/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import e from"../../Color.js";import{isSome as o}from"../../core/arrayUtils.js";import{createUniqueColors as t}from"../../core/colorUtils.js";import n from"./support/colors.js";import{createThemes as r,filterSchemesByName as a,getRawSchemes as i,filterSchemesByTag as c,getThemesforBasemap as s}from"./support/symbologyUtils.js";const m={light:{color:[153,153,153,.25],width:"1px"},dark:{color:[153,153,153,.25],width:"1px"}},l=["vibrant-rainbow","cat-dark","predominant-v2","predominant-v1","predominance-race","desert-blooms","tropical-bliss","under-the-sea","ocean-bay","cat-light","predominant-v4","predominance-money","predominant-v3","predominance-race-ethnic","pastel-chalk","predominance-rainbow","predominance-sequence","cat-popup-olympic-sunset"],p=r({themeDictionary:{default:{name:"default",label:"Default",description:"Default theme for visualizing features using the density of randomly placed dots.",schemes:{default:{light:{primary:"predominant-v5",secondary:l,common:{outline:m.light,fillOpacity:.8}},dark:{primary:"predominant-v5",secondary:l,common:{outline:m.dark,fillOpacity:.8}}}}}}});function u(e){return s(p,e)}function d(e){const t="default",n=i({basemap:e.basemap,basemapTheme:e.basemapTheme,theme:p.get(t)});if(!n)return;const{schemesInfo:r,basemapId:a,basemapTheme:c}=n,s=r.common,m=e.numColors;return{primaryScheme:b(r.primary,s,m),secondarySchemes:r.secondary.map(e=>b(e,s,m)).filter(o),basemapId:a,basemapTheme:c}}function f(e){return a(e.name,d(e))}function h(e){return c(e.includedTags,e.excludedTags,d(e))}function y(o){if(!o)return;const t={...o};return t.tags=[...t.tags],t.colors&&(t.colors=t.colors.map(o=>new e(o))),t.outline&&(t.outline={color:t.outline.color&&new e(t.outline.color),width:t.outline.width}),t}function b(e,o,r){const a=n[e];if(!a)return;return g({name:a.name,tags:a.tags,colors:a[r]||t(a.stops,r),opacity:o.fillOpacity,outline:o.outline})}function g(o){return{name:o.name,tags:[...o.tags],colors:o.colors.map(o=>new e(o)),outline:{color:new e(o.outline.color),width:o.outline.width},opacity:o.opacity}}export{y as cloneScheme,f as getSchemeByName,d as getSchemes,h as getSchemesByTag,u as getThemes};
