import{b as R,t as P,n as B,m as E,d as S,r as T,e as N,f as j,g as i,h as D,B as K,i as L,w as O,j as q,k as G,l as H,p as J,q as U,s as $,v as Y,x as Z,y as Q,I as W,u as X,z as ee,A as ae,o as h,c as I,C as _,D as m,E as te,F as k,G as ne,H as oe,J as A,K as V,L as re,M as se}from"./index-BfmASpv-.js";const[w,y]=R("tabbar"),ce={route:Boolean,fixed:P,border:P,zIndex:B,placeholder:Boolean,activeColor:String,beforeChange:Function,inactiveColor:String,modelValue:E(0),safeAreaInsetBottom:{type:Boolean,default:null}},z=Symbol(w);var le=S({name:w,props:ce,emits:["change","update:modelValue"],setup(a,{emit:u,slots:t}){const c=T(),{linkChildren:l}=N(z),o=j(c,y),b=()=>{var e;return(e=a.safeAreaInsetBottom)!=null?e:a.fixed},r=()=>{var e;const{fixed:n,zIndex:s,border:v}=a;return i("div",{ref:c,role:"tablist",style:D(s),class:[y({fixed:n}),{[K]:v,"van-safe-area-bottom":b()}]},[(e=t.default)==null?void 0:e.call(t)])};return l({props:a,setActive:(e,n)=>{L(a.beforeChange,{args:[e],done(){u("update:modelValue",e),u("change",e),n()}})}}),()=>a.fixed&&a.placeholder?o(r):r()}});const ie=O(le),[ue,x]=R("tabbar-item"),be=q({},G,{dot:Boolean,icon:String,name:B,badge:B,badgeProps:Object,iconPrefix:String});var de=S({name:ue,props:be,emits:["click"],setup(a,{emit:u,slots:t}){const c=H(),l=J().proxy,{parent:o,index:b}=U(z);if(!o)return;const r=$(()=>{var n;const{route:s,modelValue:v}=o.props;if(s&&"$route"in l){const{$route:f}=l,{to:g}=a,d=Q(g)?g:{path:g};return!!f.matched.find(C=>{const F="path"in d&&d.path===C.path,M="name"in d&&d.name===C.name;return F||M})}return((n=a.name)!=null?n:b.value)===v}),p=n=>{var s;r.value||o.setActive((s=a.name)!=null?s:b.value,c),u("click",n)},e=()=>{if(t.icon)return t.icon({active:r.value});if(a.icon)return i(W,{name:a.icon,classPrefix:a.iconPrefix},null)};return()=>{var n;const{dot:s,badge:v}=a,{activeColor:f,inactiveColor:g}=o.props,d=r.value?f:g;return i("div",{role:"tab",class:x({active:r.value}),style:{color:d},tabindex:0,"aria-selected":r.value,onClick:p},[i(Y,Z({dot:s,class:x("icon"),content:v},a.badgeProps),{default:e}),i("div",{class:x("text")},[(n=t.default)==null?void 0:n.call(t,{active:r.value})])])}}});const me=O(de),ve=["src"],pe={__name:"index",setup(a){const u=X(),t=T(0),c=$(()=>[{label:i18n.t("tabs[0]"),inactive:"images/tabbar/1.png",active:"images/tabbar/1-1.png",path:"/home"},{label:i18n.t("tabs[1]"),inactive:"images/tabbar/2.png",active:"images/tabbar/2-1.png",path:"/market"},{label:i18n.t("tabs[2]"),inactive:"images/tabbar/3.png",active:"images/tabbar/3-1.png",path:"/contract"},{label:i18n.t("tabs[3]"),inactive:"images/tabbar/3.png",active:"images/tabbar/3-1.png",path:"/financial"},{label:i18n.t("tabs[4]"),inactive:"images/tabbar/4.png",active:"images/tabbar/4-1.png",path:"/user"}]);return ee(()=>{c.value.filter((l,o)=>{l.path==u.path&&(t.value=o)})}),(l,o)=>{const b=ae("RouterView"),r=me,p=ie;return h(),I(k,null,[i(b),i(p,{modelValue:m(t),"onUpdate:modelValue":o[0]||(o[0]=e=>te(t)?t.value=e:null),"z-index":"10"},{default:_(()=>[(h(!0),I(k,null,ne(m(c),(e,n)=>(h(),oe(r,{key:e.label,to:e.path},{icon:_(s=>[A("img",{src:m(t)==n?m(V)(e.active):m(V)(e.inactive)},null,8,ve)]),default:_(()=>[A("span",{class:se({"text-[#F6A500]":m(t)==n})},re(e.label),3)]),_:2},1032,["to"]))),128))]),_:1},8,["modelValue"])],64)}}};export{pe as default};