import{defineStore as f}from"pinia";import{k as g}from"../server.mjs";import{ref as s}from"vue";import"klona";import"defu";import"#internal/nuxt/paths";const h=f("service",()=>{const{$axios:l}=g(),o=s({}),t=s(!1),u=s([]),a=s(null);async function i(){t.value=!0;const e=await l.get("services");e.status>=200&&(u.value=e.data.data,t.value=!1)}async function c(e){t.value=!0;try{const r=await l.get(`/services/${e}`);r.data?.message==="Service Not Found"?a.value=null:a.value=r.data.data}catch{a.value=null}finally{t.value=!1}}async function n(e){t.value=!0;try{const r=await l.get(`/services/show/${e}`);r.data?.message==="Service Not Found"?a.value=null:a.value=r.data.data}catch{a.value=null}finally{t.value=!1}}function v(e){return e.toString().toLowerCase().trim().replace(/\s+/g,"-").replace(/[؟,،!%&]/g,"").replace(/-+/g,"-")}return{errors:o,isLoading:t,services:u,service:a,getServices:i,getServiceById:c,getServiceBySlug:n,slugify:v}});export{h as u};
