function $AdfSwipeSupport$$($element$$395$$, $callbacks$$8$$, $options$$53$$) {
  this.Init($element$$395$$, $callbacks$$8$$, $options$$53$$);
}
$goog$exportSymbol$$("AdfSwipeSupport", $AdfSwipeSupport$$);
$AdfObject$$.$createSubclass$($AdfSwipeSupport$$);
$AdfSwipeSupport$$.$InitClass$ = function $$AdfSwipeSupport$$$$InitClass$$() {
  this.$DIRECTION_LEFT$ = 1;
  $goog$exportSymbol$$("AdfSwipeSupport.DIRECTION_LEFT", $AdfSwipeSupport$$.$DIRECTION_LEFT$);
  this.$DIRECTION_RIGHT$ = 2;
  $goog$exportSymbol$$("AdfSwipeSupport.DIRECTION_RIGHT", $AdfSwipeSupport$$.$DIRECTION_RIGHT$);
  this.$DIRECTION_UP$ = 3;
  $goog$exportSymbol$$("AdfSwipeSupport.DIRECTION_UP", $AdfSwipeSupport$$.$DIRECTION_UP$);
  this.$DIRECTION_DOWN$ = 4;
  $goog$exportSymbol$$("AdfSwipeSupport.DIRECTION_DOWN", $AdfSwipeSupport$$.$DIRECTION_DOWN$);
  this.$PANSTART_CALLBACK$ = "panstart";
  $goog$exportSymbol$$("AdfSwipeSupport.PANSTART_CALLBACK", $AdfSwipeSupport$$.$PANSTART_CALLBACK$);
  this.$PANNING_CALLBACK$ = "panning";
  $goog$exportSymbol$$("AdfSwipeSupport.PANNING_CALLBACK", $AdfSwipeSupport$$.$PANNING_CALLBACK$);
  this.$PANEND_CALLBACK$ = "panend";
  $goog$exportSymbol$$("AdfSwipeSupport.PANEND_CALLBACK", $AdfSwipeSupport$$.$PANEND_CALLBACK$);
  this.$PANCANCEL_CALLBACK$ = "pancancel";
  $goog$exportSymbol$$("AdfSwipeSupport.PANCANCEL_CALLBACK", $AdfSwipeSupport$$.$PANCANCEL_CALLBACK$);
  this.$SWIPE_CALLBACK$ = "swipe";
  $goog$exportSymbol$$("AdfSwipeSupport.SWIPE_CALLBACK", $AdfSwipeSupport$$.$SWIPE_CALLBACK$);
  this.$SUPPORT_MOUSE$ = "mouseSupport";
  $goog$exportSymbol$$("AdfSwipeSupport.SUPPORT_MOUSE", $AdfSwipeSupport$$.$SUPPORT_MOUSE$);
  this.MODE = "mode";
  $goog$exportSymbol$$("AdfSwipeSupport.MODE", $AdfSwipeSupport$$.MODE);
  this.$MODE_VERTICAL$ = 1;
  $goog$exportSymbol$$("AdfSwipeSupport.MODE_VERTICAL", $AdfSwipeSupport$$.$MODE_VERTICAL$);
  this.$CALLBACK_PARAM$ = "cp";
  $goog$exportSymbol$$("AdfSwipeSupport.CALLBACK_PARAM", $AdfSwipeSupport$$.$CALLBACK_PARAM$);
  this.$_SWIPE_VELOCITY_THRESHOLD$ = .3;
  this.$_SWIPE_DISTANCE_THRESHOLD$ = 10;
  this.$_MOUSE_SWIPE_DISTANCE_THRESHOLD$ = 3;
  this.$_TOUCH_ACTION_PANX_CLASS$ = "AFPrivateTouchActionPanX";
  this.$_TOUCH_ACTION_PANY_CLASS$ = "AFPrivateTouchActionPanY";
  this.$_USER_SELECT_NONE_CLASS$ = "AFPrivateUserSelectNone";
};
$goog$exportSymbol$$("AdfSwipeSupport.InitClass", $AdfSwipeSupport$$.$InitClass$);
$AdfSwipeSupport$$.prototype.Init = function $$AdfSwipeSupport$$$$Init$($element$$396$$, $callbacks$$9$$, $options$$54$$) {
  $AdfSwipeSupport$$.$superclass$.Init.call(this);
  this.$_element$ = $element$$396$$;
  this.$_callbacks$ = $callbacks$$9$$;
  this.$_supportMouse$ = $options$$54$$ && $options$$54$$[$AdfSwipeSupport$$.$SUPPORT_MOUSE$];
  this.$_isVertical$ = $options$$54$$ && $options$$54$$[$AdfSwipeSupport$$.MODE] === $AdfSwipeSupport$$.$MODE_VERTICAL$;
  this.$_callbackParam$ = $options$$54$$ && $options$$54$$[$AdfSwipeSupport$$.$CALLBACK_PARAM$];
  this.$_usesPointerEvents$ = void 0 === window.ontouchstart;
  $AdfDomUtils$$.$addCSSClassName$($element$$396$$, this.$_isVertical$ ? $AdfSwipeSupport$$.$_TOUCH_ACTION_PANX_CLASS$ : $AdfSwipeSupport$$.$_TOUCH_ACTION_PANY_CLASS$);
  this.$_usesPointerEvents$ ? (this.$_pointerDownHandler$ = this.$createCallback$(this.$_handlePointerDown$), $element$$396$$.addEventListener("pointerdown", this.$_pointerDownHandler$, !1)) : (this.$_touchStartHandler$ = this.$createCallback$(this.$_handleTouchStart$), $element$$396$$.addEventListener("touchstart", this.$_touchStartHandler$, !1));
  this.$_supportMouse$ && ($AdfDomUtils$$.$addCSSClassName$($element$$396$$, $AdfSwipeSupport$$.$_USER_SELECT_NONE_CLASS$), this.$_mouseDownHandler$ = this.$createCallback$(this.$_handleMouseDown$), $element$$396$$.addEventListener("mousedown", this.$_mouseDownHandler$, !1));
};
$AdfObject$$.$exportPrototypeSymbol$("AdfSwipeSupport.prototype.Init", {Init:$AdfSwipeSupport$$.prototype.Init});
$AdfSwipeSupport$$.prototype.release = function $$AdfSwipeSupport$$$$release$() {
  this.$_isPanning$ && $JSCompiler_StaticMethods__cleanupState$$(this);
  var $element$$397$$ = this.$_element$;
  this.$_callbackParam$ = this.$_callbacks$ = this.$_element$ = null;
  this.$_usesPointerEvents$ ? $element$$397$$.removeEventListener("pointerdown", this.$_pointerDownHandler$, !1) : $element$$397$$.removeEventListener("touchstart", this.$_touchStartHandler$, !1);
  $AdfDomUtils$$.$removeCSSClassName$($element$$397$$, this.$_isVertical$ ? $AdfSwipeSupport$$.$_TOUCH_ACTION_PANX_CLASS$ : $AdfSwipeSupport$$.$_TOUCH_ACTION_PANY_CLASS$);
  this.$_supportMouse$ && ($element$$397$$.removeEventListener("mousedown", this.$_mouseDownHandler$, !1), $AdfDomUtils$$.$removeCSSClassName$($element$$397$$, $AdfSwipeSupport$$.$_USER_SELECT_NONE_CLASS$));
};
$AdfObject$$.$exportPrototypeSymbol$("AdfSwipeSupport.prototype.release", {release:$AdfSwipeSupport$$.prototype.release});
$JSCompiler_prototypeAlias$$ = $AdfSwipeSupport$$.prototype;
$JSCompiler_prototypeAlias$$.$_handlePointerDown$ = function $$JSCompiler_prototypeAlias$$$$_handlePointerDown$$($event$$335$$) {
  if ("touch" == $event$$335$$.pointerType) {
    if (this.$_pointerId$) {
      try {
        this.$_isPanning$ && $JSCompiler_StaticMethods__cancelPanning$$(this, $event$$335$$);
      } finally {
        $JSCompiler_StaticMethods__cleanupState$$(this);
      }
    } else {
      this.$_pointerId$ = $event$$335$$.pointerId, $JSCompiler_StaticMethods__initiatePanning$$(this, $event$$335$$);
    }
  }
};
$JSCompiler_prototypeAlias$$.$_handleTouchStart$ = function $$JSCompiler_prototypeAlias$$$$_handleTouchStart$$($event$$336$$) {
  1 < $event$$336$$.touches.length || $JSCompiler_StaticMethods__initiatePanning$$(this, $event$$336$$);
};
$JSCompiler_prototypeAlias$$.$_handleMouseDown$ = function $$JSCompiler_prototypeAlias$$$$_handleMouseDown$$($event$$337$$) {
  $JSCompiler_StaticMethods__initiatePanning$$(this, $event$$337$$);
};
function $JSCompiler_StaticMethods__initiatePanning$$($JSCompiler_StaticMethods__initiatePanning$self$$, $event$$338$$) {
  if (!$JSCompiler_StaticMethods__initiatePanning$self$$.$_startTime$ && !$AdfSwipeSupport$$.$_shouldPreventPanning$($event$$338$$)) {
    var $pos$$43$$ = $AdfAgent$$.$AGENT$.$getMousePosition$($event$$338$$);
    $JSCompiler_StaticMethods__initiatePanning$self$$.$_panStartX$ = $pos$$43$$.x;
    $JSCompiler_StaticMethods__initiatePanning$self$$.$_panStartY$ = $pos$$43$$.y;
    $JSCompiler_StaticMethods__initiatePanning$self$$.$_startTime$ = Date.now();
    "mousedown" == $event$$338$$.type ? ($JSCompiler_StaticMethods__initiatePanning$self$$.$_fromMouseHandler$ = !0, $JSCompiler_StaticMethods__initiatePanning$self$$.$_panningHandler$ = $JSCompiler_StaticMethods__initiatePanning$self$$.$createCallback$($JSCompiler_StaticMethods__initiatePanning$self$$.$_handlePanning$), document.addEventListener("mousemove", $JSCompiler_StaticMethods__initiatePanning$self$$.$_panningHandler$, !1), $JSCompiler_StaticMethods__initiatePanning$self$$.$_panEndHandler$ = 
    $JSCompiler_StaticMethods__initiatePanning$self$$.$createCallback$($JSCompiler_StaticMethods__initiatePanning$self$$.$_handlePanEnd$), document.addEventListener("mouseup", $JSCompiler_StaticMethods__initiatePanning$self$$.$_panEndHandler$, !0)) : "pointerdown" == $event$$338$$.type ? ($JSCompiler_StaticMethods__initiatePanning$self$$.$_panningHandler$ = $JSCompiler_StaticMethods__initiatePanning$self$$.$createCallback$($JSCompiler_StaticMethods__initiatePanning$self$$.$_handlePanning$), document.addEventListener("pointermove", 
    $JSCompiler_StaticMethods__initiatePanning$self$$.$_panningHandler$, !1), $JSCompiler_StaticMethods__initiatePanning$self$$.$_panEndHandler$ = $JSCompiler_StaticMethods__initiatePanning$self$$.$createCallback$($JSCompiler_StaticMethods__initiatePanning$self$$.$_handlePanEnd$), document.addEventListener("pointerup", $JSCompiler_StaticMethods__initiatePanning$self$$.$_panEndHandler$, !1), $JSCompiler_StaticMethods__initiatePanning$self$$.$_panCancelHandler$ = $JSCompiler_StaticMethods__initiatePanning$self$$.$createCallback$($JSCompiler_StaticMethods__initiatePanning$self$$.$_handlePanCancel$), 
    $JSCompiler_StaticMethods__initiatePanning$self$$.$_element$.addEventListener("pointercancel", $JSCompiler_StaticMethods__initiatePanning$self$$.$_panCancelHandler$, !1)) : ($JSCompiler_StaticMethods__initiatePanning$self$$.$_panningHandler$ = $JSCompiler_StaticMethods__initiatePanning$self$$.$createCallback$($JSCompiler_StaticMethods__initiatePanning$self$$.$_handlePanning$), $JSCompiler_StaticMethods__initiatePanning$self$$.$_element$.addEventListener("touchmove", $JSCompiler_StaticMethods__initiatePanning$self$$.$_panningHandler$, 
    !1), $JSCompiler_StaticMethods__initiatePanning$self$$.$_panEndHandler$ = $JSCompiler_StaticMethods__initiatePanning$self$$.$createCallback$($JSCompiler_StaticMethods__initiatePanning$self$$.$_handlePanEnd$), $JSCompiler_StaticMethods__initiatePanning$self$$.$_element$.addEventListener("touchend", $JSCompiler_StaticMethods__initiatePanning$self$$.$_panEndHandler$, !1), $JSCompiler_StaticMethods__initiatePanning$self$$.$_panCancelHandler$ = $JSCompiler_StaticMethods__initiatePanning$self$$.$createCallback$($JSCompiler_StaticMethods__initiatePanning$self$$.$_handlePanCancel$), 
    $JSCompiler_StaticMethods__initiatePanning$self$$.$_element$.addEventListener("touchcancel", $JSCompiler_StaticMethods__initiatePanning$self$$.$_panCancelHandler$, !1));
  }
}
function $JSCompiler_StaticMethods__cleanupState$$($JSCompiler_StaticMethods__cleanupState$self$$) {
  $JSCompiler_StaticMethods__cleanupState$self$$.$_isPanning$ = !1;
  $JSCompiler_StaticMethods__cleanupState$self$$.$_direction$ = null;
  $JSCompiler_StaticMethods__cleanupState$self$$.$_panStartX$ = null;
  $JSCompiler_StaticMethods__cleanupState$self$$.$_panStartY$ = null;
  $JSCompiler_StaticMethods__cleanupState$self$$.$_startTime$ = null;
  $JSCompiler_StaticMethods__cleanupState$self$$.$_pointerId$ = null;
  $JSCompiler_StaticMethods__cleanupState$self$$.$_fromMouseHandler$ ? (document.removeEventListener("mousemove", $JSCompiler_StaticMethods__cleanupState$self$$.$_panningHandler$, !1), document.removeEventListener("mouseup", $JSCompiler_StaticMethods__cleanupState$self$$.$_panEndHandler$, !0)) : $JSCompiler_StaticMethods__cleanupState$self$$.$_usesPointerEvents$ ? (document.removeEventListener("pointermove", $JSCompiler_StaticMethods__cleanupState$self$$.$_panningHandler$, !1), document.removeEventListener("pointerup", 
  $JSCompiler_StaticMethods__cleanupState$self$$.$_panEndHandler$, !1), document.removeEventListener("pointercancel", $JSCompiler_StaticMethods__cleanupState$self$$.$_panCancelHandler$, !1)) : ($JSCompiler_StaticMethods__cleanupState$self$$.$_element$.removeEventListener("touchmove", $JSCompiler_StaticMethods__cleanupState$self$$.$_panningHandler$, !1), $JSCompiler_StaticMethods__cleanupState$self$$.$_element$.removeEventListener("touchend", $JSCompiler_StaticMethods__cleanupState$self$$.$_panEndHandler$, 
  !1), $JSCompiler_StaticMethods__cleanupState$self$$.$_element$.removeEventListener("touchcancel", $JSCompiler_StaticMethods__cleanupState$self$$.$_panCancelHandler$, !1));
  $JSCompiler_StaticMethods__cleanupState$self$$.$_fromMouseHandler$ = !1;
}
$JSCompiler_prototypeAlias$$.$_handlePanning$ = function $$JSCompiler_prototypeAlias$$$$_handlePanning$$($event$$339$$) {
  if ($AdfSwipeSupport$$.$_shouldPreventPanning$($event$$339$$)) {
    try {
      this.$_isPanning$ && $JSCompiler_StaticMethods__cancelPanning$$(this, $event$$339$$);
    } finally {
      $JSCompiler_StaticMethods__cleanupState$$(this);
    }
  } else {
    var $gestureEvent_pos$$44$$ = $AdfAgent$$.$AGENT$.$getMousePosition$($event$$339$$);
    if (this.$_isPanning$) {
      $event$$339$$.cancelable && $AdfAgent$$.$AGENT$.preventDefault($event$$339$$), $distance$$4_type$$213$$ = $AdfSwipeSupport$$.$PANNING_CALLBACK$, $gestureEvent_pos$$44$$ = $JSCompiler_StaticMethods__getGestureEvent$$(this, $distance$$4_type$$213$$, $event$$339$$, $gestureEvent_pos$$44$$), $JSCompiler_StaticMethods__invokeCallback$$(this, $distance$$4_type$$213$$, $gestureEvent_pos$$44$$);
    } else {
      var $distance$$4_type$$213$$ = this.$_isVertical$ ? $gestureEvent_pos$$44$$.y - this.$_panStartY$ : $gestureEvent_pos$$44$$.x - this.$_panStartX$;
      Math.abs($distance$$4_type$$213$$) > (this.$_fromMouseHandler$ ? $AdfSwipeSupport$$.$_MOUSE_SWIPE_DISTANCE_THRESHOLD$ : $AdfSwipeSupport$$.$_SWIPE_DISTANCE_THRESHOLD$) && (this.$_isPanning$ = !0, this.$_direction$ = 0 > $distance$$4_type$$213$$ ? this.$_isVertical$ ? $AdfSwipeSupport$$.$DIRECTION_UP$ : $AdfSwipeSupport$$.$DIRECTION_LEFT$ : this.$_isVertical$ ? $AdfSwipeSupport$$.$DIRECTION_DOWN$ : $AdfSwipeSupport$$.$DIRECTION_RIGHT$, $distance$$4_type$$213$$ = $AdfSwipeSupport$$.$PANSTART_CALLBACK$, 
      $gestureEvent_pos$$44$$ = $JSCompiler_StaticMethods__getGestureEvent$$(this, $distance$$4_type$$213$$, $event$$339$$, $gestureEvent_pos$$44$$), $JSCompiler_StaticMethods__invokeCallback$$(this, $distance$$4_type$$213$$, $gestureEvent_pos$$44$$), $event$$339$$.cancelable && $AdfAgent$$.$AGENT$.preventDefault($event$$339$$));
    }
  }
};
$JSCompiler_prototypeAlias$$.$_handlePanEnd$ = function $$JSCompiler_prototypeAlias$$$$_handlePanEnd$$($event$$340_gestureEvent$$1$$) {
  if (this.$_isPanning$) {
    var $type$$214$$ = $AdfSwipeSupport$$.$PANEND_CALLBACK$;
    $event$$340_gestureEvent$$1$$ = $JSCompiler_StaticMethods__getGestureEvent$$(this, $type$$214$$, $event$$340_gestureEvent$$1$$);
    $AdfSwipeSupport$$.$_isSwipe$($event$$340_gestureEvent$$1$$) && ($type$$214$$ = $AdfSwipeSupport$$.$SWIPE_CALLBACK$, $event$$340_gestureEvent$$1$$.type = $type$$214$$);
    try {
      $JSCompiler_StaticMethods__invokeCallback$$(this, $type$$214$$, $event$$340_gestureEvent$$1$$);
    } finally {
      $JSCompiler_StaticMethods__cleanupState$$(this);
    }
  } else {
    $JSCompiler_StaticMethods__cleanupState$$(this);
  }
};
$JSCompiler_prototypeAlias$$.$_handlePanCancel$ = function $$JSCompiler_prototypeAlias$$$$_handlePanCancel$$($event$$341$$) {
  try {
    this.$_isPanning$ && $JSCompiler_StaticMethods__cancelPanning$$(this, $event$$341$$);
  } finally {
    $JSCompiler_StaticMethods__cleanupState$$(this);
  }
};
function $JSCompiler_StaticMethods__cancelPanning$$($JSCompiler_StaticMethods__cancelPanning$self$$, $event$$342$$) {
  var $gestureEvent$$2$$, $type$$215$$ = $AdfSwipeSupport$$.$PANCANCEL_CALLBACK$;
  $gestureEvent$$2$$ ? $gestureEvent$$2$$.type = $type$$215$$ : $gestureEvent$$2$$ = $JSCompiler_StaticMethods__getGestureEvent$$($JSCompiler_StaticMethods__cancelPanning$self$$, $type$$215$$, $event$$342$$);
  $JSCompiler_StaticMethods__invokeCallback$$($JSCompiler_StaticMethods__cancelPanning$self$$, $type$$215$$, $gestureEvent$$2$$);
}
$AdfSwipeSupport$$.$_isSwipe$ = function $$AdfSwipeSupport$$$$_isSwipe$$($gestureEvent$$3$$) {
  return $gestureEvent$$3$$.$offsetDirection$ === $gestureEvent$$3$$.direction && $gestureEvent$$3$$.$velocity$ > $AdfSwipeSupport$$.$_SWIPE_VELOCITY_THRESHOLD$ && Math.abs($gestureEvent$$3$$.$_deltaXorY$) > $AdfSwipeSupport$$.$_SWIPE_DISTANCE_THRESHOLD$;
};
$AdfSwipeSupport$$.$_shouldPreventPanning$ = function $$AdfSwipeSupport$$$$_shouldPreventPanning$$($event$$343$$) {
  var $page$$253$$ = $AdfPage$$.$PAGE$, $dndContext$$88$$ = $page$$253$$.$getDnDContext$();
  return $event$$343$$.defaultPrevented || $page$$253$$.$isDragging$() || $dndContext$$88$$ && $dndContext$$88$$.$isDragging$();
};
function $JSCompiler_StaticMethods__getGestureEvent$$($JSCompiler_StaticMethods__getGestureEvent$self$$, $eventType$$57$$, $srcEvent$$, $pos$$45$$) {
  $pos$$45$$ || ($pos$$45$$ = $AdfAgent$$.$AGENT$.$getMousePosition$($srcEvent$$));
  var $event$$344$$ = {};
  $event$$344$$.type = $eventType$$57$$;
  $event$$344$$.deltaX = $pos$$45$$.x - $JSCompiler_StaticMethods__getGestureEvent$self$$.$_panStartX$;
  $event$$344$$.deltaY = $pos$$45$$.y - $JSCompiler_StaticMethods__getGestureEvent$self$$.$_panStartY$;
  $event$$344$$.$_deltaXorY$ = $JSCompiler_StaticMethods__getGestureEvent$self$$.$_isVertical$ ? $event$$344$$.deltaY : $event$$344$$.deltaX;
  $event$$344$$.$deltaTime$ = Date.now() - $JSCompiler_StaticMethods__getGestureEvent$self$$.$_startTime$;
  $event$$344$$.$velocity$ = Math.abs($event$$344$$.$_deltaXorY$ / $event$$344$$.$deltaTime$);
  $event$$344$$.direction = $JSCompiler_StaticMethods__getGestureEvent$self$$.$_direction$;
  $event$$344$$.$offsetDirection$ = 0 > $event$$344$$.$_deltaXorY$ ? $JSCompiler_StaticMethods__getGestureEvent$self$$.$_isVertical$ ? $AdfSwipeSupport$$.$DIRECTION_UP$ : $AdfSwipeSupport$$.$DIRECTION_LEFT$ : $JSCompiler_StaticMethods__getGestureEvent$self$$.$_isVertical$ ? $AdfSwipeSupport$$.$DIRECTION_DOWN$ : $AdfSwipeSupport$$.$DIRECTION_RIGHT$;
  $event$$344$$.$srcEvent$ = $srcEvent$$;
  return $event$$344$$;
}
function $JSCompiler_StaticMethods__invokeCallback$$($JSCompiler_StaticMethods__invokeCallback$self$$, $callback$$127_type$$216$$, $gestureEvent$$4$$) {
  ($callback$$127_type$$216$$ = $JSCompiler_StaticMethods__invokeCallback$self$$.$_callbacks$ && $JSCompiler_StaticMethods__invokeCallback$self$$.$_callbacks$[$callback$$127_type$$216$$]) && $callback$$127_type$$216$$($gestureEvent$$4$$, $JSCompiler_StaticMethods__invokeCallback$self$$.$_callbackParam$);
}
;