import{y as U,z as Y,Q as _,X as q,B as J,bc as Z,d as ee,K as ne,D as w,F as oe,L as te,f as s,bs as le,aa as ie,an as ae,bY as se,bh as re,b$ as ce,O as V,b_ as de,bt as ue,cT as ge,br as fe,bw as pe,cU as me,cV as ve,cW as $e,cX as be,a3 as v}from"./outputWidgets.b00cf7e9.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="045b066b-1cef-4bd8-b2ca-a55203496337",e._sentryDebugIdIdentifier="sentry-dbid-045b066b-1cef-4bd8-b2ca-a55203496337")}catch{}})();const B=(e,n,o,i,a)=>({backgroundColor:e,border:`${i.lineWidth}px ${i.lineType} ${n}`,[`${a}-icon`]:{color:o}}),ye=e=>{const{componentCls:n,motionDurationSlow:o,marginXS:i,marginSM:a,fontSize:u,fontSizeLG:r,lineHeight:g,borderRadiusLG:$,motionEaseInOutCirc:c,alertIconSizeLG:d,colorText:p,paddingContentVerticalSM:m,alertPaddingHorizontal:b,paddingMD:h,paddingContentHorizontalLG:C}=e;return{[n]:_(_({},q(e)),{position:"relative",display:"flex",alignItems:"center",padding:`${m}px ${b}px`,wordWrap:"break-word",borderRadius:$,[`&${n}-rtl`]:{direction:"rtl"},[`${n}-content`]:{flex:1,minWidth:0},[`${n}-icon`]:{marginInlineEnd:i,lineHeight:0},["&-description"]:{display:"none",fontSize:u,lineHeight:g},"&-message":{color:p},[`&${n}-motion-leave`]:{overflow:"hidden",opacity:1,transition:`max-height ${o} ${c}, opacity ${o} ${c},
        padding-top ${o} ${c}, padding-bottom ${o} ${c},
        margin-bottom ${o} ${c}`},[`&${n}-motion-leave-active`]:{maxHeight:0,marginBottom:"0 !important",paddingTop:0,paddingBottom:0,opacity:0}}),[`${n}-with-description`]:{alignItems:"flex-start",paddingInline:C,paddingBlock:h,[`${n}-icon`]:{marginInlineEnd:a,fontSize:d,lineHeight:0},[`${n}-message`]:{display:"block",marginBottom:i,color:p,fontSize:r},[`${n}-description`]:{display:"block"}},[`${n}-banner`]:{marginBottom:0,border:"0 !important",borderRadius:0}}},he=e=>{const{componentCls:n,colorSuccess:o,colorSuccessBorder:i,colorSuccessBg:a,colorWarning:u,colorWarningBorder:r,colorWarningBg:g,colorError:$,colorErrorBorder:c,colorErrorBg:d,colorInfo:p,colorInfoBorder:m,colorInfoBg:b}=e;return{[n]:{"&-success":B(a,i,o,e,n),"&-info":B(b,m,p,e,n),"&-warning":B(g,r,u,e,n),"&-error":_(_({},B(d,c,$,e,n)),{[`${n}-description > pre`]:{margin:0,padding:0}})}}},Ce=e=>{const{componentCls:n,iconCls:o,motionDurationMid:i,marginXS:a,fontSizeIcon:u,colorIcon:r,colorIconHover:g}=e;return{[n]:{["&-action"]:{marginInlineStart:a},[`${n}-close-icon`]:{marginInlineStart:a,padding:0,overflow:"hidden",fontSize:u,lineHeight:`${u}px`,backgroundColor:"transparent",border:"none",outline:"none",cursor:"pointer",[`${o}-close`]:{color:r,transition:`color ${i}`,"&:hover":{color:g}}},"&-close-text":{color:r,transition:`color ${i}`,"&:hover":{color:g}}}}},Ie=e=>[ye(e),he(e),Ce(e)],Se=U("Alert",e=>{const{fontSizeHeading3:n}=e,o=Y(e,{alertIconSizeLG:n,alertPaddingHorizontal:12});return[Ie(o)]}),xe={success:ue,info:ge,error:fe,warning:pe},we={success:me,info:ve,error:$e,warning:be},Be=Z("success","info","warning","error"),_e=()=>({type:v.oneOf(Be),closable:{type:Boolean,default:void 0},closeText:v.any,message:v.any,description:v.any,afterClose:Function,showIcon:{type:Boolean,default:void 0},prefixCls:String,banner:{type:Boolean,default:void 0},icon:v.any,closeIcon:v.any,onClose:Function}),Te=ee({compatConfig:{MODE:3},name:"AAlert",inheritAttrs:!1,props:_e(),setup(e,n){let{slots:o,emit:i,attrs:a,expose:u}=n;const{prefixCls:r,direction:g}=ne("alert",e),[$,c]=Se(r),d=w(!1),p=w(!1),m=w(),b=l=>{l.preventDefault();const f=m.value;f.style.height=`${f.offsetHeight}px`,f.style.height=`${f.offsetHeight}px`,d.value=!0,i("close",l)},h=()=>{var l;d.value=!1,p.value=!0,(l=e.afterClose)===null||l===void 0||l.call(e)},C=oe(()=>{const{type:l}=e;return l!==void 0?l:e.banner?"warning":"info"});u({animationEnd:h});const k=w({});return()=>{var l,f,T,H,z,A,E,D,O,L;const{banner:W,closeIcon:P=(l=o.closeIcon)===null||l===void 0?void 0:l.call(o)}=e;let{closable:F,showIcon:y}=e;const M=(f=e.closeText)!==null&&f!==void 0?f:(T=o.closeText)===null||T===void 0?void 0:T.call(o),I=(H=e.description)!==null&&H!==void 0?H:(z=o.description)===null||z===void 0?void 0:z.call(o),G=(A=e.message)!==null&&A!==void 0?A:(E=o.message)===null||E===void 0?void 0:E.call(o),S=(D=e.icon)!==null&&D!==void 0?D:(O=o.icon)===null||O===void 0?void 0:O.call(o),R=(L=o.action)===null||L===void 0?void 0:L.call(o);y=W&&y===void 0?!0:y;const N=(I?we:xe)[C.value]||null;M&&(F=!0);const t=r.value,X=te(t,{[`${t}-${C.value}`]:!0,[`${t}-closing`]:d.value,[`${t}-with-description`]:!!I,[`${t}-no-icon`]:!y,[`${t}-banner`]:!!W,[`${t}-closable`]:F,[`${t}-rtl`]:g.value==="rtl",[c.value]:!0}),j=F?s("button",{type:"button",onClick:b,class:`${t}-close-icon`,tabindex:0},[M?s("span",{class:`${t}-close-text`},[M]):P===void 0?s(le,null,null):P]):null,K=S&&(ie(S)?ae(S,{class:`${t}-icon`}):s("span",{class:`${t}-icon`},[S]))||s(N,{class:`${t}-icon`},null),Q=se(`${t}-motion`,{appear:!1,css:!0,onAfterLeave:h,onBeforeLeave:x=>{x.style.maxHeight=`${x.offsetHeight}px`},onLeave:x=>{x.style.maxHeight="0px"}});return $(p.value?null:s(de,Q,{default:()=>[re(s("div",V(V({role:"alert"},a),{},{style:[a.style,k.value],class:[a.class,X],"data-show":!d.value,ref:m}),[y?K:null,s("div",{class:`${t}-content`},[G?s("div",{class:`${t}-message`},[G]):null,I?s("div",{class:`${t}-description`},[I]):null]),R?s("div",{class:`${t}-action`},[R]):null,j]),[[ce,!d.value]])]}))}}}),ze=J(Te);export{ze as A};
//# sourceMappingURL=index.c775a6c6.js.map
