import { translate } from "i18n"
/**
* Style Manager for MapLibre GL styles
* Loads and configures local map styles with dynamic tile source
*/
import {
composeRasterFallback,
composeVectorFallback,
} from "maps_maplibre/utils/basemap_fallback"
import { classifyBasemapUrl } from "maps_maplibre/utils/basemap_url"
import { resolveTheme } from "poster_studio/data/theme_loader"
import { buildBasemapStyle } from "poster_studio/render/style_builder"
const TILE_SOURCE_URL = "https://tyles.dwri.xyz/planet/{z}/{x}/{y}.mvt"
const BASEMAP_ATTRIBUTION =
'Protomaps © OpenStreetMap'
// Cache for loaded styles
const styleCache = {}
/**
* Available map styles
*/
export const MAP_STYLES = {
dark: "dark",
light: "light",
white: "white",
black: "black",
grayscale: "grayscale",
}
/**
* Load a style JSON file via fetch
* @param {string} styleName - Name of the style
* @returns {Promise