@license
Copyright Google Inc. All Rights Reserved.

Use of this source code is governed by an MIT-style license that can be
found in the LICENSE file at https://angular.io/license
 Retrieves the sibling node for the given node.
352442
function getNextLNode(node) {
    // View nodes don't have TNodes, so their next must be retrieved through their LView.
    if (node.tNode.type === 2 /* View */) {
        var viewData = node.data;
        return viewData[NEXT] ? viewData[NEXT][HOST_NODE] : null;
    }
    return node.tNode.next ? node.view[node.tNode.next.index] : null;
}
991407
def siblings(self, node):
        
        incoming = self.incoming(node)
        # TODO: Not handling the case of multiple incoming nodes yet
        if len(incoming) == 1:
            incoming = incoming[0]
            siblings = self.outgoing(incoming)
            return siblings
        else:
            return [node]
1309618
private static Node getNthSibling(Node first, int index) {
    Node sibling = first;
    while (index != 0 && sibling != null) {
      sibling = sibling.getNext();
      index--;
    }
    return sibling;
  }
485676
function (obj) {
				obj = this._get_node(obj);
				if(!obj.length) { return false; }
				var s = this._get_settings().core.html_titles;
				obj = obj.children("a:eq(0)");
				if(s) {
					obj = obj.clone();
					obj.children("INS").remove();
					return obj.html();
				}
				else {
					obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
					return obj.nodeValue;
				}
			}
1368824
function getChildLNode(node) {
    if (node.tNode.child) {
        var viewData = node.tNode.type === 2 /* View */ ? node.data : node.view;
        return readElementValue(viewData[node.tNode.child.index]);
    }
    return null;
}
766498
function ($node, direction) {
      var that = this;
      // firstly, show the sibling td tags
      var $siblings = $();
      if (direction) {
        if (direction === 'left') {
          $siblings = $node.closest('table').parent().prevAll().removeClass('hidden');
        } else {
          $siblings = $node.closest('table').parent().nextAll().removeClass('hidden');
        }
      } else {
        $siblings = $node.closest('table').parent().siblings().removeClass('hidden');
      }
      // secondly, show the lines
      var $upperLevel = $node.closest('table').closest('tr').siblings();
      if (direction) {
        $upperLevel.eq(2).children('.hidden').slice(0, $siblings.length * 2).removeClass('hidden');
      } else {
        $upperLevel.eq(2).children('.hidden').removeClass('hidden');
      }
      // thirdly, do some cleaning stuff
      if (!this.getNodeState($node, 'parent').visible) {
        $upperLevel.removeClass('hidden');
        var parent = $upperLevel.find('.node')[0];
        this.repaint(parent);
        $(parent).addClass('sliding').removeClass('slide-down').one('transitionend', this.showRelatedParentEnd);
      }
      // lastly, show the sibling nodes with animation
      var $visibleNodes = $siblings.find('.node').filter(this.isVisibleNode.bind(this));
      this.repaint($visibleNodes.get(0));
      $visibleNodes.addClass('sliding').removeClass('slide-left slide-right');
      $visibleNodes.eq(0).one('transitionend', { 'node': $node, 'visibleNodes': $visibleNodes }, this.showSiblingsEnd.bind(this));
    }
1100103
function sibling(node, selector, ancestry) {
            var parent = ancestry[0], listProp, keys, i, l, k, m;
            if (!parent) { return false; }
            keys = estraverse.VisitorKeys[parent.type];
            for (i = 0, l = keys.length; i < l; ++i) {
                listProp = parent[keys[i]];
                if (isArray(listProp)) {
                    for (k = 0, m = listProp.length; k < m; ++k) {
                        if (listProp[k] !== node && matches(listProp[k], selector, ancestry)) {
                            return true;
                        }
                    }
                }
            }
            return false;
        }
830249
function() {
    var self = this;
    
    if (typeof CompilerInitialized !== "undefined") return true;
    
    oldPrepend = $.fn.prepend;
    $.fn.prepend = function()
    {
      var isFragment =
        arguments[0][0] && arguments[0][0].parentNode
        && arguments[0][0].parentNode.nodeName == "#document-fragment";
      var result = oldPrepend.apply(this, arguments);
      if (isFragment)
      AngularCompile(arguments[0]);
      return result;
    };
    
    oldAppend = $.fn.append;
    $.fn.append = function()
    {
      var isFragment =
        arguments[0][0] && arguments[0][0].parentNode
        && arguments[0][0].parentNode.nodeName == "#document-fragment";
      var result = oldAppend.apply(this, arguments);
      if (isFragment)
      AngularCompile(arguments[0]);
      return result;
    };

    AngularCompile = function(root)
    {
      var injector = angular.element($('[ng-app]')[0]).injector();
      var $compile = injector.get('$compile');
      var $rootScope = injector.get('$rootScope');
      var result = $compile(root)($rootScope);
      $rootScope.$digest();
      return result;
    }
    
    CompilerInitialized = true;
  }
1262252
function Node(key, value) {
  this.key = key;
  this.value = value;
  this.degree = 0;
  this.parent = undefined;
  this.child = undefined;
  this.sibling = undefined;
}
177622
function root(node, options = {}) {
  const {
    fragment,
    namespace: optionsNamespace,
  } = options;
  const { children = [] } = node;
  const { length: childrenLength } = children;

  let namespace = optionsNamespace;
  let rootIsDocument = childrenLength === 0;

  for (let i = 0; i < childrenLength; i += 1) {
    const {
      tagName,
      properties: {
        xmlns,
      } = {},
    } = children[i];
    if (tagName === 'html') {
      // If we have a root HTML node, we don't need to render as a fragment
      rootIsDocument = true;
      // Take namespace of first child
      if (typeof optionsNamespace === 'undefined') {
        if (xmlns) {
          namespace = xmlns;
        } else if (children[0].tagName === 'html') {
          namespace = 'http://www.w3.org/1999/xhtml';
        }
      }
    }
  }

  // The root node will be a Document, DocumentFragment, or HTMLElement
  let el;
  if (rootIsDocument) {
    el = document.implementation.createDocument(namespace, '', null);
  } else if (fragment) {
    el = document.createDocumentFragment();
  } else {
    el = document.createElement('html');
  }

  // Transform children
  const childOptions = Object.assign({ fragment, namespace }, options);
  for (let i = 0; i < childrenLength; i += 1) {
    const childEl = transform(children[i], childOptions);
    if (childEl) {
      el.appendChild(childEl);
    }
  }

  return el;
}
368943
function getNodesMetaData(rootEl) {
    let elMeta = [];

    let toVisit = [rootEl];
    let current = {el: rootEl, path: [], isPre: $.tag(rootEl) === 'PRE'};

    //generate paths for comment and text nodes. There's no way to quickly retrieve them
    //need to deeply traverse the DOM tree
    while (current) {
        let {el, isPre, path} = current;
        let childNodes = $.childNodes(el);

        for (let i = 0; i < childNodes.length; i++) {
            let childNode = childNodes[i];

            if ($.isText(childNode)) {
                let {meta, delta} = getTextMetaData(rootEl, i, childNode, path, !isPre);
                elMeta.push(...meta);
                i += delta;
            } else if ($.isElement(childNode)) {
                let name = $.getAttr(childNode, ATTR);
                if (name && $.tag(childNode) === 'SCRIPT') {
                    let {meta, delta} = getContainerMetaData(rootEl, i, childNode, path, name);
                    elMeta.push(...meta);
                    i += delta;
                } else {
                    toVisit.push({
                        el: childNode,
                        path: path.concat(i),
                        isPre: current.isPre || $.tag(childNode) === 'PRE'
                    });
                }
            }
        }

        toVisit.shift();
        current = toVisit[0];
    }

    let elementMeta = getElementsMetaData(rootEl);
    elMeta.push(...elementMeta);

    //we need to sort the elements in order of their depth, so that they can be updated
    //from bottom up when ultimately passed to a component.
    return elMeta.sort((a, b) => b.depth - a.depth);
}
749404
function () {
      let scope = context.getScope();
      while (scope && scope.type !== 'class') {
        scope = scope.upper;
      }
      const node = scope && scope.block;
      if (!node || !utils.isES6Component(node)) {
        return null;
      }
      return node;
    }
897748
function(type) {
			var result = this.spirit.element.parentNode;
			if (type) {
				var spirit = result.spirit;
				if (spirit && spirit instanceof type) {
					result = spirit;
				} else {
					result = null;
				}
			}
			return result;
		}
50949
function reference(node, clone)
			{
				clone.originalNode = node;
				
				node = node.firstChild;
				var child = clone.firstChild;
				
				while (node != null && child != null)
				{
					reference(node, child);
					node = node.nextSibling;
					child = child.nextSibling;
				}
				
				return clone;
			}
1358806
function (node) {
      var current = node;
      while (current) {
        if ((current.$mdGesture || {})[this.name]) {
          return current;
        }
        current = current.parentNode;
      }
      return null;
    }
826281
function getSibling(node, relativeIndex) {
  var parent = node.parentNode;
  if (parent === null) {
    return null;
  }
  var currentIndex = parent.childNodes.indexOf(node);
  var siblingIndex = currentIndex + relativeIndex;
  if (siblingIndex < 0 || siblingIndex > parent.childNodes.length - 1) {
    return null;
  }
  return parent.childNodes[siblingIndex];
}
601109
function getRootView(component) {
    ngDevMode && assertDefined(component, 'component');
    var lElementNode = _getComponentHostLElementNode(component);
    var lViewData = lElementNode.view;
    while (lViewData[PARENT]) {
        lViewData = lViewData[PARENT];
    }
    return lViewData;
}