import { n as normalizeMediaValue } from "../normalize-CeglrBT9.mjs";
import { n as generatePlaceholder, t as enrichImageMetadata } from "../enrich-BQ0mxJRs.mjs";

//#region src/media/types.ts
/**
* Convert a MediaProviderItem to a MediaValue for storage
*/
function mediaItemToValue(providerId, item) {
	return {
		provider: providerId,
		id: item.id,
		filename: item.filename,
		mimeType: item.mimeType,
		width: item.width,
		height: item.height,
		blurhash: item.blurhash,
		dominantColor: item.dominantColor,
		alt: item.alt,
		meta: item.meta
	};
}

//#endregion
//#region src/media/local.ts
/**
* Local media provider configuration
*
* @example
* ```ts
* import { localMedia } from "emdash/media";
*
* emdash({
*   mediaProviders: [
*     localMedia(), // Uses defaults
*     // or: localMedia({ enabled: false }) to disable
*   ],
* })
* ```
*/
function localMedia(config = {}) {
	return {
		id: "local",
		name: "Library",
		icon: "📁",
		entrypoint: "emdash/media/local-runtime",
		capabilities: {
			browse: true,
			search: false,
			upload: true,
			delete: true
		},
		config: { enabled: config.enabled ?? true }
	};
}

//#endregion
export { enrichImageMetadata, generatePlaceholder, localMedia, mediaItemToValue, normalizeMediaValue };
//# sourceMappingURL=index.mjs.map