import { __require as requireIsTextNode } from './isTextNode.js';

var containsNode_1;
var hasRequiredContainsNode;

function requireContainsNode () {
	if (hasRequiredContainsNode) return containsNode_1;
	hasRequiredContainsNode = 1;

	/**
	 * Copyright (c) 2013-present, Facebook, Inc.
	 *
	 * This source code is licensed under the MIT license found in the
	 * LICENSE file in the root directory of this source tree.
	 *
	 * 
	 */
	var isTextNode = requireIsTextNode();
	/*eslint-disable no-bitwise */

	/**
	 * Checks if a given DOM node contains or is another DOM node.
	 */


	function containsNode(outerNode, innerNode) {
	  if (!outerNode || !innerNode) {
	    return false;
	  } else if (outerNode === innerNode) {
	    return true;
	  } else if (isTextNode(outerNode)) {
	    return false;
	  } else if (isTextNode(innerNode)) {
	    return containsNode(outerNode, innerNode.parentNode);
	  } else if ('contains' in outerNode) {
	    return outerNode.contains(innerNode);
	  } else if (outerNode.compareDocumentPosition) {
	    return !!(outerNode.compareDocumentPosition(innerNode) & 16);
	  } else {
	    return false;
	  }
	}

	containsNode_1 = containsNode;
	return containsNode_1;
}

export { requireContainsNode as __require };
//# sourceMappingURL=containsNode.js.map
