"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

exports.__esModule = true;
exports.IS_WECHATBROWSER = exports.IS_UC_MOBILE = exports.IS_SAFARI = exports.IS_REACT_VERSION_17_OR_ABOVE = exports.IS_QQBROWSER = exports.IS_IOS = exports.IS_FIREFOX_LEGACY = exports.IS_FIREFOX = exports.IS_EDGE_LEGACY = exports.IS_CHROME_LEGACY = exports.IS_CHROME = exports.IS_APPLE = exports.IS_ANDROID = exports.HAS_BEFORE_INPUT_SUPPORT = exports.CAN_USE_DOM = void 0;

var _react = _interopRequireDefault(require("react"));

const IS_REACT_VERSION_17_OR_ABOVE = parseInt(_react.default.version.split(".")[0], 10) >= 17;
exports.IS_REACT_VERSION_17_OR_ABOVE = IS_REACT_VERSION_17_OR_ABOVE;
const IS_IOS = typeof navigator !== "undefined" && typeof window !== "undefined" && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
exports.IS_IOS = IS_IOS;
const IS_APPLE = typeof navigator !== "undefined" && /Mac OS X/.test(navigator.userAgent);
exports.IS_APPLE = IS_APPLE;
const IS_ANDROID = typeof navigator !== "undefined" && /Android/.test(navigator.userAgent);
exports.IS_ANDROID = IS_ANDROID;
const IS_FIREFOX = typeof navigator !== "undefined" && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);
exports.IS_FIREFOX = IS_FIREFOX;
const IS_SAFARI = typeof navigator !== "undefined" && /Version\/[\d\.]+.*Safari/.test(navigator.userAgent); // "modern" Edge was released at 79.x

exports.IS_SAFARI = IS_SAFARI;
const IS_EDGE_LEGACY = typeof navigator !== "undefined" && /Edge?\/(?:[0-6][0-9]|[0-7][0-8])(?:\.)/i.test(navigator.userAgent);
exports.IS_EDGE_LEGACY = IS_EDGE_LEGACY;
const IS_CHROME = typeof navigator !== "undefined" && /Chrome/i.test(navigator.userAgent); // Native `beforeInput` events don't work well with react on Chrome 75
// and older, Chrome 76+ can use `beforeInput` though.

exports.IS_CHROME = IS_CHROME;
const IS_CHROME_LEGACY = typeof navigator !== "undefined" && /Chrome?\/(?:[0-7][0-5]|[0-6][0-9])(?:\.)/i.test(navigator.userAgent); // Firefox did not support `beforeInput` until `v87`.

exports.IS_CHROME_LEGACY = IS_CHROME_LEGACY;
const IS_FIREFOX_LEGACY = typeof navigator !== "undefined" && /^(?!.*Seamonkey)(?=.*Firefox\/(?:[0-7][0-9]|[0-8][0-6])(?:\.)).*/i.test(navigator.userAgent); // qq browser

exports.IS_FIREFOX_LEGACY = IS_FIREFOX_LEGACY;
const IS_QQBROWSER = typeof navigator !== "undefined" && /.*QQBrowser/.test(navigator.userAgent); // UC mobile browser

exports.IS_QQBROWSER = IS_QQBROWSER;
const IS_UC_MOBILE = typeof navigator !== "undefined" && /.*UCBrowser/.test(navigator.userAgent); // Wechat browser

exports.IS_UC_MOBILE = IS_UC_MOBILE;
const IS_WECHATBROWSER = typeof navigator !== "undefined" && /.*Wechat/.test(navigator.userAgent); // Check if DOM is available as React does internally.
// https://github.com/facebook/react/blob/master/packages/shared/ExecutionEnvironment.js

exports.IS_WECHATBROWSER = IS_WECHATBROWSER;
const CAN_USE_DOM = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined"); // COMPAT: Firefox/Edge Legacy don't support the `beforeinput` event
// Chrome Legacy doesn't support `beforeinput` correctly

exports.CAN_USE_DOM = CAN_USE_DOM;
const HAS_BEFORE_INPUT_SUPPORT = !IS_CHROME_LEGACY && !IS_EDGE_LEGACY && // globalThis is undefined in older browsers
typeof globalThis !== "undefined" && globalThis.InputEvent && // @ts-ignore The `getTargetRanges` property isn't recognized.
typeof globalThis.InputEvent.prototype.getTargetRanges === "function";
exports.HAS_BEFORE_INPUT_SUPPORT = HAS_BEFORE_INPUT_SUPPORT;