import{isFunction as e}from"../_util/util.mjs";import t from"../_util/classNames.mjs";import n from"../locale/en_US.mjs";import r from"../locale/LocaleReceiver.mjs";import i from"../button/index.mjs";import{tourStepProps as a}from"./interface.mjs";import{computed as o,createVNode as s,defineComponent as c,toRefs as l}from"vue";import{CloseOutlined as u}from"@antsoo-lib/icons";var d=c({name:`ATourPanel`,inheritAttrs:!1,props:a(),setup(a,{attrs:c,slots:d}){let{current:f,total:p}=l(a),m=o(()=>f.value===p.value-1),h=e=>{let t=a.prevButtonProps;a.onPrev?.(e),typeof t?.onClick==`function`&&t?.onClick()},g=e=>{let t=a.nextButtonProps;m.value?a.onFinish?.(e):a.onNext?.(e),typeof t?.onClick==`function`&&t?.onClick()};return()=>{let{prefixCls:o,title:l,onClose:_,cover:v,description:y,type:b,arrow:x}=a,S=a.prevButtonProps,C=a.nextButtonProps,w;l&&(w=s(`div`,{class:`${o}-header`},[s(`div`,{class:`${o}-title`},[l])]));let T;y&&(T=s(`div`,{class:`${o}-description`},[y]));let E;v&&(E=s(`div`,{class:`${o}-cover`},[v]));let D;D=d.indicatorsRender?d.indicatorsRender({current:f.value,total:p}):[...Array.from({length:p.value}).keys()].map((e,n)=>s(`span`,{key:e,class:t(n===f.value&&`${o}-indicator-active`,`${o}-indicator`)},null));let O=b===`primary`?`default`:`primary`,k={type:`default`,ghost:b===`primary`};return s(r,{componentName:`Tour`,defaultLocale:n.Tour},{default:n=>s(`div`,{...c,class:t(b===`primary`?`${o}-primary`:``,c.class,`${o}-content`)},[x&&s(`div`,{class:`${o}-arrow`,key:`arrow`},null),s(`div`,{class:`${o}-inner`},[s(u,{class:`${o}-close`,onClick:_},null),E,w,T,s(`div`,{class:`${o}-footer`},[p.value>1&&s(`div`,{class:`${o}-indicators`},[D]),s(`div`,{class:`${o}-buttons`},[f.value===0?null:s(i,{...k,...S,onClick:h,size:`small`,class:t(`${o}-prev-btn`,S?.className)},{default:()=>[e(S?.children)?S.children():S?.children??n.Previous]}),s(i,{type:O,...C,onClick:g,size:`small`,class:t(`${o}-next-btn`,C?.className)},{default:()=>[e(C?.children)?C?.children():m.value?n.Finish:n.Next]})])])])])})}}});export{d as default};