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AU,OAAQ,CACpB,IAAIlD,EACJ,GAAIkD,EAAU,QAAS,CACrB,MAAMC,EAAgBpD,EAAamD,EAAU,OAAO,EAChD,OAAOC,GAAkB,SAC3BnD,EAAUmD,EAEVnD,EAAUkD,EAAU,WAAWR,EAAeA,EAAaQ,EAAU,OAAO,EAAI,MAEnF,CACDjD,EAAO,SAASiD,EAAU,OAAQ,CAAE,QAAAlD,CAAS,EAC9C,CACD,KAAM,CAAE,KAAAoD,EAAM,KAAAC,CAAI,EAAK,MAAMpD,EAAO,SAAS,CAAE,kBAAmB,EAAI,CAAE,EACxE,MAAO,CACL,KAAAmD,EACA,OAAQC,EAAK,MACnB,CACG,CACH,EACA,IAAIC,GAAgBR","names":["removeTrailingForwardSlash","path","removeLeadingForwardSlash","trimSlashes","isString","joinPaths","paths","i","isRemotePath","src","InvalidComponentArgs","name","ImageMissingAlt","InvalidImageService","MissingImageDimension","missingDimension","imageURL","FailedToFetchRemoteImageDimensions","UnsupportedImageFormat","format","imagePath","supportedFormats","UnsupportedImageConversion","ExpectedImage","typeofOptions","fullOptions","ExpectedImageOptions","options","ExpectedNotESMImage","IncompatibleDescriptorOptions","NoImageMetadata","LocalImageUsedWrongly","imageFilePath","AstroGlobUsedOutside","globStr","AstroGlobNoMatch","MissingSharp","normalizeLF","code","codeFrame","loc","lines","ln","visibleLines","n","gutterWidth","lineNo","w","output","isFocusedLine","AstroError","props","title","message","stack","location","hint","frame","source","err","VALID_SUPPORTED_FORMATS","DEFAULT_OUTPUT_FORMAT","DEFAULT_HASH_PROPS","isESMImportedImage","isRemoteImage","resolveSrc","matchPattern","url","remotePattern","matchProtocol","matchHostname","matchPort","matchPathname","port","protocol","hostname","allowWildcard","slicedHostname","pathname","slicedPathname","isRemoteAllowed","domains","remotePatterns","domain","isLocalService","service","parseQuality","quality","result","baseService","AstroErrorData.ExpectedImage","_","v","AstroErrorData.UnsupportedImageFormat","AstroErrorData.IncompatibleDescriptorOptions","AstroErrorData.UnsupportedImageConversion","AstroErrorData.LocalImageUsedWrongly","AstroErrorData.MissingImageDimension","targetWidth","targetHeight","getTargetDimensions","width","height","densities","widths","formats","attributes","srcSet","targetFormat","imageWidth","maxWidth","transformWidth","transformHeight","transformWithoutDimensions","allWidths","densityValues","density","densityWidths","index","maxTargetWidth","descriptor","srcSetTransform","imageConfig","searchParams","param","key","params","aspectRatio","sharp","qualityTable","loadSharp","sharpImport","AstroErrorData.MissingSharp","sharpService","inputBuffer","transformOptions","config","transform","parsedQuality","data","info","sharp_default"],"ignoreList":[0,1,2,3,4,5,6,7,8,9],"sources":["../../../../node_modules/@astrojs/internal-helpers/dist/path.js","../../../../node_modules/astro/dist/core/errors/errors-data.js","../../../../node_modules/astro/dist/core/errors/utils.js","../../../../node_modules/astro/dist/core/errors/printer.js","../../../../node_modules/astro/dist/core/errors/errors.js","../../../../node_modules/astro/dist/assets/consts.js","../../../../node_modules/astro/dist/assets/utils/imageKind.js","../../../../node_modules/astro/dist/assets/utils/remotePattern.js","../../../../node_modules/astro/dist/assets/services/service.js","../../../../node_modules/astro/dist/assets/services/sharp.js"],"sourcesContent":["function appendExtension(path, extension) {\n return path + \".\" + extension;\n}\nfunction appendForwardSlash(path) {\n return path.endsWith(\"/\") ? path : path + \"/\";\n}\nfunction prependForwardSlash(path) {\n return path[0] === \"/\" ? path : \"/\" + path;\n}\nfunction collapseDuplicateSlashes(path) {\n return path.replace(/(? {\n if (i === 0) {\n return removeTrailingForwardSlash(path);\n } else if (i === paths.length - 1) {\n return removeLeadingForwardSlash(path);\n } else {\n return trimSlashes(path);\n }\n }).join(\"/\");\n}\nfunction removeFileExtension(path) {\n let idx = path.lastIndexOf(\".\");\n return idx === -1 ? path : path.slice(0, idx);\n}\nfunction removeQueryString(path) {\n const index = path.lastIndexOf(\"?\");\n return index > 0 ? path.substring(0, index) : path;\n}\nfunction isRemotePath(src) {\n return /^(?:http|ftp|https|ws):?\\/\\//.test(src) || src.startsWith(\"data:\");\n}\nfunction slash(path) {\n return path.replace(/\\\\/g, \"/\");\n}\nfunction fileExtension(path) {\n const ext = path.split(\".\").pop();\n return ext !== path ? `.${ext}` : \"\";\n}\nfunction removeBase(path, base) {\n if (path.startsWith(base)) {\n return path.slice(removeTrailingForwardSlash(base).length);\n }\n return path;\n}\nexport {\n appendExtension,\n appendForwardSlash,\n collapseDuplicateSlashes,\n fileExtension,\n isRelativePath,\n isRemotePath,\n joinPaths,\n prependForwardSlash,\n removeBase,\n removeFileExtension,\n removeLeadingForwardSlash,\n removeLeadingForwardSlashWindows,\n removeQueryString,\n removeTrailingForwardSlash,\n slash,\n startsWithDotDotSlash,\n startsWithDotSlash,\n startsWithForwardSlash,\n trimSlashes\n};\n","const UnknownCompilerError = {\n name: \"UnknownCompilerError\",\n title: \"Unknown compiler error.\",\n hint: \"This is almost always a problem with the Astro compiler, not your code. Please open an issue at https://astro.build/issues/compiler.\"\n};\nconst ClientAddressNotAvailable = {\n name: \"ClientAddressNotAvailable\",\n title: \"`Astro.clientAddress` is not available in current adapter.\",\n message: (adapterName) => `\\`Astro.clientAddress\\` is not available in the \\`${adapterName}\\` adapter. File an issue with the adapter to add support.`\n};\nconst PrerenderClientAddressNotAvailable = {\n name: \"PrerenderClientAddressNotAvailable\",\n title: \"`Astro.clientAddress` cannot be used inside prerendered routes.\",\n message: `\\`Astro.clientAddress\\` cannot be used inside prerendered routes`\n};\nconst StaticClientAddressNotAvailable = {\n name: \"StaticClientAddressNotAvailable\",\n title: \"`Astro.clientAddress` is not available in static mode.\",\n message: \"`Astro.clientAddress` is only available when using `output: 'server'` or `output: 'hybrid'`. Update your Astro config if you need SSR features.\",\n hint: \"See https://docs.astro.build/en/guides/server-side-rendering/ for more information on how to enable SSR.\"\n};\nconst NoMatchingStaticPathFound = {\n name: \"NoMatchingStaticPathFound\",\n title: \"No static path found for requested path.\",\n message: (pathName) => `A \\`getStaticPaths()\\` route pattern was matched, but no matching static path was found for requested path \\`${pathName}\\`.`,\n hint: (possibleRoutes) => `Possible dynamic routes being matched: ${possibleRoutes.join(\", \")}.`\n};\nconst OnlyResponseCanBeReturned = {\n name: \"OnlyResponseCanBeReturned\",\n title: \"Invalid type returned by Astro page.\",\n message: (route, returnedValue) => `Route \\`${route ? route : \"\"}\\` returned a \\`${returnedValue}\\`. Only a [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) can be returned from Astro files.`,\n hint: \"See https://docs.astro.build/en/guides/server-side-rendering/#response for more information.\"\n};\nconst MissingMediaQueryDirective = {\n name: \"MissingMediaQueryDirective\",\n title: \"Missing value for `client:media` directive.\",\n message: 'Media query not provided for `client:media` directive. A media query similar to `client:media=\"(max-width: 600px)\"` must be provided'\n};\nconst NoMatchingRenderer = {\n name: \"NoMatchingRenderer\",\n title: \"No matching renderer found.\",\n message: (componentName, componentExtension, plural, validRenderersCount) => `Unable to render \\`${componentName}\\`.\n\n${validRenderersCount > 0 ? `There ${plural ? \"are\" : \"is\"} ${validRenderersCount} renderer${plural ? \"s\" : \"\"} configured in your \\`astro.config.mjs\\` file,\nbut ${plural ? \"none were\" : \"it was not\"} able to server-side render \\`${componentName}\\`.` : `No valid renderer was found ${componentExtension ? `for the \\`.${componentExtension}\\` file extension.` : `for this file extension.`}`}`,\n hint: (probableRenderers) => `Did you mean to enable the ${probableRenderers} integration?\n\nSee https://docs.astro.build/en/guides/framework-components/ for more information on how to install and configure integrations.`\n};\nconst NoClientEntrypoint = {\n name: \"NoClientEntrypoint\",\n title: \"No client entrypoint specified in renderer.\",\n message: (componentName, clientDirective, rendererName) => `\\`${componentName}\\` component has a \\`client:${clientDirective}\\` directive, but no client entrypoint was provided by \\`${rendererName}\\`.`,\n hint: \"See https://docs.astro.build/en/reference/integrations-reference/#addrenderer-option for more information on how to configure your renderer.\"\n};\nconst NoClientOnlyHint = {\n name: \"NoClientOnlyHint\",\n title: \"Missing hint on client:only directive.\",\n message: (componentName) => `Unable to render \\`${componentName}\\`. When using the \\`client:only\\` hydration strategy, Astro needs a hint to use the correct renderer.`,\n hint: (probableRenderers) => `Did you mean to pass \\`client:only=\"${probableRenderers}\"\\`? See https://docs.astro.build/en/reference/directives-reference/#clientonly for more information on client:only`\n};\nconst InvalidGetStaticPathParam = {\n name: \"InvalidGetStaticPathParam\",\n title: \"Invalid value returned by a `getStaticPaths` path.\",\n message: (paramType) => `Invalid params given to \\`getStaticPaths\\` path. Expected an \\`object\\`, got \\`${paramType}\\``,\n hint: \"See https://docs.astro.build/en/reference/api-reference/#getstaticpaths for more information on getStaticPaths.\"\n};\nconst InvalidGetStaticPathsEntry = {\n name: \"InvalidGetStaticPathsEntry\",\n title: \"Invalid entry inside getStaticPath's return value\",\n message: (entryType) => `Invalid entry returned by getStaticPaths. Expected an object, got \\`${entryType}\\``,\n hint: \"If you're using a `.map` call, you might be looking for `.flatMap()` instead. See https://docs.astro.build/en/reference/api-reference/#getstaticpaths for more information on getStaticPaths.\"\n};\nconst InvalidGetStaticPathsReturn = {\n name: \"InvalidGetStaticPathsReturn\",\n title: \"Invalid value returned by getStaticPaths.\",\n message: (returnType) => `Invalid type returned by \\`getStaticPaths\\`. Expected an \\`array\\`, got \\`${returnType}\\``,\n hint: \"See https://docs.astro.build/en/reference/api-reference/#getstaticpaths for more information on getStaticPaths.\"\n};\nconst GetStaticPathsExpectedParams = {\n name: \"GetStaticPathsExpectedParams\",\n title: \"Missing params property on `getStaticPaths` route.\",\n message: \"Missing or empty required `params` property on `getStaticPaths` route.\",\n hint: \"See https://docs.astro.build/en/reference/api-reference/#getstaticpaths for more information on getStaticPaths.\"\n};\nconst GetStaticPathsInvalidRouteParam = {\n name: \"GetStaticPathsInvalidRouteParam\",\n title: \"Invalid value for `getStaticPaths` route parameter.\",\n message: (key, value, valueType) => `Invalid getStaticPaths route parameter for \\`${key}\\`. Expected undefined, a string or a number, received \\`${valueType}\\` (\\`${value}\\`)`,\n hint: \"See https://docs.astro.build/en/reference/api-reference/#getstaticpaths for more information on getStaticPaths.\"\n};\nconst GetStaticPathsRequired = {\n name: \"GetStaticPathsRequired\",\n title: \"`getStaticPaths()` function required for dynamic routes.\",\n message: \"`getStaticPaths()` function is required for dynamic routes. Make sure that you `export` a `getStaticPaths` function from your dynamic route.\",\n hint: `See https://docs.astro.build/en/guides/routing/#dynamic-routes for more information on dynamic routes.\n\nAlternatively, set \\`output: \"server\"\\` or \\`output: \"hybrid\"\\` in your Astro config file to switch to a non-static server build. This error can also occur if using \\`export const prerender = true;\\`.\nSee https://docs.astro.build/en/guides/server-side-rendering/ for more information on non-static rendering.`\n};\nconst ReservedSlotName = {\n name: \"ReservedSlotName\",\n title: \"Invalid slot name.\",\n message: (slotName) => `Unable to create a slot named \\`${slotName}\\`. \\`${slotName}\\` is a reserved slot name. Please update the name of this slot.`\n};\nconst NoAdapterInstalled = {\n name: \"NoAdapterInstalled\",\n title: \"Cannot use Server-side Rendering without an adapter.\",\n message: `Cannot use \\`output: 'server'\\` or \\`output: 'hybrid'\\` without an adapter. Please install and configure the appropriate server adapter for your final deployment.`,\n hint: \"See https://docs.astro.build/en/guides/server-side-rendering/ for more information.\"\n};\nconst NoMatchingImport = {\n name: \"NoMatchingImport\",\n title: \"No import found for component.\",\n message: (componentName) => `Could not render \\`${componentName}\\`. No matching import has been found for \\`${componentName}\\`.`,\n hint: \"Please make sure the component is properly imported.\"\n};\nconst InvalidPrerenderExport = {\n name: \"InvalidPrerenderExport\",\n title: \"Invalid prerender export.\",\n message(prefix, suffix, isHydridOutput) {\n const defaultExpectedValue = isHydridOutput ? \"false\" : \"true\";\n let msg = `A \\`prerender\\` export has been detected, but its value cannot be statically analyzed.`;\n if (prefix !== \"const\") msg += `\nExpected \\`const\\` declaration but got \\`${prefix}\\`.`;\n if (suffix !== \"true\")\n msg += `\nExpected \\`${defaultExpectedValue}\\` value but got \\`${suffix}\\`.`;\n return msg;\n },\n hint: \"Mutable values declared at runtime are not supported. Please make sure to use exactly `export const prerender = true`.\"\n};\nconst InvalidComponentArgs = {\n name: \"InvalidComponentArgs\",\n title: \"Invalid component arguments.\",\n message: (name) => `Invalid arguments passed to${name ? ` <${name}>` : \"\"} component.`,\n hint: \"Astro components cannot be rendered directly via function call, such as `Component()` or `{items.map(Component)}`.\"\n};\nconst PageNumberParamNotFound = {\n name: \"PageNumberParamNotFound\",\n title: \"Page number param not found.\",\n message: (paramName) => `[paginate()] page number param \\`${paramName}\\` not found in your filepath.`,\n hint: \"Rename your file to `[page].astro` or `[...page].astro`.\"\n};\nconst ImageMissingAlt = {\n name: \"ImageMissingAlt\",\n title: 'Image missing required \"alt\" property.',\n message: 'Image missing \"alt\" property. \"alt\" text is required to describe important images on the page.',\n hint: 'Use an empty string (\"\") for decorative images.'\n};\nconst InvalidImageService = {\n name: \"InvalidImageService\",\n title: \"Error while loading image service.\",\n message: \"There was an error loading the configured image service. Please see the stack trace for more information.\"\n};\nconst MissingImageDimension = {\n name: \"MissingImageDimension\",\n title: \"Missing image dimensions\",\n message: (missingDimension, imageURL) => `Missing ${missingDimension === \"both\" ? \"width and height attributes\" : `${missingDimension} attribute`} for ${imageURL}. When using remote images, both dimensions are required in order to avoid CLS.`,\n hint: \"If your image is inside your `src` folder, you probably meant to import it instead. See [the Imports guide for more information](https://docs.astro.build/en/guides/imports/#other-assets). You can also use `inferSize={true}` for remote images to get the original dimensions.\"\n};\nconst FailedToFetchRemoteImageDimensions = {\n name: \"FailedToFetchRemoteImageDimensions\",\n title: \"Failed to retrieve remote image dimensions\",\n message: (imageURL) => `Failed to get the dimensions for ${imageURL}.`,\n hint: \"Verify your remote image URL is accurate, and that you are not using `inferSize` with a file located in your `public/` folder.\"\n};\nconst UnsupportedImageFormat = {\n name: \"UnsupportedImageFormat\",\n title: \"Unsupported image format\",\n message: (format, imagePath, supportedFormats) => `Received unsupported format \\`${format}\\` from \\`${imagePath}\\`. Currently only ${supportedFormats.join(\n \", \"\n )} are supported by our image services.`,\n hint: \"Using an `img` tag directly instead of the `Image` component might be what you're looking for.\"\n};\nconst UnsupportedImageConversion = {\n name: \"UnsupportedImageConversion\",\n title: \"Unsupported image conversion\",\n message: \"Converting between vector (such as SVGs) and raster (such as PNGs and JPEGs) images is not currently supported.\"\n};\nconst PrerenderDynamicEndpointPathCollide = {\n name: \"PrerenderDynamicEndpointPathCollide\",\n title: \"Prerendered dynamic endpoint has path collision.\",\n message: (pathname) => `Could not render \\`${pathname}\\` with an \\`undefined\\` param as the generated path will collide during prerendering. Prevent passing \\`undefined\\` as \\`params\\` for the endpoint's \\`getStaticPaths()\\` function, or add an additional extension to the endpoint's filename.`,\n hint: (filename) => `Rename \\`${filename}\\` to \\`${filename.replace(/\\.(?:js|ts)/, (m) => `.json` + m)}\\``\n};\nconst ExpectedImage = {\n name: \"ExpectedImage\",\n title: \"Expected src to be an image.\",\n message: (src, typeofOptions, fullOptions) => `Expected \\`src\\` property for \\`getImage\\` or \\`\\` to be either an ESM imported image or a string with the path of a remote image. Received \\`${src}\\` (type: \\`${typeofOptions}\\`).\n\nFull serialized options received: \\`${fullOptions}\\`.`,\n hint: \"This error can often happen because of a wrong path. Make sure the path to your image is correct. If you're passing an async function, make sure to call and await it.\"\n};\nconst ExpectedImageOptions = {\n name: \"ExpectedImageOptions\",\n title: \"Expected image options.\",\n message: (options) => `Expected getImage() parameter to be an object. Received \\`${options}\\`.`\n};\nconst ExpectedNotESMImage = {\n name: \"ExpectedNotESMImage\",\n title: \"Expected image options, not an ESM-imported image.\",\n message: \"An ESM-imported image cannot be passed directly to `getImage()`. Instead, pass an object with the image in the `src` property.\",\n hint: \"Try changing `getImage(myImage)` to `getImage({ src: myImage })`\"\n};\nconst IncompatibleDescriptorOptions = {\n name: \"IncompatibleDescriptorOptions\",\n title: \"Cannot set both `densities` and `widths`\",\n message: \"Only one of `densities` or `widths` can be specified. In most cases, you'll probably want to use only `widths` if you require specific widths.\",\n hint: \"Those attributes are used to construct a `srcset` attribute, which cannot have both `x` and `w` descriptors.\"\n};\nconst ImageNotFound = {\n name: \"ImageNotFound\",\n title: \"Image not found.\",\n message: (imagePath) => `Could not find requested image \\`${imagePath}\\`. Does it exist?`,\n hint: \"This is often caused by a typo in the image path. Please make sure the file exists, and is spelled correctly.\"\n};\nconst NoImageMetadata = {\n name: \"NoImageMetadata\",\n title: \"Could not process image metadata.\",\n message: (imagePath) => `Could not process image metadata${imagePath ? ` for \\`${imagePath}\\`` : \"\"}.`,\n hint: \"This is often caused by a corrupted or malformed image. Re-exporting the image from your image editor may fix this issue.\"\n};\nconst CouldNotTransformImage = {\n name: \"CouldNotTransformImage\",\n title: \"Could not transform image.\",\n message: (imagePath) => `Could not transform image \\`${imagePath}\\`. See the stack trace for more information.`,\n hint: \"This is often caused by a corrupted or malformed image. Re-exporting the image from your image editor may fix this issue.\"\n};\nconst ResponseSentError = {\n name: \"ResponseSentError\",\n title: \"Unable to set response.\",\n message: \"The response has already been sent to the browser and cannot be altered.\"\n};\nconst MiddlewareNoDataOrNextCalled = {\n name: \"MiddlewareNoDataOrNextCalled\",\n title: \"The middleware didn't return a `Response`.\",\n message: \"Make sure your middleware returns a `Response` object, either directly or by returning the `Response` from calling the `next` function.\"\n};\nconst MiddlewareNotAResponse = {\n name: \"MiddlewareNotAResponse\",\n title: \"The middleware returned something that is not a `Response` object.\",\n message: \"Any data returned from middleware must be a valid `Response` object.\"\n};\nconst EndpointDidNotReturnAResponse = {\n name: \"EndpointDidNotReturnAResponse\",\n title: \"The endpoint did not return a `Response`.\",\n message: \"An endpoint must return either a `Response`, or a `Promise` that resolves with a `Response`.\"\n};\nconst LocalsNotAnObject = {\n name: \"LocalsNotAnObject\",\n title: \"Value assigned to `locals` is not accepted.\",\n message: \"`locals` can only be assigned to an object. Other values like numbers, strings, etc. are not accepted.\",\n hint: \"If you tried to remove some information from the `locals` object, try to use `delete` or set the property to `undefined`.\"\n};\nconst AstroResponseHeadersReassigned = {\n name: \"AstroResponseHeadersReassigned\",\n title: \"`Astro.response.headers` must not be reassigned.\",\n message: \"Individual headers can be added to and removed from `Astro.response.headers`, but it must not be replaced with another instance of `Headers` altogether.\",\n hint: \"Consider using `Astro.response.headers.add()`, and `Astro.response.headers.delete()`.\"\n};\nconst MiddlewareCantBeLoaded = {\n name: \"MiddlewareCantBeLoaded\",\n title: \"Can't load the middleware.\",\n message: \"An unknown error was thrown while loading your middleware.\"\n};\nconst LocalImageUsedWrongly = {\n name: \"LocalImageUsedWrongly\",\n title: \"Local images must be imported.\",\n message: (imageFilePath) => `\\`Image\\`'s and \\`getImage\\`'s \\`src\\` parameter must be an imported image or an URL, it cannot be a string filepath. Received \\`${imageFilePath}\\`.`,\n hint: \"If you want to use an image from your `src` folder, you need to either import it or if the image is coming from a content collection, use the [image() schema helper](https://docs.astro.build/en/guides/images/#images-in-content-collections). See https://docs.astro.build/en/guides/images/#src-required for more information on the `src` property.\"\n};\nconst AstroGlobUsedOutside = {\n name: \"AstroGlobUsedOutside\",\n title: \"Astro.glob() used outside of an Astro file.\",\n message: (globStr) => `\\`Astro.glob(${globStr})\\` can only be used in \\`.astro\\` files. \\`import.meta.glob(${globStr})\\` can be used instead to achieve a similar result.`,\n hint: \"See Vite's documentation on `import.meta.glob` for more information: https://vite.dev/guide/features.html#glob-import\"\n};\nconst AstroGlobNoMatch = {\n name: \"AstroGlobNoMatch\",\n title: \"Astro.glob() did not match any files.\",\n message: (globStr) => `\\`Astro.glob(${globStr})\\` did not return any matching files.`,\n hint: \"Check the pattern for typos.\"\n};\nconst RedirectWithNoLocation = {\n name: \"RedirectWithNoLocation\",\n title: \"A redirect must be given a location with the `Location` header.\"\n};\nconst InvalidDynamicRoute = {\n name: \"InvalidDynamicRoute\",\n title: \"Invalid dynamic route.\",\n message: (route, invalidParam, received) => `The ${invalidParam} param for route ${route} is invalid. Received **${received}**.`\n};\nconst MissingSharp = {\n name: \"MissingSharp\",\n title: \"Could not find Sharp.\",\n message: \"Could not find Sharp. Please install Sharp (`sharp`) manually into your project or migrate to another image service.\",\n hint: \"See Sharp's installation instructions for more information: https://sharp.pixelplumbing.com/install. If you are not relying on `astro:assets` to optimize, transform, or process any images, you can configure a passthrough image service instead of installing Sharp. See https://docs.astro.build/en/reference/errors/missing-sharp for more information.\\n\\nSee https://docs.astro.build/en/guides/images/#default-image-service for more information on how to migrate to another image service.\"\n};\nconst UnknownViteError = {\n name: \"UnknownViteError\",\n title: \"Unknown Vite Error.\"\n};\nconst FailedToLoadModuleSSR = {\n name: \"FailedToLoadModuleSSR\",\n title: \"Could not import file.\",\n message: (importName) => `Could not import \\`${importName}\\`.`,\n hint: \"This is often caused by a typo in the import path. Please make sure the file exists.\"\n};\nconst InvalidGlob = {\n name: \"InvalidGlob\",\n title: \"Invalid glob pattern.\",\n message: (globPattern) => `Invalid glob pattern: \\`${globPattern}\\`. Glob patterns must start with './', '../' or '/'.`,\n hint: \"See https://docs.astro.build/en/guides/imports/#glob-patterns for more information on supported glob patterns.\"\n};\nconst FailedToFindPageMapSSR = {\n name: \"FailedToFindPageMapSSR\",\n title: \"Astro couldn't find the correct page to render\",\n message: \"Astro couldn't find the correct page to render, probably because it wasn't correctly mapped for SSR usage. This is an internal error. Please file an issue.\"\n};\nconst MissingLocale = {\n name: \"MissingLocaleError\",\n title: \"The provided locale does not exist.\",\n message: (locale) => `The locale/path \\`${locale}\\` does not exist in the configured \\`i18n.locales\\`.`\n};\nconst MissingIndexForInternationalization = {\n name: \"MissingIndexForInternationalizationError\",\n title: \"Index page not found.\",\n message: (defaultLocale) => `Could not find index page. A root index page is required in order to create a redirect to the index URL of the default locale. (\\`/${defaultLocale}\\`)`,\n hint: (src) => `Create an index page (\\`index.astro, index.md, etc.\\`) in \\`${src}\\`.`\n};\nconst IncorrectStrategyForI18n = {\n name: \"IncorrectStrategyForI18n\",\n title: \"You can't use the current function with the current strategy\",\n message: (functionName) => `The function \\`${functionName}\\` can only be used when the \\`i18n.routing.strategy\\` is set to \\`\"manual\"\\`.`\n};\nconst NoPrerenderedRoutesWithDomains = {\n name: \"NoPrerenderedRoutesWithDomains\",\n title: \"Prerendered routes aren't supported when internationalization domains are enabled.\",\n message: (component) => `Static pages aren't yet supported with multiple domains. To enable this feature, you must disable prerendering for the page ${component}`\n};\nconst MissingMiddlewareForInternationalization = {\n name: \"MissingMiddlewareForInternationalization\",\n title: \"Enabled manual internationalization routing without having a middleware.\",\n message: \"Your configuration setting `i18n.routing: 'manual'` requires you to provide your own i18n `middleware` file.\"\n};\nconst CantRenderPage = {\n name: \"CantRenderPage\",\n title: \"Astro can't render the route.\",\n message: \"Astro cannot find any content to render for this route. There is no file or redirect associated with this route.\",\n hint: \"If you expect to find a route here, this may be an Astro bug. Please file an issue/restart the dev server\"\n};\nconst UnhandledRejection = {\n name: \"UnhandledRejection\",\n title: \"Unhandled rejection\",\n message: (stack) => `Astro detected an unhandled rejection. Here's the stack trace:\n${stack}`,\n hint: \"Make sure your promises all have an `await` or a `.catch()` handler.\"\n};\nconst i18nNotEnabled = {\n name: \"i18nNotEnabled\",\n title: \"i18n Not Enabled\",\n message: \"The `astro:i18n` module can not be used without enabling i18n in your Astro config.\",\n hint: \"See https://docs.astro.build/en/guides/internationalization for a guide on setting up i18n.\"\n};\nconst i18nNoLocaleFoundInPath = {\n name: \"i18nNoLocaleFoundInPath\",\n title: \"The path doesn't contain any locale\",\n message: \"You tried to use an i18n utility on a path that doesn't contain any locale. You can use `pathHasLocale` first to determine if the path has a locale.\"\n};\nconst RouteNotFound = {\n name: \"RouteNotFound\",\n title: \"Route not found.\",\n message: `Astro could not find a route that matches the one you requested.`\n};\nconst EnvInvalidVariables = {\n name: \"EnvInvalidVariables\",\n title: \"Invalid Environment Variables\",\n message: (errors) => `The following environment variables defined in \\`experimental.env.schema\\` are invalid:\n\n${errors.map((err) => `- ${err}`).join(\"\\n\")}\n`\n};\nconst EnvUnsupportedGetSecret = {\n name: \"EnvUnsupportedGetSecret\",\n title: \"Unsupported astro:env getSecret\",\n message: \"`astro:env/server` exported function `getSecret` is not supported by your adapter.\"\n};\nconst ServerOnlyModule = {\n name: \"ServerOnlyModule\",\n title: \"Module is only available server-side\",\n message: (name) => `The \"${name}\" module is only available server-side.`\n};\nconst RewriteWithBodyUsed = {\n name: \"RewriteWithBodyUsed\",\n title: \"Cannot use Astro.rewrite after the request body has been read\",\n message: \"Astro.rewrite() cannot be used if the request body has already been read. If you need to read the body, first clone the request.\"\n};\nconst UnknownFilesystemError = {\n name: \"UnknownFilesystemError\",\n title: \"An unknown error occurred while reading or writing files to disk.\",\n hint: \"It can be caused by many things, eg. missing permissions or a file not existing we attempt to read. Check the error cause for more details.\"\n};\nconst UnknownCSSError = {\n name: \"UnknownCSSError\",\n title: \"Unknown CSS Error.\"\n};\nconst CSSSyntaxError = {\n name: \"CSSSyntaxError\",\n title: \"CSS Syntax Error.\"\n};\nconst UnknownMarkdownError = {\n name: \"UnknownMarkdownError\",\n title: \"Unknown Markdown Error.\"\n};\nconst MarkdownFrontmatterParseError = {\n name: \"MarkdownFrontmatterParseError\",\n title: \"Failed to parse Markdown frontmatter.\"\n};\nconst InvalidFrontmatterInjectionError = {\n name: \"InvalidFrontmatterInjectionError\",\n title: \"Invalid frontmatter injection.\",\n message: 'A remark or rehype plugin attempted to inject invalid frontmatter. Ensure \"astro.frontmatter\" is set to a valid JSON object that is not `null` or `undefined`.',\n hint: \"See the frontmatter injection docs https://docs.astro.build/en/guides/markdown-content/#modifying-frontmatter-programmatically for more information.\"\n};\nconst MdxIntegrationMissingError = {\n name: \"MdxIntegrationMissingError\",\n title: \"MDX integration missing.\",\n message: (file) => `Unable to render ${file}. Ensure that the \\`@astrojs/mdx\\` integration is installed.`,\n hint: \"See the MDX integration docs for installation and usage instructions: https://docs.astro.build/en/guides/integrations-guide/mdx/\"\n};\nconst UnknownConfigError = {\n name: \"UnknownConfigError\",\n title: \"Unknown configuration error.\"\n};\nconst ConfigNotFound = {\n name: \"ConfigNotFound\",\n title: \"Specified configuration file not found.\",\n message: (configFile) => `Unable to resolve \\`--config \"${configFile}\"\\`. Does the file exist?`\n};\nconst ConfigLegacyKey = {\n name: \"ConfigLegacyKey\",\n title: \"Legacy configuration detected.\",\n message: (legacyConfigKey) => `Legacy configuration detected: \\`${legacyConfigKey}\\`.`,\n hint: \"Please update your configuration to the new format.\\nSee https://astro.build/config for more information.\"\n};\nconst UnknownCLIError = {\n name: \"UnknownCLIError\",\n title: \"Unknown CLI Error.\"\n};\nconst GenerateContentTypesError = {\n name: \"GenerateContentTypesError\",\n title: \"Failed to generate content types.\",\n message: (errorMessage) => `\\`astro sync\\` command failed to generate content collection types: ${errorMessage}`,\n hint: \"Check your `src/content/config.*` file for typos.\"\n};\nconst UnknownContentCollectionError = {\n name: \"UnknownContentCollectionError\",\n title: \"Unknown Content Collection Error.\"\n};\nconst RenderUndefinedEntryError = {\n name: \"RenderUndefinedEntryError\",\n title: \"Attempted to render an undefined content collection entry.\",\n hint: \"Check if the entry is undefined before passing it to `render()`\"\n};\nconst GetEntryDeprecationError = {\n name: \"GetEntryDeprecationError\",\n title: \"Invalid use of `getDataEntryById` or `getEntryBySlug` function.\",\n message: (collection, method) => `The \\`${method}\\` function is deprecated and cannot be used to query the \"${collection}\" collection. Use \\`getEntry\\` instead.`,\n hint: \"Use the `getEntry` or `getCollection` functions to query content layer collections.\"\n};\nconst InvalidContentEntryFrontmatterError = {\n name: \"InvalidContentEntryFrontmatterError\",\n title: \"Content entry frontmatter does not match schema.\",\n message(collection, entryId, error) {\n return [\n `**${String(collection)} \\u2192 ${String(\n entryId\n )}** frontmatter does not match collection schema.`,\n ...error.errors.map((zodError) => zodError.message)\n ].join(\"\\n\");\n },\n hint: \"See https://docs.astro.build/en/guides/content-collections/ for more information on content schemas.\"\n};\nconst InvalidContentEntrySlugError = {\n name: \"InvalidContentEntrySlugError\",\n title: \"Invalid content entry slug.\",\n message(collection, entryId) {\n return `${String(collection)} \\u2192 ${String(\n entryId\n )} has an invalid slug. \\`slug\\` must be a string.`;\n },\n hint: \"See https://docs.astro.build/en/guides/content-collections/ for more on the `slug` field.\"\n};\nconst ContentSchemaContainsSlugError = {\n name: \"ContentSchemaContainsSlugError\",\n title: \"Content Schema should not contain `slug`.\",\n message: (collectionName) => `A content collection schema should not contain \\`slug\\` since it is reserved for slug generation. Remove this from your ${collectionName} collection schema.`,\n hint: \"See https://docs.astro.build/en/guides/content-collections/ for more on the `slug` field.\"\n};\nconst MixedContentDataCollectionError = {\n name: \"MixedContentDataCollectionError\",\n title: \"Content and data cannot be in same collection.\",\n message: (collectionName) => `**${collectionName}** contains a mix of content and data entries. All entries must be of the same type.`,\n hint: \"Store data entries in a new collection separate from your content collection.\"\n};\nconst ContentCollectionTypeMismatchError = {\n name: \"ContentCollectionTypeMismatchError\",\n title: \"Collection contains entries of a different type.\",\n message: (collection, expectedType, actualType) => `${collection} contains ${expectedType} entries, but is configured as a ${actualType} collection.`\n};\nconst DataCollectionEntryParseError = {\n name: \"DataCollectionEntryParseError\",\n title: \"Data collection entry failed to parse.\",\n message(entryId, errorMessage) {\n return `**${entryId}** failed to parse: ${errorMessage}`;\n },\n hint: \"Ensure your data entry is an object with valid JSON (for `.json` entries) or YAML (for `.yaml` entries).\"\n};\nconst DuplicateContentEntrySlugError = {\n name: \"DuplicateContentEntrySlugError\",\n title: \"Duplicate content entry slug.\",\n message(collection, slug, preExisting, alsoFound) {\n return `**${collection}** contains multiple entries with the same slug: \\`${slug}\\`. Slugs must be unique.\n\nEntries: \n- ${preExisting}\n- ${alsoFound}`;\n }\n};\nconst UnsupportedConfigTransformError = {\n name: \"UnsupportedConfigTransformError\",\n title: \"Unsupported transform in content config.\",\n message: (parseError) => `\\`transform()\\` functions in your content config must return valid JSON, or data types compatible with the devalue library (including Dates, Maps, and Sets).\nFull error: ${parseError}`,\n hint: \"See the devalue library for all supported types: https://github.com/rich-harris/devalue\"\n};\nconst ActionsWithoutServerOutputError = {\n name: \"ActionsWithoutServerOutputError\",\n title: \"Actions must be used with server output.\",\n message: \"Actions enabled without setting a server build output. A server is required to create callable backend functions. To deploy routes to a server, add a server adapter to your astro config.\",\n hint: \"Learn about on-demand rendering: https://docs.astro.build/en/basics/rendering-modes/#on-demand-rendered\"\n};\nconst ActionsReturnedInvalidDataError = {\n name: \"ActionsReturnedInvalidDataError\",\n title: \"Action handler returned invalid data.\",\n message: (error) => `Action handler returned invalid data. Handlers should return serializable data types like objects, arrays, strings, and numbers. Parse error: ${error}`,\n hint: \"See the devalue library for all supported types: https://github.com/rich-harris/devalue\"\n};\nconst ActionNotFoundError = {\n name: \"ActionNotFoundError\",\n title: \"Action not found.\",\n message: (actionName) => `The server received a request for an action named \\`${actionName}\\` but could not find a match. If you renamed an action, check that you've updated your \\`actions/index\\` file and your calling code to match.`,\n hint: \"You can run `astro check` to detect type errors caused by mismatched action names.\"\n};\nconst ActionCalledFromServerError = {\n name: \"ActionCalledFromServerError\",\n title: \"Action unexpected called from the server.\",\n message: \"Action called from a server page or endpoint without using `Astro.callAction()`. This wrapper must be used to call actions from server code.\",\n hint: \"See the `Astro.callAction()` reference for usage examples: https://docs.astro.build/en/reference/api-reference/#astrocallaction\"\n};\nconst UnknownError = { name: \"UnknownError\", title: \"Unknown Error.\" };\nexport {\n ActionCalledFromServerError,\n ActionNotFoundError,\n ActionsReturnedInvalidDataError,\n ActionsWithoutServerOutputError,\n AstroGlobNoMatch,\n AstroGlobUsedOutside,\n AstroResponseHeadersReassigned,\n CSSSyntaxError,\n CantRenderPage,\n ClientAddressNotAvailable,\n ConfigLegacyKey,\n ConfigNotFound,\n ContentCollectionTypeMismatchError,\n ContentSchemaContainsSlugError,\n CouldNotTransformImage,\n DataCollectionEntryParseError,\n DuplicateContentEntrySlugError,\n EndpointDidNotReturnAResponse,\n EnvInvalidVariables,\n EnvUnsupportedGetSecret,\n ExpectedImage,\n ExpectedImageOptions,\n ExpectedNotESMImage,\n FailedToFetchRemoteImageDimensions,\n FailedToFindPageMapSSR,\n FailedToLoadModuleSSR,\n GenerateContentTypesError,\n GetEntryDeprecationError,\n GetStaticPathsExpectedParams,\n GetStaticPathsInvalidRouteParam,\n GetStaticPathsRequired,\n ImageMissingAlt,\n ImageNotFound,\n IncompatibleDescriptorOptions,\n IncorrectStrategyForI18n,\n InvalidComponentArgs,\n InvalidContentEntryFrontmatterError,\n InvalidContentEntrySlugError,\n InvalidDynamicRoute,\n InvalidFrontmatterInjectionError,\n InvalidGetStaticPathParam,\n InvalidGetStaticPathsEntry,\n InvalidGetStaticPathsReturn,\n InvalidGlob,\n InvalidImageService,\n InvalidPrerenderExport,\n LocalImageUsedWrongly,\n LocalsNotAnObject,\n MarkdownFrontmatterParseError,\n MdxIntegrationMissingError,\n MiddlewareCantBeLoaded,\n MiddlewareNoDataOrNextCalled,\n MiddlewareNotAResponse,\n MissingImageDimension,\n MissingIndexForInternationalization,\n MissingLocale,\n MissingMediaQueryDirective,\n MissingMiddlewareForInternationalization,\n MissingSharp,\n MixedContentDataCollectionError,\n NoAdapterInstalled,\n NoClientEntrypoint,\n NoClientOnlyHint,\n NoImageMetadata,\n NoMatchingImport,\n NoMatchingRenderer,\n NoMatchingStaticPathFound,\n NoPrerenderedRoutesWithDomains,\n OnlyResponseCanBeReturned,\n PageNumberParamNotFound,\n PrerenderClientAddressNotAvailable,\n PrerenderDynamicEndpointPathCollide,\n RedirectWithNoLocation,\n RenderUndefinedEntryError,\n ReservedSlotName,\n ResponseSentError,\n RewriteWithBodyUsed,\n RouteNotFound,\n ServerOnlyModule,\n StaticClientAddressNotAvailable,\n UnhandledRejection,\n UnknownCLIError,\n UnknownCSSError,\n UnknownCompilerError,\n UnknownConfigError,\n UnknownContentCollectionError,\n UnknownError,\n UnknownFilesystemError,\n UnknownMarkdownError,\n UnknownViteError,\n UnsupportedConfigTransformError,\n UnsupportedImageConversion,\n UnsupportedImageFormat,\n i18nNoLocaleFoundInPath,\n i18nNotEnabled\n};\n","function positionAt(offset, text) {\n const lineOffsets = getLineOffsets(text);\n offset = Math.max(0, Math.min(text.length, offset));\n let low = 0;\n let high = lineOffsets.length;\n if (high === 0) {\n return {\n line: 0,\n column: offset\n };\n }\n while (low <= high) {\n const mid = Math.floor((low + high) / 2);\n const lineOffset = lineOffsets[mid];\n if (lineOffset === offset) {\n return {\n line: mid,\n column: 0\n };\n } else if (offset > lineOffset) {\n low = mid + 1;\n } else {\n high = mid - 1;\n }\n }\n const line = low - 1;\n return { line, column: offset - lineOffsets[line] };\n}\nfunction getLineOffsets(text) {\n const lineOffsets = [];\n let isLineStart = true;\n for (let i = 0; i < text.length; i++) {\n if (isLineStart) {\n lineOffsets.push(i);\n isLineStart = false;\n }\n const ch = text.charAt(i);\n isLineStart = ch === \"\\r\" || ch === \"\\n\";\n if (ch === \"\\r\" && i + 1 < text.length && text.charAt(i + 1) === \"\\n\") {\n i++;\n }\n }\n if (isLineStart && text.length > 0) {\n lineOffsets.push(text.length);\n }\n return lineOffsets;\n}\nfunction isYAMLException(err) {\n return err instanceof Error && err.name === \"YAMLException\";\n}\nfunction formatYAMLException(e) {\n return {\n name: e.name,\n id: e.mark.name,\n loc: { file: e.mark.name, line: e.mark.line + 1, column: e.mark.column },\n message: e.reason,\n stack: e.stack ?? \"\"\n };\n}\nfunction createSafeError(err) {\n if (err instanceof Error || err?.name && err.message) {\n return err;\n } else {\n const error = new Error(JSON.stringify(err));\n error.hint = `To get as much information as possible from your errors, make sure to throw Error objects instead of \\`${typeof err}\\`. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error for more information.`;\n return error;\n }\n}\nfunction normalizeLF(code) {\n return code.replace(/\\r\\n|\\r(?!\\n)|\\n/g, \"\\n\");\n}\nexport {\n createSafeError,\n formatYAMLException,\n isYAMLException,\n normalizeLF,\n positionAt\n};\n","import { normalizeLF } from \"./utils.js\";\nfunction codeFrame(src, loc) {\n if (!loc || loc.line === void 0 || loc.column === void 0) {\n return \"\";\n }\n const lines = normalizeLF(src).split(\"\\n\").map((ln) => ln.replace(/\\t/g, \" \"));\n const visibleLines = [];\n for (let n = -2; n <= 2; n++) {\n if (lines[loc.line + n]) visibleLines.push(loc.line + n);\n }\n let gutterWidth = 0;\n for (const lineNo of visibleLines) {\n let w = `> ${lineNo}`;\n if (w.length > gutterWidth) gutterWidth = w.length;\n }\n let output = \"\";\n for (const lineNo of visibleLines) {\n const isFocusedLine = lineNo === loc.line - 1;\n output += isFocusedLine ? \"> \" : \" \";\n output += `${lineNo + 1} | ${lines[lineNo]}\n`;\n if (isFocusedLine)\n output += `${Array.from({ length: gutterWidth }).join(\" \")} | ${Array.from({\n length: loc.column\n }).join(\" \")}^\n`;\n }\n return output;\n}\nexport {\n codeFrame\n};\n","import { codeFrame } from \"./printer.js\";\nfunction isAstroError(e) {\n return e instanceof AstroError;\n}\nclass AstroError extends Error {\n loc;\n title;\n hint;\n frame;\n type = \"AstroError\";\n constructor(props, options) {\n const { name, title, message, stack, location, hint, frame } = props;\n super(message, options);\n this.title = title;\n this.name = name;\n if (message) this.message = message;\n this.stack = stack ? stack : this.stack;\n this.loc = location;\n this.hint = hint;\n this.frame = frame;\n }\n setLocation(location) {\n this.loc = location;\n }\n setName(name) {\n this.name = name;\n }\n setMessage(message) {\n this.message = message;\n }\n setHint(hint) {\n this.hint = hint;\n }\n setFrame(source, location) {\n this.frame = codeFrame(source, location);\n }\n static is(err) {\n return err.type === \"AstroError\";\n }\n}\nclass CompilerError extends AstroError {\n type = \"CompilerError\";\n constructor(props, options) {\n super(props, options);\n }\n static is(err) {\n return err.type === \"CompilerError\";\n }\n}\nclass CSSError extends AstroError {\n type = \"CSSError\";\n static is(err) {\n return err.type === \"CSSError\";\n }\n}\nclass MarkdownError extends AstroError {\n type = \"MarkdownError\";\n static is(err) {\n return err.type === \"MarkdownError\";\n }\n}\nclass InternalError extends AstroError {\n type = \"InternalError\";\n static is(err) {\n return err.type === \"InternalError\";\n }\n}\nclass AggregateError extends AstroError {\n type = \"AggregateError\";\n errors;\n // Despite being a collection of errors, AggregateError still needs to have a main error attached to it\n // This is because Vite expects every thrown errors handled during HMR to be, well, Error and have a message\n constructor(props, options) {\n super(props, options);\n this.errors = props.errors;\n }\n static is(err) {\n return err.type === \"AggregateError\";\n }\n}\nconst astroConfigZodErrors = /* @__PURE__ */ new WeakSet();\nfunction isAstroConfigZodError(error) {\n return astroConfigZodErrors.has(error);\n}\nfunction trackAstroConfigZodError(error) {\n astroConfigZodErrors.add(error);\n}\nclass AstroUserError extends Error {\n type = \"AstroUserError\";\n /**\n * A message that explains to the user how they can fix the error.\n */\n hint;\n name = \"AstroUserError\";\n constructor(message, hint) {\n super();\n this.message = message;\n this.hint = hint;\n }\n static is(err) {\n return err.type === \"AstroUserError\";\n }\n}\nexport {\n AggregateError,\n AstroError,\n AstroUserError,\n CSSError,\n CompilerError,\n InternalError,\n MarkdownError,\n isAstroConfigZodError,\n isAstroError,\n trackAstroConfigZodError\n};\n","const VIRTUAL_MODULE_ID = \"astro:assets\";\nconst VIRTUAL_SERVICE_ID = \"virtual:image-service\";\nconst VALID_INPUT_FORMATS = [\n \"jpeg\",\n \"jpg\",\n \"png\",\n \"tiff\",\n \"webp\",\n \"gif\",\n \"svg\",\n \"avif\"\n];\nconst VALID_SUPPORTED_FORMATS = [\n \"jpeg\",\n \"jpg\",\n \"png\",\n \"tiff\",\n \"webp\",\n \"gif\",\n \"svg\",\n \"avif\"\n];\nconst DEFAULT_OUTPUT_FORMAT = \"webp\";\nconst VALID_OUTPUT_FORMATS = [\"avif\", \"png\", \"webp\", \"jpeg\", \"jpg\", \"svg\"];\nconst DEFAULT_HASH_PROPS = [\"src\", \"width\", \"height\", \"format\", \"quality\"];\nexport {\n DEFAULT_HASH_PROPS,\n DEFAULT_OUTPUT_FORMAT,\n VALID_INPUT_FORMATS,\n VALID_OUTPUT_FORMATS,\n VALID_SUPPORTED_FORMATS,\n VIRTUAL_MODULE_ID,\n VIRTUAL_SERVICE_ID\n};\n","function isESMImportedImage(src) {\n return typeof src === \"object\";\n}\nfunction isRemoteImage(src) {\n return typeof src === \"string\";\n}\nasync function resolveSrc(src) {\n return typeof src === \"object\" && \"then\" in src ? (await src).default ?? await src : src;\n}\nexport {\n isESMImportedImage,\n isRemoteImage,\n resolveSrc\n};\n","import { isRemotePath } from \"@astrojs/internal-helpers/path\";\nfunction matchPattern(url, remotePattern) {\n return matchProtocol(url, remotePattern.protocol) && matchHostname(url, remotePattern.hostname, true) && matchPort(url, remotePattern.port) && matchPathname(url, remotePattern.pathname, true);\n}\nfunction matchPort(url, port) {\n return !port || port === url.port;\n}\nfunction matchProtocol(url, protocol) {\n return !protocol || protocol === url.protocol.slice(0, -1);\n}\nfunction matchHostname(url, hostname, allowWildcard) {\n if (!hostname) {\n return true;\n } else if (!allowWildcard || !hostname.startsWith(\"*\")) {\n return hostname === url.hostname;\n } else if (hostname.startsWith(\"**.\")) {\n const slicedHostname = hostname.slice(2);\n return slicedHostname !== url.hostname && url.hostname.endsWith(slicedHostname);\n } else if (hostname.startsWith(\"*.\")) {\n const slicedHostname = hostname.slice(1);\n const additionalSubdomains = url.hostname.replace(slicedHostname, \"\").split(\".\").filter(Boolean);\n return additionalSubdomains.length === 1;\n }\n return false;\n}\nfunction matchPathname(url, pathname, allowWildcard) {\n if (!pathname) {\n return true;\n } else if (!allowWildcard || !pathname.endsWith(\"*\")) {\n return pathname === url.pathname;\n } else if (pathname.endsWith(\"/**\")) {\n const slicedPathname = pathname.slice(0, -2);\n return slicedPathname !== url.pathname && url.pathname.startsWith(slicedPathname);\n } else if (pathname.endsWith(\"/*\")) {\n const slicedPathname = pathname.slice(0, -1);\n const additionalPathChunks = url.pathname.replace(slicedPathname, \"\").split(\"/\").filter(Boolean);\n return additionalPathChunks.length === 1;\n }\n return false;\n}\nfunction isRemoteAllowed(src, {\n domains = [],\n remotePatterns = []\n}) {\n if (!isRemotePath(src)) return false;\n const url = new URL(src);\n return domains.some((domain) => matchHostname(url, domain)) || remotePatterns.some((remotePattern) => matchPattern(url, remotePattern));\n}\nexport {\n isRemoteAllowed,\n matchHostname,\n matchPathname,\n matchPattern,\n matchPort,\n matchProtocol\n};\n","import { AstroError, AstroErrorData } from \"../../core/errors/index.js\";\nimport { isRemotePath, joinPaths } from \"../../core/path.js\";\nimport { DEFAULT_HASH_PROPS, DEFAULT_OUTPUT_FORMAT, VALID_SUPPORTED_FORMATS } from \"../consts.js\";\nimport { isESMImportedImage } from \"../utils/imageKind.js\";\nimport { isRemoteAllowed } from \"../utils/remotePattern.js\";\nfunction isLocalService(service) {\n if (!service) {\n return false;\n }\n return \"transform\" in service;\n}\nfunction parseQuality(quality) {\n let result = parseInt(quality);\n if (Number.isNaN(result)) {\n return quality;\n }\n return result;\n}\nconst baseService = {\n propertiesToHash: DEFAULT_HASH_PROPS,\n validateOptions(options) {\n if (!options.src || typeof options.src !== \"string\" && typeof options.src !== \"object\") {\n throw new AstroError({\n ...AstroErrorData.ExpectedImage,\n message: AstroErrorData.ExpectedImage.message(\n JSON.stringify(options.src),\n typeof options.src,\n JSON.stringify(options, (_, v) => v === void 0 ? null : v)\n )\n });\n }\n if (!isESMImportedImage(options.src)) {\n if (options.src.startsWith(\"/@fs/\") || !isRemotePath(options.src) && !options.src.startsWith(\"/\")) {\n throw new AstroError({\n ...AstroErrorData.LocalImageUsedWrongly,\n message: AstroErrorData.LocalImageUsedWrongly.message(options.src)\n });\n }\n let missingDimension;\n if (!options.width && !options.height) {\n missingDimension = \"both\";\n } else if (!options.width && options.height) {\n missingDimension = \"width\";\n } else if (options.width && !options.height) {\n missingDimension = \"height\";\n }\n if (missingDimension) {\n throw new AstroError({\n ...AstroErrorData.MissingImageDimension,\n message: AstroErrorData.MissingImageDimension.message(missingDimension, options.src)\n });\n }\n } else {\n if (!VALID_SUPPORTED_FORMATS.includes(options.src.format)) {\n throw new AstroError({\n ...AstroErrorData.UnsupportedImageFormat,\n message: AstroErrorData.UnsupportedImageFormat.message(\n options.src.format,\n options.src.src,\n VALID_SUPPORTED_FORMATS\n )\n });\n }\n if (options.widths && options.densities) {\n throw new AstroError(AstroErrorData.IncompatibleDescriptorOptions);\n }\n if (options.src.format === \"svg\") {\n options.format = \"svg\";\n }\n if (options.src.format === \"svg\" && options.format !== \"svg\" || options.src.format !== \"svg\" && options.format === \"svg\") {\n throw new AstroError(AstroErrorData.UnsupportedImageConversion);\n }\n }\n if (!options.format) {\n options.format = DEFAULT_OUTPUT_FORMAT;\n }\n if (options.width) options.width = Math.round(options.width);\n if (options.height) options.height = Math.round(options.height);\n return options;\n },\n getHTMLAttributes(options) {\n const { targetWidth, targetHeight } = getTargetDimensions(options);\n const { src, width, height, format, quality, densities, widths, formats, ...attributes } = options;\n return {\n ...attributes,\n width: targetWidth,\n height: targetHeight,\n loading: attributes.loading ?? \"lazy\",\n decoding: attributes.decoding ?? \"async\"\n };\n },\n getSrcSet(options) {\n const srcSet = [];\n const { targetWidth } = getTargetDimensions(options);\n const { widths, densities } = options;\n const targetFormat = options.format ?? DEFAULT_OUTPUT_FORMAT;\n let imageWidth = options.width;\n let maxWidth = Infinity;\n if (isESMImportedImage(options.src)) {\n imageWidth = options.src.width;\n maxWidth = imageWidth;\n }\n const {\n width: transformWidth,\n height: transformHeight,\n ...transformWithoutDimensions\n } = options;\n const allWidths = [];\n if (densities) {\n const densityValues = densities.map((density) => {\n if (typeof density === \"number\") {\n return density;\n } else {\n return parseFloat(density);\n }\n });\n const densityWidths = densityValues.sort().map((density) => Math.round(targetWidth * density));\n allWidths.push(\n ...densityWidths.map((width, index) => ({\n maxTargetWidth: Math.min(width, maxWidth),\n descriptor: `${densityValues[index]}x`\n }))\n );\n } else if (widths) {\n allWidths.push(\n ...widths.map((width) => ({\n maxTargetWidth: Math.min(width, maxWidth),\n descriptor: `${width}w`\n }))\n );\n }\n for (const { maxTargetWidth, descriptor } of allWidths) {\n const srcSetTransform = { ...transformWithoutDimensions };\n if (maxTargetWidth !== imageWidth) {\n srcSetTransform.width = maxTargetWidth;\n } else {\n if (options.width && options.height) {\n srcSetTransform.width = options.width;\n srcSetTransform.height = options.height;\n }\n }\n srcSet.push({\n transform: srcSetTransform,\n descriptor,\n attributes: {\n type: `image/${targetFormat}`\n }\n });\n }\n return srcSet;\n },\n getURL(options, imageConfig) {\n const searchParams = new URLSearchParams();\n if (isESMImportedImage(options.src)) {\n searchParams.append(\"href\", options.src.src);\n } else if (isRemoteAllowed(options.src, imageConfig)) {\n searchParams.append(\"href\", options.src);\n } else {\n return options.src;\n }\n const params = {\n w: \"width\",\n h: \"height\",\n q: \"quality\",\n f: \"format\"\n };\n Object.entries(params).forEach(([param, key]) => {\n options[key] && searchParams.append(param, options[key].toString());\n });\n const imageEndpoint = joinPaths(import.meta.env.BASE_URL, \"/_image\");\n return `${imageEndpoint}?${searchParams}`;\n },\n parseURL(url) {\n const params = url.searchParams;\n if (!params.has(\"href\")) {\n return void 0;\n }\n const transform = {\n src: params.get(\"href\"),\n width: params.has(\"w\") ? parseInt(params.get(\"w\")) : void 0,\n height: params.has(\"h\") ? parseInt(params.get(\"h\")) : void 0,\n format: params.get(\"f\"),\n quality: params.get(\"q\")\n };\n return transform;\n }\n};\nfunction getTargetDimensions(options) {\n let targetWidth = options.width;\n let targetHeight = options.height;\n if (isESMImportedImage(options.src)) {\n const aspectRatio = options.src.width / options.src.height;\n if (targetHeight && !targetWidth) {\n targetWidth = Math.round(targetHeight * aspectRatio);\n } else if (targetWidth && !targetHeight) {\n targetHeight = Math.round(targetWidth / aspectRatio);\n } else if (!targetWidth && !targetHeight) {\n targetWidth = options.src.width;\n targetHeight = options.src.height;\n }\n }\n return {\n targetWidth,\n targetHeight\n };\n}\nexport {\n baseService,\n isLocalService,\n parseQuality\n};\n","import { AstroError, AstroErrorData } from \"../../core/errors/index.js\";\nimport {\n baseService,\n parseQuality\n} from \"./service.js\";\nlet sharp;\nconst qualityTable = {\n low: 25,\n mid: 50,\n high: 80,\n max: 100\n};\nasync function loadSharp() {\n let sharpImport;\n try {\n sharpImport = (await import(\"sharp\")).default;\n } catch {\n throw new AstroError(AstroErrorData.MissingSharp);\n }\n sharpImport.cache(false);\n return sharpImport;\n}\nconst sharpService = {\n validateOptions: baseService.validateOptions,\n getURL: baseService.getURL,\n parseURL: baseService.parseURL,\n getHTMLAttributes: baseService.getHTMLAttributes,\n getSrcSet: baseService.getSrcSet,\n async transform(inputBuffer, transformOptions, config) {\n if (!sharp) sharp = await loadSharp();\n const transform = transformOptions;\n if (transform.format === \"svg\") return { data: inputBuffer, format: \"svg\" };\n const result = sharp(inputBuffer, {\n failOnError: false,\n pages: -1,\n limitInputPixels: config.service.config.limitInputPixels\n });\n result.rotate();\n if (transform.height && !transform.width) {\n result.resize({ height: Math.round(transform.height) });\n } else if (transform.width) {\n result.resize({ width: Math.round(transform.width) });\n }\n if (transform.format) {\n let quality = void 0;\n if (transform.quality) {\n const parsedQuality = parseQuality(transform.quality);\n if (typeof parsedQuality === \"number\") {\n quality = parsedQuality;\n } else {\n quality = transform.quality in qualityTable ? qualityTable[transform.quality] : void 0;\n }\n }\n result.toFormat(transform.format, { quality });\n }\n const { data, info } = await result.toBuffer({ resolveWithObject: true });\n return {\n data,\n format: info.format\n };\n }\n};\nvar sharp_default = sharpService;\nexport {\n sharp_default as default\n};\n"],"file":"_astro/astro/assets-service.RTGLmmCa.js"}