function $AdfHtml5NavigationHistoryAgent$$() {
  this.Init();
}
$goog$exportSymbol$$("AdfHtml5NavigationHistoryAgent", $AdfHtml5NavigationHistoryAgent$$);
$AdfObject$$.$createSubclass$($AdfHtml5NavigationHistoryAgent$$, $AdfNavigationHistoryAgent$$);
$AdfHtml5NavigationHistoryAgent$$.$InitClass$ = function $$AdfHtml5NavigationHistoryAgent$$$$InitClass$$() {
  this.$_POP_STATE_EVENT$ = "popstate";
  this.$_HASH_CHANGE_EVENT$ = "hashchange";
};
$goog$exportSymbol$$("AdfHtml5NavigationHistoryAgent.InitClass", $AdfHtml5NavigationHistoryAgent$$.$InitClass$);
$AdfHtml5NavigationHistoryAgent$$.prototype.$dispose$ = function $$AdfHtml5NavigationHistoryAgent$$$$$dispose$$() {
  this.$_listenerAdded$ && ($AdfAgent$$.$AGENT$.$removeBubbleEventListener$(this.$GetDomWindow$(), $AdfHtml5NavigationHistoryAgent$$.$_POP_STATE_EVENT$, $AdfHtml5NavigationHistoryAgent$$.$_checkURI$), $AdfAgent$$.$AGENT$.$removeBubbleEventListener$(this.$GetDomWindow$(), $AdfHtml5NavigationHistoryAgent$$.$_HASH_CHANGE_EVENT$, $AdfHtml5NavigationHistoryAgent$$.$_checkURI$));
};
$AdfObject$$.$exportPrototypeSymbol$("AdfHtml5NavigationHistoryAgent.prototype.dispose", {$dispose$:$AdfHtml5NavigationHistoryAgent$$.prototype.$dispose$});
$AdfHtml5NavigationHistoryAgent$$.prototype.$SetQueryStringImpl$ = function $$AdfHtml5NavigationHistoryAgent$$$$$SetQueryStringImpl$$($href_pageId$$, $h$$4_id$$200$$, $queryParams$$, $anchor$$, $noHistory$$) {
  $href_pageId$$ = $JSCompiler_StaticMethods__replaceViewIdAndQuery$$(this, null, null, $queryParams$$, $noHistory$$);
  $h$$4_id$$200$$ = this.$GetDomWindow$().history;
  $noHistory$$ ? $h$$4_id$$200$$.replaceState($h$$4_id$$200$$.state, null, $href_pageId$$) : $h$$4_id$$200$$.pushState(null, null, $href_pageId$$);
};
$AdfObject$$.$exportPrototypeSymbol$("AdfHtml5NavigationHistoryAgent.prototype.SetQueryStringImpl", {$SetQueryStringImpl$:$AdfHtml5NavigationHistoryAgent$$.prototype.$SetQueryStringImpl$});
$AdfHtml5NavigationHistoryAgent$$.prototype.$StartTrackingUriImpl$ = function $$AdfHtml5NavigationHistoryAgent$$$$$StartTrackingUriImpl$$($agent$$14_info$$) {
  this.$_viewIdStartIndex$ = -1;
  if (this.$isNavigationInitialized$()) {
    var $href$$1$$ = this.$GetDomWindow$().location.href, $facesPath$$ = this.$GetFacesPath$();
    this.$_viewIdStartIndex$ = null == $facesPath$$ || "" === $facesPath$$ ? $href$$1$$.lastIndexOf("/") : $href$$1$$.indexOf($facesPath$$) + $facesPath$$.length;
    $AdfAssert$$.assert(0 <= this.$_viewIdStartIndex$);
  }
  $AdfHtml5NavigationHistoryAgent$$.$superclass$.$StartTrackingUriImpl$.call(this, $agent$$14_info$$);
  $agent$$14_info$$ = $AdfAgent$$.$AGENT$;
  $agent$$14_info$$.$addBubbleEventListener$(this.$GetDomWindow$(), $AdfHtml5NavigationHistoryAgent$$.$_POP_STATE_EVENT$, $AdfHtml5NavigationHistoryAgent$$.$_checkURI$);
  $agent$$14_info$$.$addBubbleEventListener$(this.$GetDomWindow$(), $AdfHtml5NavigationHistoryAgent$$.$_HASH_CHANGE_EVENT$, $AdfHtml5NavigationHistoryAgent$$.$_checkURI$);
  this.$_listenerAdded$ = !0;
};
$AdfObject$$.$exportPrototypeSymbol$("AdfHtml5NavigationHistoryAgent.prototype.StartTrackingUriImpl", {$StartTrackingUriImpl$:$AdfHtml5NavigationHistoryAgent$$.prototype.$StartTrackingUriImpl$});
$AdfHtml5NavigationHistoryAgent$$.prototype.$AddHistoryEntry$ = function $$AdfHtml5NavigationHistoryAgent$$$$$AddHistoryEntry$$($id$$201$$, $queryParams$$1$$) {
  var $href$$2_info$$1$$ = this.$GetViewInfoFromBrowserURI$();
  $queryParams$$1$$ = "?" == $queryParams$$1$$ ? null : $queryParams$$1$$;
  if ($href$$2_info$$1$$.id != $id$$201$$ || $href$$2_info$$1$$.$params$ != $queryParams$$1$$) {
    $href$$2_info$$1$$ = $JSCompiler_StaticMethods__replaceViewIdAndQuery$$(this, $href$$2_info$$1$$.id, $id$$201$$, $queryParams$$1$$, !1), this.$GetDomWindow$().history.pushState(null, null, $href$$2_info$$1$$);
  }
};
$AdfObject$$.$exportPrototypeSymbol$("AdfHtml5NavigationHistoryAgent.prototype.AddHistoryEntry", {$AddHistoryEntry$:$AdfHtml5NavigationHistoryAgent$$.prototype.$AddHistoryEntry$});
$AdfHtml5NavigationHistoryAgent$$.prototype.$GetViewInfoFromBrowserURI$ = function $$AdfHtml5NavigationHistoryAgent$$$$$GetViewInfoFromBrowserURI$$() {
  var $info$$2$$ = $AdfHtml5NavigationHistoryAgent$$.$superclass$.$GetViewInfoFromBrowserURI$.call(this), $href$$3_id$$202_win$$ = this.$GetDomWindow$();
  if (void 0 === $info$$2$$.$pageId$) {
    var $hashIndex_queryIndex_scIndex_state$$ = null;
    try {
      $hashIndex_queryIndex_scIndex_state$$ = $href$$3_id$$202_win$$.history.state;
    } catch ($e$$41$$) {
    }
    null != $hashIndex_queryIndex_scIndex_state$$ && ($info$$2$$.$pageId$ = $hashIndex_queryIndex_scIndex_state$$.$_afrPage$);
  }
  $info$$2$$.id = $info$$2$$.$params$ = void 0;
  if (this.$isNavigationInitialized$()) {
    $href$$3_id$$202_win$$ = $href$$3_id$$202_win$$.location.href;
    $hashIndex_queryIndex_scIndex_state$$ = $href$$3_id$$202_win$$.indexOf("#");
    0 <= $hashIndex_queryIndex_scIndex_state$$ && ($href$$3_id$$202_win$$ = $href$$3_id$$202_win$$.substring(0, $hashIndex_queryIndex_scIndex_state$$));
    var $hashIndex_queryIndex_scIndex_state$$ = $href$$3_id$$202_win$$.indexOf("?"), $params$$8$$ = "";
    0 <= $hashIndex_queryIndex_scIndex_state$$ ? ($params$$8$$ = $href$$3_id$$202_win$$.substring($hashIndex_queryIndex_scIndex_state$$), 1 < $params$$8$$.length && ($info$$2$$.$params$ = $params$$8$$), $href$$3_id$$202_win$$ = $href$$3_id$$202_win$$.substring(this.$_viewIdStartIndex$, $hashIndex_queryIndex_scIndex_state$$)) : $href$$3_id$$202_win$$ = $href$$3_id$$202_win$$.substring(this.$_viewIdStartIndex$);
    $hashIndex_queryIndex_scIndex_state$$ = $href$$3_id$$202_win$$.indexOf(";");
    $info$$2$$.id = 0 <= $hashIndex_queryIndex_scIndex_state$$ ? $href$$3_id$$202_win$$.substring(0, $hashIndex_queryIndex_scIndex_state$$) : $href$$3_id$$202_win$$;
  }
  return $info$$2$$;
};
$AdfObject$$.$exportPrototypeSymbol$("AdfHtml5NavigationHistoryAgent.prototype.GetViewInfoFromBrowserURI", {$GetViewInfoFromBrowserURI$:$AdfHtml5NavigationHistoryAgent$$.prototype.$GetViewInfoFromBrowserURI$});
$AdfHtml5NavigationHistoryAgent$$.prototype.$UpdateInitialValues$ = function $$AdfHtml5NavigationHistoryAgent$$$$$UpdateInitialValues$$($pageId$$1$$, $href$$4_viewId$$, $queryParams$$2$$, $anchor$$1$$) {
  if (this.$isNavigationInitialized$()) {
    var $info$$3$$ = this.$GetViewInfoFromBrowserURI$();
    $href$$4_viewId$$ = $JSCompiler_StaticMethods__replaceViewIdAndQuery$$(this, $info$$3$$.id, $href$$4_viewId$$, $queryParams$$2$$, !1);
  } else {
    $href$$4_viewId$$ = this.$GetDomWindow$().location.href;
  }
  $JSCompiler_StaticMethods__updatePageIdAndAnchor$$(this, $href$$4_viewId$$, $pageId$$1$$, $anchor$$1$$);
};
$AdfObject$$.$exportPrototypeSymbol$("AdfHtml5NavigationHistoryAgent.prototype.UpdateInitialValues", {$UpdateInitialValues$:$AdfHtml5NavigationHistoryAgent$$.prototype.$UpdateInitialValues$});
$AdfHtml5NavigationHistoryAgent$$.prototype.$NavigateToSavedAnchorImpl$ = function $$AdfHtml5NavigationHistoryAgent$$$$$NavigateToSavedAnchorImpl$$($info$$4$$, $anchor$$2$$) {
  var $hash$$ = "#";
  null != $anchor$$2$$ && ($hash$$ += encodeURIComponent($anchor$$2$$));
  var $w$$5$$ = this.$GetDomWindow$(), $state$$1$$ = $w$$5$$.history.state;
  $w$$5$$.location.replace($hash$$);
  $info$$4$$.$simpleAnchor$ || null == $info$$4$$.$pageId$ || this.$UpdateHash$($info$$4$$.$pageId$, void 0, void 0, $anchor$$2$$, !0);
  null != $state$$1$$ && $w$$5$$.history.replaceState($state$$1$$, null);
};
$AdfObject$$.$exportPrototypeSymbol$("AdfHtml5NavigationHistoryAgent.prototype.NavigateToSavedAnchorImpl", {$NavigateToSavedAnchorImpl$:$AdfHtml5NavigationHistoryAgent$$.prototype.$NavigateToSavedAnchorImpl$});
$AdfHtml5NavigationHistoryAgent$$.prototype.$RestoreValuesAfterAnchorNavigation$ = function $$AdfHtml5NavigationHistoryAgent$$$$$RestoreValuesAfterAnchorNavigation$$($pageId$$2$$, $href$$5_viewId$$1$$, $queryParams$$3$$, $anchor$$3$$) {
  $href$$5_viewId$$1$$ = this.$GetDomWindow$().location.href;
  $JSCompiler_StaticMethods__updatePageIdAndAnchor$$(this, $href$$5_viewId$$1$$, $pageId$$2$$, $anchor$$3$$);
};
$AdfObject$$.$exportPrototypeSymbol$("AdfHtml5NavigationHistoryAgent.prototype.RestoreValuesAfterAnchorNavigation", {$RestoreValuesAfterAnchorNavigation$:$AdfHtml5NavigationHistoryAgent$$.prototype.$RestoreValuesAfterAnchorNavigation$});
$AdfHtml5NavigationHistoryAgent$$.prototype.$UsesHashForTrackingNavigation$ = function $$AdfHtml5NavigationHistoryAgent$$$$$UsesHashForTrackingNavigation$$() {
  return !1;
};
$AdfObject$$.$exportPrototypeSymbol$("AdfHtml5NavigationHistoryAgent.prototype.UsesHashForTrackingNavigation", {$UsesHashForTrackingNavigation$:$AdfHtml5NavigationHistoryAgent$$.prototype.$UsesHashForTrackingNavigation$});
function $JSCompiler_StaticMethods__updatePageIdAndAnchor$$($JSCompiler_StaticMethods__updatePageIdAndAnchor$self$$, $href$$6$$, $pageId$$3$$, $anchor$$4$$) {
  var $hashIndex$$1_state$$2$$ = $href$$6$$.indexOf("#");
  0 <= $hashIndex$$1_state$$2$$ && ($href$$6$$ = $href$$6$$.substring(0, $hashIndex$$1_state$$2$$));
  $hashIndex$$1_state$$2$$ = null;
  null != $pageId$$3$$ && ($hashIndex$$1_state$$2$$ = {}, $hashIndex$$1_state$$2$$.$_afrPage$ = $pageId$$3$$);
  var $h$$5$$ = $JSCompiler_StaticMethods__updatePageIdAndAnchor$self$$.$GetDomWindow$().history;
  $h$$5$$.replaceState($hashIndex$$1_state$$2$$, null, $href$$6$$);
  null != $pageId$$3$$ && null == $h$$5$$.state ? $JSCompiler_StaticMethods__updatePageIdAndAnchor$self$$.$UpdateHash$($pageId$$3$$, void 0, void 0, $anchor$$4$$, !0) : null != $anchor$$4$$ && $h$$5$$.replaceState($hashIndex$$1_state$$2$$, null, $href$$6$$ + "#" + encodeURIComponent($anchor$$4$$));
}
function $JSCompiler_StaticMethods__replaceViewIdAndQuery$$($JSCompiler_StaticMethods__replaceViewIdAndQuery$self$$, $oldViewId$$, $viewId$$2$$, $query$$3$$, $preserveHash$$) {
  var $href$$7$$ = $JSCompiler_StaticMethods__replaceViewIdAndQuery$self$$.$GetDomWindow$().location.href, $hash$$1$$ = "", $hashIndex$$2_queryIndex$$1$$ = $href$$7$$.indexOf("#");
  0 <= $hashIndex$$2_queryIndex$$1$$ && ($hash$$1$$ = $href$$7$$.substring($hashIndex$$2_queryIndex$$1$$), $href$$7$$ = $href$$7$$.substring(0, $hashIndex$$2_queryIndex$$1$$));
  $hashIndex$$2_queryIndex$$1$$ = $href$$7$$.indexOf("?");
  0 <= $hashIndex$$2_queryIndex$$1$$ && ($href$$7$$ = $href$$7$$.substring(0, $hashIndex$$2_queryIndex$$1$$));
  null != $viewId$$2$$ && $oldViewId$$ !== $viewId$$2$$ && ($href$$7$$ = $href$$7$$.substring(0, $JSCompiler_StaticMethods__replaceViewIdAndQuery$self$$.$_viewIdStartIndex$) + $viewId$$2$$ + $href$$7$$.substring($JSCompiler_StaticMethods__replaceViewIdAndQuery$self$$.$_viewIdStartIndex$ + $oldViewId$$.length));
  null != $query$$3$$ && "?" != $query$$3$$ && ($href$$7$$ += $query$$3$$);
  $preserveHash$$ && ($href$$7$$ += $hash$$1$$);
  return $href$$7$$;
}
$AdfHtml5NavigationHistoryAgent$$.$_checkURI$ = function $$AdfHtml5NavigationHistoryAgent$$$$_checkURI$$() {
  $AdfNavigationHistoryAgent$$.$getInstance$().$ValidateCurrentView$();
};
