{"version":3,"file":"index-w9mo6M8x.cjs","names":["matchesSelectorRaw","matchesQueryOrPath","matchesQueryOrPathRaw","selectorsToList","selectorsToListRaw","path","MurmurHash3","csstree","normalizeBaseDir","dir","toBase64","binString","str","escapeBackticks","matchesQueryOrPath","matchesQuery","options","matchesPath","queryValue","toMatch","matchers","toArray","matcher","v","normalizeSelector","selector","selectorsToList","selectors","resolvedSelectors","selectorStr","matchesSelector","matchesSelectors","node","replaceColor","color","replacements","isColorMapPerFiles","value","TAGS_TO_PRESERVE_LINE_WIDTH_OF","preserveLineWidth","vectorEffectAttr","COLOR_ATTRS_TO_REPLACE","\"fill\"","\"stroke\"","IGNORE_COLORS","IMPORT_TYPES","replaceColorsCss","css","context","isInline","shouldPreserveColors","nodesWithOrigColors","origColorSelectors","currentColorSelectors","didSplitSelectors","ast","isOrigColor","svgNode","identifier","origColorsRule","origColorsSelectors","listItem","parent","insertBefore","rule","ELEMENTS_TO_FORCE_SET_FILL_OF","COLOR_ATTRS_TO_REPLACE_SVG","replaceColorsSvg","firstChild","newCss","isRoot","fillAttr","isFillSetOnRoot","attr","attrsColor","viteAwesomeSvgLoader","tempDir","isBuildMode","isLibraryMode","root","base","replaceColorsList","replacementsWithFiles","filesWithCurrentColor","allFilesReplacements","hasAllFilesReplacements","isFileMatcher","replaceColorsListNormalized","command","config","cleanup","rm","signal","indexOfSvg","id","relPathWithSlash","queryKVPairs","query","pair","key","fileMatcherCtx","shouldSkipTransforms","shouldPreserveLineWidth","skipPreserveLineWidthSelectors","shouldReplaceColors","colorReplacements","entry","skipReplaceColorsSelectors","skipTransformsSelectors","hashParts","arr","param","hash","assetFileNameNoExt","assetFileName","assetRelPath","fullPath","code","readFile","classesAndIdsPrefix","didTransform","optimize","querySelectorAll","importType","type","urlImportsInLibraryMode","getExports","src","assetUrl","filePath","fileDirParts","mkdir","writeFile","require_rolldown_runtime","require_common_utils_index","imurmurhash","node_fs_promises","path","svgo","svgo_lib_xast_js","css_tree","d","f","p","m","h","g","t","n","_","v","r","y","b","x","S","C","w","T","E","D","O","s","c","l","k","A","j","M","u","o","N","P","F","I","L","R","z","B","V","H","U","W","G","K","q","J","Y","X","Z","Q","i"],"sources":["../../../loader/src/internal/misc.ts","../../../loader/src/internal/preserveLineWidth.ts","../../../loader/src/internal/const.ts","../../../loader/src/internal/replaceColorsCss.ts","../../../loader/src/internal/replaceColorsSvg.ts","../../../loader/src/loader.ts"],"sourcesContent":["import { XastChild } from \"svgo/lib/types\";\n// TODO: Update import when SVGO 4.x.x will be released, it should export utility functions\n// @ts-expect-error\nimport { matches as matchesSelectorRaw } from \"svgo/lib/xast.js\";\nimport type { ColorMapPerFiles, CssSelectors, FileMatcherFnContext, FileMatchers } from \"../types\";\nimport path from \"path\";\nimport { ResolvedColorReplacements } from \"./types\";\nimport { toArray } from \"common-utils\";\n\nexport function normalizeBaseDir(dir: string) {\n  dir = dir.replaceAll(\"\\\\\", \"/\");\n\n  if (dir.endsWith(\"/\")) {\n    dir = dir.substring(0, dir.length - 1);\n  }\n\n  return dir;\n}\n\nexport function toBase64(str: string) {\n  const binString = String.fromCodePoint(...new TextEncoder().encode(str));\n  return btoa(binString);\n}\n\n/**\n * Escapes backticks in a string with a slash: \\\\\\`\n */\nexport function escapeBackticks(str: string) {\n  return str.replaceAll(\"`\", \"\\\\`\");\n}\n\nexport interface MatchesQueryOrListOptions extends MatchesPathOptions {\n  queryValue?: string;\n}\n\n/**\n * Checks if given relative path or filename matches query value or a list of matchers\n * @param relPathWithSlash Relative path with leading slash\n * @param queryValue Value of a query param to check. If value exists and not equals to `false` (case-insensitive),\n * function returns `true`.\n * @param matchers List of matchers to check path and filename against\n */\nexport function matchesQueryOrPath(options: MatchesQueryOrListOptions) {\n  return matchesQuery(options.queryValue) || matchesPath(options);\n}\n\nexport function matchesQuery(queryValue: string | undefined) {\n  return !!queryValue && queryValue.toLowerCase() !== \"false\";\n}\n\nexport interface MatchesPathOptions extends FileMatcherFnContext {\n  matchers: FileMatchers;\n}\n\n/**\n * Checks if given relative path or filename matches a list of matchers\n * @param relPathWithSlash Relative path with leading slash\n * @param matchers List of matchers to check path and filename against\n */\nexport function matchesPath(options: MatchesPathOptions) {\n  const filename = path.basename(options.relativePath);\n  const toMatch = [filename, options.relativePath];\n  const matchers = toArray(options.matchers);\n\n  if (!matchers.length) {\n    return false;\n  }\n\n  return matchers.some((matcher) => {\n    switch (typeof matcher) {\n      case \"string\":\n        return toMatch.some((v) => v === matcher);\n\n      case \"function\":\n        return matcher({ fullPath: options.fullPath, relativePath: options.relativePath });\n    }\n\n    return toMatch.some((v) => matcher.test(v));\n  });\n}\n\n/**\n * Normalizes selector string. For now, removes unneccesarry whitespace.\n */\nfunction normalizeSelector(selector: string) {\n  return selector.replaceAll(/\\s+/g, \" \").trim();\n}\n\nexport interface SelectorsToListOptions extends FileMatcherFnContext {\n  selectors: CssSelectors;\n}\n\n/**\n * Converts CSS selectors to a list and normalizes each selector\n * @param relPathWithSlash Relative path with leading slash\n * @param selectors Selectors\n */\nexport function selectorsToList(options: SelectorsToListOptions) {\n  const selectors = toArray(options.selectors);\n  const resolvedSelectors: string[] = [];\n\n  for (const selector of selectors) {\n    if (typeof selector === \"string\") {\n      resolvedSelectors.push(normalizeSelector(selector));\n      continue;\n    }\n\n    if (matchesPath({ ...options, matchers: selector.files })) {\n      for (const selectorStr of selector.selectors) {\n        resolvedSelectors.push(normalizeSelector(selectorStr));\n      }\n    }\n  }\n\n  return resolvedSelectors;\n}\n\n/**\n * Checks if a node matches a selector\n */\nexport const matchesSelector: (node: XastChild, selector: string) => boolean = matchesSelectorRaw;\n\n/**\n * Checks if a node matches at least one CSS selector in a list\n */\nexport function matchesSelectors(node: XastChild, selectors: string[]) {\n  for (const selector of selectors) {\n    if (matchesSelector(node, selector)) {\n      return true;\n    }\n  }\n\n  return false;\n}\n\nexport function replaceColor(color: string | undefined, replacements: ResolvedColorReplacements) {\n  if (!color) {\n    return replacements.default || \"\";\n  }\n\n  return replacements.replacements[color.toLowerCase()] || replacements.default || color;\n}\n\nexport function isColorMapPerFiles(value: unknown): value is ColorMapPerFiles {\n  return Array.isArray((value as any)?.files);\n}\n","import { XastElement } from \"svgo/lib/types\";\n\nconst TAGS_TO_PRESERVE_LINE_WIDTH_OF: Record<string, true> = {\n  circle: true,\n  ellipse: true,\n  foreignObject: true,\n  image: true,\n  line: true,\n  path: true,\n  polygon: true,\n  polyline: true,\n  rect: true,\n  text: true,\n  textPath: true,\n  tspan: true,\n  use: true,\n};\n\nexport function preserveLineWidth(node: XastElement, path: string) {\n  if (!TAGS_TO_PRESERVE_LINE_WIDTH_OF[node.name]) {\n    return;\n  }\n\n  const vectorEffectAttr = node.attributes[\"vector-effect\"];\n\n  if (vectorEffectAttr && vectorEffectAttr !== \"non-scaling-stroke\") {\n    console.warn(\n      `\"${path}\": Element \"${node.name}\" already contains \"vector-effect\" property. Please remove it, ` +\n        \"so it can scale correctly. This element will not be transformed.\",\n    );\n  } else {\n    node.attributes[\"vector-effect\"] = \"non-scaling-stroke\";\n  }\n}\n","import { ImportType } from \"../types\";\n\nexport const COLOR_ATTRS_TO_REPLACE: Record<string, true> = {\n  \"fill\": true,\n  \"stroke\": true,\n  \"stop-color\": true,\n};\n\nexport const IGNORE_COLORS: Record<string, true> = {\n  none: true,\n  transparent: true,\n  currentColor: true,\n};\n\nexport const IMPORT_TYPES: ImportType[] = [\"url\", \"source\", \"source-data-uri\", \"base64\", \"base64-data-uri\"];\n","import * as csstree from \"css-tree\";\nimport { XastChild } from \"svgo/lib/types\";\nimport { COLOR_ATTRS_TO_REPLACE, IGNORE_COLORS } from \"./const\";\nimport { matchesSelector, replaceColor } from \"./misc\";\nimport { ResolvedColorReplacements } from \"./types\";\n\nexport function replaceColorsCss(\n  css: any,\n  replacements: ResolvedColorReplacements,\n  nodesWithOrigColors: XastChild[],\n  isInline = false,\n) {\n  if (!css || typeof css !== \"string\") {\n    return \"\";\n  }\n\n  let context = \"stylesheet\";\n\n  if (isInline) {\n    css = `{${css}}`;\n    context = \"block\";\n  }\n\n  // For original colors preservation\n  const shouldPreserveColors = !isInline && nodesWithOrigColors.length;\n  let origColorSelectors: string[] = [];\n  let currentColorSelectors: string[] = [];\n  let didSplitSelectors = false;\n\n  const ast = csstree.parse(css, { context });\n\n  csstree.walk(ast, {\n    // Ignore because of broken types in csstree:\n    // @ts-ignore\n    visit: shouldPreserveColors ? undefined : \"Declaration\",\n\n    enter: function (node) {\n      // Skip rules with original colors\n      if ((node as any).__SKIP_SVG_LOADER__ || (this.rule as any)?.__SKIP_SVG_LOADER__) {\n        return;\n      }\n\n      // If need to preserve colors\n      if (shouldPreserveColors) {\n        // Reset lists if it's new rule\n        if (node.type === \"SelectorList\") {\n          origColorSelectors = [];\n          currentColorSelectors = [];\n          didSplitSelectors = false;\n          return;\n        }\n\n        // Classify selectors\n        if (node.type === \"Selector\") {\n          const selector = csstree.generate(node);\n          let isOrigColor = false;\n\n          for (const svgNode of nodesWithOrigColors) {\n            if (matchesSelector(svgNode, selector)) {\n              isOrigColor = true;\n              (node as any).__ORIG_COLOR__ = true;\n              break;\n            }\n          }\n\n          (isOrigColor ? origColorSelectors : currentColorSelectors).push(selector);\n          return;\n        }\n      }\n\n      // Check if there's a declaration with a color, and if this color should be replaced\n\n      if (node.type !== \"Declaration\" || !COLOR_ATTRS_TO_REPLACE[node.property]) {\n        return;\n      }\n\n      // @ts-ignore\n      const identifier = node.value?.children?.first;\n      const color = identifier?.value || identifier?.name;\n\n      if (!color || IGNORE_COLORS[color]) {\n        return;\n      }\n\n      // Create new rule with original colors and remove such selectors from the current rule.\n      // We'll replace color in the current rule.\n\n      if (shouldPreserveColors && !didSplitSelectors && this.rule?.prelude.type === \"SelectorList\") {\n        // Split selectors and create a new rule\n\n        const origColorsRule = csstree.clone(this.rule) as csstree.Rule;\n        (origColorsRule as any).__SKIP_SVG_LOADER__ = true;\n        const origColorsSelectors = new csstree.List<csstree.CssNode>();\n        const selectors = this.rule.prelude.children;\n\n        selectors.forEach((node, listItem) => {\n          if ((node as any).__ORIG_COLOR__) {\n            selectors.remove(listItem);\n            origColorsSelectors.push(node);\n          }\n        });\n\n        (origColorsRule.prelude as csstree.SelectorList).children = origColorsSelectors;\n\n        // Parent can be either at-rule or stylesheet\n        const parent = this.atrule?.block?.children || this.stylesheet?.children;\n\n        // Find current rule in parent. FFS, why there's no indices?\n        let insertBefore: csstree.ListItem<csstree.CssNode> | undefined;\n\n        parent?.some((rule, listItem) => {\n          if (rule === this.rule) {\n            insertBefore = listItem;\n            return true;\n          }\n\n          return false;\n        });\n\n        if (insertBefore) {\n          parent?.insertData(origColorsRule, insertBefore);\n        } else {\n          parent?.push(origColorsRule);\n        }\n\n        didSplitSelectors = true;\n      }\n\n      // Replace color\n\n      node.value = csstree.parse(replaceColor(csstree.generate(node.value), replacements), {\n        context: \"value\",\n      }) as csstree.Value;\n    } satisfies csstree.EnterOrLeaveFn,\n  });\n\n  return csstree.generate(ast);\n}\n","import { XastChild, XastElement } from \"svgo/lib/types\";\nimport { IGNORE_COLORS, COLOR_ATTRS_TO_REPLACE } from \"./const\";\nimport { replaceColor } from \"./misc\";\nimport { ResolvedColorReplacements } from \"./types\";\nimport { replaceColorsCss } from \"./replaceColorsCss\";\n\n/**\n * A list of elements which should have `fill` property to be forcefully replaced.\n *\n * Fill color of these elements defaults to black, if `fill` property is not defined.\n */\nconst ELEMENTS_TO_FORCE_SET_FILL_OF: Record<string, true> = {\n  circle: true,\n  ellipse: true,\n  path: true,\n  polygon: true,\n  polyline: true,\n  rect: true,\n  text: true,\n  textPath: true,\n  tref: true,\n  tspan: true,\n};\n\nconst COLOR_ATTRS_TO_REPLACE_SVG = { ...COLOR_ATTRS_TO_REPLACE };\ndelete COLOR_ATTRS_TO_REPLACE_SVG.fill; // Fill is handled separately\n\n/**\n * Sets current color of a given node\n * @returns New value of `isFillSetOnRoot`.\n */\nexport function replaceColorsSvg(\n  node: XastElement,\n  isFillSetOnRoot: boolean,\n  replacements: ResolvedColorReplacements,\n  nodesWithOrigColors: XastChild[],\n) {\n  if (node.name === \"style\") {\n    const firstChild: any = node.children[0];\n    const newCss = replaceColorsCss(firstChild?.value, replacements, nodesWithOrigColors, false);\n\n    if (newCss) {\n      firstChild.value = newCss;\n    }\n  } else {\n    const newCss = replaceColorsCss(node.attributes.style, replacements, nodesWithOrigColors, true);\n\n    if (newCss) {\n      node.attributes.style = newCss;\n    }\n  }\n\n  const isRoot = node.name === \"svg\";\n  const fillAttr = node.attributes.fill;\n\n  // If fill is set on <svg>, it'll override default fill of all underlying elements. If that's the case,\n  // we shouldn't forcefully replace fill color of elements that are filled by default but don't have a color set\n  if (isRoot && fillAttr) {\n    isFillSetOnRoot = true;\n  }\n\n  // Forcefully replace fill color unless we have what's described above\n  if (\n    ((isRoot && isFillSetOnRoot) || (!isRoot && !isFillSetOnRoot && ELEMENTS_TO_FORCE_SET_FILL_OF[node.name])) &&\n    !IGNORE_COLORS[fillAttr]\n  ) {\n    node.attributes.fill = replaceColor(fillAttr, replacements);\n  }\n\n  // Replace rest of the colors\n  for (const attr in COLOR_ATTRS_TO_REPLACE_SVG) {\n    const attrsColor = node.attributes[attr];\n\n    if (attrsColor && !IGNORE_COLORS[attrsColor]) {\n      node.attributes[attr] = replaceColor(attrsColor, replacements);\n    }\n  }\n\n  return isFillSetOnRoot;\n}\n","import type { ConfigEnv, Plugin, UserConfig } from \"vite\";\nimport { readFile, rm, mkdir, writeFile } from \"node:fs/promises\";\nimport path from \"path\";\nimport { optimize } from \"svgo\";\nimport { XastChild } from \"svgo/lib/types\";\n// TODO: Update import when SVGO 4.x.x will be released, it should export utility functions\n// @ts-expect-error\nimport { querySelectorAll } from \"svgo/lib/xast.js\";\nimport MurmurHash3 from \"imurmurhash\";\nimport {\n  ColorMap,\n  ColorMapPerFiles,\n  CssSelectors,\n  FileMatcher,\n  FileMatcherFnContext,\n  FileMatchers,\n  SvgLoaderOptions,\n} from \"./types\";\nimport {\n  escapeBackticks,\n  isColorMapPerFiles,\n  matchesPath,\n  matchesQuery,\n  matchesQueryOrPath as matchesQueryOrPathRaw,\n  matchesSelectors,\n  normalizeBaseDir,\n  selectorsToList as selectorsToListRaw,\n  toBase64,\n} from \"./internal/misc\";\nimport { preserveLineWidth } from \"./internal/preserveLineWidth\";\nimport { ResolvedColorReplacements } from \"./internal/types\";\nimport { replaceColorsSvg } from \"./internal/replaceColorsSvg\";\nimport { IMPORT_TYPES } from \"./internal/const\";\nimport { toArray } from \"common-utils\";\n\n/**\n * `vite-awesome-svg-loader` plugin.\n *\n * See {@link SvgLoaderOptions} for advanced configuration.\n *\n * @param options Plugin options. It is recommended to provide options instead of using queries in imports.\n */\nexport function viteAwesomeSvgLoader(options: SvgLoaderOptions = {}): Plugin {\n  const { urlImportsInLibraryMode = \"source-data-uri\" } = options;\n  let tempDir = options.tempDir || \".temp\";\n\n  if (tempDir.startsWith(\"/\") || tempDir.startsWith(\"./\") || tempDir.indexOf(\":/\") !== -1) {\n    throw new Error(\n      '\"tempDir\" option must be in format \"path/to/temp/dir\",' +\n        'i.e. it shouldn\\'t be an absolute path, or start with \"./\".' +\n        \"It'll be resolved to the project's root by the plugin.\",\n    );\n  }\n\n  if (tempDir.endsWith(\"/\")) {\n    tempDir = tempDir.substring(0, tempDir.length - 1);\n  }\n\n  tempDir = \"/\" + tempDir;\n\n  let isBuildMode = false;\n  let isLibraryMode = false;\n  let root = \"\";\n  let base = \"\";\n\n  const replaceColorsList = toArray(options.replaceColorsList || []);\n\n  // Prioritize replacements like so:\n  const replacementsWithFiles: ColorMapPerFiles[] = []; // ColorMapPerFiles\n  const filesWithCurrentColor: ColorMapPerFiles[] = []; // FileMatcher\n\n  // ColorMap\n  const allFilesReplacements: ColorMapPerFiles = {\n    files: /.*/,\n    replacements: {},\n    default: \"\",\n  };\n\n  let hasAllFilesReplacements = false;\n\n  const isFileMatcher = (value: Exclude<(typeof replaceColorsList)[0], ColorMapPerFiles>): value is FileMatcher => {\n    switch (typeof value) {\n      case \"string\":\n      case \"function\":\n        return true;\n    }\n\n    return value instanceof RegExp;\n  };\n\n  // Normalize list and apply prioritization\n  for (const replacements of replaceColorsList) {\n    if (isColorMapPerFiles(replacements)) {\n      replacementsWithFiles.push(replacements);\n      continue;\n    }\n\n    if (isFileMatcher(replacements)) {\n      filesWithCurrentColor.push({\n        files: replacements,\n        replacements: {},\n        default: \"currentColor\",\n      });\n\n      continue;\n    }\n\n    for (const color in replacements) {\n      hasAllFilesReplacements = true;\n      allFilesReplacements.replacements[color] = (replacements as ColorMap)[color];\n    }\n  }\n\n  const replaceColorsListNormalized: ColorMapPerFiles[] = [...replacementsWithFiles, ...filesWithCurrentColor];\n\n  if (hasAllFilesReplacements) {\n    replaceColorsListNormalized.push(allFilesReplacements);\n  }\n\n  return {\n    name: \"vite-awesome-svg-loader\",\n    enforce: \"pre\",\n\n    config(config: UserConfig, { command }: ConfigEnv) {\n      isBuildMode = command === \"build\";\n    },\n\n    configResolved(config) {\n      isLibraryMode = !!config.build.lib;\n      root = normalizeBaseDir(config.root);\n      base = normalizeBaseDir(config.base);\n\n      const cleanup = async () => {\n        if (!isBuildMode) {\n          await rm(root + tempDir, { force: true, recursive: true });\n        }\n\n        process.exit(0);\n      };\n\n      [\"SIGINT\", \"SIGTERM\", \"SIGHUP\"].forEach((signal) => process.on(signal, cleanup));\n    },\n\n    async load(id: string) {\n      const ext = \".svg\";\n      const indexOfSvg = id.indexOf(ext);\n\n      if (indexOfSvg === -1) {\n        return null;\n      }\n\n      // Normalize file path. Vite seems to always pass absolute path, but let's be safe.\n\n      let relPathWithSlash = id.substring(0, indexOfSvg + ext.length).replaceAll(\"\\\\\", \"/\");\n\n      if (relPathWithSlash.startsWith(root)) {\n        relPathWithSlash = relPathWithSlash.substring(root.length);\n      }\n\n      if (!relPathWithSlash.startsWith(\"/\")) {\n        relPathWithSlash = \"/\" + relPathWithSlash;\n      }\n\n      // Parse query\n\n      const queryStr = id.split(\"?\", 2)[1] || \"\";\n      const queryKVPairs = queryStr.split(\"&\");\n\n      const query: Record<string, string | undefined> = {};\n\n      for (const pair of queryKVPairs) {\n        const [key, value] = pair.split(\"=\");\n        query[key.toLowerCase()] = value || \"1\";\n      }\n\n      // Create wrappers around matching functions for convenience\n\n      const fileMatcherCtx: FileMatcherFnContext = {\n        fullPath: (root.endsWith(\"/\") ? root.substring(root.length) : root) + relPathWithSlash,\n        relativePath: relPathWithSlash,\n      };\n\n      const matchesQueryOrPath = (options: { matchers: FileMatchers | undefined; param?: string }) =>\n        matchesQueryOrPathRaw({\n          ...fileMatcherCtx,\n          matchers: options.matchers || [],\n          queryValue: query[options.param!],\n        });\n\n      const selectorsToList = (selectors: CssSelectors | undefined) =>\n        selectorsToListRaw({ ...fileMatcherCtx, selectors: selectors || [] });\n\n      // Skip specified files\n\n      if (matchesQueryOrPath({ param: \"skip-awesome-svg-loader\", matchers: options.skipFilesList })) {\n        return null;\n      }\n\n      // Resolve transform configuration\n\n      const shouldSkipTransforms = matchesQueryOrPath({\n        param: \"skip-transforms\",\n        matchers: options.skipTransformsList,\n      });\n\n      const shouldPreserveLineWidth =\n        !shouldSkipTransforms &&\n        matchesQueryOrPath({ param: \"preserve-line-width\", matchers: options.preserveLineWidthList }) &&\n        !matchesQueryOrPath({ matchers: options.skipPreserveLineWidthList });\n\n      const skipPreserveLineWidthSelectors = shouldPreserveLineWidth\n        ? selectorsToList(options.skipPreserveLineWidthSelectors)\n        : [];\n\n      let shouldReplaceColors = false;\n\n      const colorReplacements: ResolvedColorReplacements = {\n        replacements: {},\n        // @ts-ignore\n        default: undefined,\n      };\n\n      if (!shouldSkipTransforms && !matchesQueryOrPath({ matchers: options.skipReplaceColorsList })) {\n        if (matchesQuery(query[\"set-current-color\"])) {\n          colorReplacements.default = \"currentColor\";\n          shouldReplaceColors = true;\n        } else {\n          for (const entry of replaceColorsListNormalized) {\n            if (!matchesPath({ ...fileMatcherCtx, matchers: entry.files })) {\n              continue;\n            }\n\n            shouldReplaceColors = true;\n\n            if (colorReplacements.default === undefined && entry.default !== undefined) {\n              colorReplacements.default = entry.default;\n            }\n\n            for (const color in entry.replacements) {\n              colorReplacements.replacements[color] ||= entry.replacements[color];\n            }\n          }\n        }\n      }\n\n      colorReplacements.default ??= \"currentColor\";\n\n      const skipReplaceColorsSelectors = shouldReplaceColors ? selectorsToList(options.skipReplaceColorsSelectors) : [];\n      const skipTransformsSelectors = shouldSkipTransforms ? [] : selectorsToList(options.skipTransformsSelectors);\n\n      // Hash path and transform parameters to guarantee same output for duplicate parameters. All parameters\n      // should be accounted and normalized (i.e. stuff like whitespace in CSS selectors shouldn't affect output).\n      //\n      // We don't want to cache the results because there may be a lot of files. Limited cache also won't help because\n      // duplicates won't likely follow one after another.\n\n      const hashParts: string[] = [relPathWithSlash];\n\n      for (const arr of [skipPreserveLineWidthSelectors, skipReplaceColorsSelectors, skipTransformsSelectors]) {\n        hashParts.push(arr.join(\",\"));\n      }\n\n      for (const param of [shouldSkipTransforms, shouldPreserveLineWidth, shouldReplaceColors]) {\n        hashParts.push(param ? \"1\" : \"0\");\n      }\n\n      if (shouldReplaceColors) {\n        hashParts.push(JSON.stringify(colorReplacements));\n      }\n\n      const hash = new MurmurHash3(hashParts.join(\"__\")).result();\n\n      // Create unique asset file name\n      const fileNameNoExt = path.basename(relPathWithSlash).split(\".\")[0];\n      const assetFileNameNoExt = `${fileNameNoExt}-${hash}`;\n      const assetFileName = assetFileNameNoExt + \".svg\";\n      const assetRelPath = path.dirname(relPathWithSlash) + \"/\" + assetFileName;\n\n      const fullPath = root + relPathWithSlash;\n      let code = (await readFile(fullPath)).toString();\n      let isFillSetOnRoot = false;\n\n      const nodesWithOrigColors: XastChild[] = [];\n      const classesAndIdsPrefix = assetFileNameNoExt + \"__\";\n      let didTransform = false; // Detect additional passes, see multipass option\n\n      code = optimize(code, {\n        multipass: true,\n        plugins: [\n          {\n            name: \"prefixIds\",\n            params: {\n              prefixIds: true,\n              prefixClassNames: true,\n              prefix: classesAndIdsPrefix,\n              delim: \"\",\n            },\n          },\n          {\n            name: \"awesome-svg-loader\",\n            fn: () => {\n              if (didTransform) {\n                return null;\n              }\n\n              didTransform = true;\n\n              return {\n                root: {\n                  enter: (root) => {\n                    for (const selectors of [skipReplaceColorsSelectors, skipTransformsSelectors]) {\n                      for (const selector of selectors) {\n                        nodesWithOrigColors.push(...querySelectorAll(root, selector));\n                      }\n                    }\n                  },\n                },\n                element: {\n                  enter: (node) => {\n                    if (matchesSelectors(node, skipTransformsSelectors)) {\n                      return;\n                    }\n\n                    if (shouldPreserveLineWidth && !matchesSelectors(node, skipPreserveLineWidthSelectors)) {\n                      preserveLineWidth(node, fullPath);\n                    }\n\n                    if (shouldReplaceColors && !matchesSelectors(node, skipReplaceColorsSelectors)) {\n                      isFillSetOnRoot = replaceColorsSvg(node, isFillSetOnRoot, colorReplacements, nodesWithOrigColors);\n                    }\n                  },\n                },\n              };\n            },\n          },\n        ],\n      }).data;\n\n      let importType = options.defaultImport || \"source\";\n\n      for (const type of IMPORT_TYPES) {\n        if (query[type]) {\n          importType = type;\n        }\n      }\n\n      if (isLibraryMode && importType === \"url\" && urlImportsInLibraryMode !== \"emit-files\") {\n        importType = urlImportsInLibraryMode;\n      }\n\n      /**\n       * Returns exports string\n       * @param src Source code enclosed with quotes. Single quotes, double quotes and backticks are fine\n       * as long as they're escaped in the actual source code.)\n       * @returns Exports string\n       */\n      const getExports = (src: string) => {\n        return [\n          `export const src = ${src};`,\n          `export const prefix = \"${classesAndIdsPrefix}\"`,\n          `export default src`,\n        ].join(\"\\n\");\n      };\n\n      switch (importType) {\n        case \"source\":\n          return getExports(\"`\" + escapeBackticks(code) + \"`\");\n        case \"source-data-uri\":\n          return getExports(\"`data:image/svg+xml,\" + encodeURIComponent(code) + \"`\");\n        case \"base64\":\n          return getExports(\"`\" + escapeBackticks(toBase64(code)) + \"`\");\n        case \"base64-data-uri\":\n          return getExports(\"`data:image/svg+xml;base64,\" + encodeURIComponent(toBase64(code)) + \"`\");\n      }\n\n      if (!isBuildMode) {\n        const assetUrl = tempDir + assetRelPath;\n        const filePath = root + assetUrl;\n        const fileDirParts = filePath.split(\"/\");\n        fileDirParts.pop();\n        await mkdir(fileDirParts.join(\"/\"), { recursive: true });\n        await writeFile(filePath, code);\n        return getExports(`\"${base + assetUrl}\"`);\n      }\n\n      const assetId = this.emitFile({\n        type: \"asset\",\n        name: assetFileName,\n        source: code,\n      });\n\n      return getExports(`\"__VITE_ASSET__${assetId}__\"`);\n    },\n  };\n}\n"],"mappings":"A,gSASA,SAAgBQ,EAAiB,EAAa,CAO5C,MANA,GAAMC,EAAI,WAAW,KAAM,GAAG,EAE1BA,EAAI,SAAS,GAAG,IAClB,EAAMA,EAAI,UAAU,EAAGA,EAAI,OAAS,CAAC,GAGhCA,CACT,CAEA,SAAgBC,EAAS,EAAa,CACpC,IAAMC,EAAY,OAAO,cAAc,GAAG,IAAI,YAAY,CAAC,CAAC,OAAOC,CAAG,CAAC,EACvE,OAAO,KAAKD,CAAS,CACvB,CAKA,SAAgBE,EAAgB,EAAa,CAC3C,OAAOD,EAAI,WAAW,IAAK,KAAK,CAClC,CAaA,SAAgBE,EAAmB,EAAoC,CACrE,OAAOC,EAAaC,EAAQ,UAAU,GAAKC,EAAYD,CAAO,CAChE,CAEA,SAAgBD,EAAa,EAAgC,CAC3D,MAAO,CAAC,CAACG,GAAcA,EAAW,YAAY,IAAM,OACtD,CAWA,SAAgBD,EAAY,EAA6B,CAEvD,IAAME,EAAU,CADCd,EAAAA,QAAK,SAASW,EAAQ,YACtB,EAAUA,EAAQ,YAAY,EACzCI,EAAWC,EAAAA,EAAQL,EAAQ,QAAQ,EAMzC,OAJKI,EAAS,OAIPA,EAAS,KAAM,GAAY,CAChC,OAAQ,OAAOE,EAAf,CACE,IAAK,SACH,OAAOH,EAAQ,KAAM,GAAMI,IAAMD,CAAO,EAE1C,IAAK,WACH,OAAOA,EAAQ,CAAE,SAAUN,EAAQ,SAAU,aAAcA,EAAQ,YAAa,CAAC,CACrF,CAEA,OAAOG,EAAQ,KAAM,GA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