import{o as c,c as u,b as d,w as o,f as _,T as p,a as s,d as i,n as l,_ as m}from"./index.js";const g={key:0,class:"endurance__text"},f=["src"];function F(e,r,E,y,n,t){return c(),u("div",{class:l(["endurance",{endurance_mobile:t.isMobile}])},[d(p,{name:"fade",mode:"out-in",appear:""},{default:o(()=>[n.currentFill<=0?(c(),u("div",g,"Недостаточно выносливости")):_("",!0)]),_:1}),s("div",{class:l(["endurance__wrapper",{endurance__wrapper_danger:n.currentFill<=n.MIN_DANGER_VALUE}]),style:i({background:t.wrapperBackground})},[s("img",{class:"endurance__empty",src:t.currentEmpty},null,8,f),s("div",{class:"endurance__fill",style:i({width:`calc(${n.currentFill}%)`,background:t.currentBackground})},null,4)],6)],2)}const a={FULL:"#1DED83",MEDIUM:"#F3F2ED",CRITICAL:"#F75049"},h={name:"Endurance",props:["openParams"],data(){return{MIN_DANGER_VALUE:25,currentFill:0}},computed:{currentBackground(){return this.currentFill>75?a.FULL:this.currentFill>this.MIN_DANGER_VALUE?a.MEDIUM:a.CRITICAL},wrapperBackground(){const e="src/assets/images/endurance/bar.svg",r="src/assets/images/endurance/bar_danger.svg";return this.currentFill?`url(${e}) center / 100% 100% no-repeat`:`url(${r}) center / 100% 100% no-repeat`},currentEmpty(){const e="src/assets/images/endurance/empty_fill.svg",r="src/assets/images/endurance/empty_fill_danger.svg";return this.currentFill?e:r},isMobile(){return this.$root.isMobile}},created(){this.$data.noAdaptation=!0,this.openParams&&this.setFatigue(this.openParams[0])},methods:{setFatigue(e){this.currentFill=e*100}}},b=m(h,[["render",F],["__scopeId","data-v-1f7f682d"]]);export{b as default};
