(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[387],{30397:function(e,t,r){"use strict";var n,s=r(94746);function a(){return(a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}t.Z=function(e){return s.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 20.897 22.002"},e),n||(n=s.createElement("path",{fill:"#214738",d:"M17.039 21.91a.68.68 0 0 1-.351-.6v-2.131a3.47 3.47 0 0 1-2.444-1.852 3.36 3.36 0 0 1 0-3.031 3.48 3.48 0 0 1 2.444-1.852V.688a.69.69 0 0 1 .351-.6.73.73 0 0 1 .7 0 .7.7 0 0 1 .351.6v11.756a3.48 3.48 0 0 1 2.444 1.852 3.36 3.36 0 0 1 0 3.031 3.47 3.47 0 0 1-2.444 1.852v2.131a.7.7 0 0 1-.351.6.7.7 0 0 1-.351.092.7.7 0 0 1-.349-.092m-1.14-7.557a2.08 2.08 0 0 0-.614 1.463 2.08 2.08 0 0 0 .614 1.459 2.15 2.15 0 0 0 1.49.6 2.14 2.14 0 0 0 1.485-.6 2.06 2.06 0 0 0 .614-1.459 2.05 2.05 0 0 0-.614-1.463 2.15 2.15 0 0 0-1.485-.6 2.15 2.15 0 0 0-1.491.601Zm-5.8 7.557a.7.7 0 0 1-.351-.6V8.865a3.48 3.48 0 0 1-2.444-1.852 3.36 3.36 0 0 1 0-3.031A3.47 3.47 0 0 1 9.748 2.13V.683h.005a.67.67 0 0 1 .351-.592.69.69 0 0 1 .7 0 .67.67 0 0 1 .351.592V2.13a3.5 3.5 0 0 1 2.45 1.852 3.4 3.4 0 0 1 0 3.031 3.5 3.5 0 0 1-2.45 1.852V21.31a.68.68 0 0 1-.351.6.7.7 0 0 1-.349.092.73.73 0 0 1-.357-.092ZM8.965 4.039a2.06 2.06 0 0 0-.619 1.459 2.06 2.06 0 0 0 .619 1.463 2.13 2.13 0 0 0 1.485.6 2.13 2.13 0 0 0 1.485-.6 2.06 2.06 0 0 0 .619-1.463 2.06 2.06 0 0 0-.619-1.453 2.11 2.11 0 0 0-1.485-.607 2.13 2.13 0 0 0-1.489.601ZM3.156 21.91a.7.7 0 0 1-.351-.6v-5.566A3.5 3.5 0 0 1 .361 13.89a3.4 3.4 0 0 1 0-3.035 3.48 3.48 0 0 1 2.444-1.848V.695a.68.68 0 0 1 .351-.592.7.7 0 0 1 .7 0 .68.68 0 0 1 .351.592v8.313a3.48 3.48 0 0 1 2.444 1.848 3.37 3.37 0 0 1 0 3.035 3.5 3.5 0 0 1-2.444 1.854v5.566a.68.68 0 0 1-.351.6.7.7 0 0 1-.349.092.73.73 0 0 1-.355-.093ZM2.022 10.918a2.04 2.04 0 0 0-.614 1.457 2.03 2.03 0 0 0 .614 1.457 2.13 2.13 0 0 0 1.485.609 2.1 2.1 0 0 0 1.485-.609 2.03 2.03 0 0 0 .619-1.457 2.05 2.05 0 0 0-.619-1.457 2.1 2.1 0 0 0-1.485-.6 2.1 2.1 0 0 0-1.489.6Z","data-name":"Union 60"})))}},31721:function(e,t,r){Promise.resolve().then(r.bind(r,88375)),Promise.resolve().then(r.bind(r,20709))},88375:function(e,t,r){"use strict";r.d(t,{default:function(){return j}});var n=r(57437),s=r(53335);function a(e){let{n1:t,n2:r,n3:a,type1:i,type2:o,type3:c,title1:d,title2:u,title3:f,mb:x=!0,...p}=e;return(0,n.jsx)("div",{className:"steps hidden bg-primary/10 py-8 md:block",children:(0,n.jsxs)("div",{className:(0,s.m6)("container relative flex w-full justify-between before:absolute before:left-1/2 before:top-1/2 before:h-px before:w-full before:max-w-[60%] before:-translate-x-1/2 before:-translate-y-3 before:bg-secondaryDeep before:content-['']",p.className),children:[(0,n.jsx)(l,{number:t,title:d,type:i}),(0,n.jsx)(l,{number:r,title:u,type:o}),(0,n.jsx)(l,{number:a,title:f,type:c})]})})}function l(e){let{number:t,title:r,type:a}=e;return(0,n.jsxs)("div",{className:"flex w-1/3 flex-col items-center justify-center gap-2 ",children:[(0,n.jsx)("span",{className:(0,s.m6)("relative flex h-20 w-20 items-center justify-center rounded-full border border-dashed border-black bg-white font-accent text-3xl font-bold text-black","currentStep"===a&&"border-primary bg-primary text-primary-foreground"),children:t}),(0,n.jsx)("h2",{className:" text-lg font-bold",children:r})]})}var i=r(81689),o=r(38110),c=r(30397),d=r(2265),u=r(46568),f=r(75367),x=r(5991),p=r(88228),h=r(95937),m=r(58531),v=r(12381),b=r(44078),g=r(59117);function j(e){let{events:t,defaultSelectedFilterOptions:r,hydraView:l,getBaseUrl:j}=e,w=(0,f.Z)();(0,p.Z)();let[y,_]=(0,d.useState)(!1),k=()=>{_(()=>!y)};return(0,n.jsxs)("main",{className:"",children:[(0,n.jsx)(a,{n1:1,n2:2,n3:3,type1:"currentStep",type2:"otherStep",type3:"otherStep",title1:w("CreateCarpool.path.title1"),title2:w("CreateCarpool.path.title2"),title3:w("CreateCarpool.path.title3")}),(0,n.jsxs)("section",{className:"container",children:[(0,n.jsxs)("div",{className:"flex items-center justify-center gap-2 py-4 md:py-4",children:[(0,n.jsx)("h1",{className:" text-center text-2xl font-bold md:hidden md:text-4xl",children:w("CreateCarpool.form.title")}),(0,n.jsx)("div",{className:"w-30 border-grey-500 inline-block cursor-pointer rounded-full border bg-white p-2 shadow lg:hidden",onClick:k,children:(0,n.jsx)(c.Z,{className:"[&>*]:fill-primary"})})]}),(0,n.jsx)("div",{id:"filters",className:(0,s.m6)("relative z-30 m-auto mb-4 hidden flex-col justify-center gap-5 rounded-lg bg-white p-6 shadow md:w-fit lg:flex lg:min-w-[80%]",y?"flex":""),children:(0,n.jsx)(i.Z,{defaultSelectedFilterOptions:r,toggleFilters:k})})]}),(0,n.jsx)(u.default,{dimension:"banner",location:"event_list"}),(0,n.jsx)("section",{className:"container mb-10 w-full",children:0==t.length?(0,n.jsx)("div",{className:"col-span-4 mb-4 text-center",children:(0,n.jsx)(h.bZ,{className:"mb-4",children:(0,n.jsx)(h.X,{children:w("EventsList.empty")})})}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(x.Z,{containerClass:"cards-grid--events",children:t.map((e,t)=>(0,n.jsx)(m.EventCard,{event:e,linkTo:"/proposer-un-covoiturage/".concat(e.id),children:(0,n.jsx)(v.Button,{asChild:!0,children:(0,n.jsxs)(b.Link,{href:"/proposer-un-covoiturage/".concat(e.id),children:[(0,n.jsx)(g.JO,{icon:"plusCircled"}),w("Rewards.card.proposeCarpool")]})})},e.id))}),(0,n.jsx)(o.PagesNumber,{hydraView:l,baseUrl:j})]})}),(0,n.jsx)(u.default,{dimension:"banner",location:"event_list_bottom"})]})}},20709:function(e,t,r){"use strict";let n;r.d(t,{default:function(){return R}});var s=r(57437),a=r(2265),l=r(22171),i=r(35497),o=r(80172),c=r(331),d=r(46568),u=r(65680),f=r(5991),x=r(28199),p=r(12381),h=r(58991),m=r(44078),v=r(93448);let b=(0,r(77712).j)("underlined-link cursor-pointer flex items-center transition-all duration-100 font-medium whitespace-nowrap",{variants:{variant:{primary:"border-primary text-primary [&_svg_*[fill=red]]:fill-primary [&_svg_*[stroke]]:stroke-primary",secondary:"border-secondary text-secondary [&_svg_*[fill=red]]:fill-secondary [&_svg_*[stroke]]:stroke-secondary",success:"border-success text-success [&_svg_*[fill=red]]:fill-success [&_svg_*[stroke]]:stroke-success",error:"border-error text-error [&_svg_*[fill=red]]:fill-error [&_svg_*[stroke]]:stroke-error",warning:"border-warning text-warning [&_svg_*[fill=red]]:fill-warning [&_svg_*[stroke]]:stroke-warning",info:"border-info text-info [&_svg_*[fill=red]]:fill-info [&_svg_*[stroke]]:stroke-info",neutral:"border-neutral text-neutral [&_svg_*[fill=red]]:fill-neutral [&_svg_*[stroke]]:stroke-neutral",white:"border-white text-white [&_svg_*[fill=red]]:fill-white [&_svg_*[stroke]]:stroke-white",black:"border-black text-black [&_svg_*[fill=red]]:fill-black [&_svg_*[stroke]]:stroke-black"},size:{sm:"text-sm border-b-[3px] pb-0.5 gap-0.5",base:"text-base border-b-4 pb-1 gap-1",lg:"text-lg border-b-4",xl:"text-xl","2xl":"text-2xl","3xl":"text-3xl","4xl":"text-4xl","5xl":"text-5xl"},active:{true:"",false:"border-neutral-50 hover:border-neutral-200 text-black [&_svg_*[fill=red]]:fill-black [&_svg_*[stroke]]:stroke-black"}},defaultVariants:{variant:"primary",active:!0,size:"base"}}),g=a.forwardRef((e,t)=>{let{children:r,className:n,variant:a,active:l,size:i,...o}=e;return(0,s.jsx)(m.Link,{className:(0,v.cn)(b({variant:a,active:l,size:i,className:n})),...o,ref:t,children:r})});var j=r(59117),w=r(79820),y=r(75367),_=r(58531),k=r(95937),C=r(6681),N=r.n(C),S=r(51319),P=r(99376),E=r(46392);let L=function(){let e="CJVEVW4QZ7",t="e1a2a549b38cf50bd6e48fab85fcaa39";return e&&t||console.error("Algolia credentials are missing from .env.local"),N()(e,t)}(),Z="".concat("prod_","events"),O=(e,t)=>{clearTimeout(n),n=setTimeout(()=>t(e),325)};function R(e){let{paginate:t=24,className:r,cardsCta:n="default"}=e,i=(0,P.useSearchParams)().get("q"),o=(0,a.useContext)(u.i),c=(0,a.useContext)(h.Y),f=(0,a.useRef)(null),p=(0,a.useRef)(t),m=(0,a.useRef)(0),[b,g]=(0,a.useState)(c&&c.favoriteClub),[j,w]=(0,a.useState)(!1),y=["tenant_id = ".concat(o.id),"startAt_timestamp > ".concat(Math.floor((0,v.NY)(new Date,5).getTime()/1e3))],_={};j&&(_=c&&c.address?{aroundLatLng:"".concat(c.address.latitude,", ").concat(c.address.longitude),aroundRadius:15e4}:{aroundLatLngViaIP:!0,aroundRadius:15e4});let k=y.join(" AND "),C={};return null!==i&&""!=i&&(C[Z]={query:i,page:0}),(0,s.jsx)("div",{className:(0,v.cn)("event-search-algolia relative !mb-10 flex w-full scroll-mt-24 flex-col items-center gap-4",r),ref:f,children:(0,s.jsxs)(x.x,{searchClient:L,indexName:Z,insights:!0,routing:!1,future:{preserveSharedStateOnUnmount:!0},initialUiState:C,children:[(0,s.jsx)(l.T,{hitsPerPage:p.current,page:m.current,filters:k,optionalFilters:c&&c.favoriteClub&&b?["clubs.id:".concat(c.favoriteClub.id)]:void 0,..._}),(0,s.jsx)(A,{filterFavoriteClub:b,filterAroundMe:j,setFilterFavoriteClub:g,setFilterAroundMe:w,containerRef:f}),(0,s.jsx)(d.default,{dimension:"banner",location:"event_list"}),(0,s.jsx)(M,{cardsCta:n}),(0,s.jsx)(V,{})]})})}let A=e=>{let{filterFavoriteClub:t,filterAroundMe:r,setFilterFavoriteClub:n,setFilterAroundMe:l,containerRef:o}=e,c=(0,y.Z)(),d=(0,a.useContext)(u.i),f=(0,a.useContext)(h.Y),x=(0,a.useContext)(E.v);return(0,s.jsx)(w.Zb,{className:(0,v.cn)("event-search-algolia__filter-bar filter-bar sticky z-30 w-full rounded-none sm:rounded-md",x?"top-0":"top-[60px] lg:top-[88px]",d.stickyBottomBarEnabled&&"top-0"),children:(0,s.jsxs)(w.aY,{className:"filter-bar__content flex w-full flex-col items-center justify-between gap-2 p-4 sm:flex-row sm:gap-8",children:[(0,s.jsxs)("div",{className:"relative w-full",children:[(0,s.jsx)(j.JO,{icon:"search",className:"-z-1 pointer-events-none absolute left-2 top-1/2 h-5 w-5 -translate-y-1/2 [&_*]:pointer-events-none",variant:"neutral"}),(0,s.jsx)(i.R,{classNames:{root:"grow w-full",input:"filter-bar__search-input pl-9 grow w-full rounded-md outline outline-neutral-600 px-3 py-2 font-medium lining-nums placeholder:text-neutral focus-visible:outline-primary",submit:"hidden",reset:"hidden"},queryHook:O,placeholder:c("EventsSearchAlgolia.placeHolder")})]}),(0,s.jsxs)("div",{className:"filter-bar__filters-actions flex w-full snap-x gap-2 overflow-x-scroll scroll-smooth scrollbar-none sm:w-fit sm:overflow-x-visible",style:{scrollSnapType:"x mandatory"},children:[(0,s.jsxs)(g,{className:"m-auto flex w-fit flex-1 snap-start justify-center gap-1 sm:translate-y-1",active:!t&&!r,onClick:()=>{n(!1),l(!1),(null==o?void 0:o.current)&&o.current.scrollIntoView({behavior:"smooth"})},children:[(0,s.jsx)(j.JO,{icon:"eye"}),c("EventsSearchAlgolia.filters.all")]}),d&&d.favoriteClubEnabled&&f&&f.favoriteClub&&(0,s.jsxs)(g,{className:"m-auto flex w-fit flex-1 snap-start justify-center gap-1 sm:translate-y-1",active:t,onClick:()=>{n(!0),l(!1),(null==o?void 0:o.current)&&o.current.scrollIntoView({behavior:"smooth"})},children:[(0,s.jsx)(j.JO,{icon:"heart",className:"w-3"}),c("EventsSearchAlgolia.filters.favoriteClub")]}),(0,s.jsxs)(g,{className:"m-auto flex w-fit flex-1 snap-start justify-center gap-1 sm:translate-y-1",active:r,onClick:()=>{n(!1),l(!0),(null==o?void 0:o.current)&&o.current.scrollIntoView({behavior:"smooth"})},children:[(0,s.jsx)(j.JO,{icon:"location"}),c("EventsSearchAlgolia.filters.aroundMe")]})]})]})})},M=e=>{let{cardsCta:t}=e,r=(0,y.Z)(),{items:n,showMore:a,isLastPage:l,sendEvent:i}=(0,o.a)(),{status:d}=(0,c.b)();return n.length<=0?(0,s.jsx)("div",{className:"col-span-4 mb-4 text-center",children:(0,s.jsx)(k.bZ,{className:"mb-4",children:(0,s.jsx)(k.X,{children:r("EventsList.empty")})})}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(f.Z,{containerClass:"event-search-algolia__cards-grid px-4 md:px-0 w-full",children:n.map(e=>"carpool_publish"===t?(0,s.jsx)(_.EventCard,{event:e,sendEvent:i,linkTo:"/proposer-un-covoiturage/".concat(e.id),children:(0,s.jsx)(p.Button,{asChild:!0,onClick:()=>i?i("conversion",e,"Create Carpool Clicked"):null,children:(0,s.jsxs)(m.Link,{href:"/proposer-un-covoiturage/".concat(e.id),children:[(0,s.jsx)(j.JO,{icon:"plusCircled"}),r("Rewards.card.proposeCarpool")]})})},e.objectID):(0,s.jsx)(_.EventCard,{event:e,sendEvent:i},e.objectID))}),(0,s.jsxs)(p.Button,{variant:"secondary",size:"lg",loading:"loading"===d,className:(0,v.cn)("event-search-algolia__load-more w-11/12 sm:w-fit","loading"===d?"opacity-50":"",l?"hidden":""),onClick:a,children:[(0,s.jsx)(j.JO,{icon:"plusCircled"}),r("EventsSearchAlgolia.loadMore")]})]})};function V(){let e=(0,a.useContext)(h.Y),{addMiddlewares:t}=(0,c.b)();return(0,a.useLayoutEffect)(()=>t((0,S.o)({insightsClient:window.aa,insightsInitParams:{useCookie:!e||!e.id,userToken:e&&e.id?e.id:void 0}})),[t,e]),null}},38110:function(e,t,r){"use strict";r.d(t,{PagesNumber:function(){return l}});var n=r(57437),s=r(99376),a=r(44078);function l(e){let{hydraView:t,baseUrl:r,pageVarName:l="page",additionalParams:i}=e,o=new URL((0,s.usePathname)()+"?"+(0,s.useSearchParams)().toString(),r);void 0!==i&&i.forEach(e=>{let{name:t,value:r}=e;o.searchParams.set(t,r)});let c=new URL(t["@id"],r).searchParams.get("page"),d=new URL(t["hydra:first"],r).searchParams.get("page");null!=d&&o.searchParams.set(l,d);let u=o.toString(),f=new URL(t["hydra:last"],r).searchParams.get("page");null!=f&&o.searchParams.set(l,f);let x=o.toString(),p=new URL(t["hydra:previous"],r).searchParams.get("page");null!=p&&o.searchParams.set(l,p);let h=o.toString(),m=new URL(t["hydra:next"],r).searchParams.get("page");null!=m&&o.searchParams.set(l,m);let v=o.toString();return c&&(0,n.jsxs)("div",{className:"m-auto my-4 flex w-fit items-center gap-5 rounded bg-white p-4 px-8 font-accent text-2xl font-bold text-secondaryDeep shadow md:my-10",children:[d&&d!==c&&d!==p&&(0,n.jsxs)(a.Link,{href:u,children:[(0,n.jsx)("span",{className:"cursor-pointer rounded border p-1 px-3 transition-all  hover:bg-secondaryMedium hover:text-white",children:d})," ","..."]}),p&&(0,n.jsx)(a.Link,{href:h,children:(0,n.jsx)("span",{className:"cursor-pointer rounded border p-1 px-3 transition-all  hover:bg-secondaryMedium hover:text-white",children:p})}),(0,n.jsx)("span",{className:"rounded border border-b-4 border-b-secondaryMedium  bg-white p-1 px-3 text-secondaryDeep ",children:c}),m&&(0,n.jsx)(a.Link,{href:v,children:(0,n.jsx)("span",{className:"cursor-pointer rounded border p-1 px-3 transition-all  hover:bg-secondaryMedium hover:text-white",children:m})}),f&&f!==c&&f!==m&&(0,n.jsxs)(a.Link,{href:x,children:["..."," ",(0,n.jsx)("span",{className:"cursor-pointer rounded border p-1 px-3 transition-all  hover:bg-secondaryMedium hover:text-white",children:f})]})]})}},46392:function(e,t,r){"use strict";r.d(t,{v:function(){return n}});let n=(0,r(2265).createContext)(!1)},36760:function(e,t){var r;!function(){"use strict";var n={}.hasOwnProperty;function s(){for(var e="",t=0;t<arguments.length;t++){var r=arguments[t];r&&(e=a(e,function(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return s.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var r in e)n.call(e,r)&&e[r]&&(t=a(t,r));return t}(r)))}return e}function a(e,t){return t?e?e+" "+t:e+t:e}e.exports?(s.default=s,e.exports=s):void 0!==(r=(function(){return s}).apply(t,[]))&&(e.exports=r)}()}},function(e){e.O(0,[7279,3335,7529,5610,2043,222,5878,3446,998,6663,1648,534,7184,8341,7835,4308,4098,283,9117,6593,8531,9597,2971,9119,3859,1744],function(){return e(e.s=31721)}),_N_E=e.O()}]);