1import{i as e,t,u as n}from"./button-BRhMMokE.js";import{r,t as i}from"./router-compat-BycnWsTm.js";import{t as a}from"./arrow-right-DCB5DMn-.js";import{n as o}from"./LanguageContext-DY01oGfY.js";import{t as s}from"./minus-3_0YheVR.js";import{t as c}from"./plus-CN-iiekh.js";import{t as l}from"./trash-2-Bqro6jTG.js";import{t as u}from"./user-BIUwno8v.js";import{A as d,C as f,_ as p,h as m,j as h,k as g,w as _}from"./index-BWLRzRkE.js";import{t as v}from"./badge-BeDp1KSL.js";import{a as y,i as b,n as x,r as S,t as C}from"./sheet-Viv-GuwL.js";import{t as w}from"./scroll-area-nYp6YXAI.js";import{t as T}from"./imageUrl-D2GNmJAB.js";import{t as E}from"./progress-D9BqeDMS.js";var D=e(`gift`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M20 11v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8`,key:`1sqzm4`}],[`path`,{d:`M7.5 7a1 1 0 0 1 0-5A4.8 8 0 0 1 12 7a4.8 8 0 0 1 4.5-5 1 1 0 0 1 0 5`,key:`kc0143`}],[`rect`,{x:`3`,y:`7`,width:`18`,height:`4`,rx:`1`,key:`1hberx`}]]),O=[{id:`spend888-10`,minSubtotal:888,percentOff:10,label:`10% off orders over HK$888`,teaser:e=>`Add HK$${e.toFixed(0)} to unlock 10% off your order`}];function k(e){return Math.round(e*100)/100}function A(e){return[...O].sort((e,t)=>t.minSubtotal-e.minSubtotal).find(t=>e>=t.minSubtotal)??null}function j(e){let t=k(Math.max(0,e.subtotal)),n=A(t),r=n?k(t*(n.percentOff/100)):0,i=0;e.codePercentOff?i=k(t*(Number(e.codePercentOff)/100)):e.codeAmountOff&&(i=k(Math.min(t,Number(e.codeAmountOff))));let a=k(20/100*t);r+i>a&&(i=k(Math.max(0,a-r)),r>a&&(r=a));let o=k(Math.min(t,r+i)),s=k(t-o),c=e.shippingFreeThreshold!==null&&t>=e.shippingFreeThreshold,l=c?0:k(e.shippingFee);return{subtotal:t,autoPromotion:n,autoDiscount:r,codeDiscount:i,codeLabel:i>0?e.codeLabel??null:null,totalDiscount:o,shippingCost:l,shippingIsFree:c,total:k(s+l),totalSavings:k(o+(c?k(e.shippingFee):0))}}function M(e){let t=[],n=e>=288;n&&t.push(`Free SF Express delivery`);let r=A(e);r&&t.push(r.label);let i={unlocked:t,unlockedFreeDelivery:n,unlockedPromotion:r};if(e<288){let t=k(288-e);return{...i,progress:Math.min(100,e/288*100),message:`Add HK$${t.toFixed(0)} for free SF Express delivery`,kind:`free_delivery`,remaining:t,nextPromotion:null}}let a=[...O].sort((e,t)=>e.minSubtotal-t.minSubtotal).find(t=>e<t.minSubtotal);if(a){let t=k(a.minSubtotal-e),n=r?.minSubtotal??288,o=Math.max(1,a.minSubtotal-n);return{...i,progress:Math.min(100,(e-n)/o*100),message:a.teaser(t),kind:`promotion`,remaining:t,nextPromotion:a}}return{...i,progress:100,message:null,kind:`complete`,remaining:0,nextPromotion:null}}var N=n();function P(e,t){let n=`shop.rewards.promoLabels.${t.id}`,r=e(n);return r===n?t.label:r}function F(e,t,n){let r=`shop.rewards.promoTeasers.${t.id}`,i=e(r,{amount:n.toFixed(0)});return i===r?t.teaser(n):i}function I({subtotal:e,className:t,compact:n}){let{t:r}=o(),i=M(e),{progress:a,kind:s,remaining:c,nextPromotion:l}=i,u=s===`free_delivery`?r(`shop.rewards.freeDeliveryTeaser`,{amount:c.toFixed(0)}):s===`promotion`&&l?F(r,l,c):null,d=[];return i.unlockedFreeDelivery&&d.push(r(`shop.rewards.freeDelivery`)),i.unlockedPromotion&&d.push(P(r,i.unlockedPromotion)),(0,N.jsxs)(`div`,{className:`rounded-lg border border-border bg-muted/40 p-3 ${t??``}`,children:[(0,N.jsxs)(`div`,{className:`flex items-start gap-2 text-sm`,children:[u?(0,N.jsx)(g,{className:`mt-0.5 h-4 w-4 shrink-0 text-primary`}):(0,N.jsx)(D,{className:`mt-0.5 h-4 w-4 shrink-0 text-primary`}),(0,N.jsxs)(`div`,{className:`min-w-0`,children:[u?(0,N.jsx)(`p`,{children:u}):(0,N.jsx)(`p`,{className:`font-medium text-primary`,children:r(`shop.rewards.allUnlocked`)}),d.length>0&&(0,N.jsxs)(`p`,{className:`text-primary text-xs mt-0.5`,children:[r(`shop.rewards.unlockedPrefix`),`: `,d.join(` ⢠`)]})]})]}),(0,N.jsx)(E,{className:`mt-2 h-1.5 bg-muted`,value:a})]})}function L({autoDiscountLabel:e,autoDiscount:t,codeDiscount:n,codeLabel:r}){let{t:i}=o();return t<=0&&n<=0?null:(0,N.jsxs)(N.Fragment,{children:[t>0&&(0,N.jsxs)(`div`,{className:`flex justify-between text-primary`,children:[(0,N.jsx)(`span`,{children:e??i(`shop.rewards.autoDiscount`)}),(0,N.jsxs)(`span`,{children:[`-HK$`,t.toFixed(0)]})]}),n>0&&(0,N.jsxs)(`div`,{className:`flex justify-between text-primary`,children:[(0,N.jsx)(`span`,{children:i(`shop.rewards.codeDiscount`,{code:r??``})}),(0,N.jsxs)(`span`,{children:[`-HK$`,n.toFixed(0)]})]})]})}var R=new Set([``,`default title`,`default`,`standard`]);function z(e){let t=(e??``).trim();if(!R.has(t.toLowerCase()))return t}function B(){let e=r(),{items:n,itemCount:i,subtotal:u,updateQuantity:p,removeItem:m,isCartOpen:h,setCartOpen:g}=f(),{t:_}=o(),v=A(u);return(0,N.jsx)(C,{open:h,onOpenChange:g,children:(0,N.jsxs)(x,{className:`w-full sm:max-w-md bg-card border-border flex flex-col`,children:[(0,N.jsx)(S,{children:(0,N.jsxs)(b,{className:`flex items-center gap-2`,children:[(0,N.jsx)(d,{className:`w-5 h-5`}),_(`shop.drawer.title`,{count:i})]})}),n.length===0?(0,N.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-center text-muted-foreground`,children:[(0,N.jsx)(d,{className:`w-16 h-16 mb-4 opacity-50`}),(0,N.jsx)(`p`,{children:_(`shop.drawer.empty`)}),(0,N.jsx)(t,{className:`mt-6`,onClick:()=>{g(!1),e(`/shop`)},children:_(`shop.drawer.startShopping`)})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(w,{className:`flex-1 -mx-6 px-6`,children:(0,N.jsx)(`div`,{className:`space-y-4 py-4`,children:n.map(e=>(0,N.jsxs)(`div`,{className:`flex gap-3 p-3 rounded-lg bg-muted/50`,children:[e.image?(0,N.jsx)(`img`,{src:T(e.image,{width:128}),alt:e.title,loading:`lazy`,decoding:`async`,className:`w-16 h-16 rounded object-cover`}):(0,N.jsx)(`div`,{className:`w-16 h-16 rounded bg-muted flex items-center justify-center`,children:(0,N.jsx)(d,{className:`w-6 h-6 text-muted-foreground`})}),(0,N.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,N.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`h4`,{className:`font-medium text-sm line-clamp-1`,children:e.title}),z(e.variantTitle)&&(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:z(e.variantTitle)})]}),(0,N.jsx)(t,{variant:`ghost`,size:`icon`,className:`h-6 w-6 text-muted-foreground hover:text-destructive`,"aria-label":`Remove ${e.title}`,onClick:()=>m(e.id,e.variantId),children:(0,N.jsx)(l,{className:`w-3 h-3`})})]}),(0,N.jsxs)(`div`,{className:`flex items-center justify-between mt-2`,children:[(0,N.jsxs)(`div`,{className:`flex items-center border border-border rounded`,children:[(0,N.jsx)(t,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":`Decrease quantity`,onClick:()=>p(e.id,e.quantity-1,e.variantId),children:(0,N.jsx)(s,{className:`w-3 h-3`})}),(0,N.jsx)(`span`,{className:`w-8 text-center text-sm`,children:e.quantity}),(0,N.jsx)(t,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":`Increase quantity`,onClick:()=>p(e.id,e.quantity+1,e.variantId),children:(0,N.jsx)(c,{className:`w-3 h-3`})})]}),(0,N.jsxs)(`span`,{className:`font-medium`,children:[`HK$`,(e.price*e.quantity).toFixed(0)]})]})]})]},`${e.id}-${e.variantId}`))})}),(0,N.jsx)(I,{subtotal:u,className:`mb-3`,compact:!0}),(0,N.jsxs)(`div`,{className:`border-t border-border pt-4 space-y-4`,children:[(0,N.jsxs)(`div`,{className:`flex justify-between text-lg font-semibold`,children:[(0,N.jsx)(`span`,{children:_(`shop.common.subtotal`)}),(0,N.jsxs)(`span`,{children:[`HK$`,u.toFixed(0)]})]}),v&&(0,N.jsx)(`p`,{className:`-mt-3 text-xs text-primary`,children:_(`shop.rewards.appliedAutomatically`,{label:P(_,v)})}),(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:_(`shop.drawer.shippingAtCheckout`)}),(0,N.jsxs)(t,{className:`w-full bg-primary hover:bg-primary/90`,size:`lg`,onClick:()=>{g(!1),e(`/cart`)},children:[_(`shop.drawer.viewCart`),(0,N.jsx)(a,{className:`w-4 h-4 ml-2`})]})]})]})]})})}var V={name:`The Italian Club`,logoUrl:`https://theitalianclubhongkong.com/images/restaurant-logo.png`,supp
1ortEmail:`[email protected]`},H=[{label:`Shop`,to:`/shop`},{label:`Collections`,to:`/collections`},{label:`Cooking Guide`,to:`/italian-cooking-guide`},{label:`Wholesale`,to:`/wholesale`},{label:`Contact`,to:`/contact`}];function U({children:e,breadcrumbs:n,headerExtra:r}){let{itemCount:a,openCart:o}=f(),{session:s}=_(),c=(0,N.jsx)(t,{asChild:!0,variant:`outline`,size:`icon`,"aria-label":s?`My account`:`Sign in`,title:s?`My account`:`Sign in`,children:(0,N.jsx)(i,{to:s?`/account`:`/account/login`,children:(0,N.jsx)(u,{className:`h-5 w-5`})})}),l=(0,N.jsxs)(t,{variant:`outline`,size:`icon`,className:`relative`,"aria-label":`Cart (${a})`,onClick:o,children:[(0,N.jsx)(d,{className:`h-5 w-5`}),a>0&&(0,N.jsx)(v,{className:`absolute -top-2 -right-2 h-5 w-5 flex items-center justify-center p-0 bg-secondary text-secondary-foreground text-xs`,children:a})]});return(0,N.jsxs)(`div`,{className:`min-h-screen bg-background flex flex-col`,children:[(0,N.jsx)(`header`,{className:`sticky top-0 z-50 bg-background/95 backdrop-blur border-b border-border`,children:(0,N.jsxs)(`div`,{className:`container mx-auto px-4`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between gap-4 h-20`,children:[(0,N.jsx)(i,{to:`/`,className:`flex items-center gap-3 shrink-0`,children:(0,N.jsx)(`img`,{src:V.logoUrl,alt:V.name,className:`h-12 w-auto`})}),(0,N.jsx)(`nav`,{className:`hidden lg:flex items-center gap-7`,children:H.map(e=>(0,N.jsx)(i,{to:e.to,className:`text-sm font-medium text-muted-foreground hover:text-foreground transition-colors uppercase tracking-wider`,children:e.label},e.to))}),(0,N.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,N.jsx)(`div`,{className:`hidden sm:block`,children:(0,N.jsx)(p,{})}),c,l,(0,N.jsxs)(C,{children:[(0,N.jsx)(y,{asChild:!0,children:(0,N.jsx)(t,{variant:`ghost`,size:`icon`,className:`lg:hidden`,"aria-label":`Open menu`,children:(0,N.jsx)(h,{className:`h-5 w-5`})})}),(0,N.jsxs)(x,{side:`right`,className:`bg-background border-border`,children:[(0,N.jsxs)(`nav`,{className:`mt-10 flex flex-col`,children:[H.map(e=>(0,N.jsx)(i,{to:e.to,className:`py-4 px-2 border-b border-border/50 text-base font-medium text-foreground hover:text-primary transition-colors`,children:e.label},e.to)),(0,N.jsx)(i,{to:s?`/account`:`/account/login`,className:`py-4 px-2 border-b border-border/50 text-base font-medium text-foreground hover:text-primary transition-colors`,children:s?`My Account`:`Sign In`})]}),(0,N.jsx)(`div`,{className:`mt-6`,children:(0,N.jsx)(p,{})})]})]})]})]}),r]})}),n&&n.length>0&&(0,N.jsx)(`nav`,{"aria-label":`Breadcrumb`,className:`container mx-auto px-4 pt-4`,children:(0,N.jsxs)(`ol`,{className:`flex flex-wrap items-center gap-1 text-sm text-muted-foreground`,children:[(0,N.jsx)(`li`,{children:(0,N.jsx)(i,{to:`/`,className:`hover:text-foreground transition-colors`,children:`Home`})}),n.map((e,t)=>(0,N.jsxs)(`li`,{className:`flex items-center gap-1`,children:[(0,N.jsx)(`span`,{"aria-hidden":`true`,children:`/`}),e.to?(0,N.jsx)(i,{to:e.to,className:`hover:text-foreground transition-colors`,children:e.label}):(0,N.jsx)(`span`,{className:`text-foreground`,children:e.label})]},`${e.label}-${t}`))]})}),(0,N.jsx)(`div`,{className:`flex-1`,children:e}),(0,N.jsx)(m,{}),(0,N.jsx)(B,{})]})}export{P as a,L as i,z as n,j as o,I as r,U 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.