import{Z as o}from"./index-BFHpqQMc.js";import{P as i}from"./LocalStorage-Bg7wwOV9.js";const s="children:v1",n={hasChildren:!1,children:[],moreThanFiveChildrenNote:""},m=o("childrenstore",{state:()=>{try{let e=i.getItem(s);if(typeof e=="string")try{e=JSON.parse(e)}catch{e=null}if(e&&typeof e=="object")return{data:{...e}}}catch{}return{data:{...n}}},actions:{persist(){try{const e={hasChildren:!!this.data.hasChildren,children:Array.isArray(this.data.children)?this.data.children.map(t=>{const h=r=>r?Array.isArray(r)?r.map(a=>({name:a.name||"",size:a.size||0,type:a.type||"",lastModified:a.lastModified})):{name:r.name||"",size:r.size||0,type:r.type||"",lastModified:r.lastModified}:null;return{firstName:t.firstName,lastName:t.lastName,birthDate:t.birthDate,sameHousehold:t.sameHousehold,alimentiVersati:t.alimentiVersati??!1,school:t.school,careCosts:h(t.careCosts)}}):[],moreThanFiveChildrenNote:this.data.moreThanFiveChildrenNote||""};i.set(s,e)}catch(e){console.error("children.store: persist error",e)}},getChildren(){return this.data},setChildren(e){this.data={...this.data,...e},this.persist()},replaceChildren(e){this.data=e,this.persist()},resetChildren(){this.data={...n},this.persist()}}});export{m as u};
