import{q as U,j as e,r as s,d as l}from"./index-76f1ce5c.js";import{R as d,C as t,d as o,I as u}from"./iconBase-883829c2.js";import{D as w}from"./index-a0cf5c09.js";import{D as h}from"./logo-e4083531.js";import{T as A}from"./tabs-8bdf8fba.js";import"./index-31a0332c.js";function B({intl:D}){const{messages:q}=D,y=({onSend:g,setOnSend:P,onReset:f,setOnReset:G,tab:p,active:n})=>{const[i,c]=s.useState(null),[b,r]=s.useState(h),[v,x]=s.useState(""),[N,T]=s.useState(""),[C,S]=s.useState(""),[I,E]=s.useState([]);function R(){console.log({image:b,title:v,subTitle:N,slogan:C})}function $(){j(),c(null),r(h),x(""),T(""),S(""),E([])}function j(){function a(L){const m=document.getElementsByClassName("dz-message");if(L.length>0){const z=p=="pt-br"?0:1;i&&n?m[z].innerText=`A imagem "${i.name}" já foi carregada com sucesso!
      Clique aqui para substituí-la `:m[z].innerText=`
      Tipo de imagem aceita: JPEG ou PNG
      `}else setTimeout(()=>{E(m)},100)}a(I)}return s.useEffect(()=>{f&&n&&($(),G(!1))},[f]),s.useEffect(()=>{g&&n&&(R(),P(!1))},[g]),s.useEffect(()=>{j()},[I,p]),l("div",{children:[l(d,{children:[e("div",{className:"col-auto miniature ml-3",children:l("div",{className:"has-float-label",children:[e("label",{children:"Logo da Pesquisa"}),e("img",{src:b,alt:"imagem de perfil"})]})}),e(t,{className:"col-dropzone",children:e(o,{children:e(w,{id:"photo",name:"photo",addImage:a=>{c(a),r(a.dataURL)},removeImage:()=>{c(null),r(h)},images:i})})})]}),l(d,{children:[e(t,{className:"col-6",children:e(o,{children:l("div",{className:"has-float-label",children:[e("label",{children:"Título"}),e(u,{value:v,onChange:a=>x(a.target.value)})]})})}),e(t,{className:"col-6",children:e(o,{children:l("div",{className:"has-float-label",children:[e("label",{children:"Subtitulo"}),e(u,{value:N,onChange:a=>T(a.target.value)})]})})})]}),e(d,{children:e(t,{className:"col-12",children:e(o,{children:l("div",{className:"has-float-label",children:[e("label",{children:"Slogan "}),e(u,{type:"textarea",value:C,onChange:a=>S(a.target.value)})]})})})})]})};return e(A,{title:q["sidebar.home"],Component:y})}const O=U(B);export{O as default};
