<commit_before>// Helper functions!

// Replace `$search` with `$replace` in `$string`
// Credit to <NAME>: http://sassmeister.com/gist/1b4f2da5527830088e4d
//
// @param {String} $string       - Initial string
// @param {String} $search       - Substring to replace
// @param {String} $replace ('') - New value
//
// @return {String} - Updated string
@function str-replace($string, $search, $replace: "") {
  $index: str-index($string, $search);

  @if $index {
    @return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
  }

  @return $string;
}


// URL-encode a given string.
// @param {String} $string - Initial string
// @return {String} - URL-encoded string
@function url-encode($string) {
  $entities: (
    "%": "%25", // Must be first to prevent re-replacing escaped
    " ": "%20",   "!": "%21",   "\"": "%22",  "#": "%23",
    "$": "%24",   "&": "%26",   "'": "%27",   "(": "%28",
    ")": "%29",   "*": "%2A",   "+": "%2B",   ",": "%2C",
    "\/": "%2F",   ":": "%3A",   ";": "%3B",   "<": "%3C",
    "=": "%3D",   ">": "%3E",   "?": "%3F",   "@": "%40",
    "\\": "%5C"
  );

  // Fix issue that only seems to be happening in Libsass...
  $string: " " + $string + " ";

  @each $entity, $replacement in $entities {
    $string: str-replace($string, $entity, $replacement);
  }

  @return quote($string);
}


// Helper to generate Forge URLs in client app stylesheets
// @NOTE See `variables.scss` for $forge-path.
@function forge-asset-url($file) {
  @return url("#{$forge-path}#{$file}");
}

// @DEPRECATED: Use `forge-asset-url()` instead!
@function neue-asset-url($file) {
  @warn "The neue-asset-url() helper is deprecated. Use forge-asset-url() instead!";<commit_msg>Remove extra spacing.<commit_after>// Helper functions!

// Replace `$search` with `$replace` in `$string`
// Credit to <NAME>: http://sassmeister.com/gist/1b4f2da5527830088e4d
//
// @param {String} $string       - Initial string
// @param {String} $search       - Substring to replace
// @param {String} $replace ('') - New value
//
// @return {String} - Updated string
@function str-replace($string, $search, $replace: "") {
  $index: str-index($string, $search);

  @if $index {
    @return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
  }

  @return $string;
}

// URL-encode a given string.
// @param {String} $string - Initial string
// @return {String} - URL-encoded string
@function url-encode($string) {
  $entities: (
    "%": "%25", // Must be first to prevent re-replacing escaped
    " ": "%20",   "!": "%21",   "\"": "%22",  "#": "%23",
    "$": "%24",   "&": "%26",   "'": "%27",   "(": "%28",
    ")": "%29",   "*": "%2A",   "+": "%2B",   ",": "%2C",
    "\/": "%2F",   ":": "%3A",   ";": "%3B",   "<": "%3C",
    "=": "%3D",   ">": "%3E",   "?": "%3F",   "@": "%40",
    "\\": "%5C"
  );

  // Fix issue that only seems to be happening in Libsass...
  $string: " " + $string + " ";

  @each $entity, $replacement in $entities {
    $string: str-replace($string, $entity, $replacement);
  }

  @return quote($string);
}

// Helper to generate Forge URLs in client app stylesheets
// @NOTE See `variables.scss` for $forge-path.
@function forge-asset-url($file) {
  @return url("#{$forge-path}#{$file}");
}

// @DEPRECATED: Use `forge-asset-url()` instead!
@function neue-asset-url($file) {
  @warn "The neue-asset-url() helper is deprecated. Use forge-asset-url() instead!";
{'fraction_non_alphanumeric': 0.24774011299435028, 'fraction_numerical': 0.02768361581920904, 'mean_word_length': 3.205463182897862, 'pattern_counts': {'":': 46, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '948565', 'n_tokens_mistral': 1340, 'n_tokens_neox': 1281, 'n_words': 313}