import{d as C,c as l,e as s,f,B as u,g as $,m as v,t as h,p as g}from"./CQ5rtXCu.js";const p=t=>{if(typeof t=="number"&&Number.isFinite(t)&&t>0)return t;if(typeof t!="string")return null;const o=t.trim();if(!o)return null;const e=o.match(/^(\d+(?:\.\d+)?)(?:px)?$/);if(!e)return null;const n=Number(e[1]);return Number.isFinite(n)&&n>0?n:null},b=(t,o="nav")=>{if(!t)return{};const e={};if(t.fontSize!==void 0&&t.fontSize!==null&&t.fontSize!==""){const n=p(t.fontSize);n?(e[`--${o}-font-size-mobile`]=`${Math.max(12,Math.round(n*.62))}px`,e[`--${o}-font-size-tablet`]=`${Math.max(14,Math.round(n*.85))}px`,e[`--${o}-font-size-desktop`]=`${n}px`):e.fontSize=t.fontSize}return t.fontColor&&(e.color=t.fontColor),t.fontStyle&&(e.fontStyle=t.fontStyle),t.fontWeight!==void 0&&t.fontWeight!==null&&t.fontWeight!==""&&(e.fontWeight=t.fontWeight),t.fontFamily?.trim()&&(e.fontFamily=t.fontFamily),e},B=(t,o="nav-brand")=>{if(!t)return{};const e={};if(t.fontSize!==void 0&&t.fontSize!==null&&t.fontSize!==""){const n=p(t.fontSize);n?(e[`--${o}-font-size-mobile`]=`${Math.max(12,Math.round(n*.62))}px`,e[`--${o}-font-size-tablet`]=`${Math.max(14,Math.round(n*.85))}px`,e[`--${o}-font-size-desktop`]=`${n}px`):e.fontSize=t.fontSize}return t.fontWeight!==void 0&&t.fontWeight!==null&&t.fontWeight!==""&&(e.fontWeight=t.fontWeight),e},N=["href","title"],W=["src","alt"],M={key:1,class:"flex min-w-0 flex-col leading-tight"},_=C({__name:"NavbarBrand",props:{navData:{},href:{default:"/"},logoSrc:{},logoClass:{default:"max-h-15 w-auto object-contain"},companyClass:{default:"font-bold tracking-wider"},subtitleClass:{default:"mt-0.5 font-normal opacity-80"},fallbackColor:{default:""}},emits:["click"],setup(t,{emit:o}){const e=t,n=o,a=l(()=>e.navData??{}),c=l(()=>String(e.logoSrc||a.value.logoUrl||"").trim()),r=l(()=>String(a.value.info?.title||a.value.detailRecord?.full_name||a.value.bindings?.brandName||"").trim()),i=l(()=>String(a.value.info?.description||a.value.detailRecord?.brand_name||"").trim()),m=l(()=>r.value||i.value||"Home"),x=l(()=>!!(r.value&&i.value&&i.value!==r.value)),S=l(()=>({...e.fallbackColor?{color:e.fallbackColor}:{},...b(a.value.title,"nav-brand")})),z=l(()=>({...e.fallbackColor?{color:e.fallbackColor}:{},...b(a.value.subtitle,"nav-subtitle")}));return(w,d)=>(s(),f("a",{href:t.href,class:u(["flex min-w-0 shrink-0 items-center",{"max-md:w-[35%]":c.value}]),title:m.value,onClick:d[0]||(d[0]=k=>n("click",k))},[c.value?(s(),f("img",{key:0,src:c.value,alt:m.value,class:u(["max-md:w-full!",t.logoClass]),fetchpriority:"high",loading:"eager"},null,10,W)):r.value||i.value?(s(),f("span",M,[$("span",{class:u(["text-[length:var(--nav-brand-font-size-mobile,18px)] md:text-[length:var(--nav-brand-font-size-tablet,20px)] lg:text-[length:var(--nav-brand-font-size-desktop,20px)]",t.companyClass]),style:v(S.value)},h(r.value||i.value),7),x.value?(s(),f("span",{key:0,class:u(["hidden text-[length:var(--nav-subtitle-font-size-mobile,12px)] md:block md:text-[length:var(--nav-subtitle-font-size-tablet,13px)] lg:text-[length:var(--nav-subtitle-font-size-desktop,14px)]",t.subtitleClass]),style:v(z.value)},h(i.value),7)):g("",!0)])):g("",!0)],10,N))}});export{_,B as r};
