       0        0        0        0        0        0        0        0        0        0        0        0        0        0        0        0        0
      254
 Õ    import * as Types from '#shared/graphql/types.ts';

import gql from 'graphql-tag';
import { UserAttributesFragmentDoc } from './userAttributes.api';
export const CurrentUserAttributesFragmentDoc = gql`
    fragment currentUserAttributes on User {
  ...userAttributes
  authorizations {
    id
    provider
    uid
    username
  }
  email
  permissions {
    names
  }
  hasBetaUiSwitchAvailable
  hasContentTranslationAutoAvailable
}
    ${UserAttributesFragmentDoc}`;  A   ˆl–Ðz¾”Ên-jeAà_¸'ÔÅ£�þYu¹p�Ù …Æ�üÿÄ„AuŸÃ_ˆI|¥�+y,ÃÂ 7]    /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* mfbt maths algorithms. */

#ifndef mozilla_MathAlgorithms_h
#define mozilla_MathAlgorithms_h

#include "mozilla/Assertions.h"

#include <cmath>
#include <limits.h>
#include <stdint.h>
#include <type_traits>

namespace mozilla {

// Greatest Common Divisor
template <typename IntegerType>
MOZ_ALWAYS_INLINE IntegerType EuclidGCD(IntegerType aA, IntegerType aB) {
  // Euclid's algorithm; O(N) in the worst case.  (There are better
  // ways, but we don't need them for the current use of this algo.)
  MOZ_ASSERT(aA > IntegerType(0));
  MOZ_ASSERT(aB > IntegerType(0));

  while (aA != aB) {
    if (aA > aB) {
      aA = aA - aB;
    } else {
      aB = aB - aA;
    }
  }

  return aA;
}

// Least Common Multiple
template <typename IntegerType>
MOZ_ALWAYS_INLINE IntegerType EuclidLCM(IntegerType aA, IntegerType aB) {
  // Divide first to reduce overflow risk.
  return (aA / EuclidGCD(aA, aB)) * aB;
}

namespace detail {

template <typename T>
struct AllowDeprecatedAbsFixed : std::false_type {};

template <>
struct AllowDeprecatedAbsFixed<int32_t> : std::true_type {};
template <>
struct AllowDeprecatedAbsFixed<int64_t> : std::true_type {};

template <typename T>
struct AllowDeprecatedAbs : AllowDeprecatedAbsFixed<T> {};

template <>
struct AllowDeprecatedAbs<int> : std::true_type {};
template <>
struct AllowDeprecatedAbs<long> : std::true_type {};

}  // namespace detail

// DO NOT USE DeprecatedAbs.  It exists only until its callers can be converted
// to Abs below, and it will be removed when all callers have been changed.
template <typename T>
inline std::enable_if_t<detail::AllowDeprecatedAbs<T>::value, T> DeprecatedAbs(
    const T aValue) {
  // The absolute value of the smallest possible value of a signed-integer type
  // won't fit in that type (on twos-complement systems -- and we're blithely
  // assuming we're on such systems, for the non-<stdint.h> types listed above),
  // so assert that the input isn't that value.
  //
  // This is the case if: the value is non-negative; or if adding one (giving a
  // value in the range [-maxvalue, 0]), then negating (giving a value in the
  // range [0, maxvalue]), doesn't produce maxvalue (because in twos-complement,
  // (minvalue + 1) == -maxvalue).
  MOZ_ASSERT(aValue >= 0 ||
                 -(aValue + 1) != T((1ULL << (CHAR_BIT * sizeof(T) - 1)) - 1),
             "You can't negate the smallest possible negative integer!");
  return aValue >= 0 ? aValue : -aValue;
}

namespace detail {

template <typename T, typename = void>
struct AbsReturnType;

template <typename T>
struct AbsReturnType<
    T, std::enable_if_t<std::is_integral_v<T> && std::is_signed_v<T>>> {
  using Type = std::make_unsigned_t<T>;
};

template <typename T>
struct AbsReturnType<T, std::enable_if_t<std::is_floating_point_v<T>>> {
  using Type = T;
};

}  // namespace detail

template <typename T>
inline constexpr typename detail::AbsReturnType<T>::Type Abs(const T aValue) {
  using ReturnType = typename detail::AbsReturnType<T>::Type;
  return aValue >= 0 ? ReturnType(a