import{e as i}from"./colors.js";import{o as a,c as r,b as f,w as c,a as t,n as _,t as d,T as l,_ as v}from"./index.js";const h={class:"offer iface-container"},m={class:"offer__container"},E=t("div",{class:"offer__container__before"},null,-1),u={class:"offer__content"},p=t("div",{class:"offer__content-background"},null,-1),w=t("div",{class:"offer__btn__text"},"N",-1),y=[w],C={class:"offer__data"},B={class:"offer__title"},N=["innerHTML"],O=t("div",{class:"offer__btn__text"},"Y",-1),Y=[O];function K(e,s,x,A,D,n){return a(),r("div",h,[f(l,{name:"slide",appear:""},{default:c(()=>[t("div",m,[E,t("div",u,[p,t("div",{class:_(["offer__btn",{offer__btn_active:e.isActiveNoBtn}]),onClick:s[0]||(s[0]=(...o)=>n.no&&n.no(...o))},y,2),t("div",C,[t("div",B,d(e.title),1),t("div",{class:"offer__text",innerHTML:e.text},null,8,N)]),t("div",{class:_(["offer__btn",{offer__btn_active:e.isActiveYesBtn}]),onClick:s[1]||(s[1]=(...o)=>n.yes&&n.yes(...o))},Y,2)])])]),_:1})])}const b={props:["openParams"],data:()=>({title:"Предложение",text:"Вы хотите посмотреть список доступных работ?",noAdaptation:!0,isActiveYesBtn:!1,isActiveNoBtn:!1}),created(){this.openParams&&(this.title=this.openParams[0],this.text=i(this.openParams[1]))},mounted(){document.addEventListener("keydown",this.onKeyDown),document.addEventListener("keyup",this.onKeyUp)},unmounted(){document.removeEventListener("keydown",this.onKeyDown),document.removeEventListener("keyup",this.onKeyUp)},methods:{setInfo(e,s){this.title=e,this.text=i(s)},yes(){console.log("yes"),this.close(),sendClientEvent(gm.EVENT_EXECUTE_PUBLIC,"OnOffersConfirm",1)},no(){console.log("no"),this.close(),sendClientEvent(gm.EVENT_EXECUTE_PUBLIC,"OnOffersConfirm",0)},onKeyUp({keyCode:e}){e===window.KEY_CODE_Y&&(this.isActiveYesBtn=!1,this.yes()),e===window.KEY_CODE_N&&(this.isActiveNoBtn=!1,this.no())},onKeyDown({keyCode:e}){e===window.KEY_CODE_Y&&(this.isActiveYesBtn=!0),e===window.KEY_CODE_N&&(this.isActiveNoBtn=!0)},close(){window.closeInterface("Offer")}}},g=v(b,[["render",K]]);export{g as default};
