const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./B1HO5Dud.js","./pvhYMo2c.js","./swiper-vue.DJHdZmOr.css"])))=>i.map(i=>d[i]);
import{f as h,b as w,g as y,h as C}from"./9wDxnFtt.js";import{b as t}from"./pvhYMo2c.js";const L=h("contact",()=>{const{locale:p}=w(),{$axios:i}=y(),n=t({}),o=t(!1),r=t(!0),m=t(!1);let l=t(),f=t(1),c=t();const u=t([]);async function d(s,e){o.value=!0;try{let a=new FormData;if(a.append("name",s.name),a.append("phone",`+966${s.phone}`),a.append("email",s.email),a.append("message",s.message),(await i.post("contact",a)).status>=200){o.value=!1,n.value=void 0;const v=await C(()=>import("./B1HO5Dud.js"),__vite__mapDeps([0,1,2]),import.meta.url),{createToast:_}=v;_(p.value=="ar"?"تم التواصل بنجاح ":"Communication was successful",{toastBackgroundColor:"#00A0B4",position:"top-right",type:"success",transition:"bounce",showIcon:"true",timeout:3e3}),e({values:{email:"",name:"",message:""},errors:{}})}}catch(a){a.response&&(o.value=!1,n.value=a.response.data.errors)}}async function g(s){try{const e=await i.get("questions",{params:{page:s}});e.status>=200&&(r.value=!1,u.value=[...u.value,...e.data.data],l.value=e.data.meta.total,c.value=e.data.meta.per_page)}catch(e){e.response&&(r.value=!1)}}return{errors:n,isLoading:o,pendingState:m,isLoading2:r,getContact:d,questions:u,page:f,total:l,per_page:c,getQuestions:g}});export{L as u};
