1import{d as h,b as l,e as s,f as n,t as g,_ as v,c as b,u as a,h as d,F as I,g as D,i as p,l as W,y as V,n as M,z as P}from"./_plugin-vue_export-helper.js";import{s as E,c as H}from"./pinia.js";import{G as U}from"./theme.js";import{u as m}from"./globalConfigStore.js";import{u as R}from"./useBadges.js";import{L as T}from"./LoadingIndicator.js";import{U as k}from"./UnknownError.js";import{u as F}from"./useWallet.js";import{u as q}from"./ngpsStore.js";import{u as z,a as G,b as K,N as O}from"./NativeDialog.js";import{v as j}from"./validateConfigId.js";import"./getVouchers.js";import"./throttle.js";import"./userProfileStore.js";const X={class:"wallet-badge"},J={class:"wallet-badge__icon"},Q=["src","alt"],Y={class:"wallet-badge__name"},Z=h({__name:"WalletBadge",props:{imageUrl:{},name:{}},setup(o){return(e,t)=>(l(),s("li",X,[n("picture",J,[n("img",{src:e.imageUrl,alt:e.name},null,8,Q)]),n("p",Y,g(e.name),1)]))}}),ee=v(Z,[["__scopeId","data-v-572191da"]]),ae={key:1,class:"wallet-badges"},le={class:"wallet-badges__title"},te={key:0,class:"wallet-badges__items"},se=["innerHTML"],ne=["href"],B=6,ie=h({__name:"WalletBadges",setup(o){const{digitalWalletViewAllCtaLabel:e,digitalWalletBadgesTitle:t,digitalWalletNoBadgesDescription:i}=m().getLabels,{badges:r,errorOccurred:c,requestPending:u}=R(!0),{viewAllBadges:C}=m().getConfigData.urls,_=b(()=>r.value?r.value.slice(0,B):null),f=b(()=>_.value?.length>0),w=b(()=>_.value?.length===0),y=b(()=>r.value?.length>B);return($,L)=>a(c)?(l(),d(k,{key:0})):(l(),s("div",ae,[n("h3",le,g(a(t)),1),a(u)?(l(),d(T,{key:0})):(l(),s(I,{key:1},[f.value?(l(),s("ul",te,[(l(!0),s(I,null,D(_.value,(A,S)=>(l(),d(ee,{key:S,"image-url":A.imgUrl,name:A.prizeName},null,8,["image-url","name"]))),128))])):p("",!0),w.value?(l(),s("div",{key:1,class:"wallet-badges__no-items",innerHTML:a(i)},null,8,se)):p("",!0),y.value?(l(),s("a",{key:2,class:"wallet-view-all-badges button-secondary",href:a(C)},g(a(e)),9,ne)):p("",!0)],64))]))}}),re=v(ie,[["__scopeId","data-v-6daf238e"]]),oe={class:"wallet-currency"},ce=["src","alt"],ue={class:"wallet-currency__content"},de={class:"wallet-currency__name"},ge={class:"wallet-currency__amount"},_e={key:0,class:"wallet-currency__expiring"},pe=h({__name:"WalletCurrency",props:{amount:{},imageUrl:{},name:{},expiring:{}},setup(o){const e=o,t=m().getLabels,{enableExpiringWallet:i}=m().getConfigData,r=t.digitalWalletExpiringCurrencyLabel?.replace("%EXPIRING_CURRENCIES_NUM%",`${e.expiring}`);return(c,u)=>(l(),s("li",oe,[n("img",{class:"wallet-currency__icon",src:c.imageUrl,alt:c.name},null,8,ce),n("div",ue,[n("p",de,g(c.name),1),n("p",ge,g(c.amount),1)]),a(i)&&a(r)&&c.expiring?(l(),s("p",_e,g(a(r)),1)):p("",!0)]))}}),x=v(pe,[["__scopeId","data-v-16a377a4"]]),me={class:"wallet-all-currencies__content"},fe=["id"],ye=["id","innerHTML"],be={class:"wallet-all-currencies__items"},he=h({__name:"WalletViewAllCurrencies",props:{currencies:{}},setup(o){const e=o,t=m().getLabels,i=t.digitalWalletViewAllCurrenciesDescription?.replace("%CURRENCIES_NUM%",`<strong>${e.currencies.length}</strong>`),{requestCloseDialog:r,requestOpenDialog:c,setDialogRef:u}=z({name:"wallet-all-currencies",priority:"manual",allowBackdropClose:!0,allowKeyboardClose:!0}),{dialogDetailsId:C,dialogHeadingId:_}=G(K());return(f,w)=>(l(),s(I,null,[n("button",{class:"wallet-view-all-currencies button-secondary",onClick:w[0]||(w[0]=()=>a(c)())},g(a(t).digitalWalletViewAllCtaLabel),1),W(O,{class:"wallet-all-currencies","close-modal":a(r),"modal-label":a(t).digitalWalletViewAllCurrenciesTitle,"close-modal-label":a(t).digitalWalletViewAllCloseCtaLabel,"dialog-ref-assn-fn":a(u),inverse:""},{default:V(()=>[n("div",me,[n("h2",{id:a(_),class:"wallet-all-currencies__title"},g(a(t).digitalWalletViewAllCurrenciesTitle),9,fe),n("p",{id:a(C),class:"wallet-all-currencies__description",innerHTML:a(i)},null,8,ye),n("ul",be,[(l(!0),s(I,null,D(f.currencies,y=>(l(),d(x,{key:y.currencyName,amount:y.amount,"image-url":y.currencyIcon,name:y.currencyName,expiring:y.expiring},null,8,["amount","image-url","name","expiring"]))),128))])])]),_:1}
1,8,["close-modal","modal-label","close-modal-label","dialog-ref-assn-fn"])],64))}}),Ce=v(he,[["__scopeId","data-v-5f8b9067"]]),we={key:1,class:"wallet-currencies"},ve={class:"wallet-currencies__title"},Ie={key:0,class:"wallet-currencies__items"},$e=["innerHTML"],N=6,We=h({__name:"WalletCurrencies",setup(o){const{currencies:e,errorOccurred:t}=F(),{isLoading:i}=E(q()),{digitalWalletCurrenciesTitle:r,digitalWalletNoCurrenciesDescription:c}=m().getLabels,u=b(()=>e.value?e.value.slice(0,N):null),C=b(()=>u.value?.length>0),_=b(()=>u.value?.length===0),f=b(()=>e.value?.length>N);return(w,y)=>a(t)?(l(),d(k,{key:0})):(l(),s("div",we,[n("h3",ve,g(a(r)),1),a(i)?(l(),d(T,{key:0})):(l(),s(I,{key:1},[C.value?(l(),s("ul",Ie,[(l(!0),s(I,null,D(u.value,($,L)=>(l(),d(x,{key:L,amount:$.amount,"image-url":$.currencyIcon,name:$.currencyName,expiring:$.expiring},null,8,["amount","image-url","name","expiring"]))),128))])):p("",!0),_.value?(l(),s("div",{key:1,class:"wallet-currencies__no-items",innerHTML:a(c)},null,8,$e)):p("",!0),f.value?(l(),d(Ce,{key:2,currencies:a(e)},null,8,["currencies"])):p("",!0)],64))]))}}),De=v(We,[["__scopeId","data-v-2c5d3114"]]),ke={class:"wallet-heading"},Le={class:"wallet-heading__title"},Ae={class:"wallet-heading__description"},Be=h({__name:"WalletHeading",setup(o){const{digitalWalletTitle:e,digitalWalletDescription:t}=m().getLabels;return(i,r)=>(l(),s("div",ke,[n("h1",Le,g(a(e)),1),n("p",Ae,g(a(t)),1)]))}}),Ne=v(Be,[["__scopeId","data-v-54b3b7bf"]]),Te={class:"digital-wallet"},xe=["innerHTML"],Se={class:"digital-wallet__content-items"},Ve=h({__name:"DigitalWalletSummary",setup(o){const t=m().getConfigData,i=t.promoDescription.imageId?document.querySelector(`#${t.promoDescription.imageId} picture`):null,r=i?.querySelector("img");return(c,u)=>(l(),s("div",Te,[a(r)?(l(),s("div",{key:0,class:"digital-wallet__image",innerHTML:a(i).outerHTML},null,8,xe)):p("",!0),n("div",{class:M(["digital-wallet__content",a(t).enableBadges?"digital-wallet__content--with-badges":""])},[W(Ne),n("div",Se,[W(De),a(t).enableBadges?(l(),d(re,{key:0})):p("",!0)])],2)]))}}),Me=v(Ve,[["__scopeId","data-v-8d9bf468"]]),Pe=h({__name:"App",props:{globalProps:{}},setup(o){const e=o;m().updateConfigData(e.globalProps);const t=j();return(i,r)=>a(t)?(l(),d(Me,{key:0})):(l(),d(k,{key:1}))}}),Ee=o=>{const e=o?.split(",")||[""],t=e[0],i=e.length>1?e.slice(1).join(", "):null;return{configurationId:t,configurationIds:i}},Ze=async o=>{const{parsedGeneralData:e,promoPlusConfig:t}=U(o),i=o.getAttribute("id"),{configurationId:r,configurationIds:c}=Ee(e.badgesConfigurationId),{ngpsApiKey:u,ngpsApiUrl:C}=e.ngpsApi||{},_={globalProps:{labels:e.labels||{},ngpsConfig:t,badgesConfig:{configurationId:r,configurationIds:c,ngpsApiKey:u,ngpsApiUrl:C},enableDynamicConfigurationIds:e.enableDynamicConfigurationIds,appId:i,allowedConfigurationIds:e.allowedConfigurationIds,enableBadges:e.enableBadges,enableExpiringWallet:e.enableExpiringWallet,enableCurrencyFilteringByAge:e.enableCurrencyFilteringByAge,reCaptchaSiteKey:e.reCaptchaSiteKey,filteringVouchersByStatus:e.filteringVouchersByStatus,filteringPrizeIDs:e.filteringPrizeIDs,urls:e.urls,promoDescription:e.promoDescription,ageFilteringConfig:e.ageFilteringConfig}},f=P(Pe,_),w=H();f.use(w),f.mount(`#${i}`)};export{Ze as init};
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.