@reown/appkit-cdn 1.1.0 → 1.1.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/dist/appkit.js +11430 -0
- package/dist/appkit.js.map +1 -0
- package/package.json +11 -8
- package/dist/W3MFrameProviderSingleton--HSg3nEz.js +0 -66075
- package/dist/W3MFrameProviderSingleton-SRLqDWgO.cjs +0 -11301
- package/dist/ethers.cjs +0 -1
- package/dist/ethers.js +0 -17811
- package/dist/hooks.module-B_N3JvEN.js +0 -763
- package/dist/hooks.module-CmpdbiRp.cjs +0 -1
- package/dist/index-2d-aRmQF.js +0 -250
- package/dist/index-3Tles8GF.js +0 -2055
- package/dist/index-3jinrfKR.cjs +0 -1
- package/dist/index-BBwc05vi.cjs +0 -64
- package/dist/index-BmU807V9.cjs +0 -7
- package/dist/index-CDAn9JfZ.cjs +0 -47
- package/dist/index-CIzqgU5q.cjs +0 -1
- package/dist/index-CJq05jyL.js +0 -129
- package/dist/index-CO1X8Cxc.js +0 -254
- package/dist/index-CQ4-w5mp.cjs +0 -1
- package/dist/index-DDwvGjhD.js +0 -161
- package/dist/index-DSzXjBUF.js +0 -3175
- package/dist/index-Dlv7g3Jh.js +0 -9034
- package/dist/index-_Sw9VWRf.js +0 -930
- package/dist/index-sfhFJZJt.cjs +0 -1
- package/dist/index-v7RnFZTP.cjs +0 -41
- package/dist/index.es-CXs4mA1g.cjs +0 -43
- package/dist/index.es-TVTbcEaP.js +0 -11685
- package/dist/metamask-sdk-CaVruToV.js +0 -40484
- package/dist/metamask-sdk-CsUP8MhX.cjs +0 -217
- package/dist/native-BiFy-msx.js +0 -16
- package/dist/native-gXKXtBE3.cjs +0 -1
- package/dist/w3m-modal-Dc1peoIh.cjs +0 -150
- package/dist/w3m-modal-DwtACkc9.js +0 -276
- package/dist/wagmi-GgXheXd8.cjs +0 -46
- package/dist/wagmi-IogORaa7.js +0 -18186
- package/dist/wagmi.cjs +0 -1
- package/dist/wagmi.js +0 -9
package/dist/native-BiFy-msx.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { o as e } from "./W3MFrameProviderSingleton--HSg3nEz.js";
|
|
2
|
-
function t() {
|
|
3
|
-
if (typeof WebSocket < "u")
|
|
4
|
-
return WebSocket;
|
|
5
|
-
if (typeof e.WebSocket < "u")
|
|
6
|
-
return e.WebSocket;
|
|
7
|
-
if (typeof window.WebSocket < "u")
|
|
8
|
-
return window.WebSocket;
|
|
9
|
-
if (typeof self.WebSocket < "u")
|
|
10
|
-
return self.WebSocket;
|
|
11
|
-
throw new Error("`WebSocket` is not supported in this environment");
|
|
12
|
-
}
|
|
13
|
-
const n = t();
|
|
14
|
-
export {
|
|
15
|
-
n as WebSocket
|
|
16
|
-
};
|
package/dist/native-gXKXtBE3.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./W3MFrameProviderSingleton-SRLqDWgO.cjs");function t(){if(typeof WebSocket<"u")return WebSocket;if(typeof e.global.WebSocket<"u")return e.global.WebSocket;if(typeof window.WebSocket<"u")return window.WebSocket;if(typeof self.WebSocket<"u")return self.WebSocket;throw new Error("`WebSocket` is not supported in this environment")}const o=t();exports.WebSocket=o;
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./W3MFrameProviderSingleton-SRLqDWgO.cjs"),u=t.i`
|
|
2
|
-
:host {
|
|
3
|
-
z-index: var(--w3m-z-index);
|
|
4
|
-
display: block;
|
|
5
|
-
backface-visibility: hidden;
|
|
6
|
-
will-change: opacity;
|
|
7
|
-
position: fixed;
|
|
8
|
-
top: 0;
|
|
9
|
-
left: 0;
|
|
10
|
-
right: 0;
|
|
11
|
-
bottom: 0;
|
|
12
|
-
pointer-events: none;
|
|
13
|
-
opacity: 0;
|
|
14
|
-
background-color: var(--wui-cover);
|
|
15
|
-
transition: opacity 0.2s var(--wui-ease-out-power-2);
|
|
16
|
-
will-change: opacity;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
:host(.open) {
|
|
20
|
-
opacity: 1;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
wui-card {
|
|
24
|
-
max-width: var(--w3m-modal-width);
|
|
25
|
-
width: 100%;
|
|
26
|
-
position: relative;
|
|
27
|
-
animation: zoom-in 0.2s var(--wui-ease-out-power-2);
|
|
28
|
-
animation-fill-mode: backwards;
|
|
29
|
-
outline: none;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
wui-card[shake='true'] {
|
|
33
|
-
animation:
|
|
34
|
-
zoom-in 0.2s var(--wui-ease-out-power-2),
|
|
35
|
-
w3m-shake 0.5s var(--wui-ease-out-power-2);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
wui-flex {
|
|
39
|
-
overflow-x: hidden;
|
|
40
|
-
overflow-y: auto;
|
|
41
|
-
display: flex;
|
|
42
|
-
align-items: center;
|
|
43
|
-
justify-content: center;
|
|
44
|
-
width: 100%;
|
|
45
|
-
height: 100%;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
@media (max-height: 700px) and (min-width: 431px) {
|
|
49
|
-
wui-flex {
|
|
50
|
-
align-items: flex-start;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
wui-card {
|
|
54
|
-
margin: var(--wui-spacing-xxl) 0px;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
@media (max-width: 430px) {
|
|
59
|
-
wui-flex {
|
|
60
|
-
align-items: flex-end;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
wui-card {
|
|
64
|
-
max-width: 100%;
|
|
65
|
-
border-bottom-left-radius: 0;
|
|
66
|
-
border-bottom-right-radius: 0;
|
|
67
|
-
border-bottom: none;
|
|
68
|
-
animation: slide-in 0.2s var(--wui-ease-out-power-2);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
wui-card[shake='true'] {
|
|
72
|
-
animation:
|
|
73
|
-
slide-in 0.2s var(--wui-ease-out-power-2),
|
|
74
|
-
w3m-shake 0.5s var(--wui-ease-out-power-2);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
@keyframes zoom-in {
|
|
79
|
-
0% {
|
|
80
|
-
transform: scale(0.95) translateY(0);
|
|
81
|
-
}
|
|
82
|
-
100% {
|
|
83
|
-
transform: scale(1) translateY(0);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
@keyframes slide-in {
|
|
88
|
-
0% {
|
|
89
|
-
transform: scale(1) translateY(50px);
|
|
90
|
-
}
|
|
91
|
-
100% {
|
|
92
|
-
transform: scale(1) translateY(0);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
@keyframes w3m-shake {
|
|
97
|
-
0% {
|
|
98
|
-
transform: scale(1) rotate(0deg);
|
|
99
|
-
}
|
|
100
|
-
20% {
|
|
101
|
-
transform: scale(1) rotate(-1deg);
|
|
102
|
-
}
|
|
103
|
-
40% {
|
|
104
|
-
transform: scale(1) rotate(1.5deg);
|
|
105
|
-
}
|
|
106
|
-
60% {
|
|
107
|
-
transform: scale(1) rotate(-1.5deg);
|
|
108
|
-
}
|
|
109
|
-
80% {
|
|
110
|
-
transform: scale(1) rotate(1deg);
|
|
111
|
-
}
|
|
112
|
-
100% {
|
|
113
|
-
transform: scale(1) rotate(0deg);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
@keyframes w3m-view-height {
|
|
118
|
-
from {
|
|
119
|
-
height: var(--prev-height);
|
|
120
|
-
}
|
|
121
|
-
to {
|
|
122
|
-
height: var(--new-height);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
`;var l=function(c,e,o,i){var r=arguments.length,s=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,o):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(c,e,o,i);else for(var a=c.length-1;a>=0;a--)(n=c[a])&&(s=(r<3?n(s):r>3?n(e,o,s):n(e,o))||s);return r>3&&s&&Object.defineProperty(e,o,s),s};const h="scroll-lock";exports.W3mModal=class extends t.h{constructor(){super(),this.unsubscribe=[],this.abortController=void 0,this.open=t.ModalController.state.open,this.caipAddress=t.ChainController.state.activeCaipAddress,this.caipNetwork=t.ChainController.state.activeCaipNetwork,this.isSiweEnabled=t.OptionsController.state.isSiweEnabled,this.shake=t.ModalController.state.shake,this.initializeTheming(),t.ApiController.prefetch(),this.unsubscribe.push(t.ModalController.subscribeKey("open",e=>e?this.onOpen():this.onClose()),t.ModalController.subscribeKey("shake",e=>this.shake=e),t.AccountController.subscribeKey("siweStatus",e=>this.onSiweStatusChange(e),"eip155"),t.ChainController.subscribeKey("activeCaipNetwork",e=>this.onNewNetwork(e)),t.ChainController.subscribeKey("activeCaipAddress",e=>this.onNewAddress(e)),t.OptionsController.subscribeKey("isSiweEnabled",e=>this.isSiweEnabled=e)),t.EventsController.sendEvent({type:"track",event:"MODAL_LOADED"})}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),this.onRemoveKeyboardListener()}render(){return this.open?t.ke`
|
|
126
|
-
<wui-flex @click=${this.onOverlayClick.bind(this)} data-testid="w3m-modal-overlay">
|
|
127
|
-
<wui-card
|
|
128
|
-
shake="${this.shake}"
|
|
129
|
-
role="alertdialog"
|
|
130
|
-
aria-modal="true"
|
|
131
|
-
tabindex="0"
|
|
132
|
-
data-testid="w3m-modal-card"
|
|
133
|
-
>
|
|
134
|
-
<w3m-header></w3m-header>
|
|
135
|
-
<w3m-router></w3m-router>
|
|
136
|
-
<w3m-snackbar></w3m-snackbar>
|
|
137
|
-
<w3m-alertbar></w3m-alertbar>
|
|
138
|
-
</wui-card>
|
|
139
|
-
</wui-flex>
|
|
140
|
-
<w3m-tooltip></w3m-tooltip>
|
|
141
|
-
`:null}async onOverlayClick(e){e.target===e.currentTarget&&await this.handleClose()}async handleClose(){const e=t.RouterController.state.view==="ConnectingSiwe",o=t.RouterController.state.view==="ApproveTransaction";if(this.isSiweEnabled){const{SIWEController:i}=await Promise.resolve().then(()=>require("./index-BBwc05vi.cjs"));i.state.status!=="success"&&(e||o)?t.ModalController.shake():t.ModalController.close()}else t.ModalController.close()}initializeTheming(){const{themeVariables:e,themeMode:o}=t.ThemeController.state,i=t.UiHelperUtil.getColorTheme(o);t.initializeTheming(e,i)}onClose(){this.open=!1,this.classList.remove("open"),this.onScrollUnlock(),t.SnackController.hide(),this.onRemoveKeyboardListener()}onOpen(){this.open=!0,this.classList.add("open"),this.onScrollLock(),this.onAddKeyboardListener()}onScrollLock(){const e=document.createElement("style");e.dataset.w3m=h,e.textContent=`
|
|
142
|
-
body {
|
|
143
|
-
touch-action: none;
|
|
144
|
-
overflow: hidden;
|
|
145
|
-
overscroll-behavior: contain;
|
|
146
|
-
}
|
|
147
|
-
w3m-modal {
|
|
148
|
-
pointer-events: auto;
|
|
149
|
-
}
|
|
150
|
-
`,document.head.appendChild(e)}onScrollUnlock(){const e=document.head.querySelector(`style[data-w3m="${h}"]`);e&&e.remove()}onAddKeyboardListener(){var o;this.abortController=new AbortController;const e=(o=this.shadowRoot)==null?void 0:o.querySelector("wui-card");e==null||e.focus(),window.addEventListener("keydown",i=>{if(i.key==="Escape")this.handleClose();else if(i.key==="Tab"){const{tagName:r}=i.target;r&&!r.includes("W3M-")&&!r.includes("WUI-")&&(e==null||e.focus())}},this.abortController)}onRemoveKeyboardListener(){var e;(e=this.abortController)==null||e.abort(),this.abortController=void 0}onSiweStatusChange(e){e==="success"&&t.ModalController.close()}async onNewAddress(e){var n;const o=this.caipAddress,i=o?t.CoreHelperUtil.getPlainAddress(o):void 0,r=e?t.CoreHelperUtil.getPlainAddress(e):void 0,s=i===r;if(this.caipAddress=e,r&&!s&&this.isSiweEnabled)try{const{SIWEController:a}=await Promise.resolve().then(()=>require("./index-BBwc05vi.cjs")),d=t.AccountController.state.siweStatus==="success";!i&&r?this.onSiweNavigation():d&&i&&r&&i!==r&&(n=a.state._client)!=null&&n.options.signOutOnAccountChange&&(await a.signOut(),this.onSiweNavigation())}catch(a){throw this.caipAddress=o,a}r||t.ModalController.close()}async onNewNetwork(e){var r,s,n,a;if(!this.caipAddress){this.caipNetwork=e,t.RouterController.goBack();return}const o=(s=(r=this.caipNetwork)==null?void 0:r.caipNetworkId)==null?void 0:s.toString(),i=(n=e==null?void 0:e.caipNetworkId)==null?void 0:n.toString();if(o&&i&&o!==i)if(this.isSiweEnabled){const{SIWEController:d}=await Promise.resolve().then(()=>require("./index-BBwc05vi.cjs"));(a=d.state._client)!=null&&a.options.signOutOnNetworkChange?(await d.signOut(),this.onSiweNavigation()):t.RouterController.goBack()}else t.RouterController.goBack();this.caipNetwork=e}onSiweNavigation(){const e=t.ChainController.state.activeChain===t.ConstantsUtil$1.CHAIN.EVM;!(t.AccountController.state.siweStatus==="success")&&e?this.open?t.RouterController.replace("ConnectingSiwe"):t.ModalController.open({view:"ConnectingSiwe"}):t.RouterController.goBack()}};exports.W3mModal.styles=u;l([t.r()],exports.W3mModal.prototype,"open",void 0);l([t.r()],exports.W3mModal.prototype,"caipAddress",void 0);l([t.r()],exports.W3mModal.prototype,"caipNetwork",void 0);l([t.r()],exports.W3mModal.prototype,"isSiweEnabled",void 0);l([t.r()],exports.W3mModal.prototype,"shake",void 0);exports.W3mModal=l([t.customElement("w3m-modal")],exports.W3mModal);
|
|
@@ -1,276 +0,0 @@
|
|
|
1
|
-
import { y as v, D as y, M as r, j as h, O as f, bb as k, r as p, I as C, F as S, R as c, _ as x, U as A, J as E, a as b, b as N, G as w, z as O, bc as L } from "./W3MFrameProviderSingleton--HSg3nEz.js";
|
|
2
|
-
const K = v`
|
|
3
|
-
:host {
|
|
4
|
-
z-index: var(--w3m-z-index);
|
|
5
|
-
display: block;
|
|
6
|
-
backface-visibility: hidden;
|
|
7
|
-
will-change: opacity;
|
|
8
|
-
position: fixed;
|
|
9
|
-
top: 0;
|
|
10
|
-
left: 0;
|
|
11
|
-
right: 0;
|
|
12
|
-
bottom: 0;
|
|
13
|
-
pointer-events: none;
|
|
14
|
-
opacity: 0;
|
|
15
|
-
background-color: var(--wui-cover);
|
|
16
|
-
transition: opacity 0.2s var(--wui-ease-out-power-2);
|
|
17
|
-
will-change: opacity;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
:host(.open) {
|
|
21
|
-
opacity: 1;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
wui-card {
|
|
25
|
-
max-width: var(--w3m-modal-width);
|
|
26
|
-
width: 100%;
|
|
27
|
-
position: relative;
|
|
28
|
-
animation: zoom-in 0.2s var(--wui-ease-out-power-2);
|
|
29
|
-
animation-fill-mode: backwards;
|
|
30
|
-
outline: none;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
wui-card[shake='true'] {
|
|
34
|
-
animation:
|
|
35
|
-
zoom-in 0.2s var(--wui-ease-out-power-2),
|
|
36
|
-
w3m-shake 0.5s var(--wui-ease-out-power-2);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
wui-flex {
|
|
40
|
-
overflow-x: hidden;
|
|
41
|
-
overflow-y: auto;
|
|
42
|
-
display: flex;
|
|
43
|
-
align-items: center;
|
|
44
|
-
justify-content: center;
|
|
45
|
-
width: 100%;
|
|
46
|
-
height: 100%;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
@media (max-height: 700px) and (min-width: 431px) {
|
|
50
|
-
wui-flex {
|
|
51
|
-
align-items: flex-start;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
wui-card {
|
|
55
|
-
margin: var(--wui-spacing-xxl) 0px;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
@media (max-width: 430px) {
|
|
60
|
-
wui-flex {
|
|
61
|
-
align-items: flex-end;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
wui-card {
|
|
65
|
-
max-width: 100%;
|
|
66
|
-
border-bottom-left-radius: 0;
|
|
67
|
-
border-bottom-right-radius: 0;
|
|
68
|
-
border-bottom: none;
|
|
69
|
-
animation: slide-in 0.2s var(--wui-ease-out-power-2);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
wui-card[shake='true'] {
|
|
73
|
-
animation:
|
|
74
|
-
slide-in 0.2s var(--wui-ease-out-power-2),
|
|
75
|
-
w3m-shake 0.5s var(--wui-ease-out-power-2);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
@keyframes zoom-in {
|
|
80
|
-
0% {
|
|
81
|
-
transform: scale(0.95) translateY(0);
|
|
82
|
-
}
|
|
83
|
-
100% {
|
|
84
|
-
transform: scale(1) translateY(0);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
@keyframes slide-in {
|
|
89
|
-
0% {
|
|
90
|
-
transform: scale(1) translateY(50px);
|
|
91
|
-
}
|
|
92
|
-
100% {
|
|
93
|
-
transform: scale(1) translateY(0);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
@keyframes w3m-shake {
|
|
98
|
-
0% {
|
|
99
|
-
transform: scale(1) rotate(0deg);
|
|
100
|
-
}
|
|
101
|
-
20% {
|
|
102
|
-
transform: scale(1) rotate(-1deg);
|
|
103
|
-
}
|
|
104
|
-
40% {
|
|
105
|
-
transform: scale(1) rotate(1.5deg);
|
|
106
|
-
}
|
|
107
|
-
60% {
|
|
108
|
-
transform: scale(1) rotate(-1.5deg);
|
|
109
|
-
}
|
|
110
|
-
80% {
|
|
111
|
-
transform: scale(1) rotate(1deg);
|
|
112
|
-
}
|
|
113
|
-
100% {
|
|
114
|
-
transform: scale(1) rotate(0deg);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
@keyframes w3m-view-height {
|
|
119
|
-
from {
|
|
120
|
-
height: var(--prev-height);
|
|
121
|
-
}
|
|
122
|
-
to {
|
|
123
|
-
height: var(--new-height);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
`;
|
|
127
|
-
var d = function(u, e, t, i) {
|
|
128
|
-
var s = arguments.length, o = s < 3 ? e : i === null ? i = Object.getOwnPropertyDescriptor(e, t) : i, n;
|
|
129
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
130
|
-
o = Reflect.decorate(u, e, t, i);
|
|
131
|
-
else
|
|
132
|
-
for (var a = u.length - 1; a >= 0; a--)
|
|
133
|
-
(n = u[a]) && (o = (s < 3 ? n(o) : s > 3 ? n(e, t, o) : n(e, t)) || o);
|
|
134
|
-
return s > 3 && o && Object.defineProperty(e, t, o), o;
|
|
135
|
-
};
|
|
136
|
-
const g = "scroll-lock";
|
|
137
|
-
let l = class extends y {
|
|
138
|
-
constructor() {
|
|
139
|
-
super(), this.unsubscribe = [], this.abortController = void 0, this.open = r.state.open, this.caipAddress = h.state.activeCaipAddress, this.caipNetwork = h.state.activeCaipNetwork, this.isSiweEnabled = f.state.isSiweEnabled, this.shake = r.state.shake, this.initializeTheming(), k.prefetch(), this.unsubscribe.push(r.subscribeKey("open", (e) => e ? this.onOpen() : this.onClose()), r.subscribeKey("shake", (e) => this.shake = e), p.subscribeKey("siweStatus", (e) => this.onSiweStatusChange(e), "eip155"), h.subscribeKey("activeCaipNetwork", (e) => this.onNewNetwork(e)), h.subscribeKey("activeCaipAddress", (e) => this.onNewAddress(e)), f.subscribeKey("isSiweEnabled", (e) => this.isSiweEnabled = e)), C.sendEvent({ type: "track", event: "MODAL_LOADED" });
|
|
140
|
-
}
|
|
141
|
-
disconnectedCallback() {
|
|
142
|
-
this.unsubscribe.forEach((e) => e()), this.onRemoveKeyboardListener();
|
|
143
|
-
}
|
|
144
|
-
render() {
|
|
145
|
-
return this.open ? S`
|
|
146
|
-
<wui-flex @click=${this.onOverlayClick.bind(this)} data-testid="w3m-modal-overlay">
|
|
147
|
-
<wui-card
|
|
148
|
-
shake="${this.shake}"
|
|
149
|
-
role="alertdialog"
|
|
150
|
-
aria-modal="true"
|
|
151
|
-
tabindex="0"
|
|
152
|
-
data-testid="w3m-modal-card"
|
|
153
|
-
>
|
|
154
|
-
<w3m-header></w3m-header>
|
|
155
|
-
<w3m-router></w3m-router>
|
|
156
|
-
<w3m-snackbar></w3m-snackbar>
|
|
157
|
-
<w3m-alertbar></w3m-alertbar>
|
|
158
|
-
</wui-card>
|
|
159
|
-
</wui-flex>
|
|
160
|
-
<w3m-tooltip></w3m-tooltip>
|
|
161
|
-
` : null;
|
|
162
|
-
}
|
|
163
|
-
async onOverlayClick(e) {
|
|
164
|
-
e.target === e.currentTarget && await this.handleClose();
|
|
165
|
-
}
|
|
166
|
-
async handleClose() {
|
|
167
|
-
const e = c.state.view === "ConnectingSiwe", t = c.state.view === "ApproveTransaction";
|
|
168
|
-
if (this.isSiweEnabled) {
|
|
169
|
-
const { SIWEController: i } = await import("./index-2d-aRmQF.js");
|
|
170
|
-
i.state.status !== "success" && (e || t) ? r.shake() : r.close();
|
|
171
|
-
} else
|
|
172
|
-
r.close();
|
|
173
|
-
}
|
|
174
|
-
initializeTheming() {
|
|
175
|
-
const { themeVariables: e, themeMode: t } = L.state, i = x.getColorTheme(t);
|
|
176
|
-
A(e, i);
|
|
177
|
-
}
|
|
178
|
-
onClose() {
|
|
179
|
-
this.open = !1, this.classList.remove("open"), this.onScrollUnlock(), E.hide(), this.onRemoveKeyboardListener();
|
|
180
|
-
}
|
|
181
|
-
onOpen() {
|
|
182
|
-
this.open = !0, this.classList.add("open"), this.onScrollLock(), this.onAddKeyboardListener();
|
|
183
|
-
}
|
|
184
|
-
onScrollLock() {
|
|
185
|
-
const e = document.createElement("style");
|
|
186
|
-
e.dataset.w3m = g, e.textContent = `
|
|
187
|
-
body {
|
|
188
|
-
touch-action: none;
|
|
189
|
-
overflow: hidden;
|
|
190
|
-
overscroll-behavior: contain;
|
|
191
|
-
}
|
|
192
|
-
w3m-modal {
|
|
193
|
-
pointer-events: auto;
|
|
194
|
-
}
|
|
195
|
-
`, document.head.appendChild(e);
|
|
196
|
-
}
|
|
197
|
-
onScrollUnlock() {
|
|
198
|
-
const e = document.head.querySelector(`style[data-w3m="${g}"]`);
|
|
199
|
-
e && e.remove();
|
|
200
|
-
}
|
|
201
|
-
onAddKeyboardListener() {
|
|
202
|
-
var t;
|
|
203
|
-
this.abortController = new AbortController();
|
|
204
|
-
const e = (t = this.shadowRoot) == null ? void 0 : t.querySelector("wui-card");
|
|
205
|
-
e == null || e.focus(), window.addEventListener("keydown", (i) => {
|
|
206
|
-
if (i.key === "Escape")
|
|
207
|
-
this.handleClose();
|
|
208
|
-
else if (i.key === "Tab") {
|
|
209
|
-
const { tagName: s } = i.target;
|
|
210
|
-
s && !s.includes("W3M-") && !s.includes("WUI-") && (e == null || e.focus());
|
|
211
|
-
}
|
|
212
|
-
}, this.abortController);
|
|
213
|
-
}
|
|
214
|
-
onRemoveKeyboardListener() {
|
|
215
|
-
var e;
|
|
216
|
-
(e = this.abortController) == null || e.abort(), this.abortController = void 0;
|
|
217
|
-
}
|
|
218
|
-
onSiweStatusChange(e) {
|
|
219
|
-
e === "success" && r.close();
|
|
220
|
-
}
|
|
221
|
-
async onNewAddress(e) {
|
|
222
|
-
var n;
|
|
223
|
-
const t = this.caipAddress, i = t ? b.getPlainAddress(t) : void 0, s = e ? b.getPlainAddress(e) : void 0, o = i === s;
|
|
224
|
-
if (this.caipAddress = e, s && !o && this.isSiweEnabled)
|
|
225
|
-
try {
|
|
226
|
-
const { SIWEController: a } = await import("./index-2d-aRmQF.js"), m = p.state.siweStatus === "success";
|
|
227
|
-
!i && s ? this.onSiweNavigation() : m && i && s && i !== s && (n = a.state._client) != null && n.options.signOutOnAccountChange && (await a.signOut(), this.onSiweNavigation());
|
|
228
|
-
} catch (a) {
|
|
229
|
-
throw this.caipAddress = t, a;
|
|
230
|
-
}
|
|
231
|
-
s || r.close();
|
|
232
|
-
}
|
|
233
|
-
async onNewNetwork(e) {
|
|
234
|
-
var s, o, n, a;
|
|
235
|
-
if (!this.caipAddress) {
|
|
236
|
-
this.caipNetwork = e, c.goBack();
|
|
237
|
-
return;
|
|
238
|
-
}
|
|
239
|
-
const t = (o = (s = this.caipNetwork) == null ? void 0 : s.caipNetworkId) == null ? void 0 : o.toString(), i = (n = e == null ? void 0 : e.caipNetworkId) == null ? void 0 : n.toString();
|
|
240
|
-
if (t && i && t !== i)
|
|
241
|
-
if (this.isSiweEnabled) {
|
|
242
|
-
const { SIWEController: m } = await import("./index-2d-aRmQF.js");
|
|
243
|
-
(a = m.state._client) != null && a.options.signOutOnNetworkChange ? (await m.signOut(), this.onSiweNavigation()) : c.goBack();
|
|
244
|
-
} else
|
|
245
|
-
c.goBack();
|
|
246
|
-
this.caipNetwork = e;
|
|
247
|
-
}
|
|
248
|
-
onSiweNavigation() {
|
|
249
|
-
const e = h.state.activeChain === N.CHAIN.EVM;
|
|
250
|
-
!(p.state.siweStatus === "success") && e ? this.open ? c.replace("ConnectingSiwe") : r.open({
|
|
251
|
-
view: "ConnectingSiwe"
|
|
252
|
-
}) : c.goBack();
|
|
253
|
-
}
|
|
254
|
-
};
|
|
255
|
-
l.styles = K;
|
|
256
|
-
d([
|
|
257
|
-
w()
|
|
258
|
-
], l.prototype, "open", void 0);
|
|
259
|
-
d([
|
|
260
|
-
w()
|
|
261
|
-
], l.prototype, "caipAddress", void 0);
|
|
262
|
-
d([
|
|
263
|
-
w()
|
|
264
|
-
], l.prototype, "caipNetwork", void 0);
|
|
265
|
-
d([
|
|
266
|
-
w()
|
|
267
|
-
], l.prototype, "isSiweEnabled", void 0);
|
|
268
|
-
d([
|
|
269
|
-
w()
|
|
270
|
-
], l.prototype, "shake", void 0);
|
|
271
|
-
l = d([
|
|
272
|
-
O("w3m-modal")
|
|
273
|
-
], l);
|
|
274
|
-
export {
|
|
275
|
-
l as W3mModal
|
|
276
|
-
};
|