import{d as n}from"./MN2wDcWk.js";import{p as kt,O as vt,b5 as yt,b6 as st,b7 as dt,b8 as Ct,N as ft}from"./CJSGeVGq.js";const ht=e=>{var m,_,p,y,d,b,k,v,s,C,f,w,L,h,P,I,S,D,A,N,O,T,V,q,B,E,U,F,M,R,$,j,x,Q,z,G,H,J,K,W,X,Y,Z,g,ee,te,ie,ce,ne,oe,le,ae,ue,re,me,_e,pe,ye,de,be,ke,ve,se,Ce,fe,we,Le,he,Pe,Ie,Se,De,Ae,Ne,Oe,Te,Ve,qe,Be,Ee,Ue,Fe,Me,Re,$e,je,xe,Qe,ze,Ge,He,Je,Ke,We,Xe,Ye,Ze,ge,et,tt,it,ct,nt,ot,lt,at,ut,rt,mt,_t,pt;const{$city:o}=kt(),l=Ct(),a=vt(),u=ft(),c=a.query.webreferrer,bt=u.public.LOCALES?u.public.LOCALES.split(","):["fr","en","es","nl"],t=Object.keys(e)[0]||null;if(!l||!t||!((m=l==null?void 0:l.options)!=null&&m.enabled))return;let i={"interaction-type":!1};a.params.city&&(i={...i,viewCity:a.params.city});const r=a.path.split("/").filter(Boolean).shift();switch(bt.includes(r||"")&&(i={...i,viewCountry:r}),t){case"onSearch":i={...i,event:"search",...e[t],country:dt((_=e[t])==null?void 0:_.city)};break;case"onAddPromo":i={...i,event:"add_promo_code",label:(p=e[t])==null?void 0:p.label};break;case"onPopupDisplay":i={...i,event:"popup_display",popup_title:(y=e[t])==null?void 0:y.popup_title};break;case"onPopupClick":i={...i,event:"popup_click",popup_title:(d=e[t])==null?void 0:d.popup_title,action:(b=e[t])==null?void 0:b.action};break;case"onFormValidation":i={...i,event:"contact_form",label:(k=e[t])==null?void 0:k.label};break;case"onAddToCart":i={...i,event:"add_to_cart",origin:(v=e[t])==null?void 0:v.origin,ecommerce:{currency:(s=e[t])==null?void 0:s.currency,value:(((w=(f=(C=e[t])==null?void 0:C.product)==null?void 0:f.pricing)==null?void 0:w.retail)||0)/100,items:(L=e[t])!=null&&L.product?n([(h=e[t])==null?void 0:h.product],((P=e[t])==null?void 0:P.currency)||"",((I=e[t])==null?void 0:I.city)||"",c):[]}};break;case"onBeginCheckout":i={...i,event:"begin_checkout",ecommerce:{currency:(S=e[t])==null?void 0:S.currency,value:(D=e[t])==null?void 0:D.total,items:(A=e[t])!=null&&A.products?n(((N=e[t])==null?void 0:N.products)||[],((O=e[t])==null?void 0:O.currency)||"",((T=e[t])==null?void 0:T.city)||""):[]}};break;case"onPurchase":i={...i,event:"purchase",ecommerce:{email:(V=e[t])==null?void 0:V.email,transaction_id:(q=e[t])==null?void 0:q.transactionId,currency:(B=e[t])==null?void 0:B.currency,value:(E=e[t])==null?void 0:E.total,affiliation:c,payment_type:"cb",items:(U=e[t])!=null&&U.products?n(((F=e[t])==null?void 0:F.products)||[],((M=e[t])==null?void 0:M.currency)||"",((R=e[t])==null?void 0:R.city)||""):[]}};break;case"onDownloadApp":i={...i,event:"outbound_app",link_domain:($=e[t])==null?void 0:$.linkDomain,link_url:(j=e[t])==null?void 0:j.linkUrl};break;case"onCityChange":i={...i,event:"select_city",origin:(x=e[t])==null?void 0:x.origin,country:dt((Q=e[t])==null?void 0:Q.city),city:(z=e[t])==null?void 0:z.city};break;case"onLanguageChange":i={...i,event:"select_language",origin:(G=e[t])==null?void 0:G.origin,language:(H=e[t])==null?void 0:H.lang};break;case"onSocialClick":i={...i,event:"outbound_social_media",link_social_media:(J=e[t])==null?void 0:J.link};break;case"onLinkClick":i={...i,event:"userClick",event_action:"user_click",click_position:(K=e[t])==null?void 0:K.clickPosition,event_label:(W=e[t])==null?void 0:W.label,...(X=e[t])!=null&&X.blockTitle?{block_title:(Y=e[t])==null?void 0:Y.blockTitle}:{},...(Z=e[t])!=null&&Z.section?{section_title:(g=e[t])==null?void 0:g.section}:{},...(ee=e[t])!=null&&ee.blockPosition?{block_position:(te=e[t])==null?void 0:te.blockPosition}:{}};break;case"errorMessage":i={...i,event_category:"booking",event_action:"form-error",event_label:(ie=e[t])==null?void 0:ie.errorMessage,event_value:""};break;case"onViewItemList":i={...i,event:"view_item_list",ecommerce:{currency:(ce=e[t])==null?void 0:ce.currency,item_list_id:(ne=e[t])==null?void 0:ne.item_list_id,item_list_name:(oe=e[t])==null?void 0:oe.item_list_name,items:st((le=e[t])==null?void 0:le.items,o.getCityName(),(ae=e[t])==null?void 0:ae.category,(ue=e[t])==null?void 0:ue.date,(re=e[t])==null?void 0:re.quantity)}};break;case"onSelectItem":i={...i,event:"select_item",ecommerce:{currency:(me=e[t])==null?void 0:me.currency,item_list_id:(_e=e[t])==null?void 0:_e.item_list_id,item_list_name:(pe=e[t])==null?void 0:pe.item_list_name,items:yt((ye=e[t])==null?void 0:ye.items,(de=e[t])!=null&&de.city?(be=e[t])==null?void 0:be.city:o.getCityName(),(ke=e[t])==null?void 0:ke.category,(ve=e[t])==null?void 0:ve.date,(se=e[t])==null?void 0:se.quantity,c,o.getCityCurrency())}};break;case"onViewItem":i={...i,event:"view_item",ecommerce:{currency:(Ce=e[t])==null?void 0:Ce.currency,item_list_id:(fe=e[t])==null?void 0:fe.item_list_id,item_list_name:(we=e[t])==null?void 0:we.item_list_name,items:yt((Le=e[t])==null?void 0:Le.items,(he=e[t])!=null&&he.city?(Pe=e[t])==null?void 0:Pe.city:o.getCityName(),(Ie=e[t])==null?void 0:Ie.category,(Se=e[t])==null?void 0:Se.date,(De=e[t])==null?void 0:De.quantity,c,o.getCityCurrency())}};break;case"onRemoveFromCart":i={...i,event:"remove_from_cart",ecommerce:{currency:(Ae=e[t])==null?void 0:Ae.currency,value:(Ne=e[t])==null?void 0:Ne.total,items:(Oe=e[t])!=null&&Oe.products?n(((Te=e[t])==null?void 0:Te.products)||[],((Ve=e[t])==null?void 0:Ve.currency)||"",((qe=e[t])==null?void 0:qe.city)||"",c):[]}};break;case"onViewCart":i={...i,event:"view_cart",ecommerce:{currency:(Be=e[t])==null?void 0:Be.currency,value:(Ee=e[t])==null?void 0:Ee.total,items:(Ue=e[t])!=null&&Ue.products?n(((Fe=e[t])==null?void 0:Fe.products)||[],((Me=e[t])==null?void 0:Me.currency)||"",((Re=e[t])==null?void 0:Re.city)||"",c):[]}};break;case"addPaymentInfo":i={...i,event:"add_payment_info",ecommerce:{currency:($e=e[t])==null?void 0:$e.currency,value:(je=e[t])==null?void 0:je.total,transaction_id:(xe=e[t])==null?void 0:xe.transactionId,payment_type:"cb",items:(Qe=e[t])!=null&&Qe.products?n(((ze=e[t])==null?void 0:ze.products)||[],((Ge=e[t])==null?void 0:Ge.currency)||"",((He=e[t])==null?void 0:He.city)||"",c):[]}};break;case"onSelectDate":i={...i,event:"select_date",origin:(Je=e[t])==null?void 0:Je.origin,date:(Ke=e[t])==null?void 0:Ke.date};break;case"onSelectQuantity":i={...i,event:`selec_${(We=e[t])==null?void 0:We.type}`,origin:(Xe=e[t])==null?void 0:Xe.origin,action:(Ye=e[t])==null?void 0:Ye.action,[`${(Ze=e[t])==null?void 0:Ze.type}_nb`]:(ge=e[t])==null?void 0:ge.nb};break;case"onOutboundLink":i={...i,event:"outbound_links",link_domain:(et=e[t])==null?void 0:et.linkDomain,link_url:(tt=e[t])==null?void 0:tt.linkUrl};break;case"onVideoStart":i={...i,event:"video_start",video_title:(it=e[t])==null?void 0:it.title};break;case"onVideoComplete":i={...i,event:"video_complete",video_title:(ct=e[t])==null?void 0:ct.title};break;case"onNavigationClick":i={...i,event:"navigation_click",navigation_type:(nt=e[t])==null?void 0:nt.navigationType,position:"header"};break;case"onFileDownload":i={...i,event:"file_download",file_name:(ot=e[t])==null?void 0:ot.name.toLocaleLowerCase(),file_category:(lt=e[t])==null?void 0:lt.category};break;case"onMapInteraction":i={...i,event:"map_interaction",action:(at=e[t])==null?void 0:at.action};break;case"onUpgrade":i={...i,event:"upgrade",days_nb:(ut=e[t])==null?void 0:ut.days_nb,product_name:(mt=(rt=e[t])==null?void 0:rt.product_name)==null?void 0:mt.toLowerCase()};break;case"onUpsell":i={...i,event:"upsell",product_name:(pt=(_t=e[t])==null?void 0:_t.product_name)==null?void 0:pt.toLowerCase()};break}Object.keys(e).length!==0&&l.trackEvent(i)};export{ht as u};