import{_ as B}from"./ButtonDefault-CghIUDY0.js";import{_ as S}from"./BasicInput-BYe5b9L8.js";import{_ as T}from"./BlockSelectContract-3ekz5W0S.js";import{u as g}from"./contracts-CILh9uSu.js";import{_ as I}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as u,f as w,H as y,s as D,c as U,o as E,a as p,b as r}from"./index-CipWZKo_.js";import"./component-DWBAga-C.js";import"./multiselect-DWCHRlfT.js";const F={class:"modal__body"},L={class:"modal__input-row"},M={__name:"ModalWindowFundsTransfer",emits:["modalClose","buttonClicked"],setup(x,{emit:f}){const d=g(),n=u(null),l=u(null),a=u(null),c=u(!1),v=f,C=w(()=>d?.contractsList);function b(o){const e=Object.values(C.value).find(s=>s.ID===o);e&&(a.value=e.Balance)}function m(){v("modalClose")}function i(){c.value=!0;const o={FromContractID:n.value,ToContractID:l.value,Summ:a.value};d.FundsTransfer(o).then(e=>{e.status==="success"&&m(),c.value=!1})}const _=o=>{o.key==="Enter"&&i()};return y(()=>{document.addEventListener("keyup",_),d.fetchContracts()}),D(()=>{document.removeEventListener("keyup",_)}),(o,e)=>{const s=T,V=S,k=B;return E(),U("div",F,[e[3]||(e[3]=p("div",{class:"list-item__title"},"Перевод средств между счетами",-1)),p("div",L,[r(s,{modelValue:n.value,"onUpdate:modelValue":e[0]||(e[0]=t=>n.value=t),title:"Откуда","has-balance":!0,"allow-partner":!0,onUpdate:b,onButtonClicked:m},null,8,["modelValue"]),r(s,{modelValue:l.value,"onUpdate:modelValue":e[1]||(e[1]=t=>l.value=t),title:"Куда","allow-partner":!0,onButtonClicked:m},null,8,["modelValue"]),r(V,{label:"Сумма",name:"Summ",placeholder:"199.99",modelValue:a.value,"onUpdate:modelValue":e[2]||(e[2]=t=>a.value=t)},null,8,["modelValue"]),r(k,{class:"modal__button",label:"Сохранить",disabled:n.value===null||l.value===null,"is-loading":c.value,onClick:i},null,8,["disabled","is-loading"])])])}}},R=I(M,[["__scopeId","data-v-da72cb6f"]]);export{R as default};
