function $AdfMultiSelectPanel$$($peer$$61$$) {
  this.Init($peer$$61$$);
}
$goog$exportSymbol$$("AdfMultiSelectPanel", $AdfMultiSelectPanel$$);
$AdfObject$$.$createSubclass$($AdfMultiSelectPanel$$, $AdfSuggestionsPanel$$);
$AdfMultiSelectPanel$$.$InitClass$ = function $$AdfMultiSelectPanel$$$$InitClass$$() {
  this.$CHECKBOX_EXPANDO$ = "data-afr-cb";
  $goog$exportSymbol$$("AdfMultiSelectPanel.CHECKBOX_EXPANDO", $AdfMultiSelectPanel$$.$CHECKBOX_EXPANDO$);
  this.$_CHECKBOX_HTML$ = '\x3cinput role\x3d"presentation" class\x3d"AFTltCheckbox" type\x3d"checkbox"\x3e\x3c/input\x3e';
  this.$_SELECTED_CHECKBOX_HTML$ = '\x3cinput role\x3d"presentation" class\x3d"AFTltCheckbox" type\x3d"checkbox" checked\x3e\x3c/input\x3e';
  var $checkboxWrapperHtml$$ = '\x3cdiv class\x3d"AFTltCheckboxCntnr"\x3e' + this.$_CHECKBOX_HTML$ + '\x3cdiv class\x3d"AFTltVirtualCheckbox"\x3e\x3c/div\x3e\x3c/div\x3e', $selectedCheckboxWrapperHtml$$ = '\x3cdiv class\x3d"AFTltCheckboxCntnr"\x3e' + this.$_SELECTED_CHECKBOX_HTML$ + '\x3cdiv class\x3d"AFTltVirtualCheckbox"\x3e\x3c/div\x3e\x3c/div\x3e';
  this.$_CONTENT_LIST_TEMPLATE_WRAPPER$ = "\x3cdiv class\x3d'AFTltWrapper'\x3e\x3cdiv class\x3d'AFTltSideAlign'\x3e" + $checkboxWrapperHtml$$ + "\x3c/div\x3e\x3cdiv class\x3d'AFTltSideAlign'\x3e$1\x3c/div\x3e\x3c/div\x3e";
  this.$_CONTENT_TABLE_TEMPLATE_WRAPPER$ = "\x3ctd " + this.$CHECKBOX_EXPANDO$ + "\x3e" + $checkboxWrapperHtml$$ + "\x3c/td\x3e$1";
  this.$_SECTION_HEADER_LIST_TEMPLATE_WRAPPER$ = "\x3cdiv class\x3d'AFTltWrapper'\x3e\x3cdiv class\x3d'AFTltSideAlign'\x3e" + $selectedCheckboxWrapperHtml$$ + "\x3c/div\x3e\x3cdiv class\x3d'AFTltSideAlign'\x3e$1\x3c/div\x3e\x3c/div\x3e";
  this.$_SECTION_HEADER_TABLE_TEMPLATE_WRAPPER$ = "\x3cth\x3e" + $selectedCheckboxWrapperHtml$$ + "\x3c/th\x3e$1";
  this.$_CONTENT_HEADER_TEMPLATE_WRAPPER$ = "\x3cth\x3e\x3c/th\x3e$1";
};
$goog$exportSymbol$$("AdfMultiSelectPanel.InitClass", $AdfMultiSelectPanel$$.$InitClass$);
$AdfMultiSelectPanel$$.prototype.Init = function $$AdfMultiSelectPanel$$$$Init$($peer$$62$$) {
  $AdfMultiSelectPanel$$.$superclass$.Init.call(this, $peer$$62$$);
};
$AdfObject$$.$exportPrototypeSymbol$("AdfMultiSelectPanel.prototype.Init", {Init:$AdfMultiSelectPanel$$.prototype.Init});
$AdfMultiSelectPanel$$.$getSectionalHeader$ = function $$AdfMultiSelectPanel$$$$getSectionalHeader$$($clientId$$74_component$$559$$, $element$$151$$, $rootElement$$6$$) {
  for ($clientId$$74_component$$559$$ = $clientId$$74_component$$559$$.$getClientId$();$element$$151$$ != document.body && !$AdfMultiSelectPanel$$.$_isSectionalHeader$($clientId$$74_component$$559$$, $element$$151$$) && $element$$151$$ != $rootElement$$6$$;) {
    $element$$151$$ = $element$$151$$.parentNode;
  }
  return $AdfMultiSelectPanel$$.$_isSectionalHeader$($clientId$$74_component$$559$$, $element$$151$$) ? $element$$151$$ : null;
};
$goog$exportSymbol$$("AdfMultiSelectPanel.getSectionalHeader", $AdfMultiSelectPanel$$.$getSectionalHeader$);
$AdfMultiSelectPanel$$.$_isSectionalHeader$ = function $$AdfMultiSelectPanel$$$$_isSectionalHeader$$($clientId$$75$$, $element$$152$$) {
  var $idPrefix$$ = $AdfSuggestionsPanel$$.$getSuggestItemIdPrefix$($clientId$$75$$);
  return 0 === $element$$152$$.id.indexOf($idPrefix$$) && !$AdfSuggestionsPanel$$.$IsSuggestItem$($element$$152$$);
};
$AdfMultiSelectPanel$$.prototype.$handleClick$ = function $$AdfMultiSelectPanel$$$$$handleClick$$($eventTarget$$28_state$$inline_730$$) {
  var $displayedSuggestions$$inline_731_headerElem_peer$$63$$ = this.$GetPeer$(), $component$$560$$ = $displayedSuggestions$$inline_731_headerElem_peer$$63$$.$getComponent$(), $localSelections$$inline_732_rootElement$$7$$ = $displayedSuggestions$$inline_731_headerElem_peer$$63$$.$getDomElement$();
  if ($displayedSuggestions$$inline_731_headerElem_peer$$63$$.$IsSelectionsShown$($component$$560$$) && ($displayedSuggestions$$inline_731_headerElem_peer$$63$$ = $AdfMultiSelectPanel$$.$getSectionalHeader$($component$$560$$, $eventTarget$$28_state$$inline_730$$, $localSelections$$inline_732_rootElement$$7$$))) {
    var $checkbox$$inline_729_value$$inline_735$$ = $AdfMultiSelectPanel$$.$_getCheckbox$($displayedSuggestions$$inline_731_headerElem_peer$$63$$);
    $eventTarget$$28_state$$inline_730$$ = !$checkbox$$inline_729_value$$inline_735$$.checked;
    $checkbox$$inline_729_value$$inline_735$$.checked = $eventTarget$$28_state$$inline_730$$;
    var $displayedSuggestions$$inline_731_headerElem_peer$$63$$ = this.$getDisplayedSuggestions$(), $localSelections$$inline_732_rootElement$$7$$ = this.$GetPeer$().$__getLocalSelections$(), $currLength$$inline_733$$ = $localSelections$$inline_732_rootElement$$7$$.size;
    $localSelections$$inline_732_rootElement$$7$$.clear();
    for (var $suggestItem$$inline_734$$ = $AdfSuggestionsPanel$$.$GetNextItem$($component$$560$$, !0);$suggestItem$$inline_734$$;) {
      $checkbox$$inline_729_value$$inline_735$$ = $AdfMultiSelectPanel$$.$_getCheckbox$($suggestItem$$inline_734$$);
      $AdfMultiSelectPanel$$.$_toggleSelection$($suggestItem$$inline_734$$, $checkbox$$inline_729_value$$inline_735$$, $eventTarget$$28_state$$inline_730$$);
      if ($eventTarget$$28_state$$inline_730$$) {
        var $checkbox$$inline_729_value$$inline_735$$ = $AdfSuggestionsPanel$$.$GetValueFromItem$($component$$560$$, $suggestItem$$inline_734$$), $suggestion$$inline_736$$ = $displayedSuggestions$$inline_731_headerElem_peer$$63$$.get($checkbox$$inline_729_value$$inline_735$$);
        $localSelections$$inline_732_rootElement$$7$$.set($checkbox$$inline_729_value$$inline_735$$, $suggestion$$inline_736$$);
      }
      $suggestItem$$inline_734$$ = $AdfSuggestionsPanel$$.$GetNextItem$($component$$560$$, !0, $suggestItem$$inline_734$$);
    }
    $AdfMultiSelectPanel$$.$_setSelectionsCount$($component$$560$$, $eventTarget$$28_state$$inline_730$$ ? $displayedSuggestions$$inline_731_headerElem_peer$$63$$.length : 0, 0 == $currLength$$inline_733$$);
    $component$$560$$.focus();
    return;
  }
  $AdfMultiSelectPanel$$.$superclass$.$handleClick$.call(this, $eventTarget$$28_state$$inline_730$$);
};
$AdfObject$$.$exportPrototypeSymbol$("AdfMultiSelectPanel.prototype.handleClick", {$handleClick$:$AdfMultiSelectPanel$$.prototype.$handleClick$});
$AdfMultiSelectPanel$$.prototype.$CreateSampleListItem$ = function $$AdfMultiSelectPanel$$$$$CreateSampleListItem$$($isTableMode$$, $listSize$$) {
  var $sampleListItem$$ = $AdfMultiSelectPanel$$.$superclass$.$CreateSampleListItem$.call(this, $isTableMode$$, $listSize$$);
  $sampleListItem$$.setAttribute("aria-selected", "false");
  return $sampleListItem$$;
};
$AdfObject$$.$exportPrototypeSymbol$("AdfMultiSelectPanel.prototype.CreateSampleListItem", {$CreateSampleListItem$:$AdfMultiSelectPanel$$.prototype.$CreateSampleListItem$});
$AdfMultiSelectPanel$$.prototype.$GetSelectedSampleListItem$ = function $$AdfMultiSelectPanel$$$$$GetSelectedSampleListItem$$($sampleListItem$$1_selectedSampleListItem$$) {
  $sampleListItem$$1_selectedSampleListItem$$ = $sampleListItem$$1_selectedSampleListItem$$.cloneNode(!1);
  $sampleListItem$$1_selectedSampleListItem$$.setAttribute("aria-selected", "true");
  return $sampleListItem$$1_selectedSampleListItem$$;
};
$AdfObject$$.$exportPrototypeSymbol$("AdfMultiSelectPanel.prototype.GetSelectedSampleListItem", {$GetSelectedSampleListItem$:$AdfMultiSelectPanel$$.prototype.$GetSelectedSampleListItem$});
$AdfMultiSelectPanel$$.prototype.$IsSelected$ = function $$AdfMultiSelectPanel$$$$$IsSelected$$($value$$168$$) {
  return this.$GetPeer$().$__getLocalSelections$().has($value$$168$$);
};
$AdfObject$$.$exportPrototypeSymbol$("AdfMultiSelectPanel.prototype.IsSelected", {$IsSelected$:$AdfMultiSelectPanel$$.prototype.$IsSelected$});
$AdfMultiSelectPanel$$.prototype.$SelectSuggestItem$ = function $$AdfMultiSelectPanel$$$$$SelectSuggestItem$$($component$$561$$, $newValue$$27$$, $suggestionElem$$) {
  var $checkbox$$1$$ = $AdfMultiSelectPanel$$.$_getCheckbox$($suggestionElem$$), $localSelections$$ = this.$GetPeer$().$__getLocalSelections$();
  if ($localSelections$$.has($newValue$$27$$)) {
    $localSelections$$["delete"]($newValue$$27$$), $AdfMultiSelectPanel$$.$_toggleSelection$($suggestionElem$$, $checkbox$$1$$, !1), $AdfMultiSelectPanel$$.$_updateSelectionsCount$($component$$561$$, -1);
  } else {
    var $selection$$16$$ = this.$getDisplayedSuggestions$().get($newValue$$27$$);
    $localSelections$$.set($newValue$$27$$, $selection$$16$$);
    $AdfMultiSelectPanel$$.$_toggleSelection$($suggestionElem$$, $checkbox$$1$$, !0);
    $AdfMultiSelectPanel$$.$_updateSelectionsCount$($component$$561$$, 1);
  }
};
$AdfObject$$.$exportPrototypeSymbol$("AdfMultiSelectPanel.prototype.SelectSuggestItem", {$SelectSuggestItem$:$AdfMultiSelectPanel$$.prototype.$SelectSuggestItem$});
$AdfMultiSelectPanel$$.prototype.$GetSelectedItemTemplate$ = function $$AdfMultiSelectPanel$$$$$GetSelectedItemTemplate$$($template$$8$$) {
  return $template$$8$$.replace($AdfMultiSelectPanel$$.$_CHECKBOX_HTML$, $AdfMultiSelectPanel$$.$_SELECTED_CHECKBOX_HTML$);
};
$AdfObject$$.$exportPrototypeSymbol$("AdfMultiSelectPanel.prototype.GetSelectedItemTemplate", {$GetSelectedItemTemplate$:$AdfMultiSelectPanel$$.prototype.$GetSelectedItemTemplate$});
$AdfMultiSelectPanel$$.prototype.$WrapContentHeaderTemplate$ = function $$AdfMultiSelectPanel$$$$$WrapContentHeaderTemplate$$($template$$9$$) {
  return $AdfMultiSelectPanel$$.$_CONTENT_HEADER_TEMPLATE_WRAPPER$.replace("$1", $template$$9$$);
};
$AdfObject$$.$exportPrototypeSymbol$("AdfMultiSelectPanel.prototype.WrapContentHeaderTemplate", {$WrapContentHeaderTemplate$:$AdfMultiSelectPanel$$.prototype.$WrapContentHeaderTemplate$});
$AdfMultiSelectPanel$$.prototype.$WrapContentStampTemplate$ = function $$AdfMultiSelectPanel$$$$$WrapContentStampTemplate$$($component$$562$$, $template$$10$$) {
  return $component$$562$$.getContentMode() == $AdfDhtmlInputSearchPeer$$.$__CONTENT_MODE_TABLE$ ? $AdfMultiSelectPanel$$.$_CONTENT_TABLE_TEMPLATE_WRAPPER$.replace("$1", $template$$10$$) : $AdfMultiSelectPanel$$.$_CONTENT_LIST_TEMPLATE_WRAPPER$.replace("$1", $template$$10$$);
};
$AdfObject$$.$exportPrototypeSymbol$("AdfMultiSelectPanel.prototype.WrapContentStampTemplate", {$WrapContentStampTemplate$:$AdfMultiSelectPanel$$.prototype.$WrapContentStampTemplate$});
$AdfMultiSelectPanel$$.prototype.$WrapSectionHeaderTemplate$ = function $$AdfMultiSelectPanel$$$$$WrapSectionHeaderTemplate$$($component$$563$$, $section$$2$$, $template$$11$$) {
  return $section$$2$$.getType && $section$$2$$.getType() == $AdfDhtmlInputSearchPeer$$.$__SEARCH_SECTION_TYPE_DEFAULT$ ? $component$$563$$.getContentMode() == $AdfDhtmlInputSearchPeer$$.$__CONTENT_MODE_TABLE$ ? $AdfMultiSelectPanel$$.$_SECTION_HEADER_TABLE_TEMPLATE_WRAPPER$.replace("$1", $template$$11$$) : $AdfMultiSelectPanel$$.$_SECTION_HEADER_LIST_TEMPLATE_WRAPPER$.replace("$1", $template$$11$$) : $template$$11$$;
};
$AdfObject$$.$exportPrototypeSymbol$("AdfMultiSelectPanel.prototype.WrapSectionHeaderTemplate", {$WrapSectionHeaderTemplate$:$AdfMultiSelectPanel$$.prototype.$WrapSectionHeaderTemplate$});
$AdfMultiSelectPanel$$.$_getCheckbox$ = function $$AdfMultiSelectPanel$$$$_getCheckbox$$($suggestionElem$$1$$) {
  return $suggestionElem$$1$$.getElementsByTagName("input")[0];
};
$AdfMultiSelectPanel$$.$_toggleSelection$ = function $$AdfMultiSelectPanel$$$$_toggleSelection$$($suggestItem$$, $checkbox$$2$$, $state$$13$$) {
  $checkbox$$2$$.checked = $state$$13$$;
  $suggestItem$$.setAttribute("aria-selected", $state$$13$$);
};
$AdfMultiSelectPanel$$.$_updateSelectionsCount$ = function $$AdfMultiSelectPanel$$$$_updateSelectionsCount$$($component$$564$$, $diff$$2$$) {
  var $selectionsButton$$ = $AdfInputSearchUtils$getSelectionsButton$$($component$$564$$), $currValue$$3$$ = parseInt($selectionsButton$$.getAttribute($AdfMultiSelectInputSearchPeer$$.$__SELECTIONS_LENGTH_EXPANDO$)), $newValue$$28$$;
  isNaN($currValue$$3$$) ? ($AdfAssert$$.assert(1 == $diff$$2$$), $currValue$$3$$ = 0, $newValue$$28$$ = 1) : $newValue$$28$$ = $currValue$$3$$ + $diff$$2$$;
  $AdfMultiSelectPanel$$.$_setSelectionsCount$($component$$564$$, $newValue$$28$$, 0 == $currValue$$3$$, $selectionsButton$$);
};
$AdfMultiSelectPanel$$.$_setSelectionsCount$ = function $$AdfMultiSelectPanel$$$$_setSelectionsCount$$($component$$565$$, $newLength$$, $noSelectionsState_rootElement$$8$$, $selectionsButton$$1$$) {
  $noSelectionsState_rootElement$$8$$ && ($noSelectionsState_rootElement$$8$$ = $component$$565$$.$getPeer$().$getDomElement$(), $AdfDomUtils$$.$addCSSClassName$($noSelectionsState_rootElement$$8$$, $AdfMultiSelectInputSearchPeer$$.$__HAS_SELECTIONS_STATE_STYLE_CLASS$));
  $selectionsButton$$1$$ || ($selectionsButton$$1$$ = $AdfInputSearchUtils$getSelectionsButton$$($component$$565$$));
  0 === $newLength$$ ? ($selectionsButton$$1$$.removeAttribute($AdfMultiSelectInputSearchPeer$$.$__SELECTIONS_LENGTH_EXPANDO$), $noSelectionsState_rootElement$$8$$ = $component$$565$$.$getPeer$().$getDomElement$(), $AdfDomUtils$$.$removeCSSClassName$($noSelectionsState_rootElement$$8$$, $AdfMultiSelectInputSearchPeer$$.$__HAS_SELECTIONS_STATE_STYLE_CLASS$)) : $selectionsButton$$1$$.setAttribute($AdfMultiSelectInputSearchPeer$$.$__SELECTIONS_LENGTH_EXPANDO$, $newLength$$);
};
