1import{f as W}from"./chunk-ATBZ44BY.js";import{b as G,c as $,h as j,i as L,j as U,k as H,l as _,o as K}from"./chunk-GCS4DPN4.js";import"./chunk-DJ2VMUZB.js";import"./chunk-5VCLSKF7.js";import{b as X}from"./chunk-YEB46YOC.js";import{a as D}from"./chunk-R4ZOGL7K.js";import{a as M}from"./chunk-AELWALOR.js";import{b as y}from"./chunk-FW4363Y4.js";var E=y(D()),J=y(X());var r=y(D());var l=y(D()),S=({value:e,label:t,showColon:n=!0})=>l.default.createElement("div",{className:"flex items-center"},l.default.createElement("div",{className:`flex flex-col items-center ${n?"pr-22":""}`},l.default.createElement("div",{className:"text-[5.2rem] md:text-[7.8rem] font-extrabold relative"},e<10?`0${e}`:e,n&&l.default.createElement("div",{className:"w-1 border border-white opacity-70 absolute -right-22 top-20 bottom-15"})),l.default.createElement("div",{className:"text-12 font-extrabold uppercase opacity-70 tracking-[1px]"},t))),B=({drawDate:e,gameType:t,countdownLabel:n})=>{let s={lotto:"bg-lotto-red-1",vikinglotto:"bg-vikinglotto-blue-1",eurojackpot:"bg-black"},[a,p]=(0,l.useState)(null);(0,l.useEffect)(()=>{let m=()=>{let b=new Date().getTime(),g=new Date(e).getTime()-b;if(g<0){p({days:0,hours:0,minutes:0,seconds:0,totalHours:0});return}let T=Math.floor(g/(1e3*60*60*24)),f=Math.floor(g%(1e3*60*60*24)/(1e3*60*60)),x=Math.floor(g%(1e3*60*60)/(1e3*60)),C=Math.floor(g%(1e3*60)/1e3),N=Math.floor(g/(1e3*60*60));p({days:T,hours:f,minutes:x,seconds:C,totalHours:N})};m();let w=setInterval(m,1e3);return()=>clearInterval(w)},[e]);let c=a&&a.totalHours>24,d=a&&a.totalHours<=24;return l.default.createElement("div",{className:`flex flex-col gap-16 p-16 md:p-32 ${s[t.toLowerCase()||""]} rounded-32 flex-1 text-white`},n&&l.default.createElement("h3",{className:"text-14 font-bold text-center uppercase tracking-[1px]"},n.replace("{gameType}",t).replace("{drawDayName}",new Date(e).toLocaleDateString("da-DK",{weekday:"long"}))),a&&l.default.createElement("div",{className:"flex gap-22 justify-center"},c&&l.default.createElement(S,{value:a.days,label:"DAGE"}),l.default.createElement(S,{value:a.hours,label:"TIMER"}),l.default.createElement(S,{value:a.minutes,label:"MIN",showColon:!!d}),d&&l.default.createElement(S,{value:a.seconds,label:"SEK",showColon:!1})))};var o=y(D());var R="Europe/Copenhagen",ee=new Intl.DateTimeFormat("da-DK",{timeZone:R,year:"numeric",month:"numeric",day:"numeric"}),O=e=>{let t=ee.formatToParts(e),n=s=>Number(t.find(a=>a.type===s)?.value);return{year:n("year"),month:n("month"),day:n("day")}},te=e=>{let{year:t,month:n,day:s}=O(e),a=new Date(Date.UTC(t,n-1,s)),p=(a.getUTCDay()+6)%7;a.setUTCDate(a.getUTCDate()-p+3);let c=a.getUTCFullYear(),d=new Date(Date.UTC(c,0,4));return d.setUTCDate(d.getUTCDate()-(d.getUTCDay()+6)%7+3),{week:1+Math.round((a.getTime()-d.getTime())/(10080*60*1e3)),year:c}},F=e=>{if(!e)return null;let t=new Date(e);if(isNaN(t.getTime()))return null;let{week:n,year:s}=te(t),{year:a,month:p,day:c}=O(t);return{drawWeek:`${n}/${s}`,drawDate:`${c}.${p}.${a}`}};var u=y(D());var ae=-1,Z=e=>{if(!e)return null;let t=new Date(e);if(isNaN(t.getTime()))return null;let n=parseInt(t.toLocaleString("en-GB",{day:"numeric",timeZone:"Europe/Copenhagen"}),10),s=t.toLocaleString("da-DK",{month:"long",timeZone:"Europe/Copenhagen"}),a=t.toLocaleString("en-GB",{year:"numeric",timeZone:"Europe/Copenhagen"});return`${n} ${s.slice(0,3)}. ${a}`},oe=(e,t)=>e?e.replace(/{count}/gi,String(t)):null,A=({headline:e,date:t,rowCountText:n})=>u.default.createElement("div",{className:"w-full flex flex-col items-center gap-4 text-12"},u.default.createElement("div",{className:"font-bold"},e),u.default.createElement("div",{className:"w-full flex flex-row justify-between gap-8 px-8"},t&&u.default.createElement("span",null,t),n&&u.default.createElement("span",null,n))),V=({gameInfo:e})=>{let[t,n]=(0,u.useState)({}),s=e.campaigns,a=e.gameType.toLowerCase()==="lotto",p=s.length>0;if((0,u.useEffect)(()=>{!p||!a||_("NumberGames/ViewCoupon/Campaigns/ExtraCampaigns").then(m=>n(m.ExtraCampaigns??{})).catch(()=>n({}))},[p,a]),!p)return null;let c=Math.round(e.selectedRows);if(!a)return u.default.createElement(u.default.Fragment,null,s.map(m=>u.default.createElement(A,{key:m.id,headline:m.name,date:Z(m.date??e.drawDate),rowCountText:null})));let d=s.find(m=>m.id===ae);return d?u.default.createElement(A,{headline:t.MillionaireChanceHeadline||d.name,date:Z(e.drawDate),rowCountText:oe(c>1?t.MillionaireMultipleRowsCount:t.MillionaireSingleRowCount,c)}):null};var Y=({gameInfo:e,couponTitle:t,couponPlayWeekLabel:n,couponDescriptionLine1:s,couponDescriptionLine2:a,couponRowsLabel:p,couponS
1haresLabel:c,couponTotalLabel:d,couponFooterLabel:m,asteriskText:w})=>{let b={lotto:"/dlo/Components/DanskeSpil/Domain/Lotto/Graphics/SpriteSheets/LottoCommonIcons/icon-lotto_logo_vindertal_dark.svg",vikinglotto:"/dlo/Components/DanskeSpil/Domain/VikingLotto/Graphics/SpriteSheets/VikingLottoCommonIcons/icon-viking-helmet_darkgrey.svg",eurojackpot:"/dlo/Components/DanskeSpil/Domain/Eurojackpot/Graphics/SpriteSheets/EurojackpotCommonIcons/icon-eurojackpot_logo.svg"},v=F(e.drawDate);return o.default.createElement("div",{className:"flex flex-col w-302 bg-white rounded-b-32 bg-repeat bg-[url('/Components/DanskeSpil/Domain/NumberGames/Graphics/SpriteSheets/coupon-background.jpg')]"},o.default.createElement("div",{className:"flex flex-col justify-center items-center gap-24 mt-26 mb-30 px-16"},o.default.createElement("div",{className:"h-24"},o.default.createElement("img",{src:b[e.gameType.toLowerCase()],alt:e.gameType})),o.default.createElement("div",{className:"flex flex-col items-center gap-4 text-center"},t&&o.default.createElement("span",{className:"text-14 font-bold tracking-[0.5px]"},t),o.default.createElement("span",{className:"text-10 font-bold"},new Date(e.purchaseTime).toLocaleDateString("da-DK",{day:"numeric",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit"}))),(s||a)&&o.default.createElement("div",{className:"flex flex-col gap-4"},s&&o.default.createElement("span",{className:"text-14 font-bold tracking-[0.5px]"},s),a&&o.default.createElement("span",{className:"text-12"},a)),o.default.createElement("div",{className:"flex flex-col gap-4 items-center"},o.default.createElement("div",{className:"flex flex-row gap-4"},p&&o.default.createElement("span",{className:"text-12 font-bold"},p),o.default.createElement("span",{className:"text-12"},e.selectedRows," / ",e.rows,w&&"*")),o.default.createElement("div",{className:"flex flex-row gap-4"},c&&o.default.createElement("span",{className:"text-12 font-bold"},c),o.default.createElement("span",{className:"text-12"},e.selectedShares," / ",e.totalShares,w&&"*")),v&&o.default.createElement("div",null,o.default.createElement("h4",{className:"draw-week text-12 font-bold"},n&&`${n} `,v.drawWeek," - ",o.default.createElement("span",{className:"draw-date"},v.drawDate))),o.default.createElement(V,{gameInfo:e})),o.default.createElement("div",{className:"w-full flex flex-col gap-8 items-center"},o.default.createElement("div",{className:"w-full pt-24 pb-8 border-b flex flex-row justify-between"},d&&o.default.createElement("span",{className:"text-16 font-bold tracking-[0.5px]"},d),o.default.createElement("span",{className:"text-16 font-bold tracking-[0.5px]"},e.totalPrice," KR.")),m&&o.default.createElement("div",{className:"text-12"},m),w&&o.default.createElement("div",{className:"w-302 text-12 text-gray-500 text-center py-10"},w))))};var q=({title:e,subtitle:t,countdownLabel:n,couponTitle:s,couponPlayWeekLabel:a,couponDescriptionLine1:p,couponDescriptionLine2:c,couponRowsLabel:d,couponSharesLabel:m,couponTotalLabel:w,couponFooterLabel:b,asteriskText:v,receiptCTA:g,jackpots:T})=>{let f=H("gameKey")||null,[x,C]=(0,r.useState)(null);return(0,r.useEffect)(()=>{if(f){let N=sessionStorage.getItem(`SyndicatePlay-${f}`);if(N)try{let{game:i,quantity:h,purchaseTracked:z,purchaseTime:Q}=JSON.parse(N);if(C({gameKey:f,gameType:i.brand,rows:i.rows,selectedRows:i.rows/i.totalShares*h,totalShares:i.totalShares,selectedShares:h,pricePerShare:i.pricePerShare,totalPrice:i.pricePerShare*h,availableShares:i.availableShares,drawId:i.drawId,drawDate:i.drawDate,gameStatus:"active",purchaseTime:Q??new Date().toISOString(),campaigns:[]}),K(i.brand,i.drawId).then(k=>{k.length&&C(P=>P&&{...P,campaigns:k})}),!z){j(i,h,f),G({id:f,revenue:(i.pricePerShare*h).toString()},{name:i.brand,price:i.pricePerShare.toString(),variant:h.toString(),quantity:i.rows/i.totalShares*h,coupon:i.rows.toString()});let k={game:i,quantity:h,purchaseTracked:!0};sessionStorage.setItem(`SyndicatePlay-${f}`,JSON.stringify(k))}}catch{}}},[f]),(0,r.useEffect)(()=>{W(()=>{window.location.href="/spil-sammen"})},[]),r.default.createElement("div",{className:"flex flex-row md:flex-col items-center gap-64"},x&&r.default.createElement("div",{className:"flex flex-col md:flex-row gap-32 w-full max-w-1200
1justify-center items-stretch"},r.default.createElement("div",{className:"md:w-1/2 bg-white flex flex-col justify-center pt-60 md:py-136"},r.default.createElement("div",{className:"w-full max-w-[50rem] mx-auto flex flex-col items-center gap-32 md:gap-60"},r.default.createElement(L,{title:e,centered:!0},t&&r.default.createElement("div",{className:"text-16 whitespace-break-spaces tracking-[0.5px]",dangerouslySetInnerHTML:{__html:t.replace("{poolSize}",T?.[x.gameType]||"")}})),r.default.createElement("div",{className:"w-full max-w-424 mx-auto pb-32 md:pb-0"},r.default.createElement(B,{drawDate:x.drawDate,gameType:x.gameType,countdownLabel:n})),g?.url&&g?.text&&r.default.createElement($,{href:g.url,tracking:{action:"receipt_cta",ctaLabel:g.text}},g.text))),r.default.createElement("div",{className:"md:w-1/2 flex justify-center items-center bg-gray-100 rounded-b-32 md:rounded-r-32"},r.default.createElement("div",{className:"py-32 md:py-64"},r.default.createElement("div",{className:"w-320 h-10 bg-gray-400 rounded-full -mb-4 -mx-10"}),r.default.createElement("div",{className:"flex flex-col gap-32 items-center"},r.default.createElement(Y,{gameInfo:x,couponTitle:s,couponPlayWeekLabel:a,couponDescriptionLine1:p,couponDescriptionLine2:c,couponRowsLabel:d,couponSharesLabel:m,couponTotalLabel:w,couponFooterLabel:b,asteriskText:v}))))),!x&&f&&r.default.createElement(U,{centered:!0},r.default.createElement(L,{title:e,centered:!0}),r.default.createElement("p",{className:"text-center text-red-600"},"Kunne ikke hente spilinformation. Pr\xF8v igen senere.")))};var I=class extends M{constructor(t){super(t),this.init()}init(){let t=s=>E.default.createElement(q,{...s});(0,J.createRoot)(this.element).render(E.default.createElement(t,{...this.settings}))}},Ce=I;export{Ce as default}; 2//# sourceMappingURL=SyndicatePlayReceipt.entry.RAHUHBFA.js.map
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.