import{M as t,a6 as e,R as i,o,j as a,r as n,l as s,m as r,x as l,k as c,C as d,J as u,a1 as h,v as p,E as f,O as m,z as w,n as g,S as b,I as x,T as v,a7 as y,a8 as k}from"./p-BxEPsDRj.js";import{c as $,n as C,r as S,U as R}from"./p-CrMmJdZ6.js";import{o as j}from"./p-zNe_7rLp.js";import{P as W}from"./p-DsIfsp4b.js";import"./p-CbOrugAV.js";import{H as z}from"./p-DO7_rlGh.js";import{C as O}from"./p-DtZPtFUa.js";import"./p-WZF-tHaR.js";import"./p-DJATscC5.js";import"./p-DujiERu9.js";import"./p-Cesxc720.js";import{S as A}from"./p-fC-zSJu1.js";import"./p-CG_zIdXa.js";import"./p-BId5WtRC.js";import"buffer";import"events";import"ox";import"viem";import"viem/chains";import"./p-DntCYpai.js";import"./p-QEmqEl1n.js";import"./p-4_J16YIF.js";import"./p-CUUFsMGb.js";import"./p-08zq6pz3.js";import"./p-wMYIvr92.js";import"./p-CsctQ88z.js";import"./p-YV_GhS6X.js";const I={isUnsupportedChainView(){return i.state.view==="UnsupportedChain"||i.state.view==="SwitchNetwork"&&i.state.history.includes("UnsupportedChain")},async safeClose(){if(this.isUnsupportedChainView()){t.shake();return}const a=await e.isSIWXCloseDisabled();if(a){t.shake();return}if(i.state.view==="DataCapture"||i.state.view==="DataCaptureOtpConfirm"){o.disconnect()}t.close()}};var E=a`
  :host {
    display: block;
    border-radius: clamp(0px, ${({borderRadius:t})=>t["8"]}, 44px);
    box-shadow: 0 0 0 1px ${({tokens:t})=>t.theme.foregroundPrimary};
    overflow: hidden;
  }
`;var T=undefined&&undefined.__decorate||function(t,e,i,o){var a=arguments.length,n=a<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)if(s=t[r])n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n;return a>3&&n&&Object.defineProperty(e,i,n),n};let P=class t extends s{render(){return r`<slot></slot>`}};P.styles=[n,E];P=T([$("wui-card")],P);var N=a`
  :host {
    width: 100%;
  }

  :host > wui-flex {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: ${({spacing:t})=>t[2]};
    padding: ${({spacing:t})=>t[3]};
    border-radius: ${({borderRadius:t})=>t[6]};
    border: 1px solid ${({tokens:t})=>t.theme.borderPrimary};
    box-sizing: border-box;
    background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
    box-shadow: 0px 0px 16px 0px rgba(0, 0, 0, 0.25);
    color: ${({tokens:t})=>t.theme.textPrimary};
  }

  :host > wui-flex[data-type='info'] {
    .icon-box {
      background-color: ${({tokens:t})=>t.theme.foregroundSecondary};

      wui-icon {
        color: ${({tokens:t})=>t.theme.iconDefault};
      }
    }
  }
  :host > wui-flex[data-type='success'] {
    .icon-box {
      background-color: ${({tokens:t})=>t.core.backgroundSuccess};

      wui-icon {
        color: ${({tokens:t})=>t.core.borderSuccess};
      }
    }
  }
  :host > wui-flex[data-type='warning'] {
    .icon-box {
      background-color: ${({tokens:t})=>t.core.backgroundWarning};

      wui-icon {
        color: ${({tokens:t})=>t.core.borderWarning};
      }
    }
  }
  :host > wui-flex[data-type='error'] {
    .icon-box {
      background-color: ${({tokens:t})=>t.core.backgroundError};

      wui-icon {
        color: ${({tokens:t})=>t.core.borderError};
      }
    }
  }

  wui-flex {
    width: 100%;
  }

  wui-text {
    word-break: break-word;
    flex: 1;
  }

  .close {
    cursor: pointer;
    color: ${({tokens:t})=>t.theme.iconDefault};
  }

  .icon-box {
    height: 40px;
    width: 40px;
    border-radius: ${({borderRadius:t})=>t["2"]};
    background-color: var(--local-icon-bg-value);
  }
`;var D=undefined&&undefined.__decorate||function(t,e,i,o){var a=arguments.length,n=a<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)if(s=t[r])n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n;return a>3&&n&&Object.defineProperty(e,i,n),n};const B={info:"info",success:"checkmark",warning:"warningCircle",error:"warning"};let L=class t extends s{constructor(){super(...arguments);this.message="";this.type="info"}render(){return r`
      <wui-flex
        data-type=${j(this.type)}
        flexDirection="row"
        justifyContent="space-between"
        alignItems="center"
        gap="2"
      >
        <wui-flex columnGap="2" flexDirection="row" alignItems="center">
          <wui-flex
            flexDirection="row"
            alignItems="center"
            justifyContent="center"
            class="icon-box"
          >
            <wui-icon color="inherit" size="md" name=${B[this.type]}></wui-icon>
          </wui-flex>
          <wui-text variant="md-medium" color="inherit" data-testid="wui-alertbar-text"
            >${this.message}</wui-text
          >
        </wui-flex>
        <wui-icon
          class="close"
          color="inherit"
          size="sm"
          name="close"
          @click=${this.onClose}
        ></wui-icon>
      </wui-flex>
    `}onClose(){l.close()}};L.styles=[n,N];D([C()],L.prototype,"message",void 0);D([C()],L.prototype,"type",void 0);L=D([$("wui-alertbar")],L);var U=a`
  :host {
    display: block;
    position: absolute;
    top: ${({spacing:t})=>t["3"]};
    left: ${({spacing:t})=>t["4"]};
    right: ${({spacing:t})=>t["4"]};
    opacity: 0;
    pointer-events: none;
  }
`;var Y=undefined&&undefined.__decorate||function(t,e,i,o){var a=arguments.length,n=a<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)if(s=t[r])n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n;return a>3&&n&&Object.defineProperty(e,i,n),n};const F={info:{backgroundColor:"fg-350",iconColor:"fg-325",icon:"info"},success:{backgroundColor:"success-glass-reown-020",iconColor:"success-125",icon:"checkmark"},warning:{backgroundColor:"warning-glass-reown-020",iconColor:"warning-100",icon:"warningCircle"},error:{backgroundColor:"error-glass-reown-020",iconColor:"error-125",icon:"warning"}};let X=class t extends s{constructor(){super();this.unsubscribe=[];this.open=l.state.open;this.onOpen(true);this.unsubscribe.push(l.subscribeKey("open",(t=>{this.open=t;this.onOpen(false)})))}disconnectedCallback(){this.unsubscribe.forEach((t=>t()))}render(){const{message:t,variant:e}=l.state;const i=F[e];return r`
      <wui-alertbar
        message=${t}
        backgroundColor=${i?.backgroundColor}
        iconColor=${i?.iconColor}
        icon=${i?.icon}
        type=${e}
      ></wui-alertbar>
    `}onOpen(t){if(this.open){this.animate([{opacity:0,transform:"scale(0.85)"},{opacity:1,transform:"scale(1)"}],{duration:150,fill:"forwards",easing:"ease"});this.style.cssText=`pointer-events: auto`}else if(!t){this.animate([{opacity:1,transform:"scale(1)"},{opacity:0,transform:"scale(0.85)"}],{duration:150,fill:"forwards",easing:"ease"});this.style.cssText=`pointer-events: none`}}};X.styles=U;Y([S()],X.prototype,"open",void 0);X=Y([$("w3m-alertbar")],X);var H=a`
  button {
    display: block;
    display: flex;
    align-items: center;
    padding: ${({spacing:t})=>t[1]};
    transition: background-color ${({durations:t})=>t["lg"]}
      ${({easings:t})=>t["ease-out-power-2"]};
    will-change: background-color;
    border-radius: ${({borderRadius:t})=>t[32]};
  }

  wui-image {
    border-radius: 100%;
  }

  wui-text {
    padding-left: ${({spacing:t})=>t[1]};
  }

  .left-icon-container,
  .right-icon-container {
    width: 24px;
    height: 24px;
    justify-content: center;
    align-items: center;
  }

  wui-icon {
    color: ${({tokens:t})=>t.theme.iconDefault};
  }

  /* -- Sizes --------------------------------------------------- */
  button[data-size='lg'] {
    height: 32px;
  }

  button[data-size='md'] {
    height: 28px;
  }

  button[data-size='sm'] {
    height: 24px;
  }

  button[data-size='lg'] wui-image {
    width: 24px;
    height: 24px;
  }

  button[data-size='md'] wui-image {
    width: 20px;
    height: 20px;
  }

  button[data-size='sm'] wui-image {
    width: 16px;
    height: 16px;
  }

  button[data-size='lg'] .left-icon-container {
    width: 24px;
    height: 24px;
  }

  button[data-size='md'] .left-icon-container {
    width: 20px;
    height: 20px;
  }

  button[data-size='sm'] .left-icon-container {
    width: 16px;
    height: 16px;
  }

  /* -- Variants --------------------------------------------------------- */
  button[data-type='filled-dropdown'] {
    background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
  }

  button[data-type='text-dropdown'] {
    background-color: transparent;
  }

  /* -- Focus states --------------------------------------------------- */
  button:focus-visible:enabled {
    background-color: ${({tokens:t})=>t.theme.foregroundSecondary};
    box-shadow: 0 0 0 4px ${({tokens:t})=>t.core.foregroundAccent040};
  }

  /* -- Hover & Active states ----------------------------------------------------------- */
  @media (hover: hover) and (pointer: fine) {
    button:hover:enabled,
    button:active:enabled {
      background-color: ${({tokens:t})=>t.theme.foregroundSecondary};
    }
  }

  /* -- Disabled states --------------------------------------------------- */
  button:disabled {
    background-color: ${({tokens:t})=>t.theme.foregroundSecondary};
    opacity: 0.5;
  }
`;var V=undefined&&undefined.__decorate||function(t,e,i,o){var a=arguments.length,n=a<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)if(s=t[r])n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n;return a>3&&n&&Object.defineProperty(e,i,n),n};const G={lg:"lg-regular",md:"md-regular",sm:"sm-regular"};const M={lg:"lg",md:"md",sm:"sm"};let _=class t extends s{constructor(){super(...arguments);this.imageSrc="";this.text="";this.size="lg";this.type="text-dropdown";this.disabled=false}render(){return r`<button ?disabled=${this.disabled} data-size=${this.size} data-type=${this.type}>
      ${this.imageTemplate()} ${this.textTemplate()}
      <wui-flex class="right-icon-container">
        <wui-icon name="chevronBottom"></wui-icon>
      </wui-flex>
    </button>`}textTemplate(){const t=G[this.size];if(this.text){return r`<wui-text color="primary" variant=${t}>${this.text}</wui-text>`}return null}imageTemplate(){if(this.imageSrc){return r`<wui-image src=${this.imageSrc} alt="select visual"></wui-image>`}const t=M[this.size];return r` <wui-flex class="left-icon-container">
      <wui-icon size=${t} name="networkPlaceholder"></wui-icon>
    </wui-flex>`}};_.styles=[n,c,H];V([C()],_.prototype,"imageSrc",void 0);V([C()],_.prototype,"text",void 0);V([C()],_.prototype,"size",void 0);V([C()],_.prototype,"type",void 0);V([C({type:Boolean})],_.prototype,"disabled",void 0);_=V([$("wui-select")],_);var Q=a`
  wui-image {
    border-radius: ${({borderRadius:t})=>t.round};
  }

  .transfers-badge {
    background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
    border: 1px solid ${({tokens:t})=>t.theme.foregroundSecondary};
    border-radius: ${({borderRadius:t})=>t[4]};
  }
`;var J=undefined&&undefined.__decorate||function(t,e,i,o){var a=arguments.length,n=a<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)if(s=t[r])n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n;return a>3&&n&&Object.defineProperty(e,i,n),n};let K=class t extends s{constructor(){super();this.unsubscribe=[];this.paymentAsset=W.state.paymentAsset;this.amount=W.state.amount;this.unsubscribe.push(W.subscribeKey("paymentAsset",(t=>{this.paymentAsset=t})),W.subscribeKey("amount",(t=>{this.amount=t})))}disconnectedCallback(){this.unsubscribe.forEach((t=>t()))}render(){const t=d.getAllRequestedCaipNetworks();const e=t.find((t=>t.caipNetworkId===this.paymentAsset.network));return r`<wui-flex
      alignItems="center"
      gap="1"
      .padding=${["1","2","1","1"]}
      class="transfers-badge"
    >
      <wui-image src=${j(this.paymentAsset.metadata.logoURI)} size="xl"></wui-image>
      <wui-text variant="lg-regular" color="primary">
        ${this.amount} ${this.paymentAsset.metadata.symbol}
      </wui-text>
      <wui-text variant="sm-regular" color="secondary">
        on ${e?.name??"Unknown"}
      </wui-text>
    </wui-flex>`}};K.styles=[Q];J([C()],K.prototype,"paymentAsset",void 0);J([C()],K.prototype,"amount",void 0);K=J([$("w3m-pay-header")],K);var Z=a`
  :host {
    height: 60px;
  }

  :host > wui-flex {
    box-sizing: border-box;
    background-color: var(--local-header-background-color);
  }

  wui-text {
    background-color: var(--local-header-background-color);
  }

  wui-flex.w3m-header-title {
    transform: translateY(0);
    opacity: 1;
  }

  wui-flex.w3m-header-title[view-direction='prev'] {
    animation:
      slide-down-out 120ms forwards ${({easings:t})=>t["ease-out-power-2"]},
      slide-down-in 120ms forwards ${({easings:t})=>t["ease-out-power-2"]};
    animation-delay: 0ms, 200ms;
  }

  wui-flex.w3m-header-title[view-direction='next'] {
    animation:
      slide-up-out 120ms forwards ${({easings:t})=>t["ease-out-power-2"]},
      slide-up-in 120ms forwards ${({easings:t})=>t["ease-out-power-2"]};
    animation-delay: 0ms, 200ms;
  }

  wui-icon-button[data-hidden='true'] {
    opacity: 0 !important;
    pointer-events: none;
  }

  @keyframes slide-up-out {
    from {
      transform: translateY(0px);
      opacity: 1;
    }
    to {
      transform: translateY(3px);
      opacity: 0;
    }
  }

  @keyframes slide-up-in {
    from {
      transform: translateY(-3px);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  @keyframes slide-down-out {
    from {
      transform: translateY(0px);
      opacity: 1;
    }
    to {
      transform: translateY(-3px);
      opacity: 0;
    }
  }

  @keyframes slide-down-in {
    from {
      transform: translateY(3px);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
`;var q=undefined&&undefined.__decorate||function(t,e,i,o){var a=arguments.length,n=a<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)if(s=t[r])n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n;return a>3&&n&&Object.defineProperty(e,i,n),n};const tt=["SmartSessionList"];const et={PayWithExchange:p.tokens.theme.foregroundPrimary};function it(){const t=i.state.data?.connector?.name;const e=i.state.data?.wallet?.name;const o=i.state.data?.network?.name;const a=e??t;const n=w.getConnectors();const s=n.length===1&&n[0]?.id==="w3m-email";const r=d.getAccountData()?.socialProvider;const l=r?r.charAt(0).toUpperCase()+r.slice(1):"Connect Social";return{Connect:`Connect ${s?"Email":""} Wallet`,Create:"Create Wallet",ChooseAccountName:undefined,Account:undefined,AccountSettings:undefined,AllWallets:"All Wallets",ApproveTransaction:"Approve Transaction",BuyInProgress:"Buy",UsageExceeded:"Usage Exceeded",ConnectingExternal:a??"Connect Wallet",ConnectingWalletConnect:a??"WalletConnect",ConnectingWalletConnectBasic:"WalletConnect",ConnectingSiwe:"Sign In",Convert:"Convert",ConvertSelectToken:"Select token",ConvertPreview:"Preview Convert",Downloads:a?`Get ${a}`:"Downloads",EmailLogin:"Email Login",EmailVerifyOtp:"Confirm Email",EmailVerifyDevice:"Register Device",GetWallet:"Get a Wallet",Networks:"Choose Network",OnRampProviders:"Choose Provider",OnRampActivity:"Activity",OnRampTokenSelect:"Select Token",OnRampFiatSelect:"Select Currency",Pay:"How you pay",ProfileWallets:"Wallets",SwitchNetwork:o??"Switch Network",Transactions:"Activity",UnsupportedChain:"Switch Network",UpgradeEmailWallet:"Upgrade Your Wallet",UpdateEmailWallet:"Edit Email",UpdateEmailPrimaryOtp:"Confirm Current Email",UpdateEmailSecondaryOtp:"Confirm New Email",WhatIsABuy:"What is Buy?",RegisterAccountName:"Choose Name",RegisterAccountNameSuccess:"",WalletReceive:"Receive",WalletCompatibleNetworks:"Compatible Networks",Swap:"Swap",SwapSelectToken:"Select Token",SwapPreview:"Preview Swap",WalletSend:"Send",WalletSendPreview:"Review Send",WalletSendSelectToken:"Select Token",WalletSendConfirmed:"Confirmed",WhatIsANetwork:"What is a network?",WhatIsAWallet:"What is a Wallet?",ConnectWallets:"Connect Wallet",ConnectSocials:"All Socials",ConnectingSocial:l,ConnectingMultiChain:"Select Chain",ConnectingFarcaster:"Farcaster",SwitchActiveChain:"Switch Chain",SmartSessionCreated:undefined,SmartSessionList:"Smart Sessions",SIWXSignMessage:"Sign In",PayLoading:"Processing payment...",PayQuote:"Payment Quote",DataCapture:"Profile",DataCaptureOtpConfirm:"Confirm Email",FundWallet:"Fund Wallet",PayWithExchange:"Deposit from Exchange",PayWithExchangeSelectAsset:"Select Asset",SmartAccountSettings:"Smart Account Settings"}}let ot=class t extends s{constructor(){super();this.unsubscribe=[];this.heading=it()[i.state.view];this.network=d.state.activeCaipNetwork;this.networkImage=u.getNetworkImage(this.network);this.showBack=false;this.prevHistoryLength=1;this.view=i.state.view;this.viewDirection="";this.unsubscribe.push(h.subscribeNetworkImages((()=>{this.networkImage=u.getNetworkImage(this.network)})),i.subscribeKey("view",(t=>{setTimeout((()=>{this.view=t;this.heading=it()[t]}),O.ANIMATION_DURATIONS.HeaderText);this.onViewChange();this.onHistoryChange()})),d.subscribeKey("activeCaipNetwork",(t=>{this.network=t;this.networkImage=u.getNetworkImage(this.network)})))}disconnectCallback(){this.unsubscribe.forEach((t=>t()))}render(){const t=et[i.state.view]??p.tokens.theme.backgroundPrimary;this.style.setProperty("--local-header-background-color",t);return r`
      <wui-flex
        .padding=${["0","4","0","4"]}
        justifyContent="space-between"
        alignItems="center"
      >
        ${this.leftHeaderTemplate()} ${this.titleTemplate()} ${this.rightHeaderTemplate()}
      </wui-flex>
    `}onWalletHelp(){f.sendEvent({type:"track",event:"CLICK_WALLET_HELP"});i.push("WhatIsAWallet")}async onClose(){await I.safeClose()}rightHeaderTemplate(){const t=m?.state?.features?.smartSessions;if(i.state.view!=="Account"||!t){return this.closeButtonTemplate()}return r`<wui-flex>
      <wui-icon-button
        icon="clock"
        size="lg"
        iconSize="lg"
        type="neutral"
        variant="primary"
        @click=${()=>i.push("SmartSessionList")}
        data-testid="w3m-header-smart-sessions"
      ></wui-icon-button>
      ${this.closeButtonTemplate()}
    </wui-flex> `}closeButtonTemplate(){return r`
      <wui-icon-button
        icon="close"
        size="lg"
        type="neutral"
        variant="primary"
        iconSize="lg"
        @click=${this.onClose.bind(this)}
        data-testid="w3m-header-close"
      ></wui-icon-button>
    `}titleTemplate(){if(this.view==="PayQuote"){return r`<w3m-pay-header></w3m-pay-header>`}const t=tt.includes(this.view);return r`
      <wui-flex
        view-direction="${this.viewDirection}"
        class="w3m-header-title"
        alignItems="center"
        gap="2"
      >
        <wui-text
          display="inline"
          variant="lg-regular"
          color="primary"
          data-testid="w3m-header-text"
        >
          ${this.heading}
        </wui-text>
        ${t?r`<wui-tag variant="accent" size="md">Beta</wui-tag>`:null}
      </wui-flex>
    `}leftHeaderTemplate(){const{view:t}=i.state;const e=t==="Connect";const o=m.state.enableEmbedded;const a=t==="ApproveTransaction";const n=t==="ConnectingSiwe";const s=t==="Account";const l=m.state.enableNetworkSwitch;const c=a||n||e&&o;if(s&&l){return r`<wui-select
        id="dynamic"
        data-testid="w3m-account-select-network"
        active-network=${j(this.network?.name)}
        @click=${this.onNetworks.bind(this)}
        imageSrc=${j(this.networkImage)}
      ></wui-select>`}if(this.showBack&&!c){return r`<wui-icon-button
        data-testid="header-back"
        id="dynamic"
        icon="chevronLeft"
        size="lg"
        iconSize="lg"
        type="neutral"
        variant="primary"
        @click=${this.onGoBack.bind(this)}
      ></wui-icon-button>`}return r`<wui-icon-button
      data-hidden=${!e}
      id="dynamic"
      icon="helpCircle"
      size="lg"
      iconSize="lg"
      type="neutral"
      variant="primary"
      @click=${this.onWalletHelp.bind(this)}
    ></wui-icon-button>`}onNetworks(){if(this.isAllowedNetworkSwitch()){f.sendEvent({type:"track",event:"CLICK_NETWORKS"});i.push("Networks")}}isAllowedNetworkSwitch(){const t=d.getAllRequestedCaipNetworks();const e=t?t.length>1:false;const i=t?.find((({id:t})=>t===this.network?.id));return e||!i}onViewChange(){const{history:t}=i.state;let e=O.VIEW_DIRECTION.Next;if(t.length<this.prevHistoryLength){e=O.VIEW_DIRECTION.Prev}this.prevHistoryLength=t.length;this.viewDirection=e}async onHistoryChange(){const{history:t}=i.state;const e=this.shadowRoot?.querySelector("#dynamic");if(t.length>1&&!this.showBack&&e){await e.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished;this.showBack=true;e.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"})}else if(t.length<=1&&this.showBack&&e){await e.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished;this.showBack=false;e.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"})}}onGoBack(){i.goBack()}};ot.styles=Z;q([S()],ot.prototype,"heading",void 0);q([S()],ot.prototype,"network",void 0);q([S()],ot.prototype,"networkImage",void 0);q([S()],ot.prototype,"showBack",void 0);q([S()],ot.prototype,"prevHistoryLength",void 0);q([S()],ot.prototype,"view",void 0);q([S()],ot.prototype,"viewDirection",void 0);ot=q([$("w3m-header")],ot);var at=a`
  :host {
    display: flex;
    align-items: center;
    gap: ${({spacing:t})=>t[1]};
    padding: ${({spacing:t})=>t[2]} ${({spacing:t})=>t[3]}
      ${({spacing:t})=>t[2]} ${({spacing:t})=>t[2]};
    border-radius: ${({borderRadius:t})=>t[20]};
    background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
    box-shadow:
      0px 0px 8px 0px rgba(0, 0, 0, 0.1),
      inset 0 0 0 1px ${({tokens:t})=>t.theme.borderPrimary};
    max-width: 320px;
  }

  wui-icon-box {
    border-radius: ${({borderRadius:t})=>t.round} !important;
    overflow: hidden;
  }

  wui-loading-spinner {
    padding: ${({spacing:t})=>t[1]};
    background-color: ${({tokens:t})=>t.core.foregroundAccent010};
    border-radius: ${({borderRadius:t})=>t.round} !important;
  }
`;var nt=undefined&&undefined.__decorate||function(t,e,i,o){var a=arguments.length,n=a<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)if(s=t[r])n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n;return a>3&&n&&Object.defineProperty(e,i,n),n};let st=class t extends s{constructor(){super(...arguments);this.message="";this.variant="success"}render(){return r`
      ${this.templateIcon()}
      <wui-text variant="lg-regular" color="primary" data-testid="wui-snackbar-message"
        >${this.message}</wui-text
      >
    `}templateIcon(){const t={success:"success",error:"error",warning:"warning",info:"default"};const e={success:"checkmark",error:"warning",warning:"warningCircle",info:"info"};if(this.variant==="loading"){return r`<wui-loading-spinner size="md" color="accent-primary"></wui-loading-spinner>`}return r`<wui-icon-box
      size="md"
      color=${t[this.variant]}
      icon=${e[this.variant]}
    ></wui-icon-box>`}};st.styles=[n,at];nt([C()],st.prototype,"message",void 0);nt([C()],st.prototype,"variant",void 0);st=nt([$("wui-snackbar")],st);var rt=g`
  :host {
    display: block;
    position: absolute;
    opacity: 0;
    pointer-events: none;
    top: 11px;
    left: 50%;
    width: max-content;
  }
`;var lt=undefined&&undefined.__decorate||function(t,e,i,o){var a=arguments.length,n=a<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)if(s=t[r])n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n;return a>3&&n&&Object.defineProperty(e,i,n),n};let ct=class t extends s{constructor(){super();this.unsubscribe=[];this.timeout=undefined;this.open=b.state.open;this.unsubscribe.push(b.subscribeKey("open",(t=>{this.open=t;this.onOpen()})))}disconnectedCallback(){clearTimeout(this.timeout);this.unsubscribe.forEach((t=>t()))}render(){const{message:t,variant:e}=b.state;return r` <wui-snackbar message=${t} variant=${e}></wui-snackbar> `}onOpen(){clearTimeout(this.timeout);if(this.open){this.animate([{opacity:0,transform:"translateX(-50%) scale(0.85)"},{opacity:1,transform:"translateX(-50%) scale(1)"}],{duration:150,fill:"forwards",easing:"ease"});if(this.timeout){clearTimeout(this.timeout)}if(b.state.autoClose){this.timeout=setTimeout((()=>b.hide()),2500)}}else{this.animate([{opacity:1,transform:"translateX(-50%) scale(1)"},{opacity:0,transform:"translateX(-50%) scale(0.85)"}],{duration:150,fill:"forwards",easing:"ease"})}}};ct.styles=rt;lt([S()],ct.prototype,"open",void 0);ct=lt([$("w3m-snackbar")],ct);var dt=a`
  :host {
    z-index: ${({tokens:t})=>t.core.zIndex};
    display: block;
    backface-visibility: hidden;
    will-change: opacity;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    opacity: 0;
    background-color: ${({tokens:t})=>t.theme.overlay};
    backdrop-filter: blur(0px);
    transition:
      opacity ${({durations:t})=>t["lg"]} ${({easings:t})=>t["ease-out-power-2"]},
      backdrop-filter ${({durations:t})=>t["lg"]}
        ${({easings:t})=>t["ease-out-power-2"]};
    will-change: opacity;
  }

  :host(.open) {
    opacity: 1;
    backdrop-filter: blur(8px);
  }

  :host(.appkit-modal) {
    position: relative;
    pointer-events: unset;
    background: none;
    width: 100%;
    opacity: 1;
  }

  wui-card {
    max-width: var(--apkt-modal-width);
    width: 100%;
    position: relative;
    outline: none;
    transform: translateY(4px);
    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.05);
    transition:
      transform ${({durations:t})=>t["lg"]}
        ${({easings:t})=>t["ease-out-power-2"]},
      border-radius ${({durations:t})=>t["lg"]}
        ${({easings:t})=>t["ease-out-power-1"]},
      background-color ${({durations:t})=>t["lg"]}
        ${({easings:t})=>t["ease-out-power-1"]},
      box-shadow ${({durations:t})=>t["lg"]}
        ${({easings:t})=>t["ease-out-power-1"]};
    will-change: border-radius, background-color, transform, box-shadow;
    background-color: ${({tokens:t})=>t.theme.backgroundPrimary};
    padding: var(--local-modal-padding);
    box-sizing: border-box;
  }

  :host(.open) wui-card {
    transform: translateY(0px);
  }

  wui-card::before {
    z-index: 1;
    pointer-events: none;
    content: '';
    position: absolute;
    inset: 0;
    border-radius: clamp(0px, var(--apkt-borderRadius-8), 44px);
    transition: box-shadow ${({durations:t})=>t["lg"]}
      ${({easings:t})=>t["ease-out-power-2"]};
    transition-delay: ${({durations:t})=>t["md"]};
    will-change: box-shadow;
  }

  :host([data-mobile-fullscreen='true']) wui-card::before {
    border-radius: 0px;
  }

  :host([data-border='true']) wui-card::before {
    box-shadow: inset 0px 0px 0px 4px ${({tokens:t})=>t.theme.foregroundSecondary};
  }

  :host([data-border='false']) wui-card::before {
    box-shadow: inset 0px 0px 0px 1px ${({tokens:t})=>t.theme.borderPrimaryDark};
  }

  :host([data-border='true']) wui-card {
    animation:
      fade-in ${({durations:t})=>t["lg"]} ${({easings:t})=>t["ease-out-power-2"]},
      card-background-border var(--apkt-duration-dynamic)
        ${({easings:t})=>t["ease-out-power-2"]};
    animation-fill-mode: backwards, both;
    animation-delay: var(--apkt-duration-dynamic);
  }

  :host([data-border='false']) wui-card {
    animation:
      fade-in ${({durations:t})=>t["lg"]} ${({easings:t})=>t["ease-out-power-2"]},
      card-background-default var(--apkt-duration-dynamic)
        ${({easings:t})=>t["ease-out-power-2"]};
    animation-fill-mode: backwards, both;
    animation-delay: 0s;
  }

  :host(.appkit-modal) wui-card {
    max-width: var(--apkt-modal-width);
  }

  wui-card[shake='true'] {
    animation:
      fade-in ${({durations:t})=>t["lg"]} ${({easings:t})=>t["ease-out-power-2"]},
      w3m-shake ${({durations:t})=>t["xl"]}
        ${({easings:t})=>t["ease-out-power-2"]};
  }

  wui-flex {
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
  }

  @media (max-height: 700px) and (min-width: 431px) {
    wui-flex {
      align-items: flex-start;
    }

    wui-card {
      margin: var(--apkt-spacing-6) 0px;
    }
  }

  @media (max-width: 430px) {
    :host([data-mobile-fullscreen='true']) {
      height: 100dvh;
    }
    :host([data-mobile-fullscreen='true']) wui-flex {
      align-items: stretch;
    }
    :host([data-mobile-fullscreen='true']) wui-card {
      max-width: 100%;
      height: 100%;
      border-radius: 0;
      border: none;
    }
    :host(:not([data-mobile-fullscreen='true'])) wui-flex {
      align-items: flex-end;
    }

    :host(:not([data-mobile-fullscreen='true'])) wui-card {
      max-width: 100%;
      border-bottom: none;
    }

    :host(:not([data-mobile-fullscreen='true'])) wui-card[data-embedded='true'] {
      border-bottom-left-radius: clamp(0px, var(--apkt-borderRadius-8), 44px);
      border-bottom-right-radius: clamp(0px, var(--apkt-borderRadius-8), 44px);
    }

    :host(:not([data-mobile-fullscreen='true'])) wui-card:not([data-embedded='true']) {
      border-bottom-left-radius: 0px;
      border-bottom-right-radius: 0px;
    }

    wui-card[shake='true'] {
      animation: w3m-shake 0.5s ${({easings:t})=>t["ease-out-power-2"]};
    }
  }

  @keyframes fade-in {
    0% {
      transform: scale(0.99) translateY(4px);
    }
    100% {
      transform: scale(1) translateY(0);
    }
  }

  @keyframes w3m-shake {
    0% {
      transform: scale(1) rotate(0deg);
    }
    20% {
      transform: scale(1) rotate(-1deg);
    }
    40% {
      transform: scale(1) rotate(1.5deg);
    }
    60% {
      transform: scale(1) rotate(-1.5deg);
    }
    80% {
      transform: scale(1) rotate(1deg);
    }
    100% {
      transform: scale(1) rotate(0deg);
    }
  }

  @keyframes card-background-border {
    from {
      background-color: ${({tokens:t})=>t.theme.backgroundPrimary};
    }
    to {
      background-color: ${({tokens:t})=>t.theme.foregroundSecondary};
    }
  }

  @keyframes card-background-default {
    from {
      background-color: ${({tokens:t})=>t.theme.foregroundSecondary};
    }
    to {
      background-color: ${({tokens:t})=>t.theme.backgroundPrimary};
    }
  }
`;var ut=undefined&&undefined.__decorate||function(t,e,i,o){var a=arguments.length,n=a<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)if(s=t[r])n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n;return a>3&&n&&Object.defineProperty(e,i,n),n};const ht="scroll-lock";const pt={PayWithExchange:"0",PayWithExchangeSelectAsset:"0",Pay:"0",PayQuote:"0",PayLoading:"0"};class ft extends s{constructor(){super();this.unsubscribe=[];this.abortController=undefined;this.hasPrefetched=false;this.enableEmbedded=m.state.enableEmbedded;this.open=t.state.open;this.caipAddress=d.state.activeCaipAddress;this.caipNetwork=d.state.activeCaipNetwork;this.shake=t.state.shake;this.filterByNamespace=w.state.filterByNamespace;this.padding=p.spacing[1];this.mobileFullScreen=m.state.enableMobileFullScreen;this.initializeTheming();x.prefetchAnalyticsConfig();this.unsubscribe.push(...[t.subscribeKey("open",(t=>t?this.onOpen():this.onClose())),t.subscribeKey("shake",(t=>this.shake=t)),d.subscribeKey("activeCaipNetwork",(t=>this.onNewNetwork(t))),d.subscribeKey("activeCaipAddress",(t=>this.onNewAddress(t))),m.subscribeKey("enableEmbedded",(t=>this.enableEmbedded=t)),w.subscribeKey("filterByNamespace",(t=>{if(this.filterByNamespace!==t&&!d.getAccountData(t)?.caipAddress){x.fetchRecommendedWallets();this.filterByNamespace=t}})),i.subscribeKey("view",(()=>{this.dataset["border"]=z.hasFooter()?"true":"false";this.padding=pt[i.state.view]??p.spacing[1]}))])}firstUpdated(){this.dataset["border"]=z.hasFooter()?"true":"false";if(this.mobileFullScreen){this.setAttribute("data-mobile-fullscreen","true")}if(this.caipAddress){if(this.enableEmbedded){t.close();this.prefetch();return}this.onNewAddress(this.caipAddress)}if(this.open){this.onOpen()}if(this.enableEmbedded){this.prefetch()}}disconnectedCallback(){this.unsubscribe.forEach((t=>t()));this.onRemoveKeyboardListener()}render(){this.style.setProperty("--local-modal-padding",this.padding);if(this.enableEmbedded){return r`${this.contentTemplate()}
        <w3m-tooltip></w3m-tooltip> `}return this.open?r`
          <wui-flex @click=${this.onOverlayClick.bind(this)} data-testid="w3m-modal-overlay">
            ${this.contentTemplate()}
          </wui-flex>
          <w3m-tooltip></w3m-tooltip>
        `:null}contentTemplate(){return r` <wui-card
      shake="${this.shake}"
      data-embedded="${j(this.enableEmbedded)}"
      role="alertdialog"
      aria-modal="true"
      tabindex="0"
      data-testid="w3m-modal-card"
    >
      <w3m-header></w3m-header>
      <w3m-router></w3m-router>
      <w3m-footer></w3m-footer>
      <w3m-snackbar></w3m-snackbar>
      <w3m-alertbar></w3m-alertbar>
    </wui-card>`}async onOverlayClick(t){if(t.target===t.currentTarget){if(this.mobileFullScreen){return}await this.handleClose()}}async handleClose(){await I.safeClose()}initializeTheming(){const{themeVariables:t,themeMode:e}=v.state;const i=R.getColorTheme(e);y(t,i)}onClose(){this.open=false;this.classList.remove("open");this.onScrollUnlock();b.hide();this.onRemoveKeyboardListener()}onOpen(){this.open=true;this.classList.add("open");this.onScrollLock();this.onAddKeyboardListener()}onScrollLock(){const t=document.createElement("style");t.dataset["w3m"]=ht;t.textContent=`\n      body {\n        touch-action: none;\n        overflow: hidden;\n        overscroll-behavior: contain;\n      }\n      w3m-modal {\n        pointer-events: auto;\n      }\n    `;document.head.appendChild(t)}onScrollUnlock(){const t=document.head.querySelector(`style[data-w3m="${ht}"]`);if(t){t.remove()}}onAddKeyboardListener(){this.abortController=new AbortController;const t=this.shadowRoot?.querySelector("wui-card");t?.focus();window.addEventListener("keydown",(e=>{if(e.key==="Escape"){this.handleClose()}else if(e.key==="Tab"){const{tagName:i}=e.target;if(i&&!i.includes("W3M-")&&!i.includes("WUI-")){t?.focus()}}}),this.abortController)}onRemoveKeyboardListener(){this.abortController?.abort();this.abortController=undefined}async onNewAddress(o){const a=d.state.isSwitchingNamespace;const n=i.state.view==="ProfileWallets";const s=!o&&!a&&!n;if(s){t.close()}await e.initializeIfEnabled(o);this.caipAddress=o;d.setIsSwitchingNamespace(false)}onNewNetwork(e){const o=this.caipNetwork;const a=o?.caipNetworkId?.toString();const n=e?.caipNetworkId?.toString();const s=a!==n;const r=i.state.view==="UnsupportedChain";const l=t.state.open;let c=false;if(this.enableEmbedded&&i.state.view==="SwitchNetwork"){c=true}if(s){A.resetState()}if(l&&r){c=true}if(c&&i.state.view!=="SIWXSignMessage"){i.goBack()}this.caipNetwork=e}prefetch(){if(!this.hasPrefetched){x.prefetch();x.fetchWalletsByPage({page:1});this.hasPrefetched=true}}}ft.styles=dt;ut([C({type:Boolean})],ft.prototype,"enableEmbedded",void 0);ut([S()],ft.prototype,"open",void 0);ut([S()],ft.prototype,"caipAddress",void 0);ut([S()],ft.prototype,"caipNetwork",void 0);ut([S()],ft.prototype,"shake",void 0);ut([S()],ft.prototype,"filterByNamespace",void 0);ut([S()],ft.prototype,"padding",void 0);ut([S()],ft.prototype,"mobileFullScreen",void 0);let mt=class t extends ft{};mt=ut([$("w3m-modal")],mt);let wt=class t extends ft{};wt=ut([$("appkit-modal")],wt);var gt=a`
  .icon-box {
    width: 64px;
    height: 64px;
    border-radius: ${({borderRadius:t})=>t[5]};
    background-color: ${({colors:t})=>t.semanticError010};
  }
`;var bt=undefined&&undefined.__decorate||function(t,e,i,o){var a=arguments.length,n=a<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)if(s=t[r])n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n;return a>3&&n&&Object.defineProperty(e,i,n),n};let xt=class t extends s{constructor(){super()}render(){return r`
      <wui-flex
        flexDirection="column"
        alignItems="center"
        gap="4"
        .padding="${["1","3","4","3"]}"
      >
        <wui-flex justifyContent="center" alignItems="center" class="icon-box">
          <wui-icon size="xxl" color="error" name="warningCircle"></wui-icon>
        </wui-flex>

        <wui-text variant="lg-medium" color="primary" align="center">
          The app isn't responding as expected
        </wui-text>
        <wui-text variant="md-regular" color="secondary" align="center">
          Try again or reach out to the app team for help.
        </wui-text>

        <wui-button
          variant="neutral-secondary"
          size="md"
          @click=${this.onTryAgainClick.bind(this)}
          data-testid="w3m-usage-exceeded-button"
        >
          <wui-icon color="inherit" slot="iconLeft" name="refresh"></wui-icon>
          Try Again
        </wui-button>
      </wui-flex>
    `}onTryAgainClick(){i.goBack()}};xt.styles=gt;xt=bt([$("w3m-usage-exceeded-view")],xt);var vt=a`
  :host {
    width: 100%;
  }
`;var yt=undefined&&undefined.__decorate||function(t,e,i,o){var a=arguments.length,n=a<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)if(s=t[r])n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n;return a>3&&n&&Object.defineProperty(e,i,n),n};let kt=class t extends s{constructor(){super(...arguments);this.hasImpressionSent=false;this.walletImages=[];this.imageSrc="";this.name="";this.size="md";this.tabIdx=undefined;this.disabled=false;this.showAllWallets=false;this.loading=false;this.loadingSpinnerColor="accent-100";this.rdnsId="";this.displayIndex=undefined;this.walletRank=undefined;this.namespaces=[]}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback();this.cleanupIntersectionObserver()}updated(t){super.updated(t);if(t.has("name")||t.has("imageSrc")||t.has("walletRank")){this.hasImpressionSent=false}const e=t.has("walletRank")&&this.walletRank;if(e&&!this.intersectionObserver){this.setupIntersectionObserver()}}setupIntersectionObserver(){this.intersectionObserver=new IntersectionObserver((t=>{t.forEach((t=>{if(t.isIntersecting&&!this.loading&&!this.hasImpressionSent){this.sendImpressionEvent()}}))}),{threshold:.1});this.intersectionObserver.observe(this)}cleanupIntersectionObserver(){if(this.intersectionObserver){this.intersectionObserver.disconnect();this.intersectionObserver=undefined}}sendImpressionEvent(){if(!this.name||this.hasImpressionSent||!this.walletRank){return}this.hasImpressionSent=true;if(this.rdnsId||this.name){f.sendWalletImpressionEvent({name:this.name,walletRank:this.walletRank,rdnsId:this.rdnsId,view:i.state.view,displayIndex:this.displayIndex})}}handleGetWalletNamespaces(){const t=Object.keys(k.state.adapters).length>1;if(t){return this.namespaces}return[]}render(){return r`
      <wui-list-wallet
        .walletImages=${this.walletImages}
        imageSrc=${j(this.imageSrc)}
        name=${this.name}
        size=${j(this.size)}
        tagLabel=${j(this.tagLabel)}
        .tagVariant=${this.tagVariant}
        .walletIcon=${this.walletIcon}
        .tabIdx=${this.tabIdx}
        .disabled=${this.disabled}
        .showAllWallets=${this.showAllWallets}
        .loading=${this.loading}
        loadingSpinnerColor=${this.loadingSpinnerColor}
        .namespaces=${this.handleGetWalletNamespaces()}
      ></wui-list-wallet>
    `}};kt.styles=vt;yt([C({type:Array})],kt.prototype,"walletImages",void 0);yt([C()],kt.prototype,"imageSrc",void 0);yt([C()],kt.prototype,"name",void 0);yt([C()],kt.prototype,"size",void 0);yt([C()],kt.prototype,"tagLabel",void 0);yt([C()],kt.prototype,"tagVariant",void 0);yt([C()],kt.prototype,"walletIcon",void 0);yt([C()],kt.prototype,"tabIdx",void 0);yt([C({type:Boolean})],kt.prototype,"disabled",void 0);yt([C({type:Boolean})],kt.prototype,"showAllWallets",void 0);yt([C({type:Boolean})],kt.prototype,"loading",void 0);yt([C({type:String})],kt.prototype,"loadingSpinnerColor",void 0);yt([C()],kt.prototype,"rdnsId",void 0);yt([C()],kt.prototype,"displayIndex",void 0);yt([C()],kt.prototype,"walletRank",void 0);yt([C({type:Array})],kt.prototype,"namespaces",void 0);kt=yt([$("w3m-list-wallet")],kt);var $t=a`
  :host {
    --local-duration-height: 0s;
    --local-duration: ${({durations:t})=>t["lg"]};
    --local-transition: ${({easings:t})=>t["ease-out-power-2"]};
  }

  .container {
    display: block;
    overflow: hidden;
    overflow: hidden;
    position: relative;
    height: var(--local-container-height);
    transition: height var(--local-duration-height) var(--local-transition);
    will-change: height, padding-bottom;
  }

  .container[data-mobile-fullscreen='true'] {
    overflow: scroll;
  }

  .page {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    width: inherit;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    background-color: ${({tokens:t})=>t.theme.backgroundPrimary};
    border-bottom-left-radius: var(--local-border-bottom-radius);
    border-bottom-right-radius: var(--local-border-bottom-radius);
    transition: border-bottom-left-radius var(--local-duration) var(--local-transition);
  }

  .page[data-mobile-fullscreen='true'] {
    height: 100%;
  }

  .page-content {
    display: flex;
    flex-direction: column;
    min-height: 100%;
  }

  .footer {
    height: var(--apkt-footer-height);
  }

  div.page[view-direction^='prev-'] .page-content {
    animation:
      slide-left-out var(--local-duration) forwards var(--local-transition),
      slide-left-in var(--local-duration) forwards var(--local-transition);
    animation-delay: 0ms, var(--local-duration, ${({durations:t})=>t["lg"]});
  }

  div.page[view-direction^='next-'] .page-content {
    animation:
      slide-right-out var(--local-duration) forwards var(--local-transition),
      slide-right-in var(--local-duration) forwards var(--local-transition);
    animation-delay: 0ms, var(--local-duration, ${({durations:t})=>t["lg"]});
  }

  @keyframes slide-left-out {
    from {
      transform: translateX(0px) scale(1);
      opacity: 1;
      filter: blur(0px);
    }
    to {
      transform: translateX(8px) scale(0.99);
      opacity: 0;
      filter: blur(4px);
    }
  }

  @keyframes slide-left-in {
    from {
      transform: translateX(-8px) scale(0.99);
      opacity: 0;
      filter: blur(4px);
    }
    to {
      transform: translateX(0) translateY(0) scale(1);
      opacity: 1;
      filter: blur(0px);
    }
  }

  @keyframes slide-right-out {
    from {
      transform: translateX(0px) scale(1);
      opacity: 1;
      filter: blur(0px);
    }
    to {
      transform: translateX(-8px) scale(0.99);
      opacity: 0;
      filter: blur(4px);
    }
  }

  @keyframes slide-right-in {
    from {
      transform: translateX(8px) scale(0.99);
      opacity: 0;
      filter: blur(4px);
    }
    to {
      transform: translateX(0) translateY(0) scale(1);
      opacity: 1;
      filter: blur(0px);
    }
  }
`;var Ct=undefined&&undefined.__decorate||function(t,e,i,o){var a=arguments.length,n=a<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)if(s=t[r])n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n;return a>3&&n&&Object.defineProperty(e,i,n),n};const St=60;let Rt=class t extends s{constructor(){super(...arguments);this.resizeObserver=undefined;this.transitionDuration="0.15s";this.transitionFunction="";this.history="";this.view="";this.setView=undefined;this.viewDirection="";this.historyState="";this.previousHeight="0px";this.mobileFullScreen=m.state.enableMobileFullScreen;this.onViewportResize=()=>{this.updateContainerHeight()}}updated(t){if(t.has("history")){const t=this.history;if(this.historyState!==""&&this.historyState!==t){this.onViewChange(t)}}if(t.has("transitionDuration")){this.style.setProperty("--local-duration",this.transitionDuration)}if(t.has("transitionFunction")){this.style.setProperty("--local-transition",this.transitionFunction)}}firstUpdated(){if(this.transitionFunction){this.style.setProperty("--local-transition",this.transitionFunction)}this.style.setProperty("--local-duration",this.transitionDuration);this.historyState=this.history;this.resizeObserver=new ResizeObserver((t=>{for(const e of t){if(e.target===this.getWrapper()){let t=e.contentRect.height;const i=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--apkt-footer-height")||"0");if(this.mobileFullScreen){const e=window.visualViewport?.height||window.innerHeight;const o=this.getHeaderHeight();t=e-o-i;this.style.setProperty("--local-border-bottom-radius","0px")}else{const e=t+i;t=e;this.style.setProperty("--local-border-bottom-radius",i?"var(--apkt-borderRadius-5)":"0px")}this.style.setProperty("--local-container-height",`${t}px`);if(this.previousHeight!=="0px"){this.style.setProperty("--local-duration-height",this.transitionDuration)}this.previousHeight=`${t}px`}}}));this.resizeObserver.observe(this.getWrapper());this.updateContainerHeight();window.addEventListener("resize",this.onViewportResize);window.visualViewport?.addEventListener("resize",this.onViewportResize)}disconnectedCallback(){const t=this.getWrapper();if(t&&this.resizeObserver){this.resizeObserver.unobserve(t)}window.removeEventListener("resize",this.onViewportResize);window.visualViewport?.removeEventListener("resize",this.onViewportResize)}render(){return r`
      <div class="container" data-mobile-fullscreen="${j(this.mobileFullScreen)}">
        <div
          class="page"
          data-mobile-fullscreen="${j(this.mobileFullScreen)}"
          view-direction="${this.viewDirection}"
        >
          <div class="page-content">
            <slot></slot>
          </div>
        </div>
      </div>
    `}onViewChange(t){const e=t.split(",").filter(Boolean);const i=this.historyState.split(",").filter(Boolean);const o=i.length;const a=e.length;const n=e[e.length-1]||"";const s=R.cssDurationToNumber(this.transitionDuration);let r="";if(a>o){r="next"}else if(a<o){r="prev"}else if(a===o&&e[a-1]!==i[o-1]){r="next"}this.viewDirection=`${r}-${n}`;setTimeout((()=>{this.historyState=t;this.setView?.(n)}),s);setTimeout((()=>{this.viewDirection=""}),s*2)}getWrapper(){return this.shadowRoot?.querySelector("div.page")}updateContainerHeight(){const t=this.getWrapper();if(!t){return}const e=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--apkt-footer-height")||"0");let i=0;if(this.mobileFullScreen){const t=window.visualViewport?.height||window.innerHeight;const o=this.getHeaderHeight();i=t-o-e;this.style.setProperty("--local-border-bottom-radius","0px")}else{i=t.getBoundingClientRect().height+e;this.style.setProperty("--local-border-bottom-radius",e?"var(--apkt-borderRadius-5)":"0px")}this.style.setProperty("--local-container-height",`${i}px`);if(this.previousHeight!=="0px"){this.style.setProperty("--local-duration-height",this.transitionDuration)}this.previousHeight=`${i}px`}getHeaderHeight(){return St}};Rt.styles=[$t];Ct([C({type:String})],Rt.prototype,"transitionDuration",void 0);Ct([C({type:String})],Rt.prototype,"transitionFunction",void 0);Ct([C({type:String})],Rt.prototype,"history",void 0);Ct([C({type:String})],Rt.prototype,"view",void 0);Ct([C({attribute:false})],Rt.prototype,"setView",void 0);Ct([S()],Rt.prototype,"viewDirection",void 0);Ct([S()],Rt.prototype,"historyState",void 0);Ct([S()],Rt.prototype,"previousHeight",void 0);Ct([S()],Rt.prototype,"mobileFullScreen",void 0);Rt=Ct([$("w3m-router-container")],Rt);export{wt as AppKitModal,kt as W3mListWallet,mt as W3mModal,ft as W3mModalBase,Rt as W3mRouterContainer,xt as W3mUsageExceededView};
//# sourceMappingURL=p-DAHLPJPw.js.map