import{defineComponent as S,computed as $,createVNode as n}from"vue";import C from"@ant-design/icons-vue/CheckCircleFilled";import x from"@ant-design/icons-vue/CloseCircleFilled";import N from"@ant-design/icons-vue/ExclamationCircleFilled";import b from"@ant-design/icons-vue/WarningFilled";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:C,error:x,info:N,warning:b},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]),r=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 p=t.title??e.title?.(),m=t.subTitle??e.subTitle?.(),E=t.icon??e.icon?.(),v=t.extra??e.extra?.(),i=o.value;return u(n("div",{...c,class:[f.value,c.class]},[F(i,{status:t.status,icon:E}),n("div",{class:`${i}-title`},[p]),m&&n("div",{class:`${i}-subtitle`},[m]),P(i,v),e.default&&n("div",{class:`${i}-content`},[e.default()])]))}}});r.PRESENTED_IMAGE_403=l[403];r.PRESENTED_IMAGE_404=l[404];r.PRESENTED_IMAGE_500=l[500];r.install=function(t){return t.component(r.name,r),t};export{l as ExceptionMap,_ as IconMap,r as default,A as resultProps};
