import{g as r,j as y,_,a7 as w,o,b as n,a as s,ai as h,s as u,d as I,c as g,l as f,ag as A,y as v,r as k}from"./n9X0QzKa.js";const c=e=>{var a,i;const t=r("delayAd",()=>0);t.value=((i=(a=y().value)==null?void 0:a.find(({key:m})=>m===e))==null?void 0:i.delayAdDisplay)??0};c.decrementTime=()=>{const e=r("delayAd");return e.value>0&&(e.value-=1),e.value};const C={props:{adInfo:{type:Object,required:!0}},emits:["close"],setup(){return c("wa"),{page:w("page")}},data(){var e,t;return{open:(e=this.adInfo)==null?void 0:e.adType,timeRemaining:parseInt(((t=this.adInfo)==null?void 0:t.adLength)??0)}},computed:{headerLogo(){var e,t,a,i;return((t=(e=this.$ss)==null?void 0:e.header)==null?void 0:t.prestitialLogo)??((i=(a=this.$ss)==null?void 0:a.header)==null?void 0:i.logo)},shouldAdDisplay(){return r("delayAd").value===0}},mounted(){this.delayTimer(),window.setTimeout(this.reduceElapsed,this.adInfo.adDelay*1e3),this.recalculateAdTagFrameSize(),window.setTimeout(this.recalculateAdTagFrameSize,300)},methods:{recalculateAdTagFrameSize(){var e;(e=this.$refs.adTagFrame)!=null&&e.contentWindow&&(this.$refs.adTagFrame.height=this.$refs.adTagFrame.contentWindow.document.body.scrollHeight+"px",this.$refs.adTagFrame.width=this.$refs.adTagFrame.contentWindow.document.body.scrollWidth+"px"),window.setTimeout(this.recalculateAdTagFrameSize,300)},reduceElapsed(){this.timeRemaining===1?this.close():(this.shouldAdDisplay&&(this.timeRemaining=this.timeRemaining-1),window.setTimeout(this.reduceElapsed,1e3))},delayTimer(){c.decrementTime()>0&&window.setTimeout(this.delayTimer,1e3)},close(){this.$emit("close")}}},b={class:v(["gam-welcome-ad","alternate-view"]),style:{background:"rgba(68,68,68,.97)"}},p={class:"top"},F={class:"continue"},E={class:"ad-modal"},N=["href"],D=["src"],S=["srcdoc"],x={class:"continue"};function L(e,t,a,i,m,d){const T=k;return a.adInfo&&d.shouldAdDisplay?(o(),n(A,{key:0,to:"body"},[s("div",b,[s("div",p,[(o(),n(h(a.adInfo.adType==="welcomeAdImage"?"a":"div"),{href:a.adInfo.adClickUrl,target:"_blank",class:"logo"},{default:u(()=>[I(T,{src:`${d.headerLogo.split("?")[0]}?h=40`,alt:e.$ss.general.siteName},null,8,["src","alt"])]),_:1},8,["href"])),s("div",F,[s("div",{class:"text",onClick:t[0]||(t[0]=(...l)=>d.close&&d.close(...l))}," CLOSE AND CONTINUE TO SITE > ")])]),(o(),n(h(a.adInfo.adType==="welcomeAdImage"?"a":"div"),{class:"main",onClick:d.close},{default:u(()=>[s("div",E,[s("div",{class:"ad-modal close-icon",onClick:t[1]||(t[1]=()=>d.close())}," X "),s("a",{href:a.adInfo.adClickUrl,target:"_blank"},[a.adInfo.adType==="welcomeAdImage"?(o(),g("img",{key:0,src:a.adInfo.adImagePath},null,8,D)):a.adInfo.adType==="welcomeAdTag"?(o(),g("iframe",{key:1,ref:"adTagFrame",srcdoc:a.adInfo.adTag,width:"300",height:"250",border:"0",style:{border:0},scrolling:"no"},null,8,S)):f("",!0)],8,N),s("div",x,[s("div",{class:"text",onClick:t[2]||(t[2]=(...l)=>d.close&&d.close(...l))}," CONTINUE TO SITE> ")])])]),_:1},8,["onClick"]))])])):f("",!0)}const O=_(C,[["render",L]]);export{O as default};