1import{u as P,a4 as F,r as b,a9 as A,d as N,V as I,s as R,o as d,v as k,y as w,a as u,H as z,I as S,W as j,x as p,a1 as K,c as $,A as V,al as W,C as O,z as c,J as G,a2 as H,K as Q,F as X,p as L,w as U,am as Y}from"./app-CF38Zyoh.js";import{_ as M}from"./Card.vue_vue_type_script_setup_true_lang-DmS7Cfm5.js";import{u as Z,p as ee,F as te,e as _,b as ae,D as se,a as le}from"./app-DdkoSIic.js";import{_ as q}from"./FormCheckbox.vue_vue_type_script_setup_true_lang-C-V_hdBd.js";import{_ as re}from"./Info.vue_vue_type_script_setup_true_lang-AbXyZ62V.js";import{_ as J}from"./StaticMap.vue_vue_type_script_setup_true_lang-DVQm0gmP.js";import{_ as oe}from"./RecipeSquareImage.vue_vue_type_script_setup_true_lang-MXlhdP4e.js";const ne=(r,a,n={})=>{if(typeof IntersectionObserver>"u")return;const s=new IntersectionObserver(t=>{t.forEach(e=>{e.isIntersecting&&a()})},n);return P(()=>{s.observe(r.value)}),F(()=>s.disconnect()),{observer:s}},ie=(r,a=null)=>{const n=()=>A().props[r],s=b(n().data),t=b(A().url),e=N(()=>n().next_page_url!==null),l=b(!1),o=b({}),f=v=>{t.value=v},C=()=>{if(l.value||!e.value)return;let v={};o.value.data&&(v=o.value.data,delete o.value.data);const g={...o.value,preserveState:!0,preserveScroll:!0,replace:!0,preserveUrl:!0,only:[r],onSuccess:()=>{s.value=[...s.value,...n().data]}};I.get(n().next_page_url,v,g)};return a!==null&&ne(a,C,{rootMargin:"0px 0px 150px 0px"}),{items:s,pause:l,requestOptions:o,refreshUrl:f,loadMoreItems:C,reset:()=>{s.value=n().data},canLoadMoreItems:e}};var ue=function(r,a){a===void 0&&(a=5);var n=Math.pow(10,a),s=function(e){return Array.isArray(e)||(e=[e.lat,e.lng]),[E(e[0]*n),E(e[1]*n)]};return de(r,s)},de=function(r,a){for(var n=[],s=[0,0],t,e=0,l=r.length;e<l;++e)t=a(r[e]),D(E(t[0])-E(s[0]),n),D(E(t[1])-E(s[1]),n),s=t;return n.join("")},D=function(r,a){return ce(r<0?~(r<<1):r<<1,a)},ce=function(r,a){for(;r>=32;)a.push(String.fromCharCode((32|r&31)+63)),r>>=5;return a.push(String.fromCharCode(r+63)),a},E=function(r){return Math.floor(Math.abs(r)+.5)*(r>=0?1:-1)};const me={class:"flex flex-col space-y-2"},pe={class:"prose max-w-none md:prose-lg 2xl:prose-xl"},fe=["textContent"],he={key:0,class:"aspect-square w-full sm:max-w-[170px]"},ve=R({__name:"SearchEateriesCta",props:{latlng:{},location:{}},emits:["eatery-search"],setup(r){const a=r,n=N(()=>
1{if(!a.latlng)return null;const s=5*1.60934,t=[];for(let e=0;e<=360;e+=10){const l=e*Math.PI/180,o=s/111*Math.cos(l),f=s/(111*Math.cos(a.latlng.lat*Math.PI/180))*Math.sin(l);t.push([a.latlng.lat+o,a.latlng.lng+f])}return ue(t)});return(s,t)=>(d(),k(re,{class:"mx-3 flex flex-col justify-between space-y-2 xs:flex-row xs:space-x-2","no-icon":""},{default:w(()=>[u("div",me,[u("p",pe,[t[2]||(t[2]=z(" If you're looking for places to eat in ")),u("strong",{textContent:S(s.location)},null,8,fe),t[3]||(t[3]=z(", you can find more detailed results in our ")),u("a",{class:"inline-block cursor-pointer font-semibold",onClick:t[0]||(t[0]=j(e=>s.$emit("eatery-search"),["prevent"]))}," Eating Out guide "),z(", we've done a basic search within 5 miles of "+S(s.location)+", but you can search a wider radius in our Eating Out Guide. ",1)]),u("div",null,[p(K,{label:`See more results for ${s.location}`,size:"lg",theme:"secondary",as:"button",bold:"",onClick:t[1]||(t[1]=e=>s.$emit("eatery-search"))},null,8,["label"])])]),s.latlng?(d(),$("div",he,[p(J,{lat:s.latlng.lat,lng:s.latlng.lng,"can-expand":!1,"map-classes":"!bg-cover h-full","additional-params":{path:`color:0xDBBC2599|fillcolor:0xDBBC254C|enc:${n.value}`,zoom:"11",size:"400x400"}},null,8,["lat","lng","additional-params"])])):V("",!0)]),_:1}))}}),ge={class:"w-full sm:max-xl:w-1/4 xl:w-1/5"},xe=["src","alt"],ye={class:"flex flex-col space-y-4 sm:flex-1 sm:space-y-2"},be=["textContent"],ke=["textContent"],we={class:"mt-auto flex items-end justify-between"},$e={class:"flex items-end space-x-2"},_e=["textContent"],Se=["textContent"],Ce=["textContent"],Ee=R({__name:"SearchResult",props:{item:{}},setup(r){const a=r,n=e=>e!=="Eatery"&&e!=="Hotel"&&e!=="Attraction",s=e=>{const l=e.toFixed(2),o=ee("mile",e);return`${l} ${o} away`},t=e=>{const l=["rounded-lg","px-2","py-2","leading-none","text-xs","font-semibold","lg:text-base","lg:px-4"];switch(e){case"Blog":l.push("bg-primary");break;case"Recipe":l.push("bg-primary-light");break;case"Eatery":case"Hotel":case"Attraction":l.push("bg-secondary");break;case"Shop Product":l.push("bg-primary-other text-white");break}return l};return Z().logWhenVisible(W("card"),"scrolled_into_view","SearchResultCard",{type:a.item.type,title:a.item.title}),(e,l)=>(d(),k(M,{ref:"card",class:"group/item transform p-4 transition-all sm:scale-95 sm:group-hover:opacity-50 sm:hover:scale-100 sm:hover:opacity-100!"},{default:w(()=>[p(c(G),{href:e.item.link,class:"flex flex-col space-y-4 sm:flex-row sm:space-y-0 sm:space-x-4",prefetch:""},{default:w(()=>{var o,f;return[u("div",ge,[e.item.type==="Recipe"?(d(),k(oe,{key:0,src:e.item.image,alt:e.item.title},null,8,["src","alt"])):n(e.item.type)?(d(),$("img",{key:1,src:e.item.image,alt:e.item.title},null,8,xe)):(d(),k(J,{key:2,lng:e.item.image.lng,lat:e.item.image.lat,"can-expand":!1},null,8,["lng","lat"]))]),u("div",ye,[u("h2",{class:"text-xl font-semibold text-primary-dark transition group-hover/item:text-black lg:max-xl:text-2xl xl:text-3xl",textContent:S(e.item.title)},null,8,be),u("p",{class:"prose max-w-none flex-1 lg:prose-xl",textContent:S(e.item.description)},null,8,ke),u("div",we,[u("div",$e,[u("div",{class:O(t(e.item.type)),textContent:S(e.item.type)},null,10,_e),(o=e.item)!=null&&o.cuisine?(d(),$("div",{key:0,class:O([...t(e.item.type),"!bg-secondary-lightest"]),textContent:S(e.item.cuisine)},null,10,Se)):V("",!0)]),(f=e.item)!=null&&f.distance?(d(),$("div",{key:0,class:"text-sm text-grey-off-dark group-hover/item:text-grey-dark lg:text-base",textContent:S(s(e.item.distance))},null,8,Ce)):V("",!0)])])]}),_:1},8,["href"])]),_:1},512))}}),Ve={key:2,class:"group flex min-h-screen flex-col space-y-2 xmd:-ml-3! xmd:pt-2"},Be=R({__name:"SearchResults",props:{results:{},shouldLoad:{type:Boolean},landmark:{},hasEatery:{type:Boolean},location:{},searchLatLng:{},term:{}},emits:["mounted"],setup(r,{expose:a,emit:n}){const s=r,t=n;P(()=>{t("mounted")});const{reset:e,pause:l,items:o,refreshUrl:f,requestOptions:C}=ie("results",b(s.landmark)),v=()=>{I.post("/wheretoeat/search",{term:s.term,range:5})};return a({reset:e,pause:l,refreshUrl:f,requestOptions:C}),(g,x)=>g.shouldLoad?(d(),k(M,{key:0,class:"mt-4! w-full"},{default:w(()=>[p(H,{color:"primary",display:!0,absolute:!1,size:"size-12"})]),_:1})):c(o).length===0?(d(),k(M,{key:1,class:"mt-4! w-full"},{default:w(()=>x[1]||(x[1]=[u("div",{class:"px-4 py-8 text-center text-xl font-semibold text-primary-dark"}," No results found! ",-1)])),_:1})):(d(),$("div",Ve,[g.hasEatery&&g.location?(d(),k(ve,{key:0,location:g.location,latlng:g.searchLatLng,onEaterySearch:x[0]||(x[0]=y=>v())},null,8,["location","latlng"])):V("",!0),(d(!0),$(Q,null,X(c(o),y=>(d(),k(Ee,{key:y.link,item:y},null,8,["item"]))),128))]))}}),Ue={class:"flex flex-col space-y-4 xmd:flex-row xmd:space-y-0 xmd:s
1pace-x-4"},Me={class:"xmd:w-1/4 xmd:max-w-[215px] xmd:shrink-0"},Le={key:0,class:"font-semibold break-words text-red"},qe={class:"grid grid-cols-2 gap-2 xmd:grid-cols-1"},De=R({__name:"Index",props:{parameters:{},location:{},searchedLatLng:{},results:{},hasEatery:{type:Boolean},aiAssisted:{type:Boolean}},setup(r){const a=r,n=()=>new URLSearchParams({q:a.parameters.q,blogs:a.parameters.blogs?"true":"false",recipes:a.parameters.recipes?"true":"false",eateries:a.parameters.eateries?"true":"false",shop:a.parameters.shop?"true":"false"}),s=b(),t=b(null),{hasError:e,searchForm:l,latLng:o,cancelSearch:f,isSubmitting:C,store:v,submitSearch:g}=te();P(()=>{if(_.$emit("hide-site-loader"),t.value&&(t.value.pause=!0),v.setForm(a.parameters),a.aiAssisted){_.$emit("show-site-loader");const i=new URL(ae().currentUrl());i.search=n().toString(),L(()=>{_.$emit("show-site-loader"),I.get(i.toString(),{},{preserveScroll:!0,preserveState:!0,replace:!0,onSuccess:()=>{var m;(m=t.value)==null||m.refreshUrl(i.pathname+i.search),L(()=>{_.$emit("hide-site-loader")})}})})}o.value&&t.value&&(t.value.requestOptions={headers:{"x-user-location":o.value}}),L(()=>{t.value&&(t.value.pause=!1)})}),F(()=>{v.$reset()});const x=b(!1);_.$on("sticky-nav-on",()=>x.value=!0),_.$on("sticky-nav-off",()=>x.value=!1);const y=b(!0),B=()=>{y.value=!0,t.value&&(t.value.pause=!0),f&&f.value&&f.value.cancel(),L(()=>{g({onSuccess:()=>{t.value&&(t.value.pause=!1,t.value.reset()),y.value=!1,_.$emit("hide-site-loader")}})})};return U(()=>l.value.blogs,()=>{B()}),U(()=>l.value.recipes,()=>{B()}),U(()=>l.value.eateries,()=>{B()}),U(()=>l.value.shop,()=>{B()}),U(()=>o.value,()=>{!o.value||!t.value||(t.value.requestOptions={headers:{"x-search-location":o.value}})}),se(()=>l.value.q,()=>{B()},{debounce:500}),I.on("before",i=>{o.value&&i.detail.visit.only[0]==="results"&&(i.detail.visit.headers={...i.detail.visit.headers,"x-search-location":o.value})}),(i,m)=>{var T;return d(),$("div",Ue,[u("div",Me,[p(M,{class:O(["mx-3 mt-3 rounded-lg bg-primary-light/40! xmd:max-w-[195px] xmd:rounded-lg xmd:border-2 xmd:border-primary xmd:bg-primary-light/10! xmd:p-3",{"xmd:top-[40px]":x.value,"xmd:top-auto":!x.value,"xmd:fixed":!c(C)&&!y.value&&i.results&&((T=i.results.data)==null?void 0:T.length)>1}]),faded:"",shadow:!1},{default:w(()=>[u("form",{class:"flex flex-col space-y-4",onSubmit:j(h=>{},["prevent"])},[p(le,{modelValue:c(l).q,"onUpdate:modelValue":m[0]||(m[0]=h=>c(l).q=h),label:"",type:"search",name:"q",placeholder:"Search...",class:"flex-1","hide-label":"",borders:"",max:255},null,8,["modelValue"]),c(e)?(d(),$("p",Le," Please enter at least 3 characters ")):V("",!0),u("div",qe,[p(q,{modelValue:c(l).blogs,"onUpdate:modelValue":m[1]||(m[1]=h=>c(l).blogs=h),label:"Blogs",layout:"left",name:"blogs",xl:""},null,8,["modelValue"]),p(q,{modelValue:c(l).recipes,"onUpdate:modelValue":m[2]||(m[2]=h=>c(l).recipes=h),label:"Recipes",layout:"left",name:"recipes",xl:""},null,8,["modelValue"]),p(q,{modelValue:c(l).eateries,"onUpdate:modelValue":m[3]||(m[3]=h=>c(l).eateries=h),label:"Eateries",layout:"left",name:"eateries",xl:""},null,8,["modelValue"]),p(q,{modelValue:c(l).shop,"onUpdate:modelValue":m[4]||(m[4]=h=>c(l).shop=h),label:"Shop",layout:"left",name:"shop",xl:""},null,8,["modelValue"])])],32)]),_:1},8,["class"])]),p(c(Y),{data:"results"},{fallback:w(()=>[p(M,{class:"mt-4! w-full"},{default:w(()=>[p(H,{color:"primary",display:!0,absolute:!1,size:"size-12"})]),_:1})]),default:w(()=>[i.results?(d(),k(Be,{key:0,ref_key:"resultsElem",ref:t,"should-load":y.value,results:i.results,landmark:s.value,"has-eatery":i.hasEatery,location:i.location,"search-lat-lng":i.searchedLatLng,term:i.parameters.q,onMounted:m[5]||(m[5]=h=>y.value=!1)},null,8,["should-load","results","landmark","has-eatery","location","search-lat-lng","term"])):V("",!0)]),_:1}),u("div",{ref_key:"landmark",ref:s},null,512)])}}});
1export{De as default};
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.