1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4290],{4474:(e,t,s)=>{s.d(t,{$:()=>o,r:()=>i});var r=s(95155);s(12115);var a=s(42442),l=s(18460),n=s(91337);let i=(0,l.F)("cursor-pointer inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg_secondary text-secondary-foreground hover:bg_secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function o({className:e,variant:t,size:s,asChild:l=!1,...d}){let c=l?a.DX:"button";return(0,r.jsx)(c,{"data-slot":"button",className:(0,n.cn)(i({variant:t,size:s,className:e})),...d})}},40088:(e,t,s)=>{s.d(t,{Vv:()=>x});var r=s(95155),a=s(12115),l=s(66088),n=s(41641),i=s(21362),o=s(29759),d=s(77550),c=s(91337),u=s(4474);function h({value:e,onChange:t,options:s,disabled:n,"aria-label":i}){let[o,d]=a.useState(!1),u=a.useRef(null),x=a.useRef(null),m=s?.find(t=>Number(t.value)===Number(e));return a.useEffect(()=>{if(!o)return;if(x.current){let e=x.current.querySelector("[data-selected='true']");e&&e.scrollIntoView({block:"center"})}let e=e=>{u.current&&!u.current.contains(e.target)&&d(!1)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e)}},[o]),(0,r.jsxs)("div",{ref:u,className:"relative inline-block",children:[(0,r.jsxs)("button",{type:"button",disabled:n,"aria-label":i,onClick:e=>{e.preventDefault(),e.stopPropagation(),d(e=>!e)},className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-xl bg-white/5 hover:bg-white/10 border border-white/15 text-sm font-semibold text-white cursor-pointer transition-colors focus:outline-none focus:ring-1 focus:ring-white/30",children:[(0,r.jsx)("span",{children:m?.label??e}),(0,r.jsx)(l.A,{className:(0,c.cn)("size-3.5 text-gray-300 shrink-0 transition-transform duration-200",o&&"rotate-180")})]}),o&&(0,r.jsx)("div",{ref:x,className:"absolute top-full left-1/2 -translate-x-1/2 mt-1.5 bg-[#181818]/95 backdrop-blur-md border border-white/15 shadow-2xl rounded-xl p-1 z-50 max-h-56 overflow-y-auto min-w-[90px] flex flex-col gap-0.5",onClick:e=>e.stopPropagation(),children:s?.map(s=>{let a=Number(s.value)===Number(e);return(0,r.jsx)("button",{type:"button","data-selected":a,disabled:s.disabled,onClick:e=>{var r;e.preventDefault(),e.stopPropagation(),r=String(s.value),t&&t({target:{value:r}}),d(!1)},className:(0,c.cn)("text-sm font-medium cursor-pointer rounded-lg text-gray-300 hover:text-white hover:bg-white/10 focus:bg-white/10 focus:text-white py-1.5 px-3 transition-colors text-center w-full whitespace-nowrap",a&&"bg-white/15 text-white font-semibold",s.disabled&&"opacity-40 cursor-not-allowed pointer-events-none"),children:s.label},s.value)})})]})}function x({className:e,classNames:t,showOutsideDays:s=!0,captionLayout:a="label",buttonVariant:g="ghost",formatters:p,components:f,style:b,...w}){let j=(0,o.a)();return(0,r.jsx)(d.h,{showOutsideDays:s,style:{"--cell-size":"36px",...b}
1,className:(0,c.cn)("bg-background group/calendar p-3 [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:a,formatters:{formatMonthDropdown:e=>e.toLocaleString("default",{month:"short"}),...p},classNames:{root:(0,c.cn)("w-fit",j.root),months:(0,c.cn)("flex gap-4 flex-col md:flex-row relative",j.months),month:(0,c.cn)("flex flex-col w-full gap-4",j.month),nav:(0,c.cn)("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",j.nav),button_previous:(0,c.cn)((0,u.r)({variant:g}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",j.button_previous),button_next:(0,c.cn)((0,u.r)({variant:g}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",j.button_next),month_caption:(0,c.cn)("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",j.month_caption),dropdowns:(0,c.cn)("w-full flex items-center text-base font-medium justify-center h-(--cell-size) gap-1.5",j.dropdowns),dropdown_root:(0,c.cn)("relative",j.dropdown_root),dropdown:(0,c.cn)("absolute bg-popover inset-0 opacity-0",j.dropdown),caption_label:(0,c.cn)("select-none font-bold","label"===a?"text-lg":"rounded-md pl-2 pr-1 flex items-center gap-1 text-base h-8 [&>svg]:text-muted-foreground [&>svg]:size-4",j.caption_label),table:"w-full border-collapse",weekdays:(0,c.cn)("flex",j.weekdays),weekday:(0,c.cn)("text-muted-foreground rounded-md flex-1 font-semibold text-sm select-none",j.weekday),week:(0,c.cn)("flex w-full mt-2",j.week),week_number_header:(0,c.cn)("select-none w-(--cell-size)",j.week_number_header),week_number:(0,c.cn)("text-sm select-none text-muted-foreground",j.week_number),day:(0,c.cn)("relative w-full h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none",w.showWeekNumber?"[&:nth-child(2)[data-selected=true]_button]:rounded-l-md":"[&:first-child[data-selected=true]_button]:rounded-l-md",j.day),range_start:(0,c.cn)("rounded-l-md bg-primary text-primary-foreground",j.range_start),range_middle:(0,c.cn)("rounded-none bg-gray-400",j.range_middle),range_end:(0,c.cn)("rounded-r-md bg-primary text-primary-foreground",j.range_end),today:(0,c.cn)("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",j.today),outside:(0,c.cn)("text-muted-foreground aria-selected:text-muted-foreground",j.outside),disabled:(0,c.cn)("text-muted-foreground opacity-50",j.disabled),hidden:(0,c.cn)("invisible",j.hidden),...t},components:{Root:({className:e,rootRef:t,...s})=>(0,r.jsx)("div",{"data-slot":"calendar",ref:t,className:(0,c.cn)(e),...s}),Chevron:({className:e,orientation:t,...s})=>"left"===t?(0,r.jsx)(n.A,{className:(0,c.cn)("size-5",e),...s}):"right"===t?(0,r.jsx)(i.A,{className:(0,c.cn)("size-5",e),...s}):(0,r.jsx)(l.A,{className:(0,c.cn)("size-5",e),...s}),Dropdown:h,DayButton:m,WeekNumber:({children:e,...t})=>(0,r.jsx)("td",{...t,children:(0,r.jsx)("div",{className:"flex size-(--cell-size) items-center justify-center text-center",children:e})}),...f},...w})}function m({className:e,day:t,modifiers:s,...l}){let n=(0,o.a)(),i=a.useRef(null);return a.useEffect(()=>{s.focused&&i.current?.focus()},[s.focused]),(0,r.jsx)(u.$,{ref:i,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":s.selected&&!s.range_start&&!s.range_end&&!s.range_middle,"data-range-start":s.range_start,"data-range-end":s.range_end,"data-range-middle":s.range_middle,className:(0,c.cn)("text-base font-bold","data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-gray-300 data-[range-middle=true]:text-gray-900 data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:opacity-70",n.day,e),...l})}},47561:(e,t,s)=>
1{s.d(t,{Cd:()=>n,Et:()=>r,M9:()=>d,YL:()=>i,bl:()=>a,ct:()=>o,q:()=>l});let r="pk.eyJ1Ijoic3VnYXJ5bGxjIiwiYSI6ImNtYnNqcHQyZDBsMG0ybHF1cTcxejc0Ym4ifQ.cL0aZl9OeyO7RiWOwKNArg",a="mapbox://styles/sugaryllc/cmsjhc8jc00yd01sd1fl06l35",l="linear-gradient(0deg, rgba(0,120,140,1) 0%, rgba(1,133,150,1) 53%, rgba(16,178,199,1) 98%)";function n(e){if(!e)return null;let t=e.RequestLatitude??e.CenterLat,s=e.RequestLongitude??e.CenterLng;return null==t||null==s?null:{lat:t,lng:s}}function i(e){if(null!=e.RequestLatitude)return 14;switch(e.Level){case"ADMIN_ZONE":return 13;case"CITY":return 11;case"STATE":return 7;default:return 4.5}}function o(e,t){let s=null;t&&(s=t.displayName);let r=function(e){if(!e)return null;let t=[e.CountryName];return e.CountryHasCity?t=[e.CityName,e.CountryName]:e.CountryHasState&&(t=[e.StateName,e.CountryName]),t.filter(Boolean).join(", ")}(e);return r&&!s?{primary:r,secondary:null}:{primary:s,secondary:r}}function d(e,t,s){if(!r)return null;let a=`pin-l+10b2c7(${t},${e})`;return`https://api.mapbox.com/styles/v1/sugaryllc/cmsjhc8jc00yd01sd1fl06l35/static/${a}/${t},${e},${s},0,0/640x360@2x?access_token=${r}`}},54290:(e,t,s)=>{s.d(t,{default:()=>Y});var r=s(95155),a=s(12115),l=s(41455),n=s(5199),i=s(63439),o=s(12464),d=s(66088),c=s(97812),u=s(37002),h=s(2693),x=s(23591),m=s(9338),g=s(11109),p=s(67021),f=s(47561),b=s(96621),w=s(62489),j=s(40088);let v=({variant:e})=>{let t=(0,u.useGlobalStore)(e=>e.giftingPlace),s=(0,u.useGlobalStore)(e=>e.giftingDate),l=(0,u.useGlobalStore)(e=>e.isHydrated),{currentGeoPlace:n,hasShownLocationPopover:v,markLocationPopoverShown:y}=(0,g.Q)(),{language:N}=(0,h.n)(),_=x.P[N],k=(0,b.a)(),S=!e||("desktop"===e?!k:k),{primary:C,secondary:A}=(0,f.ct)(t,n),[I,z]=(0,a.useState)(!1),[$,R]=(0,a.useState)(!1),[T,E]=(0,a.useState)(s?new Date(s):void 0),[M,L]=(0,a.useState)(T);(0,a.useEffect)(()=>{if(!l||!S||v)return;let e=setTimeout(()=>{z(!0),y()},1e3);return()=>clearTimeout(e)},[l,S,v,y]),(0,a.useEffect)(()=>{if(!I)return;let e=setTimeout(()=>{z(!1)},1e4);return()=>clearTimeout(e)},[I]);let D=async()=>{z(!1),g.Q.getState().openPicker({surface:p.S7.Header})},O=async e=>{E(e),R(!1);let t="";e&&!isNaN(e.getTime())&&(t=`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`,(0,m.fG)(t))};return(0,r.jsx)("div",{className:"relative flex lg:flex-none lg:inline-block group mr-2 md:mr-0 md:mt-0 mt-4",children:(0,r.jsxs)(w.AM,{open:I&&S,children:[(0,r.jsx)(w.dT,{asChild:!0,children:(0,r.jsx)("div",{className:"relative max-[400px]:w-[160px] flex-1 lg:flex-none lg:w-fit flex items-stretch glass_card_black shadow-xl rounded-full h-[52px] overflow-hidden ml-2",children:l?t?(0,r.jsxs)("div",{className:"flex items-stretch h-full w-full",children:[(0,r.jsxs)("button",{type:"button",onClick:D,className:"flex items-center h-full pl-4 lg:pl-2 pr-3 lg:pr-4 gap-2 cursor-pointer hover:bg-white/5 transition-colors min-w-0 flex-1 lg:shrink-0 lg:w-fit text-left",children:[(0,r.jsx)("span",{className:"text-xl lg:text-2xl shrink-0",children:(0,r.jsx)(i.iF,{countryIso2:t?.CountryIso2,width:36,height:36,className:"w-[26px] lg:w-[32px] h-[26px] lg:h-[32px]"})}),(0,r.jsxs)("div",{className:"flex flex-col min-w-0 w-full",children:[(0,r.jsxs)("div",{className:`flex items-center gap-1 text-sm md:text-lg lg:text-[11px] font-thin leading-none mb-0.5 lg:mb-1 uppercase text_gray_50 min-w-0 ${k?"w-full":""}`,children:[(0,r.jsx)("span",{className:`font-medium text_gray_50 ${k?"truncate block":"whitespace-nowrap"}`,children:_.header.send_to})," ",(0,r.jsx)(d.A,{strokeWidth:3,size:10,className:"lg:w-3 lg:h-3 text_gray_50 shrink-0"})]}),(0,r.jsx)("div",{className:"text-lg md:text-xl lg:text-sm font-bold text_white uppercase leading-none truncate w-full",children:t?.CountryHasCity&&t?.CityName?t?.CityName:t?.CountryHasState&&t?.StateName?t?.StateName:t?.CountryName})]})]}),(0,r.jsx)("div",{className:"hidden lg:block self-center h-6 w-[1px] bg-white/10 shrink-0"}),(0,r.jsxs)(w.AM,{open:$,onOpenChange:R,children:[(0,r.jsx)(w.Wv,{asChild:!0,children:(0,r.jsxs)("button",{type:"button",className:`flex flex-col items-start justify-center h-full pl-3.5 pr-4 lg:pl-4 lg:pr-5 cursor-pointer hover:bg-white/5 transition-colors text-left ${k?"":"shrink-0 w-fit"}`,children:[(0,r.jsx)("div",{className:`text-sm md:text-lg lg:text-[11px] font-medium text_gray_50 leading-none mb-0.5 lg:mb-1 uppercase whitespace-nowrap truncate ${k?"max-w-[70px] sm:max-w-[90px]":""}`,children:_.header.set_date}),(0,r.jsx)("div",{className:"text-lg md:text-xl lg:text-sm font-bold text_white uppercase leading-none",children:s?(0,c.s)(s):"â"})]})}),(0,r.jsx)(w.hl,{className:"w-auto overflow-visible p-0 z-[99999] rounded-xl border-white/10 shadow-2xl bg-black/15 backdrop-blur-lg",align:"end",alignOffset:-8,sideOffset:10,children:(0,r.jsx)("div",{className:"bg-black/55 p-[1px] pb-[2px] rounded-xl border border-white/10",children:(0,r.jsx)(j.Vv,{defaultMonth:T,className:"!bg-transparent font-bricolage text-white rounded-xl",mode:"single",selected:T,captionLayout:"dropdown",month:M,onMonthChange:L,onSelect:O,disabled:e=>{let s=t?.TimezoneOffsetInMinutes??0,r=new Date(new Date(new Date().getTime()+60*s*1e3));r.setDate(r.getDate()-2),r.setHours(23,59,59,999);let a=new Date(e);return a.setHours(0,0,0,0),a<=r}})})})]})]}):(0,r.jsxs)("button",{type:"button",onClick:D,className:"flex items-center w-full h-full pl-3.5 lg:pl-3 pr-4 gap-2 cursor-pointer hover:bg-white/5 transition-colors text-left",children:[(0,r.jsx)("div",{className:"flex items-center justify-center w-[26px] h-[26px] lg:w-8 lg:h-8 rounded-full bg-white/10 shrink-0",children:(0,r.jsx)(o.A,{size:16,className:"text-white lg:w-[18px] lg:h-[18px]"})}),(0,r.jsxs)("div",{className:`flex flex-col min-w-0 gap-1 ${k?"w-full":""}`,children:[(0,r.jsx)("span",{className:`text-md md:text-[11px] font-medium uppercase text_gray_50 leading-none mb-0.5 lg:mb-1 truncate ${k?"w-full":""}`,children:_.header.send_to}),(0,r.jsx)("span",{className:`text-md lg:text-sm font-bold text_white uppercase leading-none truncate ${k?"w-full":""}`,children:_.header.select_location})]})]}):(0,r.jsxs)("div",{className:"flex items-stretch h-full w-full animate-pulse",children:[(0,r.jsxs)("div",{className:"flex items-center h-full pl-4 lg:pl-2 pr-3 lg:pr-4 gap-2 min-w-0 flex-1 lg:shrink-0 lg:w-fit",children:[(0,r.jsx)("div",{className:"w-[26px] h-[26px] lg:w-[32px] lg:h-[32px] rounded-full bg-white/10 shrink-0"}
1),(0,r.jsxs)("div",{className:"flex flex-col min-w-0 w-full gap-1.5 justify-center",children:[(0,r.jsx)("div",{className:"h-2.5 lg:h-[11px] w-12 bg-white/10 rounded"}),(0,r.jsx)("div",{className:"h-3 lg:h-3.5 w-20 md:w-24 lg:w-28 bg-white/10 rounded"})]})]}),(0,r.jsx)("div",{className:"hidden lg:block self-center h-6 w-[1px] bg-white/10 shrink-0"}),(0,r.jsxs)("div",{className:`flex flex-col justify-center h-full pl-3.5 pr-4 lg:pl-4 lg:pr-5 gap-1.5 ${k?"":"shrink-0 w-fit"}`,children:[(0,r.jsx)("div",{className:"h-2.5 lg:h-[11px] w-14 bg-white/10 rounded"}),(0,r.jsx)("div",{className:"h-3 lg:h-3.5 w-16 md:w-20 lg:w-24 bg-white/10 rounded"})]})]})})}),(0,r.jsx)(w.hl,{onOpenAutoFocus:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),align:"start",sideOffset:12,className:"w-fit p-0 z-[100] border-none bg-transparent shadow-none",children:(0,r.jsx)("div",{className:"glass_card_black relative p-5 lg:p-6 shadow-2xl squircle",children:(0,r.jsx)("div",{className:"relative z-20",children:t?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,r.jsx)("div",{className:"flex items-center justify-center w-12 h-12 md:w-11 md:h-11 rounded-full bg-white/10 shrink-0",children:(0,r.jsx)(o.A,{size:20,className:"text-white lg:size-5"})}),(0,r.jsx)("h3",{className:"whitespace-nowrap text-[16px] md:text-md font-bold text-white leading-tight",children:_.header.is_delivery_address_correct})]}),(0,r.jsxs)("div",{className:"mb-4",children:[C&&(0,r.jsx)("p",{className:"truncate text-[16px] md:text-base font-semibold text-white/70",children:C}),(0,r.jsx)("p",{className:"truncate text-sm lg:text-base font-medium text-white/70",children:A})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2 lg:gap-3 mt-4",children:[(0,r.jsx)("button",{type:"button",onClick:()=>{z(!1)},className:"flex-1 h-14 lg:h-11 rounded-full bg-white text-black text-xl md:text-sm font-bold uppercase cursor-pointer hover:bg-white/90 transition-colors",children:_.header.yes}),(0,r.jsx)("button",{type:"button",onClick:D,className:"flex-1 h-14 lg:h-11 rounded-full bg-white/10 text-white text-xl md:text-sm font-bold uppercase cursor-pointer hover:bg-white/20 transition-colors",children:_.header.no})]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,r.jsx)("div",{className:"flex items-center justify-center w-10 h-10 lg:w-11 lg:h-11 rounded-full bg-white/10 shrink-0",children:(0,r.jsx)(o.A,{size:18,className:"text-white lg:size-5"})}),(0,r.jsx)("h3",{className:"text-2xl lg:text-base font-semibold text-white",children:_.header.set_delivery_location_first})]}),(0,r.jsx)("p",{className:"text-xl lg:text-sm text_gray_70 font-thin leading-relaxed mb-4",children:_.header.confirm_delivery_address}),(0,r.jsx)("button",{type:"button",onClick:D,className:"w-full h-14 lg:h-11 rounded-full bg-white text-black text-xl lg:text-sm font-bold uppercase cursor-pointer hover:bg-white/90 transition-colors mt-4",children:_.header.select_location})]})})})})]})})};var y=s(54419),N=s(74937),_=s(52760),k=s(92564),S=s(60565),C=s(42869),A=s(24642),I=s(41313),z=s(61878),$=s(29857),R=s(33210),T=s(4474),E=s(43447),M=s(23511),L=s(37999),D=s(6407),O=s(67899),F=s(6296),q=s(91337);let H=({className:e,...t})=>{let{totalItems:s,totalItemsDigital:a,isLoading:l}=(0,L.M)(),{openDrawer:n}=(0,D.o)(),i=(0,b.a)(),o=s+a,d=async e=>{e.stopPropagation(),await n(),t.onClick?.(e)};return 0===o&&i?null:i?(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("button",{type:"button",onClick:()=>n(),className:"cursor-pointer grid place-items-center h-[52px] w-[52px] rounded-full glass_card_black border border-white/10 hover:bg-white/5 transition-all duration-200 active:scale-95","aria-label":"Open basket",children:l?(0,r.jsx)(F.A,{size:18,className:"animate-spin text-white/60"}):(0,r.jsx)(O.A,{size:18,className:"text-white/80"})}),o>0&&!l&&(0,r.jsx)("span",{suppressHydrationWarning:!0,className:"pointer-events-none absolute -top-1 -right-1 min-w-[20px] h-[20px] px-1 flex items-center justify-center rounded-full bg-[#003F7E] border border-black/40 text-[14px] font-black text-white leading-none shadow-md z-10",children:o>99?"99+":o})]}):(0,r.jsxs)("button",{...t,onClick:d,type:"button",className:(0,q.cn)("flex items-center justify-center bg_blue border border-white/10 rounded-full px-6 h-[52px] gap-2 cursor-pointer transition-all duration-200 shadow-2xl active:scale-95 outline-none",e),children:[(0,r.jsx)(O.A,{size:20,className:"text-white stroke-[1.5]"}),(0,r.jsx)("span",{suppressHydrationWarning:!0,className:"text-[18px] font-bold text-white transition-all flex items-center justify-center",children:l?(0,r.jsx)(F.A,{size:16,className:"animate-spin text-white/70"}):o})]})};var G=s(68245),P=s(45601),V=s(62795),U=s(91459);let W="78px",Y=({searchPlaceHolder:e,searchTypewriterTexts:t,handleSearch:s,initialSearchKeyword:i="",showLocationPicker:o=!0,showBasketButton:d=!0,isFloating:c=!0,topBanner:m,redirect:g=!0,logoHref:p,showSearchPanel:f=!0,storeChip:w})=>{let j=(0,l.rd)(),L=(0,u.useGlobalStore)(e=>e.isHydrated),D=(0,u.useGlobalStore)(e=>e.current_user),O=D?.IsGuest||!1,F=(0,b.a)(),[q,Y]=(0,a.useState)(!1),[B,X]=(0,a.useState)(!1),Z=null===s?null:e=>{"function"==typeof s?s(e):e.trim()&&j.push(`/search?q=${encodeURIComponent(e.trim())}`)},{language:Q}=(0,h.n)(),J=x.P[Q],{openAuthModal:K,openLogoutPopup:ee}=(0,P.w)(),et=async()=>{await K()},es=async()=>{await ee()},{direction:er,isPastFold:ea}=function(e=8){let[t,s]=(0,a.useState)({direction:"up",isPastFold:!1}),r=(0,a.useRef)(0);return(0,a.useEffect)(()=>{let t=()=>{let t=window.scrollY,a=t-r.current,l=window.innerHeight;s(s=>{let r=Math.abs(a)>=e?a>0?"down":"up":s.direction,n=t>l;return r===s.direction&&n===s.isPastFold?s:{direction:r,isPastFold:n}}),Math.abs(a)>=e&&(r.current=t)};return window.addEventListener("scroll",t,{passive:!0}),()=>window.removeEventListener("scroll",t)},[e]),t}(150),el=c&&"down"===er&&!q;return(0,r.jsxs)("div",{className:"landing-content-container",children:[c&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{"aria-hidden":"true",className:"w-full lg:hidden",style:{height:q&&Z?`calc(${W} + 72px + ${m?"72px":"0px"})`:`calc(${W} + ${m?"72px":"0px"})`,transition:"height 300ms ease-in-out"}}),(0,r.jsx)("div",{"aria-hidden":"true",className:"w-full hidden lg:block",style:{height:"88px"}})]}),(0,r.jsxs)("header",{className:` 2 landing-content-padding 3 w-full pointer-events-auto flex flex-col transition-all duration-300 border-b 4 ${B?"z-[60]":"z-30"} 5 ${c?"fixed top-0 left-0 right-0":"relative"} 6 ${el?"-translate-y-full":"translate-y-0"} 7 ${c&&ea?"bg-black/30 backdrop-blur-sm border-white/6":"bg-transparent border-transparent"} 8 `,children:[m&&(0,r.jsx)("div",{className:"w-full",children:m}),(0,r.jsxs)("div",{className:"hidden lg:flex items-center w-full pt-2 pb-2 pb-0 px-10 gap-8",children:[g?(0,r.jsx)(l.N_,{href:p??"/",children:(0,r.jsx)(n.d,{className:"cursor-pointer h-auto object-contain relative z-20 mt-4 w-[120px] mr-[35px] shrink-0"})}):(0,r.jsx)(n.d,{className:"h-auto object-contain relative z-20 mt-4 w-[120px] mr-[35px] shrink-0"}),o&&(0,r.jsx)(v,{variant:"desktop"}),Z&&(0,r.jsx)(y.T,{initialValue:i,handleSearch:Z,placeholderText:e,typewriterTexts:t,className:"w-[300px] lg:w-[340px] xl:w-[440px]",onActiveChange:X,showSearchPanel:f,storeChip:w}),(0,r.jsxs)("div",{className:"flex items-center gap-3 ml-auto shrink-0",children:[(0,r.jsxs)(U.m_,{children:[(0,r.jsx)(U.k$,{asChild:!0,children:(0,r.jsx)("button",{type:"button",onClick:()=>V.c.getState().openDrawer(),className:"cursor-pointer grid place-items-center h-[52px] w-[52px] rounded-full glass_card_black glass_card_black_hover transition-all duration-200 border border-white/10 hover:bg-white/5 active:scale-95 outline-none shrink-0 ","aria-label":"Open chat",children:(0,r.jsx)(k.A,{size:20,className:"text-white"})})}),(0,r.jsx)(U.ZI,{side:"bottom",className:"bg-white text-sm font-semibold rounded-xl border border-gray-100 shadow-2xl",children:(0,r.jsx)("p",{children:J.header.chat})})]}),(0,r.jsxs)(U.m_,{children:[(0,r.jsx)(U.k$,{asChild:!0,children:(0,r.jsx)("div",{children:(0,r.jsx)(G.c,{})})}),(0,r.jsx)(U.ZI,{side:"bottom",className:"bg-white text-sm font-semibold rounded-xl border border-gray-100 shadow-2xl",children:(0,r.jsxs)("p",{children:[J.header.language," & ",J.header.currency]})})]}),L?!D||O?(0,r.jsxs)(T.$,{onClick:et,className:"rounded-full h-[52px] pl-1 pr-6 text-white font-bold bg-gradient-to-r from-[#004128] to-[#006531] hover:scale-105 transition-transform shadow-lg uppercase text-sm border border-white/15 glass_card_black_hover",children:[(0,r.jsx)("div",{className:"flex items-center justify-center rounded-full p-[10px] ml-1 mr-2 bg-black/20",children:(0,r.jsx)(S.A,{size:14,className:"text-white/80"})}),J.header.login]}):(0,r.jsxs)(E.rI,{modal:!1,children:[(0,r.jsx)(E.ty,{asChild:!0,children:(0,r.jsxs)("div",{className:"flex items-center glass_card_black glass_card_black_hover rounded-full pl-1 px-4 h-[52px] gap-3 hover:bg-white/5 cursor-pointer outline-none",role:"button","aria-label":"User settings",children:[(0,r.jsx)("div",{className:"w-[44px] h-[44px] rounded-full overflow-hidden border border-white/20 flex items-center justify-center bg-gray-800",children:D.Avatar?(0,r.jsx)(N.A,{src:(0,_.X)(D.Avatar,"sm")||"",alt:D.FullName,width:50,height:50,className:"object-cover"}):(0,r.jsx)(C.A,{size:20,className:"text-gray-400"})}),(0,r.jsx)("span",{className:"text-sm font-semibold text-white uppercase min-w-[4ch]",children:D.FirstName}),(0,r.jsx)("div",{className:"flex flex-col gap-0.5",children:[1,2,3].map(e=>(0,r.jsx)("div",{className:"w-4 h-0.5 bg-gray-500 rounded-full"},e))})]})}),(0,r.jsxs)(E.SQ,{align:"end",className:"w-64 bg-black/40 backdrop-blur-xl border border-white/10 text_gray_70 squircle p-2 shadow-2xl",children:[(0,r.jsxs)(E.lp,{className:"px-3 py-2 flex items-center gap-2",children:[(0,r.jsx)("div",{className:"w-9 h-9 rounded-full overflow-hidden flex items-center justify-center bg-white/5 shrink-0",children:D.Avatar?(0,r.jsx)(N.A,{src:(0,_.X)(D.Avatar,"sm")||"",alt:D.FullName,width:50,height:50,className:"object-cover w-full h-full"}):(0,r.jsx)(C.A,{size:20,className:"text-gray-400"})}),(0,r.jsxs)("div",{className:"flex flex-col gap-0.5 min-w-0 flex-1",children:[(0,r.jsx)("p",{className:"text-sm font-bold text-white truncate",children:D.FullName}),(0,r.jsx)("p",{className:"text-sm md:text-[12px] text_gray_70 truncate",children:D.Email})]})]}),(0,r.jsx)(E.mB,{className:"bg-white/10"}),(0,r.jsx)(E._2,{asChild:!0,className:"flex items-center gap-3 px-3 py-2.5 squircle cursor-pointer hover:bg-white/10 focus:bg-white/10 transition-colors text-white",children:(0,r.jsxs)(l.N_,{href:"/my-profile",children:[(0,r.jsx)("div",{className:"flex items-center justify-center w-8 h-8 rounded-full bg-white/10",children:(0,r.jsx)(C.A,{size:16})}),(0,r.jsx)("span",{className:"text-sm font-semibold",children:J.header?.my_profile||"My Profile"})]})}),(0,r.jsx)(E._2,{asChild:!0,className:"flex items-center gap-3 px-3 py-2.5 squircle cursor-pointer hover:bg-white/10 focus:bg-white/10 transition-colors text-white",children:(0,r.jsxs)(l.N_,{href:"/my-orders",children:[(0,r.jsx)("div",{className:"flex items-center justify-center w-8 h-8 rounded-full bg-white/10",children:(0,r.jsx)(A.A,{size:16})}),(0,r.jsx)("span",{className:"text-sm font-semibold",children:J.header.my_orders||"My Orders"})]})}),F&&(0,r.jsx)(G.c,{variant:"menu-item"}),(0,r.jsxs)(E._2,{className:"hover:!text-red-400 flex items-center gap-3 px-3 py-2.5 squircle cursor-pointer hover:bg-white/10 focus:bg-white/10 transition-colors text-red-400",onClick:es,children:[(0,r.jsx)("div",{className:"flex items-center justify-center w-8 h-8 rounded-full bg-red-500/10",children:(0,r.jsx)(I.A,{size:16})}),(0,r.jsx)("span",{className:"text-sm font-semibold",children:J.header.logout})]})]})]}):(0,r.jsxs)("div",{className:"flex items-center glass_card_black rounded-full pl-1 px-4 h-[52px] gap-3",children:[(0,r.jsx)(M.E,{className:"w-[44px] h-[44px] rounded-full border border-white/20 shrink-0"}),(0,r.jsx)(M.E,{className:"h-4 w-12 rounded-full"}),(0,r.jsx)("div",{className:"flex flex-col gap-0.5",children:[1,2,3].map(e=>(0,r.jsx)("div",{className:"w-4 h-0.5 bg-gray-500 rounded-full"},e))})]}),d&&(0,r.jsx)("div",{className:"ml-2 hover:scale-105",children:(0,r.jsx)(H,{})})]})]}),(0,r.jsxs)("div",{className:"lg:hidden flex items-center w-full pt-5 pb-2 px-4 gap-2",children:[o?(0,r.jsxs)(r.Fragment,{children:[g?(0,r.jsx)(l.N_,{href:p??"/",children:(0,r.jsx)(N.A,{src:"/sugary-web-assets/logo/sugary-icon.svg",alt:"Sugary Icon",width:25,height:25,className:"object-contain ml-4 md:ml-0 mt-4 md:mt-0"})}):(0,r.jsx)(N.A,{src:"/sugary-web-assets/logo/sugary-icon.svg",alt:"Sugary Icon",width:25,height:25,className:"object-contain ml-4 md:ml-0 mt-4 md:mt-0"}),(0,r.jsx)("div",{className:"min-w-0 shrink mr-auto",children:(0,r.jsx)(v,{variant:"mobile"})})]}):(0,r.jsx)("div",{className:"mr-auto flex items-center",children:g?(0,r.jsx)(l.N_,{href:p??"/",children:(0,r.jsx)(n.d,{className:"cursor-pointer h-auto object-contain relative z-20 w-[95px] sm:w-[110px] mt-4 shrink-0"})}):(0,r.jsx)(n.d,{className:"h-auto object-contain relative z-20 w-[95px] sm:w-[110px] mt-4 shrink-0"})}),(0,r.jsxs)("div",{className:"flex items-center gap-2 shrink-0 mt-4",children:[Z&&(0,r.jsx)("button",{type:"button",onClick:()=>Y(e=>
8!e),className:`cursor-pointer grid place-items-center h-[52px] w-[52px] rounded-full glass_card_black transition-all duration-200 border ${q?"border-white/30 bg-white/10":"border-white/10 hover:bg-white/5"}`,"aria-label":"Open search","aria-expanded":q,children:(0,r.jsx)(z.A,{size:17,className:q?"text-white":"text-white/80"})}),d&&(0,r.jsx)(H,{}),L?(0,r.jsxs)(E.rI,{modal:!1,children:[(0,r.jsx)(E.ty,{asChild:!0,children:(0,r.jsx)("button",{type:"button",className:`cursor-pointer relative flex items-center glass_card_black border border-white/10 hover:bg-white/5 transition-colors outline-none ${D&&!O?"pl-[10px] pr-2.5 h-[52px] gap-1.5 rounded-full":"h-[52px] w-[52px] p-0 justify-center rounded-full"}`,"aria-label":"Open menu",children:D&&!O?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"w-10 h-10 rounded-full overflow-hidden flex items-center justify-center bg-gray-800 shrink-0",children:D.Avatar?(0,r.jsx)(N.A,{src:(0,_.X)(D.Avatar,"sm")||"",alt:D.FullName,width:28,height:28,className:"object-cover"}):(0,r.jsx)(C.A,{size:13,className:"text-gray-400"})}),(0,r.jsx)($.A,{size:19,className:"text-white"})]}):(0,r.jsx)($.A,{size:20,className:"text-white"})})}),(0,r.jsx)(E.SQ,{align:"end",className:"bg-black/60 backdrop-blur-xl border border-white/10 text_gray_70 squircle p-3 shadow-2xl flex flex-col gap-2.5 z-[70] min-w-[200px]",children:D&&!O?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(E.lp,{className:"px-1 py-1 flex items-center gap-2.5",children:[(0,r.jsx)("div",{className:"w-12 h-12 rounded-full overflow-hidden flex items-center justify-center bg-white/5 shrink-0 border border-white/20",children:D.Avatar?(0,r.jsx)(N.A,{src:(0,_.X)(D.Avatar,"sm")||"",alt:D.FullName,width:36,height:36,className:"object-cover"}):(0,r.jsx)(C.A,{size:18,className:"text-gray-400"})}),(0,r.jsxs)("div",{className:"flex flex-col gap-0.5 min-w-0",children:[(0,r.jsx)("p",{className:"text-xl font-bold text-white truncate",children:D.FullName}),(0,r.jsx)("p",{className:"text-lg text_gray_70 truncate",children:D.Email})]})]}),(0,r.jsx)(E.mB,{className:"bg-white/10"}),(0,r.jsxs)(E._2,{className:"flex items-center gap-3 px-3 py-2.5 squircle cursor-pointer hover:bg-white/10 focus:bg-white/10 transition-colors text-white",onClick:()=>V.c.getState().openDrawer(),children:[(0,r.jsx)("div",{className:"flex items-center justify-center w-9 h-9 rounded-full bg-white/10",children:(0,r.jsx)(k.A,{size:20})}),(0,r.jsx)("span",{className:"text-xl font-bold text-white",children:J.chat?.messages||"Messages"})]}),(0,r.jsx)(E._2,{asChild:!0,className:"flex items-center gap-3 px-3 py-2.5 squircle cursor-pointer hover:bg-white/10 focus:bg-white/10 transition-colors text-white",children:(0,r.jsxs)(l.N_,{href:"/my-profile",children:[(0,r.jsx)("div",{className:"flex items-center justify-center w-9 h-9 rounded-full bg-white/10",children:(0,r.jsx)(C.A,{size:20})}),(0,r.jsx)("span",{className:"text-xl font-bold text-white",children:J.header?.my_profile||"My Profile"})]})}),(0,r.jsx)(E._2,{asChild:!0,className:"flex items-center gap-3 px-3 py-2.5 squircle cursor-pointer hover:bg-white/10 focus:bg-white/10 transition-colors text-white",children:(0,r.jsxs)(l.N_,{href:"/my-orders",children:[(0,r.jsx)("div",{className:"flex items-center justify-center w-9 h-9 rounded-full bg-white/10",children:(0,r.jsx)(A.A,{size:20})}),(0,r.jsx)("span",{className:"text-xl font-bold text-white",children:J.header.my_orders||"My Orders"})]})}),(0,r.jsx)(G.c,{variant:"menu-item"}),(0,r.jsxs)(E._2,{className:"flex items-center gap-3 px-3 py-2.5 squircle cursor-pointer hover:bg-white/10 focus:bg-white/10 transition-colors text-red-400 hover:!text-red-400",onClick:es,children:[(0,r.jsx)("div",{className:"flex items-center justify-center w-9 h-9 rounded-full bg-red-500/10",children:(0,r.jsx)(I.A,{size:20})}),(0,r.jsx)("span",{className:"text-xl font-bold",children:J.header.logout})]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(G.c,{variant:"menu-item"}),(0,r.jsxs)(T.$,{onClick:et,className:"w-full rounded-full h-[48px] text-white font-bold bg-gradient-to-r from-[#004128] to-[#006531] hover:scale-[1.02] transition-transform shadow-lg uppercase text-xl border border-white/15 flex items-center justify-center gap-2 mt-1",children:[(0,r.jsx)("div",{className:"flex items-center justify-center rounded-full p-[6px] bg-black/20",children:(0,r.jsx)(S.A,{size:16,className:"text-white/80"})}),J.header.login]})]})})]}):(0,r.jsx)(M.E,{className:"h-[52px] w-[52px] rounded-full bg-white/10"})]})]}),Z&&(0,r.jsx)("div",{className:`lg:hidden overflow-hidden transition-all duration-300 ease-in-out ${q?"max-h-[80px] opacity-100 pt-2 pb-3 px-4":"max-h-0 opacity-0 py-0 px-4"}`,children:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("button",{type:"button",onClick:()=>Y(!1),className:"cursor-pointer shrink-0 grid place-items-center h-[48px] w-[48px] rounded-full glass_card_black border border-white/10 hover:bg-white/5 transition-all duration-200","aria-label":"Close search",children:(0,r.jsx)(R.A,{size:17,className:"text-white/80"})}),(0,r.jsx)(y.T,{initialValue:i,handleSearch:Z,placeholderText:e,typewriterTexts:t,className:"flex-1",onActiveChange:X,showSearchPanel:f,storeChip:w,autoFocus:q&&!w&&!1!==f})]})}),Z&&(0,r.jsx)("div",{"aria-hidden":"true",className:`lg:hidden absolute inset-0 -z-10 transition-all duration-300 pointer-events-none ${q?"opacity-100 bg-black/40 backdrop-blur-xl":"op
8acity-0"}`})]})]})}},62795:(e,t,s)=>{s.d(t,{c:()=>i});var r=s(1934),a=s(93111),l=s(37002),n=s(45601);let i=(0,r.v)((e,t)=>({isOpen:!1,targetStoreId:null,targetRoomId:null,openDrawer:async t=>{let{current_user:s,token:r}=l.useGlobalStore.getState();(null!=s&&!s.IsGuest&&null!=r||await n.w.getState().openAuthModal())&&e({isOpen:!0,targetStoreId:t?.storeId??null,targetRoomId:t?.roomId??null})},closeDrawer:()=>{a.L.getState().cleanupEmptyRooms(),e({isOpen:!1,targetStoreId:null,targetRoomId:null})},toggleDrawer:async()=>{let{isOpen:e}=t();e?t().closeDrawer():await t().openDrawer()}}))},93111:(e,t,s)=>{s.d(t,{L:()=>x});var r=s(1934),a=s(2125),l=s(35844),n=s(37002);async function i(e,t){try{let s=await l.u.get(`${a.VR.CREATE_ROOM}?storeId=${e}&userId=${t}`),r=await s.json();return r?.Data??r??null}catch(e){return console.error("Failed to create chat room:",e),null}}var o=s(15217),d=s(29407);let c=null,u=async()=>(c||(c=await s.e(3522).then(s.bind(s,73522))),c),h=new Set,x=(0,r.v)((e,t)=>({rooms:[],messages:[],selectedRoomId:null,connection:null,isConnected:!1,isLoading:!1,isLoadingOlderMessages:!1,hasOlderMessages:!0,autoTranslate:!1,setAutoTranslate:t=>{(0,o.setClientCookie)(d.F.CHAT_AUTO_TRANSLATE,t,365),e({autoTranslate:t})},hydrateAutoTranslate:()=>{let t=(0,o.ok)(d.F.CHAT_AUTO_TRANSLATE);null!==t&&e({autoTranslate:!0===t||"true"===t})},addRoom:s=>{let{rooms:r}=t();r.some(e=>e.Id===s.Id)||e({rooms:[s,...r]})},setSelectedRoomId:t=>e({selectedRoomId:t}),cleanupEmptyRooms:()=>e(e=>({rooms:e.rooms.filter(e=>!!e.LastMessageText||!!e.LastMessageSentAt)})),fetchRooms:async(s=0,r=20,n="")=>{0===t().rooms.length&&e({isLoading:!0});try{let t=n?encodeURIComponent(n.trim()):"",i=await l.u.get(`${a.VR.GET_ROOMS}?skip=${s}&limit=${r}&search=${t}`),o=await i.json(),d=Array.isArray(o)?o:o.Data??[];return 0===s?e(e=>{if(!n){let t=new Set(d.map(e=>e.Id));return{rooms:[...e.rooms.filter(e=>!t.has(e.Id)),...d]}}return{rooms:d}}):e(e=>({rooms:[...e.rooms,...d]})),d}catch(e){return console.error("Failed to fetch chat rooms:",e),[]}finally{e({isLoading:!1})}},fetchMessages:async(s,r=null)=>{let n=null!==r;if(n)e({isLoadingOlderMessages:!0});else{let r=t().messages;t().selectedRoomId===s&&r.length>0&&r[0]?.StoreChatRoomId===s||e({isLoading:!0,messages:[],hasOlderMessages:!0})}try{let t=`${a.VR.GET_MESSAGES}?roomId=${s}`+(r?`&firstMessageId=${r}`:""),i=await l.u.get(t),o=await i.json(),d=Array.isArray(o)?o:o.Data??[];d=[...d].reverse(),n?0===d.length?e({hasOlderMessages:!1}):e(e=>({messages:[...d,...e.messages]})):(e({messages:d}),0===d.length&&e({hasOlderMessages:!1}))}catch(e){console.error("Failed to fetch messages:",e)}finally{e({isLoading:!1,isLoadingOlderMessages:!1})}},sendMessage:async(e,s,r)=>{let{current_user:i}=n.useGlobalStore.getState();if(i)try{let n={Id:0,StoreChatRoomId:e,Text:s,Type:r?"BESPOKE_ORDER":"TEXT",SenderId:i.Id,SentAt:new Date().toISOString().split(".")[0]+"Z",ImagePath:null,ImageWidth:null,ImageHeight:null,ByteSize:null,IsError:!1,...r?{IntValueA:r}:{}},o=await l.u.post(a.VR.SEND_MESSAGE,n),d=await o.json(),c=d?.Data??d;c?.Id&&t().addMessage(c)}catch(e){console.error("Failed to send message:",e)}},addMessage:s=>{let{messages:r}=t();r.some(e=>e.Id===s.Id)||(e({messages:[...r,s]}),e(e=>({rooms:e.rooms.map(e=>e.Id===s.StoreChatRoomId?{...e,LastMessageText:s.Text,LastMessageSentAt:s.SentAt}:e)})))},joinRoom:async e=>{let{connection:s}=t();if(s&&s.state===c?.HubConnectionState.Connected&&!h.has(e))try{await s.invoke("JoinRoom",e),h.add(e)}catch(t){console.error("Failed to join room:",e,t)}},startChat:async e=>{let s=t=>t.find(t=>t.StoreId?.toString()===e||t.Id?.toString()===e||t.StoreUid&&t.StoreUid.toLowerCase()===e.toLowerCase()),r=s(t().rooms);if(r)return r.Id;await t().fetchRooms();let a=s(t().rooms);if(a)return a.Id;let{current_user:l}=n.useGlobalStore.getState();if(l&&e){let s=await i(e,l.Id);if(s&&s.Id)return t().addRoom(s),s.Id}return console.warn(`No chat room found for storeId="${e}"`),null},initializeConnection:async s=>{let r,l,n;if(t().connection)return;try{({HubConnectionBuilder:r,LogLevel:l}=await u())}catch(e){console.warn("Failed to load SignalR module:",e);return}let i="https://api.sugary.ae".replace(/\/+$/,"");try{n=new r().withUrl(`${i}${a.Zf}`,{accessTokenFactory:()=>s,withCredentials:!1}).withAutomaticReconnect().configureLogging(l.Warning).build()}catch(e){console.warn("Failed to build SignalR connection:",e);return}n.on("ReceiveMessage",s=>{try{let r=Array.isArray(s)?s[0]:s,a="string"==typeof r?JSON.parse(r):r,{messages:l,selectedRoomId:n}=t();if(l.some(e=>e.Id===a.Id))return;a.StoreChatRoomId===n&&e({messages:[...l,a]}),e(e=>({rooms:e.rooms.map(e=>e.Id===a.StoreChatRoomId?{...e,LastMessageText:a.Text,LastMessageSentAt:a.SentAt}:e)}))}catch(e){console.error("Error processing incoming message:",e)}}
8),n.onreconnected(async()=>{h.clear();let{rooms:e,selectedRoomId:s}=t();for(let s of e)await t().joinRoom(s.Id);s&&await t().joinRoom(s)});try{for(let s of(await n.start(),console.log("â
Connected to Chat Hub"),e({connection:n,isConnected:!0}),t().rooms))await t().joinRoom(s.Id)}catch(t){console.warn("SignalR Connection Error:",t),e({isConnected:!1})}},disconnect:()=>{let{connection:s}=t();s&&(s.stop(),h.clear(),e({connection:null,isConnected:!1}))}}))},97812:(e,t,s)=>{s.d(t,{s:()=>r});function r(e){if(!e)return"";let t=new Date(e);if(isNaN(t.getTime()))return"";let s=t.getDate(),r=t.toLocaleString("en-US",{month:"short"}).toLowerCase();return`${s} ${r}`}}}]);
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.