import{u as m}from"./use-placeholder-CaxDMxdA.js";import{b7 as D,by as s,bn as I,bk as R,N as l,bX as f,bY as A,bZ as C,bo as w,r as N,aq as P}from"./index-xnhGKCfe.js";const[L,t]=R("nav-bar"),S={title:String,fixed:Boolean,zIndex:I,border:s,leftText:String,rightText:String,leftDisabled:Boolean,rightDisabled:Boolean,leftArrow:Boolean,placeholder:Boolean,safeAreaInsetTop:Boolean,clickable:s};var y=D({name:L,props:S,emits:["clickLeft","clickRight"],setup(e,{emit:n,slots:a}){const r=N(),d=m(r,t),o=i=>{e.leftDisabled||n("clickLeft",i)},b=i=>{e.rightDisabled||n("clickRight",i)},h=()=>a.left?a.left():[e.leftArrow&&l(w,{class:t("arrow"),name:"arrow-left"},null),e.leftText&&l("span",{class:t("text")},[e.leftText])],g=()=>a.right?a.right():l("span",{class:t("text")},[e.rightText]),c=()=>{const{title:i,fixed:x,border:u,zIndex:v}=e,B=A(v),k=e.leftArrow||e.leftText||a.left,T=e.rightText||a.right;return l("div",{ref:r,style:B,class:[t({fixed:x}),{[C]:u,"van-safe-area-top":e.safeAreaInsetTop}]},[l("div",{class:t("content")},[k&&l("div",{class:[t("left",{disabled:e.leftDisabled}),e.clickable&&!e.leftDisabled?f:""],onClick:o},[h()]),l("div",{class:[t("title"),"van-ellipsis"]},[a.title?a.title():i]),T&&l("div",{class:[t("right",{disabled:e.rightDisabled}),e.clickable&&!e.rightDisabled?f:""],onClick:b},[g()])])])};return()=>e.fixed&&e.placeholder?d(c):c()}});const _=P(y);export{_ as N};
