import{ref as a}from"vue";import{defineStore as m}from"pinia";import{k as p}from"../server.mjs";import"klona";import"defu";import"#internal/nuxt/paths";const L=m("offers",()=>{const{$axios:s}=p(),i=a({}),o=a(),f=a(!0),e=a(!0),u=a([]);async function n(t){const r=await s.get(`offer/show/${t}`);r.status>=200&&(o.value=r.data.data,e.value=!1),setTimeout(()=>{e.value=!0},500)}async function c(t){const r=await s.get(`offer/show/${t}`);r.status>=200&&(o.value=r.data.data,e.value=!1),setTimeout(()=>{e.value=!0},500)}function l(t){return t?t.toString().toLowerCase().trim().replace(/\s+/g,"-").replace(/[؟,،!%&]/g,"").replace(/-+/g,"-"):""}async function g(){const t=await s.get("offers");t.status>=200&&(u.value=t.data.data,f.value=!1),setTimeout(()=>{f.value=!0},500)}return{errors:i,isLoading:f,isLoading2:e,getOffer:n,getOfferBySlug:c,getOffers:g,offers:u,offer:o,slugify:l}});export{L as u};
