import{o as s,c as t,a as o,d as a,e as i,t as u,F as v,i as m,f as g,n as h,p as E,g as p,_ as P}from"./index.js";const c=e=>(E("data-v-64a1be29"),e=e(),p(),e),y={class:"control-panel"},F={class:"display"},w=c(()=>o("div",{class:"floor-title"},[o("b",null,"Управление"),i("лифтом")],-1)),U={class:"floor-money"},b=c(()=>o("br",null,null,-1)),k={style:{color:"#82A14A"}},I={class:"floor-level-info"},L={style:{color:"#507CF6"}},N={class:"floor-level-progress-bar-background"},S=c(()=>o("div",{class:"floor-level-progress-bar-background-img"},null,-1)),T={class:"floor-page"},B={class:"floor-list"},D={key:0,class:"floor-cradle"},M=["src"];function V(e,r,f,A,n,l){return s(),t("div",{class:h(["window-cleaner",{"window-cleaner_mobile":l.isMobile}])},[o("div",y,[o("div",{class:"up",onClick:r[0]||(r[0]=d=>l.changeFloorCradle(!0)),style:a(l.getStyleControlPanel(!0))},null,4),o("div",{class:"down",onClick:r[1]||(r[1]=d=>l.changeFloorCradle(!1)),style:a(l.getStyleControlPanel(!1))},null,4)]),o("div",F,[w,o("div",U,[i("Заработано "),b,o("span",k,[o("b",null,u(n.currentMoney)+"p",1)])]),o("div",I,[i("Уровень "),o("span",L,u(n.currentFloor+1),1)]),o("div",N,[S,o("div",{class:"floor-level-progress-bar-active",style:a(l.getCurrentFloorProgressBar(l.getCurrentFloor))},null,4)]),o("div",T,[(s(!0),t(v,null,m(n.floors,(d,_)=>(s(),t("div",B,[l.getCurrentFloor==_?(s(),t("div",D)):g("",!0),o("img",{class:"floor-image-status",src:l.getFloorImageStatus(_)},null,8,M)]))),256))])])],2)}const O=10,C=5,X={name:"window-cleaner",props:["openParams"],data(){return{floors:[],currentFloor:0,currentMoney:0,moveUp:!1,moveDown:!1}},computed:{isMobile(){return this.$root.isMobile},getCurrentFloor(){return O-(this.currentFloor+1)}},created(){this.$data.noAdaptation=!0,this.openParams&&(this.floors=this.openParams)},methods:{getFloorListInfo(e){this.floors=JSON.parse(e)},updateFloorMoney(e){this.currentMoney=e},updateFloorLevel(e){this.currentFloor=e},getFloorImageStatus(e){return this.floors[e]==0?"/images/window_cleaner/green_block.png":"/images/window_cleaner/red_block.png"},getCurrentFloorProgressBar(e){return{width:(C-this.floors[e])/C*100+"%"}},changeFloorCradle(e){e?this.moveUp?(this.moveUp=!1,sendClientEvent(gm.EVENT_EXECUTE_PUBLIC,"ClickPlayerControlPanel",1)):(this.moveDown&&sendClientEvent(gm.EVENT_EXECUTE_PUBLIC,"ClickPlayerControlPanel",2),this.moveDown=!1,this.moveUp=!0,sendClientEvent(gm.EVENT_EXECUTE_PUBLIC,"ClickPlayerControlPanel",1)):this.moveDown?(this.moveDown=!1,sendClientEvent(gm.EVENT_EXECUTE_PUBLIC,"ClickPlayerControlPanel",2)):(this.moveUp&&sendClientEvent(gm.EVENT_EXECUTE_PUBLIC,"ClickPlayerControlPanel",1),this.moveUp=!1,this.currentFloor>0&&(this.moveDown=!0),sendClientEvent(gm.EVENT_EXECUTE_PUBLIC,"ClickPlayerControlPanel",2))},getStyleControlPanel(e){if(e){if(this.moveUp)return{transform:"scale(0.85)"}}else if(this.moveDown)return{transform:"scale(0.85)"}}}},W=P(X,[["render",V],["__scopeId","data-v-64a1be29"]]);export{W as default};
