1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6a3229d3-92e6-4e7b-9119-720bf0e9f503",e._sentryDebugIdIdentifier="sentry-dbid-6a3229d3-92e6-4e7b-9119-720bf0e9f503")}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8141],{3998:(e,t,s)=>{"use strict";s.d(t,{$:()=>c,r:()=>o});var r=s(695155),a=s(332467),l=s(983101),n=s(212115),i=s(964269);let o=(0,l.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-lg px-3 text-xs",lg:"h-10 rounded-lg px-8",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}}),c=n.forwardRef((e,t)=>{let{className:s,variant:l,size:n,asChild:c=!1,...d}=e,u=c?a.Slot:"button";return(0,r.jsx)(u,{className:(0,i.cn)(o({variant:l,size:n,className:s})),ref:t,type:"button",...d})});c.displayName="Button"},115894:(e,t,s)=>{"use strict";s.d(t,{dj:()=>u,oR:()=>d});var r=s(212115);let a=0,l=new Map,n=e=>{if(l.has(e))return;let t=setTimeout(()=>{l.delete(e),c({type:"REMOVE_TOAST",toastId:e})},1e6);l.set(e,t)},i=[],o={toasts:[]};function c(e){o=((e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,1)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case"DISMISS_TOAST":{let{toastId:s}=t;return s?n(s):e.toasts.forEach(e=>{n(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===s||void 0===s?{...e,open:!1}:e)}}case"REMOVE_TOAST":if(void 0===t.toastId)return{...e,toasts:[]};return{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}})(o,e),i.forEach(e=>{e(o)})}function d(e){let{...t}=e,s=(a=(a+1)%Number.MAX_SAFE_INTEGER).toString(),r=()=>c({type:"DISMISS_TOAST",toastId:s});return c({type:"ADD_TOAST",toast:{...t,id:s,open:!0,onOpenChange:e=>{e||r()}}}),{id:s,dismiss:r,update:e=>c({type:"UPDATE_TOAST",toast:{...e,id:s}})}}function u(){let[e,t]=r.useState(o);return r.useEffect(()=>(i.push(t),()=>{let e=i.indexOf(t);e>-1&&i.splice(e,1)}),[]),{...e,toast:d,dismiss:e=>c({type:"DISMISS_TOAST",toastId:e})}}},184636:(e,t,s)=>{"use strict";s.d(t,{AppStoreProvider:()=>o,C:()=>c});var r=s(695155),a=s(212115),l=s(571138),n=s(582719);let i=(0,a.createContext)(void 0),o=e=>{let{children:t,initState:s}=e,l=(0,a.useRef)(null);return l.current||(l.current=(0,n.p)(s)),(0,a.useEffect)(()=>{l.current&&l.current.setState(s)},[s]),(0,r.jsx)(i.Provider,{value:l.current,children:t})},c=e=>{let t=(0,a.useContext)(i);if(!t)throw Error("useAppStore must be used within AppStoreProvider");return(0,l.P)(t,e)}},226541:(e,t,s)=>{"use strict";s.d(t,{N_:()=>i,a8:()=>c,rd:()=>d});var r=s(18956),a=s(675087),l=s(624805);let n=(0,a.o)({locales:l.M.LOCALES,defaultLocale:l.M.LOCALES[0],localeDetection:!1}),{Link:i,redirect:o,usePathname:c,useRouter:d,getPathname:u}=(0,r.xp)(n)},353080:(e,t,s)=>{"use strict";s.d(t,{i:()=>r});let r=(0,s(644972).pY)()},410514:(e,t,s)=>{"use strict";s.d(t,{Y:()=>a});var r=s(495604);function a(){var e;let{appUser:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=(0,r.useLocale)();return null!=(e=null==t?void 0:t.preferredLanguage)?e:s}},426333:(e,t,s)=>{"use strict";s.d(t,{AM:()=>i,Wv:()=>o,hl:()=>c});var r=s(695155),a=s(82286),l=s(212115),n=s(964269);let i=a.bL,o=a.l9;a.Mz;let c=l.forwardRef((e,t)=>
1{let{className:s,align:l="center",sideOffset:i=4,...o}=e;return(0,r.jsx)(a.ZL,{children:(0,r.jsx)(a.UC,{ref:t,align:l,sideOffset:i,className:(0,n.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none",s),...o})})});c.displayName=a.UC.displayName},582558:(e,t,s)=>{"use strict";s.d(t,{$i:()=>n,lg:()=>l,oF:()=>i});let r=e=>{if("string"!=typeof e)return null;let t=e.trim();return t.length>0?t:null},a=e=>{if("number"==typeof e&&Number.isFinite(e))return e;if("string"==typeof e&&e.trim().length>0){let t=Number(e);return Number.isFinite(t)?t:null}return null},l=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,s=[],l=e.merchantLocations;if(Array.isArray(l)&&l.length>0)l.forEach(e=>{let t=(e=>{if(!e||"object"!=typeof e)return null;let t=r(e.address);return t?{address:t,latitude:a(e.latitude),longitude:a(e.longitude)}:null})(e);t&&s.push(t)});else{let t=r(e.street),l=a(e.latitude),n=a(e.longitude);t?s.push({address:t,latitude:l,longitude:n}):(null!==l||null!==n)&&s.push({address:"",latitude:l,longitude:n})}let n=[],i=new Set;for(let e of s){var o,c,d,u;let t=e.address.trim();if(!t&&null===e.latitude&&null===e.longitude)continue;let s=[t.toLowerCase(),null!=(d=null==(o=e.latitude)?void 0:o.toString())?d:"null",null!=(u=null==(c=e.longitude)?void 0:c.toString())?u:"null"].join("|");i.has(s)||(i.add(s),n.push({address:t,latitude:e.latitude,longitude:e.longitude}))}return n.slice(0,t)};function n(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;return l(e,t).filter(e=>e.address.trim().length>0)}function i(e,t,s){var r;return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;return n(e,t).length}(e)>1?s:null!=(r=null==t?void 0:t.trim())?r:""}},582719:(e,t,s)=>{"use strict";s.d(t,{J:()=>a,p:()=>l});var r=s(690490);let a={isMobile:!1,appUser:null,profiles:{customer:void 0,merchant:void 0,merchantCouponRedeemer:void 0},customerSettings:void 0,progress:0,isProgressVisible:!1,impersonationJwt:void 0,restaurantPassStatus:null,eventPassStatus:null,wellnessPassStatus:null},l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a;return(0,r.y)()(t=>({...e,setIsMobile:e=>t({isMobile:e}),setAppUser:e=>t({appUser:e}),setProfiles:e=>t({profiles:e}),setCustomerSettings:e=>t({customerSettings:e}),setProgressVisible:(e,s)=>t({progress:e,isProgressVisible:s}),setImpersonationJwt:e=>t({impersonationJwt:e}),setRestaurantPassStatus:e=>t({restaurantPassStatus:e}),setEventPassStatus:e=>t({eventPassStatus:e}),setWellnessPassStatus:e=>t({wellnessPassStatus:e})}))}},624805:(e,t,s)=>{"use strict";s.d(t,{M:()=>p});let r={MERCHANT_BUCKET:{name:"merchant",folders:{publicBanner:"public/banner",publicBannerOriginals:"public/banner-originals",dishes:"public/dishes"},maxBanners:30,getBannerFolder:e=>"".concat(r.MERCHANT_BUCKET.folders.publicBanner,"/").concat(e),getBannerPath:(e,t)=>"".concat(r.MERCHANT_BUCKET.getBannerFolder(e),"/").concat(t),getBannerOriginalFolder:e=>"".concat(r.MERCHANT_BUCKET.folders.publicBannerOriginals,"/").concat(e),getBannerOriginalPath:(e,t)=>"".concat(r.MERCHANT_BUCKET.getBannerOriginalFolder(e),"/").concat(t),getDishesFolder:e=>"".concat(r.MERCHANT_BUCKET.folders.dishes,"/").concat(e),getDishesPath:(e,t)=>"".concat(r.MERCHANT_BUCKET.getDishesFolder(e),"/").concat(t)},RESTAURANT_BUCKET:{name:"restaurant-images",getImagePath:e=>"restaurants/".concat(e,".jpg")},CUSTOMER_BUCKET:{name:"customer",getAvatarPath:e=>"public/avatars/".concat(e,".jpg"),getVisitPhotoPath:(e,t)=>"public/visit-photos/".concat(e,"/").concat(t,".jpg")}},a="CUSTOMER",l="MERCHANT",n="https://www.joinspectra.com",i="Spectra Eats",o="Secret restaurant offers in Montreal. Not on the menu. Only on Spectra.",c={metadataBase:new URL(n),title:i,description:o,openGraph:{type:"website",title:i,description:o,url:n,countryName:"Canada",emails:["[email protected]"],locale:"en_CA",images:[{url:"".concat(n,"/logo.png"),width:1200,height:630,alt:"Spectra",type:"image/png",secureUrl:"".concat(n,"/logo.png")}],siteName:"Spectra"},twitter:{card:"summary_large_image",title:i,description:o,images:["".concat(n,"/logo.png")]}},d=["MERCHANT_REJECTED","MERCHANT_NOTIFICATION_EXPIRED"],u=["FULFILLED"],m=[...d,...u],p={ADD_ON_TYPES:["ONE_OF","MULTIPLE","COUNTABLE"],BUCKET_STORAGE:r,ESTIMATED_SAVING_MULTIPLIER:1.3225,COUPON_FREE_VALIDITY_PERIOD:864e5,COUPON_VALIDITY_PERIOD:2592e6,MAX_TAGS_PER_MERCHANT_PER_LANGUAGE:10,LOCALES:["en","fr"],ORDER_STATUS_PENDING:["PENDING"],ORDER_STATUS_ONGOING:["PENDING","MERCHANT_ACCEPTED"],ORDER_STATUS_FAILED:d,ORDER_STATUS_SUCCESS:u,ORDER_STATUS_FLOW_FINISHED:m,USER_TYPE:{CUSTOMER:a,MERCHANT:l,MERCHANT_COUPON_REDEEMER:"MERCHANT_COUPON_REDEEMER"},CUSTOMER:a,MERCHANT:l,BANNER_WIDTH:2400,BANNER_HEIGHT:1500,OG_METADATA:c,SOCIALS:{facebook:"https://www.facebook.com/profile.php?id=61571077800249",instagram:"https://www.instagram.com/spectra.ca?igsh=MWJydDVmZmNvcno0dg%3D%3D&utm_source=qr",x:"https://x.com/spectratc",tiktok:"https://www.tiktok.com/@spectra.ca?_t=ZM-8xTvX7BiuwS&_r=1"},MERCHANT_DAYS:["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],MERCHANT_DAYS_FR:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],LOCAL_STORAGE_KEYS:{CART:()=>"user-cart"},RATE_LIMIT:{MAX_PENDING_CHECKOUT_SESSIONS_PER_USER:5},ENV_STRIPE_PUBLISHABLE_KEY:()=>{let e="pk_live_51PD8wPGEpr3f403gUap0Ww1lO2G3vZ6MSTqhncKys0YJsglUNxjKlYubxw07hDbN3HTobBB6fnootPUvdldN6KxD00DcSsIkqs";if(!e)throw Error("STRIPE_PUBLISHABLE_KEY is not set");return e},MASTER_DOMAIN:n,STRIPE_DASHBOARD_URL:"https://dashboard.stripe.com/dashboard",DINING_REQUEST_TIMEOUT_MS:18e5,DINING_CHECKOUT_TIMEOUT_MS:9e6,PAYMENT_INTENT_DEFAULT_AMOUNT:50,GST_RATE:.05,HST_RATE:.09975,MINIMUM_TIP_RATE:0,MAXIMUM_TIP_RATE:1,EXPIRY_ORDER_TIP_RATE:.15,APPLICATION_FEE_RATE:.05,JOB_WORKER_KEY
1S:{EXPIRED_ORDER_QUEUE:"EXPIRED_ORDER_QUEUE",DINING_CHECKOUT_QUEUE:"DINING_CHECKOUT_QUEUE"},STRIPE_FEE_RATE_ONE_TIME:.029,STRIPE_FEE_BASE_AMOUNT_CENTS:30,STRIPE_FEE_RATE_SUBSCRIPTION:.007,MIN_ORDER_AMOUNT_CENTS:1e3,STRIPE_FEE_RATE_CUSTOMER:.015,STRIPE_FEE_BASE_AMOUNT_CENTS_CUSTOMER:15,MIN_DISCOUNT:20,MAX_DISCOUNT:100,CLOSED_TIMES:"00:00-00:00",VENDOR_TYPES:["RESTAURANT","BEAUTY"],JOBS_QUEUE_KEY:"8b3a2a08451a571b22bce0522ba70393331fcf16bd2b902becaf3fe0a8658dc9",APP_STORE_URL:"https://apps.apple.com/ca/app/spectra-mtl/id6751058602",APP_STORE_URL_SCHEME:"itms-apps://itunes.apple.com/app/id6751058602",PLAY_STORE_URL:"https://play.google.com/store/apps/details?id=discount.spectra.spectra_mobile",PLAY_STORE_INTENT:"intent://details?id=discount.spectra.spectra_mobile#Intent;scheme=market;package=com.android.vending;end",MIN_PASSWORD_LENGTH:6}},631120:(e,t,s)=>{"use strict";s.d(t,{T:()=>n});var r=s(695155),a=s(212115),l=s(964269);let n=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("textarea",{className:(0,l.cn)("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",s),ref:t,...a})});n.displayName="Textarea"},672165:(e,t,s)=>{Promise.resolve().then(s.bind(s,93691)),Promise.resolve().then(s.bind(s,458558)),Promise.resolve().then(s.bind(s,936171))},673457:(e,t,s)=>{"use strict";s.d(t,{S:()=>o});var r=s(695155),a=s(538162),l=s(505917),n=s(212115),i=s(964269);let o=n.forwardRef((e,t)=>{let{className:s,...n}=e;return(0,r.jsx)(a.bL,{ref:t,className:(0,i.cn)("peer size-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",s),...n,children:(0,r.jsx)(a.C1,{className:(0,i.cn)("flex items-center justify-center text-current"),children:(0,r.jsx)(l.A,{className:"size-4"})})})});o.displayName=a.bL.displayName},711186:(e,t,s)=>{"use strict";s.d(t,{bq:()=>m,eb:()=>g,gC:()=>h,l6:()=>d,yv:()=>u});var r=s(695155),a=s(247887),l=s(924033),n=s(712108),i=s(505917),o=s(212115),c=s(964269);let d=a.bL;a.YJ;let u=a.WT,m=o.forwardRef((e,t)=>{let{className:s,children:n,...i}=e;return(0,r.jsxs)(a.l9,{ref:t,className:(0,c.cn)("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",s),...i,children:[n,(0,r.jsx)(a.In,{asChild:!0,children:(0,r.jsx)(l.A,{className:"size-4 opacity-50"})})]})});m.displayName=a.l9.displayName;let p=o.forwardRef((e,t)=>{let{className:s,...l}=e;return(0,r.jsx)(a.PP,{ref:t,className:(0,c.cn)("flex cursor-default items-center justify-center py-1",s),...l,children:(0,r.jsx)(n.A,{className:"size-4"})})});p.displayName=a.PP.displayName;let f=o.forwardRef((e,t)=>{let{className:s,...n}=e;return(0,r.jsx)(a.wn,{ref:t,className:(0,c.cn)("flex cursor-default items-center justify-center py-1",s),...n,children:(0,r.jsx)(l.A,{className:"size-4"})})});f.displayName=a.wn.displayName;let h=o.forwardRef((e,t)=>{let{className:s,children:l,position:n="popper",...i}=e;return(0,r.jsx)(a.ZL,{children:(0,r.jsxs)(a.UC,{ref:t,className:(0,c.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md","popper"===n&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",s),position:n,...i,children:[(0,r.jsx)(p,{}
1),(0,r.jsx)(a.LM,{className:(0,c.cn)("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:l}),(0,r.jsx)(f,{})]})})});h.displayName=a.UC.displayName,o.forwardRef((e,t)=>{let{className:s,...l}=e;return(0,r.jsx)(a.JU,{ref:t,className:(0,c.cn)("px-2 py-1.5 text-sm font-semibold",s),...l})}).displayName=a.JU.displayName;let g=o.forwardRef((e,t)=>{let{className:s,children:l,...n}=e;return(0,r.jsxs)(a.q7,{ref:t,className:(0,c.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...n,children:[(0,r.jsx)("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,r.jsx)(a.VF,{children:(0,r.jsx)(i.A,{className:"size-4"})})}),(0,r.jsx)(a.p4,{children:l})]})});g.displayName=a.q7.displayName,o.forwardRef((e,t)=>{let{className:s,...l}=e;return(0,r.jsx)(a.wv,{ref:t,className:(0,c.cn)("-mx-1 my-1 h-px bg-muted",s),...l})}).displayName=a.wv.displayName},851194:(e,t,s)=>{"use strict";s.d(t,{QQ:()=>a,bw:()=>r,uB:()=>l});let r={privacyPolicy:"/privacy-policy",dataDeletion:"/data-deletion",termsOfServiceCustomer:"/terms-customer",termsOfServiceMerchant:"/t-c-merchant.pdf",root:"/",access:"/access",admin:"/admin",admin2:"/admin2",admin2Merchants:"/admin2/merchants",admin2MerchantDetail:e=>"/admin2/merchants/".concat(e),admin2MerchantDashboard:e=>"/admin2/merchants/".concat(e,"/dashboard"),auth:"/auth",authConfirm:"/auth/confirm",loginCustomer:"/auth/login/customer",loginMerchant:"/auth/login/merchant",signupCustomer:"/auth/signup/customer",signupMerchant:"/auth/signup/merchant",error:"/error",customerWelcome:"/customer-welcome",customer:"/customer",customerProfile:"/customer/profile",customerReferral:"/customer/referral",customerFeed:"/customer/feed",customerAccess:"/customer/access",customerWallet:"/customer/wallet",customerWalletMobile:"/wallet-mobile",customerOrders:(e,t)=>{let s=n({orderId:e,thankYou:t?"true":void 0});return"/customer/orders".concat(s?"?".concat(s):"")},customerOngoingOrder:"/customer/ongoing-order",merchant:"/merchant",merchantOrders:"/merchant/orders",merchantWelcome:"/merchant-welcome",passwordReset:"/password-reset",updatePassword:"/update-password",updateEmail:"/update-email",explore:"/explore",waitlist:"/waitlist",merchantPublic:e=>"/merchants/".concat(e),merchantOngoingOrders:"/merchant/ongoing-orders",customerCodes:"/customer/codes",customerReservations:"/customer/reservations",merchantRedeemer:"/merchant-redeemer",merchantStats:e=>"/stats/".concat(e),redeem:e=>"/redeem/".concat(e)},a={feedback:"/feedback",stripeAccountLinkReturn:"/api/stripe/account-link-return",customerOngoingOrder:"/api/customer/ongoing-order",merchantOngoingOrders:"/api/merchant/ongoing-orders",order:"/api/order",fullfilOrder:"/api/jobs/fullfil-order",webhooks:"/webhooks",subscriptionWebhooks:"/webhooks/subscriptions",paymentMethods:"/api/payment-methods",paymentMethodsDefault:"/api/payment-methods/default",paymentMethodById:e=>"/api/payment-methods/".concat(e)},l={user_wallet:"user_wallet",redirect_back_to_url_on_wallet_add:"redirect_back_to_url_on_wallet_add",openSubscribeDialog:"openSubscribeDialog"},n=e=>Object.entries(e).filter(e=>{let[t,s]=e;return void 0!==s}).map(e=>{let[t,s]=e;return"".concat(t,"=").concat(s)}).join("&")},851834:(e,t,s)=>{"use strict";s.d(t,{Cf:()=>m,Es:()=>f,L3:()=>h,c7:()=>p,lG:()=>o,rr:()=>g,zM:()=>c});var r=s(695155),a=s(389511),l=s(265229),n=s(212115),i=s(964269);let o=a.bL,c=a.l9,d=a.ZL;a.bm;let u=n.forwardRef((e,t)=>{let{className:s,...l}=e;return(0,r.jsx)(a.hJ,{ref:t,className:(0,i.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80",s),...l})});u.displayName=a.hJ.displayName;let m=n.forwardRef((e,t)=>{let{className:s,children:n,...o}=e;return(0,r.jsxs)(d,{children:[(0,r.jsx)(u,{className:(0,i.cn)("data-[state=open]:animate-dialog-overlay-show","data-[state=closed]:animate-dialog-overlay-hide")}),(0,r.jsxs)(a.UC,{ref:t,className:(0,i.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 roun
1ded-md border bg-background p-6 shadow-lg duration-200","data-[state=open]:animate-dialog-content-show","data-[state=closed]:animate-dialog-content-hide",s),...o,children:[n,(0,r.jsxs)(a.bm,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,r.jsx)(l.A,{className:"size-4"}),(0,r.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});m.displayName=a.UC.displayName;let p=e=>{let{className:t,...s}=e;return(0,r.jsx)("div",{className:(0,i.cn)("flex flex-col space-y-1.5 text-center sm:text-left",t),...s})};p.displayName="DialogHeader";let f=e=>{let{className:t,...s}=e;return(0,r.jsx)("div",{className:(0,i.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...s})};f.displayName="DialogFooter";let h=n.forwardRef((e,t)=>{let{className:s,...l}=e;return(0,r.jsx)(a.hE,{ref:t,className:(0,i.cn)("text-lg font-semibold leading-none tracking-tight",s),...l})});h.displayName=a.hE.displayName;let g=n.forwardRef((e,t)=>{let{className:s,...l}=e;return(0,r.jsx)(a.VY,{ref:t,className:(0,i.cn)("text-sm text-muted-foreground",s),...l})});g.displayName=a.VY.displayName},936171:(e,t,s)=>{"use strict";s.d(t,{default:()=>eE});var r=s(695155),a=s(93736),l=s(780003),n=s(38707),i=s(886651),o=s(566630),c=s(505917),d=s(121873),u=s(539347),m=s(495604),p=s(442444),f=s(212115),h=s(571138),g=s(515239),x=s(711186),b=s(711647),v=s(206132),y=s(926983),N=s(382063),j=s(529502),w=s(395740),T=s(841896),E=s(704587),_=s(99708),A=s(964269),C=s(555082);let k={merchant_sold_out:N.A,merchant_x_left:N.A,promo_remaining:N.A,promo_sold_out:N.A,promo_already_claimed:N.A,cooldown:j.A,cooldown_next_available:j.A,coupon_cutoff:j.A,pass_exclusive_event:w.A,pass_exclusive_restaurant:T.A,pass_exclusive_wellness:E.A,unavailable_today:j.A};function S(e){let{badges:t,locked:s,className:a}=e,l=(0,m.useTranslations)();return t&&0!==t.length?(0,r.jsx)("div",{className:(0,A.cn)("flex flex-wrap gap-2",a),children:t.map((e,t)=>{var a;let n=null!=(a=k[e.kind])?a:N.A,i=e.kind.startsWith("pass_exclusive_"),o=s&&i?"locked":e.tone,c=(()=>{let t=e.i18n.webapp.key;if("__literal__"===t)return e.fallbackLabel;try{return l(t,e.i18n.webapp.params)}catch(t){return e.fallbackLabel}})();return(0,r.jsxs)(b.E,{variant:(0,C.zD)(o,e.kind),className:(0,C.hH)(o,e.kind),children:[s&&i?(0,r.jsx)(_.A,{className:"size-3"}):(0,r.jsx)(n,{className:"size-3"}),c]},"".concat(e.kind,":").concat(t))})}):null}var R=s(410514),O=s(226541),M=s(851194),I=s(117267);function U(e,t){var s;let r=null==e?void 0:e[0];if(!r)return null;let a="fr"===t,l=a?r.nameFR:r.nameEN,n=a?r.nameEN:r.nameFR,i=(null!=(s=null!=l?l:n)?s:"").trim();return i.length>0?i:null}function P(e){return!e||e.length<=1?0:e.length-1}var D=s(582558),L=s(409763),z=s(673457),B=s(936832),F=s(3998);function G(){let{enabled:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[t,s]=(0,f.useState)(null);return(0,f.useEffect)(()=>{e&&navigator.geolocation&&navigator.geolocation.getCurrentPosition(e=>{s({latitude:e.coords.latitude,longitude:e.coords.longitude})})},[e]),t}var K=s(184636);function H(e){var t;let{merchants:s,sortBy:a,onSortByChange:l,filterBy:n,onFilterByChange:i,showSocialActions:o=!1}=e,p=(0,m.useTranslations)("customer"),h=(0,m.useTranslations)("merchant"),j=(0,R.Y)();(0,B.al)();let[w,T]=(0,f.useState)("select"),[E,_]=(0,f.useState)("all"),C=null!=a?a:w,k=null!=n?n:E,H=G({enabled:"distance"===C}),W=(0,K.C)(e=>e.customerSettings),Y=null!=(t=null==W?void 0:W.favoriteMerchantIds)?t:[],V=s.map(e=>{var t,s;let{todaysCapacity:r,ordersLeft:a}=I.p.getOrdersLeft(e),l=(null==H?void 0:H.latitude)&&(null==H?void 0:H.longitude)&&e.latitude&&e.longitude?I.p.getDistance(H.latitude,H.longitude,e.latitude,e.longitude):1/0;return{id:e.id,merchantOrderType:e.merchantOrderType,weeklyCouponBuyCount:e.weeklyCouponBuyCount,merchantWeeklyCouponLimit:e.weeklyCouponLimit,stripeActive:"DINE_IN"!==e.merchantOrderType||e.stripeOnboarded,name:e.name,isMerchantSoldOut:r,ordersLeft:a,merchantBadges:null!=(t=e.merchantBadges)?t:null,rating:e.ratings.length>0?e.ratings.reduce((e,t)=>
1e+t.rating,0)/e.ratings.length:0,googleRating:null!=(s=e.googleRating)?s:null,firstTicketTitle:U(e.searchableTickets,j),otherOffersCount:P(e.searchableTickets),totalRatings:e.ratings.length,area:(0,D.oF)(e,e.merchantAreaEN,p("restaurants.multiple_locations")),discount:e.defaultDiscount,imageUrl:e.banners.length>0?e.banners[0].publicUrl:"",orderCount:e.orderCount,description:"en"===j?e.descriptionEN:e.descriptionFR,type:"en"===j?e.merchantTypeEN:e.merchantTypeFR,dishesWithCustomDiscount:e.dishesWithCustomDiscount,openingHours:e.merchantOpeningHours,displayOrder:e.displayOrder,isFavorite:Y.includes(e.id),distance:l}}),X=[..."all"===k?V:V.filter(e=>!!e.stripeActive&&("openToday"!==k||!!e.openingHours&&I.p.isMerchantOpenForGivenDay(e.openingHours,new Date)))].sort((e,t)=>{let s=!1===e.stripeActive&&!0===t.stripeActive?1:!0===e.stripeActive&&!1===t.stripeActive?-1:0;if(0!==s)return s;if(!e.stripeActive&&!t.stripeActive)return e.displayOrder-t.displayOrder;let r=0;switch(C){case"distance":r=e.distance===1/0?1:t.distance===1/0?-1:e.distance-t.distance;break;case"rating":r=((e,t)=>{var s,r,a,l;let n=null!=(a=null==(s=e.googleRating)?void 0:s.rating)?a:0;return(null!=(l=null==(r=t.googleRating)?void 0:r.rating)?l:0)-n})(e,t)}return 0===r?e.displayOrder-t.displayOrder:r}),J=(0,r.jsxs)("div",{className:"my-0 flex cursor-pointer items-center gap-2",onClick:()=>(0,f.startTransition)(()=>{let e="openToday"===k?"all":"openToday";i?i(e):_(e)}),children:[(0,r.jsx)(z.S,{checked:"openToday"===k}),(0,r.jsx)("span",{children:p("marketplace.filter.openToday")})]}),Q="all"!==k||"distance"!==C;function q(){i?i("all"):_("all"),l?l("distance"):T("select")}return(0,r.jsxs)("section",{className:"mx-auto pb-10 max-w-7xl px-4",children:[void 0===a&&void 0===n&&(0,r.jsxs)("div",{className:"mx-auto mb-2 flex max-w-2xl items-center justify-between gap-4 md:max-w-xl",children:[(0,r.jsx)("div",{className:"flex items-center gap-2",children:(0,r.jsxs)(x.l6,{value:C,onValueChange:e=>T(e),children:[(0,r.jsx)(x.bq,{className:"w-[140px]",children:(0,r.jsx)(x.yv,{placeholder:p("marketplace.sort.title")})}),(0,r.jsxs)(x.gC,{children:[(0,r.jsx)(x.eb,{value:"select",children:(0,r.jsxs)("span",{className:"inline-flex items-center gap-2",children:[(0,r.jsx)(c.A,{className:"size-3.5"}),p("marketplace.sort.select")]})}),(0,r.jsx)(x.eb,{value:"distance",children:(0,r.jsxs)("span",{className:"inline-flex items-center gap-2",children:[(0,r.jsx)(d.A,{className:"size-3.5"}),p("marketplace.sort.distance")]})}),(0,r.jsx)(x.eb,{value:"rating",children:(0,r.jsxs)("span",{className:"inline-flex items-center gap-2",children:[(0,r.jsx)(u.A,{className:"size-3.5"}),p("marketplace.sort.rating")]})})]})]})}),(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[J,Q&&(0,r.jsx)(F.$,{variant:"outline",size:"sm",onClick:q,children:p("marketplace.filters.clear")})]})]}),0===X.length?(0,r.jsxs)("div",{className:"mx-auto max-w-md py-8 text-center",children:[(0,r.jsx)("div",{className:"text-xl font-semibold",children:p("marketplace.empty_filters.title")}),(0,r.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:p("marketplace.empty_filters.description")}),Q&&(0,r.jsx)(F.$,{className:"mt-4",onClick:q,children:p("marketplace.filters.clear")})]}):(0,r.jsx)("div",{className:"my-4 grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-4",children:X.map((e,t)=>(0,r.jsxs)("div",{className:"group relative flex flex-col transition-transform sm:min-h-[280px] [@media(hover:hover)]:hover:-translate-y-0.5",children:[(0,r.jsxs)(O.N_,{href:M.bw.merchantPublic(e.id),className:"relative h-[160px] w-full cursor-pointer overflow-hidden rounded-2xl sm:h-[200px]",children:[e.imageUrl?(0,r.jsx)(g.default,{src:e.imageUrl,alt:e.name,className:"object-cover brightness-[0.9]",fill:!0,sizes:"(min-width: 1024px) 25vw, (min-width: 640px) 50vw, 100vw",priority:t<4,placeholder:"blur",blurDataURL:function(e,t){let s='<svg width="'.concat(24,'" height="').concat(16,'" viewBox="0 0 ').concat(e," ").concat(t,'" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none">\n <style>\n .bg { fill: #f3f4f6; }\n .stop1 { stop-color: #f3f4f6; }\n .stop2 { stop-color: #e5e7eb; }\n @media (prefers-color-scheme: dark) {\n .bg { fill: #1f2937; }\n .stop1 { stop-color: #1f2937; }\n .stop2 { stop-color: #374151; }\n }\n </style>\n <defs>\n <linearGradient id="g">\n <stop class="stop1" offset="20%"/>\n <stop class="stop2" offset="50%"/>\n <stop class="stop1" offset="70%"/>\n </linearGradient>\n </defs>\n <rect width="').concat(e,'" height="').concat(t,'" class="bg"/>\n <rect id="r" width="').concat(e,'" height="').concat(t,'" fill="url(#g)"/>\n <animate xlink:href="#r" attributeName="x" from="-').concat(e,'" to="').concat(e,'" dur="1s" repeatCount="indef
1inite"/>\n </svg>');return"data:image/svg+xml;base64,".concat(window.btoa(s))}(24,16)}):(0,r.jsx)("div",{className:"flex size-full items-center justify-center bg-muted"}),(0,r.jsxs)("div",{className:"absolute left-2 top-2 z-10 flex flex-col items-start gap-1",children:[e.discount>0&&(0,r.jsx)("div",{className:"inline-flex items-center gap-1 rounded-md bg-spectraGold/85 px-2.5 py-0.5 text-xs font-semibold text-white shadow-sm",children:(0,r.jsx)("span",{children:h("marketplace.discount_only",{discount:e.discount})})}),e.merchantBadges&&e.merchantBadges.length>0?(0,r.jsx)(S,{badges:e.merchantBadges}):"number"==typeof e.ordersLeft&&e.ordersLeft>=0&&e.ordersLeft<11?(0,r.jsxs)(b.E,{variant:"destructive",className:(0,A.cn)("shadow-sm inline-flex items-center gap-1",0===e.ordersLeft?"bg-destructive/70 hover:bg-destructive/70":"bg-[#CC5500]/70 hover:bg-orange/70"),children:[0===e.ordersLeft?(0,r.jsx)(v.A,{className:"h-3.5 w-3.5","aria-hidden":"true"}):(0,r.jsx)(y.A,{className:"h-3.5 w-3.5","aria-hidden":"true"}),(0,r.jsx)("span",{children:h("marketplace.only_x_left",{count:Math.max(0,e.ordersLeft)})})]}):null]}),!e.stripeActive&&(0,r.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:(0,r.jsx)("div",{className:"text-xl font-semibold text-white",children:h("marketplace.coming_soon")})})]}),(0,r.jsxs)("div",{className:"flex flex-col pt-2",children:[(0,r.jsxs)(O.N_,{href:M.bw.merchantPublic(e.id),className:"cursor-pointer",children:[(0,r.jsx)("div",{className:"flex items-center justify-between gap-2",children:(0,r.jsx)("h3",{className:"truncate text-lg font-semibold",children:e.name})}),(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[e.firstTicketTitle&&(0,r.jsxs)("div",{className:"flex items-center gap-1.5 mt-[-2px]",children:[(0,r.jsx)("p",{className:"min-w-0 truncate text-sm font-medium text-spectraGold",children:e.firstTicketTitle}),e.otherOffersCount>0&&(0,r.jsxs)("span",{className:"inline-flex shrink-0 items-center gap-0.5 text-sm font-medium text-spectraGold/80",children:[h("marketplace.more_offers",{count:e.otherOffersCount}),(0,r.jsx)(N.A,{className:"size-3.5 text-spectraGold/80","aria-hidden":"true"})]})]}),e.distance!==1/0&&(0,r.jsx)("span",{className:"text-xs font-semibold",children:(0,A.B)(e.distance)})]}),(0,r.jsxs)("p",{className:"mt-1 truncate text-xs text-muted-foreground",children:[e.type," \xb7 ",e.area]})]}),o&&(0,r.jsx)(L.o,{className:"mt-3",target:{merchantId:e.id,restaurantName:e.name,imageUrl:e.imageUrl||null}})]})]},e.id))})]})}var W=s(965142),Y=s(134357),V=s(237911),X=s(906191),J=s(776561),Q=s(265229),q=s(131039);function Z(e){var t;let{merchant:s,onClose:a,showSocialActions:l=!1}=e;(0,m.useTranslations)("customer");let n=(0,m.useTranslations)("merchant"),i=(0,m.useLocale)();return(0,r.jsx)("div",{className:"absolute bottom-4 left-4 right-4 z-50 mx-auto max-w-md animate-in fade-in slide-in-from-bottom-4 duration-300",children:(0,r.jsxs)("div",{className:"overflow-hidden rounded-xl bg-card shadow-xl ring-1 ring-border",children:[(0,r.jsx)("button",{onClick:e=>{e.preventDefault(),e.stopPropagation(),a()},className:"absolute right-2 top-2 z-50 flex size-8 items-center justify-center rounded-full bg-background/90 shadow-sm transition-colors hover:bg-background","aria-label":"Close",children:(0,r.jsx)(Q.A,{className:"size-4 text-muted-foreground"})}),(0,r.jsxs)(O.N_,{href:M.bw.merchantPublic(s.id),className:"block",children:[(0,r.jsxs)("div",{className:"relative h-32 w-full",children:[s.imageUrl?(0,r.jsx)(g.default,{src:s.imageUrl,alt:s.name,className:"object-cover",fill:!0,sizes:"(max-width: 448px) 100vw, 448px"}):(0,r.jsx)("div",{className:"flex size-full items-center justify-center bg-muted"}),s.discount>0&&(0,r.jsx)("div",{className:"absolute left-2 top-2 z-40 inline-flex items-center gap-1 rounded-md bg-spectraGold/85 px-2.5 py-0.5 text-xs font-semibold text-white shadow-sm",children:(0,r.jsx)("span",{children:n("marketplace.discount_only",{discount:s.discount})})}),!s.stripeActive&&(0,r.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-black/40 backdrop-blur-sm",children:(0,r.jsx)("span",{className:"text-lg font-semibold text-white",children:n("marketplace.coming_soon")})}),s.isMerchantSoldOut&&s.stripeActive&&(0,r.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-black/40 backdrop-blur-sm",children:[(0,r.jsx)("span",{className:"text-lg font-semibold text-white",children:"SOLD"}),(0,r.jsx)("span",{className:"text-lg font-semibold text-white",children:"OUT"})]})]}),(0,r.jsxs)("div",{className:"p-4",children:[(0,r.jsx)("div",{className:"flex items-center justify-between gap-2",children:(0,r.jsx)("h3",{className:"truncate text-lg font-bold",children:s.name})}),s.googleRating&&null!==s.googleRating.rating&&(0,r.jsx)("div",{className:"mt-1",children:(0,r.jsx)(q.E,{rating:s.googleRating.rating,reviewCount:null!=(t=s.googleRating.userRatingsTotal)?t:0,size:"sm",showLabel:!1})}),(0,r.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:s.type}),s.previewDishes&&s.previewDishes.length>0&&(0,r.jsx)("div",{className:"mt-3 flex flex-col gap-1.5",children:s.previewDishes.map((e,t)=>(0,r.jsx)("div",{className:"flex items-center gap-2 rounded-md border border-emerald-100 dark:border-emerald-900 bg-background px-2 py-1.5 shadow-sm",children:(0,r.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"en"===i?e.nameEN:e.nameFR})},t))})]})]}),l&&(0,r.jsx)("div",{className:"px-4 pb-4",children:(0,r.jsx)(L.o,{target:{merchantId:s.id,restaurantName:s.name,imageUrl:s.imageUrl||null}})})]})})}var $=s(112861);let ee=[{elementType:"geometry",stylers:[{color:"#1f1f23"}]},{elementType:"labels.text.stroke",stylers:[{color:"#1f1f23"}]},{elementType:"labels.text.fill",stylers:[{color:"#9ca3af"}]},{elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"poi",stylers:[{visibility:"off"}]},{featureType:"transit",stylers:[{visibility:"off"}]},{featureType:"administrative",elementType:"geometry",stylers:[{color:"#2a2a30"}]},{featureType:"administrative.country",elementType:"labels.text.fill",stylers:[{color:"#c0c4cc"}]},{featureType:"administrative.locality",elementType:"labels.text.fill",stylers:[{color:"#d4d4d8"}]},{featureType:"administrative.neighborhood",elementType:"labels.text.fill",stylers:[{color:"#a1a1aa"}]},{featureType:"road",elementType:"geometry",stylers:[{color:"#2c2c33"}]},{featureType:"road",elementType:"geometry.stroke",stylers:[{color:"#1a1a1f"}]},{featureType:"road",elementType:"labels.text.fill",stylers:[{color:"#8b8b93"}]},{featureType:"road.highway",elementType:"geometry",stylers:[{color:"#3a3a42"}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#1a1a1f"}]},{featureType:"road.highway",elementType:"labels.text.fill",stylers:[{color:"#d4d4d8"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#15151a"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#4b5563"}]},{featureType:"landscape",elementType:"geometry",stylers:[{color:"#1f1f23"}]}],et={lat:45.5019,lng:-73.5674},es=(0,f.memo)(e=>{let t,{imageUrl:s,name:a,isActive:l=!0,isMerchantSoldOut:n=!1,isBeauty:i=!1,hasAdditionalOffers:o=!1,isAtTruePosition:c=!0,isSelected:d=!1,markerTier:u="partner"}=e,m="top"===u?32:38;return t="top"===u?d?"#94a3b8":"#cbd5e1":n?"#6b7280":i?d?"#db2777":"#ec4899":l?d?"#b8860b":"#daa520":"#6b7280",(0,r.jsxs)("div",{className:(0,A.cn)("relative flex flex-col items-center",d&&"animate-bounce"),style:{width:m,height:m+8},children:[(0,r.jsx)("div",{className:"absolute bottom-0",style:{width:0,height:0,borderLeftWidth:.18*m,borderRightWidth:.18*m,borderTopWidth:.24*m,borderLeftColor:"transparent",borderRightColor:"transparent",borderTopColor:c?t:"transparent"}}),(0,r.jsxs)("div",{className:"relative overflow-hidden",style:{width:m,height:m,borderRadius:m/2,borderWidth:d?3:2,borderStyle:"solid",borderColor:t,backgroundColor:"#d1cab4",boxShadow:"0 2px 4px rgba(0,0,0,0.15)"},children:[(0,r.jsx)("img",{src:s||"/logo.png",alt:"",className:"absolute inset-0 size-full object-cover"}),!l&&(0,r.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-muted/60",children:(0,r.jsx)("span",{className:"text-[8px] font-bold text-white",children:"SOON"})}),n&&(0,r.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-muted/60",children:[(0,r.jsx)("span",{className:"text-[8px] font-bold text-white",children:"SOLD"}),(0,r.jsx)("span",{className:"-mt-1 text-[8px] font-bold text-white",children:"OUT"})]})]}),o&&!n&&(0,r.jsx)("div",{className:"absolute -right-0.5 -top-0.5 flex items-center justify-center rounded-full bg-emerald-500",style:{width:14,height:14,borderWidth:1.5,borderColor:"#14532d"},children:(0,r.jsx)(X.A,{className:"text-white"})}),a&&(0,r.jsx)("div",{className:"pointer-events-none absolute left-1/2 top-full -translate-x-1/2 whitespace-nowrap",style:{marginTop:2},children:(0,r.jsx)("span",{className:(0,A.cn)("rounded px-1 py-px text-[10px] font-semibold leading-tight text-slate-900","bg-white/90 shadow-sm ring-1 ring-black/5 backdrop-blur-sm"),style:{textShadow:"0 1px 2px rgba(255,255,255,0.6)"},children:a})})]})});function er(e){let{position:t}=e;return(0,r.jsx)(V.J8,{position:t,zIndex:9999,children:(0,r.jsx)("div",{className:"flex items-center justify-center",style:{width:28,height:28},children:(0,r.jsx)("div",{className:"flex items-center justify-center rounded-full",style:{width:28,height:28,backgroundColor:"rgba(37, 99, 235, 0.18)"},children:(0,r.jsx)("div",{className:"flex items-center justify-center rounded-full bg-background",style:{width:16,height:16},children:(0,r.jsx)("div",{className:"rounded-full bg-blue-600",style:{width:9,height:9}})})})})})}function ea(e){let{onRecenter:t,disabled:s}=e;return(0,r.jsx)("div",{className:"absolute top-4 right-4 z-40",children:(0,r.jsx)("button",{onClick:t,disabled:s,className:(0,A.cn)("flex size-12 items-center justify-center rounded-full bg-background/70 shadow-lg ring-1 ring-border backdrop-blur-sm transition-all hover:bg-background",s&&"cursor-not-allowed opacity-50"),"aria-label":"Center on my location",children:(0,r.jsx)(J.A,{className:"size-5 text-muted-foreground"})})})}function el(e){let{merchants:t,vendorType:s,selectedMarkerKey:a,setSelectedMarkerKey:l,userPosition:n,showSocialActions:i=!1}=e,o=(0,V.ko)(),{appUser:d}=(0,B.Km)({required:!1}),{data:u}=(0,$.tK)(!!d&&"RESTAURANT"===s),[m,p]=(0,f.useState)(null);(0,f.useEffect)(()=>
1{if(!o)return;let e=o.addListener("idle",()=>{let e=o.getBounds();if(e){let t=e.getNorthEast(),s=e.getSouthWest();p({north:t.lat(),south:s.lat(),east:t.lng(),west:s.lng()})}});return()=>{google.maps.event.removeListener(e)}},[o]);let h=(0,f.useMemo)(()=>t.filter(e=>"number"==typeof e.latitude&&"number"==typeof e.longitude),[t]),g=(0,f.useMemo)(()=>(function(e,t,s){if(!e.length||!t||!s)return e;let r=t.north-t.south;t.east,t.west;let a=(t.north+t.south)/2,l=[],n=500/(111e3*(Math.cos((null!=a?a:0)*Math.PI/180)||1)),i=new Map,o=e=>{let{__offsetApplied:t,...s}=e;l.push({...s,__offsetApplied:!1})};e.forEach(e=>{if("number"!=typeof e.latitude||"number"!=typeof e.longitude)return void o(e);let t=!0===e.isMerchantSoldOut,s=!1===e.stripeActive&&!t;if(t||s)return void o(e);let r=Math.floor(e.latitude/.0045045045045045045),a=Math.floor(e.longitude/n),l="".concat(r,":").concat(a),c=i.get(l);c?c.push(e):i.set(l,[e])});let c=r/700*4884e3,d=(r-.02)/.38;return d<0&&(d=0),d>1&&(d=1),i.forEach(e=>{var t;if(1===e.length||0===d)return void e.forEach(e=>{o(e)});let s=[...e].sort((e,t)=>{var s,r,a,l,n,i;let o=null!=(s=e.longitude)?s:0,c=null!=(r=t.longitude)?r:0;if(o!==c)return o-c;let d=String(null!=(l=null!=(a=e.mapKey)?a:e.id)?l:""),u=String(null!=(i=null!=(n=t.mapKey)?n:t.id)?i:"");return d.localeCompare(u)}),r=s.length,a=Math.cos((s.reduce((e,t)=>{var s;return e+(null!=(s=t.latitude)?s:0)},0)/r||0)*Math.PI/180)||1,n=e=>e/(111e3*a),i=null!=(t=s[0].longitude)?t:0,u=s.map(e=>{var t;return 111e3*((null!=(t=e.longitude)?t:0)-i)*a}),m=c*d;if(m<=0)return void s.forEach(e=>o(e));let p=1/0;for(let e=0;e<r-1;e+=1){let t=u[e+1]-u[e];t<p&&(p=t)}if(!Number.isFinite(p)||p>=m)return void s.forEach(e=>o(e));let f=[];f[0]=u[0];for(let e=1;e<r;e+=1){let t=f[e-1]+m;f[e]=Math.max(u[e],t)}let h=0;for(let e=0;e<r;e+=1){let t=Math.abs(f[e]-u[e]);t>h&&(h=t)}let g=h>800&&h>0?800/h:1;for(let e=0;e<r;e+=1){let t=s[e];if("number"!=typeof t.latitude||"number"!=typeof t.longitude){o(t);continue}let r=i+n(u[e]+(f[e]-u[e])*g);l.push({...t,latitude:t.latitude,longitude:r,__offsetApplied:!0})}}),l})(h,m,!0),[h,m]),x=(0,f.useCallback)(()=>{o&&n&&(o.panTo(n),o.setZoom(14))},[o,n]);(0,f.useEffect)(()=>{if(!o||!a)return;let e=g.find(e=>{var t;return(null!=(t=e.mapKey)?t:e.id)===a});e&&"number"==typeof e.latitude&&"number"==typeof e.longitude&&o.panTo({lat:e.latitude,lng:e.longitude})},[o,a,g]);let b=(0,f.useMemo)(()=>{var e;return null!=(e=g.find(e=>{var t;return(null!=(t=e.mapKey)?t:e.id)===a}))?e:null},[g,a]),v=(0,f.useMemo)(()=>{var e;return new Set((null!=(e=null==u?void 0:u.journalEntries)?e:[]).map(e=>e.locationKey))},[null==u?void 0:u.journalEntries]),y=(0,f.useMemo)(()=>0===v.size?[]:g.filter(e=>v.has("merchant:".concat(e.id))).map(e=>{var t;return{key:"visited-merchant-".concat(null!=(t=e.mapKey)?t:e.id),latitude:e.latitude,longitude:e.longitude}}),[g,v]);return(0,r.jsxs)(r.Fragment,{children:[n&&(0,r.jsx)(er,{position:n}),g.map(e=>{var t;let n=null!=(t=e.mapKey)?t:e.id,i=n===a,o=!e.__offsetApplied,c=10;if(e.stripeActive)if(e.isMerchantSoldOut)c="BEAUTY"===s?12:11;else{let t=(e.dishesWithCustomDiscount||0)>1,r="BEAUTY"===s?15:14;c=t?r+2:r}return(0,r.jsx)(V.J8,{position:{lat:e.latitude,lng:e.longitude},zIndex:i?30:c,onClick:()=>l(n),className:(0,A.cn)(i?"z-[30]":""),children:(0,r.jsx)(es,{imageUrl:e.imageUrl,name:e.name,isActive:e.stripeActive,isMerchantSoldOut:e.isMerchantSoldOut,isBeauty:"BEAUTY"===s,hasAdditionalOffers:e.dishesWithCustomDiscount>1,isAtTruePosition:o,isSelected:i,markerTier:"partner"})},n)}),y.map(e=>(0,r.jsx)(V.J8,{position:{lat:e.latitude,lng:e.longitude},zIndex:45,className:"pointer-events-none",children:(0,r.jsx)("div",{className:"flex size-5 items-center justify-center rounded-full border-2 border-background bg-emerald-500 text-white shadow-md",children:(0,r.jsx)(c.A,{className:"size-3"})})},e.key)),(0,r.jsx)(ea,{onRecenter:x,disabled:!n}),b&&(0,r.jsx)(Z,{merchant:b,onClose:()=>l(null),showSocialActions:i})]})}es.displayName="CustomMarkerContent";let en=(0,f.memo)(function(e){let{merchants:t,vendorType:s,showSocialActions:a=!1}=e,[l,n]=(0,f.useState)(null),i=G({enabled:!0}),o=(0,f.useMemo)(()=>(null==i?void 0:i.latitude)&&(null==i?void 0:i.longitude)?{lat:i.latitude,lng:i.longitude}:null,[null==i?void 0:i.latitude,null==i?void 0:i.longitude]),c="AIzaSyCOTLZctbIxD1pmjLk6mUuWNuIe3bgrpfc",d=(0,f.useCallback)(()=>n(null),[]);return c?(0,r.jsx)("div",{className:"relative h-[2000px] max-h-[80vh] w-full overflow-hidden rounded-lg",children:(0,r.jsx)(V.c4,{apiKey:c,children:(0,r.jsx)(V.T5,{defaultCenter:et,defaultZoom:13,mapId:"spectra-explore-map",colorScheme:"DARK",gestureHandling:"greedy",disableDefaultUI:!0,zoomControl:!0,mapTypeControl:!1,streetViewControl:!1,fullscreenControl:!1,scaleControl:!1,rotateControl:!0,styles:ee,clickableIcons:!1,onClick:d,className:"size-full",children:(0,r.jsx)(el,{merchants:t,vendorType:s,selectedMarkerKey:l,setSelectedMarkerKey:n,userPosition:o,showSocialActions:a})},"google-map")})}):(0,r.jsx)("div",{className:"flex h-[600px] items-center justify-center bg-muted",children:(0,r.jsx)("p",{className:"text-muted-foreground",children:"Map unavailable - API key not configured"})})});var ei=s(426333),eo=s(50909),ec=s(627937),ed=s(35626),eu=s(552987),em=s(918174);let ep=function(e,t){let s='<svg width="'.concat(24,'" height="').concat(16,'" viewBox="0 0 ').concat(24," ").concat(16,'" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none">\n <style>\n .bg { fill: #f3f4f6; }\n .stop1 { stop-color: #f3f4f6; }\n .stop2 { stop-color: #e5e7eb; }\n @media (prefers-color-scheme: dark) {\n .bg { fill: #1f2937; }\n .stop1 { stop-color: #1f2937; }\n .stop2 { stop-color: #374151; }\n }\n </style>\n <defs>\n <linearGradient id="g">\n <stop class="stop1" offset="20%"/>\n <stop class="stop2" offset="50%"/>\n <stop class="stop1" offset="70%"/>\n </linearGradient>\n </defs>\n <rect width="').concat(e,'" height="').concat(t,'" class="bg"/>\n <rect id="r" width="').concat(e,'" height="').concat(t,'" fill="url(#g)"/>\n <animate xlink:href="#r" attributeName="x" from="-').concat(e,'" to="').concat(e,'" dur="1s" repeatCount="indef
1inite"/>\n </svg>');return"data:image/svg+xml;base64,".concat(window.btoa(s))}(24,16);function ef(e){return null!=e&&"string"==typeof e.id&&"string"==typeof e.name}let eh=(0,f.memo)(function(e){var t;let{merchant:s,imagePriority:a}=e,l=(0,m.useTranslations)("merchant"),n="number"==typeof s.ordersLeft&&s.ordersLeft>=0&&s.ordersLeft<11;return(0,r.jsx)(O.N_,{href:M.bw.merchantPublic(s.id),className:"block h-full",children:(0,r.jsxs)("div",{className:(0,A.cn)("group relative flex flex-col transition-transform [@media(hover:hover)]:hover:-translate-y-0.5",em.G?"h-[240px]":"h-[200px]"),children:[(0,r.jsxs)("div",{className:"relative h-[130px] w-full shrink-0 overflow-hidden rounded-xl",children:[s.imageUrl?(0,r.jsx)(g.default,{src:s.imageUrl,alt:s.name,className:"object-cover",fill:!0,sizes:"260px",priority:a,placeholder:"blur",blurDataURL:ep}):(0,r.jsx)("div",{className:"flex size-full items-center justify-center bg-muted"}),(0,r.jsxs)("div",{className:"absolute left-2 right-2 top-2 z-10 flex flex-col items-start gap-1",children:[s.merchantBadges&&s.merchantBadges.length>0?(0,r.jsx)(S,{badges:s.merchantBadges}):n?(0,r.jsxs)("div",{className:(0,A.cn)("inline-flex max-w-full items-center gap-1 rounded px-2 py-1 text-xs font-bold",0===s.ordersLeft?"bg-red-600/70 text-white":"COUPONS"===s.merchantOrderType?"bg-spectraGold/85 text-black":"bg-red-600/70 text-white"),children:[0===s.ordersLeft?(0,r.jsx)(v.A,{className:"size-3 shrink-0","aria-hidden":"true"}):(0,r.jsx)(y.A,{className:"size-3 shrink-0","aria-hidden":"true"}),(0,r.jsx)("span",{className:"truncate",children:l("marketplace.only_x_left",{count:Math.max(0,null!=(t=s.ordersLeft)?t:0)})})]}):null,s.discount>0&&(0,r.jsx)("div",{className:"inline-flex max-w-full items-center gap-1 rounded bg-spectraGold/85 px-2 py-1 text-xs font-bold text-white",children:(0,r.jsx)("span",{className:"truncate",children:l("marketplace.discount_only",{discount:s.discount})})})]}),!s.stripeActive&&(0,r.jsx)("div",{className:"absolute inset-0 z-20 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:(0,r.jsx)("div",{className:"text-sm font-semibold text-white",children:l("marketplace.coming_soon")})})]}),(0,r.jsxs)("div",{className:"flex flex-col pt-2",children:[(0,r.jsx)("h3",{className:"mb-1 truncate text-sm font-bold",children:s.name}),s.firstTicketTitle&&(0,r.jsxs)("div",{className:"mt-[-2px] flex items-center gap-1",children:[(0,r.jsx)("p",{className:"min-w-0 truncate text-sm font-medium text-spectraGold",children:s.firstTicketTitle}),s.otherOffersCount>0&&(0,r.jsx)("span",{className:"shrink-0 text-sm font-medium text-spectraGold/80",children:l("marketplace.more_offers",{count:s.otherOffersCount})})]}),(0,r.jsxs)("p",{className:"mt-1 truncate text-xs text-muted-foreground",children:[s.type," \xb7 ",s.area]}),em.G&&(0,r.jsx)(L.o,{className:"mt-1",target:{merchantId:s.id,restaurantName:s.name,imageUrl:s.imageUrl||null}})]})]})})});function eg(e){let{title:t,merchants:s,viewAllHref:a,priorityImages:l=!1}=e,n=(0,m.useTranslations)("customer"),i=(0,R.Y)(),o=n("restaurants.multiple_locations"),c=(0,f.useRef)(null),[d,u]=(0,f.useState)(!1),[p,h]=(0,f.useState)(!1),g=(0,f.useRef)(null),x=(0,f.useRef)(null),b=(0,f.useRef)(!1),v=(0,f.useCallback)(()=>{null!==x.current&&(cancelAnimationFrame(x.current),x.current=null)},[]),y=(0,f.useCallback)(e=>{let t=c.current;if(!t||.02>Math.abs(e))return;v();let s=e,r=performance.now(),a=e=>{let l=Math.min(e-r,64);r=e,t.scrollLeft+=s*l,s*=Math.pow(.998,l);let n=t.scrollLeft<=0,i=t.scrollLeft>=t.scrollWidth-t.clientWidth-1;if(.02>Math.abs(s)||s<0&&n||s>0&&i){x.current=null;return}x.current=requestAnimationFrame(a)};x.current=requestAnimationFrame(a)},[v]);(0,f.useEffect)(()=>{let e=c.current;if(!e)return;let t=()=>{u(e.scrollLeft>1),h(e.scrollLeft<e.scrollWidth-e.clientWidth-1)};t(),e.addEventListener("scroll",t,{passive:!0});let s=new ResizeObserver(t);return s.observe(e),()=>{e.removeEventListener("scroll",t),s.disconnect(),v()}},[v]);let N=(0,f.useCallback)(e=>{if(v(),"mouse"!==e.pointerType||0!==e.button)return;let t=c.current;t&&(g.current={pointerId:e.pointerId,startX:e.clientX,startScrollLeft:t.scrollLeft,lastX:e.clientX,lastTime:performance.now(),velocity:0,dragged:!1},t.setPointerCapture(e.pointerId))},[v]),j=(0,f.useCallback)(e=>{let t=g.current,s=c.current;if(!t||!s||e.pointerId!==t.pointerId)return;let r=performance.now(),a=r-t.lastTime,l=a>0?-(e.clientX-t.lastX)/a:t.velocity;t.velocity=.8*l+.2*t.velocity,t.lastX=e.clientX,t.lastTime=r,Math.abs(e.clientX-t.startX)>5&&(t.dragged=!0),s.scrollLeft=t.startScrollLeft-(e.clientX-t.startX)},[]),w=(0,f.useCallback)(e=>{var t;let s=g.current;s&&e.pointerId===s.pointerId&&(g.current=null,null==(t=c.current)||t.releasePointerCapture(e.pointerId),s.dragged&&(b.current=!0,setTimeout(()=>{b.current=!1},0),"pointercancel"!==e.type&&y(s.velocity)))},[y]),T=(0,f.useCallback)(e=>{b.current&&(e.preventDefault(),e.stopPropagation(),b.current=!1)},[]),E=(0,f.useCallback)(e=>{let t=c.current;t&&t.scrollBy({left:e*t.clientWidth*.8,behavior:"smooth"})},[]),_=(0,f.useMemo)(()=>(Array.isArray(s)?s.filter(ef):[]).map(e=>{var t,s,r,a,l,n,c;let{todaysCapacity:d,ordersLeft:u}=I.p.getOrdersLeft(e),m=null!=(s=e.banners)?s:[];return{id:e.id,name:e.name,merchantOrderType:e.merchantOrderType,stripeActive:"DINE_IN"!==e.merchantOrderType||e.stripeOnboarded,isMerchantSoldOut:d,ordersLeft:u,merchantBadges:null!=(r=e.merchantBadges)?r:null,firstTicketTitle:U(e.searchableTickets,i),otherOffersCount:P(e.searchableTickets),area:(0,D.oF)(e,null!=(a=e.merchantAreaEN)?a:"",o),discount:null!=(l=e.defaultDiscount)?l:0,imageUrl:m.length>0&&(null==(t=m[0])?void 0:t.publicUrl)?m[0].publicUrl:"",type:null!=(n="en"===i?e.merchantTypeEN:e.merchantTypeFR)?n:"",dishesWithCustomDiscount:null!=(c=e.dishesWithCustomDiscount)?c:0}}),[s,i,o]);return 0===_.length?null:(0,r.jsxs)("section",{className:"mb-8 border-b border-border",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,r.jsx)("h2",{className:"text-xl font-bold",children:t}),a&&(0,r.jsxs)(O.N_,{href:a,className:"flex items-center gap-1 text-sm text-primary hover:underline",children:[n("marketplace.viewAll"),(0,r.jsx)(ec.A,{className:"size-4"})]})]}),(0,r.jsxs)("div",{className:"relative",role:"region","aria-roledescription":"carousel","aria-label":t,children:[(0,r.jsx)("div",{ref:c,className:"flex select-none gap-3 overflow-x-auto overscroll-x-contain py-2 [
1-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",onPointerDown:N,onPointerMove:j,onPointerUp:w,onPointerCancel:w,onWheel:v,onClickCapture:T,onDragStart:e=>e.preventDefault(),children:_.map((e,t)=>(0,r.jsx)("div",{role:"group","aria-roledescription":"slide",className:(0,A.cn)("w-[260px] shrink-0 [content-visibility:auto]",em.G?"[contain-intrinsic-size:260px_240px]":"[contain-intrinsic-size:260px_200px]"),children:(0,r.jsx)(eh,{merchant:e,imagePriority:l&&t<4})},e.id))}),(0,r.jsxs)(F.$,{variant:"outline",size:"icon",className:"absolute -left-4 top-1/2 hidden size-8 -translate-y-1/2 rounded-full sm:inline-flex",disabled:!d,onClick:()=>E(-1),children:[(0,r.jsx)(ed.A,{className:"size-4"}),(0,r.jsx)("span",{className:"sr-only",children:"Previous slide"})]}),(0,r.jsxs)(F.$,{variant:"outline",size:"icon",className:"absolute -right-4 top-1/2 hidden size-8 -translate-y-1/2 rounded-full sm:inline-flex",disabled:!p,onClick:()=>E(1),children:[(0,r.jsx)(eu.A,{className:"size-4"}),(0,r.jsx)("span",{className:"sr-only",children:"Next slide"})]})]})]})}var ex=s(320508),eb=s(352619),ev=s.n(eb);function ey(e){let{users:t}=e,s=(0,m.useLocale)();return 0===t.length?null:(0,r.jsxs)("section",{className:"mx-auto max-w-4xl px-4 py-4",children:[(0,r.jsx)("div",{className:"mb-3 text-sm font-semibold uppercase tracking-wide text-muted-foreground",children:"Users"}),(0,r.jsx)("div",{className:"grid gap-3",children:t.map(e=>(0,r.jsxs)(ev(),{href:"/".concat(s,"/profile/").concat(e.handle),className:"flex items-center gap-3 rounded-xl border bg-card p-4 transition-colors hover:bg-muted/40",children:[e.avatarUrl?(0,r.jsx)("img",{src:e.avatarUrl,alt:e.fullName,className:"size-12 rounded-full object-cover"}):(0,r.jsx)("div",{className:"flex size-12 items-center justify-center rounded-full bg-muted",children:(0,r.jsx)(ex.A,{className:"size-5 text-muted-foreground"})}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("div",{className:"truncate font-semibold",children:e.fullName}),(0,r.jsxs)("div",{className:"truncate text-sm text-muted-foreground",children:["@",e.handle]}),e.bio&&(0,r.jsx)("div",{className:"mt-1 line-clamp-1 text-sm text-muted-foreground",children:e.bio})]})]},e.id))})]})}var eN=s(731117),ej=s(460692);let ew=(0,h.v)(e=>({searchQuery:"",setSearchQuery:t=>e({searchQuery:t})})),eT="RESTAURANT";function eE(e){var t;let{merchants:s,carouselCategories:h=[]}=e,g=(0,m.useTranslations)("customer"),x=(0,p.useRouter)(),b=(0,p.usePathname)(),{appUser:v}=(0,B.Km)({required:!1}),{searchQuery:y,setSearchQuery:N}=ew(),j=(0,K.C)(e=>e.customerSettings),w=null!=(t=null==j?void 0:j.favoriteMerchantIds)?t:[],{recentlyViewedIds:T,hasRecentlyViewed:E,pruneStaleIds:_}=(0,eN.b)(),C=(0,p.useSearchParams)(),[k,S]=(0,f.useState)("select"),[R,O]=(0,f.useState)("all"),[M,I]=(0,f.useState)("map"===C.get("view")),[U,P]=(0,f.useState)("restaurants"),{users:L}=(0,ej.K)(y,{enabled:em.G&&!!v});(0,f.useEffect)(()=>{"map"===C.get("view")?I(!0):I(!1)},[C]);let G=(0,f.useMemo)(()=>E?T.map(e=>s.find(t=>t.id===e)).filter(e=>void 0!==e):[],[T,s,E]),V=(0,f.useMemo)(()=>{let e=e=>e.vendorType===eT,t=s.filter(e=>w.includes(e.id)).filter(e),r=h.some(e=>"FAVORITES"===e.type)?new Set(t.map(e=>e.id)):new Set;return h.map(s=>{let a;return"RECENTLY_VIEWED"===s.type?a=G.filter(e):"FAVORITES"===s.type?a=t:(s.type,a=s.merchants.filter(e)),"FAVORITES"!==s.type&&(a=a.filter(e=>!r.has(e.id))),{id:s.id,title:"FAVORITES"===s.type?g("marketplace.carousels.wantToGo"):s.name,merchants:a}}).filter(e=>e.merchants.length>0)},[h,G,s,w,g]);(0,f.useEffect)(()=>{_(new Set(s.map(e=>e.id)))},[s,_]);let X=!y&&!M,J=em.G&&y.trim().length>0&&!M,Q=(0,f.useMemo)(()=>s.filter(e=>e.vendorType===eT).map(e=>({...e,tagsString:(e.merchantTags||[]).map(e=>{var t;return(null==(t=e.tag)?void 0:t.id)||""}).filter(Boolean).join(" ")})),[s]),q=(0,f.useMemo)(()=>new a.A(Q,{threshold:.3,ignoreDiacritics:!0,includeScore:!0,keys:["name","merchantTypeEN","merchantTypeFR","merchantAreaEN","merchantAreaFR","descriptionEN","descriptionFR","tagsString"]}),[Q]),Z=(0,f.useMemo)(()=>y?function(e,t,s){let r=s.trim();if(!r)return t;let a=new Map,l=new Map,n=0;for(let t of e.search(r)){var i;
1a.set(t.item.id,{item:t.item,score:null!=(i=t.score)?i:1}),l.set(t.item.id,n++)}let o=r.toLocaleLowerCase();return t.forEach(e=>{var t,s;if(t=e,s=o,!(t.searchableTickets&&0!==s.length&&t.searchableTickets.some(e=>[e.nameEN,e.nameFR,e.descriptionEN,e.descriptionFR].some(e=>"string"==typeof e&&e.toLocaleLowerCase().includes(s)))))return;let r=a.get(e.id);if(r){r.score>.65&&a.set(e.id,{...r,score:.65});return}a.set(e.id,{item:e,score:.65}),l.set(e.id,n++)}),Array.from(a.values()).sort((e,t)=>{var s,r;let a=e.score-t.score;return 0!==a?a:(null!=(s=l.get(e.item.id))?s:0)-(null!=(r=l.get(t.item.id))?r:0)}).map(e=>e.item)}(q,Q,y):Q,[y,q,Q]);(0,f.useEffect)(()=>{window.scrollTo(0,0)},[]);let $=(0,f.useMemo)(()=>Z.flatMap(e=>{let t=(0,D.lg)(e),s=t.filter(e=>"number"==typeof e.latitude&&"number"==typeof e.longitude);return(s.length>0?s:t.slice(0,1)).map((t,s)=>{var r,a,l,n,i,o,c,d,u;return{...e,mapKey:"".concat(e.id,"::").concat(s),type:null!=(l=e.merchantTypeEN)?l:"",isMerchantSoldOut:!1,discount:null!=(n=e.defaultDiscount)?n:0,imageUrl:null!=(i=null==(a=e.banners)||null==(r=a[0])?void 0:r.publicUrl)?i:"",latitude:null!=(c=null!=(o=t.latitude)?o:e.latitude)?c:0,longitude:null!=(u=null!=(d=t.longitude)?d:e.longitude)?u:0,stripeActive:"DINE_IN"!==e.merchantOrderType||e.stripeOnboarded,isFavorite:w.includes(e.id),markerTier:"partner"}})}),[Z,w]),ee=(0,Y.YQ)((e,t)=>{e.trim()&&fetch("/api/analytics/search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:e,source:"WEB",resultsCount:t})})},2e3);return(0,f.useEffect)(()=>{ee(y,Z.length)},[y,ee]),(0,r.jsxs)("main",{className:"relative min-h-screen px-1",children:[(0,r.jsx)("div",{className:(0,A.cn)("sticky top-[55px] md:top-16 z-20 mt-0 animate-fade-up opacity-0 [animation-delay:50ms] [animation-fill-mode:forwards]"),children:(0,r.jsxs)("div",{className:"mx-auto mb-2 max-w-xl",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[!v&&(0,r.jsx)(F.$,{variant:"outline",size:"icon",onClick:()=>{let e=new URLSearchParams(C.toString());M?e.delete("view"):e.set("view","map");let t=e.toString();x.replace(t?"".concat(b,"?").concat(t):b,{scroll:!1})},className:(0,A.cn)("size-12 shrink-0 rounded-lg border-1 border-border bg-muted shadow-md hover:bg-muted",M&&"bg-muted ring-2 ring-border"),children:M?(0,r.jsx)(l.A,{className:"size-5"}):(0,r.jsx)(n.A,{className:"size-5"})}),(0,r.jsxs)("div",{className:"relative flex-1 h-12 rounded-lg bg-gradient-to-br from-gray-200/90 to-gray-100 dark:from-muted dark:to-muted backdrop-blur-xl",children:[(0,r.jsx)(i.A,{className:"absolute left-2 top-1/2 size-5 -translate-y-1/2 text-muted-foreground"}),(0,r.jsx)(W.p,{placeholder:g("marketplace.search.placeholder_restaurant"),spellCheck:!1,autoComplete:"off",className:"shadow-md font-bold h-full w-full rounded-lg border-0 px-4 pl-8 text-muted-foreground focus:border-transparent focus:outline-none focus:ring-2 focus:ring-primary",value:y,onChange:e=>N(e.target.value)}),(0,r.jsx)("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 flex items-center gap-2",children:(0,r.jsxs)(ei.AM,{children:[(0,r.jsx)(ei.Wv,{asChild:!0,children:(0,r.jsx)("button",{"aria-label":g("marketplace.sort.title"),className:"p-1 rounded-md hover:bg-muted text-muted-foreground",children:(0,r.jsx)(o.A,{className:"size-5"})})}),(0,r.jsx)(ei.hl,{align:"end",className:"w-72",children:(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)("div",{className:"text-sm font-medium",children:g("marketplace.sort.title")}),(0,r.jsxs)(eo.z,{value:k,onValueChange:e=>S(e),children:[(0,r.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,r.jsx)(eo.C,{value:"select"}),(0,r.jsxs)("span",{className:"inline-flex items-center gap-2",children:[(0,r.jsx)(c.A,{className:"size-3.5"}),g("marketplace.sort.select")]})]}),(0,r.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,r.jsx)(eo.C,{value:"distance"}),(0,r.jsxs)("span",{className:"inline-flex items-center gap-2",children:[(0,r.jsx)(d.A,{className:"size-3.5"}),g("marketplace.sort.distance")]})]}),(0,r.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,r.jsx)(eo.C,{value:"rating"}),(0,r.jsxs)("span",{className:"inline-flex items-center gap-2",children:[(0,r.jsx)(u.A,{className:"size-3.5"}),g("marketplace.sort.rating")]})]})]}),(0,r.jsx)("div",{className:"h-px bg-border my-2"}),(0,r.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,r.jsx)(z.S,{checked:"openToday"===R,onCheckedChange:()=>O("openToday"===R?"all":"openToday")}),(0,r.jsx)("span",{children:g("marketplace.filter.openToday")})]}),("all"!==R||"select"!==k)&&(0,r.jsx)("div",{className:"pt-1",children:(0,r.jsx)(F.$,{variant:"outline",size:"sm",onClick:()=>{O("all"),S("select")},children:g("marketplace.filters.clear")})})]})})]})})]})]}),J&&(0,r.jsxs)("div",{className:"mt-2 grid grid-cols-2 rounded-lg bg-muted p-1 text-sm font-medium",children:[(0,r.jsx)("button",{type:"button",onClick:()=>P("restaurants"),className:(0,A.cn)("rounded-md px-3 py-2 transition-colors","restaurants"===U?"bg-background shadow-sm":"text-muted-foreground"),children:"Restaurants"}),(0,r.jsx)("button",{type:"button",onClick:()=>P("users"),className:(0,A.cn)("rounded-md px-3 py-2 transition-colors","users"===U?"bg-background shadow-sm":"text-muted-foreground"),children:"Users"})]})]})}),J&&"users"===U?L.length>0?(0,r.jsx)(ey,{users:L}):(0,r.jsxs)("div",{className:"mx-auto max-w-md py-12 text-center",children:[(0,r.jsx)("div",{className:"text-2xl font-semibold",children:"No users found"}),(0,r.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"Try searching by name or @handle."})]}):0===Z.length?(0,r.jsxs)("div",{className:"mx-auto max-w-md py-12 text-center",children:[(0,r.jsx)("div",{className:"text-2xl font-semibold",children:g("marketplace.empty.title")}),(0,r.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:g("marketplace.empty.description")}),(0,r.jsx)("div",{className:"mt-6 flex items-center justify-center gap-3",children:(0,r.jsx)("button",{className:(0,A.cn)("rounded-md border px-3 py-2 text-sm"),onClick:()=>N(""),children:g("marketplace.empty.clear_search")})})]}):M?(0,r.jsx)("section",{className:"mx-auto pb-10 max-w-7xl px-0",children:(0,r.jsx)(en,{merchants:$,vendorType:eT,showSocialActions:!0})}):(0,r.jsxs)(r.Fragment,{children:[X&&(0,r.jsx)("div",{className:"mx-auto max-w-7xl px-4 pt-4",children:V.map((e,t)=>(0,r.jsx)(eg,{title:e.title,merchants:e.merchants,priorityImages:0===t},e.id))}),(0,r.jsx)(H,{merchants:Z,sortBy:k,onSortByChange:e=>S(e),filterBy:R,onFilterByChange:e=>O(e),showSocialActions:!0})]})]})}},936832:(e,t,s)=>{"use strict";s.d(t,{EB:()=>i,Km:()=>o,al:()=>c,fj:()=>l,lg:()=>d,rZ:()=>a,zZ:()=>n});var r=s(184636);let a=function(){let{required:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,r.C)(e=>e.profiles);if(e&&!t.customer)throw Error("Customer profile not found");return{customerProfile:t.customer}},l=function(){let{required:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,r.C)(e=>e.profiles);if(e&&!t.merchant)throw Error("Merchant profile not found");return{merchantProfile:t.merchant}},n=function(){let{required:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,r.C)(e=>e.profiles);if(e&&!t.merchantCouponRedeemer)throw Error("Merchant coupon redeemer profile not found");return{merchantCouponRedeemer:t.merchantCouponRedeemer}},i=()=>{let e=(0,r.C)(e=>e.isProgressVisible),t=(0,r.C)(e=>e.setProgressVisible);return{isVisible:e,progress:(0,r.C)(e=>e.progress),startProgress:()=>t(0,!0),completeProgress:()=>t(100,!0),setProgress:e=>t(e,!0)}},o=function(){let{required:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,r.C)(e=>e.appUser);if(e&&!t)throw Error("App user not found");return{appUser:t}},c=()=>(0,r.C)(e=>e.isMobile),d=()=>(0,r.C)(e=>e.impersonationJwt)},964269:(e,t,s)=>{"use strict";s.d(t,{B:()=>n,cn:()=>l});var r=s(302821),a=s(475889);function l(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,a.QP)((0,r.$)(t))}let n=e=>e<1?"".concat(Math.round(1e3*e)," m"):e<10?"".concat(e.toFixed(1)," km"):"".concat(Math.round(e)," km")},965142:(e,t,s)=>{"use strict";s.d(t,{p:()=>n});var r=s(695155),a=s(212115),l=s(964269);let n=a.forwardRef((e,t)=>
1{let{className:s,type:a,...n}=e;return(0,r.jsx)("input",{type:a,className:(0,l.cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",s),ref:t,...n})});n.displayName="Input"}}]);
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.