import{Z as p}from"./index-BFHpqQMc.js";import{P as s}from"./LocalStorage-Bg7wwOV9.js";const e="taxstore:v1",i={prevPreparedByUs:!1,prevDeclaration:null,firstName:"",lastName:"",birthDate:"",address:"",zip:"",city:""},r={maritalStatus:"",spouseFirstName:"",spouseLastName:"",spouseName:"",spouseBirthDate:"",spouseTaxNumber:"",spouseAddress:"",spouseZip:"",spouseCity:"",marriageDate:"",separated:!1,spousePreviousDivorces:!1,spouseAlimentiVersati:!1},f=p("taxstore",{state:()=>{try{const t=s.getItem(e);if(t&&typeof t=="object"){const a=t;if(Array.isArray(a.items))return{items:a.items}}}catch{}return{items:[{key:"taxpayer",data:{...i}},{key:"marital",data:{...r}}]}},actions:{persist(){try{s.set(e,{items:this.items})}catch{}},_findTaxpayer(){return this.items.find(t=>t.key==="taxpayer")},_findMarital(){return this.items.find(t=>t.key==="marital")},getTaxpayer(){return this._findTaxpayer()?.data},setTaxpayer(t){const a=this._findTaxpayer();a&&(a.data={...a.data,...t}),this.persist()},replaceTaxpayer(t){const a=this._findTaxpayer();a&&(a.data=t),this.persist()},resetTaxpayer(){const t=this._findTaxpayer();t&&(t.data={...i}),this.persist()},getMarital(){return this._findMarital()?.data},setMarital(t){const a=this._findMarital();a&&(a.data={...a.data,...t}),this.persist()},replaceMarital(t){const a=this._findMarital();a&&(a.data=t),this.persist()},resetMarital(){const t=this._findMarital();t&&(t.data={...r}),this.persist()}}});export{f as u};
