"use strict"; const THEME_ICON_SHAPES = Object.freeze({ activity: '', box: '', code: '', command: '', file: '', folder: '', globe: '', key: '', "layout-panel": '', list: '', network: '', palette: '', play: '', settings: '', shield: '', table: '', terminal: '', wrench: '', }); function createThemeContributionNativeImage(nativeImage, icon, dark = false) { if (!nativeImage?.createFromDataURL || icon?.kind !== "theme") return undefined; const shape = THEME_ICON_SHAPES[icon.name] ?? ''; const color = dark ? "white" : "black"; const svg = `${shape}`; const image = nativeImage.createFromDataURL(`data:image/svg+xml;base64,${Buffer.from(svg).toString("base64")}`); return image?.isEmpty?.() ? undefined : image; } function resolveApplicationMenuIconReference(menu, commandById) { return menu?.icon ?? commandById?.get?.(menu?.command)?.icon; } module.exports = { THEME_ICON_SHAPES, createThemeContributionNativeImage, resolveApplicationMenuIconReference, };