import{g as b,m as w,_ as s,r as z,w as y,j as C,n as M,d as f}from"./index.TkDYtvUB.js";import{d as B,i as d,l as u}from"./index.CPcBO1Os.js";const I=t=>{const{componentCls:e,sizePaddingEdgeHorizontal:o,colorSplit:n,lineWidth:i}=t;return{[e]:s(s({},z(t)),{borderBlockStart:"".concat(i,"px solid ").concat(n),"&-vertical":{position:"relative",top:"-0.06em",display:"inline-block",height:"0.9em",margin:"0 ".concat(t.dividerVerticalGutterMargin,"px"),verticalAlign:"middle",borderTop:0,borderInlineStart:"".concat(i,"px solid ").concat(n)},"&-horizontal":{display:"flex",clear:"both",width:"100%",minWidth:"100%",margin:"".concat(t.dividerHorizontalGutterMargin,"px 0")},["&-horizontal".concat(e,"-with-text")]:{display:"flex",alignItems:"center",margin:"".concat(t.dividerHorizontalWithTextGutterMargin,"px 0"),color:t.colorTextHeading,fontWeight:500,fontSize:t.fontSizeLG,whiteSpace:"nowrap",textAlign:"center",borderBlockStart:"0 ".concat(n),"&::before, &::after":{position:"relative",width:"50%",borderBlockStart:"".concat(i,"px solid transparent"),borderBlockStartColor:"inherit",borderBlockEnd:0,transform:"translateY(50%)",content:"''"}},["&-horizontal".concat(e,"-with-text-left")]:{"&::before":{width:"5%"},"&::after":{width:"95%"}},["&-horizontal".concat(e,"-with-text-right")]:{"&::before":{width:"95%"},"&::after":{width:"5%"}},["".concat(e,"-inner-text")]:{display:"inline-block",padding:"0 1em"},"&-dashed":{background:"none",borderColor:n,borderStyle:"dashed",borderWidth:"".concat(i,"px 0 0")},["&-horizontal".concat(e,"-with-text").concat(e,"-dashed")]:{"&::before, &::after":{borderStyle:"dashed none none"}},["&-vertical".concat(e,"-dashed")]:{borderInlineStartWidth:i,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},["&-plain".concat(e,"-with-text")]:{color:t.colorText,fontWeight:"normal",fontSize:t.fontSize},["&-horizontal".concat(e,"-with-text-left").concat(e,"-no-default-orientation-margin-left")]:{"&::before":{width:0},"&::after":{width:"100%"},["".concat(e,"-inner-text")]:{paddingInlineStart:o}},["&-horizontal".concat(e,"-with-text-right").concat(e,"-no-default-orientation-margin-right")]:{"&::before":{width:"100%"},"&::after":{width:0},["".concat(e,"-inner-text")]:{paddingInlineEnd:o}}})}},G=b("Divider",t=>{const e=w(t,{dividerVerticalGutterMargin:t.marginXS,dividerHorizontalWithTextGutterMargin:t.margin,dividerHorizontalGutterMargin:t.marginLG});return[I(e)]},{sizePaddingEdgeHorizontal:0}),H=()=>({prefixCls:String,type:{type:String,default:"horizontal"},dashed:{type:Boolean,default:!1},orientation:{type:String,default:"center"},plain:{type:Boolean,default:!1},orientationMargin:[String,Number]}),W=B({name:"ADivider",inheritAttrs:!1,compatConfig:{MODE:3},props:H(),setup(t,e){let{slots:o,attrs:n}=e;const{prefixCls:i,direction:m}=C("divider",t),[v,h]=G(i),g=d(()=>t.orientation==="left"&&t.orientationMargin!=null),c=d(()=>t.orientation==="right"&&t.orientationMargin!=null),$=d(()=>{const{type:r,dashed:l,plain:S}=t,a=i.value;return{[a]:!0,[h.value]:!!h.value,["".concat(a,"-").concat(r)]:!0,["".concat(a,"-dashed")]:!!l,["".concat(a,"-plain")]:!!S,["".concat(a,"-rtl")]:m.value==="rtl",["".concat(a,"-no-default-orientation-margin-left")]:g.value,["".concat(a,"-no-default-orientation-margin-right")]:c.value}}),x=d(()=>{const r=typeof t.orientationMargin=="number"?"".concat(t.orientationMargin,"px"):t.orientationMargin;return s(s({},g.value&&{marginLeft:r}),c.value&&{marginRight:r})}),p=d(()=>t.orientation.length>0?"-"+t.orientation:t.orientation);return()=>{var r;const l=M((r=o.default)===null||r===void 0?void 0:r.call(o));return v(u("div",f(f({},n),{},{class:[$.value,l.length?"".concat(i.value,"-with-text ").concat(i.value,"-with-text").concat(p.value):"",n.class],role:"separator"}),[l.length?u("span",{class:"".concat(i.value,"-inner-text"),style:x.value},[l]):null]))}}}),T=y(W);export{T as D};
