@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);
|
|
@@ -604,28 +618,28 @@ var init_lit = __esm(() => {
|
|
|
604
618
|
});
|
|
605
619
|
|
|
606
620
|
// ../../node_modules/lit-html/directive-helpers.js
|
|
607
|
-
var t3, f3 = (
|
|
608
|
-
const
|
|
609
|
-
if (
|
|
610
|
-
const
|
|
611
|
-
|
|
621
|
+
var t3, f3 = (o) => o.strings === undefined, r4 = () => document.createComment(""), s4 = (o, i, n) => {
|
|
622
|
+
const e = o._$AA.parentNode, l = i === undefined ? o._$AB : i._$AA;
|
|
623
|
+
if (n === undefined) {
|
|
624
|
+
const i = e.insertBefore(r4(), l), d = e.insertBefore(r4(), l);
|
|
625
|
+
n = new t3(i, d, o, o.options);
|
|
612
626
|
} else {
|
|
613
|
-
const
|
|
614
|
-
if (
|
|
615
|
-
let
|
|
616
|
-
|
|
627
|
+
const t = n._$AB.nextSibling, i = n._$AM, d = i !== o;
|
|
628
|
+
if (d) {
|
|
629
|
+
let t;
|
|
630
|
+
n._$AQ?.(o), n._$AM = o, n._$AP !== undefined && (t = o._$AU) !== i._$AU && n._$AP(t);
|
|
617
631
|
}
|
|
618
|
-
if (
|
|
619
|
-
let
|
|
620
|
-
for (;
|
|
621
|
-
const
|
|
622
|
-
|
|
632
|
+
if (t !== l || d) {
|
|
633
|
+
let o = n._$AA;
|
|
634
|
+
for (;o !== t; ) {
|
|
635
|
+
const t = o.nextSibling;
|
|
636
|
+
e.insertBefore(o, l), o = t;
|
|
623
637
|
}
|
|
624
638
|
}
|
|
625
639
|
}
|
|
626
|
-
return
|
|
627
|
-
}, v2 = (
|
|
628
|
-
|
|
640
|
+
return n;
|
|
641
|
+
}, v2 = (o, t, i = o) => (o._$AI(t, i), o), u3, m2 = (o, t = u3) => o._$AH = t, p3 = (o) => o._$AH, M2 = (o) => {
|
|
642
|
+
o._$AR(), o._$AA.remove();
|
|
629
643
|
};
|
|
630
644
|
var init_directive_helpers = __esm(() => {
|
|
631
645
|
init_lit_html();
|
|
@@ -635,66 +649,66 @@ var init_directive_helpers = __esm(() => {
|
|
|
635
649
|
|
|
636
650
|
// ../../node_modules/lit-html/directive.js
|
|
637
651
|
class i5 {
|
|
638
|
-
constructor(
|
|
652
|
+
constructor(t) {}
|
|
639
653
|
get _$AU() {
|
|
640
654
|
return this._$AM._$AU;
|
|
641
655
|
}
|
|
642
|
-
_$AT(
|
|
643
|
-
this._$Ct =
|
|
656
|
+
_$AT(t, e, i) {
|
|
657
|
+
this._$Ct = t, this._$AM = e, this._$Ci = i;
|
|
644
658
|
}
|
|
645
|
-
_$AS(
|
|
646
|
-
return this.update(
|
|
659
|
+
_$AS(t, e) {
|
|
660
|
+
return this.update(t, e);
|
|
647
661
|
}
|
|
648
|
-
update(
|
|
649
|
-
return this.render(...
|
|
662
|
+
update(t, e) {
|
|
663
|
+
return this.render(...e);
|
|
650
664
|
}
|
|
651
665
|
}
|
|
652
|
-
var t4, e4 = (
|
|
666
|
+
var t4, e4 = (t) => (...e) => ({ _$litDirective$: t, values: e });
|
|
653
667
|
var init_directive = __esm(() => {
|
|
654
668
|
t4 = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 };
|
|
655
669
|
});
|
|
656
670
|
|
|
657
671
|
// ../../node_modules/lit-html/async-directive.js
|
|
658
|
-
function h3(
|
|
659
|
-
this._$AN !== undefined ? (o5(this), this._$AM =
|
|
660
|
-
}
|
|
661
|
-
function n4(
|
|
662
|
-
const
|
|
663
|
-
if (
|
|
664
|
-
if (
|
|
665
|
-
if (Array.isArray(
|
|
666
|
-
for (let
|
|
667
|
-
s5(
|
|
672
|
+
function h3(i) {
|
|
673
|
+
this._$AN !== undefined ? (o5(this), this._$AM = i, r5(this)) : this._$AM = i;
|
|
674
|
+
}
|
|
675
|
+
function n4(i, t = false, e = 0) {
|
|
676
|
+
const r = this._$AH, h = this._$AN;
|
|
677
|
+
if (h !== undefined && h.size !== 0)
|
|
678
|
+
if (t)
|
|
679
|
+
if (Array.isArray(r))
|
|
680
|
+
for (let i = e;i < r.length; i++)
|
|
681
|
+
s5(r[i], false), o5(r[i]);
|
|
668
682
|
else
|
|
669
|
-
|
|
683
|
+
r != null && (s5(r, false), o5(r));
|
|
670
684
|
else
|
|
671
|
-
s5(this,
|
|
685
|
+
s5(this, i);
|
|
672
686
|
}
|
|
673
|
-
var s5 = (
|
|
674
|
-
const
|
|
675
|
-
if (
|
|
687
|
+
var s5 = (i, t) => {
|
|
688
|
+
const e = i._$AN;
|
|
689
|
+
if (e === undefined)
|
|
676
690
|
return false;
|
|
677
|
-
for (const
|
|
678
|
-
|
|
691
|
+
for (const i of e)
|
|
692
|
+
i._$AO?.(t, false), s5(i, t);
|
|
679
693
|
return true;
|
|
680
|
-
}, o5 = (
|
|
681
|
-
let
|
|
694
|
+
}, o5 = (i) => {
|
|
695
|
+
let t, e;
|
|
682
696
|
do {
|
|
683
|
-
if ((
|
|
697
|
+
if ((t = i._$AM) === undefined)
|
|
684
698
|
break;
|
|
685
|
-
|
|
686
|
-
} while (
|
|
687
|
-
}, r5 = (
|
|
688
|
-
for (let
|
|
689
|
-
let
|
|
690
|
-
if (
|
|
691
|
-
|
|
692
|
-
else if (
|
|
699
|
+
e = t._$AN, e.delete(i), i = t;
|
|
700
|
+
} while (e?.size === 0);
|
|
701
|
+
}, r5 = (i) => {
|
|
702
|
+
for (let t;t = i._$AM; i = t) {
|
|
703
|
+
let e = t._$AN;
|
|
704
|
+
if (e === undefined)
|
|
705
|
+
t._$AN = e = new Set;
|
|
706
|
+
else if (e.has(i))
|
|
693
707
|
break;
|
|
694
|
-
|
|
708
|
+
e.add(i), c4(t);
|
|
695
709
|
}
|
|
696
|
-
}, c4 = (
|
|
697
|
-
|
|
710
|
+
}, c4 = (i) => {
|
|
711
|
+
i.type == t4.CHILD && (i._$AP ??= n4, i._$AQ ??= h3);
|
|
698
712
|
}, f4;
|
|
699
713
|
var init_async_directive = __esm(() => {
|
|
700
714
|
init_directive_helpers();
|
|
@@ -704,18 +718,18 @@ var init_async_directive = __esm(() => {
|
|
|
704
718
|
constructor() {
|
|
705
719
|
super(...arguments), this._$AN = undefined;
|
|
706
720
|
}
|
|
707
|
-
_$AT(
|
|
708
|
-
super._$AT(
|
|
721
|
+
_$AT(i, t, e) {
|
|
722
|
+
super._$AT(i, t, e), r5(this), this.isConnected = i._$AU;
|
|
709
723
|
}
|
|
710
|
-
_$AO(
|
|
711
|
-
|
|
724
|
+
_$AO(i, t = true) {
|
|
725
|
+
i !== this.isConnected && (this.isConnected = i, i ? this.reconnected?.() : this.disconnected?.()), t && (s5(this, i), o5(this));
|
|
712
726
|
}
|
|
713
|
-
setValue(
|
|
727
|
+
setValue(t) {
|
|
714
728
|
if (f3(this._$Ct))
|
|
715
|
-
this._$Ct._$AI(
|
|
729
|
+
this._$Ct._$AI(t, this);
|
|
716
730
|
else {
|
|
717
|
-
const
|
|
718
|
-
|
|
731
|
+
const i = [...this._$Ct._$AH];
|
|
732
|
+
i[this._$Ci] = t, this._$Ct._$AI(i, this, 0);
|
|
719
733
|
}
|
|
720
734
|
}
|
|
721
735
|
disconnected() {}
|
|
@@ -733,20 +747,20 @@ var init_ref = __esm(() => {
|
|
|
733
747
|
init_directive();
|
|
734
748
|
o6 = new WeakMap;
|
|
735
749
|
n5 = e4(class extends f4 {
|
|
736
|
-
render(
|
|
750
|
+
render(i) {
|
|
737
751
|
return E;
|
|
738
752
|
}
|
|
739
|
-
update(
|
|
740
|
-
const
|
|
741
|
-
return
|
|
753
|
+
update(i, [s]) {
|
|
754
|
+
const e = s !== this.G;
|
|
755
|
+
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;
|
|
742
756
|
}
|
|
743
|
-
rt(
|
|
744
|
-
if (this.isConnected || (
|
|
745
|
-
const
|
|
746
|
-
let
|
|
747
|
-
|
|
757
|
+
rt(t) {
|
|
758
|
+
if (this.isConnected || (t = undefined), typeof this.G == "function") {
|
|
759
|
+
const i = this.ht ?? globalThis;
|
|
760
|
+
let s = o6.get(i);
|
|
761
|
+
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);
|
|
748
762
|
} else
|
|
749
|
-
this.G.value =
|
|
763
|
+
this.G.value = t;
|
|
750
764
|
}
|
|
751
765
|
get lt() {
|
|
752
766
|
return typeof this.G == "function" ? o6.get(this.ht ?? globalThis)?.get(this.G) : this.G?.value;
|
|
@@ -770,16 +784,16 @@ function base(ALPHABET) {
|
|
|
770
784
|
throw new TypeError("Alphabet too long");
|
|
771
785
|
}
|
|
772
786
|
const BASE_MAP = new Uint8Array(256);
|
|
773
|
-
for (let
|
|
774
|
-
BASE_MAP[
|
|
787
|
+
for (let j = 0;j < BASE_MAP.length; j++) {
|
|
788
|
+
BASE_MAP[j] = 255;
|
|
775
789
|
}
|
|
776
|
-
for (let
|
|
777
|
-
const
|
|
778
|
-
const xc =
|
|
790
|
+
for (let i = 0;i < ALPHABET.length; i++) {
|
|
791
|
+
const x = ALPHABET.charAt(i);
|
|
792
|
+
const xc = x.charCodeAt(0);
|
|
779
793
|
if (BASE_MAP[xc] !== 255) {
|
|
780
|
-
throw new TypeError(
|
|
794
|
+
throw new TypeError(x + " is ambiguous");
|
|
781
795
|
}
|
|
782
|
-
BASE_MAP[xc] =
|
|
796
|
+
BASE_MAP[xc] = i;
|
|
783
797
|
}
|
|
784
798
|
const BASE = ALPHABET.length;
|
|
785
799
|
const LEADER = ALPHABET.charAt(0);
|
|
@@ -809,8 +823,8 @@ function base(ALPHABET) {
|
|
|
809
823
|
const b58 = new Uint8Array(size);
|
|
810
824
|
while (pbegin !== pend) {
|
|
811
825
|
let carry = source[pbegin];
|
|
812
|
-
let
|
|
813
|
-
for (let it1 = size - 1;(carry !== 0 ||
|
|
826
|
+
let i = 0;
|
|
827
|
+
for (let it1 = size - 1;(carry !== 0 || i < length) && it1 !== -1; it1--, i++) {
|
|
814
828
|
carry += 256 * b58[it1] >>> 0;
|
|
815
829
|
b58[it1] = carry % BASE >>> 0;
|
|
816
830
|
carry = carry / BASE >>> 0;
|
|
@@ -818,7 +832,7 @@ function base(ALPHABET) {
|
|
|
818
832
|
if (carry !== 0) {
|
|
819
833
|
throw new Error("Non-zero carry");
|
|
820
834
|
}
|
|
821
|
-
length =
|
|
835
|
+
length = i;
|
|
822
836
|
pbegin++;
|
|
823
837
|
}
|
|
824
838
|
let it2 = size - length;
|
|
@@ -856,8 +870,8 @@ function base(ALPHABET) {
|
|
|
856
870
|
if (carry === 255) {
|
|
857
871
|
return;
|
|
858
872
|
}
|
|
859
|
-
let
|
|
860
|
-
for (let it3 = size - 1;(carry !== 0 ||
|
|
873
|
+
let i = 0;
|
|
874
|
+
for (let it3 = size - 1;(carry !== 0 || i < length) && it3 !== -1; it3--, i++) {
|
|
861
875
|
carry += BASE * b256[it3] >>> 0;
|
|
862
876
|
b256[it3] = carry % 256 >>> 0;
|
|
863
877
|
carry = carry / 256 >>> 0;
|
|
@@ -865,7 +879,7 @@ function base(ALPHABET) {
|
|
|
865
879
|
if (carry !== 0) {
|
|
866
880
|
throw new Error("Non-zero carry");
|
|
867
881
|
}
|
|
868
|
-
length =
|
|
882
|
+
length = i;
|
|
869
883
|
psz++;
|
|
870
884
|
}
|
|
871
885
|
let it4 = size - length;
|
|
@@ -873,9 +887,9 @@ function base(ALPHABET) {
|
|
|
873
887
|
it4++;
|
|
874
888
|
}
|
|
875
889
|
const vch = new Uint8Array(zeroes + (size - it4));
|
|
876
|
-
let
|
|
890
|
+
let j = zeroes;
|
|
877
891
|
while (it4 !== size) {
|
|
878
|
-
vch[
|
|
892
|
+
vch[j++] = b256[it4++];
|
|
879
893
|
}
|
|
880
894
|
return vch;
|
|
881
895
|
}
|
|
@@ -915,14 +929,14 @@ var init_near = __esm(() => {
|
|
|
915
929
|
});
|
|
916
930
|
|
|
917
931
|
// ../shared-ts/src/utils/validation.ts
|
|
918
|
-
function isObject(
|
|
919
|
-
return
|
|
932
|
+
function isObject(x) {
|
|
933
|
+
return x !== null && typeof x === "object";
|
|
920
934
|
}
|
|
921
|
-
function isString(
|
|
922
|
-
return typeof
|
|
935
|
+
function isString(x) {
|
|
936
|
+
return typeof x === "string";
|
|
923
937
|
}
|
|
924
|
-
function isNumber(
|
|
925
|
-
return typeof
|
|
938
|
+
function isNumber(x) {
|
|
939
|
+
return typeof x === "number";
|
|
926
940
|
}
|
|
927
941
|
var init_validation = __esm(() => {
|
|
928
942
|
init_near();
|
|
@@ -968,11 +982,14 @@ var init_LitElementWithProps = __esm(() => {
|
|
|
968
982
|
init_lit();
|
|
969
983
|
init_validation();
|
|
970
984
|
LitElementWithProps = class LitElementWithProps extends i4 {
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
985
|
+
constructor() {
|
|
986
|
+
super(...arguments);
|
|
987
|
+
this._varsSheet = null;
|
|
988
|
+
this._varsMap = {};
|
|
989
|
+
this._appearanceVarNames = new Set;
|
|
990
|
+
this._varsDocSheet = null;
|
|
991
|
+
this._varsClassName = null;
|
|
992
|
+
}
|
|
976
993
|
static keepDefinitions;
|
|
977
994
|
static requiredChildTags;
|
|
978
995
|
static strictChildDefinitions;
|
|
@@ -992,7 +1009,6 @@ var init_LitElementWithProps = __esm(() => {
|
|
|
992
1009
|
propertyNames.forEach((prop) => this.upgradeProperty(prop));
|
|
993
1010
|
}
|
|
994
1011
|
}
|
|
995
|
-
styles;
|
|
996
1012
|
connectedCallback() {
|
|
997
1013
|
super.connectedCallback();
|
|
998
1014
|
this.upgradeAllProperties();
|
|
@@ -1004,7 +1020,7 @@ var init_LitElementWithProps = __esm(() => {
|
|
|
1004
1020
|
const { keepDefinitions, requiredChildTags, strictChildDefinitions } = ctor;
|
|
1005
1021
|
const defs = keepDefinitions;
|
|
1006
1022
|
if (defs && defs.length) {
|
|
1007
|
-
for (const
|
|
1023
|
+
for (const d of defs)
|
|
1008
1024
|
;
|
|
1009
1025
|
}
|
|
1010
1026
|
const req = requiredChildTags;
|
|
@@ -1039,7 +1055,7 @@ var init_LitElementWithProps = __esm(() => {
|
|
|
1039
1055
|
const setVar = (name, val) => {
|
|
1040
1056
|
vars[name] = val;
|
|
1041
1057
|
};
|
|
1042
|
-
const toKebab = (
|
|
1058
|
+
const toKebab = (s) => this.camelToKebab(s);
|
|
1043
1059
|
const transformViewportUnits = (val) => {
|
|
1044
1060
|
if (!val || typeof val !== "string")
|
|
1045
1061
|
return val;
|
|
@@ -1086,14 +1102,14 @@ var init_LitElementWithProps = __esm(() => {
|
|
|
1086
1102
|
setVar(colorMappings[key], maybeTransformed);
|
|
1087
1103
|
return;
|
|
1088
1104
|
}
|
|
1089
|
-
const
|
|
1090
|
-
if (
|
|
1091
|
-
setVar(`--w3a-border-radius-${
|
|
1105
|
+
const r = key.match(radiusMatcher);
|
|
1106
|
+
if (r) {
|
|
1107
|
+
setVar(`--w3a-border-radius-${r[1].toLowerCase()}`, maybeTransformed);
|
|
1092
1108
|
return;
|
|
1093
1109
|
}
|
|
1094
|
-
const
|
|
1095
|
-
if (
|
|
1096
|
-
setVar(`--w3a-shadows-${
|
|
1110
|
+
const s = key.match(shadowMatcher);
|
|
1111
|
+
if (s) {
|
|
1112
|
+
setVar(`--w3a-shadows-${s[1].toLowerCase()}`, maybeTransformed);
|
|
1097
1113
|
return;
|
|
1098
1114
|
}
|
|
1099
1115
|
setVar(`--w3a-${toKebab(key)}`, maybeTransformed);
|
|
@@ -1104,8 +1120,8 @@ var init_LitElementWithProps = __esm(() => {
|
|
|
1104
1120
|
const kebabSection = toKebab(section);
|
|
1105
1121
|
const kebabProp = toKebab(prop);
|
|
1106
1122
|
const cssVarNew = `--w3a-${prefix}__${kebabSection}__${kebabProp}`;
|
|
1107
|
-
const
|
|
1108
|
-
vars[cssVarNew] =
|
|
1123
|
+
const v = typeof value === "string" ? transformViewportUnits(value) : String(value);
|
|
1124
|
+
vars[cssVarNew] = v;
|
|
1109
1125
|
});
|
|
1110
1126
|
}
|
|
1111
1127
|
});
|
|
@@ -1116,12 +1132,12 @@ var init_LitElementWithProps = __esm(() => {
|
|
|
1116
1132
|
}
|
|
1117
1133
|
setCssVars(vars) {
|
|
1118
1134
|
try {
|
|
1119
|
-
for (const [
|
|
1120
|
-
if (
|
|
1135
|
+
for (const [k, v] of Object.entries(vars)) {
|
|
1136
|
+
if (v == null)
|
|
1121
1137
|
continue;
|
|
1122
|
-
this._varsMap[
|
|
1138
|
+
this._varsMap[k] = String(v);
|
|
1123
1139
|
}
|
|
1124
|
-
const decls = Object.entries(this._varsMap).map(([
|
|
1140
|
+
const decls = Object.entries(this._varsMap).map(([k, v]) => `${k}: ${v};`).join(" ");
|
|
1125
1141
|
const cssTextShadow = `:host{ ${decls} }`;
|
|
1126
1142
|
const canUseConstructable = supportsConstructableStylesheets();
|
|
1127
1143
|
if (this.renderRoot instanceof ShadowRoot && canUseConstructable && hasAdoptedStyleSheets(this.renderRoot)) {
|
|
@@ -1221,16 +1237,16 @@ var init_lit_events = __esm(() => {
|
|
|
1221
1237
|
});
|
|
1222
1238
|
|
|
1223
1239
|
// src/core/signingEngine/uiConfirm/ui/lit-components/asset-base.ts
|
|
1224
|
-
function withTrailingSlash(
|
|
1225
|
-
return
|
|
1240
|
+
function withTrailingSlash(s) {
|
|
1241
|
+
return s.endsWith("/") ? s : s + "/";
|
|
1226
1242
|
}
|
|
1227
1243
|
function readGlobalEmbeddedBase() {
|
|
1228
1244
|
try {
|
|
1229
1245
|
if (typeof window === "undefined")
|
|
1230
1246
|
return;
|
|
1231
|
-
const
|
|
1232
|
-
if (typeof
|
|
1233
|
-
return withTrailingSlash(
|
|
1247
|
+
const v = window.__W3A_WALLET_SDK_BASE__;
|
|
1248
|
+
if (typeof v === "string" && v.length > 0)
|
|
1249
|
+
return withTrailingSlash(v);
|
|
1234
1250
|
} catch {}
|
|
1235
1251
|
return;
|
|
1236
1252
|
}
|
|
@@ -1239,14 +1255,14 @@ function deriveFromModuleUrl() {
|
|
|
1239
1255
|
const moduleUrl = String(import.meta.url || "").trim();
|
|
1240
1256
|
if (!moduleUrl)
|
|
1241
1257
|
return;
|
|
1242
|
-
const
|
|
1243
|
-
const
|
|
1244
|
-
const href =
|
|
1258
|
+
const base = typeof window !== "undefined" ? window.location.href : undefined;
|
|
1259
|
+
const u = base ? new URL(moduleUrl, base) : new URL(moduleUrl);
|
|
1260
|
+
const href = u.toString();
|
|
1245
1261
|
const idx = href.indexOf(SDK_SEGMENT);
|
|
1246
1262
|
if (idx > 0) {
|
|
1247
1263
|
return withTrailingSlash(href.slice(0, idx + SDK_SEGMENT.length));
|
|
1248
1264
|
}
|
|
1249
|
-
const origin =
|
|
1265
|
+
const origin = u.origin;
|
|
1250
1266
|
if (origin && /^https?:/i.test(origin)) {
|
|
1251
1267
|
return withTrailingSlash(origin + "/sdk");
|
|
1252
1268
|
}
|
|
@@ -1260,22 +1276,22 @@ var SDK_SEGMENT = "/sdk/";
|
|
|
1260
1276
|
|
|
1261
1277
|
// src/core/signingEngine/uiConfirm/ui/lit-components/css/css-loader.ts
|
|
1262
1278
|
function resolveStylesheetUrl(assetName) {
|
|
1263
|
-
const
|
|
1264
|
-
const join = (
|
|
1265
|
-
if (/^https?:/i.test(
|
|
1266
|
-
return `${join(
|
|
1279
|
+
const base = resolveEmbeddedBase();
|
|
1280
|
+
const join = (s) => s.endsWith("/") ? s : s + "/";
|
|
1281
|
+
if (/^https?:/i.test(base))
|
|
1282
|
+
return `${join(base)}${assetName}`;
|
|
1267
1283
|
try {
|
|
1268
1284
|
if (!warnedRelativeBaseOnce && typeof document !== "undefined" && document.URL === "about:srcdoc") {
|
|
1269
1285
|
warnedRelativeBaseOnce = true;
|
|
1270
|
-
console.warn(`[W3A][css-loader] Embedded SDK base is relative: "${
|
|
1286
|
+
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" } }, `);
|
|
1271
1287
|
}
|
|
1272
1288
|
} catch {}
|
|
1273
1289
|
const origin = typeof window !== "undefined" && window.location ? window.location.origin : "";
|
|
1274
1290
|
if (origin && origin !== "null" && /^https?:/i.test(origin)) {
|
|
1275
|
-
const prefix =
|
|
1291
|
+
const prefix = base.startsWith("/") ? base : `/${base}`;
|
|
1276
1292
|
return `${join(origin + prefix)}${assetName}`;
|
|
1277
1293
|
}
|
|
1278
|
-
const normalized =
|
|
1294
|
+
const normalized = base.startsWith("/") ? base : `/${base}`;
|
|
1279
1295
|
return `${join(normalized)}${assetName}`;
|
|
1280
1296
|
}
|
|
1281
1297
|
function getDoc(root) {
|
|
@@ -1321,9 +1337,9 @@ async function adoptConstructable(root, assetName) {
|
|
|
1321
1337
|
if (!res.ok)
|
|
1322
1338
|
return null;
|
|
1323
1339
|
const cssText = await res.text();
|
|
1324
|
-
const
|
|
1325
|
-
|
|
1326
|
-
return
|
|
1340
|
+
const sheet = new CSSStyleSheet;
|
|
1341
|
+
sheet.replaceSync(cssText);
|
|
1342
|
+
return sheet;
|
|
1327
1343
|
} catch {
|
|
1328
1344
|
return null;
|
|
1329
1345
|
}
|
|
@@ -1373,8 +1389,8 @@ var init_css_loader = __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;
|
|
@@ -2179,7 +2190,7 @@ function renderCopyStatusIcon() {
|
|
|
2179
2190
|
function settlingState(state, maskedTarget, startedAtMs) {
|
|
2180
2191
|
const prefix = maskedTarget.startsWith(state.prefix) ? state.prefix : "";
|
|
2181
2192
|
const targetSlots = Array.from(maskedTarget.slice(prefix.length));
|
|
2182
|
-
const slots = targetSlots.length === state.slots.length ? state.slots : targetSlots.map((
|
|
2193
|
+
const slots = targetSlots.length === state.slots.length ? state.slots : targetSlots.map((_, index) => ({
|
|
2183
2194
|
glyph: randomReelGlyph(state.alphabet),
|
|
2184
2195
|
nextChangeAtMs: startedAtMs + index * 37 % 90
|
|
2185
2196
|
}));
|
|
@@ -2305,15 +2316,38 @@ var init_viewer = __esm(() => {
|
|
|
2305
2316
|
errorMessage: { type: String },
|
|
2306
2317
|
showCloseButton: { type: Boolean, attribute: "show-close-button" }
|
|
2307
2318
|
};
|
|
2308
|
-
copiedFields = new Set;
|
|
2309
|
-
copyTimers = new Map;
|
|
2310
|
-
revealStates = new Map;
|
|
2311
|
-
revealAnimationFrame = null;
|
|
2312
|
-
_stylesReady = false;
|
|
2313
|
-
_stylePromises = [];
|
|
2314
|
-
_stylesAwaiting = null;
|
|
2315
2319
|
constructor() {
|
|
2316
2320
|
super();
|
|
2321
|
+
this.copiedFields = new Set;
|
|
2322
|
+
this.copyTimers = new Map;
|
|
2323
|
+
this.revealStates = new Map;
|
|
2324
|
+
this.revealAnimationFrame = null;
|
|
2325
|
+
this._stylesReady = false;
|
|
2326
|
+
this._stylePromises = [];
|
|
2327
|
+
this._stylesAwaiting = null;
|
|
2328
|
+
this.onRevealAnimationFrame = (now) => {
|
|
2329
|
+
this.revealAnimationFrame = null;
|
|
2330
|
+
if (this.ownerDocument?.hidden) {
|
|
2331
|
+
this.scheduleRevealAnimation();
|
|
2332
|
+
return;
|
|
2333
|
+
}
|
|
2334
|
+
let changed = false;
|
|
2335
|
+
for (const [entryKey, state] of this.revealStates) {
|
|
2336
|
+
if (state.kind === "settled")
|
|
2337
|
+
continue;
|
|
2338
|
+
const nextState = advanceRevealState(state, now);
|
|
2339
|
+
if (nextState !== state) {
|
|
2340
|
+
this.revealStates.set(entryKey, nextState);
|
|
2341
|
+
changed = true;
|
|
2342
|
+
}
|
|
2343
|
+
}
|
|
2344
|
+
if (changed)
|
|
2345
|
+
this.requestUpdate();
|
|
2346
|
+
this.scheduleRevealAnimation();
|
|
2347
|
+
};
|
|
2348
|
+
this._stopDragStart = (e) => {
|
|
2349
|
+
e.stopPropagation();
|
|
2350
|
+
};
|
|
2317
2351
|
this.theme = "dark";
|
|
2318
2352
|
this.variant = "drawer";
|
|
2319
2353
|
this.keys = undefined;
|
|
@@ -2325,27 +2359,27 @@ var init_viewer = __esm(() => {
|
|
|
2325
2359
|
return "export";
|
|
2326
2360
|
}
|
|
2327
2361
|
createRenderRoot() {
|
|
2328
|
-
const
|
|
2329
|
-
const root =
|
|
2362
|
+
const supportsConstructable = typeof ShadowRoot !== "undefined" && "adoptedStyleSheets" in ShadowRoot.prototype && typeof CSSStyleSheet !== "undefined" && "replaceSync" in CSSStyleSheet.prototype;
|
|
2363
|
+
const root = supportsConstructable ? super.createRenderRoot() : this;
|
|
2330
2364
|
const p1 = ensureExternalStyles(root, "export-viewer.css", "data-w3a-export-viewer-css");
|
|
2331
2365
|
this._stylePromises.push(p1);
|
|
2332
2366
|
p1.catch(() => {});
|
|
2333
2367
|
const pCopyIcon = ensureExternalStyles(root, "copy-icon.css", "data-w3a-copy-icon-css");
|
|
2334
2368
|
this._stylePromises.push(pCopyIcon);
|
|
2335
2369
|
pCopyIcon.catch(() => {});
|
|
2336
|
-
const
|
|
2337
|
-
this._stylePromises.push(
|
|
2338
|
-
|
|
2339
|
-
const
|
|
2340
|
-
this._stylePromises.push(
|
|
2341
|
-
|
|
2370
|
+
const p2 = ensureExternalStyles(root, "w3a-components.css", "data-w3a-components-css");
|
|
2371
|
+
this._stylePromises.push(p2);
|
|
2372
|
+
p2.catch(() => {});
|
|
2373
|
+
const p3 = ensureExternalStyles(root, "drawer.css", "data-w3a-drawer-css");
|
|
2374
|
+
this._stylePromises.push(p3);
|
|
2375
|
+
p3.catch(() => {});
|
|
2342
2376
|
return root;
|
|
2343
2377
|
}
|
|
2344
2378
|
shouldUpdate(_changed) {
|
|
2345
2379
|
if (this._stylesReady)
|
|
2346
2380
|
return true;
|
|
2347
2381
|
if (!this._stylesAwaiting) {
|
|
2348
|
-
const settle = Promise.all(this._stylePromises).then(() => new Promise((
|
|
2382
|
+
const settle = Promise.all(this._stylePromises).then(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r()))));
|
|
2349
2383
|
this._stylesAwaiting = settle.then(() => {
|
|
2350
2384
|
this._stylesReady = true;
|
|
2351
2385
|
this.requestUpdate();
|
|
@@ -2380,26 +2414,6 @@ var init_viewer = __esm(() => {
|
|
|
2380
2414
|
this.resetRevealStates();
|
|
2381
2415
|
super.disconnectedCallback();
|
|
2382
2416
|
}
|
|
2383
|
-
onRevealAnimationFrame = (now) => {
|
|
2384
|
-
this.revealAnimationFrame = null;
|
|
2385
|
-
if (this.ownerDocument?.hidden) {
|
|
2386
|
-
this.scheduleRevealAnimation();
|
|
2387
|
-
return;
|
|
2388
|
-
}
|
|
2389
|
-
let changed = false;
|
|
2390
|
-
for (const [entryKey, state] of this.revealStates) {
|
|
2391
|
-
if (state.kind === "settled")
|
|
2392
|
-
continue;
|
|
2393
|
-
const nextState = advanceRevealState(state, now);
|
|
2394
|
-
if (nextState !== state) {
|
|
2395
|
-
this.revealStates.set(entryKey, nextState);
|
|
2396
|
-
changed = true;
|
|
2397
|
-
}
|
|
2398
|
-
}
|
|
2399
|
-
if (changed)
|
|
2400
|
-
this.requestUpdate();
|
|
2401
|
-
this.scheduleRevealAnimation();
|
|
2402
|
-
};
|
|
2403
2417
|
scheduleRevealAnimation() {
|
|
2404
2418
|
if (this.revealAnimationFrame !== null || prefersReducedMotion(this.ownerDocument))
|
|
2405
2419
|
return;
|
|
@@ -2456,9 +2470,6 @@ var init_viewer = __esm(() => {
|
|
|
2456
2470
|
}
|
|
2457
2471
|
this.scheduleRevealAnimation();
|
|
2458
2472
|
}
|
|
2459
|
-
_stopDragStart = (e6) => {
|
|
2460
|
-
e6.stopPropagation();
|
|
2461
|
-
};
|
|
2462
2473
|
updateTheme() {
|
|
2463
2474
|
try {
|
|
2464
2475
|
const docEl = this.ownerDocument?.documentElement;
|
|
@@ -2506,8 +2517,8 @@ var init_viewer = __esm(() => {
|
|
|
2506
2517
|
}
|
|
2507
2518
|
this.markCopied(index, type);
|
|
2508
2519
|
this.requestUpdate();
|
|
2509
|
-
} catch (
|
|
2510
|
-
console.warn("Copy failed",
|
|
2520
|
+
} catch (e) {
|
|
2521
|
+
console.warn("Copy failed", e);
|
|
2511
2522
|
}
|
|
2512
2523
|
}
|
|
2513
2524
|
copyViaTextareaFallback(text) {
|
|
@@ -2560,9 +2571,9 @@ var init_viewer = __esm(() => {
|
|
|
2560
2571
|
const provided = Array.isArray(this.keys) ? this.keys.filter((item) => {
|
|
2561
2572
|
if (!item || typeof item !== "object")
|
|
2562
2573
|
return false;
|
|
2563
|
-
const
|
|
2564
|
-
const
|
|
2565
|
-
return !!
|
|
2574
|
+
const publicKey = String(item.publicKey || "").trim();
|
|
2575
|
+
const privateKey = String(item.privateKey || "").trim();
|
|
2576
|
+
return !!publicKey || !!privateKey;
|
|
2566
2577
|
}) : [];
|
|
2567
2578
|
if (provided.length > 0)
|
|
2568
2579
|
return provided;
|
|
@@ -2705,8 +2716,8 @@ function declarationsToCssText(selector, declarations) {
|
|
|
2705
2716
|
function getDefaultCspNonce() {
|
|
2706
2717
|
if (typeof window === "undefined")
|
|
2707
2718
|
return;
|
|
2708
|
-
const
|
|
2709
|
-
return
|
|
2719
|
+
const w = window;
|
|
2720
|
+
return w.w3aNonce || w.litNonce || undefined;
|
|
2710
2721
|
}
|
|
2711
2722
|
function createCspStylesheetManager(opts) {
|
|
2712
2723
|
const { doc, baseCss, baseStyleDataAttr, dynamicStyleDataAttr, nonce } = opts;
|
|
@@ -2725,7 +2736,7 @@ function createCspStylesheetManager(opts) {
|
|
|
2725
2736
|
return;
|
|
2726
2737
|
return typeof nonce === "function" ? nonce() : nonce;
|
|
2727
2738
|
};
|
|
2728
|
-
const
|
|
2739
|
+
const supportsConstructable = () => {
|
|
2729
2740
|
if (state.supportConstructable != null)
|
|
2730
2741
|
return state.supportConstructable;
|
|
2731
2742
|
state.supportConstructable = typeof CSSStyleSheet !== "undefined" && "adoptedStyleSheets" in doc;
|
|
@@ -2765,7 +2776,7 @@ function createCspStylesheetManager(opts) {
|
|
|
2765
2776
|
const ensureBase = () => {
|
|
2766
2777
|
if (state.baseSheet || state.baseStyleEl)
|
|
2767
2778
|
return;
|
|
2768
|
-
if (
|
|
2779
|
+
if (supportsConstructable()) {
|
|
2769
2780
|
try {
|
|
2770
2781
|
state.baseSheet = new CSSStyleSheet;
|
|
2771
2782
|
state.baseSheet.replaceSync(baseCss);
|
|
@@ -2783,7 +2794,7 @@ function createCspStylesheetManager(opts) {
|
|
|
2783
2794
|
const buildDynamicCss = () => Array.from(state.rules.values()).join(`
|
|
2784
2795
|
`);
|
|
2785
2796
|
const ensureDynamic = () => {
|
|
2786
|
-
if (
|
|
2797
|
+
if (supportsConstructable()) {
|
|
2787
2798
|
if (!state.dynamicSheet) {
|
|
2788
2799
|
state.dynamicSheet = new CSSStyleSheet;
|
|
2789
2800
|
adoptSheets([state.dynamicSheet]);
|
|
@@ -2798,7 +2809,7 @@ function createCspStylesheetManager(opts) {
|
|
|
2798
2809
|
};
|
|
2799
2810
|
const syncDynamic = () => {
|
|
2800
2811
|
const css = buildDynamicCss();
|
|
2801
|
-
if (
|
|
2812
|
+
if (supportsConstructable()) {
|
|
2802
2813
|
try {
|
|
2803
2814
|
ensureDynamic();
|
|
2804
2815
|
state.dynamicSheet?.replaceSync(css);
|
|
@@ -2817,7 +2828,7 @@ function createCspStylesheetManager(opts) {
|
|
|
2817
2828
|
const existing = state.declarationRules.get(id);
|
|
2818
2829
|
if (existing && existing.selector === selector)
|
|
2819
2830
|
return existing.rule;
|
|
2820
|
-
if (!
|
|
2831
|
+
if (!supportsConstructable())
|
|
2821
2832
|
return null;
|
|
2822
2833
|
try {
|
|
2823
2834
|
if (!state.declarationSheet) {
|
|
@@ -2826,9 +2837,9 @@ function createCspStylesheetManager(opts) {
|
|
|
2826
2837
|
}
|
|
2827
2838
|
const sheet = state.declarationSheet;
|
|
2828
2839
|
if (existing) {
|
|
2829
|
-
const
|
|
2830
|
-
if (
|
|
2831
|
-
sheet.deleteRule(
|
|
2840
|
+
const index = Array.prototype.indexOf.call(sheet.cssRules, existing.rule);
|
|
2841
|
+
if (index >= 0)
|
|
2842
|
+
sheet.deleteRule(index);
|
|
2832
2843
|
state.declarationRules.delete(id);
|
|
2833
2844
|
}
|
|
2834
2845
|
const index = sheet.insertRule(`${selector}{}`, sheet.cssRules.length);
|
|
@@ -2918,8 +2929,8 @@ function createCspStylesheetManager(opts) {
|
|
|
2918
2929
|
// src/core/signingEngine/uiConfirm/ui/lit-components/ExportPrivateKey/iframe-host.ts
|
|
2919
2930
|
var exports_iframe_host = {};
|
|
2920
2931
|
__export(exports_iframe_host, {
|
|
2921
|
-
|
|
2922
|
-
|
|
2932
|
+
IframeExportHost: () => IframeExportHost,
|
|
2933
|
+
default: () => iframe_host_default
|
|
2923
2934
|
});
|
|
2924
2935
|
function getExportTokenStyleManager() {
|
|
2925
2936
|
if (!exportTokenStyleManager) {
|
|
@@ -2936,9 +2947,9 @@ function toStringRecord(value) {
|
|
|
2936
2947
|
if (!value || typeof value !== "object")
|
|
2937
2948
|
return {};
|
|
2938
2949
|
const out = {};
|
|
2939
|
-
for (const [
|
|
2940
|
-
if (typeof
|
|
2941
|
-
out[
|
|
2950
|
+
for (const [k, v] of Object.entries(value)) {
|
|
2951
|
+
if (typeof v === "string")
|
|
2952
|
+
out[k] = v;
|
|
2942
2953
|
}
|
|
2943
2954
|
return out;
|
|
2944
2955
|
}
|
|
@@ -3020,13 +3031,13 @@ var init_iframe_host = __esm(() => {
|
|
|
3020
3031
|
errorMessage: { type: String },
|
|
3021
3032
|
surface: { type: String, attribute: "data-w3a-export-surface", reflect: false }
|
|
3022
3033
|
};
|
|
3023
|
-
drawerEl = null;
|
|
3024
|
-
viewerEl = null;
|
|
3025
|
-
openFrame = null;
|
|
3026
|
-
stylesReady = false;
|
|
3027
|
-
stylePromise = null;
|
|
3028
3034
|
constructor() {
|
|
3029
3035
|
super();
|
|
3036
|
+
this.drawerEl = null;
|
|
3037
|
+
this.viewerEl = null;
|
|
3038
|
+
this.openFrame = null;
|
|
3039
|
+
this.stylesReady = false;
|
|
3040
|
+
this.stylePromise = null;
|
|
3030
3041
|
this.theme = "dark";
|
|
3031
3042
|
this.variant = "drawer";
|
|
3032
3043
|
this.accountId = "";
|
|
@@ -3247,13 +3258,98 @@ var init_viewer2 = __esm(() => {
|
|
|
3247
3258
|
statusMessage: { state: true },
|
|
3248
3259
|
copied: { state: true }
|
|
3249
3260
|
};
|
|
3250
|
-
experience = { kind: "unconfigured" };
|
|
3251
|
-
loadGeneration = 0;
|
|
3252
|
-
copiedResetTimer = null;
|
|
3253
|
-
stylesReady = false;
|
|
3254
|
-
stylePromise = null;
|
|
3255
3261
|
constructor() {
|
|
3256
3262
|
super();
|
|
3263
|
+
this.experience = { kind: "unconfigured" };
|
|
3264
|
+
this.loadGeneration = 0;
|
|
3265
|
+
this.copiedResetTimer = null;
|
|
3266
|
+
this.stylesReady = false;
|
|
3267
|
+
this.stylePromise = null;
|
|
3268
|
+
this.retryStatus = () => {
|
|
3269
|
+
if (this.experience.kind !== "account_menu")
|
|
3270
|
+
return;
|
|
3271
|
+
const generation = this.loadGeneration + 1;
|
|
3272
|
+
this.loadGeneration = generation;
|
|
3273
|
+
const current = this.viewState;
|
|
3274
|
+
if (current.kind !== "summary")
|
|
3275
|
+
return;
|
|
3276
|
+
this.viewState = { ...current, loadState: { kind: "loading" }, actionError: null };
|
|
3277
|
+
this.loadSummaryStatus(this.experience, generation);
|
|
3278
|
+
};
|
|
3279
|
+
this.openRecoveryCodes = async () => {
|
|
3280
|
+
if (this.experience.kind !== "account_menu" || this.viewState.kind !== "summary")
|
|
3281
|
+
return;
|
|
3282
|
+
const generation = this.loadGeneration;
|
|
3283
|
+
const summary = this.viewState;
|
|
3284
|
+
this.viewState = { ...summary, kind: "opening", actionError: null };
|
|
3285
|
+
try {
|
|
3286
|
+
const request = await this.experience.loadPendingBackup();
|
|
3287
|
+
if (generation !== this.loadGeneration)
|
|
3288
|
+
return;
|
|
3289
|
+
if (!request) {
|
|
3290
|
+
this.viewState = {
|
|
3291
|
+
...summary,
|
|
3292
|
+
actionError: "Recovery codes are no longer available on this device."
|
|
3293
|
+
};
|
|
3294
|
+
return;
|
|
3295
|
+
}
|
|
3296
|
+
this.viewState = { kind: "recovery_codes", request };
|
|
3297
|
+
await this.updateComplete;
|
|
3298
|
+
await new Promise(requestAnimationFrame);
|
|
3299
|
+
this.querySelector("#w3a-wallet-recovery-title")?.focus();
|
|
3300
|
+
} catch (error) {
|
|
3301
|
+
if (generation !== this.loadGeneration)
|
|
3302
|
+
return;
|
|
3303
|
+
this.viewState = {
|
|
3304
|
+
...summary,
|
|
3305
|
+
actionError: errorMessage(error, "Could not open recovery codes")
|
|
3306
|
+
};
|
|
3307
|
+
}
|
|
3308
|
+
};
|
|
3309
|
+
this.closeSummary = () => {
|
|
3310
|
+
this.dispatchClose({ kind: "dismissed" });
|
|
3311
|
+
};
|
|
3312
|
+
this.download = () => {
|
|
3313
|
+
if (this.viewState.kind !== "recovery_codes")
|
|
3314
|
+
return;
|
|
3315
|
+
const { walletId, recoveryCodes } = this.viewState.request;
|
|
3316
|
+
try {
|
|
3317
|
+
const url = URL.createObjectURL(new Blob([backupText(walletId, recoveryCodes)], {
|
|
3318
|
+
type: "text/plain;charset=utf-8"
|
|
3319
|
+
}));
|
|
3320
|
+
const anchor = document.createElement("a");
|
|
3321
|
+
anchor.href = url;
|
|
3322
|
+
anchor.download = `seams-wallet-recovery-codes-${safeWalletId(walletId)}.txt`;
|
|
3323
|
+
try {
|
|
3324
|
+
anchor.click();
|
|
3325
|
+
} finally {
|
|
3326
|
+
window.setTimeout(URL.revokeObjectURL.bind(URL, url), 0);
|
|
3327
|
+
}
|
|
3328
|
+
this.statusMessage = "Recovery codes downloaded.";
|
|
3329
|
+
} catch {
|
|
3330
|
+
this.statusMessage = "Unable to download the codes. Copy them or try again.";
|
|
3331
|
+
}
|
|
3332
|
+
};
|
|
3333
|
+
this.copy = async () => {
|
|
3334
|
+
if (this.viewState.kind !== "recovery_codes")
|
|
3335
|
+
return;
|
|
3336
|
+
const { walletId, recoveryCodes } = this.viewState.request;
|
|
3337
|
+
try {
|
|
3338
|
+
await navigator.clipboard.writeText(backupText(walletId, recoveryCodes));
|
|
3339
|
+
this.statusMessage = "Recovery codes copied.";
|
|
3340
|
+
this.flashCopied();
|
|
3341
|
+
} catch {
|
|
3342
|
+
this.statusMessage = "Unable to copy the codes. Download them or try again.";
|
|
3343
|
+
}
|
|
3344
|
+
};
|
|
3345
|
+
this.onAcknowledgementChange = (event) => {
|
|
3346
|
+
const input = event.target;
|
|
3347
|
+
if (input instanceof HTMLInputElement)
|
|
3348
|
+
this.acknowledged = input.checked;
|
|
3349
|
+
};
|
|
3350
|
+
this.closeRecoveryCodes = () => {
|
|
3351
|
+
this.dispatchClose({ kind: "recovery_codes", acknowledged: this.acknowledged });
|
|
3352
|
+
};
|
|
3257
3353
|
this.viewState = { kind: "unconfigured" };
|
|
3258
3354
|
this.acknowledged = false;
|
|
3259
3355
|
this.statusMessage = "";
|
|
@@ -3379,50 +3475,6 @@ var init_viewer2 = __esm(() => {
|
|
|
3379
3475
|
assertNever2(this.viewState);
|
|
3380
3476
|
}
|
|
3381
3477
|
}
|
|
3382
|
-
retryStatus = () => {
|
|
3383
|
-
if (this.experience.kind !== "account_menu")
|
|
3384
|
-
return;
|
|
3385
|
-
const generation = this.loadGeneration + 1;
|
|
3386
|
-
this.loadGeneration = generation;
|
|
3387
|
-
const current = this.viewState;
|
|
3388
|
-
if (current.kind !== "summary")
|
|
3389
|
-
return;
|
|
3390
|
-
this.viewState = { ...current, loadState: { kind: "loading" }, actionError: null };
|
|
3391
|
-
this.loadSummaryStatus(this.experience, generation);
|
|
3392
|
-
};
|
|
3393
|
-
openRecoveryCodes = async () => {
|
|
3394
|
-
if (this.experience.kind !== "account_menu" || this.viewState.kind !== "summary")
|
|
3395
|
-
return;
|
|
3396
|
-
const generation = this.loadGeneration;
|
|
3397
|
-
const summary = this.viewState;
|
|
3398
|
-
this.viewState = { ...summary, kind: "opening", actionError: null };
|
|
3399
|
-
try {
|
|
3400
|
-
const request = await this.experience.loadPendingBackup();
|
|
3401
|
-
if (generation !== this.loadGeneration)
|
|
3402
|
-
return;
|
|
3403
|
-
if (!request) {
|
|
3404
|
-
this.viewState = {
|
|
3405
|
-
...summary,
|
|
3406
|
-
actionError: "Recovery codes are no longer available on this device."
|
|
3407
|
-
};
|
|
3408
|
-
return;
|
|
3409
|
-
}
|
|
3410
|
-
this.viewState = { kind: "recovery_codes", request };
|
|
3411
|
-
await this.updateComplete;
|
|
3412
|
-
await new Promise(requestAnimationFrame);
|
|
3413
|
-
this.querySelector("#w3a-wallet-recovery-title")?.focus();
|
|
3414
|
-
} catch (error) {
|
|
3415
|
-
if (generation !== this.loadGeneration)
|
|
3416
|
-
return;
|
|
3417
|
-
this.viewState = {
|
|
3418
|
-
...summary,
|
|
3419
|
-
actionError: errorMessage(error, "Could not open recovery codes")
|
|
3420
|
-
};
|
|
3421
|
-
}
|
|
3422
|
-
};
|
|
3423
|
-
closeSummary = () => {
|
|
3424
|
-
this.dispatchClose({ kind: "dismissed" });
|
|
3425
|
-
};
|
|
3426
3478
|
dispatchClose(detail) {
|
|
3427
3479
|
this.dispatchEvent(new CustomEvent(RECOVERY_BACKUP_CLOSE_EVENT, {
|
|
3428
3480
|
detail,
|
|
@@ -3430,39 +3482,6 @@ var init_viewer2 = __esm(() => {
|
|
|
3430
3482
|
composed: true
|
|
3431
3483
|
}));
|
|
3432
3484
|
}
|
|
3433
|
-
download = () => {
|
|
3434
|
-
if (this.viewState.kind !== "recovery_codes")
|
|
3435
|
-
return;
|
|
3436
|
-
const { walletId, recoveryCodes } = this.viewState.request;
|
|
3437
|
-
try {
|
|
3438
|
-
const url = URL.createObjectURL(new Blob([backupText(walletId, recoveryCodes)], {
|
|
3439
|
-
type: "text/plain;charset=utf-8"
|
|
3440
|
-
}));
|
|
3441
|
-
const anchor = document.createElement("a");
|
|
3442
|
-
anchor.href = url;
|
|
3443
|
-
anchor.download = `seams-wallet-recovery-codes-${safeWalletId(walletId)}.txt`;
|
|
3444
|
-
try {
|
|
3445
|
-
anchor.click();
|
|
3446
|
-
} finally {
|
|
3447
|
-
window.setTimeout(URL.revokeObjectURL.bind(URL, url), 0);
|
|
3448
|
-
}
|
|
3449
|
-
this.statusMessage = "Recovery codes downloaded.";
|
|
3450
|
-
} catch {
|
|
3451
|
-
this.statusMessage = "Unable to download the codes. Copy them or try again.";
|
|
3452
|
-
}
|
|
3453
|
-
};
|
|
3454
|
-
copy = async () => {
|
|
3455
|
-
if (this.viewState.kind !== "recovery_codes")
|
|
3456
|
-
return;
|
|
3457
|
-
const { walletId, recoveryCodes } = this.viewState.request;
|
|
3458
|
-
try {
|
|
3459
|
-
await navigator.clipboard.writeText(backupText(walletId, recoveryCodes));
|
|
3460
|
-
this.statusMessage = "Recovery codes copied.";
|
|
3461
|
-
this.flashCopied();
|
|
3462
|
-
} catch {
|
|
3463
|
-
this.statusMessage = "Unable to copy the codes. Download them or try again.";
|
|
3464
|
-
}
|
|
3465
|
-
};
|
|
3466
3485
|
flashCopied() {
|
|
3467
3486
|
if (this.copiedResetTimer !== null)
|
|
3468
3487
|
window.clearTimeout(this.copiedResetTimer);
|
|
@@ -3472,14 +3491,6 @@ var init_viewer2 = __esm(() => {
|
|
|
3472
3491
|
this.copied = false;
|
|
3473
3492
|
}, COPIED_FLASH_MS);
|
|
3474
3493
|
}
|
|
3475
|
-
onAcknowledgementChange = (event) => {
|
|
3476
|
-
const input = event.target;
|
|
3477
|
-
if (input instanceof HTMLInputElement)
|
|
3478
|
-
this.acknowledged = input.checked;
|
|
3479
|
-
};
|
|
3480
|
-
closeRecoveryCodes = () => {
|
|
3481
|
-
this.dispatchClose({ kind: "recovery_codes", acknowledged: this.acknowledged });
|
|
3482
|
-
};
|
|
3483
3494
|
closeLabel(request) {
|
|
3484
3495
|
if (this.acknowledged)
|
|
3485
3496
|
return "Finish backup";
|
|
@@ -3627,8 +3638,8 @@ var init_viewer2 = __esm(() => {
|
|
|
3627
3638
|
// src/core/signingEngine/uiConfirm/ui/lit-components/RecoveryCodeBackup/host.ts
|
|
3628
3639
|
var exports_host = {};
|
|
3629
3640
|
__export(exports_host, {
|
|
3630
|
-
|
|
3631
|
-
|
|
3641
|
+
RecoveryCodeBackupHost: () => RecoveryCodeBackupHost,
|
|
3642
|
+
default: () => host_default
|
|
3632
3643
|
});
|
|
3633
3644
|
var RecoveryCodeBackupHost, host_default;
|
|
3634
3645
|
var init_host = __esm(() => {
|
|
@@ -3644,24 +3655,22 @@ var init_host = __esm(() => {
|
|
|
3644
3655
|
experience: { attribute: false },
|
|
3645
3656
|
surface: { type: String }
|
|
3646
3657
|
};
|
|
3647
|
-
dialogEl = null;
|
|
3648
|
-
viewerEl = null;
|
|
3649
|
-
shown = false;
|
|
3650
|
-
dialogShown;
|
|
3651
|
-
resolveDialogShown;
|
|
3652
|
-
handleCancel = (event) => {
|
|
3653
|
-
event.preventDefault();
|
|
3654
|
-
this.dispatchEvent(new CustomEvent(RECOVERY_BACKUP_CANCEL_EVENT, { bubbles: true, composed: true }));
|
|
3655
|
-
};
|
|
3656
|
-
handleStageChange = (event) => {
|
|
3657
|
-
const dialog = event.currentTarget;
|
|
3658
|
-
if (!(dialog instanceof HTMLDialogElement))
|
|
3659
|
-
return;
|
|
3660
|
-
const detail = event.detail;
|
|
3661
|
-
dialog.dataset.w3aRecoveryStage = detail.stage;
|
|
3662
|
-
};
|
|
3663
3658
|
constructor() {
|
|
3664
3659
|
super();
|
|
3660
|
+
this.dialogEl = null;
|
|
3661
|
+
this.viewerEl = null;
|
|
3662
|
+
this.shown = false;
|
|
3663
|
+
this.handleCancel = (event) => {
|
|
3664
|
+
event.preventDefault();
|
|
3665
|
+
this.dispatchEvent(new CustomEvent(RECOVERY_BACKUP_CANCEL_EVENT, { bubbles: true, composed: true }));
|
|
3666
|
+
};
|
|
3667
|
+
this.handleStageChange = (event) => {
|
|
3668
|
+
const dialog = event.currentTarget;
|
|
3669
|
+
if (!(dialog instanceof HTMLDialogElement))
|
|
3670
|
+
return;
|
|
3671
|
+
const detail = event.detail;
|
|
3672
|
+
dialog.dataset.w3aRecoveryStage = detail.stage;
|
|
3673
|
+
};
|
|
3665
3674
|
this.experience = { kind: "unconfigured" };
|
|
3666
3675
|
this.surface = "standalone";
|
|
3667
3676
|
this.dialogShown = new Promise((resolve) => {
|
|
@@ -3751,44 +3760,44 @@ var init_registry = __esm(() => {
|
|
|
3751
3760
|
});
|
|
3752
3761
|
|
|
3753
3762
|
// ../shared-ts/src/near/actions.ts
|
|
3754
|
-
function fromActionArgsWasm(
|
|
3755
|
-
switch (
|
|
3763
|
+
function fromActionArgsWasm(a) {
|
|
3764
|
+
switch (a.action_type) {
|
|
3756
3765
|
case "FunctionCall" /* FunctionCall */: {
|
|
3757
3766
|
let parsedArgs = {};
|
|
3758
3767
|
try {
|
|
3759
|
-
parsedArgs = typeof
|
|
3768
|
+
parsedArgs = typeof a.args === "string" ? a.args ? JSON.parse(a.args) : {} : a.args || {};
|
|
3760
3769
|
} catch {
|
|
3761
3770
|
parsedArgs = {};
|
|
3762
3771
|
}
|
|
3763
3772
|
return {
|
|
3764
3773
|
type: "FunctionCall" /* FunctionCall */,
|
|
3765
|
-
methodName:
|
|
3774
|
+
methodName: a.method_name,
|
|
3766
3775
|
args: parsedArgs,
|
|
3767
|
-
gas:
|
|
3768
|
-
deposit:
|
|
3776
|
+
gas: a.gas,
|
|
3777
|
+
deposit: a.deposit
|
|
3769
3778
|
};
|
|
3770
3779
|
}
|
|
3771
3780
|
case "Transfer" /* Transfer */:
|
|
3772
|
-
return { type: "Transfer" /* Transfer */, amount:
|
|
3781
|
+
return { type: "Transfer" /* Transfer */, amount: a.deposit };
|
|
3773
3782
|
case "CreateAccount" /* CreateAccount */:
|
|
3774
3783
|
return { type: "CreateAccount" /* CreateAccount */ };
|
|
3775
3784
|
case "DeployContract" /* DeployContract */:
|
|
3776
3785
|
return {
|
|
3777
3786
|
type: "DeployContract" /* DeployContract */,
|
|
3778
|
-
code: Array.isArray(
|
|
3787
|
+
code: Array.isArray(a.code) ? new Uint8Array(a.code) : new Uint8Array
|
|
3779
3788
|
};
|
|
3780
3789
|
case "DeployGlobalContract" /* DeployGlobalContract */:
|
|
3781
3790
|
return {
|
|
3782
3791
|
type: "DeployGlobalContract" /* DeployGlobalContract */,
|
|
3783
|
-
code: Array.isArray(
|
|
3784
|
-
deployMode:
|
|
3792
|
+
code: Array.isArray(a.code) ? new Uint8Array(a.code) : new Uint8Array,
|
|
3793
|
+
deployMode: a.deploy_mode
|
|
3785
3794
|
};
|
|
3786
3795
|
case "Stake" /* Stake */:
|
|
3787
|
-
return { type: "Stake" /* Stake */, stake:
|
|
3796
|
+
return { type: "Stake" /* Stake */, stake: a.stake, publicKey: a.public_key };
|
|
3788
3797
|
case "AddKey" /* AddKey */: {
|
|
3789
3798
|
let accessKey;
|
|
3790
3799
|
try {
|
|
3791
|
-
accessKey = JSON.parse(
|
|
3800
|
+
accessKey = JSON.parse(a.access_key);
|
|
3792
3801
|
} catch {
|
|
3793
3802
|
accessKey = { nonce: BigInt(0), permission: "FullAccess" };
|
|
3794
3803
|
}
|
|
@@ -3810,7 +3819,7 @@ function fromActionArgsWasm(a3) {
|
|
|
3810
3819
|
}
|
|
3811
3820
|
return {
|
|
3812
3821
|
type: "AddKey" /* AddKey */,
|
|
3813
|
-
publicKey:
|
|
3822
|
+
publicKey: a.public_key,
|
|
3814
3823
|
accessKey: {
|
|
3815
3824
|
nonce: typeof accessKey?.nonce === "number" ? accessKey.nonce : 0,
|
|
3816
3825
|
permission: normalizedPermission
|
|
@@ -3818,13 +3827,13 @@ function fromActionArgsWasm(a3) {
|
|
|
3818
3827
|
};
|
|
3819
3828
|
}
|
|
3820
3829
|
case "DeleteKey" /* DeleteKey */:
|
|
3821
|
-
return { type: "DeleteKey" /* DeleteKey */, publicKey:
|
|
3830
|
+
return { type: "DeleteKey" /* DeleteKey */, publicKey: a.public_key };
|
|
3822
3831
|
case "DeleteAccount" /* DeleteAccount */:
|
|
3823
|
-
return { type: "DeleteAccount" /* DeleteAccount */, beneficiaryId:
|
|
3832
|
+
return { type: "DeleteAccount" /* DeleteAccount */, beneficiaryId: a.beneficiary_id };
|
|
3824
3833
|
case "UseGlobalContract" /* UseGlobalContract */:
|
|
3825
|
-
return { type: "UseGlobalContract" /* UseGlobalContract */, accountId:
|
|
3834
|
+
return { type: "UseGlobalContract" /* UseGlobalContract */, accountId: a.account_id, codeHash: a.code_hash };
|
|
3826
3835
|
default:
|
|
3827
|
-
throw new Error(`Unsupported wasm action_type: ${
|
|
3836
|
+
throw new Error(`Unsupported wasm action_type: ${a?.action_type}`);
|
|
3828
3837
|
}
|
|
3829
3838
|
}
|
|
3830
3839
|
function fromTransactionInputWasm(tx) {
|
|
@@ -3846,74 +3855,74 @@ var init_actions2 = __esm(() => {
|
|
|
3846
3855
|
});
|
|
3847
3856
|
|
|
3848
3857
|
// ../../node_modules/lit-html/directives/repeat.js
|
|
3849
|
-
var u4 = (
|
|
3850
|
-
const
|
|
3851
|
-
for (let
|
|
3852
|
-
|
|
3853
|
-
return
|
|
3858
|
+
var u4 = (e, s, t) => {
|
|
3859
|
+
const r = new Map;
|
|
3860
|
+
for (let l = s;l <= t; l++)
|
|
3861
|
+
r.set(e[l], l);
|
|
3862
|
+
return r;
|
|
3854
3863
|
}, c5;
|
|
3855
3864
|
var init_repeat = __esm(() => {
|
|
3856
3865
|
init_lit_html();
|
|
3857
3866
|
init_directive();
|
|
3858
3867
|
init_directive_helpers();
|
|
3859
3868
|
c5 = e4(class extends i5 {
|
|
3860
|
-
constructor(
|
|
3861
|
-
if (super(
|
|
3869
|
+
constructor(e) {
|
|
3870
|
+
if (super(e), e.type !== t4.CHILD)
|
|
3862
3871
|
throw Error("repeat() can only be used in text expressions");
|
|
3863
3872
|
}
|
|
3864
|
-
dt(
|
|
3865
|
-
let
|
|
3866
|
-
|
|
3867
|
-
const
|
|
3868
|
-
let
|
|
3869
|
-
for (const
|
|
3870
|
-
|
|
3871
|
-
return { values:
|
|
3872
|
-
}
|
|
3873
|
-
render(
|
|
3874
|
-
return this.dt(
|
|
3875
|
-
}
|
|
3876
|
-
update(
|
|
3877
|
-
const
|
|
3878
|
-
if (!Array.isArray(
|
|
3879
|
-
return this.ut =
|
|
3880
|
-
const
|
|
3881
|
-
let
|
|
3882
|
-
for (;
|
|
3883
|
-
if (
|
|
3884
|
-
|
|
3885
|
-
else if (
|
|
3886
|
-
|
|
3887
|
-
else if (
|
|
3888
|
-
|
|
3889
|
-
else if (
|
|
3890
|
-
|
|
3891
|
-
else if (
|
|
3892
|
-
|
|
3893
|
-
else if (
|
|
3894
|
-
|
|
3895
|
-
else if (
|
|
3896
|
-
if (
|
|
3897
|
-
const
|
|
3898
|
-
if (
|
|
3899
|
-
const
|
|
3900
|
-
v2(
|
|
3873
|
+
dt(e, s, t) {
|
|
3874
|
+
let r;
|
|
3875
|
+
t === undefined ? t = s : s !== undefined && (r = s);
|
|
3876
|
+
const l = [], o = [];
|
|
3877
|
+
let i = 0;
|
|
3878
|
+
for (const s of e)
|
|
3879
|
+
l[i] = r ? r(s, i) : i, o[i] = t(s, i), i++;
|
|
3880
|
+
return { values: o, keys: l };
|
|
3881
|
+
}
|
|
3882
|
+
render(e, s, t) {
|
|
3883
|
+
return this.dt(e, s, t).values;
|
|
3884
|
+
}
|
|
3885
|
+
update(s, [t, r, c]) {
|
|
3886
|
+
const d = p3(s), { values: p, keys: a } = this.dt(t, r, c);
|
|
3887
|
+
if (!Array.isArray(d))
|
|
3888
|
+
return this.ut = a, p;
|
|
3889
|
+
const h = this.ut ??= [], v = [];
|
|
3890
|
+
let m, y, x = 0, j = d.length - 1, k = 0, w = p.length - 1;
|
|
3891
|
+
for (;x <= j && k <= w; )
|
|
3892
|
+
if (d[x] === null)
|
|
3893
|
+
x++;
|
|
3894
|
+
else if (d[j] === null)
|
|
3895
|
+
j--;
|
|
3896
|
+
else if (h[x] === a[k])
|
|
3897
|
+
v[k] = v2(d[x], p[k]), x++, k++;
|
|
3898
|
+
else if (h[j] === a[w])
|
|
3899
|
+
v[w] = v2(d[j], p[w]), j--, w--;
|
|
3900
|
+
else if (h[x] === a[w])
|
|
3901
|
+
v[w] = v2(d[x], p[w]), s4(s, v[w + 1], d[x]), x++, w--;
|
|
3902
|
+
else if (h[j] === a[k])
|
|
3903
|
+
v[k] = v2(d[j], p[k]), s4(s, d[x], d[j]), j--, k++;
|
|
3904
|
+
else if (m === undefined && (m = u4(a, k, w), y = u4(h, x, j)), m.has(h[x]))
|
|
3905
|
+
if (m.has(h[j])) {
|
|
3906
|
+
const e = y.get(a[k]), t = e !== undefined ? d[e] : null;
|
|
3907
|
+
if (t === null) {
|
|
3908
|
+
const e = s4(s, d[x]);
|
|
3909
|
+
v2(e, p[k]), v[k] = e;
|
|
3901
3910
|
} else
|
|
3902
|
-
|
|
3903
|
-
|
|
3911
|
+
v[k] = v2(t, p[k]), s4(s, d[x], t), d[e] = null;
|
|
3912
|
+
k++;
|
|
3904
3913
|
} else
|
|
3905
|
-
M2(
|
|
3914
|
+
M2(d[j]), j--;
|
|
3906
3915
|
else
|
|
3907
|
-
M2(
|
|
3908
|
-
for (;
|
|
3909
|
-
const
|
|
3910
|
-
v2(
|
|
3916
|
+
M2(d[x]), x++;
|
|
3917
|
+
for (;k <= w; ) {
|
|
3918
|
+
const e = s4(s, v[w + 1]);
|
|
3919
|
+
v2(e, p[k]), v[k++] = e;
|
|
3911
3920
|
}
|
|
3912
|
-
for (;
|
|
3913
|
-
const
|
|
3914
|
-
|
|
3921
|
+
for (;x <= j; ) {
|
|
3922
|
+
const e = d[x++];
|
|
3923
|
+
e !== null && M2(e);
|
|
3915
3924
|
}
|
|
3916
|
-
return this.ut =
|
|
3925
|
+
return this.ut = a, m2(s, v), T;
|
|
3917
3926
|
}
|
|
3918
3927
|
});
|
|
3919
3928
|
});
|
|
@@ -4337,8 +4346,8 @@ var fromScale = (prefix, scale) => {
|
|
|
4337
4346
|
if (!scale)
|
|
4338
4347
|
return {};
|
|
4339
4348
|
const out = {};
|
|
4340
|
-
for (const
|
|
4341
|
-
out[`${prefix}${
|
|
4349
|
+
for (const k of Object.keys(scale))
|
|
4350
|
+
out[`${prefix}${k}`] = scale[k];
|
|
4342
4351
|
return out;
|
|
4343
4352
|
};
|
|
4344
4353
|
var init_base_styles = () => {};
|
|
@@ -4593,7 +4602,7 @@ function formatArgs(args) {
|
|
|
4593
4602
|
if (typeof args === "string")
|
|
4594
4603
|
return args;
|
|
4595
4604
|
try {
|
|
4596
|
-
return JSON.stringify(args, (_k,
|
|
4605
|
+
return JSON.stringify(args, (_k, v) => typeof v === "bigint" ? v.toString() : v, 2);
|
|
4597
4606
|
} catch {
|
|
4598
4607
|
return String(args);
|
|
4599
4608
|
}
|
|
@@ -4668,49 +4677,126 @@ var init_TxTree = __esm(() => {
|
|
|
4668
4677
|
init_registry();
|
|
4669
4678
|
HEIGHT_DRIVEN_CLASSES = ["anim-h", "anim-h-active", "anim-h-driven"];
|
|
4670
4679
|
TxTree = class TxTree extends LitElementWithProps {
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
|
-
|
|
4679
|
-
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
|
|
4690
|
-
|
|
4691
|
-
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
|
|
4695
|
-
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
|
|
4705
|
-
|
|
4706
|
-
|
|
4707
|
-
|
|
4708
|
-
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
|
|
4680
|
+
constructor() {
|
|
4681
|
+
super(...arguments);
|
|
4682
|
+
this.showShadow = true;
|
|
4683
|
+
this._copied = new Set;
|
|
4684
|
+
this._copyTimers = new Map;
|
|
4685
|
+
this._fileContentModes = new Map;
|
|
4686
|
+
this._animating = new WeakSet;
|
|
4687
|
+
this.onFileContentToggleClick = (e, node) => {
|
|
4688
|
+
e.preventDefault();
|
|
4689
|
+
e.stopPropagation();
|
|
4690
|
+
if (!this.hasFileContentToggle(node))
|
|
4691
|
+
return;
|
|
4692
|
+
const shell = e.currentTarget?.closest(".file-content-shell") ?? null;
|
|
4693
|
+
const currentMode = this.resolveFileContentMode(node);
|
|
4694
|
+
const nextMode = currentMode === "decoded" ? "raw" : "decoded";
|
|
4695
|
+
const fromCssPx = shell?.getBoundingClientRect().height ?? 0;
|
|
4696
|
+
if (shell) {
|
|
4697
|
+
shell.classList.add(...HEIGHT_DRIVEN_CLASSES);
|
|
4698
|
+
this.setCssVars({ "--w3a-tree__anim-target": `${fromCssPx}px` });
|
|
4699
|
+
}
|
|
4700
|
+
this._fileContentModes.set(node.id, nextMode);
|
|
4701
|
+
this.requestUpdate();
|
|
4702
|
+
if (!shell)
|
|
4703
|
+
return;
|
|
4704
|
+
this.updateComplete.then(() => {
|
|
4705
|
+
shell.classList.remove(...HEIGHT_DRIVEN_CLASSES);
|
|
4706
|
+
const toCssPx = shell.getBoundingClientRect().height;
|
|
4707
|
+
shell.classList.add(...HEIGHT_DRIVEN_CLASSES);
|
|
4708
|
+
const claimed = announceClampedSurfaceResize({
|
|
4709
|
+
reason: `${node.id}:file-content-mode`,
|
|
4710
|
+
element: shell,
|
|
4711
|
+
drivenClasses: HEIGHT_DRIVEN_CLASSES,
|
|
4712
|
+
fromCssPx,
|
|
4713
|
+
toCssPx,
|
|
4714
|
+
setHeightCssPx: (px) => this.setCssVars({ "--w3a-tree__anim-target": `${px}px` })
|
|
4715
|
+
});
|
|
4716
|
+
if (!claimed)
|
|
4717
|
+
shell.classList.remove(...HEIGHT_DRIVEN_CLASSES);
|
|
4718
|
+
});
|
|
4719
|
+
};
|
|
4720
|
+
this.onSummaryClick = (e) => {
|
|
4721
|
+
const summary = e.currentTarget;
|
|
4722
|
+
if (!summary)
|
|
4723
|
+
return;
|
|
4724
|
+
const path = typeof e.composedPath === "function" ? e.composedPath() : undefined;
|
|
4725
|
+
let clickedReceiverLink = null;
|
|
4726
|
+
if (Array.isArray(path)) {
|
|
4727
|
+
for (const t of path) {
|
|
4728
|
+
if (t instanceof Element && t.matches("a.highlight-receiver-id")) {
|
|
4729
|
+
clickedReceiverLink = t;
|
|
4730
|
+
break;
|
|
4731
|
+
}
|
|
4732
|
+
}
|
|
4733
|
+
} else {
|
|
4734
|
+
const target = e.target;
|
|
4735
|
+
clickedReceiverLink = target?.closest?.("a.highlight-receiver-id") ?? null;
|
|
4736
|
+
}
|
|
4737
|
+
if (clickedReceiverLink) {
|
|
4738
|
+
e.preventDefault();
|
|
4739
|
+
e.stopPropagation();
|
|
4740
|
+
dispatchTxReviewOpenLink(this, { href: clickedReceiverLink.href });
|
|
4741
|
+
try {
|
|
4742
|
+
window.open(clickedReceiverLink.href, "_blank", "noopener");
|
|
4743
|
+
} catch {}
|
|
4744
|
+
return;
|
|
4745
|
+
}
|
|
4746
|
+
e.preventDefault();
|
|
4747
|
+
e.stopPropagation();
|
|
4748
|
+
const details = summary.closest("details");
|
|
4749
|
+
if (!details || this._animating.has(details))
|
|
4750
|
+
return;
|
|
4751
|
+
const body = details.querySelector(":scope > .folder-children, :scope > .row.file-row");
|
|
4752
|
+
if (!body) {
|
|
4753
|
+
details.open = !details.open;
|
|
4754
|
+
this.handleToggle({ nodeId: details.dataset.nodeId, open: details.open });
|
|
4755
|
+
return;
|
|
4756
|
+
}
|
|
4757
|
+
const reduceMotion = (() => {
|
|
4758
|
+
return typeof window !== "undefined" && "matchMedia" in window ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : false;
|
|
4759
|
+
})();
|
|
4760
|
+
if (reduceMotion) {
|
|
4761
|
+
details.open = !details.open;
|
|
4762
|
+
this.handleToggle({ nodeId: details.dataset.nodeId, open: details.open });
|
|
4763
|
+
return;
|
|
4764
|
+
}
|
|
4765
|
+
if (!details.open) {
|
|
4766
|
+
this.animateOpen(details, body);
|
|
4767
|
+
} else {
|
|
4768
|
+
this.animateClose(details, body);
|
|
4769
|
+
}
|
|
4770
|
+
};
|
|
4771
|
+
}
|
|
4772
|
+
static properties = {
|
|
4773
|
+
node: { attribute: false },
|
|
4774
|
+
depth: { type: Number, attribute: false },
|
|
4775
|
+
styles: { attribute: false, state: true },
|
|
4776
|
+
theme: { type: String, reflect: true },
|
|
4777
|
+
appearance: { attribute: false },
|
|
4778
|
+
width: { type: String },
|
|
4779
|
+
shadowDom: { type: Boolean, attribute: "shadow-dom" },
|
|
4780
|
+
nearExplorerUrl: { type: String, attribute: "near-explorer-url" },
|
|
4781
|
+
tempoExplorerUrl: { type: String, attribute: "tempo-explorer-url" },
|
|
4782
|
+
evmExplorerUrl: { type: String, attribute: "evm-explorer-url" },
|
|
4783
|
+
showShadow: { type: Boolean, attribute: "show-shadow" }
|
|
4784
|
+
};
|
|
4785
|
+
isCopied(id) {
|
|
4786
|
+
return this._copied.has(id);
|
|
4787
|
+
}
|
|
4788
|
+
async handleCopyClick(e, node) {
|
|
4789
|
+
e.stopPropagation();
|
|
4790
|
+
const value = node.copyValue;
|
|
4791
|
+
if (!value)
|
|
4792
|
+
return;
|
|
4793
|
+
try {
|
|
4794
|
+
if (navigator.clipboard && navigator.clipboard.writeText) {
|
|
4795
|
+
await navigator.clipboard.writeText(value);
|
|
4796
|
+
} else {
|
|
4797
|
+
const ta = document.createElement("textarea");
|
|
4798
|
+
ta.value = value;
|
|
4799
|
+
ta.setAttribute("readonly", "");
|
|
4714
4800
|
ta.className = "w3a-offscreen";
|
|
4715
4801
|
document.body.appendChild(ta);
|
|
4716
4802
|
ta.select();
|
|
@@ -4762,94 +4848,10 @@ var init_TxTree = __esm(() => {
|
|
|
4762
4848
|
const mode = this.resolveFileContentMode(node);
|
|
4763
4849
|
return mode === "raw" ? variants.raw : variants.decoded;
|
|
4764
4850
|
}
|
|
4765
|
-
onFileContentToggleClick = (e6, node) => {
|
|
4766
|
-
e6.preventDefault();
|
|
4767
|
-
e6.stopPropagation();
|
|
4768
|
-
if (!this.hasFileContentToggle(node))
|
|
4769
|
-
return;
|
|
4770
|
-
const shell = e6.currentTarget?.closest(".file-content-shell") ?? null;
|
|
4771
|
-
const currentMode = this.resolveFileContentMode(node);
|
|
4772
|
-
const nextMode = currentMode === "decoded" ? "raw" : "decoded";
|
|
4773
|
-
const fromCssPx = shell?.getBoundingClientRect().height ?? 0;
|
|
4774
|
-
if (shell) {
|
|
4775
|
-
shell.classList.add(...HEIGHT_DRIVEN_CLASSES);
|
|
4776
|
-
this.setCssVars({ "--w3a-tree__anim-target": `${fromCssPx}px` });
|
|
4777
|
-
}
|
|
4778
|
-
this._fileContentModes.set(node.id, nextMode);
|
|
4779
|
-
this.requestUpdate();
|
|
4780
|
-
if (!shell)
|
|
4781
|
-
return;
|
|
4782
|
-
this.updateComplete.then(() => {
|
|
4783
|
-
shell.classList.remove(...HEIGHT_DRIVEN_CLASSES);
|
|
4784
|
-
const toCssPx = shell.getBoundingClientRect().height;
|
|
4785
|
-
shell.classList.add(...HEIGHT_DRIVEN_CLASSES);
|
|
4786
|
-
const claimed = announceClampedSurfaceResize({
|
|
4787
|
-
reason: `${node.id}:file-content-mode`,
|
|
4788
|
-
element: shell,
|
|
4789
|
-
drivenClasses: HEIGHT_DRIVEN_CLASSES,
|
|
4790
|
-
fromCssPx,
|
|
4791
|
-
toCssPx,
|
|
4792
|
-
setHeightCssPx: (px) => this.setCssVars({ "--w3a-tree__anim-target": `${px}px` })
|
|
4793
|
-
});
|
|
4794
|
-
if (!claimed)
|
|
4795
|
-
shell.classList.remove(...HEIGHT_DRIVEN_CLASSES);
|
|
4796
|
-
});
|
|
4797
|
-
};
|
|
4798
4851
|
handleToggle(detail) {
|
|
4799
4852
|
dispatchLitTreeToggled(this);
|
|
4800
4853
|
dispatchTxReviewToggleNode(this, detail);
|
|
4801
4854
|
}
|
|
4802
|
-
onSummaryClick = (e6) => {
|
|
4803
|
-
const summary = e6.currentTarget;
|
|
4804
|
-
if (!summary)
|
|
4805
|
-
return;
|
|
4806
|
-
const path = typeof e6.composedPath === "function" ? e6.composedPath() : undefined;
|
|
4807
|
-
let clickedReceiverLink = null;
|
|
4808
|
-
if (Array.isArray(path)) {
|
|
4809
|
-
for (const t5 of path) {
|
|
4810
|
-
if (t5 instanceof Element && t5.matches("a.highlight-receiver-id")) {
|
|
4811
|
-
clickedReceiverLink = t5;
|
|
4812
|
-
break;
|
|
4813
|
-
}
|
|
4814
|
-
}
|
|
4815
|
-
} else {
|
|
4816
|
-
const target = e6.target;
|
|
4817
|
-
clickedReceiverLink = target?.closest?.("a.highlight-receiver-id") ?? null;
|
|
4818
|
-
}
|
|
4819
|
-
if (clickedReceiverLink) {
|
|
4820
|
-
e6.preventDefault();
|
|
4821
|
-
e6.stopPropagation();
|
|
4822
|
-
dispatchTxReviewOpenLink(this, { href: clickedReceiverLink.href });
|
|
4823
|
-
try {
|
|
4824
|
-
window.open(clickedReceiverLink.href, "_blank", "noopener");
|
|
4825
|
-
} catch {}
|
|
4826
|
-
return;
|
|
4827
|
-
}
|
|
4828
|
-
e6.preventDefault();
|
|
4829
|
-
e6.stopPropagation();
|
|
4830
|
-
const details = summary.closest("details");
|
|
4831
|
-
if (!details || this._animating.has(details))
|
|
4832
|
-
return;
|
|
4833
|
-
const body = details.querySelector(":scope > .folder-children, :scope > .row.file-row");
|
|
4834
|
-
if (!body) {
|
|
4835
|
-
details.open = !details.open;
|
|
4836
|
-
this.handleToggle({ nodeId: details.dataset.nodeId, open: details.open });
|
|
4837
|
-
return;
|
|
4838
|
-
}
|
|
4839
|
-
const reduceMotion = (() => {
|
|
4840
|
-
return typeof window !== "undefined" && "matchMedia" in window ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : false;
|
|
4841
|
-
})();
|
|
4842
|
-
if (reduceMotion) {
|
|
4843
|
-
details.open = !details.open;
|
|
4844
|
-
this.handleToggle({ nodeId: details.dataset.nodeId, open: details.open });
|
|
4845
|
-
return;
|
|
4846
|
-
}
|
|
4847
|
-
if (!details.open) {
|
|
4848
|
-
this.animateOpen(details, body);
|
|
4849
|
-
} else {
|
|
4850
|
-
this.animateClose(details, body);
|
|
4851
|
-
}
|
|
4852
|
-
};
|
|
4853
4855
|
animateOpen(details, body) {
|
|
4854
4856
|
this._animating.add(details);
|
|
4855
4857
|
body.classList.add("anim-h", "anim-h-hold");
|
|
@@ -4945,9 +4947,9 @@ var init_TxTree = __esm(() => {
|
|
|
4945
4947
|
}
|
|
4946
4948
|
createRenderRoot() {
|
|
4947
4949
|
if (this.shadowDom) {
|
|
4948
|
-
const
|
|
4949
|
-
ensureExternalStyles(
|
|
4950
|
-
return
|
|
4950
|
+
const root = super.createRenderRoot();
|
|
4951
|
+
ensureExternalStyles(root, "tx-tree.css", "data-w3a-tx-tree-css").catch(() => {});
|
|
4952
|
+
return root;
|
|
4951
4953
|
}
|
|
4952
4954
|
ensureExternalStyles(this, "tx-tree.css", "data-w3a-tx-tree-css").catch(() => {});
|
|
4953
4955
|
const root = this.getRootNode ? this.getRootNode() : null;
|
|
@@ -5003,7 +5005,7 @@ var init_TxTree = __esm(() => {
|
|
|
5003
5005
|
}
|
|
5004
5006
|
resolveContractExplorerHref(treeNode, contractAddress) {
|
|
5005
5007
|
const chain = treeNode.chain;
|
|
5006
|
-
const
|
|
5008
|
+
const base = (() => {
|
|
5007
5009
|
if (chain === "tempo")
|
|
5008
5010
|
return this.normalizeExplorerBase(this.tempoExplorerUrl);
|
|
5009
5011
|
if (chain === "evm")
|
|
@@ -5012,9 +5014,9 @@ var init_TxTree = __esm(() => {
|
|
|
5012
5014
|
return this.normalizeExplorerBase(this.nearExplorerUrl || "https://testnet.nearblocks.io");
|
|
5013
5015
|
return;
|
|
5014
5016
|
})();
|
|
5015
|
-
if (!
|
|
5017
|
+
if (!base)
|
|
5016
5018
|
return;
|
|
5017
|
-
return `${
|
|
5019
|
+
return `${base}/address/${encodeURIComponent(contractAddress)}`;
|
|
5018
5020
|
}
|
|
5019
5021
|
renderContractTransactionLabel(treeNode) {
|
|
5020
5022
|
const contractAddress = String(treeNode.contractAddress || "").trim();
|
|
@@ -5056,17 +5058,17 @@ var init_TxTree = __esm(() => {
|
|
|
5056
5058
|
}
|
|
5057
5059
|
renderLabelWithSelectiveHighlight(treeNode) {
|
|
5058
5060
|
if (treeNode.action) {
|
|
5059
|
-
const
|
|
5060
|
-
switch (
|
|
5061
|
+
const a = treeNode.action;
|
|
5062
|
+
switch (a.type) {
|
|
5061
5063
|
case "FunctionCall": {
|
|
5062
|
-
const method =
|
|
5063
|
-
const gasStr = formatGas(
|
|
5064
|
-
const depositStr = formatDeposit(
|
|
5064
|
+
const method = a.methodName;
|
|
5065
|
+
const gasStr = formatGas(a.gas);
|
|
5066
|
+
const depositStr = formatDeposit(a.deposit);
|
|
5065
5067
|
return x`Calling <span class="highlight-method-name">${method}</span> ${depositStr !== "0 NEAR" ? x` with <span class="highlight-method-name">${depositStr}</span>` : ""}
|
|
5066
5068
|
${gasStr ? x` using <span class="highlight-method-name">${gasStr}</span>` : ""}`;
|
|
5067
5069
|
}
|
|
5068
5070
|
case "Transfer": {
|
|
5069
|
-
const amount = formatDeposit(
|
|
5071
|
+
const amount = formatDeposit(a.amount);
|
|
5070
5072
|
return x`Transfer <span class="highlight-amount">${amount}</span>`;
|
|
5071
5073
|
}
|
|
5072
5074
|
case "CreateAccount":
|
|
@@ -5074,26 +5076,26 @@ var init_TxTree = __esm(() => {
|
|
|
5074
5076
|
case "DeleteAccount":
|
|
5075
5077
|
return "Deleting Account";
|
|
5076
5078
|
case "Stake":
|
|
5077
|
-
return `Staking ${formatDeposit(
|
|
5079
|
+
return `Staking ${formatDeposit(a.stake)}`;
|
|
5078
5080
|
case "AddKey":
|
|
5079
5081
|
return "Adding Key";
|
|
5080
5082
|
case "DeleteKey":
|
|
5081
5083
|
return "Deleting Key";
|
|
5082
5084
|
case "DeployContract": {
|
|
5083
|
-
const codeSize = formatCodeSize(
|
|
5085
|
+
const codeSize = formatCodeSize(a.code);
|
|
5084
5086
|
return `Deploying WASM contract (${codeSize})`;
|
|
5085
5087
|
}
|
|
5086
5088
|
case "DeployGlobalContract": {
|
|
5087
|
-
const codeSize = formatCodeSize(
|
|
5088
|
-
const mode =
|
|
5089
|
+
const codeSize = formatCodeSize(a.code);
|
|
5090
|
+
const mode = a.deployMode || "Unknown";
|
|
5089
5091
|
return `Deploy global WASM contract (mode: ${String(mode)}, size ${codeSize})`;
|
|
5090
5092
|
}
|
|
5091
5093
|
case "UseGlobalContract": {
|
|
5092
|
-
const accountId =
|
|
5093
|
-
const codeHash =
|
|
5094
|
+
const accountId = a.accountId;
|
|
5095
|
+
const codeHash = a.codeHash;
|
|
5094
5096
|
if (accountId) {
|
|
5095
|
-
const
|
|
5096
|
-
const href = `${
|
|
5097
|
+
const base = (this.nearExplorerUrl || "https://testnet.nearblocks.io").replace(/\/$/, "");
|
|
5098
|
+
const href = `${base}/address/${encodeURIComponent(String(accountId))}`;
|
|
5097
5099
|
return x`Use global contract
|
|
5098
5100
|
<a
|
|
5099
5101
|
class="highlight-receiver-id"
|
|
@@ -5112,7 +5114,7 @@ var init_TxTree = __esm(() => {
|
|
|
5112
5114
|
}
|
|
5113
5115
|
default: {
|
|
5114
5116
|
const idxText = isNumber(treeNode.actionIndex) ? ` ${treeNode.actionIndex + 1}` : "";
|
|
5115
|
-
const typeText =
|
|
5117
|
+
const typeText = a.type || "Unknown";
|
|
5116
5118
|
return `Action${idxText}: ${typeText}`;
|
|
5117
5119
|
}
|
|
5118
5120
|
}
|
|
@@ -5122,8 +5124,8 @@ var init_TxTree = __esm(() => {
|
|
|
5122
5124
|
const idx = treeNode.transactionIndex ?? 0;
|
|
5123
5125
|
const prefix = total > 1 ? `Transaction ${idx + 1}: to ` : "Transaction to ";
|
|
5124
5126
|
const receiverId = treeNode.transaction.receiverId;
|
|
5125
|
-
const
|
|
5126
|
-
const href = `${
|
|
5127
|
+
const base = (this.nearExplorerUrl || "https://testnet.nearblocks.io").replace(/\/$/, "");
|
|
5128
|
+
const href = `${base}/address/${encodeURIComponent(receiverId)}`;
|
|
5127
5129
|
return x`${prefix}<a
|
|
5128
5130
|
class="highlight-receiver-id"
|
|
5129
5131
|
href=${href}
|
|
@@ -5142,22 +5144,22 @@ var init_TxTree = __esm(() => {
|
|
|
5142
5144
|
}
|
|
5143
5145
|
computePlainLabel(treeNode) {
|
|
5144
5146
|
if (treeNode.action) {
|
|
5145
|
-
const
|
|
5146
|
-
switch (
|
|
5147
|
+
const a = treeNode.action;
|
|
5148
|
+
switch (a.type) {
|
|
5147
5149
|
case "FunctionCall": {
|
|
5148
|
-
const method =
|
|
5149
|
-
const gasStr = formatGas(
|
|
5150
|
-
const depositStr = formatDeposit(
|
|
5150
|
+
const method = a.methodName;
|
|
5151
|
+
const gasStr = formatGas(a.gas);
|
|
5152
|
+
const depositStr = formatDeposit(a.deposit);
|
|
5151
5153
|
return `Calling ${method} with ${depositStr} using ${gasStr}`;
|
|
5152
5154
|
}
|
|
5153
5155
|
case "Transfer":
|
|
5154
|
-
return `Transfer ${formatDeposit(
|
|
5156
|
+
return `Transfer ${formatDeposit(a.amount)}`;
|
|
5155
5157
|
case "CreateAccount":
|
|
5156
5158
|
return "Creating Account";
|
|
5157
5159
|
case "DeleteAccount":
|
|
5158
5160
|
return "Deleting Account";
|
|
5159
5161
|
case "Stake":
|
|
5160
|
-
return `Staking ${formatDeposit(
|
|
5162
|
+
return `Staking ${formatDeposit(a.stake)}`;
|
|
5161
5163
|
case "AddKey":
|
|
5162
5164
|
return "Adding Key";
|
|
5163
5165
|
case "DeleteKey":
|
|
@@ -5165,13 +5167,13 @@ var init_TxTree = __esm(() => {
|
|
|
5165
5167
|
case "DeployContract":
|
|
5166
5168
|
return "Deploying WASM contract";
|
|
5167
5169
|
case "DeployGlobalContract": {
|
|
5168
|
-
const codeSize = formatCodeSize(
|
|
5169
|
-
const mode =
|
|
5170
|
+
const codeSize = formatCodeSize(a.code);
|
|
5171
|
+
const mode = a.deployMode || "Unknown";
|
|
5170
5172
|
return `Deploy global WASM contract (mode: ${String(mode)}, size ${codeSize})`;
|
|
5171
5173
|
}
|
|
5172
5174
|
case "UseGlobalContract": {
|
|
5173
|
-
const accountId =
|
|
5174
|
-
const codeHash =
|
|
5175
|
+
const accountId = a.accountId;
|
|
5176
|
+
const codeHash = a.codeHash;
|
|
5175
5177
|
if (accountId) {
|
|
5176
5178
|
return `Use global contract by account ${String(accountId)}`;
|
|
5177
5179
|
}
|
|
@@ -5182,7 +5184,7 @@ var init_TxTree = __esm(() => {
|
|
|
5182
5184
|
}
|
|
5183
5185
|
default: {
|
|
5184
5186
|
const idxText = isNumber(treeNode.actionIndex) ? ` ${treeNode.actionIndex + 1}` : "";
|
|
5185
|
-
const typeText =
|
|
5187
|
+
const typeText = a.type || "Unknown";
|
|
5186
5188
|
return `Action${idxText}: ${typeText}`;
|
|
5187
5189
|
}
|
|
5188
5190
|
}
|
|
@@ -5225,7 +5227,7 @@ var init_TxTree = __esm(() => {
|
|
|
5225
5227
|
${node.copyValue ? x` <span
|
|
5226
5228
|
class="copy-badge"
|
|
5227
5229
|
data-copied=${this.isCopied(node.id)}
|
|
5228
|
-
@click=${(
|
|
5230
|
+
@click=${(e) => this.handleCopyClick(e, node)}
|
|
5229
5231
|
title=${this.isCopied(node.id) ? "Copied" : "Copy"}
|
|
5230
5232
|
>
|
|
5231
5233
|
${this.isCopied(node.id) ? "copied" : "copy"}
|
|
@@ -5238,7 +5240,7 @@ var init_TxTree = __esm(() => {
|
|
|
5238
5240
|
class="file-content-mode-toggle"
|
|
5239
5241
|
title=${`Show ${toggleLabel}`}
|
|
5240
5242
|
aria-label=${`Show ${toggleLabel}`}
|
|
5241
|
-
@click=${(
|
|
5243
|
+
@click=${(e) => this.onFileContentToggleClick(e, node)}
|
|
5242
5244
|
>
|
|
5243
5245
|
${toggleLabel}
|
|
5244
5246
|
</button>` : ""}
|
|
@@ -5264,7 +5266,7 @@ var init_TxTree = __esm(() => {
|
|
|
5264
5266
|
<span
|
|
5265
5267
|
class="copy-badge"
|
|
5266
5268
|
data-copied=${this.isCopied(node.id)}
|
|
5267
|
-
@click=${(
|
|
5269
|
+
@click=${(e) => this.handleCopyClick(e, node)}
|
|
5268
5270
|
title=${this.isCopied(node.id) ? "Copied" : "Copy"}
|
|
5269
5271
|
>${this.isCopied(node.id) ? "copied" : "copy"}</span
|
|
5270
5272
|
>
|
|
@@ -5297,7 +5299,7 @@ var init_TxTree = __esm(() => {
|
|
|
5297
5299
|
</summary>
|
|
5298
5300
|
${nodeChildren && nodeChildren.length > 0 ? x`
|
|
5299
5301
|
<div class="folder-children">
|
|
5300
|
-
${c5(nodeChildren, (
|
|
5302
|
+
${c5(nodeChildren, (c) => c.id, (c) => this.renderAnyNode(c, depth + 1))}
|
|
5301
5303
|
</div>
|
|
5302
5304
|
` : x``}
|
|
5303
5305
|
</details>
|
|
@@ -5796,49 +5798,49 @@ function hexToBytes(hex) {
|
|
|
5796
5798
|
throw new Error(`Invalid hex (odd length): ${hex}`);
|
|
5797
5799
|
}
|
|
5798
5800
|
const bytes = new Uint8Array(normalized.length / 2);
|
|
5799
|
-
for (let
|
|
5800
|
-
const byte = normalized.slice(
|
|
5801
|
+
for (let i = 0;i < bytes.length; i++) {
|
|
5802
|
+
const byte = normalized.slice(i * 2, i * 2 + 2);
|
|
5801
5803
|
const value = Number.parseInt(byte, 16);
|
|
5802
5804
|
if (!Number.isFinite(value))
|
|
5803
5805
|
throw new Error(`Invalid hex: ${hex}`);
|
|
5804
|
-
bytes[
|
|
5806
|
+
bytes[i] = value;
|
|
5805
5807
|
}
|
|
5806
5808
|
return bytes;
|
|
5807
5809
|
}
|
|
5808
5810
|
function bytesToHex(bytes) {
|
|
5809
|
-
return `0x${Array.from(bytes).map((
|
|
5811
|
+
return `0x${Array.from(bytes).map((b) => b.toString(16).padStart(2, "0")).join("")}`;
|
|
5810
5812
|
}
|
|
5811
5813
|
|
|
5812
5814
|
// ../shared-ts/src/utils/keccak.ts
|
|
5813
5815
|
function rotateLeft64(value, shift) {
|
|
5814
|
-
const
|
|
5815
|
-
return (value <<
|
|
5816
|
+
const n = BigInt(shift);
|
|
5817
|
+
return (value << n | value >> 64n - n) & UINT64_MASK;
|
|
5816
5818
|
}
|
|
5817
5819
|
function keccakF1600(state) {
|
|
5818
|
-
const
|
|
5819
|
-
const
|
|
5820
|
+
const c = new Array(5);
|
|
5821
|
+
const d = new Array(5);
|
|
5820
5822
|
for (let round = 0;round < 24; round += 1) {
|
|
5821
|
-
for (let
|
|
5822
|
-
|
|
5823
|
+
for (let x = 0;x < 5; x += 1) {
|
|
5824
|
+
c[x] = state[x] ^ state[x + 5] ^ state[x + 10] ^ state[x + 15] ^ state[x + 20];
|
|
5823
5825
|
}
|
|
5824
|
-
for (let
|
|
5825
|
-
|
|
5826
|
+
for (let x = 0;x < 5; x += 1) {
|
|
5827
|
+
d[x] = c[(x + 4) % 5] ^ rotateLeft64(c[(x + 1) % 5], 1);
|
|
5826
5828
|
}
|
|
5827
|
-
for (let
|
|
5828
|
-
const rowOffset =
|
|
5829
|
-
for (let
|
|
5830
|
-
state[rowOffset +
|
|
5829
|
+
for (let y = 0;y < 5; y += 1) {
|
|
5830
|
+
const rowOffset = y * 5;
|
|
5831
|
+
for (let x = 0;x < 5; x += 1) {
|
|
5832
|
+
state[rowOffset + x] ^= d[x];
|
|
5831
5833
|
}
|
|
5832
5834
|
}
|
|
5833
5835
|
let lane = state[1];
|
|
5834
|
-
for (let
|
|
5835
|
-
const targetIndex = PI_LANE_INDEXES[
|
|
5836
|
+
for (let i = 0;i < 24; i += 1) {
|
|
5837
|
+
const targetIndex = PI_LANE_INDEXES[i];
|
|
5836
5838
|
const nextLane = state[targetIndex];
|
|
5837
|
-
state[targetIndex] = rotateLeft64(lane, ROTATION_OFFSETS[
|
|
5839
|
+
state[targetIndex] = rotateLeft64(lane, ROTATION_OFFSETS[i]);
|
|
5838
5840
|
lane = nextLane;
|
|
5839
5841
|
}
|
|
5840
|
-
for (let
|
|
5841
|
-
const rowOffset =
|
|
5842
|
+
for (let y = 0;y < 5; y += 1) {
|
|
5843
|
+
const rowOffset = y * 5;
|
|
5842
5844
|
const lane0 = state[rowOffset];
|
|
5843
5845
|
const lane1 = state[rowOffset + 1];
|
|
5844
5846
|
const lane2 = state[rowOffset + 2];
|
|
@@ -5861,8 +5863,8 @@ function absorbByte(state, offset, byte) {
|
|
|
5861
5863
|
function keccak256Bytes(input) {
|
|
5862
5864
|
const state = new Array(25).fill(0n);
|
|
5863
5865
|
let offset = 0;
|
|
5864
|
-
for (let
|
|
5865
|
-
absorbByte(state, offset, input[
|
|
5866
|
+
for (let i = 0;i < input.length; i += 1) {
|
|
5867
|
+
absorbByte(state, offset, input[i]);
|
|
5866
5868
|
offset += 1;
|
|
5867
5869
|
if (offset === KECCAK_RATE_BYTES) {
|
|
5868
5870
|
keccakF1600(state);
|
|
@@ -5873,10 +5875,10 @@ function keccak256Bytes(input) {
|
|
|
5873
5875
|
absorbByte(state, KECCAK_RATE_BYTES - 1, 128);
|
|
5874
5876
|
keccakF1600(state);
|
|
5875
5877
|
const out = new Uint8Array(KECCAK256_OUTPUT_BYTES);
|
|
5876
|
-
for (let
|
|
5877
|
-
const lane = state[Math.floor(
|
|
5878
|
-
const laneShift = BigInt(
|
|
5879
|
-
out[
|
|
5878
|
+
for (let i = 0;i < KECCAK256_OUTPUT_BYTES; i += 1) {
|
|
5879
|
+
const lane = state[Math.floor(i / 8)];
|
|
5880
|
+
const laneShift = BigInt(i % 8 * 8);
|
|
5881
|
+
out[i] = Number(lane >> laneShift & 0xffn);
|
|
5880
5882
|
}
|
|
5881
5883
|
return out;
|
|
5882
5884
|
}
|
|
@@ -6117,8 +6119,8 @@ function parseAbiTypeNode(args) {
|
|
|
6117
6119
|
dynamic: baseType === "bytes" || baseType === "string"
|
|
6118
6120
|
};
|
|
6119
6121
|
}
|
|
6120
|
-
for (let
|
|
6121
|
-
const length = arrayDimensions[
|
|
6122
|
+
for (let i = arrayDimensions.length - 1;i >= 0; i -= 1) {
|
|
6123
|
+
const length = arrayDimensions[i];
|
|
6122
6124
|
node = {
|
|
6123
6125
|
kind: "array",
|
|
6124
6126
|
canonicalType: `${node.canonicalType}[${length == null ? "" : String(length)}]`,
|
|
@@ -6245,16 +6247,16 @@ function decodeTypeAt(typeNode, bytes, offset) {
|
|
|
6245
6247
|
if (!decodedItems)
|
|
6246
6248
|
return null;
|
|
6247
6249
|
const out = {};
|
|
6248
|
-
for (let
|
|
6249
|
-
const component = typeNode.components[
|
|
6250
|
-
const baseName = String(component.name || "").trim() || `item${
|
|
6250
|
+
for (let i = 0;i < typeNode.components.length; i += 1) {
|
|
6251
|
+
const component = typeNode.components[i];
|
|
6252
|
+
const baseName = String(component.name || "").trim() || `item${i}`;
|
|
6251
6253
|
let name = baseName;
|
|
6252
6254
|
let counter = 1;
|
|
6253
6255
|
while (Object.prototype.hasOwnProperty.call(out, name)) {
|
|
6254
6256
|
counter += 1;
|
|
6255
6257
|
name = `${baseName}_${counter}`;
|
|
6256
6258
|
}
|
|
6257
|
-
out[name] = decodedItems[
|
|
6259
|
+
out[name] = decodedItems[i];
|
|
6258
6260
|
}
|
|
6259
6261
|
return out;
|
|
6260
6262
|
}
|
|
@@ -6268,8 +6270,8 @@ function decodeTypeAt(typeNode, bytes, offset) {
|
|
|
6268
6270
|
const baseOffset = isDynamicArray ? offset + WORD_SIZE : offset;
|
|
6269
6271
|
const items = [];
|
|
6270
6272
|
if (typeNode.item.dynamic) {
|
|
6271
|
-
for (let
|
|
6272
|
-
const itemRelativeOffset = readWordNumber(bytes, baseOffset +
|
|
6273
|
+
for (let i = 0;i < arrayLength; i += 1) {
|
|
6274
|
+
const itemRelativeOffset = readWordNumber(bytes, baseOffset + i * WORD_SIZE);
|
|
6273
6275
|
if (itemRelativeOffset == null)
|
|
6274
6276
|
return null;
|
|
6275
6277
|
const decoded = decodeTypeAt(typeNode.item, bytes, baseOffset + itemRelativeOffset);
|
|
@@ -6280,8 +6282,8 @@ function decodeTypeAt(typeNode, bytes, offset) {
|
|
|
6280
6282
|
return items;
|
|
6281
6283
|
}
|
|
6282
6284
|
const itemWords = staticWordLength(typeNode.item);
|
|
6283
|
-
for (let
|
|
6284
|
-
const itemOffset = baseOffset +
|
|
6285
|
+
for (let i = 0;i < arrayLength; i += 1) {
|
|
6286
|
+
const itemOffset = baseOffset + i * itemWords * WORD_SIZE;
|
|
6285
6287
|
const decoded = decodeTypeAt(typeNode.item, bytes, itemOffset);
|
|
6286
6288
|
if (decoded == null)
|
|
6287
6289
|
return null;
|
|
@@ -6297,17 +6299,17 @@ function decodeTupleComponents(components, bytes, tupleOffset) {
|
|
|
6297
6299
|
cursorWords += component.typeNode.dynamic ? 1 : staticWordLength(component.typeNode);
|
|
6298
6300
|
}
|
|
6299
6301
|
const out = [];
|
|
6300
|
-
for (let
|
|
6301
|
-
const component = components[
|
|
6302
|
-
const headOffset = tupleOffset + headOffsets[
|
|
6302
|
+
for (let i = 0;i < components.length; i += 1) {
|
|
6303
|
+
const component = components[i];
|
|
6304
|
+
const headOffset = tupleOffset + headOffsets[i];
|
|
6303
6305
|
if (component.typeNode.dynamic) {
|
|
6304
6306
|
const relativeOffset = readWordNumber(bytes, headOffset);
|
|
6305
6307
|
if (relativeOffset == null)
|
|
6306
6308
|
return null;
|
|
6307
|
-
const
|
|
6308
|
-
if (
|
|
6309
|
+
const decoded = decodeTypeAt(component.typeNode, bytes, tupleOffset + relativeOffset);
|
|
6310
|
+
if (decoded == null)
|
|
6309
6311
|
return null;
|
|
6310
|
-
out.push(
|
|
6312
|
+
out.push(decoded);
|
|
6311
6313
|
continue;
|
|
6312
6314
|
}
|
|
6313
6315
|
const decoded = decodeTypeAt(component.typeNode, bytes, headOffset);
|
|
@@ -6390,10 +6392,6 @@ var init_abiDecode = __esm(() => {
|
|
|
6390
6392
|
});
|
|
6391
6393
|
|
|
6392
6394
|
// src/core/signingEngine/uiConfirm/ui/lit-components/TxTree/abi/enrichDisplayModelWithAbi.ts
|
|
6393
|
-
var exports_enrichDisplayModelWithAbi = {};
|
|
6394
|
-
__export(exports_enrichDisplayModelWithAbi, {
|
|
6395
|
-
enrichDisplayModelWithAbi: () => enrichDisplayModelWithAbi
|
|
6396
|
-
});
|
|
6397
6395
|
function isGenericContractCallOperation(operation) {
|
|
6398
6396
|
return operation.kind === "generic.contractCall";
|
|
6399
6397
|
}
|
|
@@ -6491,12 +6489,6 @@ var init_tx_confirm_content = __esm(() => {
|
|
|
6491
6489
|
init_registry();
|
|
6492
6490
|
init_registry();
|
|
6493
6491
|
TxConfirmContentElement = class TxConfirmContentElement extends LitElementWithProps {
|
|
6494
|
-
_heightReflow = createSurfaceHeightReflow({
|
|
6495
|
-
reason: "tx-body",
|
|
6496
|
-
element: () => this.querySelector(".txc-root"),
|
|
6497
|
-
setHeightCssPx: (px) => this.setCssVars({ [CONFIRM_SURFACE_HEIGHT_DRIVEN_VAR]: `${px}px` }),
|
|
6498
|
-
settled: () => this.updateComplete
|
|
6499
|
-
});
|
|
6500
6492
|
static requiredChildTags = [W3A_TX_TREE_ID];
|
|
6501
6493
|
static keepDefinitions = [TxTree_default];
|
|
6502
6494
|
static properties = {
|
|
@@ -6519,22 +6511,39 @@ var init_tx_confirm_content = __esm(() => {
|
|
|
6519
6511
|
evmExplorerUrl: { type: String, attribute: "evm-explorer-url" },
|
|
6520
6512
|
showShadow: { type: Boolean, attribute: "show-shadow" }
|
|
6521
6513
|
};
|
|
6522
|
-
_treeNode = null;
|
|
6523
|
-
_ensureTreeDefinition = TxTree_default;
|
|
6524
|
-
_stylesReady = false;
|
|
6525
|
-
_stylePromises = [];
|
|
6526
|
-
_stylesAwaiting = null;
|
|
6527
6514
|
static _STYLE_MARKERS = [
|
|
6528
6515
|
"data-w3a-tx-tree-css",
|
|
6529
6516
|
"data-w3a-tx-confirmer-css",
|
|
6530
6517
|
"data-w3a-components-css"
|
|
6531
6518
|
];
|
|
6532
|
-
_treeBuildVersion = 0;
|
|
6533
|
-
_confirmArmed = false;
|
|
6534
|
-
_confirmArmRaf1 = null;
|
|
6535
|
-
_confirmArmRaf2 = null;
|
|
6536
6519
|
constructor() {
|
|
6537
6520
|
super();
|
|
6521
|
+
this._heightReflow = createSurfaceHeightReflow({
|
|
6522
|
+
reason: "tx-body",
|
|
6523
|
+
element: () => this.querySelector(".txc-root"),
|
|
6524
|
+
setHeightCssPx: (px) => this.setCssVars({ [CONFIRM_SURFACE_HEIGHT_DRIVEN_VAR]: `${px}px` }),
|
|
6525
|
+
settled: () => this.updateComplete
|
|
6526
|
+
});
|
|
6527
|
+
this._treeNode = null;
|
|
6528
|
+
this._ensureTreeDefinition = TxTree_default;
|
|
6529
|
+
this._stylesReady = false;
|
|
6530
|
+
this._stylePromises = [];
|
|
6531
|
+
this._stylesAwaiting = null;
|
|
6532
|
+
this._treeBuildVersion = 0;
|
|
6533
|
+
this._confirmArmed = false;
|
|
6534
|
+
this._confirmArmRaf1 = null;
|
|
6535
|
+
this._confirmArmRaf2 = null;
|
|
6536
|
+
this._stopDragStart = (e) => {
|
|
6537
|
+
e.stopPropagation();
|
|
6538
|
+
};
|
|
6539
|
+
this.onConfirm = () => {
|
|
6540
|
+
if (this.loading || !this._confirmArmed)
|
|
6541
|
+
return;
|
|
6542
|
+
dispatchLitConfirm(this);
|
|
6543
|
+
};
|
|
6544
|
+
this.onCancel = () => {
|
|
6545
|
+
dispatchLitCancel(this);
|
|
6546
|
+
};
|
|
6538
6547
|
const root = document?.documentElement || null;
|
|
6539
6548
|
if (root) {
|
|
6540
6549
|
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"));
|
|
@@ -6584,8 +6593,8 @@ var init_tx_confirm_content = __esm(() => {
|
|
|
6584
6593
|
return true;
|
|
6585
6594
|
}
|
|
6586
6595
|
if (!this._stylesAwaiting) {
|
|
6587
|
-
const
|
|
6588
|
-
this._stylesAwaiting =
|
|
6596
|
+
const p = Promise.all(this._stylePromises).then(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r()))));
|
|
6597
|
+
this._stylesAwaiting = p.then(() => {
|
|
6589
6598
|
this._stylesReady = true;
|
|
6590
6599
|
this._rebuildTree();
|
|
6591
6600
|
});
|
|
@@ -6625,17 +6634,17 @@ var init_tx_confirm_content = __esm(() => {
|
|
|
6625
6634
|
}
|
|
6626
6635
|
}
|
|
6627
6636
|
_applyTooltipWidthVar() {
|
|
6628
|
-
const
|
|
6629
|
-
if (
|
|
6630
|
-
this.setCssVars({ "--tooltip-width":
|
|
6637
|
+
const w = this._normalizeWidth(this.tooltipWidth);
|
|
6638
|
+
if (w)
|
|
6639
|
+
this.setCssVars({ "--tooltip-width": w });
|
|
6631
6640
|
}
|
|
6632
6641
|
_normalizeWidth(val) {
|
|
6633
6642
|
if (val === undefined || val === null)
|
|
6634
6643
|
return;
|
|
6635
6644
|
if (typeof val === "number" && Number.isFinite(val))
|
|
6636
6645
|
return `${val}px`;
|
|
6637
|
-
const
|
|
6638
|
-
return
|
|
6646
|
+
const s = String(val).trim();
|
|
6647
|
+
return s.length ? s : undefined;
|
|
6639
6648
|
}
|
|
6640
6649
|
_operationHasAbiDecodeHint(operation) {
|
|
6641
6650
|
const hint = operation.abiDecodeHint;
|
|
@@ -6661,10 +6670,10 @@ var init_tx_confirm_content = __esm(() => {
|
|
|
6661
6670
|
}
|
|
6662
6671
|
async _enrichTreeWithAbi(args) {
|
|
6663
6672
|
try {
|
|
6664
|
-
const module = await Promise.resolve().then(() => (init_enrichDisplayModelWithAbi(),
|
|
6673
|
+
const module = await Promise.resolve().then(() => (init_enrichDisplayModelWithAbi(), {}));
|
|
6665
6674
|
if (args.buildVersion !== this._treeBuildVersion)
|
|
6666
6675
|
return;
|
|
6667
|
-
const enrichedModel =
|
|
6676
|
+
const enrichedModel = enrichDisplayModelWithAbi(args.model);
|
|
6668
6677
|
if (args.buildVersion !== this._treeBuildVersion)
|
|
6669
6678
|
return;
|
|
6670
6679
|
this._treeNode = buildDisplayTreeFromModel(enrichedModel);
|
|
@@ -6707,23 +6716,12 @@ var init_tx_confirm_content = __esm(() => {
|
|
|
6707
6716
|
return;
|
|
6708
6717
|
}
|
|
6709
6718
|
this._treeNode = null;
|
|
6710
|
-
} catch (
|
|
6711
|
-
console.warn("[TxConfirmContent] failed to build TxTree",
|
|
6719
|
+
} catch (e) {
|
|
6720
|
+
console.warn("[TxConfirmContent] failed to build TxTree", e);
|
|
6712
6721
|
this._treeNode = null;
|
|
6713
6722
|
}
|
|
6714
6723
|
maybeRequestUpdate();
|
|
6715
6724
|
}
|
|
6716
|
-
_stopDragStart = (e6) => {
|
|
6717
|
-
e6.stopPropagation();
|
|
6718
|
-
};
|
|
6719
|
-
onConfirm = () => {
|
|
6720
|
-
if (this.loading || !this._confirmArmed)
|
|
6721
|
-
return;
|
|
6722
|
-
dispatchLitConfirm(this);
|
|
6723
|
-
};
|
|
6724
|
-
onCancel = () => {
|
|
6725
|
-
dispatchLitCancel(this);
|
|
6726
|
-
};
|
|
6727
6725
|
render() {
|
|
6728
6726
|
const treeTheme = this.theme === "dark" ? "dark" : "light";
|
|
6729
6727
|
const nearExplorerBase = this.nearExplorerUrl || "https://testnet.nearblocks.io";
|
|
@@ -6847,6 +6845,26 @@ var init_HaloBorder = __esm(() => {
|
|
|
6847
6845
|
init_css_loader();
|
|
6848
6846
|
init_registry();
|
|
6849
6847
|
HaloBorderElement = class HaloBorderElement extends LitElementWithProps {
|
|
6848
|
+
constructor() {
|
|
6849
|
+
super(...arguments);
|
|
6850
|
+
this._stylesReady = false;
|
|
6851
|
+
this._stylePromises = [];
|
|
6852
|
+
this._stylesAwaiting = null;
|
|
6853
|
+
this._rafId = null;
|
|
6854
|
+
this._startTs = 0;
|
|
6855
|
+
this._running = false;
|
|
6856
|
+
this.tick = (ts) => {
|
|
6857
|
+
if (!this._running)
|
|
6858
|
+
return;
|
|
6859
|
+
if (!this._startTs)
|
|
6860
|
+
this._startTs = ts;
|
|
6861
|
+
const dur = typeof this.durationMs === "number" && this.durationMs > 0 ? this.durationMs : 1150;
|
|
6862
|
+
const delta = (ts - this._startTs) % dur;
|
|
6863
|
+
const angle = delta / dur * 360;
|
|
6864
|
+
this.setCssVars({ "--halo-angle": `${angle}deg` });
|
|
6865
|
+
this._rafId = requestAnimationFrame(this.tick);
|
|
6866
|
+
};
|
|
6867
|
+
}
|
|
6850
6868
|
static properties = {
|
|
6851
6869
|
animated: { type: Boolean },
|
|
6852
6870
|
theme: { type: String },
|
|
@@ -6861,15 +6879,12 @@ var init_HaloBorder = __esm(() => {
|
|
|
6861
6879
|
innerPadding: { type: String, attribute: "inner-padding" },
|
|
6862
6880
|
innerBackground: { type: String, attribute: "inner-background" }
|
|
6863
6881
|
};
|
|
6864
|
-
_stylesReady = false;
|
|
6865
|
-
_stylePromises = [];
|
|
6866
|
-
_stylesAwaiting = null;
|
|
6867
6882
|
static _STYLE_MARKER = "data-w3a-halo-border-css";
|
|
6868
6883
|
createRenderRoot() {
|
|
6869
6884
|
const root = super.createRenderRoot();
|
|
6870
|
-
const
|
|
6871
|
-
this._stylePromises.push(
|
|
6872
|
-
|
|
6885
|
+
const p = ensureExternalStyles(root, "halo-border.css", HaloBorderElement._STYLE_MARKER);
|
|
6886
|
+
this._stylePromises.push(p);
|
|
6887
|
+
p.catch(() => {});
|
|
6873
6888
|
return root;
|
|
6874
6889
|
}
|
|
6875
6890
|
shouldUpdate(_changed) {
|
|
@@ -6880,7 +6895,7 @@ var init_HaloBorder = __esm(() => {
|
|
|
6880
6895
|
return true;
|
|
6881
6896
|
}
|
|
6882
6897
|
if (!this._stylesAwaiting) {
|
|
6883
|
-
const settle = Promise.all(this._stylePromises).then(() => new Promise((
|
|
6898
|
+
const settle = Promise.all(this._stylePromises).then(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r()))));
|
|
6884
6899
|
this._stylesAwaiting = settle.then(() => {
|
|
6885
6900
|
this._stylesReady = true;
|
|
6886
6901
|
this.requestUpdate();
|
|
@@ -6898,9 +6913,6 @@ var init_HaloBorder = __esm(() => {
|
|
|
6898
6913
|
const statefulLink = link;
|
|
6899
6914
|
return !!(statefulLink._w3aLoaded || link.sheet);
|
|
6900
6915
|
}
|
|
6901
|
-
_rafId = null;
|
|
6902
|
-
_startTs = 0;
|
|
6903
|
-
_running = false;
|
|
6904
6916
|
connectedCallback() {
|
|
6905
6917
|
super.connectedCallback();
|
|
6906
6918
|
this.applyCssVars();
|
|
@@ -6940,17 +6952,6 @@ var init_HaloBorder = __esm(() => {
|
|
|
6940
6952
|
this.stop();
|
|
6941
6953
|
super.disconnectedCallback();
|
|
6942
6954
|
}
|
|
6943
|
-
tick = (ts) => {
|
|
6944
|
-
if (!this._running)
|
|
6945
|
-
return;
|
|
6946
|
-
if (!this._startTs)
|
|
6947
|
-
this._startTs = ts;
|
|
6948
|
-
const dur = typeof this.durationMs === "number" && this.durationMs > 0 ? this.durationMs : 1150;
|
|
6949
|
-
const delta = (ts - this._startTs) % dur;
|
|
6950
|
-
const angle = delta / dur * 360;
|
|
6951
|
-
this.setCssVars({ "--halo-angle": `${angle}deg` });
|
|
6952
|
-
this._rafId = requestAnimationFrame(this.tick);
|
|
6953
|
-
};
|
|
6954
6955
|
start() {
|
|
6955
6956
|
if (this._running)
|
|
6956
6957
|
return;
|
|
@@ -6993,6 +6994,12 @@ var init_PasskeyHaloLoading = __esm(() => {
|
|
|
6993
6994
|
init_css_loader();
|
|
6994
6995
|
init_registry();
|
|
6995
6996
|
PasskeyHaloLoadingElement = class PasskeyHaloLoadingElement extends LitElementWithProps {
|
|
6997
|
+
constructor() {
|
|
6998
|
+
super(...arguments);
|
|
6999
|
+
this._stylesReady = false;
|
|
7000
|
+
this._stylePromises = [];
|
|
7001
|
+
this._stylesAwaiting = null;
|
|
7002
|
+
}
|
|
6996
7003
|
static properties = {
|
|
6997
7004
|
animated: { type: Boolean },
|
|
6998
7005
|
theme: { type: String },
|
|
@@ -7011,15 +7018,12 @@ var init_PasskeyHaloLoading = __esm(() => {
|
|
|
7011
7018
|
iconContainerBorderRadius: { type: String, attribute: "icon-container-border-radius" },
|
|
7012
7019
|
iconContainerBackgroundColor: { type: String, attribute: "icon-container-background-color" }
|
|
7013
7020
|
};
|
|
7014
|
-
_stylesReady = false;
|
|
7015
|
-
_stylePromises = [];
|
|
7016
|
-
_stylesAwaiting = null;
|
|
7017
7021
|
static _STYLE_MARKER = "data-w3a-passkey-halo-loading-css";
|
|
7018
7022
|
createRenderRoot() {
|
|
7019
7023
|
const root = super.createRenderRoot();
|
|
7020
|
-
const
|
|
7021
|
-
this._stylePromises.push(
|
|
7022
|
-
|
|
7024
|
+
const p = ensureExternalStyles(root, "passkey-halo-loading.css", PasskeyHaloLoadingElement._STYLE_MARKER);
|
|
7025
|
+
this._stylePromises.push(p);
|
|
7026
|
+
p.catch(() => {});
|
|
7023
7027
|
return root;
|
|
7024
7028
|
}
|
|
7025
7029
|
shouldUpdate(_changed) {
|
|
@@ -7030,7 +7034,7 @@ var init_PasskeyHaloLoading = __esm(() => {
|
|
|
7030
7034
|
return true;
|
|
7031
7035
|
}
|
|
7032
7036
|
if (!this._stylesAwaiting) {
|
|
7033
|
-
const settle = Promise.all(this._stylePromises).then(() => new Promise((
|
|
7037
|
+
const settle = Promise.all(this._stylePromises).then(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r()))));
|
|
7034
7038
|
this._stylesAwaiting = settle.then(() => {
|
|
7035
7039
|
this._stylesReady = true;
|
|
7036
7040
|
this.requestUpdate();
|
|
@@ -7292,50 +7296,6 @@ var init_viewer_drawer = __esm(() => {
|
|
|
7292
7296
|
otpResendStatus: { type: String, attribute: false },
|
|
7293
7297
|
otpSubmitAnimating: { type: Boolean, attribute: false }
|
|
7294
7298
|
};
|
|
7295
|
-
otpCode = "";
|
|
7296
|
-
otpError = "";
|
|
7297
|
-
otpResendBusy = false;
|
|
7298
|
-
otpResendUntilMs = 0;
|
|
7299
|
-
otpResendStatus = "";
|
|
7300
|
-
otpSubmitAnimating = false;
|
|
7301
|
-
_otpResendTimer = null;
|
|
7302
|
-
_otpSubmitTimer = null;
|
|
7303
|
-
_lastAutoOtpSubmitCode = "";
|
|
7304
|
-
_ensureDrawerDefinition = Drawer_default;
|
|
7305
|
-
_drawerEl = null;
|
|
7306
|
-
_open = false;
|
|
7307
|
-
_ownsThemeAttr = false;
|
|
7308
|
-
_onWindowMessage = (ev) => {
|
|
7309
|
-
const data = ev && ev.data && typeof ev.data === "object" ? ev.data : undefined;
|
|
7310
|
-
if (!data || typeof data.type !== "string")
|
|
7311
|
-
return;
|
|
7312
|
-
if (data.type === "MODAL_TIMEOUT") {
|
|
7313
|
-
const msg = typeof data.payload === "string" && data.payload ? data.payload : "Operation timed out";
|
|
7314
|
-
this.loading = false;
|
|
7315
|
-
this.errorMessage = msg;
|
|
7316
|
-
this._drawerEl?.handleClose?.();
|
|
7317
|
-
this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
|
|
7318
|
-
bubbles: true,
|
|
7319
|
-
composed: true,
|
|
7320
|
-
detail: { confirmed: false }
|
|
7321
|
-
}));
|
|
7322
|
-
}
|
|
7323
|
-
};
|
|
7324
|
-
_onKeyDown = (e6) => {
|
|
7325
|
-
if (e6.key === "Escape" || e6.key === "Esc") {
|
|
7326
|
-
if (this.loading)
|
|
7327
|
-
return;
|
|
7328
|
-
e6.preventDefault();
|
|
7329
|
-
this._drawerEl?.handleClose();
|
|
7330
|
-
if (!this._drawerEl) {
|
|
7331
|
-
this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
|
|
7332
|
-
bubbles: true,
|
|
7333
|
-
composed: true,
|
|
7334
|
-
detail: { confirmed: false }
|
|
7335
|
-
}));
|
|
7336
|
-
}
|
|
7337
|
-
}
|
|
7338
|
-
};
|
|
7339
7299
|
_chainLabelForModel() {
|
|
7340
7300
|
switch (this.model?.chain) {
|
|
7341
7301
|
case "tempo":
|
|
@@ -7428,24 +7388,6 @@ var init_viewer_drawer = __esm(() => {
|
|
|
7428
7388
|
</div>
|
|
7429
7389
|
`;
|
|
7430
7390
|
}
|
|
7431
|
-
onPasskeyRegistrationConfirm = () => {
|
|
7432
|
-
this.finishContentConfirm();
|
|
7433
|
-
};
|
|
7434
|
-
_onOtpInput = (event) => {
|
|
7435
|
-
const input = event.currentTarget;
|
|
7436
|
-
const code = String(input?.value || "").replace(/\D/g, "").slice(0, 6);
|
|
7437
|
-
this.otpCode = code;
|
|
7438
|
-
this.otpError = "";
|
|
7439
|
-
if (code.length < 6) {
|
|
7440
|
-
this._lastAutoOtpSubmitCode = "";
|
|
7441
|
-
this._resetOtpSubmitAnimation();
|
|
7442
|
-
return;
|
|
7443
|
-
}
|
|
7444
|
-
if (this.loading || this._lastAutoOtpSubmitCode === code)
|
|
7445
|
-
return;
|
|
7446
|
-
this._lastAutoOtpSubmitCode = code;
|
|
7447
|
-
this._submitEmailOtpAfterFade(code);
|
|
7448
|
-
};
|
|
7449
7391
|
_clearOtpSubmitTimer() {
|
|
7450
7392
|
if (this._otpSubmitTimer != null)
|
|
7451
7393
|
window.clearTimeout(this._otpSubmitTimer);
|
|
@@ -7489,40 +7431,6 @@ var init_viewer_drawer = __esm(() => {
|
|
|
7489
7431
|
return `Resend in ${Math.ceil(remainingMs / 1000)}s`;
|
|
7490
7432
|
return this.otpResendStatus || "Resend code";
|
|
7491
7433
|
}
|
|
7492
|
-
_onOtpResend = () => {
|
|
7493
|
-
const resend = this.emailOtpPrompt?.onResend;
|
|
7494
|
-
if (typeof resend !== "function" || this.otpResendBusy || this.loading)
|
|
7495
|
-
return;
|
|
7496
|
-
if (this.otpResendUntilMs > Date.now())
|
|
7497
|
-
return;
|
|
7498
|
-
this.otpError = "";
|
|
7499
|
-
this.otpResendStatus = "";
|
|
7500
|
-
this._lastAutoOtpSubmitCode = "";
|
|
7501
|
-
this._resetOtpSubmitAnimation();
|
|
7502
|
-
this.otpResendBusy = true;
|
|
7503
|
-
this._startOtpResendCountdown(Number(this.emailOtpPrompt?.resendDebounceMs) || 1e4);
|
|
7504
|
-
this.requestUpdate();
|
|
7505
|
-
(async () => {
|
|
7506
|
-
try {
|
|
7507
|
-
const result = await resend();
|
|
7508
|
-
const challengeId = String(result?.challengeId || "").trim();
|
|
7509
|
-
const emailHint = String(result?.emailHint || "").trim();
|
|
7510
|
-
if (challengeId) {
|
|
7511
|
-
this.emailOtpPrompt = {
|
|
7512
|
-
...this.emailOtpPrompt,
|
|
7513
|
-
challengeId,
|
|
7514
|
-
...emailHint ? { emailHint } : {}
|
|
7515
|
-
};
|
|
7516
|
-
}
|
|
7517
|
-
this.otpResendStatus = "Code sent";
|
|
7518
|
-
} catch (error) {
|
|
7519
|
-
this.otpError = formatEmailOtpResendError(error);
|
|
7520
|
-
} finally {
|
|
7521
|
-
this.otpResendBusy = false;
|
|
7522
|
-
this.requestUpdate();
|
|
7523
|
-
}
|
|
7524
|
-
})();
|
|
7525
|
-
};
|
|
7526
7434
|
_renderEmailOtpPrompt() {
|
|
7527
7435
|
if (!this._isEmailOtpMode())
|
|
7528
7436
|
return "";
|
|
@@ -7569,11 +7477,6 @@ var init_viewer_drawer = __esm(() => {
|
|
|
7569
7477
|
</div>
|
|
7570
7478
|
`;
|
|
7571
7479
|
}
|
|
7572
|
-
_onFundingNoticeCopy = (event) => {
|
|
7573
|
-
const target = event.currentTarget;
|
|
7574
|
-
const accountId = String(target?.dataset.copyValue || "").trim();
|
|
7575
|
-
copyTextToClipboard(accountId);
|
|
7576
|
-
};
|
|
7577
7480
|
_renderConfirmationBody() {
|
|
7578
7481
|
const body = String(this.body || "").trim();
|
|
7579
7482
|
if (!body)
|
|
@@ -7604,6 +7507,147 @@ var init_viewer_drawer = __esm(() => {
|
|
|
7604
7507
|
}
|
|
7605
7508
|
constructor() {
|
|
7606
7509
|
super();
|
|
7510
|
+
this.otpCode = "";
|
|
7511
|
+
this.otpError = "";
|
|
7512
|
+
this.otpResendBusy = false;
|
|
7513
|
+
this.otpResendUntilMs = 0;
|
|
7514
|
+
this.otpResendStatus = "";
|
|
7515
|
+
this.otpSubmitAnimating = false;
|
|
7516
|
+
this._otpResendTimer = null;
|
|
7517
|
+
this._otpSubmitTimer = null;
|
|
7518
|
+
this._lastAutoOtpSubmitCode = "";
|
|
7519
|
+
this._ensureDrawerDefinition = Drawer_default;
|
|
7520
|
+
this._drawerEl = null;
|
|
7521
|
+
this._open = false;
|
|
7522
|
+
this._ownsThemeAttr = false;
|
|
7523
|
+
this._onWindowMessage = (ev) => {
|
|
7524
|
+
const data = ev && ev.data && typeof ev.data === "object" ? ev.data : undefined;
|
|
7525
|
+
if (!data || typeof data.type !== "string")
|
|
7526
|
+
return;
|
|
7527
|
+
if (data.type === "MODAL_TIMEOUT") {
|
|
7528
|
+
const msg = typeof data.payload === "string" && data.payload ? data.payload : "Operation timed out";
|
|
7529
|
+
this.loading = false;
|
|
7530
|
+
this.errorMessage = msg;
|
|
7531
|
+
this._drawerEl?.handleClose?.();
|
|
7532
|
+
this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
|
|
7533
|
+
bubbles: true,
|
|
7534
|
+
composed: true,
|
|
7535
|
+
detail: { confirmed: false }
|
|
7536
|
+
}));
|
|
7537
|
+
}
|
|
7538
|
+
};
|
|
7539
|
+
this._onKeyDown = (e) => {
|
|
7540
|
+
if (e.key === "Escape" || e.key === "Esc") {
|
|
7541
|
+
if (this.loading)
|
|
7542
|
+
return;
|
|
7543
|
+
e.preventDefault();
|
|
7544
|
+
this._drawerEl?.handleClose();
|
|
7545
|
+
if (!this._drawerEl) {
|
|
7546
|
+
this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
|
|
7547
|
+
bubbles: true,
|
|
7548
|
+
composed: true,
|
|
7549
|
+
detail: { confirmed: false }
|
|
7550
|
+
}));
|
|
7551
|
+
}
|
|
7552
|
+
}
|
|
7553
|
+
};
|
|
7554
|
+
this.onPasskeyRegistrationConfirm = () => {
|
|
7555
|
+
this.finishContentConfirm();
|
|
7556
|
+
};
|
|
7557
|
+
this._onOtpInput = (event) => {
|
|
7558
|
+
const input = event.currentTarget;
|
|
7559
|
+
const code = String(input?.value || "").replace(/\D/g, "").slice(0, 6);
|
|
7560
|
+
this.otpCode = code;
|
|
7561
|
+
this.otpError = "";
|
|
7562
|
+
if (code.length < 6) {
|
|
7563
|
+
this._lastAutoOtpSubmitCode = "";
|
|
7564
|
+
this._resetOtpSubmitAnimation();
|
|
7565
|
+
return;
|
|
7566
|
+
}
|
|
7567
|
+
if (this.loading || this._lastAutoOtpSubmitCode === code)
|
|
7568
|
+
return;
|
|
7569
|
+
this._lastAutoOtpSubmitCode = code;
|
|
7570
|
+
this._submitEmailOtpAfterFade(code);
|
|
7571
|
+
};
|
|
7572
|
+
this._onOtpResend = () => {
|
|
7573
|
+
const resend = this.emailOtpPrompt?.onResend;
|
|
7574
|
+
if (typeof resend !== "function" || this.otpResendBusy || this.loading)
|
|
7575
|
+
return;
|
|
7576
|
+
if (this.otpResendUntilMs > Date.now())
|
|
7577
|
+
return;
|
|
7578
|
+
this.otpError = "";
|
|
7579
|
+
this.otpResendStatus = "";
|
|
7580
|
+
this._lastAutoOtpSubmitCode = "";
|
|
7581
|
+
this._resetOtpSubmitAnimation();
|
|
7582
|
+
this.otpResendBusy = true;
|
|
7583
|
+
this._startOtpResendCountdown(Number(this.emailOtpPrompt?.resendDebounceMs) || 1e4);
|
|
7584
|
+
this.requestUpdate();
|
|
7585
|
+
(async () => {
|
|
7586
|
+
try {
|
|
7587
|
+
const result = await resend();
|
|
7588
|
+
const challengeId = String(result?.challengeId || "").trim();
|
|
7589
|
+
const emailHint = String(result?.emailHint || "").trim();
|
|
7590
|
+
if (challengeId) {
|
|
7591
|
+
this.emailOtpPrompt = {
|
|
7592
|
+
...this.emailOtpPrompt,
|
|
7593
|
+
challengeId,
|
|
7594
|
+
...emailHint ? { emailHint } : {}
|
|
7595
|
+
};
|
|
7596
|
+
}
|
|
7597
|
+
this.otpResendStatus = "Code sent";
|
|
7598
|
+
} catch (error) {
|
|
7599
|
+
this.otpError = formatEmailOtpResendError(error);
|
|
7600
|
+
} finally {
|
|
7601
|
+
this.otpResendBusy = false;
|
|
7602
|
+
this.requestUpdate();
|
|
7603
|
+
}
|
|
7604
|
+
})();
|
|
7605
|
+
};
|
|
7606
|
+
this._onFundingNoticeCopy = (event) => {
|
|
7607
|
+
const target = event.currentTarget;
|
|
7608
|
+
const accountId = String(target?.dataset.copyValue || "").trim();
|
|
7609
|
+
copyTextToClipboard(accountId);
|
|
7610
|
+
};
|
|
7611
|
+
this.onDrawerCancel = () => {
|
|
7612
|
+
if (this.loading)
|
|
7613
|
+
return;
|
|
7614
|
+
this._open = false;
|
|
7615
|
+
this.requestUpdate();
|
|
7616
|
+
this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
|
|
7617
|
+
bubbles: true,
|
|
7618
|
+
composed: true,
|
|
7619
|
+
detail: { confirmed: false }
|
|
7620
|
+
}));
|
|
7621
|
+
};
|
|
7622
|
+
this.onContentConfirm = () => {
|
|
7623
|
+
if (this.loading || this.otpSubmitAnimating)
|
|
7624
|
+
return;
|
|
7625
|
+
if (this._isEmailOtpMode()) {
|
|
7626
|
+
const code = String(this.otpCode || "").replace(/\D/g, "").slice(0, 6);
|
|
7627
|
+
if (!/^\d{6}$/.test(code)) {
|
|
7628
|
+
this.otpCode = code;
|
|
7629
|
+
this.otpError = "Enter the 6-digit Email OTP code.";
|
|
7630
|
+
this.requestUpdate();
|
|
7631
|
+
return;
|
|
7632
|
+
}
|
|
7633
|
+
this.otpCode = code;
|
|
7634
|
+
this.otpError = "";
|
|
7635
|
+
this._lastAutoOtpSubmitCode = code;
|
|
7636
|
+
this._submitEmailOtpAfterFade(code);
|
|
7637
|
+
return;
|
|
7638
|
+
}
|
|
7639
|
+
this.finishContentConfirm();
|
|
7640
|
+
};
|
|
7641
|
+
this.onContentCancel = () => {
|
|
7642
|
+
this._drawerEl?.handleClose();
|
|
7643
|
+
this._open = false;
|
|
7644
|
+
this.requestUpdate();
|
|
7645
|
+
this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
|
|
7646
|
+
bubbles: true,
|
|
7647
|
+
composed: true,
|
|
7648
|
+
detail: { confirmed: false }
|
|
7649
|
+
}));
|
|
7650
|
+
};
|
|
7607
7651
|
this.nearAccountId = "";
|
|
7608
7652
|
this.txSigningRequests = undefined;
|
|
7609
7653
|
this.model = undefined;
|
|
@@ -7664,7 +7708,7 @@ var init_viewer_drawer = __esm(() => {
|
|
|
7664
7708
|
ensureExternalStyles(root, "tx-confirmer.css", "data-w3a-tx-confirmer-css"),
|
|
7665
7709
|
ensureExternalStyles(root, "drawer.css", "data-w3a-drawer-css")
|
|
7666
7710
|
]);
|
|
7667
|
-
await new Promise((
|
|
7711
|
+
await new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r())));
|
|
7668
7712
|
this._open = true;
|
|
7669
7713
|
this.requestUpdate();
|
|
7670
7714
|
}
|
|
@@ -7693,36 +7737,6 @@ var init_viewer_drawer = __esm(() => {
|
|
|
7693
7737
|
}
|
|
7694
7738
|
}
|
|
7695
7739
|
}
|
|
7696
|
-
onDrawerCancel = () => {
|
|
7697
|
-
if (this.loading)
|
|
7698
|
-
return;
|
|
7699
|
-
this._open = false;
|
|
7700
|
-
this.requestUpdate();
|
|
7701
|
-
this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
|
|
7702
|
-
bubbles: true,
|
|
7703
|
-
composed: true,
|
|
7704
|
-
detail: { confirmed: false }
|
|
7705
|
-
}));
|
|
7706
|
-
};
|
|
7707
|
-
onContentConfirm = () => {
|
|
7708
|
-
if (this.loading || this.otpSubmitAnimating)
|
|
7709
|
-
return;
|
|
7710
|
-
if (this._isEmailOtpMode()) {
|
|
7711
|
-
const code = String(this.otpCode || "").replace(/\D/g, "").slice(0, 6);
|
|
7712
|
-
if (!/^\d{6}$/.test(code)) {
|
|
7713
|
-
this.otpCode = code;
|
|
7714
|
-
this.otpError = "Enter the 6-digit Email OTP code.";
|
|
7715
|
-
this.requestUpdate();
|
|
7716
|
-
return;
|
|
7717
|
-
}
|
|
7718
|
-
this.otpCode = code;
|
|
7719
|
-
this.otpError = "";
|
|
7720
|
-
this._lastAutoOtpSubmitCode = code;
|
|
7721
|
-
this._submitEmailOtpAfterFade(code);
|
|
7722
|
-
return;
|
|
7723
|
-
}
|
|
7724
|
-
this.finishContentConfirm();
|
|
7725
|
-
};
|
|
7726
7740
|
finishContentConfirm(opts) {
|
|
7727
7741
|
if (this.loading)
|
|
7728
7742
|
return;
|
|
@@ -7742,16 +7756,6 @@ var init_viewer_drawer = __esm(() => {
|
|
|
7742
7756
|
}
|
|
7743
7757
|
}));
|
|
7744
7758
|
}
|
|
7745
|
-
onContentCancel = () => {
|
|
7746
|
-
this._drawerEl?.handleClose();
|
|
7747
|
-
this._open = false;
|
|
7748
|
-
this.requestUpdate();
|
|
7749
|
-
this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
|
|
7750
|
-
bubbles: true,
|
|
7751
|
-
composed: true,
|
|
7752
|
-
detail: { confirmed: false }
|
|
7753
|
-
}));
|
|
7754
|
-
};
|
|
7755
7759
|
close(_confirmed) {
|
|
7756
7760
|
if (!this._open)
|
|
7757
7761
|
return;
|
|
@@ -7952,12 +7956,6 @@ var init_viewer_modal = __esm(() => {
|
|
|
7952
7956
|
init_nearFundingNotice();
|
|
7953
7957
|
init_registry();
|
|
7954
7958
|
ModalTxConfirmElement = class ModalTxConfirmElement extends LitElementWithProps {
|
|
7955
|
-
_heightReflow = createSurfaceHeightReflow({
|
|
7956
|
-
reason: "confirm-body",
|
|
7957
|
-
element: () => this.querySelector(".modal-container-root"),
|
|
7958
|
-
setHeightCssPx: (px) => this.setCssVars({ [CONFIRM_SURFACE_HEIGHT_DRIVEN_VAR]: `${px}px` }),
|
|
7959
|
-
settled: () => this.updateComplete
|
|
7960
|
-
});
|
|
7961
7959
|
static requiredChildTags = ["w3a-tx-confirm-content"];
|
|
7962
7960
|
static strictChildDefinitions = true;
|
|
7963
7961
|
static keepDefinitions = [tx_confirm_content_default];
|
|
@@ -7990,57 +7988,6 @@ var init_viewer_modal = __esm(() => {
|
|
|
7990
7988
|
otpResendStatus: { type: String, attribute: false },
|
|
7991
7989
|
otpSubmitAnimating: { type: Boolean, attribute: false }
|
|
7992
7990
|
};
|
|
7993
|
-
totalAmount = "";
|
|
7994
|
-
method = "";
|
|
7995
|
-
fingerprint = "";
|
|
7996
|
-
body = "";
|
|
7997
|
-
title = "";
|
|
7998
|
-
cancelText = "Cancel";
|
|
7999
|
-
confirmText = "Next";
|
|
8000
|
-
model;
|
|
8001
|
-
securityContext;
|
|
8002
|
-
loading = false;
|
|
8003
|
-
errorMessage = undefined;
|
|
8004
|
-
theme = "dark";
|
|
8005
|
-
appearance;
|
|
8006
|
-
nearExplorerUrl;
|
|
8007
|
-
tempoExplorerUrl;
|
|
8008
|
-
evmExplorerUrl;
|
|
8009
|
-
signingAuthMode;
|
|
8010
|
-
emailOtpPrompt;
|
|
8011
|
-
otpCode = "";
|
|
8012
|
-
otpError = "";
|
|
8013
|
-
otpResendBusy = false;
|
|
8014
|
-
otpResendUntilMs = 0;
|
|
8015
|
-
otpResendStatus = "";
|
|
8016
|
-
otpSubmitAnimating = false;
|
|
8017
|
-
_otpResendTimer = null;
|
|
8018
|
-
_otpSubmitTimer = null;
|
|
8019
|
-
_lastAutoOtpSubmitCode = "";
|
|
8020
|
-
intentDigest;
|
|
8021
|
-
deferClose = false;
|
|
8022
|
-
_stylesReady = false;
|
|
8023
|
-
_stylePromises = [];
|
|
8024
|
-
_stylesAwaiting = null;
|
|
8025
|
-
_ensureTreeDefinition = TxTree_default;
|
|
8026
|
-
_ensureHaloElements = [HaloBorder_default, PasskeyHaloLoading_default];
|
|
8027
|
-
_onKeyDown = (e6) => {
|
|
8028
|
-
if (e6.key === "Escape" || e6.key === "Esc") {
|
|
8029
|
-
e6.preventDefault();
|
|
8030
|
-
this._handleCancel();
|
|
8031
|
-
}
|
|
8032
|
-
};
|
|
8033
|
-
_onWindowMessage = (ev) => {
|
|
8034
|
-
const data = ev && ev.data && typeof ev.data === "object" ? ev.data : undefined;
|
|
8035
|
-
if (!data || typeof data.type !== "string")
|
|
8036
|
-
return;
|
|
8037
|
-
if (data.type === "MODAL_TIMEOUT") {
|
|
8038
|
-
const msg = typeof data.payload === "string" && data.payload ? data.payload : "Operation timed out";
|
|
8039
|
-
this.loading = false;
|
|
8040
|
-
this.errorMessage = msg;
|
|
8041
|
-
this._handleCancel();
|
|
8042
|
-
}
|
|
8043
|
-
};
|
|
8044
7991
|
_chainLabelForModel() {
|
|
8045
7992
|
switch (this.model?.chain) {
|
|
8046
7993
|
case "tempo":
|
|
@@ -8078,12 +8025,6 @@ var init_viewer_modal = __esm(() => {
|
|
|
8078
8025
|
_isStandaloneSurface() {
|
|
8079
8026
|
return this.closest("w3a-tx-confirmer")?.getAttribute("data-w3a-confirm-surface") === "standalone";
|
|
8080
8027
|
}
|
|
8081
|
-
_handleBackdropClick = (event) => {
|
|
8082
|
-
if (!this._isStandaloneSurface())
|
|
8083
|
-
return;
|
|
8084
|
-
event.stopPropagation();
|
|
8085
|
-
this._handleCancel();
|
|
8086
|
-
};
|
|
8087
8028
|
_authHeadingFallback() {
|
|
8088
8029
|
if (this._passkeyRegistrationDisplay())
|
|
8089
8030
|
return "Create your passkey";
|
|
@@ -8149,9 +8090,6 @@ var init_viewer_modal = __esm(() => {
|
|
|
8149
8090
|
</div>
|
|
8150
8091
|
`;
|
|
8151
8092
|
}
|
|
8152
|
-
_onPasskeyRegistrationConfirm = () => {
|
|
8153
|
-
this._finishConfirm();
|
|
8154
|
-
};
|
|
8155
8093
|
_renderPasskeyRegistrationModal(display) {
|
|
8156
8094
|
return x`
|
|
8157
8095
|
${this._isStandaloneSurface() ? x`<div class="standalone-surface-backdrop" @click=${this._handleBackdropClick}></div>` : ""}
|
|
@@ -8186,21 +8124,6 @@ var init_viewer_modal = __esm(() => {
|
|
|
8186
8124
|
</div>
|
|
8187
8125
|
`;
|
|
8188
8126
|
}
|
|
8189
|
-
_onOtpInput = (event) => {
|
|
8190
|
-
const input = event.currentTarget;
|
|
8191
|
-
const code = String(input?.value || "").replace(/\D/g, "").slice(0, 6);
|
|
8192
|
-
this.otpCode = code;
|
|
8193
|
-
this.otpError = "";
|
|
8194
|
-
if (code.length < 6) {
|
|
8195
|
-
this._lastAutoOtpSubmitCode = "";
|
|
8196
|
-
this._resetOtpSubmitAnimation();
|
|
8197
|
-
return;
|
|
8198
|
-
}
|
|
8199
|
-
if (this.loading || this._lastAutoOtpSubmitCode === code)
|
|
8200
|
-
return;
|
|
8201
|
-
this._lastAutoOtpSubmitCode = code;
|
|
8202
|
-
this._submitEmailOtpAfterFade(code);
|
|
8203
|
-
};
|
|
8204
8127
|
_clearOtpSubmitTimer() {
|
|
8205
8128
|
if (this._otpSubmitTimer != null)
|
|
8206
8129
|
window.clearTimeout(this._otpSubmitTimer);
|
|
@@ -8244,40 +8167,6 @@ var init_viewer_modal = __esm(() => {
|
|
|
8244
8167
|
return `Resend in ${Math.ceil(remainingMs / 1000)}s`;
|
|
8245
8168
|
return this.otpResendStatus || "Resend code";
|
|
8246
8169
|
}
|
|
8247
|
-
_onOtpResend = () => {
|
|
8248
|
-
const resend = this.emailOtpPrompt?.onResend;
|
|
8249
|
-
if (typeof resend !== "function" || this.otpResendBusy || this.loading)
|
|
8250
|
-
return;
|
|
8251
|
-
if (this.otpResendUntilMs > Date.now())
|
|
8252
|
-
return;
|
|
8253
|
-
this.otpError = "";
|
|
8254
|
-
this.otpResendStatus = "";
|
|
8255
|
-
this._lastAutoOtpSubmitCode = "";
|
|
8256
|
-
this._resetOtpSubmitAnimation();
|
|
8257
|
-
this.otpResendBusy = true;
|
|
8258
|
-
this._startOtpResendCountdown(Number(this.emailOtpPrompt?.resendDebounceMs) || 1e4);
|
|
8259
|
-
this.requestUpdate();
|
|
8260
|
-
(async () => {
|
|
8261
|
-
try {
|
|
8262
|
-
const result = await resend();
|
|
8263
|
-
const challengeId = String(result?.challengeId || "").trim();
|
|
8264
|
-
const emailHint = String(result?.emailHint || "").trim();
|
|
8265
|
-
if (challengeId) {
|
|
8266
|
-
this.emailOtpPrompt = {
|
|
8267
|
-
...this.emailOtpPrompt,
|
|
8268
|
-
challengeId,
|
|
8269
|
-
...emailHint ? { emailHint } : {}
|
|
8270
|
-
};
|
|
8271
|
-
}
|
|
8272
|
-
this.otpResendStatus = "Code sent";
|
|
8273
|
-
} catch (error) {
|
|
8274
|
-
this.otpError = formatEmailOtpResendError2(error);
|
|
8275
|
-
} finally {
|
|
8276
|
-
this.otpResendBusy = false;
|
|
8277
|
-
this.requestUpdate();
|
|
8278
|
-
}
|
|
8279
|
-
})();
|
|
8280
|
-
};
|
|
8281
8170
|
_renderEmailOtpPrompt() {
|
|
8282
8171
|
if (!this._isEmailOtpMode())
|
|
8283
8172
|
return "";
|
|
@@ -8322,11 +8211,6 @@ var init_viewer_modal = __esm(() => {
|
|
|
8322
8211
|
</div>
|
|
8323
8212
|
`;
|
|
8324
8213
|
}
|
|
8325
|
-
_onFundingNoticeCopy = (event) => {
|
|
8326
|
-
const target = event.currentTarget;
|
|
8327
|
-
const accountId = String(target?.dataset.copyValue || "").trim();
|
|
8328
|
-
copyTextToClipboard(accountId);
|
|
8329
|
-
};
|
|
8330
8214
|
_renderConfirmationBody() {
|
|
8331
8215
|
const body = String(this.body || "").trim();
|
|
8332
8216
|
if (!body)
|
|
@@ -8357,12 +8241,123 @@ var init_viewer_modal = __esm(() => {
|
|
|
8357
8241
|
}
|
|
8358
8242
|
constructor() {
|
|
8359
8243
|
super();
|
|
8244
|
+
this._heightReflow = createSurfaceHeightReflow({
|
|
8245
|
+
reason: "confirm-body",
|
|
8246
|
+
element: () => this.querySelector(".modal-container-root"),
|
|
8247
|
+
setHeightCssPx: (px) => this.setCssVars({ [CONFIRM_SURFACE_HEIGHT_DRIVEN_VAR]: `${px}px` }),
|
|
8248
|
+
settled: () => this.updateComplete
|
|
8249
|
+
});
|
|
8250
|
+
this.totalAmount = "";
|
|
8251
|
+
this.method = "";
|
|
8252
|
+
this.fingerprint = "";
|
|
8253
|
+
this.body = "";
|
|
8254
|
+
this.title = "";
|
|
8255
|
+
this.cancelText = "Cancel";
|
|
8256
|
+
this.confirmText = "Next";
|
|
8257
|
+
this.loading = false;
|
|
8258
|
+
this.errorMessage = undefined;
|
|
8259
|
+
this.theme = "dark";
|
|
8260
|
+
this.otpCode = "";
|
|
8261
|
+
this.otpError = "";
|
|
8262
|
+
this.otpResendBusy = false;
|
|
8263
|
+
this.otpResendUntilMs = 0;
|
|
8264
|
+
this.otpResendStatus = "";
|
|
8265
|
+
this.otpSubmitAnimating = false;
|
|
8266
|
+
this._otpResendTimer = null;
|
|
8267
|
+
this._otpSubmitTimer = null;
|
|
8268
|
+
this._lastAutoOtpSubmitCode = "";
|
|
8269
|
+
this.deferClose = false;
|
|
8270
|
+
this._stylesReady = false;
|
|
8271
|
+
this._stylePromises = [];
|
|
8272
|
+
this._stylesAwaiting = null;
|
|
8273
|
+
this._ensureTreeDefinition = TxTree_default;
|
|
8274
|
+
this._ensureHaloElements = [HaloBorder_default, PasskeyHaloLoading_default];
|
|
8275
|
+
this._onKeyDown = (e) => {
|
|
8276
|
+
if (e.key === "Escape" || e.key === "Esc") {
|
|
8277
|
+
e.preventDefault();
|
|
8278
|
+
this._handleCancel();
|
|
8279
|
+
}
|
|
8280
|
+
};
|
|
8281
|
+
this._onWindowMessage = (ev) => {
|
|
8282
|
+
const data = ev && ev.data && typeof ev.data === "object" ? ev.data : undefined;
|
|
8283
|
+
if (!data || typeof data.type !== "string")
|
|
8284
|
+
return;
|
|
8285
|
+
if (data.type === "MODAL_TIMEOUT") {
|
|
8286
|
+
const msg = typeof data.payload === "string" && data.payload ? data.payload : "Operation timed out";
|
|
8287
|
+
this.loading = false;
|
|
8288
|
+
this.errorMessage = msg;
|
|
8289
|
+
this._handleCancel();
|
|
8290
|
+
}
|
|
8291
|
+
};
|
|
8292
|
+
this._handleBackdropClick = (event) => {
|
|
8293
|
+
if (!this._isStandaloneSurface())
|
|
8294
|
+
return;
|
|
8295
|
+
event.stopPropagation();
|
|
8296
|
+
this._handleCancel();
|
|
8297
|
+
};
|
|
8298
|
+
this._onPasskeyRegistrationConfirm = () => {
|
|
8299
|
+
this._finishConfirm();
|
|
8300
|
+
};
|
|
8301
|
+
this._onOtpInput = (event) => {
|
|
8302
|
+
const input = event.currentTarget;
|
|
8303
|
+
const code = String(input?.value || "").replace(/\D/g, "").slice(0, 6);
|
|
8304
|
+
this.otpCode = code;
|
|
8305
|
+
this.otpError = "";
|
|
8306
|
+
if (code.length < 6) {
|
|
8307
|
+
this._lastAutoOtpSubmitCode = "";
|
|
8308
|
+
this._resetOtpSubmitAnimation();
|
|
8309
|
+
return;
|
|
8310
|
+
}
|
|
8311
|
+
if (this.loading || this._lastAutoOtpSubmitCode === code)
|
|
8312
|
+
return;
|
|
8313
|
+
this._lastAutoOtpSubmitCode = code;
|
|
8314
|
+
this._submitEmailOtpAfterFade(code);
|
|
8315
|
+
};
|
|
8316
|
+
this._onOtpResend = () => {
|
|
8317
|
+
const resend = this.emailOtpPrompt?.onResend;
|
|
8318
|
+
if (typeof resend !== "function" || this.otpResendBusy || this.loading)
|
|
8319
|
+
return;
|
|
8320
|
+
if (this.otpResendUntilMs > Date.now())
|
|
8321
|
+
return;
|
|
8322
|
+
this.otpError = "";
|
|
8323
|
+
this.otpResendStatus = "";
|
|
8324
|
+
this._lastAutoOtpSubmitCode = "";
|
|
8325
|
+
this._resetOtpSubmitAnimation();
|
|
8326
|
+
this.otpResendBusy = true;
|
|
8327
|
+
this._startOtpResendCountdown(Number(this.emailOtpPrompt?.resendDebounceMs) || 1e4);
|
|
8328
|
+
this.requestUpdate();
|
|
8329
|
+
(async () => {
|
|
8330
|
+
try {
|
|
8331
|
+
const result = await resend();
|
|
8332
|
+
const challengeId = String(result?.challengeId || "").trim();
|
|
8333
|
+
const emailHint = String(result?.emailHint || "").trim();
|
|
8334
|
+
if (challengeId) {
|
|
8335
|
+
this.emailOtpPrompt = {
|
|
8336
|
+
...this.emailOtpPrompt,
|
|
8337
|
+
challengeId,
|
|
8338
|
+
...emailHint ? { emailHint } : {}
|
|
8339
|
+
};
|
|
8340
|
+
}
|
|
8341
|
+
this.otpResendStatus = "Code sent";
|
|
8342
|
+
} catch (error) {
|
|
8343
|
+
this.otpError = formatEmailOtpResendError2(error);
|
|
8344
|
+
} finally {
|
|
8345
|
+
this.otpResendBusy = false;
|
|
8346
|
+
this.requestUpdate();
|
|
8347
|
+
}
|
|
8348
|
+
})();
|
|
8349
|
+
};
|
|
8350
|
+
this._onFundingNoticeCopy = (event) => {
|
|
8351
|
+
const target = event.currentTarget;
|
|
8352
|
+
const accountId = String(target?.dataset.copyValue || "").trim();
|
|
8353
|
+
copyTextToClipboard(accountId);
|
|
8354
|
+
};
|
|
8355
|
+
this._ownsThemeAttr = false;
|
|
8360
8356
|
const root = document?.documentElement || null;
|
|
8361
8357
|
if (root) {
|
|
8362
8358
|
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"));
|
|
8363
8359
|
}
|
|
8364
8360
|
}
|
|
8365
|
-
_ownsThemeAttr = false;
|
|
8366
8361
|
willUpdate(changedProperties) {
|
|
8367
8362
|
super.willUpdate(changedProperties);
|
|
8368
8363
|
if (this.hasUpdated)
|
|
@@ -8434,8 +8429,8 @@ var init_viewer_modal = __esm(() => {
|
|
|
8434
8429
|
if (this._stylesReady)
|
|
8435
8430
|
return true;
|
|
8436
8431
|
if (!this._stylesAwaiting) {
|
|
8437
|
-
const
|
|
8438
|
-
this._stylesAwaiting =
|
|
8432
|
+
const p = Promise.all(this._stylePromises).then(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r()))));
|
|
8433
|
+
this._stylesAwaiting = p.then(() => {
|
|
8439
8434
|
this._stylesReady = true;
|
|
8440
8435
|
this.requestUpdate();
|
|
8441
8436
|
});
|
|
@@ -8674,18 +8669,18 @@ var init_tx_confirmer_wrapper = __esm(() => {
|
|
|
8674
8669
|
evmExplorerUrl: { type: String, attribute: "evm-explorer-url" }
|
|
8675
8670
|
};
|
|
8676
8671
|
static keepDefinitions = [ModalTxConfirmElement, DrawerTxConfirmerElement];
|
|
8677
|
-
childRef = e5();
|
|
8678
|
-
redispatchingEvent = false;
|
|
8679
|
-
interactiveAnnounced = false;
|
|
8680
|
-
currentChild = null;
|
|
8681
|
-
boundConfirmListener = (event) => {
|
|
8682
|
-
this.handleChildConfirm(event);
|
|
8683
|
-
};
|
|
8684
|
-
boundCancelListener = (_event) => {
|
|
8685
|
-
this.handleChildCancel();
|
|
8686
|
-
};
|
|
8687
8672
|
constructor() {
|
|
8688
8673
|
super();
|
|
8674
|
+
this.childRef = e5();
|
|
8675
|
+
this.redispatchingEvent = false;
|
|
8676
|
+
this.interactiveAnnounced = false;
|
|
8677
|
+
this.currentChild = null;
|
|
8678
|
+
this.boundConfirmListener = (event) => {
|
|
8679
|
+
this.handleChildConfirm(event);
|
|
8680
|
+
};
|
|
8681
|
+
this.boundCancelListener = (_event) => {
|
|
8682
|
+
this.handleChildCancel();
|
|
8683
|
+
};
|
|
8689
8684
|
this.variant = DEFAULT_VARIANT;
|
|
8690
8685
|
this.nearAccountId = "";
|
|
8691
8686
|
this.txSigningRequests = undefined;
|