Component which has a draggable element in the middle which reveals one or
the other sides as the user drags.

@constructor
548367
function DualViewer(el, opts) {
      classCallCheck(this, DualViewer);

      var _this = possibleConstructorReturn(this, _TinyEmitter.call(this));

      _this.element = el;

      _this.options = Object.assign({}, DualViewer.Defaults, opts);

      _this._isVertical = _this.options.isVertical;

      /** @private {Element} */
      _this._scrubberEl = null;

      /** @private {Element} */
      _this._overlayEl = null;

      /** @private {Element} */
      _this._underlayEl = null;

      /** @private {Element} */
      _this._overlayObjectEl = null;

      /**
       * Dragger component
       * @type {OdoDraggable}
       * @private
       */
      _this._draggable = null;

      /**
       * Boundary for the scrubber.
       * @type {Rect}
       * @private
       */
      _this._scrubberLimits = null;

      /**
       * The axis to drag depends on the carousel direction.
       * @type {OdoPointer.Axis}
       * @private
       */
      _this._dragAxis = _this._isVertical ? 'y' : 'x';

      /**
       * Height or width.
       * @type {string}
       * @private
       */
      _this._dimensionAttr = _this._isVertical ? 'height' : 'width';

      /**
       * Previous percentage revealed. Needed for window resizes to reset back to
       * correct position.
       * @type {number}
       * @private
       */
      _this._previousPercent = _this.options.startPosition;

      /**
       * Current position of the dual viewer.
       * @type {number}
       * @private
       */
      _this._position = DualViewer.Position.CENTER;

      /** @private {boolean} */
      _this._isResting = true;

      _this.decorate();
      return _this;
    }
1082318
function (e) {
            if (!this.dragging) {
                return;
            }

            var x = e.pageX || e.originalEvent.touches && e.originalEvent.touches[0].pageX;
            this.coords.x_pointer = x - this.coords.x_gap;

            this.calc();
        }
1093811
function eventElementHandlers(event, eventElement) {
		eventElement
			.click(function(ev) {
				if (!eventElement.hasClass('ui-draggable-dragging') &&
					!eventElement.hasClass('ui-resizable-resizing')) {
						return trigger('eventClick', this, event, ev);
					}
			})
			.hover(
				function(ev) {
					trigger('eventMouseover', this, event, ev);
				},
				function(ev) {
					trigger('eventMouseout', this, event, ev);
				}
			);
		// TODO: don't fire eventMouseover/eventMouseout *while* dragging is occuring (on subject element)
		// TODO: same for resizing
	}
889099
function (evt) {
                this._dragStartPosition = null;
                disconnectMouseEvents(this);

                var element = this._activeDrag;
                if (element) {
                    element.end();
                }

                this._candidateForDrag = null;
                this._activeDrag = null;
            }
137457
private void handleRelease() {
        float speed = Math.max(dragHelper.getDragSpeed(), animationSpeed);

        if (getTopMargin() > initialMargin ||
                (dragHelper.getDragSpeed() > animationSpeed && dragHelper.getDragDistance() > 0) ||
                (getDeviceType(getContext()) == DeviceType.TABLET && isMaximized() &&
                        getTopMargin() > minMargin)) {
            animateHideView(parentHeight - getTopMargin(), speed, new DecelerateInterpolator(),
                    true);
        } else {
            animateShowView(-(getTopMargin() - minMargin), speed, new DecelerateInterpolator());
        }
    }
991651
function dragInit(event) {
            var isTouch = event.type === 'touchstart',
                source = event.data.source,
                isSlidee = source === 'slidee';

            // Ignore other than left mouse button
            if (isTouch || event.which <= 1) {
                stopDefault(event);

                // Update a dragging object
                dragging.source   = source;
                dragging.$source  = $(event.target);
                dragging.init     = 0;
                dragging.released = 0;
                dragging.touch    = isTouch;
                dragging.initLoc  = (isTouch ? event.originalEvent.touches[0] : event)[o.horizontal ? 'pageX' : 'pageY'];
                dragging.initPos  = isSlidee ? pos.cur : hPos.cur;
                dragging.start    = +new Date();
                dragging.time     = 0;
                dragging.path     = 0;
                dragging.pathMin  = isSlidee ? -dragging.initLoc : -hPos.cur;
                dragging.pathMax  = isSlidee ? document[o.horizontal ? 'width' : 'height'] - dragging.initLoc : hPos.end - hPos.cur;

                // Add dragging class
                (isSlidee ? $slidee : $handle).addClass(o.draggedClass);

                // Bind dragging events
                $doc.on(isTouch ? dragTouchEvents : dragMouseEvents, dragHandler);
            }
        }
865295
function () {
			var that = this,
					dropSuccessful = false,
					dropSort = false,
					dropSortIndex, dropSortParent;

			$(document).on('dragover', 'body', function () {
				if ($.fn.mediumInsert.settings.enabled === false) {
					return;
				}

				that.$el.addClass('hover');
			});

			$(document).on('dragend', 'body', function () {
				if ($.fn.mediumInsert.settings.enabled === false) {
					return;
				}

				that.$el.removeClass('hover');
			});

			this.$el.on('dragover', '.mediumInsert', function () {
				if ($.fn.mediumInsert.settings.enabled === false) {
					return;
				}

				$(this).addClass('hover');
				$(this).attr('contenteditable', true);
			});

			this.$el.on('dragleave', '.mediumInsert', function () {
				if ($.fn.mediumInsert.settings.enabled === false) {
					return;
				}

				$(this).removeClass('hover');
				$(this).attr('contenteditable', false);
			});

			this.$el.on('dragstart', '.mediumInsert .mediumInsert-images img', function () {
				if ($.fn.mediumInsert.settings.enabled === false) {
					return;
				}

				dropSortIndex = $(this).parent().index();
				dropSortParent = $(this).parent().parent().parent().attr('id');
			});

			this.$el.on('dragend', '.mediumInsert .mediumInsert-images img', function (e) {
				if ($.fn.mediumInsert.settings.enabled === false) {
					return;
				}

				if (dropSuccessful === true) {
					if ($(e.originalEvent.target.parentNode).siblings().length === 0) {
						$(e.originalEvent.target.parentNode).parent().parent().removeClass('small');
					}
					$(e.originalEvent.target.parentNode).mouseleave();
					$(e.originalEvent.target.parentNode).remove();
					dropSuccessful = false;
					dropSort = false;

					that.$el.trigger('keyup').trigger('input');
				}
			});

			this.$el.on('dragover', '.mediumInsert .mediumInsert-images img', function (e) {
				if ($.fn.mediumInsert.settings.enabled === false) {
					return;
				}

				e.preventDefault();
			});

			this.$el.on('drop', '.mediumInsert .mediumInsert-images img', function () {
				var index, $dragged, finalIndex;

				if ($.fn.mediumInsert.settings.enabled === false) {
					return;
				}


				if (dropSortParent !== $(this).parent().parent().parent().attr('id')) {
					dropSort = false;
					dropSortIndex = dropSortParent = null;
					return;
				}

				index = parseInt(dropSortIndex, 10);

				// Sort
				$dragged = $(this).parent().parent().find('.mediumInsert-images:nth-child('+ (index+1) +')');
				finalIndex = $(this).parent().index();
				if(index < finalIndex) {
					$dragged.insertAfter($(this).parent());
				} else if(index > finalIndex) {
					$dragged.insertBefore($(this).parent());
				}

				$dragged.mouseleave();

				dropSort = true;
				dropSortIndex = null;

				that.$el.trigger('keyup').trigger('input');
			});

			this.$el.on('drop', '.mediumInsert', function (e) {
				var files;

				e.preventDefault();

				if ($.fn.mediumInsert.settings.enabled === false) {
					return;
				}

				$(this).removeClass('hover');
				that.$el.removeClass('hover');
				$(this).attr('contenteditable', false);

				files = e.originalEvent.dataTransfer.files;
				if (files.length > 0) {
					// File upload
					that.uploadFiles($('.mediumInsert-placeholder', this), files, that);
				} else if (dropSort === true) {
					dropSort = false;
				} else {
					// Image move from block to block
					$('.mediumInsert-placeholder', this).append('<figure class="mediumInsert-images">'+ e.originalEvent.dataTransfer.getData('text/html') +'</figure>');
					$('meta', this).remove();
					dropSuccessful = true;
				}
			});
		}
1234158
function( elem, dd ){
                var offset = (elem && elem.ownerDocument) 
                    ? $( elem )[ dd.relative ? "position" : "offset" ]() || { top:0, left:0 }
                    : { top: 0, left: 0 };
                return {
                    drag: elem,
                    callback: new drag.callback(),
                    droppable: [],
                    offset: offset
                };
            }
182378
function Component(classDef, el, options) {
    _classCallCheck(this, Component);

    // Display error if el is valid HTML Element
    if (!(el instanceof Element)) {
      console.error(Error(el + ' is not an HTML Element'));
    }

    // If exists, destroy and reinitialize in child
    var ins = classDef.getInstance(el);
    if (!!ins) {
      ins.destroy();
    }

    this.el = el;
    this.$el = cash(el);
  }
997319
function() {
        var style = this._element.style,
            coord = this.__coord || [0, 0, 0, 0],
            co = {
                x: coord[0],
                y: coord[1],
                w: coord[2],
                h: coord[3]
            },
            prefix = Crafty.support.prefix,
            trans = [];

        if (this._cssStyles.visibility !== this._visible) {
            this._cssStyles.visibility = this._visible;
            if (!this._visible) {
                style.visibility = "hidden";
            } else {
                style.visibility = "visible";
            }
        }

        //utilize CSS3 if supported
        if (Crafty.support.css3dtransform && !this.avoidCss3dTransforms) {
            trans.push(
                "translate3d(" + ~~this._x + "px," + ~~this._y + "px,0)"
            );
        } else {
            if (this._cssStyles.left !== this._x) {
                this._cssStyles.left = this._x;
                style.left = ~~this._x + "px";
            }
            if (this._cssStyles.top !== this._y) {
                this._cssStyles.top = this._y;
                style.top = ~~this._y + "px";
            }
        }

        if (this._cssStyles.width !== this._w) {
            this._cssStyles.width = this._w;
            style.width = ~~this._w + "px";
        }
        if (this._cssStyles.height !== this._h) {
            this._cssStyles.height = this._h;
            style.height = ~~this._h + "px";
        }
        if (this._cssStyles.zIndex !== this._z) {
            this._cssStyles.zIndex = this._z;
            style.zIndex = this._z;
        }

        if (this._cssStyles.opacity !== this._alpha) {
            this._cssStyles.opacity = this._alpha;
            style.opacity = this._alpha;
            style[prefix + "Opacity"] = this._alpha;
        }

        if (this._mbr) {
            var origin = this._origin.x + "px " + this._origin.y + "px";
            style.transformOrigin = origin;
            style[prefix + "TransformOrigin"] = origin;
            if (Crafty.support.css3dtransform)
                trans.push("rotateZ(" + this._rotation + "deg)");
            else trans.push("rotate(" + this._rotation + "deg)");
        }

        if (this._flipX) {
            trans.push("scaleX(-1)");
        }

        if (this._flipY) {
            trans.push("scaleY(-1)");
        }

        if (this._cssStyles.transform !== trans.join(" ")) {
            this._cssStyles.transform = trans.join(" ");
            style.transform = this._cssStyles.transform;
            style[prefix + "Transform"] = this._cssStyles.transform;
        }

        this.trigger("Draw", {
            style: style,
            type: "DOM",
            co: co
        });

        return this;
    }
585287
function ( e )
	{
		var that = this;

		if ( this.dom.drag === null )
		{
			/* Only create the drag element if the mouse has moved a specific distance from the start
			 * point - this allows the user to make small mouse movements when sorting and not have a
			 * possibly confusing drag element showing up
			 */
			if ( Math.pow(
				Math.pow(e.pageX - this.s.mouse.startX, 2) +
				Math.pow(e.pageY - this.s.mouse.startY, 2), 0.5 ) < 5 )
			{
				return;
			}
			this._fnCreateDragNode();
		}

		/* Position the element - we respect where in the element the click occured */
		this.dom.drag.css( {
			left: e.pageX - this.s.mouse.offsetX,
			top: e.pageY - this.s.mouse.offsetY
		} );

		/* Based on the current mouse position, calculate where the insert should go */
		var bSet = false;
		var lastToIndex = this.s.mouse.toIndex;

		for ( var i=1, iLen=this.s.aoTargets.length ; i<iLen ; i++ )
		{
			if ( e.pageX < this.s.aoTargets[i-1].x + ((this.s.aoTargets[i].x-this.s.aoTargets[i-1].x)/2) )
			{
				this.dom.pointer.css( 'left', this.s.aoTargets[i-1].x );
				this.s.mouse.toIndex = this.s.aoTargets[i-1].to;
				bSet = true;
				break;
			}
		}

		// The insert element wasn't positioned in the array (less than
		// operator), so we put it at the end
		if ( !bSet )
		{
			this.dom.pointer.css( 'left', this.s.aoTargets[this.s.aoTargets.length-1].x );
			this.s.mouse.toIndex = this.s.aoTargets[this.s.aoTargets.length-1].to;
		}

		// Perform reordering if realtime updating is on and the column has moved
		if ( this.s.init.bRealtime && lastToIndex !== this.s.mouse.toIndex ) {
			this.s.dt.oInstance.fnColReorder( this.s.mouse.fromIndex, this.s.mouse.toIndex );
			this.s.mouse.fromIndex = this.s.mouse.toIndex;
			this._fnRegions();
		}
	}
750805
function() {
    if (!this._shape.dragging) {
      this._shape.dragging = new L.Handler.PathDrag(this._shape);
    }
    this._shape.dragging.enable();
    this._shape
      .on('dragstart', this._onStartDragFeature, this)
      .on('dragend', this._onStopDragFeature, this);
  }
646427
function init() {
      if ($el.hasClass('horizontal')){
        scrollDirection = 'horiz';
        scrollOffsetAttr = 'scrollLeft';
        sizeAttr = 'width';
        offsetAttr = 'left';
      }

      $el.prepend('<div class="tse-scrollbar"><div class="drag-handle"></div></div>');
      $scrollbarEl = $el.find('.tse-scrollbar');
      $dragHandleEl = $el.find('.drag-handle');

      if (options.wrapContent) {
        $contentEl.wrap('<div class="tse-scroll-content" />');
      }
      $scrollContentEl = $el.find('.tse-scroll-content');

      resizeScrollContent();

      if (options.autoHide) {
        $el.on('mouseenter', flashScrollbar);
      }

      $dragHandleEl.on('mousedown', startDrag);
      $scrollbarEl.on('mousedown', jumpScroll);
      $scrollContentEl.on('scroll', onScrolled);

      resizeScrollbar();

      $(window).on('resize', function() {
        recalculate();
      });

      if (!options.autoHide) {
        showScrollbar();
      }
    }
1154044
function createRegion() {
  const element = document.createElement('div');

  element.setAttribute('id', 'draggable-live-region');
  element.setAttribute(ARIA_RELEVANT, 'additions');
  element.setAttribute(ARIA_ATOMIC, 'true');
  element.setAttribute(ARIA_LIVE, 'assertive');
  element.setAttribute(ROLE, 'log');

  element.style.position = 'fixed';
  element.style.width = '1px';
  element.style.height = '1px';
  element.style.top = '-1px';
  element.style.overflow = 'hidden';

  return element;
}
702407
function (item) {
        if (this.state.held && this.state.dragged && this.state.dragged.item === item) {
          return this.state.draggedStyle;
        }
        return undefined;
      }
252577
function ieInternalDragAndDrop() {
        editor.on('dragstart', function (e) {
          setMceInternalContent(e);
        });

        editor.on('drop', function (e) {
          if (!isDefaultPrevented(e)) {
            var internalContent = getMceInternalContent(e);

            if (internalContent && internalContent.id != editor.id) {
              e.preventDefault();

              var rng = RangeUtils.getCaretRangeFromPoint(e.x, e.y, editor.getDoc());
              selection.setRng(rng);
              insertClipboardContents(internalContent.html, true);
            }
          }
        });
      }
697359
function startDrag(e) {	
	var eventSource = nn6 ? e.target : event.srcElement;
	if (eventSource.tagName == 'HTML')
		return;

	while (eventSource != document.body && !hasClass(eventSource, "draggable"))
	{  	
		eventSource = nn6 ? eventSource.parentNode : eventSource.parentElement;
	}

	// if a draggable element was found, calculate its actual position
	if (hasClass(eventSource, "draggable")) {
		isdrag = true;
		elementToMove = eventSource;

		// set absolute positioning on the element		
		elementToMove.style.position = "absolute";
				
		// calculate start point
		elementStartX = elementToMove.offsetLeft;
		elementStartY = elementToMove.offsetTop;
		
		// calculate mouse start point
		mouseStartX = nn6 ? e.clientX : event.clientX;
		mouseStartY = nn6 ? e.clientY : event.clientY;
		
		// calculate bounds as left, top, width, height of the parent element
		if(getStyle(elementToMove.parentNode, "position") == 'absolute') {
			bounds[0] = bounds[1] = 0;
		} else {
			bounds[0] = calculateOffsetLeft(elementToMove.parentNode);
			bounds[1] = calculateOffsetTop(elementToMove.parentNode);
		}
		bounds[2] = bounds[0] + elementToMove.parentNode.offsetWidth;
		bounds[3] = bounds[1] + elementToMove.parentNode.offsetHeight;		
		
		// either find the block related to the dragging element to call its onMove method
		blocksToMove = new Array();
		
		blocksToMoveScanner.scan(eventSource);
		document.onmousemove = movemouse;
		
		originalZIndex = getStyle(elementToMove, "z-index");
		elementToMove.style.zIndex = "3";
		
		return false;
	}
}