Uses the bounds of the element we want the opening overtop of to set the dimensions of the opening and position it
@param {HTMLElement} targetElement The element the opening will expose
@param {SVGElement} openingElement The svg mask for the opening
777788
function positionModalOpening(targetElement, openingElement) {
  if (targetElement.getBoundingClientRect && openingElement instanceof SVGElement) {
    const { x, y, width, height, left, top } = targetElement.getBoundingClientRect();

    // getBoundingClientRect is not consistent. Some browsers use x and y, while others use left and top
    _setAttributes(openingElement, { x: x || left, y: y || top, width, height });
  }
}
69641
function (popup) {
                if (utilsArray.isEmpty(this.openedPopups)) {
                    this.connectEvents();
                }
                if (popup.modalMaskDomElement) {
                    if (this.modalPopups === 0) {
                        this.connectModalEvents();
                        this.$raiseEvent("modalPopupPresent");
                    }
                    this.modalPopups += 1;
                }
                this.openedPopups.push(popup);

                this.$raiseEvent({
                    name : "popupOpen",
                    popup : popup
                });

                if (!ariaCoreBrowser.isIE7) {
                    // The navigation elements inserted by ensureElements make the following tests fail on IE 7:
                    // - test.aria.widgets.wai.popup.dialog.modal.FirstTest
                    // - test.aria.widgets.wai.popup.dialog.modal.FourthTest
                    // Those tests are blocked in _testFocusRestoration while waiting for the opening element to
                    // be focused again. It is not obvious why adding the navigation elements prevents the opening
                    // element from being correctly focused again when the dialog is closed... just an IE 7 bug!
                    // The issue seems not to happen if we do not remove the navigation elements from the DOM when
                    // the dialog is closed. However, instead of keeping those elements in the DOM a little longer
                    // (with a non-deterministic setTimeout), we simply avoid adding those elements on IE 7:
                    this._viewportNavigationInterceptor.ensureElements();
                }
            }
1035831
function() {
        if (this.resizeFrame) {
            var DOM    = YAHOO.util.Dom;
            var el     = this.getEl();
            var dragEl = this.getDragEl();

            var bt = parseInt( DOM.getStyle(dragEl, "borderTopWidth"    ), 10);
            var br = parseInt( DOM.getStyle(dragEl, "borderRightWidth"  ), 10);
            var bb = parseInt( DOM.getStyle(dragEl, "borderBottomWidth" ), 10);
            var bl = parseInt( DOM.getStyle(dragEl, "borderLeftWidth"   ), 10);

            if (isNaN(bt)) { bt = 0; }
            if (isNaN(br)) { br = 0; }
            if (isNaN(bb)) { bb = 0; }
            if (isNaN(bl)) { bl = 0; }

            this.logger.log("proxy size: " + bt + "  " + br + " " + bb + " " + bl);

            var newWidth  = Math.max(0, el.offsetWidth  - br - bl);                                                                                           
            var newHeight = Math.max(0, el.offsetHeight - bt - bb);

            this.logger.log("Resizing proxy element");

            DOM.setStyle( dragEl, "width",  newWidth  + "px" );
            DOM.setStyle( dragEl, "height", newHeight + "px" );
        }
    }
289451
protected function linkTargetCanAccessOpener(DOMElement $element)
	{
		// Can't access window.opener if the link doesn't have a target
		if (!$element->hasAttribute('target'))
		{
			return false;
		}

		// Can't access window.opener if the link already has rel="noopener" or rel="noreferrer"
		if (preg_match('(\\bno(?:open|referr)er\\b)', $element->getAttribute('rel')))
		{
			return false;
		}

		return true;
	}
641533
function openedChanged(element) {
  if (element.state.autoFocus) {
    if (element.state.opened) {
      // Opened
      if (!element[restoreFocusToElementKey] && document.activeElement !== document.body) {
        // Remember which element had the focus before we were opened.
        element[restoreFocusToElementKey] = document.activeElement;
      }
      // Focus on the element itself (if it's focusable), or the first focusable
      // element inside it.
      // TODO: We'd prefer to require that overlays (like the Overlay base
      // class) make use of delegatesFocus via DelegateFocusMixin, which would
      // let us drop the need for this mixin here to do anything special with
      // focus. However, an initial trial of this revealed an issue in
      // MenuButton, where invoking the menu did not put the focus on the first
      // menu item as expected. Needs more investigation.
      const focusElement = firstFocusableElement(element);
      if (focusElement) {
        focusElement.focus();
      }
    } else {
      // Closed
      if (element[restoreFocusToElementKey]) {
        // Restore focus to the element that had the focus before the overlay was
        // opened.
        element[restoreFocusToElementKey].focus();
        element[restoreFocusToElementKey] = null;
      }
    }
  }
}
38608
public void showOver(Node target) {
        requireNonNull(target, "Parameter 'target' is null");

        final Point2D center = center(target.localToScreen(target.getBoundsInLocal()));
        internalShow(target, target, center.getX(), center.getY());
    }
426686
function( event, target ) {
		var options = this.options;
		if ( options.disabled ) {
			return;
		}

		// called only when using activate(false) to close all parts programmatically
		if ( !event.target ) {
			if ( !options.collapsible ) {
				return;
			}
			this.active
				.removeClass( "ui-state-active ui-corner-top" )
				.addClass( "ui-state-default ui-corner-all" )
				.children( ".ui-icon" )
					.removeClass( options.icons.headerSelected )
					.addClass( options.icons.header );
			this.active.next().addClass( "ui-accordion-content-active" );
			var toHide = this.active.next(),
				data = {
					options: options,
					newHeader: $( [] ),
					oldHeader: options.active,
					newContent: $( [] ),
					oldContent: toHide
				},
				toShow = ( this.active = $( [] ) );
			this._toggle( toShow, toHide, data );
			return;
		}

		// get the click target
		var clicked = $( event.currentTarget || target ),
			clickedIsActive = clicked[0] === this.active[0];

		// TODO the option is changed, is that correct?
		// TODO if it is correct, shouldn't that happen after determining that the click is valid?
		options.active = options.collapsible && clickedIsActive ?
			false :
			this.headers.index( clicked );

		// if animations are still active, or the active header is the target, ignore click
		if ( this.running || ( !options.collapsible && clickedIsActive ) ) {
			return;
		}

		// find elements to show and hide
		var active = this.active,
			toShow = clicked.next(),
			toHide = this.active.next(),
			data = {
				options: options,
				newHeader: clickedIsActive && options.collapsible ? $([]) : clicked,
				oldHeader: this.active,
				newContent: clickedIsActive && options.collapsible ? $([]) : toShow,
				oldContent: toHide
			},
			down = this.headers.index( this.active[0] ) > this.headers.index( clicked[0] );

		// when the call to ._toggle() comes after the class changes
		// it causes a very odd bug in IE 8 (see #6720)
		this.active = clickedIsActive ? $([]) : clicked;
		this._toggle( toShow, toHide, data, clickedIsActive, down );

		// switch classes
		active
			.removeClass( "ui-state-active ui-corner-top" )
			.addClass( "ui-state-default ui-corner-all" )
			.children( ".ui-icon" )
				.removeClass( options.icons.headerSelected )
				.addClass( options.icons.header );
		if ( !clickedIsActive ) {
			clicked
				.removeClass( "ui-state-default ui-corner-all" )
				.addClass( "ui-state-active ui-corner-top" )
				.children( ".ui-icon" )
					.removeClass( options.icons.header )
					.addClass( options.icons.headerSelected );
			clicked
				.next()
				.addClass( "ui-accordion-content-active" );
		}

		return;
	}
320243
function() {
      if (this.dialog_.hasAttribute('open')) {
        throw new Error('Failed to execute \'showModal\' on dialog: The element is already open, and therefore cannot be opened modally.');
      }
      if (!document.body.contains(this.dialog_)) {
        throw new Error('Failed to execute \'showModal\' on dialog: The element is not in a Document.');
      }
      if (!dialogPolyfill.dm.pushDialog(this)) {
        throw new Error('Failed to execute \'showModal\' on dialog: There are too many open modal dialogs.');
      }

      if (createsStackingContext(this.dialog_.parentElement)) {
        console.warn('A dialog is being shown inside a stacking context. ' +
            'This may cause it to be unusable. For more information, see this link: ' +
            'https://github.com/GoogleChrome/dialog-polyfill/#stacking-context');
      }

      this.setOpen(true);
      this.openAsModal_ = true;

      // Optionally center vertically, relative to the current viewport.
      if (dialogPolyfill.needsCentering(this.dialog_)) {
        dialogPolyfill.reposition(this.dialog_);
        this.replacedStyleTop_ = true;
      } else {
        this.replacedStyleTop_ = false;
      }

      // Insert backdrop.
      this.dialog_.parentNode.insertBefore(this.backdrop_, this.dialog_.nextSibling);

      // Focus on whatever inside the dialog.
      this.focus_();
    }
224499
function setFocusedElement(cstOption) {
    if (focusedElement) {
      focusedElement.classList.remove(builderParams.hasFocusClass);
    }
    if (typeof cstOption !== 'undefined') {
      focusedElement = cstOption;
      focusedElement.classList.add(builderParams.hasFocusClass);
      // Offset update: checks if the focused element is in the visible part of the panelClass
      // if not dispatches a custom event
      if (isOpen) {
        if (cstOption.offsetTop < cstOption.offsetParent.scrollTop
          || cstOption.offsetTop >
            (cstOption.offsetParent.scrollTop + cstOption.offsetParent.clientHeight)
            - cstOption.clientHeight) {
          cstOption.dispatchEvent(new CustomEvent('custom-select:focus-outside-panel', { bubbles: true }));
        }
      }
    } else {
      focusedElement = undefined;
    }
  }
1100999
function(element, options) {
        element = this.setElement(element);
        options = this.setOptions(options, element);

        // Add class and set relative positioning
        if (!element.is('body')) {
            element.addClass('is-maskable');

            var position = element.css('position');

            if (!position || position === 'static') {
                element.css('position', 'relative');
            }
        }

        // Find a mask or create it
        var mask = element.find('> ' + this.ns());

        if (!mask.length) {
            mask = this.render(options.template);
        }

        this.setMask(mask);

        if (options.selector) {
            this.addEvent('click', 'document', 'toggle', options.selector);
        }

        this.initialize();
    }
1281344
function _Overlay_baseOverlayConstructor(element, options) {

                    this._disposed = false;

                    // Make sure there's an input element
                    if (!element) {
                        element = _Global.document.createElement("div");
                    }

                    // Check to make sure we weren't duplicated
                    var overlay = element.winControl;
                    if (overlay) {
                        throw new _ErrorFromName("WinJS.UI._Overlay.DuplicateConstruction", strings.duplicateConstruction);
                    }

                    if (!this._element) {
                        this._element = element;
                    }

                    if (!this._element.hasAttribute("tabIndex")) {
                        this._element.tabIndex = -1;
                    }

                    this._sticky = false;
                    this._doNext = "";

                    this._element.style.visibility = "hidden";
                    this._element.style.opacity = 0;

                    // Remember ourselves
                    element.winControl = this;

                    // Attach our css class
                    _ElementUtilities.addClass(this._element, _Constants.overlayClass);
                    _ElementUtilities.addClass(this._element, "win-disposable");

                    // We don't want to be selectable, set UNSELECTABLE
                    var unselectable = this._element.getAttribute("unselectable");
                    if (unselectable === null || unselectable === undefined) {
                        this._element.setAttribute("unselectable", "on");
                    }

                    // Base animation is popIn/popOut
                    this._currentAnimateIn = this._baseAnimateIn;
                    this._currentAnimateOut = this._baseAnimateOut;
                    this._animationPromise = Promise.as();

                    // Command Animations to Queue
                    this._queuedToShow = [];
                    this._queuedToHide = [];
                    this._queuedCommandAnimation = false;

                    if (options) {
                        _Control.setOptions(this, options);
                    }

                    // Make sure _Overlay event handlers are hooked up (this aids light dismiss)
                    _Overlay._globalEventListeners.initialize();
                }
376658
function adjustTarget(oMessage) {
					if (oMessage.target) {
						var aSegments = oMessage.target.split("/");

						if (aSegments.shift() === sBindingParameter) {
							oMessage.target = aSegments.join("/");
							return;
						}
					}
					delete oMessage.target;
				}
454158
function getTargetFromShadowDom(event, defaultTarget) {
      var path, target = defaultTarget;

      // When target element is inside Shadow DOM we need to take first element from path
      // otherwise we'll get Shadow Root parent, not actual target element

      // Normalize target for WebComponents v0 implementation (in Chrome)
      path = event.path;
      if (path && path.length > 0) {
        target = path[0];
      }

      // Normalize target for WebComponents v1 implementation (standard)
      if (event.deepPath) {
        path = event.deepPath();
        if (path && path.length > 0) {
          target = path[0];
        }
      }

      return target;
    }
288425
private void applyElementSize(Element element, int width, int height, boolean addCoordSize) {
		if (width >= 0 && height >= 0) {
			if (addCoordSize) {
				Dom.setElementAttribute(element, "coordsize", width + " " + height);
			}
			Dom.setStyleAttribute(element, "width", width + "px");
			Dom.setStyleAttribute(element, "height", height + "px");
		}
	}
1019446
function(imageElement) {
			_readyCb = function() {
				try {
					var w = imageElement.width;
					var h = imageElement.height;
					var newImg = document.createElement('img');
					var ratio = (w / _w < h / _h) ? (w / _w) : (h / _h);
					newImg.setAttribute('src', imageElement.getAttribute('src'));
					newImg.height = (h / ratio);
					newImg.width = (w / ratio);
					_context.clearRect(0, 0, _w, _h);
					_context.drawImage(newImg, 0, 0, _w, _h);
					link.setIcon(_canvas);
				} catch(e) {
					throw 'Error setting image. Message: ' + e.message;
				}
			};
			if (_ready) {
				_readyCb();
			}
		}
17340
function(suppliedConfig) {

    var targetElement = suppliedConfig.el || getConfig().el;

    rootTarget = $(targetElement);

    if (rootTarget.length === 0) {
      throw triggerError('No target DOM element was found (' + targetElement + ')');
    }

    rootTarget.addClass('bookingjs');
    rootTarget.children(':not(script)').remove();

  }
710738
function toggleTargetState( element ) {
  if ( element.classList.contains( this.classes.targetExpanded ) ) {
    this.ui.target.classList.add( this.classes.targetCollapsed );
    this.ui.target.classList.remove( this.classes.targetExpanded );
  } else {
    this.ui.target.classList.add( this.classes.targetExpanded );
    this.ui.target.classList.remove( this.classes.targetCollapsed );
  }
}