import{_ as x}from"./icon-warning_white.js";import{o as _,c as p,a as f,t as v,f as S,_ as g,y as o,Q as D,H as k,R as M}from"./index.js";const A={class:"main-menu-draw-ticket-timer"},N=f("img",{class:"main-menu-draw-ticket-timer__icon",src:x},null,-1),$={class:"main-menu-draw-ticket-timer__text"},B={key:0,class:"main-menu-draw-ticket-timer__time"};function H(n,r,a,t,l,c){return _(),p("div",A,[N,f("div",$,v(t.text),1),t.isShowDisplayTime?(_(),p("div",B,v(t.formattedDisplayTime),1)):S("",!0)])}const I={props:["openParams"],data:()=>({noAdaptation:!0}),setup(n){const r=o(""),a=o(0),t=o(0),l=o(!1),c=o(!1),m=o(new Date().getTime()),u=o(null),h=e=>r.value=e,T=e=>a.value=e,y=e=>t.value=e,w=D(()=>{const e=Math.floor(a.value/3600).toString().padStart(2,"0"),i=Math.floor(a.value%3600/60).toString().padStart(2,"0"),s=Math.floor(a.value%3600%60).toString().padStart(2,"0");return e>0?`${e}ч. ${i}м.`:`${i}м. ${s}с.`});if(n.openParams){const[e,i,s]=n.openParams;h(e),T(i),y(s),s>0&&(l.value=!0),i>0&&(c.value=!0)}const d=()=>clearInterval(u.value);return k(()=>{u.value=setInterval(()=>{const e=Math.round((new Date().getTime()-m.value)/1e3);m.value=new Date().getTime(),a.value=Math.max(a.value-e,0),t.value=Math.max(t.value-e,0),t.value<=0&&l.value&&window.closeInterface("AlertNotification"),t.value<=0&&a.value<=0&&d()},1e3)}),M(d),{text:r,formattedDisplayTime:w,isShowDisplayTime:c}}},C=g(I,[["render",H]]);export{C as default};
