{"version":3,"file":"CfzoCes8.js","sources":["../../../../src/middleware/validate-car.ts"],"sourcesContent":["import {LISTINGS_SERVICE} from \"~/data/ServicesConstants\";\n\nexport default defineNuxtRouteMiddleware(async (to) => {\n if (import.meta.server) return\n try {\n const axiosRequest = await useNuxtApp().$getApi(LISTINGS_SERVICE)\n const {data} = await axiosRequest.get(`/listings/public/cars/${to.params.slug}`)\n const car = useState('car')\n if (!data) {\n throw new Error(`Error al no encontrar la data.`)\n }\n car.value = data\n } catch (error) {\n throw createError({\n statusCode: 404,\n statusMessage: `${error}`,\n });\n }\n})"],"names":["validateCar","defineNuxtRouteMiddleware","to","__temp","__restore","axiosRequest","__executeAsync","useNuxtApp","LISTINGS_SERVICE","data","car","useState","error","createError"],"mappings":"wEAGI,MAAwBA,EAAAC,EAAA,MAAAC,GAAA,CAAA,IAAAC,EAAAC,EAEpB,GAAA,CACM,MAAAC,GAAK,CAAAF,EAAAC,CAAA,EAAAE,EAAU,IAAAC,IAAiB,QAAyBC,CAAA,CAAA,EAAGL,EAAO,MAAMA,SACzE,CAAA,KAAAM,OAAoBL,CAAA,EAAAE,EAAA,IAAAD,EAAA,IAAA,yBAAAH,EAAA,OAAA,IAAA,EAAA,CAAA,EAAAC,EAAA,MAAAA,EAAAC,IAAAD,GACfO,EAAAC,EAAA,KAAA,EACD,GAAA,CAAAF,EACV,MAAA,IAAA,MAAA,gCAAA,UAEYA,CACZ,OAAkBG,EAAA,CAAA,MACFC,EAAA,CACZ,WAAA,IACH,cAAA,GAAAD,CAAA,EAAA,CACL,CACH"}