import{x as V,z as B,aQ as L,n as N,r as h,f as d,o,g as c,i as g,j as S,k as v,M as q,h as y,aR as U,D as $,H as j,R as E,aS as H,aT as K,U as M,N as O}from"./B7moA0Zy.js";const Q={__name:"Input",props:{data:{type:Object,required:!0}},emits:["update","submit"],setup(e,{emit:k}){const t=e,x=k,u=t.data.formId;let l=B(),i=null;const s=t.data.handle;u?(i=L(u),l=i.request,i.initRequest(s,{type:t.data.type}),t.data.value&&i.updateRequest(s,"value",t.data.value)):t.data.value&&(l.value=t.data.value);const b=N(()=>u?l[s].value:l.value);function f(a){u?i.updateRequest(s,"value",a):(l.value=a,x("update",a))}function w(a){x("submit",a)}const{theme:I,plain:C}=t.data;return(a,n)=>{const R=H,z=K,D=M,F=O,p=h("pad"),m=h("lay");return d((o(),c("div",{class:E([a.$mq.s?"typo--4":"typo--p",y(I)])},[d((o(),c("div",null,[e.data.label?(o(),g(R,{key:0,data:{key:e.data.key,label:e.data.label,description:e.data.description,required:e.data.required}},null,8,["data"])):S("",!0),v(z,{error:e.data.error},null,8,["error"])])),[[q,!y(C)],[p,{x:"m"}],[m,{dir:"h",align:"even"}]]),d((o(),c("div",null,[d((o(),g($(e.data.type==="textarea"?"textarea":"input"),{type:e.data.type,id:e.data.key,name:e.data.id,required:e.data.required,placeholder:e.data.placeholder,minlength:e.data.minLength,maxlength:e.data.maxLength,min:e.data.min,max:e.data.max,multiple:e.data.multiple,pattern:e.data.pattern,rows:e.data.rows||2,size:"1",cols:"1",value:y(b),onInput:n[0]||(n[0]=r=>f(r.target.value)),onKeyup:n[1]||(n[1]=U(r=>w(r.target.value),["enter"]))},null,40,["type","id","name","required","placeholder","minlength","maxlength","min","max","multiple","pattern","rows","value"])),[[p,["s","m"]]]),d(v(F,{onClick:n[2]||(n[2]=r=>f(null)),data:{themes:["button","icon","plain"]}},{default:j(()=>[v(D,{data:{name:"cross",size:"s",color:"white"}})]),_:1},512),[[q,e.data.icon]])])),[[m,"o"]])],2)),[[m,{gap:"s",align:["start"]}]])}}},A=V(Q,[["__scopeId","data-v-69938288"]]);export{A as I};