import{_ as k,a as h,b as f,c as m,d as M}from"./skilled.js";import{B as x}from"./Button2.js";/* empty css                                          */import{r as g,o as r,c as l,a as n,d as C,t as y,h as p,w as A,e as u,f as _,n as c,_ as v,b as d}from"./index.js";const B={class:"training-role-item__content"},E={class:"training-role-item__title"},S=["innerHTML"],T=["src"];function L(i,t,s,b,I,e){const a=g("Button");return r(),l("div",{class:c(["training-role-item",{"training-role-item_mobile":e.isMobile}])},[n("div",{class:"training-role-item__background",style:C({backgroundImage:`url(${e.getImage(s.background)})`})},null,4),n("div",B,[n("div",E,y(s.title),1),n("div",{class:"training-role-item__text",innerHTML:s.text},null,8,S)]),n("img",{class:"training-role-item__illustration",src:e.getImage(s.illustration)},null,8,T),s.isActive?(r(),p(a,{key:0,class:"training-role-item__button",onClick:e.onContinueClick},{default:A(()=>[u("Продолжить")]),_:1},8,["onClick"])):_("",!0)],2)}const N={props:{title:{type:String,required:!0},text:{type:String,required:!1},illustration:{type:String,required:!0},background:{type:String,required:!0},isActive:{type:Boolean,default:!1}},components:{Button:x},data(){return{images:Object.assign({"/src/assets/images/training/role/beginner.png":k,"/src/assets/images/training/role/bg-beginner.png":h,"/src/assets/images/training/role/bg-skilled.png":f,"/src/assets/images/training/role/pointer.svg":m,"/src/assets/images/training/role/skilled.png":M})}},computed:{isMobile(){return this.$root.isMobile}},methods:{getImage(i){return this.images[`/src/assets/images/training/role/${i}`]},onContinueClick(){this.$emit("buttonPressed")}}},P=v(N,[["render",L],["__scopeId","data-v-038aa86d"]]),V={key:0,class:"training-role__bg_top"},q={class:"training-role__content"},F=n("div",{class:"training-role__text"},"Выберите подходящую роль",-1),O=n("div",{class:"training-role__title"},"Кто Вы?",-1),w={key:0,class:"training-role__help"},z=n("img",{src:m},null,-1),D={key:1,class:"training-role__bg_bottom"};function H(i,t,s,b,I,e){const a=g("Item");return r(),l("div",{class:c(["training-role iface-container",`training-role_hovered-${i.hoveredItem}`,{"training-role_mobile":e.isMobile}])},[d(a,{class:c(["training-role__item",{"training-role__item_faded":e.isActiveSecond,"training-role-item_hover":e.isActiveFirst}]),title:"Новенький",text:e.firstItemText,illustration:"beginner.png",background:"bg-beginner.png",isActive:e.isActiveFirst,onClick:t[0]||(t[0]=o=>e.clickItem("first")),onButtonPressed:t[1]||(t[1]=o=>e.onItemClick(!0)),onMouseenter:t[2]||(t[2]=o=>e.onItemMouseEnter("first")),onMouseleave:e.onItemMouseLeave},null,8,["class","text","isActive","onMouseleave"]),e.isMobile?(r(),l("div",V)):_("",!0),n("div",q,[F,O,e.isMobile?(r(),l("div",w,[z,u("Сделайте выбор нажатием пальца")])):_("",!0)]),e.isMobile?(r(),l("div",D)):_("",!0),d(a,{class:c(["training-role__item",{"training-role__item_faded":e.isActiveFirst,"training-role-item_hover":e.isActiveSecond}]),title:"Опытный игрок",text:e.secondItemText,illustration:"skilled.png",background:"bg-skilled.png",isActive:e.isActiveSecond,onClick:t[3]||(t[3]=o=>e.clickItem("second")),onButtonPressed:t[4]||(t[4]=o=>e.onItemClick(!1)),onMouseenter:t[5]||(t[5]=o=>e.onItemMouseEnter("second")),onMouseleave:e.onItemMouseLeave},null,8,["class","text","isActive","onMouseleave"])],2)}const R={props:["openParams"],components:{Item:P},data:()=>({hoveredItem:null}),computed:{isMobile(){return this.$root.isMobile},isActiveFirst(){return this.hoveredItem==="first"},isActiveSecond(){return this.hoveredItem==="second"},firstItemText(){return this.isMobile?"<div>Я первый раз в игре и хочу пройти обучение.</div><div>По завершении обучения вы получите приятный <b>денежный</b> бонус!</div>":"<div>Я первый раз в игре и хочу ознакомиться с игровой механикой</div><div>По завершении обучения вы получите приятный <b>денежный</b> бонус,</div><div>который облегчит вам старт в игре</div>"},secondItemText(){return"Я уже знаком с игрой и не нуждаюсь в дополнительном обучении"}},created(){this.$data.noAdaptation=!0},mounted(){document.addEventListener("click",this.onClick)},unmounted(){document.removeEventListener("click",this.onClick)},methods:{onItemClick(i){sendClientEvent(gm.EVENT_EXECUTE_PUBLIC,"SDSY_OnPlayerAccept",+i)},clickItem(i){this.hoveredItem=i},onClick(i){i.target.className.indexOf("training-role-item")===-1&&(this.hoveredItem=null)},onItemMouseEnter(i){this.isMobile||(this.hoveredItem=i)},onItemMouseLeave(){this.isMobile||(this.hoveredItem=null)}}},G=v(R,[["render",H]]);export{G as default};
