import{u as g,W as i,r as n}from"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c89264.js";import"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c89263.js";import{I as c}from"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c89268.js";import{c as d}from"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c89262.js";import"./v_7_4_3_72_6a457bf5-eeae-4570-8821-bd6fa39c89265.js";const y=d()(s=>({categories:[],addCategory:e=>s(a=>{const{language:t}=g.getState(),o={...e,id:n()},r=[...a.categories,o];return i("categoria",r),chrome.runtime.sendMessage({action:"addCategory",dados:o}),c({type:"Success",message:t.categoryCreated,position:"top-right"}),{categories:r}}),sortCategories:e=>s(a=>{const t=[...a.categories],[o]=t.splice(e.oldIndex,1);return t.splice(e.newIndex,0,o),i("categoria",t),chrome.runtime.sendMessage({action:"sortCategories",dados:e}),{categories:t}}),removeCategory:e=>s(a=>{const{language:t}=g.getState(),o=a.categories.filter(r=>r.id!==e);return i("categoria",o),chrome.runtime.sendMessage({action:"removeCategory",dados:e}),c({type:"Success",message:t.deletedCategory,position:"top-right"}),{categories:o}}),editCategory:e=>s(a=>{const{language:t}=g.getState(),o=a.categories.map(r=>r.id===e.id?e:r);return i("categoria",o),chrome.runtime.sendMessage({action:"editCategory",dados:e}),c({type:"Success",message:t.categoryEdited,position:"top-right"}),{categories:o}})}));export{y as u};
