import Z from"./B7R0KftR.js";import J from"./Xw-NRrHd.js";import K from"./7CJg1zA0.js";import Q from"./D-dwsp7D.js";import X from"./YMgwR3Gi.js";import{a as Y,s as h,u as ee,b as oe,e as te,H as ae,r as d,z as se,f as L,h as ne,M as re,m as P,j as _,l as u,k as f,i as I,A as k,w as C,p as n,D as ie,T as N,Z as le,t as D,v as ce,C as ue}from"./BCLrUOBx.js";import{u as pe}from"./CCot8u0_.js";import"./CE6lP_wf.js";import"./DQR9alpc.js";import"./CWalxxGV.js";import"./CTAcmMAz.js";import"./Chg4k-Cc.js";import"./a5umXhxZ.js";import"./Bxmfm8sn.js";import"./Di7fl9dA.js";import"./BnLnKt_p.js";import"./Ce8lFovl.js";import"./DRQhQ4ga.js";import"./D7xsgz5m.js";import"./BEgkQibR.js";import"./Bvs3L9q-.js";import"./7BSVXI-E.js";import"./9ejc9Ihm.js";import"./x_rD_Ya3.js";const me={key:0,class:"popup-banner-wrapper"},de={class:"flex gap-15"},_e={class:"f-9"},Fe={__name:"default",setup(fe){const w=Y(),{profile:ge}=h(w),{setProfile:ve,getUserToken:be}=w,E=ee(),{currentLanguage:T}=h(E),B=oe(),{setting:l,site_setting:p,popupBanner:g,toastMessage:$,toastError:x,toastMessageStatus:V}=h(B),{hideToast:H,getRequest:ye}=B,{commonMeta:j}=pe();te(j(p.value));const v=ae(),b=d(!0),z=d(null);d(!1);const y=d(!1),{status:U}=se(),R=L(()=>{var e;return y.value&&parseInt((e=g.value)==null?void 0:e.status)===1}),A=L(()=>{var e;return((e=v==null?void 0:v.name)==null?void 0:e.split("___")[0])||"error"}),F=()=>{localStorage.setItem("cookieBannerClosed",!0),b.value=!0},G=e=>{window.dataLayer=window.dataLayer||[];function t(){window.dataLayer.push(arguments)}t("js",new Date),t("config",e)},W=({id:e,url:t})=>{z.value=e+"-"+Date.now(),router.push({path:t})},S=()=>{localStorage.setItem("popupBannerClosed",!0),M()},M=()=>{y.value=!1,document.body.classList.remove("no-scroll")},O=e=>{(function(t,r,i,c,o,a,s){t.fbq||(o=t.fbq=function(){o.callMethod?o.callMethod.apply(o,arguments):o.queue.push(arguments)},t._fbq||(t._fbq=o),o.push=o,o.loaded=!0,o.version="2.0",o.queue=[],a=r.createElement(i),a.async=!0,a.src=c,s=r.getElementsByTagName(i)[0],s.parentNode.insertBefore(a,s))})(window,document,"script","https://connect.facebook.net/en_US/fbevents.js"),fbq("init",e),fbq("track","PageView")};return ne(()=>{var e,t,r,i,c,o,a,s;if(document.body.classList.add(((e=T.value)==null?void 0:e.direction)||"ltr"),(t=p.value)!=null&&t.primary_color&&(document.documentElement.style.setProperty("--primary-color",p.value.primary_color),document.documentElement.style.setProperty("--primary-hover-color",p.value.primary_hover_color)),b.value=!((r=l.value)!=null&&r.cookie_banner)||localStorage.getItem("cookieBannerClosed",!1),!localStorage.getItem("popupBannerClosed",!1)&&parseInt((i=g.value)==null?void 0:i.status)===U.PUBLIC&&(document.body.classList.add("no-scroll"),y.value=!0),(c=l.value)!=null&&c.enable_ga){const m=document.createElement("script");m.src="https://www.googletagmanager.com/gtag/js?id="+((o=l.value)==null?void 0:o.ga_id),m.async=!0,document.head.appendChild(m),m.onload=()=>{var q;G((q=l.value)==null?void 0:q.ga_id)}}(a=l.value)!=null&&a.enable_pixel&&O((s=l.value)==null?void 0:s.pixel_id)}),(e,t)=>{const r=Z,i=J,c=K,o=Q,a=X,s=re("outside-click");return _(),P("div",{class:ue(n(A))},[u(N,{name:"fade",mode:"out-in"},{default:C(()=>[n(R)?(_(),P("div",me,[ie(u(r,{class:"popup-banner",banner:n(g),onClose:S,onClicked:S},null,8,["banner"]),[[s,M]])])):k("",!0)]),_:1}),u(i,{onGoingNext:W}),f("main",null,[le(e.$slots,"default")]),u(c),u(N,{name:"fade",mode:"out-in"},{default:C(()=>[n(V)?(_(),I(o,{key:0,"is-error":n(x),onHide:n(H),message:n($)},null,8,["is-error","onHide","message"])):k("",!0)]),_:1}),n(b)?k("",!0):(_(),I(a,{key:0,class:"cookie-banner","elem-id":"cookie-pop-over","layer-on-responsive":!1,layer:!1},{content:C(()=>[f("div",de,[f("p",_e,D(e.$t("date.cb")),1),f("button",{onClick:ce(F,["prevent"]),class:"outline-btn plr-15"},D(e.$t("date.gi")),1)])]),_:1}))],2)}}};export{Fe as default};
