import{U as v}from"./Button4.js";import{C as S}from"./Button.js";import{f as y}from"./numbers.js";import{r as h,o,c,a as s,F as l,i as m,n as d,t as a,e as b,f,h as r,w as C,p as E,g as w,_ as x}from"./index.js";/* empty css                                                      */import"./telegram-authenticator.js";import"./close2.js";import"./donate.js";import"./money.js";const i=t=>(E("data-v-151959bb"),t=t(),w(),t),N={class:"iface-centered machinist--container"},P={class:"machinist-head"},g={class:"machinist-head__col"},B=i(()=>s("div",{class:"machinist-head--dummy"},null,-1)),M=i(()=>s("div",{class:"machinist-head--dummy"},null,-1)),O={class:"machinist-semaphore machinist-section"},k=i(()=>s("div",{class:"signal__after"},null,-1)),D=[k],I={class:"machinist-head__col machinist-head--pattern"},J=i(()=>s("div",{class:"machinist-head--pattern__top"},[s("div",{class:"machinist-head--dummy"}),s("div",{class:"machinist-head--dummy"})],-1)),Y={class:"machinist-head--pattern__bottom"},T={class:"machinist-section"},A=i(()=>s("div",{class:"machinist-head--dummy"},null,-1)),K=[A],V={class:"machinist-data"},W={class:"machinist-data__row machinist-section"},F=i(()=>s("div",{class:"col"},"Держите скорость",-1)),U={class:"col"},z={class:"machinist-data__row machinist-section"},L=i(()=>s("div",{class:"col"},"Скорость",-1)),j={class:"col"},q={key:0,class:"machinist-data__row machinist-section"},G={class:"col"},H={class:"subtitle"},Q={class:"col"},R={class:"hint"},X={class:"machinist-data__row machinist-section"},Z=i(()=>s("div",{class:"col"},"Заработано",-1)),$={class:"col"},ss=i(()=>s("div",{class:"text"},"Нажмите C для завершения работы",-1));function ts(t,is,os,ns,e,n){const p=h("ControlsButton"),u=h("SubmitButton");return o(),c("div",N,[s("div",{class:d(["machinist",{machinist_mobile:n.isMobile}])},[s("div",P,[s("div",g,[B,M,s("div",O,[(o(!0),c(l,null,m(e.semaphore,_=>(o(),c("div",{class:d(["signal",{red:!_,green:_}])},D,2))),256))])]),s("div",I,[J,s("div",Y,[(o(),c(l,null,m(2,_=>s("div",T,K)),64))])])]),s("div",V,[s("div",W,[F,s("div",U,a(e.speed.value)+" км/ч",1)]),s("div",z,[L,s("div",j,[s("div",{class:d(["text",e.SPEED_TYPES[e.speed.type].color])},a(e.SPEED_TYPES[e.speed.type].text),3)])]),e.station.show?(o(),c("div",q,[s("div",G,[b("Следующая станция"),s("div",H,a(e.station.name),1)]),s("div",Q,[s("div",R,a(n.formatNumberWithSpaces(e.station.distance))+" м",1)])])):f("",!0),s("div",X,[Z,s("div",$,a(n.formatNumberWithSpaces(e.money))+" руб.",1)]),n.isMobile?(o(),r(p,{key:1,keyCode:e.KEY_CODE_C,text:"Завершить работу",mobileAdaptive:n.isMobile},null,8,["keyCode","mobileAdaptive"])):(o(),r(u,{key:2,class:"machinist-submit"},{default:C(()=>[ss]),_:1}))])],2)])}const es={props:["openParams"],components:{SubmitButton:v,ControlsButton:S},data(){return{KEY_CODE_C:window.KEY_CODE_C,SPEED_TYPES:[{text:"Слишком низкая!",color:"yellow"},{text:"В норме.",color:"green"},{text:"Слишком высокая!",color:"red"}],semaphore:[1,0,0,1],speed:{value:"100-120",type:0},station:{name:"Лыткарино",distance:5848,show:!0},money:17024}},computed:{isMobile(){return this.$root.isMobile}},created(){this.$data.noAdaptation=!0,this.openParams&&(this.setSemaphoreState(JSON.stringify(this.openParams[0])),this.setSpeed(JSON.stringify(this.openParams[1])),this.setStation(JSON.stringify(this.openParams[2])),this.setMoney(this.openParams[3]))},methods:{formatNumberWithSpaces:y,setSemaphoreState(t){this.semaphore=JSON.parse(t)},setSpeed(t){t=JSON.parse(t),this.speed={value:t[0],type:t[1]}},setStation(t){t=JSON.parse(t),this.station={name:t[0],distance:t[1],show:t[2]}},showStationInfo(t){this.station.show=t},setMoney(t){this.money=t}}},us=x(es,[["render",ts],["__scopeId","data-v-151959bb"]]);export{us as default};
