1import{_ as le,a as ae,b as ie}from"./BUPx_Yo6.js";import{s as re,a as me}from"./CnNORy5k.js";import{a as ue,s as ce}from"./FiYZWnXF.js";import{_ as ee,o as s,c as w,a as $,t as O,j as h,h as o,H as Q,i as B,b as T,l as pe,e as X,J as fe,r as I,K as we,y as de,B as G,f as ve,a7 as _e,a8 as Y,A as Z,a5 as M,g as ye,w as x,m as W,k as ge,N as be,F as A,D as R}from"./DAqtiSCo.js";/* empty css *//* empty css */import"./C0MMMUCL.js";import"./CCK1C8MJ.js";/* empty css */const he={class:"popup-card"},je={class:"subtitle"},ke={style:{"overflow-y":"scroll","overflow-x":"hidden"}},xe={key:0,style:{display:"flex","justify-content":"space-between","align-items":"center","margin-top":"-2rem","margin-bottom":"1rem"}},Ne={key:0},ze={key:1},De={__name:"newsDialog",props:{item:Object},setup(u){return(t,C)=>{const j=le,m=pe;return s(),w("div",he,[C[0]||(C[0]=$("br",null,null,-1)),$("p",je,O(u.item.title),1),$("div",ke,[(s(),h(j,{image:u.item.image,key:u.item.image},null,8,["image"])),u.item.validTo||u.item.validFrom?(s(),w("div",xe,[u.item.validFrom?(s(),w("p",Ne,O(("t"in t?t.t:o(Q))("od"))+" "+O(t.$dayjs(u.item.validFrom).format("DD MMMM")),1)):B("",!0),u.item.validTo?(s(),w("p",ze,O(("t"in t?t.t:o(Q))("do"))+" "+O(t.$dayjs(u.item.validTo).format("DD MMMM")),1)):B("",!0)])):B("",!0),T(m,{content:u.item.content||u.item.description,style:{"font-size":"0.9rem"}},null,8,["content"])])])}}},$e=ee(De,[["__scopeId","data-v-feae7579"]]),Oe={style:{"overflow-y":"scroll","padding-bottom":"2rem"}},Fe={key:0},Ie={key:1},Be={class:"empty"},Ce={__name:"events",setup(u){var S,E,H;const t=ge(),C=X(()=>t.mall.internalOffers||t.mall.internalNews?[t.mall.internalOffers?{label:v("Promocje"),icon:null,empty:v("Åadowanie promocji"),value:"offers"}:null,t.mall.internalNews?{label:v("Wydarzenia"),icon:null,empty:v("Åadowanie wydarzeÅ"),value:"news"}:null].filter(Boolean):[{label:v("Promocje"),icon:null,empty:v("Åadowanie promocji"),value:"offers"},{label:v("Wydarzenia"),icon:null,empty:v("Åadowanie wydarzeÅ"),value:"news"}]),j=fe(),m=I(Number(((S=j==null?void 0:j.query)==null?void 0:S.page)||"offers")),d=I({offers:[],news:[]});we(()=>{const{bind:e,bindDoc:n,doc:_,collection:y,query:k,firestoreQueryBuilder:g}=de();console.log("event monted"),t.mall.internalOffers&&e(k(y("offers"),g({op:"and",items:[{field:"mall.id",op:"==",value:t.mall.id},{field:"active",op:"==",value:!0}]})),"offers",i=>{console.log("new offers",i),d.value.offers=G(i,r=>{const c=new Date;return(r.visibleTo?r.visibleTo>c:!0)&&(r.visibleFrom?r.visibleFrom<c:!0)})}).then(i=>{console.log("APP: offers loaded",i.length,JSON.stringify(i).length,"B")}),t.mall.internalNews&&e(k(y("news"),g({op:"and",items:[{field:"mall.id",op:"==",value:t.mall.id},{field:"active",op:"==",value:!0}]})),"news",i=>{d.value.news=G(i,r=>{const c=new Date;return(r.visibleTo?r.visibleTo>c:!0)&&(r.visibleFrom?r.visibleFrom<c:!0)})}).then(i=>{console.log("APP: news loaded",i.length,JSON.stringify(i).length,"B")})}),ve(()=>{var e;t.pageTitle=v("NowoÅci"),m.value=Number(((e=j==null?void 0:j.query)==null?void 0:e.page)||0)}),X(()=>_e().public.appConfig.projectId);const te=t.mall.externalOffersUrl||(t.projectId==="zlote-tarasy"?"https://zlotetarasy.pl/api/promotions?app=mobile":t.projectId==="whitestar-sloneczna"?"https://"+t.mall.mallWebsite+"/wp-json/extra-api/promotions":"https://"+((E=t.mall)==null?void 0:E.mallWebsite)+"/xml/galeria_promocje.xml"),J=t.mall.externalNewsUrl||(t.projectId==="zlote-tarasy"?"https://zlotetarasy.pl/api/news?app=mobile":t.projectId==="whitestar-sloneczna"?"https://"+t.mall.mallWebsite+"/wp-json/extra-api/events":"https://"+((H=t.mall)==null?void 0:H.mallWebsite)+"/xml/galeria_aktualnosci.xml"),ne=t.projectId==="zlote-tarasy"||t.projectId==="whitestar-sloneczna"?"app-getJsonRaw":"getJsonRaw",V=J.includes(".xml")?"app-getXmlRaw":ne;t.mall.internalOffers||(Y(V,{url:te}).then(e=>{var n;console.log("promotions",q,e.length),d.value.offers=Z(((n=e==null?void 0:e.newsList)==null?void 0:n.news)||(e==null?void 0:e.results)||(e==null?void 0:e.newsList)||e,_=>oe(_)),t.offers=d.value.offers}
1),Y(V,{url:J}).then(e=>{var n;console.log("news",q,e.length),d.value.news=Z(((n=e==null?void 0:e.newsList)==null?void 0:n.news)||(e==null?void 0:e.results)||(e==null?void 0:e.newsList)||e,_=>se(_)),t.news=d.value.news}));const q=M.lang;function oe(e){const n=e.news||e,{shop_name:_,title:y,excerpt:k,content:g,content_text:i,image:r,miniURL:c,publication_date:z,content_text_more:l,description:p,date_from:b,date_to:L,short:f,thumb_image:P}=n;function a(D){return(D==null?void 0:D[M.lang])||(D==null?void 0:D.pl)||D}const K=(b==null?void 0:b.date)||b;return{title:a(y),summary:a(k)||a(f)||a(p)||a(g)||a(i),content:a(g)||a(l)||a(p),image:a(r||P||c),publishedAt:z?new Date(z):new Date(K),dateFrom:b?new Date(K):null}}function se(e){const n=e.news||e,{title:_,content:y,content_text:k,image:g,miniURL:i,publication_date:r,content_text_more:c,description:z,date:l,date_from:p,short:b,thumb_image:L}=n;function f(a){return(a==null?void 0:a[M.lang])||(a==null?void 0:a.pl)||a}const P=(p==null?void 0:p.date)||p;return{title:f(_),summary:f(y)||f(b)||f(z)||f(k),content:f(y)||f(c)||f(z),image:f(g||L||i),publishedAt:r?new Date(r):new Date(P),dateFrom:p?new Date(P):null}}const N=I(!1),U=I(null),F=I(),{t:v}=ye("events",{en:{NowoÅci:"Current news",Promocje:"Promotions",Wydarzenia:"Events","Åadowanie promocji":"No promotions available","Åadowanie wydarzeÅ":"No planned events"},uk:{NowoÅci:"Ðовини",Promocje:"ÐкÑÑÑ",Wydarzenia:"ÐодÑÑ","Brak aktualnych promocji":"ÐÐµÐ¼Ð°Ñ Ð¿Ð¾ÑоÑниÑ
акÑÑй","Brak bieżÄ
cych wydarzeÅ":"ÐÐµÐ¼Ð°Ñ Ð¿Ð¾ÑоÑниÑ
подÑй"}});return(e,n)=>{const _=ae,y=me,k=re,g=ie,i=ue,r=ce,c=be,z=$e;return s(),w("div",null,[T(k,{active:o(m),"onUpdate:active":n[0]||(n[0]=l=>W(m)?m.value=l:null),sticky:"","line-width":"40%","offset-top":"60",border:"",style:{"z-index":"8"}},{default:x(()=>[(s(!0),w(A,null,R(o(C),l=>(s(),h(y,{title:l.label,name:l.value},{default:x(()=>[$("div",Oe,[o(d)[o(m)].length?(s(),w("div",Fe,[(s(!0),w(A,null,R(o(d)[o(m)],(p,b)=>(s(),h(_,{item:p,large:!0,onClick:L=>{U.value=p,N.value=!0,F.value=b}},null,8,["item","onClick"]))),256))])):(s(),w("div",Ie,[$("p",Be,O(l.empty),1)]))])]),_:2},1032,["title","name"]))),256))]),_:1},8,["active"]),n[5]||(n[5]=$("br",null,null,-1)),n[6]||(n[6]=$("br",null,null,-1)),o(m)==="offers"?(s(),h(c,{key:0,show:o(N),"onUpdate:show":n[1]||(n[1]=l=>W(N)?N.value=l:null),closeable:"",position:"bottom",round:"","safe-area-inset-bottom":"","safe-area-inset-top":"",class:"popup-style",onClose:n[2]||(n[2]=l=>{U.value=null,F.value=null})},{default:x(()=>[(s(),h(r,{"initial-swipe":o(F),key:o(m)},{default:x(()=>[(s(!0),w(A,null,R(o(d)[o(m)],l=>(s(),h(i,null,{default:x(()=>[T(g,{item:l,"no-swipe":""},null,8,["item"])]),_:2},1024))),256))]),_:1},8,["initial-swipe"]))]),_:1},8,["show"])):B("",!0),o(m)==="news"?(s(),h(c,{key:1,show:o(N),"onUpdate:show":n[3]||(n[3]=l=>W(N)?N.value=l:null),closeable:"",position:"bottom",round:"","safe-area-inset-bottom":"","safe-area-inset-top":"",class:"popup-style",onClose:n[4]||(n[4]=l=>{U.value=null,F.value=null})},{default:x(()=>[(s(),h(r,{"initial-swipe":o(F),key:o(m)},{default:x(()=>[(s(!0),w(A,null,R(o(d)[o(m)],l=>(s(),h(i,null,{default:x(()=>[T(z,{item:l,"no-swipe":""},null,8,["item"])]),_:2},1024))),256))]),_:1},8,["initial-swipe"]))]),_:1},8,["show"])):B("",!0)])}}},Ve=ee(Ce,[["__scopeId","data-v-77e28da0"]]);export{Ve 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.