import{u as h,V as g}from"./DKMWZZOl.js";import{h as y,k as o,m as E,v as p,o as n,ad as d,c as f,I as B,J as m,K as V}from"./BzhixHsn.js";var k=y({inheritAttrs:!1,__name:"VisuallyHiddenInputBubble",props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:"fully-hidden"}},setup(i){const e=i,{primitiveElement:s,currentElement:l}=h(),t=o(()=>e.checked??e.value);return E(t,(r,a)=>{if(!l.value)return;const u=l.value,_=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(_,"value").set;if(v&&r!==a){const b=new Event("input",{bubbles:!0}),q=new Event("change",{bubbles:!0});v.call(u,r),u.dispatchEvent(b),u.dispatchEvent(q)}}),(r,a)=>(n(),p(g,d({ref_key:"primitiveElement",ref:s},{...e,...r.$attrs},{as:"input"}),null,16))}}),c=k,A=y({inheritAttrs:!1,__name:"VisuallyHiddenInput",props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:"fully-hidden"}},setup(i){const e=i,s=o(()=>typeof e.value=="object"&&Array.isArray(e.value)&&e.value.length===0&&e.required),l=o(()=>typeof e.value=="string"||typeof e.value=="number"||typeof e.value=="boolean"||e.value===null||e.value===void 0?[{name:e.name,value:e.value}]:typeof e.value=="object"&&Array.isArray(e.value)?e.value.flatMap((t,r)=>typeof t=="object"?Object.entries(t).map(([a,u])=>({name:`${e.name}[${r}][${a}]`,value:u})):{name:`${e.name}[${r}]`,value:t}):e.value!==null&&typeof e.value=="object"&&!Array.isArray(e.value)?Object.entries(e.value).map(([t,r])=>({name:`${e.name}[${t}]`,value:r})):[]);return(t,r)=>(n(),f(m,null,[B(" We render single input if it's required "),s.value?(n(),p(c,d({key:t.name},{...e,...t.$attrs},{name:t.name,value:t.value}),null,16,["name","value"])):(n(!0),f(m,{key:1},V(l.value,a=>(n(),p(c,d({key:a.name},{ref_for:!0},{...e,...t.$attrs},{name:a.name,value:a.value}),null,16,["name","value"]))),128))],2112))}}),w=A;export{w as V};
