import{defineComponent as S,computed as $,createVNode as n}from"vue";import{WarningFilled as C,ExclamationCircleFilled as x,CloseCircleFilled as N,CheckCircleFilled as b}from"@antsoo-lib/icons";import y from"../_util/classNames.mjs";import s from"../_util/vue-types/index.mjs";import I from"../config-provider/hooks/useConfigInject.mjs";import T from"./noFound.mjs";import g from"./serverError.mjs";import M from"./style/index.mjs";import R from"./unauthorized.mjs";const _={success:b,error:N,info:x,warning:C},l={404:T,500:g,403:R},h=Object.keys(l),A=()=>({prefixCls:String,icon:s.any,status:{type:[Number,String],default:"info"},title:s.any,subTitle:s.any,extra:s.any}),F=(t,{status:e,icon:c})=>{if(h.includes(`${e}`)){const u=l[e];return n("div",{class:`${t}-icon ${t}-image`},[n(u,null,null)])}const o=_[e],a=c||n(o,null,null);return n("div",{class:`${t}-icon`},[a])},P=(t,e)=>e&&n("div",{class:`${t}-extra`},[e]),i=S({compatConfig:{MODE:3},name:"AResult",inheritAttrs:!1,props:A(),slots:Object,setup(t,{slots:e,attrs:c}){const{prefixCls:o,direction:a}=I("result",t),[u,d]=M(o),f=$(()=>y(o.value,d.value,`${o.value}-${t.status}`,{[`${o.value}-rtl`]:a.value==="rtl"}));return()=>{const E=t.title??e.title?.(),m=t.subTitle??e.subTitle?.(),p=t.icon??e.icon?.(),v=t.extra??e.extra?.(),r=o.value;return u(n("div",{...c,class:[f.value,c.class]},[F(r,{status:t.status,icon:p}),n("div",{class:`${r}-title`},[E]),m&&n("div",{class:`${r}-subtitle`},[m]),P(r,v),e.default&&n("div",{class:`${r}-content`},[e.default()])]))}}});i.PRESENTED_IMAGE_403=l[403];i.PRESENTED_IMAGE_404=l[404];i.PRESENTED_IMAGE_500=l[500];i.install=function(t){return t.component(i.name,i),t};export{l as ExceptionMap,_ as IconMap,i as default,A as resultProps};
