1import{_ as J}from"./MpiTgu6l.js";import{_ as M}from"./DFvfqJfm.js";import{Q as P,cD as U,_ as A,b5 as G,p as N}from"./jUn5Q-A0.js";import{D as C}from"./CuXfEcPf.js";import{d as O,a4 as V,L as o,R as l,O as p,Y as s,x as n,N as j,Z as L,X as R,l as D,a1 as w,e as v,v as T,C as q,H as B,W as E,M as F}from"./JFTuL8MR.js";import{_ as H}from"./CNv6l1CD.js";import{u as Q}from"./B6zAsE2v.js";import"./ZE0XUaFf.js";import"./a3sj5zmn.js";import"./11KAhT0R.js";const W={class:"w-full flex flex-col gap-4"},X={class:"flex w-full items-center bg-gray-100 p-2 rounded-xl gap-2"},Y={key:0,class:"flex w-full flex-col items-center gap-2"},Z={key:0,class:"flex items-center w-full"},z={key:1,class:"flex items-center w-full"},K=O({__name:"Inpage",props:{loading:{type:Boolean}},emits:["search"],setup(S,{emit:h}){const g=S,b=h,c=v(!0),u=v([]),f=v([]),_=v(null),r=v(1),a=T(()=>g.loading||c.value),m=()=>{c.value=!c.value,c.value&&b("search",{coordinates:u.value.reduce((e,d)=>{const y=d.list.map(t=>[t.lng,t.lat]);return e.push(...y),e},[]),catIds:f.value.map(e=>e._id),$dateSelected:_.value?.start&&_.value?.end?[C.fromJSDate(_.value.start).set({hours:0,minutes:0,seconds:0,milliseconds:0}).toJSDate({includeOffset:!1}),C.fromJSDate(_.value.end).set({hours:23,minutes:59,seconds:59,milliseconds:999}).toJSDate({includeOffset:!1})]:void 0,$nbPeopleSelected:this.nbPeople||1})},x=e=>{_.value=e},i=e=>{r.value=e};return(e,d)=>{const y=M,t=P,k=V("search-global-localities"),I=V("search-global-categories");return o(),l("section",W,[p("div",X,[s(y,{"is-loading":n(a),"show-search-button":!1,onUpdatedate:x,onUpdatepeople:i},null,8,["is-loading"]),s(t,{onClick:m,loading:S.loading},{default:j(()=>[L(R(n(c)?"Modifier":"Go"),1)]),_:1},8,["loading"])]),n(c)?w("",!0):(o(),l("div",Y,[e.launcher&&e.launcher.localities.length?(o(),l("div",Z,[s(k,{localities:e.launcher.localities,modelValue:n(u),"onUpdate:modelValue":d[0]||(d[0]=$=>D(u)?u.value=$:null)},null,8,["localities","modelValue"])])):w("",!0),e.launcher&&e.launcher.categories.length?(o(),l("div",z,[s(I,{categories:e.launcher.categories,modelValue:n(f),"onUpdate:modelValue":d[1]||(d[1]=$=>D(f)?f.value=$:null)},null,8,["categories","modelValue"])])):w("",!0)]))])}}}),ee=Object.assign(K,{__name:"CSearchGlobalInpage"}),te={class:"cContainer-extra"},oe={class:"mb-2 mt-2 flex flex-nowrap md:flex-wrap overflow-auto -mx-2 pl-2"},se={class:"flex items-center mb-4"},le={key:0,class:"w-full grid grid-cols-1 md:grid-cols-5 gap-4"},ae={key:1,class:"my-4 space-y-10"},ne={class:"text-2xl font-semibold mb-2 block"},ce={class:"grid grid-cols-1 md:grid-cols-5 gap-4"},re=["onClick"],ie={class:"w-full h-full rounded-lg bg-gray-100 flex flex-col items-center justify-center py-10"},be=O({__name:"globale",setup(S){const h=Q(),g=v(!1),{results:b,categoriesExtended:c}=q(h),u=r=>c.value?.[r]||!1,f=r=>{const a=Object.assign({},c.value);a[r]=!0,h.categoriesExtended=a},_=async r=>{g.value=!0;try{const a={$limit:10,$skip:0,city:"paris",...r},m=await N().$feathers.service("product-search").find({query:a});h.results=m,h.categoriesExtended=m.reduce((x,i)=>(x[i.categoryName]=!1,x),{})}catch(a){console.error(a),N().$toast.error("Error lors de la recherche.")}finally{g.value=!1}};return(r,a)=>{const m=J,x=ee,i=U,e=H,d=A,y=G;return o(),l("div",te,[p("div",oe,[s(m,{link:"/",label:"Accueil"}),s(m,{label:"Recherche globale"})]),p("div",se,[s(x,{onSearch:_,loading:n(g)},null,8,["loading"])]),n(g)?(o(),l("div",le,[s(i,{width:"100%",height:96}),s(i,{width:"100%",height:96}),s(i,{width:"100%",height:96}),s(i,{width:"100%",height:96})])):n(b)&&n(b).length?(o(),l("div",ae,[(o(!0),l(B,null,E(n(b),t=>(o(),l("div",{key:t.categoryName},[p("span",ne,R(t.categoryName),1),p("div",ce,[(o(!0),l(B,null,E(t.products.slice(0,u(t.categoryName)?t.products.length:4),k=>(o(),l("div",{key:k._id,class:"w-full flex flex-col h-full cursor-pointer"},[s(e,{class:"h-full",product:k,"show-store-name":!0},null,8,["product"])]))),128)),t.products.length>5&&!u(t.categoryName)?(o(),l("div",{key:0,class:"w-full flex flex-col shadow rounded-lg h-full p-1 cursor-pointer group",onClick:k=>f(t.categoryName)},[p("div",ie,[s(d,{name:"ant:rr-arrow-right",class:"text-4xl text-gray-300 group-hover:text-black transition-all",role:"presentation","aria-hidden":"true"}),a[0]||(a[0]=p("span",{class:"mt-4 block text-sm font-semibold text-gray-400 group-hover:text-black transition-all"},"Voir plus",-1))])],8,re)):w("",!0)])]))),128))])):(o(),F(y,{key:2,message:"Aucun résultat trouvé pour cette recherche"}))])}}});
1export{be 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.