import{n as D,H as m,R as N,t as d,q as s,A as g,x as R,E as L,F as w,G as F,v as _,y as I,_ as A,u as x,a3 as K,a6 as H,L as S,w as z,Y as O,N as U,a2 as W,p as C,B,r as k,a9 as j,z as q,a4 as G,D as E,a0 as M}from"./C-p8iwFB.js";import{_ as Y}from"./CLiMtjFX.js";import{_ as T}from"./CGEZKsSZ.js";import{E as J}from"./0J232JST.js";import{p as Q,a as P}from"./Dr5sbCdv.js";import{P as X}from"./BcFO11Td.js";const Z={key:0,class:"tabs",role:"tablist"},ee=["id","aria-selected","aria-controls","onClick"],te=D({__name:"CountryTabs",props:{hideTabs:{type:Boolean},tabs:{}},setup(n,{emit:i}){const p=n,f=i,o=m(p.tabs),c=m(0),b=m(!0),h=m([]),e=r=>{c.value=r,o.value.forEach((y,t)=>{y.isActive=t===r}),f(J.CLICK,r)};return N(()=>{e(0),b.value=!1}),(r,y)=>(s(),d("div",{class:g({invisible:b.value})},[r.hideTabs?R("",!0):(s(),d("div",Z,[(s(!0),d(w,null,F(o.value,(t,a)=>(s(),d("div",{key:`tab-${a}`,class:g(["tab-container",{active:c.value===a}])},[_("button",{id:`tab-${a}`,ref_for:!0,ref_key:"tabButtons",ref:h,role:"tab","aria-selected":c.value===a?"true":"false","aria-controls":`panel-${a}`,onClick:l=>e(a)},I(t.title),9,ee)],2))),128))])),L(r.$slots,"default",{},void 0,!0)],2))}}),oe=A(te,[["__scopeId","data-v-a8ced42b"]]),ae={class:"price-list"},se=D({__name:"CountryTab",props:{title:{},id:{},countries:{},defaultCountry:{},tabCorner:{type:Boolean},noRightBox:{type:Boolean},pricelist:{}},setup(n,{expose:i}){const{t:p,locale:f}=x(),o=n,c=m(0),b=m(null),h=m(!0),e=m(null),r=(t,a)=>{if(b.value=t,c.value=a,o.countries[a].code==="li"){e.value=(o.pricelist||[]).find(l=>l.slug==="ch");return}e.value=(o.pricelist||[]).find(l=>{var v;return l.slug===((v=b.value)==null?void 0:v.code)})},y=({price:t,currency:a})=>{const l=Q(f.value,t,{currency:a}),v=p("global.countryTab.from");switch(f.value){case S.HU:return l+v;default:return`${v} ${l}`}};return N(()=>{let t=o.countries.findIndex(a=>a.code===o.defaultCountry);t<0&&(t=0),r(o.countries[t],t)}),i({isActive:h,title:o.title,id:o.id}),(t,a)=>K((s(),d("div",ae,[_("div",{class:g(["tab-content",{"tab-corner":t.tabCorner}])},[_("ul",{class:g(["countries-text countries-list",{"one-column":t.countries.length<10}])},[L(t.$slots,"flags",{showPrices:r,activeLabel:c.value},void 0,!0)],2)],2),_("div",{class:g([t.noRightBox?"image-container":"price-container"])},[L(t.$slots,"price",{activeCountry:b.value,prettyFromPrice:y,prices:e.value},void 0,!0)],2)],512)),[[H,h.value]])}}),re=A(se,[["__scopeId","data-v-bbf18f57"]]),ne={class:"pb-120"},ie={class:"bg-grey-50"},le=["tabindex","onClick","onKeyup"],ce=D({__name:"CountryInfo",props:{countryTabs:{},pricelist:{},tabsTeaser:{},hideTabs:{type:Boolean},image:{},noRightBox:{type:Boolean},deliveryFrom:{type:Boolean},returnFrom:{type:Boolean}},setup(n){const i=O(),p=z[i.public.webId].countryCode,o=U().$pages,c=m([]),b=e=>{if(e){const r=c.value;r.find(y=>y.id===e.id)||(r.push(e),c.value=r)}},h=e=>({name:o.whereWeDeliverCountry,params:{country:e.code}});return(e,r)=>{const y=W("editable");return s(),d("div",ne,[_("div",ie,[_("div",{class:g(["box container pb-48",{"no-right-box":e.noRightBox}])},[e.tabsTeaser?(s(),C(Y,{key:0,content:e.tabsTeaser},{default:k(({data:t})=>[B(j,{line1:t.line1,level:"h2",line2:t.line2},null,8,["line1","line2"])]),_:1},8,["content"])):R("",!0),B(oe,{"hide-tabs":e.hideTabs,tabs:c.value},{default:k(()=>[(s(!0),d(w,null,F(e.countryTabs,(t,a)=>K((s(),C(re,{id:`country-tabs-tab-${a}`,key:t._uid,ref_for:!0,ref:b,title:t.region,countries:t.countries,pricelist:e.pricelist,"default-country":q(p),"no-right-box":e.noRightBox},{flags:k(({showPrices:l,activeLabel:v})=>[(s(!0),d(w,null,F(t.countries,(u,$)=>(s(),d("li",{key:u.id,class:g([{active:$===v,"not-active":!t.countryLink&&e.noRightBox},"country-element"]),tabindex:e.noRightBox?-1:0,onClick:V=>l(u,$),onKeyup:G(V=>l(u,$),["enter"])},[t.countryLink?(s(),C(M,{key:1,to:h(u),class:"country-link"},{default:k(()=>[B(T,{"src-static":u.flag.filename,alt:u.flag.alt},null,8,["src-static","alt"]),E(" "+I(u.name),1)]),_:2},1032,["to"])):(s(),d("span",{key:0,class:g([{"not-link":e.noRightBox},"country-link"])},[B(T,{"src-static":u.flag.filename,alt:u.flag.alt},null,8,["src-static","alt"]),E(" "+I(u.name),1)],2))],42,le))),128))]),price:k(({activeCountry:l,prices:v})=>[e.noRightBox?e.image?(s(),C(T,{key:1,class:"ms-xl-64 img-fluid",src:e.image.filename,alt:e.image.alt},null,8,["src","alt"])):R("",!0):(s(),C(X,{key:0,"active-country":l||void 0,prices:v,"return-from":e.returnFrom,"delivery-from":e.deliveryFrom},null,8,["active-country","prices","return-from","delivery-from"]))]),_:2},1032,["id","title","countries","pricelist","default-country","no-right-box"])),[[y,t]])),128))]),_:1},8,["hide-tabs","tabs"])],2)])])}}}),be=A(ce,[["__scopeId","data-v-76f4477f"]]),ye=n=>{try{return n?Object.keys(n).filter(i=>i.includes("pickupPointPrice")).map(i=>{const p=i.replace("pickupPointPrice",""),f=n.prefix,o=n.postfix;return{slug:p.toLowerCase(),pickupPointPriceFormatted:P(n[i],f,o),homeDeliveryPriceFormatted:P(n[`homeDeliveryPrice${p}`],f,o),returnPackagePriceFormatted:P(n[`reverseLogisticsPrice${p}`],f,o)}}):[]}catch(i){return console.error("ERROR: getPriceList",i),[]}};export{be as C,oe as a,ye as g}; //# sourceMappingURL=D-AxJQh-.js.map