1import{z as S,u as a,A as s}from"./B4qhNgh9.js";import{u as v}from"./B-sIFSRq.js";const l=S("veterinarians",{state:()=>({veterinarians:new Set,totalElements:0,totalPages:0,status:"",error:null,serviceAreas:[],activityAreas:[],veterinarian:null,veterinarianStatus:"",veterinarianServices:new Set,veterinarianServicesTotalElements:0,veterinarianServicesStatus:"",selectedService:null,selectedServiceStatus:"",similarServices:new Set,similarServicesStatus:"",homeVeterinarians:new Set,homeVeterinariansStatus:"",homeVeterinarianServices:new Set,homeVeterinarianServicesStatus:""}),getters:{getVeterinarians:e=>e.veterinarians,getTotalElements:e=>e.totalElements,getTotalPages:e=>e.totalPages,getStatus:e=>e.status,getServiceAreas:e=>e.serviceAreas,getActivityAreas:e=>e.activityAreas,getVeterinarian:e=>e.veterinarian,getVeterinarianStatus:e=>e.veterinarianStatus,getVeterinarianServices:e=>e.veterinarianServices,getVeterinarianServicesTotalElements:e=>e.veterinarianServicesTotalElements,getVeterinarianServicesStatus:e=>e.veterinarianServicesStatus,getSelectedService:e=>e.selectedService,getSelectedServiceStatus:e=>e.selectedServiceStatus,getSimilarServices:e=>e.similarServices,getSimilarServicesStatus:e=>e.similarServicesStatus,getHomeVeterinarians:e=>e.homeVeterinarians,getHomeVeterinariansStatus:e=>e.homeVeterinariansStatus,getHomeVeterinarianServices:e=>e.homeVeterinarianServices,getHomeVeterinarianServicesStatus:e=>e.homeVeterinarianServicesStatus},actions:{resetVeterinarians(){this.veterinarians=new Set,this.totalElements=0,this.totalPages=0,this.status="",this.error=null},async fetchVeterinarians(e){this.status="pending";try{const i=a().public.baseURL,t=await $fetch(`${i}${s.veterinarians}`,{method:"GET",query:e});this.totalElements=t?.totalElements??0,this.totalPages=t?.totalPages??0,t?.content?.forEach(r=>{this.veterinarians.add(r)}),this.status="success"}catch{this.status="error"}},async fetchServiceAreas(){try{const e=a().public.baseURL,i=await $fetch(`${e}${s.product_groups}`,{method:"GET",query:{categoryType:"VETERINARIAN"}});this.serviceAreas=i??[]}catch{this.serviceAreas=[]}},async fetchActivityAreas(){const e=v();await e.searchCities(),this.activityAreas=e.cities},resetVeterinarian(){this.veterinarian=null,this.veterinarianStatus=""},resetVeterinarianServices(){this.veterinarianServices=new Set,this.veterinarianServicesTotalElements=0,this.veterinarianServicesStatus=""},async fetchVeterinarianById(e){this.veterinarianStatus="pending";try{const i=a().public.baseURL,t=await $fetch(`${i}${s.veterinarians}/${e}`,{method:"GET"});this.veterinarian=t,this.veterinarianStatus="success"}catch{this.veterinarian=null,this.veterinarianStatus="error"}},async fetchVeterinarianServices(e){this.veterinarianServicesStatus="pending";try{const i=a().public.baseURL,t=await $fetch(`${i}${s["veterinarian-products"]}`,{method:"GET",query:{veterinarianId:e.veterinarianId,page:e.page,size:e.size,...e.search?{productNamePhrase:e.search}:{}}});this.veterinarianServicesTotalElements=t?.totalElements??0;const r=this.veterinarian?.name??"";t?.content?.forEach(n=>{this.veterinarianServices.add({...n,storeName:n.storeName??r})}),this.veterinarianServicesStatus="success"}catch{this.veterinarianServicesStatus="error"}},resetSelectedService(){this.selectedService=null,this.selectedServiceStatus=""},resetSimilarServices(){this.similarServices=new Set,this.similarServicesStatus=""},async fetchServiceById(e,i){this.selectedServiceStatus="pending";try{const t=a().public.baseURL,r=await $fetch(`${t}${s["veterinarian-products"]}/${i}`,{method:"GET"});this.selectedService=r,this.selectedServiceStatus="success"}catch{this.selectedService=null,this.selectedServiceStatus="error"}},resetHomeVeterinarians(){this.homeVeterinarians=new Set,this.homeVeterinariansStatus=""},async fetchHomeVeterinarians(e){this.homeVeterinariansStatus="pending";try{const i=a().public.baseURL,t=await $fetch(`${i}${s.veterinarians}`,{method:"GET",query:{page:e.page??0,size:e.size??5}});this.homeVeterinarians=new Set(t?.content??[]),this.homeVeterinariansStatus="success"}catch{this.homeVeterinariansStatus="error"}},resetHomeVeterinarianServices(){this.homeVeterinarianServices=new Set,this.homeVeterinarianServicesStatus=""},async fetchHomeVeterinarianServices(e){this.homeVeterinarianServicesStatus="pending";try{const i=a().public.baseURL,t=await $fetch(`${i}${s["veterinarian-random-products"]}`,{method:"GET",query:{page:e.page??0,size:e.size??5}});this.homeVeterinarianServices=new Set(t??[]),this.homeVeterinarianServicesStatus="success"}catch{this.homeVeterinarianServicesStatus="error"}},async fetchSimilarServices(e,i){this.similarServicesStatus="pending";try{const t=a().public.baseURL,r=await $fetch(`${t}${s["veterinarian-products"]}`,{method:"GET",query:{veterinarianId:e,page:0,size:6}}),n=this.selectedService?.veterinarian?.name??"";r?.content?.filter(c=>
1String(c.id)!==i).slice(0,5).forEach(c=>{this.similarServices.add({...c,storeName:c.storeName??n})}),this.similarServicesStatus="success"}catch{this.similarServicesStatus="error"}}}});export{l as u};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.