@use "sass:map";
@use "sass:list";

$_fa-font-family-regular: "'Font Awesome 7 Regular'";
$_fa-font-family-solid: "'Font Awesome 7 Solid'";
$_fa-font-family-brands: "'Font Awesome 7 Brands'";
$_fa-font-family-sharp-regular: "'Font Awesome 7 Sharp Regular'";
$_fa-font-family-sharp-solid: "'Font Awesome 7 Sharp Solid'";

$_dynamic-icons: (
  "menu": (
    "at-play": (
      'font-family': $_fa-font-family-solid,
      'content': "'\e5db'",
    ),
    "at-work": (
      'font-family': $_fa-font-family-sharp-solid,
      'content': "'\e196'",
    ),
  ),
  "search": (
    "at-play": (
      'font-family': $_fa-font-family-solid,
      'content': "'\f002'",
    ),
    "at-work": (
      'font-family': $_fa-font-family-sharp-solid,
      'content': "'\f002'",
    ),
  ),
  "arrow-right": (
    "at-play": (
      'font-family': $_fa-font-family-solid,
      'content': '"\f061"',
    ),
    "at-work": (
      'font-family': $_fa-font-family-sharp-solid,
      'content': "'\f061'",
    ),
  ),
  "circle-minus": (
    "at-play": (
      'font-family': $_fa-font-family-regular,
      'content': "'\f056'",
    ),
    "at-work": (
      'font-family': $_fa-font-family-sharp-regular,
      'content': "'\f056'",
    ),
  ),
  "filter": (
    "at-play": (
      'font-family': $_fa-font-family-solid,
      'content': "'\e17c'",
    ),
    "at-work": (
      'font-family': $_fa-font-family-sharp-solid,
      'content': "'\e17c'",
    ),
  ),
  "checkbox-checked": (
    "at-play": (
      'font-family': $_fa-font-family-regular,
      'content': "'\f14a'",
    ),
    "at-work": (
      'font-family': $_fa-font-family-sharp-regular,
      'content': "'\f14a'",
    ),
  ),
  "newspaper": (
    "at-play": (
      'font-family': $_fa-font-family-regular,
      'content': "'\f1ea'",
    ),
    "at-work": (
      'font-family': $_fa-font-family-sharp-regular,
      'content': "'\f1ea'",
    ),
  ),
);

$_brand-icons: (
  "linkedin": (
    "font-family": $_fa-font-family-brands,
    "content": "'\f08c'",
  ),
  "drupal": (
    "font-family": $_fa-font-family-brands,
    "content": "'\f1a9'",
  ),
  "github": (
    "font-family": $_fa-font-family-brands,
    "content": "'\f09b'"
  ),
  "facebook": (
    "font-family": $_fa-font-family-brands,
    "content": "'\f09a'"
  ),
  "twitter": (
    "font-family": $_fa-font-family-brands,
    "content": "'\e61b'"
  ),
  "x": (
    "font-family": $_fa-font-family-brands,
    "content": "'\e61b'"
  ),
);
// This creates will give us the proper css variables.
$brands-map: ('icon': $_brand-icons);

$icon-list: ();

/// Get all the $brand-icon keys and add them to the icon-list.
@each $key, $icon in $_brand-icons {
  $icon-list: list.append(
    $icon-list,
    $key,
  );
}

/// Get all the $_dynamic-icon keys and add them to the icon-list.
@each $key, $icon in $_dynamic-icons {
  $icon-list: list.append(
    $icon-list,
    $key,
  );
}

$_at-play-map: ();
$_at-work-map: ();

/// Create maps for both "at-play" and "at-work" icons.
@each $key, $icon in $_dynamic-icons {
  $_at-play-map: (
    map.merge(
      $_at-play-map,
      ($key: map.get(
        map.get($_dynamic-icons, $key),
        'at-play'
        )
      )
    )
  );

  $_at-work-map: (
    map.merge(
      $_at-work-map,
      ($key: map.get(
        map.get($_dynamic-icons, $key),
        'at-work'
        )
      )
    )
  );
}

// This creates will give us the proper css variables.
$at-play-map: ('icon': $_at-play-map);
$at-work-map: ('icon': $_at-work-map);
