import a from"@arcgis/core/Basemap";import{WellKnownBasemap as e,wellKnownBasemapTitles as s}from"../support/esri.js";import{basemapsAreEquivalent as r,standardBasemaps as t}from"./_layers.js";import{checkArg as E}from"./checkArg.js";export{basemapsAreEquivalent,standardBasemaps}from"./_layers.js";export async function createStandardBasemap(r){E("id",r).satisfies((a=>t.hasOwnProperty(a)),`Invalid basemap ID "${r}".`);const c=a.fromJSON(t[r]);let T;switch(c.id=r,r){case e.HYBRID_VECTOR:case e.TERRAIN_VECTOR:case e.OCEANS_VECTOR:case e.OPEN_STREET_MAP_VECTOR:T=a.fromId(r.replace("-vector",""));break;case e.SATELLITE:case e.HYBRID:case e.STREETS:case e.STREETS_VECTOR:case e.TOPO:case e.TOPO_VECTOR:case e.STREETS_NAVIGATION_VECTOR:case e.STREETS_NIGHT_VECTOR:case e.TERRAIN:case e.DARK_GRAY:case e.DARK_GRAY_VECTOR:case e.GRAY:case e.GRAY_VECTOR:case e.OCEANS:case e.OPEN_STREET_MAP:case e.STREETS_RELIEF_VECTOR:default:T=a.fromId(r)}return await Promise.all([c.load(),T?.load()]),c.title=T?.title||s[r],c.thumbnailUrl=T?.thumbnailUrl,c}export function isStandardBasemap(a){return Object.values(t).some((e=>r(e,a)))}export function getStandardBasemapId(a){return Object.entries(t).find((([e,s])=>r(a,s)))?.[0]}