"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("../../style/index.js"),d=require("../../style/compact-item.js");require("../../theme/internal.js");const p=require("./dropdown.js"),g=require("./multiple.js"),m=require("./single.js"),$=require("../../theme/util/genComponentStyleHook.js"),i=require("../../theme/util/statistic.js"),b=o=>{const{componentCls:e}=o;return{position:"relative",backgroundColor:o.colorBgContainer,border:`${o.lineWidth}px ${o.lineType} ${o.colorBorder}`,transition:`all ${o.motionDurationMid} ${o.motionEaseInOut}`,input:{cursor:"pointer"},[`${e}-show-search&`]:{cursor:"text",input:{cursor:"auto",color:"inherit"}},[`${e}-disabled&`]:{color:o.colorTextDisabled,background:o.colorBgContainerDisabled,cursor:"not-allowed",[`${e}-multiple&`]:{background:o.colorBgContainerDisabled},input:{cursor:"not-allowed"}}}},a=(o,e,t=!1)=>{const{componentCls:r,borderHoverColor:l,outlineColor:c,antCls:s}=e,u=t?{[`${r}-selector`]:{borderColor:l}}:{};return{[o]:{[`&:not(${r}-disabled):not(${r}-customize-input):not(${s}-pagination-size-changer)`]:{...u,[`${r}-focused& ${r}-selector`]:{borderColor:l,boxShadow:`0 0 0 ${e.controlOutlineWidth}px ${c}`,borderInlineEndWidth:`${e.controlLineWidth}px !important`,outline:0},[`&:hover ${r}-selector`]:{borderColor:l,borderInlineEndWidth:`${e.controlLineWidth}px !important`}}}}},S=o=>{const{componentCls:e}=o;return{[`${e}-selection-search-input`]:{margin:0,padding:0,background:"transparent",border:"none",outline:"none",appearance:"none","&::-webkit-search-cancel-button":{display:"none","-webkit-appearance":"none"}}}},f=o=>{const{componentCls:e,inputPaddingHorizontalBase:t,iconCls:r}=o;return{[e]:{...n.resetComponent(o),position:"relative",display:"inline-block",cursor:"pointer",[`&:not(${e}-customize-input) ${e}-selector`]:{...b(o),...S(o)},[`${e}-selection-item`]:{flex:1,fontWeight:"normal",...n.textEllipsis},[`${e}-selection-placeholder`]:{...n.textEllipsis,flex:1,color:o.colorTextPlaceholder,pointerEvents:"none"},[`${e}-arrow`]:{...n.resetIcon(),position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:t,height:o.fontSizeIcon,marginTop:-o.fontSizeIcon/2,color:o.colorTextQuaternary,fontSize:o.fontSizeIcon,lineHeight:1,textAlign:"center",pointerEvents:"none",display:"flex",alignItems:"center",[r]:{verticalAlign:"top",transition:`transform ${o.motionDurationSlow}`,"> svg":{verticalAlign:"top"},[`&:not(${e}-suffix)`]:{pointerEvents:"auto"}},[`${e}-disabled &`]:{cursor:"not-allowed"},"> *:not(:last-child)":{marginInlineEnd:8}},[`${e}-clear`]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:t,zIndex:1,display:"inline-block",width:o.fontSizeIcon,height:o.fontSizeIcon,marginTop:-o.fontSizeIcon/2,color:o.colorTextQuaternary,fontSize:o.fontSizeIcon,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",background:o.colorBgContainer,cursor:"pointer",opacity:0,transition:`color ${o.motionDurationMid} ease, opacity ${o.motionDurationSlow} ease`,textRendering:"auto","&:before":{display:"block"},"&:hover":{color:o.colorTextTertiary}},"&:hover":{[`${e}-clear`]:{opacity:1}}},[`${e}-has-feedback`]:{[`${e}-clear`]:{insetInlineEnd:t+o.fontSize+o.paddingXXS}}}},h=o=>{const{componentCls:e}=o;return[{[e]:{[`&-borderless ${e}-selector`]:{backgroundColor:"transparent !important",borderColor:"transparent !important",boxShadow:"none !important"},[`&${e}-in-form-item`]:{width:"100%"}}},f(o),m.default(o),g.default(o),p.default(o),{[`${e}-rtl`]:{direction:"rtl"}},a(e,i.merge(o,{borderHoverColor:o.colorPrimaryHover,outlineColor:o.controlOutline})),a(`${e}-status-error`,i.merge(o,{borderHoverColor:o.colorErrorHover,outlineColor:o.colorErrorOutline}),!0),a(`${e}-status-warning`,i.merge(o,{borderHoverColor:o.colorWarningHover,outlineColor:o.colorWarningOutline}),!0),d.genCompactItemStyle(o,{borderElCls:`${e}-selector`,focusElCls:`${e}-focused`})]},C=$.default("Select",(o,{rootPrefixCls:e})=>{const t=i.merge(o,{rootPrefixCls:e,inputPaddingHorizontalBase:o.paddingSM-1});return[h(t)]},o=>({zIndexPopup:o.zIndexPopupBase+50}));exports.default=C;
