"use client";
import{b as l}from"./chunk-5X5UU2I7.js";import{b as r}from"./chunk-3NQOMOHD.js";import{e as $}from"./chunk-CLTGASR6.js";import{a as x,m as u}from"./chunk-3CHPBNY2.js";import{p as i,s}from"./chunk-KEPQUAOX.js";import e from"clsx";var v=x("EulAmountInput",["input","label","maxBtn","price","product","root","customRadius","noBottomRadius","noTopRadius","disabled"]),I=o=>$("EulAmountInput",{input:["input",o.disabled&&"disabled"],label:["label"],maxBtn:["maxBtn"],price:["price"],product:["product"],root:["root",Boolean(o.noBottomRadius||o.noTopRadius)&&"customRadius",!!o.noTopRadius&&"noTopRadius",!!o.noBottomRadius&&"noBottomRadius"]}),n=v;var B=u("label")(({theme:o})=>i`
    display: flex;
    flex-direction: column;
    gap: ${o.spacing(2)};
    align-items: flex-start;
    align-self: stretch;
    padding: ${o.spacing(4)};
    background: ${o.palette.background[200]};
    border-radius: ${o.spacing(2)};
    outline: transparent solid ${o.spacing(.5)};
    outline-offset: ${o.spacing(-.5)};
    transition: ${o.transitions.create(["background-color","outline-color"])};

    &.${n.noBottomRadius} {
      border-radius: ${o.spacing(2,2,0,0)};
    }

    &.${n.noTopRadius} {
      border-radius: ${o.spacing(0,0,2,2)};
    }

    &.${n.noTopRadius}.${n.noBottomRadius} {
      border-radius: 0;
    }

    &:hover {
      background: ${o.palette.background[200]};
    }

    &:focus-within:not(.${n.customRadius}) {
      outline-color: ${o.palette.teal[600]};
    }
  `),h=u("input")(({theme:o})=>i`
    width: 100%;
    padding: 0;
    margin: 0;
    color: ${o.palette.common.white};
    font-size: ${o.typography.input1.fontSize};
    font-family: ${o.typography.fontFamily};
    line-height: ${o.typography.input1.lineHeight};
    background: none;
    background: transparent;
    border: none;
    outline: none;
    box-shadow: none;
    -moz-appearance: textfield;

    &:focus {
      outline: none;
      box-shadow: none;
    }

    &::placeholder {
      color: ${o.palette.background[700]};
      opacity: 1;
    }

    &.${n.disabled} {
      color: ${o.palette.background[800]};
    }

    &::-webkit-outer-spin-button,
    &::-webkit-inner-spin-button {
      margin: 0;
      -webkit-appearance: none;
    }
  `),R=u("button")(({theme:o})=>i`
    padding: ${o.spacing(0,1)};
    color: ${o.palette.teal[700]};
    font: inherit;
    font-size: ${o.typography.pxToRem(14)};
    line-height: ${o.typography.pxToRem(20)};
    background: none;
    border: none;
    box-shadow: none;
    cursor: pointer;
    appearance: none;

    &:focus {
      outline: none;
    }

    &::-moz-focus-inner {
      border: 0;
    }
  `);import{jsx as t,jsxs as p}from"react/jsx-runtime";function k(o){let{asset:w,balance:c,className:C,isBalanceLoading:d,isLoading:m,label:A,maxLabel:T,onChange:N,onClickMax:g,product:b,usdValue:f,...S}=o,a=I(o);return p(B,{className:e(C,a.root),children:[p(s,{alignItems:"center",display:"flex",gap:4,justifyContent:"space-between",width:"100%",children:[t(r,{className:e(a.label),color:"secondary",component:"span",variant:"body2",children:A}),m&&t(l,{height:12,width:123}),b&&!m&&t(r,{className:e(a.product),component:"span",variant:"body2",children:b})]}),p(s,{alignItems:"center",display:"flex",gap:4,pt:1,width:"100%",children:[t(h,{...S,className:e(a.input),onChange:y=>N?.(isNaN(y.target.valueAsNumber)?void 0:y.target.valueAsNumber),type:"number"}),w]}),p(s,{alignItems:"center",display:"flex",gap:4,height:20,justifyContent:"space-between",width:"100%",children:[t(r,{className:e(a.price),color:"secondary",component:"span",children:f?`~ ${f}`:"-"}),c&&!d&&t(r,{className:e(a.balance),component:"span",variant:"body2",children:p(s,{alignItems:"center",display:"flex",gap:2,children:[c,g&&t(R,{className:e(a.maxBtn),onClick:g,children:T||"Max"})]})}),d&&t(l,{height:14,width:168})]})]})}export{n as a,k as b};
