import{initInputToken as z,genPlaceholderStyle as E,genInputGroupStyle as A,genDisabledStyle as H,genActiveStyle as W,genHoverStyle as h,genStatusStyle as c,genBasicInputStyle as g}from"../../input/style/index.mjs";import{resetComponent as u,resetIcon as C}from"../../style/index.mjs";import{genCompactItemStyle as B}from"../../style/compact-item.mjs";import"../../theme/internal.mjs";import P from"../../theme/util/genComponentStyleHook.mjs";const T=e=>{const{componentCls:n,lineWidth:r,lineType:t,colorBorder:o,borderRadius:i,fontSizeLG:a,controlHeightLG:b,controlHeightSM:$,colorError:f,inputPaddingHorizontalSM:S,colorTextDescription:l,motionDurationMid:d,colorPrimary:x,controlHeight:m,inputPaddingHorizontal:w,colorBgContainer:y,colorTextDisabled:I,borderRadiusSM:p,borderRadiusLG:s,controlWidth:R,handleVisible:v}=e;return[{[n]:{...u(e),...g(e),...c(e,n),display:"inline-block",width:R,margin:0,padding:0,border:`${r}px ${t} ${o}`,borderRadius:i,"&-rtl":{direction:"rtl",[`${n}-input`]:{direction:"rtl"}},"&-lg":{padding:0,fontSize:a,borderRadius:s,[`input${n}-input`]:{height:b-2*r}},"&-sm":{padding:0,borderRadius:p,[`input${n}-input`]:{height:$-2*r,padding:`0 ${S}px`}},"&:hover":{...h(e)},"&-focused":{...W(e)},"&-disabled":{...H(e),[`${n}-input`]:{cursor:"not-allowed"}},"&-out-of-range":{input:{color:f}},"&-group":{...u(e),...A(e),"&-wrapper":{display:"inline-block",textAlign:"start",verticalAlign:"top",[`${n}-affix-wrapper`]:{width:"100%"},"&-lg":{[`${n}-group-addon`]:{borderRadius:s}},"&-sm":{[`${n}-group-addon`]:{borderRadius:p}}}},[n]:{"&-input":{width:"100%",height:m-2*r,padding:`0 ${w}px`,textAlign:"start",backgroundColor:"transparent",border:0,borderRadius:i,outline:0,transition:`all ${d} linear`,appearance:"textfield",color:e.colorText,fontSize:"inherit",verticalAlign:"top",...E(e.colorTextPlaceholder),'&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button':{margin:0,webkitAppearance:"none",appearance:"none"}}}}},{[n]:{[`&:hover ${n}-handler-wrap, &-focused ${n}-handler-wrap`]:{opacity:1},[`${n}-handler-wrap`]:{position:"absolute",insetBlockStart:0,insetInlineEnd:0,width:e.handleWidth,height:"100%",background:y,borderStartStartRadius:0,borderStartEndRadius:i,borderEndEndRadius:i,borderEndStartRadius:0,opacity:v===!0?1:0,display:"flex",flexDirection:"column",alignItems:"stretch",transition:`opacity ${d} linear ${d}`,[`${n}-handler`]:{display:"flex",alignItems:"center",justifyContent:"center",flex:"auto",height:"40%",[`
              ${n}-handler-up-inner,
              ${n}-handler-down-inner
            `]:{marginInlineEnd:0,fontSize:e.handleFontSize}}},[`${n}-handler`]:{height:"50%",overflow:"hidden",color:l,fontWeight:"bold",lineHeight:0,textAlign:"center",cursor:"pointer",borderInlineStart:`${r}px ${t} ${o}`,transition:`all ${d} linear`,"&:active":{background:e.colorFillAlter},"&:hover":{height:"60%",[`
              ${n}-handler-up-inner,
              ${n}-handler-down-inner
            `]:{color:x}},"&-up-inner, &-down-inner":{...C(),color:l,transition:`all ${d} linear`,userSelect:"none"}},[`${n}-handler-up`]:{borderStartEndRadius:i},[`${n}-handler-down`]:{borderBlockStart:`${r}px ${t} ${o}`,borderEndEndRadius:i},"&-disabled, &-readonly":{[`${n}-handler-wrap`]:{display:"none"},[`${n}-input`]:{color:"inherit"}},[`
          ${n}-handler-up-disabled,
          ${n}-handler-down-disabled
        `]:{cursor:"not-allowed"},[`
          ${n}-handler-up-disabled:hover &-handler-up-inner,
          ${n}-handler-down-disabled:hover &-handler-down-inner
        `]:{color:I}}},{[`${n}-borderless`]:{borderColor:"transparent",boxShadow:"none",[`${n}-handler-down`]:{borderBlockStartWidth:0}}}]},M=e=>{const{componentCls:n,inputPaddingHorizontal:r,inputAffixPadding:t,controlWidth:o,borderRadiusLG:i,borderRadiusSM:a}=e;return{[`${n}-affix-wrapper`]:{...g(e),...c(e,`${n}-affix-wrapper`),position:"relative",display:"inline-flex",width:o,padding:0,paddingInlineStart:r,"&-lg":{borderRadius:i},"&-sm":{borderRadius:a},[`&:not(${n}-affix-wrapper-disabled):hover`]:{...h(e),zIndex:1},"&-focused, &:focus":{zIndex:1},"&-disabled":{[`${n}[disabled]`]:{background:"transparent"}},[`> div${n}`]:{width:"100%",border:"none",outline:"none",[`&${n}-focused`]:{boxShadow:"none !important"}},[`input${n}-input`]:{padding:0},"&::before":{width:0,visibility:"hidden",content:'"\\a0"'},[`${n}-handler-wrap`]:{zIndex:2},[n]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center",pointerEvents:"none"},"&-prefix":{marginInlineEnd:t},"&-suffix":{position:"absolute",insetBlockStart:0,insetInlineEnd:0,zIndex:1,height:"100%",marginInlineEnd:r,marginInlineStart:t}}}}},V=P("InputNumber",e=>{const n=z(e);return[T(n),M(n),B(n)]},e=>({controlWidth:90,handleWidth:e.controlHeightSM-e.lineWidth*2,handleFontSize:e.fontSize/2,handleVisible:"auto"}));export{V as default};
