"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("../../style/index.js");require("../../theme/internal.js");const u=require("../../theme/util/genComponentStyleHook.js"),c=require("../../theme/util/statistic.js");function o(e,i){return{[`${e}, ${e}:hover, ${e}:focus`]:{color:i.colorTextDisabled,cursor:"not-allowed"}}}function r(e){return{backgroundColor:e.bgColorSelected,boxShadow:e.boxShadow}}const b={overflow:"hidden",...n.textEllipsis},$=e=>{const{componentCls:i}=e;return{[i]:{...n.resetComponent(e),display:"inline-block",padding:e.segmentedContainerPadding,color:e.labelColor,backgroundColor:e.bgColor,borderRadius:e.borderRadius,transition:`all ${e.motionDurationMid} ${e.motionEaseInOut}`,[`${i}-group`]:{position:"relative",display:"flex",alignItems:"stretch",justifyItems:"flex-start",width:"100%"},[`&${i}-rtl`]:{direction:"rtl"},[`&${i}-block`]:{display:"flex"},[`&${i}-block ${i}-item`]:{flex:1,minWidth:0},[`${i}-item`]:{position:"relative",textAlign:"center",cursor:"pointer",transition:`color ${e.motionDurationMid} ${e.motionEaseInOut}`,borderRadius:e.borderRadiusSM,"&-selected":{...r(e),color:e.labelColorHover},"&::after":{content:'""',position:"absolute",width:"100%",height:"100%",top:0,insetInlineStart:0,borderRadius:"inherit",transition:`background-color ${e.motionDurationMid}`,pointerEvents:"none"},[`&:hover:not(${i}-item-selected):not(${i}-item-disabled)`]:{color:e.labelColorHover,"&::after":{backgroundColor:e.bgColorHover}},"&-label":{minHeight:e.controlHeight-e.segmentedContainerPadding*2,lineHeight:`${e.controlHeight-e.segmentedContainerPadding*2}px`,padding:`0 ${e.segmentedPaddingHorizontal}px`,...b},"&-icon + *":{marginInlineStart:e.marginSM/2},"&-input":{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:0,height:0,opacity:0,pointerEvents:"none"}},[`${i}-thumb`]:{...r(e),position:"absolute",insetBlockStart:0,insetInlineStart:0,width:0,height:"100%",padding:`${e.paddingXXS}px 0`,borderRadius:e.borderRadiusSM,[`& ~ ${i}-item:not(${i}-item-selected):not(${i}-item-disabled)::after`]:{backgroundColor:"transparent"}},[`&${i}-lg`]:{borderRadius:e.borderRadiusLG,[`${i}-item-label`]:{minHeight:e.controlHeightLG-e.segmentedContainerPadding*2,lineHeight:`${e.controlHeightLG-e.segmentedContainerPadding*2}px`,padding:`0 ${e.segmentedPaddingHorizontal}px`,fontSize:e.fontSizeLG},[`${i}-item, ${i}-thumb`]:{borderRadius:e.borderRadius}},[`&${i}-sm`]:{borderRadius:e.borderRadiusSM,[`${i}-item-label`]:{minHeight:e.controlHeightSM-e.segmentedContainerPadding*2,lineHeight:`${e.controlHeightSM-e.segmentedContainerPadding*2}px`,padding:`0 ${e.segmentedPaddingHorizontalSM}px`},[`${i}-item, ${i}-thumb`]:{borderRadius:e.borderRadiusXS}},...o(`&-disabled ${i}-item`,e),...o(`${i}-item-disabled`,e),[`${i}-thumb-motion-appear-active`]:{transition:`transform ${e.motionDurationSlow} ${e.motionEaseInOut}, width ${e.motionDurationSlow} ${e.motionEaseInOut}`,willChange:"transform, width"}}}},h=u.default("Segmented",e=>{const{lineWidthBold:i,lineWidth:t,colorTextLabel:d,colorText:l,colorFillSecondary:a,colorBgLayout:s,colorBgElevated:g}=e,m=c.merge(e,{segmentedPaddingHorizontal:e.controlPaddingHorizontal-t,segmentedPaddingHorizontalSM:e.controlPaddingHorizontalSM-t,segmentedContainerPadding:i,labelColor:d,labelColorHover:l,bgColor:s,bgColorHover:a,bgColorSelected:g});return[$(m)]});exports.default=h;
