import{J as p,d as B,c as y,a0 as O,a5 as $,a1 as C,a6 as g,a7 as V,g as d,a8 as R,a9 as M,aa as N,q as _,ab as j,ac as z,ad as E,ae as q,af as w,C as D,ag as F,ah as J,ai as K,l as Y}from"./index-b3d5c748.js";const[A,I]=p("tabbar"),Z={route:Boolean,fixed:C,border:C,zIndex:g,placeholder:Boolean,activeColor:String,beforeChange:Function,inactiveColor:String,modelValue:V(0),safeAreaInsetBottom:{type:Boolean,default:null}},T=Symbol(A);var G=B({name:A,props:Z,emits:["change","update:modelValue"],setup(e,{emit:u,slots:r}){const m=y(),{linkChildren:b}=O(T),c=$(m,I),f=()=>{var a;return(a=e.safeAreaInsetBottom)!=null?a:e.fixed},n=()=>{var a;const{fixed:t,zIndex:o,border:l}=e;return d("div",{ref:m,role:"tablist",style:R(o),class:[I({fixed:t}),{[M]:l,"van-safe-area-bottom":f()}]},[(a=r.default)==null?void 0:a.call(r)])};return b({props:e,setActive:(a,t)=>{N(e.beforeChange,{args:[a],done(){u("update:modelValue",a),u("change",a),t()}})}}),()=>e.fixed&&e.placeholder?c(n):n()}});const W=_(G),[H,h]=p("tabbar-item"),L=j({},z,{dot:Boolean,icon:String,name:g,badge:g,badgeProps:Object,iconPrefix:String});var Q=B({name:H,props:L,emits:["click"],setup(e,{emit:u,slots:r}){const m=E(),b=q().proxy,{parent:c,index:f}=w(T);if(!c)return;const n=D(()=>{var t;const{route:o,modelValue:l}=c.props;if(o&&"$route"in b){const{$route:v}=b,{to:i}=e,s=K(i)?i:{path:i};return!!v.matched.find(P=>{const S="path"in s&&s.path===P.path,k="name"in s&&s.name===P.name;return S||k})}return((t=e.name)!=null?t:f.value)===l}),x=t=>{var o;n.value||c.setActive((o=e.name)!=null?o:f.value,m),u("click",t)},a=()=>{if(r.icon)return r.icon({active:n.value});if(e.icon)return d(Y,{name:e.icon,classPrefix:e.iconPrefix},null)};return()=>{var t;const{dot:o,badge:l}=e,{activeColor:v,inactiveColor:i}=c.props,s=n.value?v:i;return d("div",{role:"tab",class:h({active:n.value}),style:{color:s},tabindex:0,"aria-selected":n.value,onClick:x},[d(F,J({dot:o,class:h("icon"),content:l},e.badgeProps),{default:a}),d("div",{class:h("text")},[(t=r.default)==null?void 0:t.call(r,{active:n.value})])])}}});const X=_(Q);export{W as T,X as a};