1import{c as e}from"./DorSiaX2.js";import{A as t,G as n,Gt as r,Jt as i,Tt as a,V as o,W as s,at as c,d as l,et as u,f as d,it as f,l as p,mt as m,p as h,qt as g,r as _,st as v,u as y,v as b,vt as x,x as S,y as C}from"./Dw33plwm.js";import{ot as w,t as T}from"./CBF9tWyD.js";import{C as E,m as D}from"./Bm5XyCLo.js";import{t as O}from"./DlVb8YNB.js";import{t as k}from"./C9kYOsoz.js";import{a as ee}from"./Bvhm9SRq.js";import{t as A}from"./CWB0G9zp.js";import{$ as j,B as M,D as te,k as N,p as ne}from"./B-EOieCo.js";import{n as P}from"./WX6epeCT.js";import{t as F}from"./BDNMzG2s.js";import{n as I}from"./B35lLJ6p.js";import"./B7nG8JeV.js";import{t as L}from"./BPhqmHkA.js";import{t as R}from"./RslQsZuL.js";import"./CpK87C1X.js";import{t as re}from"./Cw5DexJI2.js";import{t as ie}from"./BhzonX5J2.js";import"./D-Z7piPW2.js";import{t as z}from"./DNKpzfJ92.js";var ae={class:`w-full`},oe={class:`w-full`},se={type:`button`,class:`text-midnight-950 bg-cocaine enabled:hover:bg-midnight-50 border-midnight-300 + focus:border-midnight-800 focus:outline-midnight-800 enabled:hover:shadow-s flex h-7 items-center justify-center gap-1.5 rounded-md border px-2.5 align-middle text-xs font-medium shadow-xs transition-all duration-300 ease-in-out focus:border focus:outline`},ce={class:`text-nowrap`},B={class:`inline-grid h-4 w-4 shrink-0 place-items-center`},V={class:`flex flex-col`},H=[`onClick`],U={class:`flex items-center gap-1.5`},W=S({__name:`currency-selector`,setup(e){let t=[{label:`CAD | EN`,value:`CAD`,icon:`flag:ca-4x3`},{label:`USD | EN`,value:`USD`,icon:`flag:us-4x3`}],{currency:n,setCurrency:c}=I(),u=x(n.value||`CAD`);f(n,e=>{let t=e||`CAD`;t!==u.value&&(u.value=t)}),f(u,e=>{e!==n.value&&c(e)});let m=x(!1),g=p(()=>t.map(e=>({...e,selected:u.value===e.value}))),b=p(()=>g.value.find(e=>e.selected)),S=p(()=>b.value?.label??`CAD | EN`),T=p(()=>m.value?`lucide:x`:`lucide:chevron-down`),E=p(()=>`transition-transform duration-500 ease-in-out ${m.value?`rotate-180`:``}`),D=e=>{e.disabled||(u.value!==e.value&&(u.value=e.value),m.value=!1)};return(e,t)=>{let n=A;return o(),h(`div`,ae,[C(a(M),{overlay:!1,"is-open":a(m),class:`w-full`,onOpened:t[0]||=e=>m.value=!0,onClosed:t[1]||=e=>m.value=!1},{trigger:v(()=>[y(`div`,oe,[y(`button`,se,[a(b)?.icon?(o(),l(n,{key:0,name:a(b).icon,class:`h-3! w-4! shrink-0 rounded-xs`},null,8,[`name`])):d(``,!0),y(`span`,ce,i(a(S)),1),y(`span`,B,[C(n,{name:a(T),size:16,class:r(a(E))},null,8,[`name`,`class`])])])])]),body:v(()=>[y(`ul`,V,[(o(!0),h(_,null,s(a(g),(e,t)=>(o(),h(`li`,{key:t,class:r([`group hover:bg-midnight-50 flex w-full cursor-pointer items-center justify-between gap-1.5 rounded-sm p-1.5 text-xs font-medium transition-colors duration-320 hover:shadow-xs`,e.disabled&&`cursor-not-allowed opacity-60`]),onClick:w(t=>D(e),[`prevent`])},[y(`div`,U,[e.icon?(o(),l(n,{key:0,name:e.icon,class:`h-3! w-4! shrink-0 rounded-xs`},null,8,[`name`])):d(``,!0),y(`span`,null,i(e.label),1)]),e.selected?(o(),l(n,{key:0,name:`lucide:check`,size:16})):d(``,!0)],10,H))),128))])]),_:1},8,[`is-open`])])}}}),G={class:`flex flex-col`},le=[`onClick`],ue={class:`flex items-center gap-2`},de=S({__name:`currency-accordion`,setup(e){let{currency:t,setCurrency:n}=I(),u=[{label:`CAD | EN`,value:`CAD`,icon:`flag:ca-4x3`},{label:`USD | EN`,value:`USD`,icon:`flag:us-4x3`}],f=x(!1),g=x(t.value??u[0].value),b=p(()=>u.find(e=>e.value===g.value)??u[0]),S=p(()=>b.value.label),T=p(()=>b.value.icon),E=e=>{g.value=e,n(e),f.value=!1};return c(()=>{g.value||=u[0].value,n(g.value)}),(e,t)=>{let n=A;return o(),l(a(N),{modelValue:a(f),"onUpdate:modelValue":t[0]||=e=>m(f)?f.value=e:null,label:a(S),icon:a(T),"leading-icon-shape":`rect`,size:`xl`,color:`cocaine`,class:`w-full text-nowrap`},{default:v(()=>[y(`ul`,G,[(o(),h(_,null,s(u,e=>y(`li`,{key:e.value},[y(`div`,{class:`group text-m hover:bg-midnight-50 flex min-w-full cursor-pointer items-center justify-between gap-2 rounded-sm p-2 font-medium transition-colors duration-320 hover:shadow-xs`,onClick:w(t=>E(e.value),[`prevent`])},[y(`div`,ue,[e.icon?(o(),l(n,{key:0,name:e.icon,class:`h-4.5! w-6! shrink-0 rounded-xs`},null,8,[`name`])):d(``,!0),y(`span`,null,i(e.label),1)]),C(a(P),{name:`lucide:check`,size:24,class:r([`shrink-0 transition-opacity duration-200`,a(g)===e.value?`opacity-100`:`opacity-0`])},null,8,[`class`])],8,le)])),64))])]),_:1},8,[`modelValue`,`label`,`icon`])}}}),K=S({__name:`sign-in-button`,props:{size:{default:`s`}},setup(e){return(t,n)=>(o(),l(a(j),{type:`cocaine`,color:`midnight`,size:e.size,"leading-avatar":``},{default:v(()=>[...n[0]||=[y(`span`,{class:`whitespace-nowrap`},`Sign in`,-1)]]),_:1},8,[`size`]))}}),q=[{type:`tab`,label:`Orders`,icon:`lucide:package`,tab:`orders`},{type:`tab`,label:`Wishlist`,icon:`lucide:heart`,tab:`wishlist`},{type:`tab`,label:`Personal Details`,icon:`lucide:user`,tab:`personalDetails`},{type:`action`,label:`Sign Out`,icon:`lucide:log-out`,action:`sign-out`}],fe={class:`whitespace-nowrap`},pe={class:`flex w-max min-w-full flex-col gap-y-1`},me={class:`whitespace-nowrap`},he={class:`leading-none`},ge={class:`whitespace-nowrap`},_e=F(S({__name:`account-dropdown`,props:{fullName:{default:`Account`},photo:{default:``}},setup(e){let t=D(),n=R(),r=L(),c=x(!1),u=p(()=>e.photo||``),d=p(()=>q.filter(e=>e.type===`tab`)),f=p(()=>q.filter(e=>e.type===`action`)),m=async e=>{if(e.type===`action`){e.action===`sign-out`&&(await n.signOut(),r.resetCart());return}await t.push({path:`/account`,query:{tab:e.tab}})};return(t,n)=>(o(),l(a(M),{direction:`right`,overlay:!1,"is-open":a(c),onOpened:n[0]||=e=>c.value=!0,onClosed:n[1]||=e=>c.value=!1},{trigger:v(()=>[C(a(j),{type:`cocaine`,color:`midnight`,size:`s`,"leading-avatar":a(u),"leading-avatar-chip":!0,"trailing-icon":`lucide:ellipsis-vertical`},{default:v(()=>[y(`span`,fe,i(e.fullName),1)]),_:1},8,[`leading-avatar`])]),body:v(()=>[y(`ul`,pe,[(o(!0),h(_,null,s(a(d),e=>(o(),h(`li`,{key:e.tab},[C(a(j),{type:`ghost`,color:`midnight`,size:`m`,display:`block`,justify:`start`,"leading-icon":e.icon,class:`w-full`,onClick:t=>m(e)},{default:v(()=>[y(`span`,me,i(e.label),1)]),_:2},1032,[`leading-icon`,`onClick`])]))),128)),y(`li`,he,[C(a(ne),{size:`3xs`})]),(o(!0),h(_,null,s(a(f),e=>(o(),h(`li`,{key:e.action},[C(a(j),{type:`ghost`,color:`midnight`,size:`m`,display:`block`,justify:`start`,"leading-icon":e.icon,class:`w-full`,onClick:t=>m(e)},{default:v(()=>[y(`span`,ge,i(e.label),1)]),_:2},1032,[`leading-icon`,`onClick`])]))),128))])]),_:1},8,[`is-open`]))}}),[[`__scopeId`,`data-v-efb5cf5f`]]),ve={class:`flex flex-col`},ye={class:`text-midnight-950`},be=S({__name:`account-accordion`,props:{fullName:{default:`Account`},photo:{default:``}},emits:[`navigate`],setup(e,{emit:t}){let n=t,r=R(),c=L(),u=x(!1),d=p(()=>e.photo||``),f=p(()=>q.filter(e=>e.type===`tab`)),g=p(()=>q.filter(e=>e.type===`action`)),b=e=>({path:`/account`,query:{tab:e}}),S=()=>{u.value=!1,n(`navigate`)},w=async()=>{u.value=!1,await r.signOut(),c.resetCart(),n(`navigate`)};return(t,n)=>(o(),l(a(N),{modelValue:a(u),"onUpdate:modelValue":n[0]||=e=>m(u)?u.value=e:null,label:e.fullName,size:`xl`,color:`cocaine`,class:`w-full text-nowrap`,"leading-avatar":a(d),"leading-avatar-chip":!0},{default:v(()=>[y(`div`,ve,[(o(!0),h(_,null,s(a(f),e=>(o(),l(a(te),{key:e.tab,label:e.label,href:b(e.tab),icon:e.icon,color:`cocaine`,size:`xl`,onClick:S},null,8,[`label`,`href`,`icon`]))),128)),(o(!0),h(_,null,s(a(g),e=>
1(o(),h(`button`,{key:e.action,type:`button`,class:`group text-m hover:bg-midnight-50 flex items-center gap-2 rounded-sm p-2 transition select-none hover:shadow-xs`,onClick:w},[C(a(P),{name:e.icon,size:24,class:`text-midnight-600 group-hover:text-midnight-950`},null,8,[`name`]),y(`span`,ye,i(e.label),1)]))),128))])]),_:1},8,[`modelValue`,`label`,`leading-avatar`]))}}),J=()=>{let{data:e,pending:t,error:n}=T(`header-menu-root`,async()=>{try{let e=await O(`/api/header-menu/root`);return ie(e)||[]}catch(e){return console.error(`Root header menu fetch error:`,e),[]}},{server:!0,default:()=>[]});return{items:e,pending:t,error:n}},Y={name:`Shop`,id:`shop`,rowType:`Root`,order:0,url:null,categoryId:null,brandId:null,badgeId:null,badge:null,category:null,brand:null,createdAt:new Date,updatedAt:new Date},xe={class:`hover:border-midnight-800 relative flex h-full items-center border-b-2 border-transparent transition-all`},X=S({__name:`header-menu-item`,props:{item:{}},emits:[`click`],setup(e,{emit:t}){let s=e,c=t,u=p(()=>!!s.item.url),d=p(()=>!!s.item.categoryId&&!!s.item.category),f=p(()=>!!s.item.brandId&&!!s.item.brand),m=p(()=>!!s.item.badgeId&&!!s.item.badgeId),g=p(()=>!u.value&&!d.value&&!f.value&&!m.value&&s.item.name.trim().toLowerCase()===`blog`),_=p(()=>!u.value&&!d.value&&!f.value&&!m.value&&s.item.name.trim().toLowerCase()===`services`),y=p(()=>u.value||d.value||f.value||m.value||g.value||_.value),x=p(()=>u.value?s.item.url:d.value&&s.item.category?.fullPathName?`/${z(s.item.category.fullPathName)}`:f.value&&s.item.brand?.name?`/${z(s.item.brand.name)}`:m.value&&s.item.badge?.name?`/${z(s.item.badge.name)}`:g.value?`/blog`:_.value?`/service`:`#`),S=p(()=>s.item.badge?.color?`text-${s.item.badge.color}-500`:`text-gray-700`);return(t,s)=>{let u=k;return o(),h(`li`,xe,[a(y)?(o(),l(u,{key:0,to:a(x),class:r([`text-s flex items-center gap-2 py-2 font-medium`,a(S)])},{default:v(()=>[b(i(e.item.name)+` `,1),n(t.$slots,`trailing`)]),_:3},8,[`to`,`class`])):(o(),h(`button`,{key:1,class:r([`text-s flex cursor-pointer items-center gap-2 py-2 font-medium`,a(S)]),onClick:s[0]||=t=>c(`click`,e.item)},[b(i(e.item.name)+` `,1),n(t.$slots,`trailing`)],2))])}}}),Se={class:`flex h-full items-center space-x-9`},Ce={key:1,class:`text-s px-4 py-2 text-red-500`},we=F(S({__name:`header-menu-list`,props:{isShopOpen:{type:Boolean,required:!0},isShopOpenModifiers:{}},emits:t([`item-click`],[`update:isShopOpen`]),setup(e){let t=u(e,`isShopOpen`),{items:n,error:i}=J();return(e,c)=>{let u=A;return o(),h(`ul`,Se,[C(X,{item:a(Y),onClick:c[0]||=e=>t.value=!t.value},{trailing:v(()=>[y(`div`,{class:r([`flex items-center justify-center transition-transform duration-300`,t.value?`-rotate-180`:`rotate-0`])},[C(u,{name:t.value?`i-lucide:x`:`i-lucide:chevron-down`,size:`20`},null,8,[`name`])],2)]),_:1},8,[`item`]),a(i)?(o(),h(`li`,Ce,`Menu loading error`)):(o(!0),h(_,{key:0},s(a(n)||[],t=>(o(),l(X,{key:t.id,item:t,onClick:c[1]||=t=>e.$emit(`item-click`,t)},null,8,[`item`]))),128))])}}}),[[`__scopeId`,`data-v-8d36e7dd`]]),Te={class:`relative flex h-12 items-center justify-center transition-all`},Z=S({__name:`header-menu-item`,props:{item:{}},emits:[`click`],setup(e,{emit:t}){let s=e,c=t,u=p(()=>!!s.item.url),d=p(()=>!!s.item.categoryId&&!!s.item.category),f=p(()=>!!s.item.brandId&&!!s.item.brand),m=p(()=>!!s.item.badgeId&&!!s.item.badgeId),g=p(()=>!u.value&&!d.value&&!f.value&&!m.value&&s.item.name.trim().toLowerCase()===`blog`),_=p(()=>!u.value&&!d.value&&!f.value&&!m.value&&s.item.name.trim().toLowerCase()===`services`),y=p(()=>u.value||d.value||f.value||m.value||g.value||_.value),x=p(()=>u.value?s.item.url:d.value&&s.item.category?.fullPathName?`/${z(s.item.category.fullPathName)}`:f.value&&s.item.brand?.name?`/${z(s.item.brand.name)}`:m.value&&s.item.badge?.name?`/${z(s.item.badge.name)}`:g.value?`/blog`:_.value?`/service`:`#`),S=p(()=>s.item.badge?.color?`text-${s.item.badge.color}-500`:`text-gray-700`);return(t,s)=>{let u=k;return o(),h(`li`,Te,[a(y)?(o(),l(u,{key:0,to:a(x),class:r([`text-s flex w-full items-center justify-center gap-2 px-2 py-2 font-medium whitespace-nowrap`,a(S)])},{default:v(()=>[b(i(e.item.name)+` `,1),n(t.$slots,`trailing`)]),_:3},8,[`to`,`class`])):(o(),h(`button`,{key:1,class:r([`text-s flex w-full cursor-pointer items-center justify-center gap-2 px-2 py-2 font-medium whitespace-nowrap`,a(S)]),onClick:s[0]||=t=>c(`click`,e.item)},[b(i(e.item.name)+` `,1),n(t.$slots,`trailing`)],2))])}}}),Ee={key:1,class:`text-s px-4 py-2 text-red-500`},Q=F(S({__name:`header-menu-list`,props:{isShopOpen:{type:Boolean,required:!0},isShopOpenModifiers:{}},emits:t([`item-click`],[`update:isShopOpen`]),setup(e){let t=u(e,`isShopOpen`),{items:n,pending:i,error:c}=J(),d=p(()=>(n.value?.length||0)+1),f=p(()=>{let e=d.value,t=e;return e>6&&(t=6),e>8&&(t=8),{"--grid-cols":t,gridTemplateColumns:`repeat(${t}, 1fr)`}});return(e,i)=>{let u=A;return o(),h(`ul`,{style:g(a(f)),class:r([`divide-midnight-300 border-midnight-300 grid w-full auto-cols-fr items-center gap-0 divide-x border-b min-[0px]:grid-cols-[repeat(auto-fit,minmax(80px,1fr))] sm:grid-cols-[repeat(auto-fit,minmax(100px,1fr))] md:grid-cols-[repeat(auto-fit,minmax(120px,1fr))]`,t.value?`shadow-none`:`shadow-m`])},[C(Z,{item:a(Y),class:r([`transition-all duration-300`,t.value?`bg-midnight-100`:`bg-transparent`]),onClick:i[0]||=e=>t.value=!t.value},{trailing:v(()=>[y(`div`,{class:r([`flex items-center justify-center transition-transform duration-300`,t.value?`-rotate-180`:`rotate-0`])}
1,[C(u,{name:t.value?`i-lucide:x`:`i-lucide:chevron-down`,size:`20`},null,8,[`name`])],2)]),_:1},8,[`item`,`class`]),a(c)?(o(),h(`li`,Ee,`Menu loading error`)):(o(!0),h(_,{key:0},s(a(n)||[],t=>(o(),l(Z,{key:t.id,item:t,onClick:i[1]||=t=>e.$emit(`item-click`,t)},null,8,[`item`]))),128))],6)}}}),[[`__scopeId`,`data-v-42e95c64`]]),De={class:`border-midnight-300 relative flex w-full items-center justify-center border-b-1 transition-all`},$=S({__name:`header-menu-item`,props:{item:{}},emits:[`click`],setup(e,{emit:t}){let s=e,c=t,u=p(()=>!!s.item.url),d=p(()=>!!s.item.categoryId&&!!s.item.category),f=p(()=>!!s.item.brandId&&!!s.item.brand),m=p(()=>!!s.item.badgeId&&!!s.item.badgeId),g=p(()=>!u.value&&!d.value&&!f.value&&!m.value&&s.item.name.trim().toLowerCase()===`blog`),_=p(()=>!u.value&&!d.value&&!f.value&&!m.value&&s.item.name.trim().toLowerCase()===`services`),y=p(()=>u.value||d.value||f.value||m.value||g.value||_.value),x=p(()=>u.value?s.item.url:d.value&&s.item.category?.fullPathName?`/${z(s.item.category.fullPathName)}`:f.value&&s.item.brand?.name?`/${z(s.item.brand.name)}`:m.value&&s.item.badge?.name?`/${z(s.item.badge.name)}`:g.value?`/blog`:_.value?`/service`:`#`),S=p(()=>s.item.badge?.color?`text-${s.item.badge.color}-500`:`text-gray-700`);return(t,s)=>{let u=k;return o(),h(`li`,De,[a(y)?(o(),l(u,{key:0,to:a(x),class:r([`text-m flex w-full items-center justify-between gap-2 px-2 py-4 font-medium whitespace-nowrap`,a(S)])},{default:v(()=>[b(i(e.item.name)+` `,1),n(t.$slots,`trailing`)]),_:3},8,[`to`,`class`])):(o(),h(`button`,{key:1,class:r([`text-m flex w-full cursor-pointer items-center justify-between gap-2 px-2 py-4 font-medium whitespace-nowrap`,a(S)]),onClick:s[0]||=t=>c(`click`,e.item)},[b(i(e.item.name)+` `,1),n(t.$slots,`trailing`)],2))])}}}),Oe={class:`bg-midnight-100 border-midnight-300 absolute top-0 left-0 z-40 h-[calc(100vh-6rem)] w-full overflow-y-auto`},ke={class:`bg-cocaine flex w-full flex-col px-4`},Ae={key:1,class:`text-s px-4 py-2 text-red-500`},je={class:`flex flex-col gap-2 px-4 py-6`},Me=F(S({__name:`header-menu-list`,props:{isShopOpen:{type:Boolean,required:!0},isShopOpenModifiers:{}},emits:t([`item-click`,`close`],[`update:isShopOpen`]),setup(t,{emit:n}){let i=u(t,`isShopOpen`),c=n,{open:d}=re(),f=R(),{user:m,fullName:g,photo:b}=ee(f),x=p(()=>!!m.value),S=e(),w=p(()=>{if(b.value)return E(S.public.cdn,b.value)}),{items:T,pending:D,error:O}=J(),k=()=>{i.value=!1,c(`close`)};return(e,t)=>{let n=A;return o(),h(`div`,Oe,[y(`ul`,ke,[C($,{item:a(Y),onClick:t[0]||=e=>i.value=!i.value},{trailing:v(()=>[y(`div`,{class:r([`flex items-center justify-center transition-transform duration-300`,i.value?`-rotate-180`:`rotate-0`])},[C(n,{name:i.value?`i-lucide:x`:`i-lucide:chevron-right`,size:`20`},null,8,[`name`])],2)]),_:1},8,[`item`]),a(O)?(o(),h(`li`,Ae,`Menu loading error`)):(o(!0),h(_,{key:0},s(a(T)||[],n=>(o(),l($,{key:n.id,item:n,onClick:t[1]||=t=>e.$emit(`item-click`,t)},null,8,[`item`]))),128))]),y(`div`,je,[a(x)?(o(),l(a(be),{key:0,class:`w-full`,"full-name":a(g),photo:a(w),onNavigate:k},null,8,[`full-name`,`photo`])):(o(),l(a(K),{key:1,class:`w-full`,size:`xl`,onClick:a(d)},null,8,[`onClick`])),C(a(de),{class:`w-full`})])])}}}),[[`__scopeId`,`data-v-4bd00a6c`]]);export{K as a,_e as i,Q as n,W as o,we as r,Me as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.