1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[237],{67237:function(e,t,o){o.r(t),o.d(t,{W3mModal:function(){return p}});var i=o(31133),a=o(84927),r=o(32801),s=o(83370),n=o(4927),l=o(44159),d=(0,i.iv)` 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 :host(.embedded) { 24 position: relative; 25 pointer-events: unset; 26 background: none; 27 width: 100%; 28 opacity: 1; 29 } 30 31 wui-card { 32 max-width: var(--w3m-modal-width); 33 width: 100%; 34 position: relative; 35 animation: zoom-in 0.2s var(--wui-ease-out-power-2); 36 animation-fill-mode: backwards; 37 outline: none; 38 transition: 39 border-radius var(--wui-duration-lg) var(--wui-ease-out-power-1), 40 background-color var(--wui-duration-lg) var(--wui-ease-out-power-1); 41 will-change: border-radius, background-color; 42 } 43 44 :host(.embedded) wui-card { 45 max-width: 400px; 46 } 47 48 wui-card[shake='true'] { 49 animation: 50 zoom-in 0.2s var(--wui-ease-out-power-2), 51 w3m-shake 0.5s var(--wui-ease-out-power-2); 52 } 53 54 wui-flex { 55 overflow-x: hidden; 56 overflow-y: auto; 57 display: flex; 58 align-items: center; 59 justify-content: center; 60 width: 100%; 61 height: 100%; 62 } 63 64 @media (max-height: 700px) and (min-width: 431px) { 65 wui-flex { 66 align-items: flex-start; 67 } 68 69 wui-card { 70 margin: var(--wui-spacing-xxl) 0px; 71 } 72 } 73 74 @media (max-width: 430px) { 75 wui-flex { 76 align-items: flex-end; 77 } 78 79 wui-card { 80 max-width: 100%; 81 border-bottom-left-radius: var(--local-border-bottom-mobile-radius); 82 border-bottom-right-radius: var(--local-border-bottom-mobile-radius); 83 border-bottom: none; 84 animation: slide-in 0.2s var(--wui-ease-out-power-2); 85 } 86 87 wui-card[shake='true'] { 88 animation: 89 slide-in 0.2s var(--wui-ease-out-power-2), 90 w3m-shake 0.5s var(--wui-ease-out-power-2); 91 } 92 } 93 94 @keyframes zoom-in { 95 0% { 96 transform: scale(0.95) translateY(0); 97 } 98 100% { 99 transform: scale(1) translateY(0); 100 } 101 } 102 103 @keyframes slide-in { 104 0% { 105 transform: scale(1) translateY(50px); 106 } 107 100% { 108 transform: scale(1) translateY(0); 109 } 110 } 111 112 @keyframes w3m-shake { 113 0% { 114 transform: scale(1) rotate(0deg); 115 } 116 20% { 117 transform: scale(1) rotate(-1deg); 118 } 119 40% { 120 transform: scale(1) rotate(1.5deg); 121 } 122 60% { 123 transform: scale(1) rotate(-1.5deg); 124 } 125 80% { 126 transform: scale(1) rotate(1deg); 127 } 128 100% { 129 transform: scale(1) rotate(0deg); 130 } 131 } 132 133 @keyframes w3m-view-height { 134 from { 135 height: var(--prev-height); 136 } 137 to { 138 height: var(--new-height); 139 } 140 } 141`,c=function(e,t,o,i){var a,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var n=e.length-1;n>=0;n--)(a=e[n])&&(s=(r<3?a(s):r>3?a(t,o,s):a(t,o))||s);return r>3&&s&&Object.defineProperty(t,o,s),s};let h="scroll-lock",p=class extends i.oi{constructor(){super(),this.unsubscribe=[],this.abortController=void 0,this.enableEmbedded=n.OptionsController.state.enableEmbedded,this.open=n.IN.state.open,this.caipAddress=n.RY.state.activeCaipAddress,this.caipNetwork=n.RY.state.activeCaipNetwork,this.shake=n.IN.state.shake,this.initializeTheming(),n.ApiController.prefetch(),this.unsubscribe.push(n.IN.subscribeKey("open",e=>e?this.onOpen():this.onClose()),n.IN.subscribeKey("shake",e=>this.shake=e),n.RY.subscribeKey("activeCaipNetwork",e=>this.onNewNetwork(e)),n.RY.subscribeKey("activeCaipAddress",e=>this.onNewAddress(e)),n.OptionsController.subscribeKey("enableEmbedded",e=>this.enableEmbedded=e)),n.Xs.sendEvent({type:"track",event:"MODAL_LOADED"})}firstUpdated(){if(this.caipAddress){if(this.enableEmbedded){n.IN.close();return}this.onNewAddress(this.caipAddress)}this.open&&this.onOpen()}
141disconnectedCallback(){this.unsubscribe.forEach(e=>e()),this.onRemoveKeyboardListener()}render(){return(this.style.cssText=` 142 --local-border-bottom-mobile-radius: ${this.enableEmbedded?"clamp(0px, var(--wui-border-radius-l), 44px)":"0px"}; 143 `,this.enableEmbedded)?(0,i.dy)`${this.contentTemplate()} 144 <w3m-tooltip></w3m-tooltip> `:this.open?(0,i.dy)` 145 <wui-flex @click=${this.onOverlayClick.bind(this)} data-testid="w3m-modal-overlay"> 146 ${this.contentTemplate()} 147 </wui-flex> 148 <w3m-tooltip></w3m-tooltip> 149 `:null}contentTemplate(){return(0,i.dy)` <wui-card 150 shake="${this.shake}" 151 data-embedded="${(0,r.o)(this.enableEmbedded)}" 152 role="alertdialog" 153 aria-modal="true" 154 tabindex="0" 155 data-testid="w3m-modal-card" 156 > 157 <w3m-header></w3m-header> 158 <w3m-router></w3m-router> 159 <w3m-snackbar></w3m-snackbar> 160 <w3m-alertbar></w3m-alertbar> 161 </wui-card>`}async onOverlayClick(e){e.target===e.currentTarget&&await this.handleClose()}async handleClose(){"UnsupportedChain"===n.RouterController.state.view||await n.wf.isSIWXCloseDisabled()?n.IN.shake():n.IN.close()}initializeTheming(){let{themeVariables:e,themeMode:t}=n.ThemeController.state,o=l.UiHelperUtil.getColorTheme(t);(0,l.initializeTheming)(e,o)}onClose(){this.open=!1,this.classList.remove("open"),this.onScrollUnlock(),n.SnackController.hide(),this.onRemoveKeyboardListener()}onOpen(){this.open=!0,this.classList.add("open"),this.onScrollLock(),this.onAddKeyboardListener()}onScrollLock(){let e=document.createElement("style");e.dataset.w3m=h,e.textContent=` 162 body { 163 touch-action: none; 164 overflow: hidden; 165 overscroll-behavior: contain; 166 } 167 w3m-modal { 168 pointer-events: auto; 169 } 170 `,document.head.appendChild(e)}onScrollUnlock(){let e=document.head.querySelector(`style[data-w3m="${h}"]`);e&&e.remove()}onAddKeyboardListener(){this.abortController=new AbortController;let e=this.shadowRoot?.querySelector("wui-card");e?.focus(),window.addEventListener("keydown",t=>{if("Escape"===t.key)this.handleClose();else if("Tab"===t.key){let{tagName:o}=t.target;!o||o.includes("W3M-")||o.includes("WUI-")||e?.focus()}},this.abortController)}onRemoveKeyboardListener(){this.abortController?.abort(),this.abortController=void 0}async onNewAddress(e){let t=n.RY.state.isSwitchingNamespace,o=n.j1.getPlainAddress(e);o||t?t&&o&&n.RouterController.goBack():n.IN.close(),await n.wf.initializeIfEnabled(),this.caipAddress=e,n.RY.setIsSwitchingNamespace(!1)}onNewNetwork(e){n.ApiController.prefetch();let t=this.caipNetwork?.caipNetworkId?.toString(),o=e?.caipNetworkId?.toString(),i=n.RY.state.isSwitchingNamespace,a=this.caipNetwork?.name===s.bq.UNSUPPORTED_NETWORK_NAME,r="ConnectingExternal"===n.RouterController.state.view,l=!this.caipAddress,d="UnsupportedChain"===n.RouterController.state.view;!r&&(l||d||t&&o&&t!==o&&!a&&!i)&&n.RouterController.goBack(),this.caipNetwork=e}};p.styles=d,c([(0,a.Cb)({type:Boolean})],p.prototype,"enableEmbedded",void 0),c([(0,a.SB)()],p.prototype,"open",void 0),c([(0,a.SB)()],p.prototype,"caipAddress",void 0),c([(0,a.SB)()],p.prototype,"caipNetwork",void 0),c([(0,a.SB)()],p.prototype,"shake",void 0),p=c([(0,l.customElement)("w3m-modal")],p)}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.