import{resetIcon as g}from"../../style/index.mjs";import"../../theme/internal.mjs";import{merge as s}from"../../theme/util/statistic.mjs";const n=2;function c({controlHeightSM:i,controlHeight:l,lineWidth:e}){const o=(l-i)/2-e,t=Math.ceil(o/2);return[o,t]}function a(i,l){const{componentCls:e,iconCls:o}=i,t=`${e}-selection-overflow`,r=i.controlHeightSM,[d]=c(i),p=l?`${e}-${l}`:"";return{[`${e}-multiple${p}`]:{fontSize:i.fontSize,[t]:{position:"relative",display:"flex",flex:"auto",flexWrap:"wrap",maxWidth:"100%","&-item":{flex:"none",alignSelf:"center",maxWidth:"100%",display:"inline-flex"}},[`${e}-selector`]:{display:"flex",flexWrap:"wrap",alignItems:"center",padding:`${d-n}px ${n*2}px`,borderRadius:i.borderRadius,[`${e}-show-search&`]:{cursor:"text"},[`${e}-disabled&`]:{background:i.colorBgContainerDisabled,cursor:"not-allowed"},"&:after":{display:"inline-block",width:0,margin:`${n}px 0`,lineHeight:`${r}px`,content:'"\\a0"'}},[`
        &${e}-show-arrow ${e}-selector,
        &${e}-allow-clear ${e}-selector
      `]:{paddingInlineEnd:i.fontSizeIcon+i.controlPaddingHorizontal},[`${e}-selection-item`]:{position:"relative",display:"flex",flex:"none",boxSizing:"border-box",maxWidth:"100%",height:r,marginTop:n,marginBottom:n,lineHeight:`${r-i.lineWidth*2}px`,background:i.colorFillSecondary,border:`${i.lineWidth}px solid ${i.colorSplit}`,borderRadius:i.borderRadiusSM,cursor:"default",transition:`font-size ${i.motionDurationSlow}, line-height ${i.motionDurationSlow}, height ${i.motionDurationSlow}`,userSelect:"none",marginInlineEnd:n*2,paddingInlineStart:i.paddingXS,paddingInlineEnd:i.paddingXS/2,[`${e}-disabled&`]:{color:i.colorTextDisabled,borderColor:i.colorBorder,cursor:"not-allowed"},"&-content":{display:"inline-block",marginInlineEnd:i.paddingXS/2,overflow:"hidden",whiteSpace:"pre",textOverflow:"ellipsis"},"&-remove":{...g(),display:"inline-block",color:i.colorIcon,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",[`> ${o}`]:{verticalAlign:"-0.2em"},"&:hover":{color:i.colorIconHover}}},[`${t}-item + ${t}-item`]:{[`${e}-selection-search`]:{marginInlineStart:0}},[`${e}-selection-search`]:{display:"inline-flex",position:"relative",maxWidth:"100%",marginInlineStart:i.inputPaddingHorizontalBase-d,"\n          &-input,\n          &-mirror\n        ":{height:r,fontFamily:i.fontFamily,lineHeight:`${r}px`,transition:`all ${i.motionDurationSlow}`},"&-input":{width:"100%",minWidth:4.1},"&-mirror":{position:"absolute",top:0,insetInlineStart:0,insetInlineEnd:"auto",zIndex:999,whiteSpace:"pre",visibility:"hidden"}},[`${e}-selection-placeholder `]:{position:"absolute",top:"50%",insetInlineStart:i.inputPaddingHorizontalBase,insetInlineEnd:i.inputPaddingHorizontalBase,transform:"translateY(-50%)",transition:`all ${i.motionDurationSlow}`}}}}function u(i){const{componentCls:l}=i,e=s(i,{controlHeight:i.controlHeightSM,controlHeightSM:i.controlHeightXS,borderRadius:i.borderRadiusSM,borderRadiusSM:i.borderRadiusXS}),[,o]=c(i);return[a(i),a(e,"sm"),{[`${l}-multiple${l}-sm`]:{[`${l}-selection-placeholder`]:{insetInlineStart:i.controlPaddingHorizontalSM-i.lineWidth,insetInlineEnd:i.controlPaddingHorizontalSM-i.lineWidth},[`${l}-selection-search`]:{marginInlineStart:o}}},a(s(i,{fontSize:i.fontSizeLG,controlHeight:i.controlHeightLG,controlHeightSM:i.controlHeight,borderRadius:i.borderRadiusLG,borderRadiusSM:i.borderRadius}),"lg")]}export{u as default};
