'use strict';

Liferay.Loader.define('frontend-taglib-clay$clay-dropdown@2.24.1/lib/ClayDropdownBase.soy', ['module', 'exports', 'require', 'frontend-js-metal-web$metal-component', 'frontend-js-metal-web$metal-soy'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.templates = exports.ClayDropdownBase = undefined;

    var _metalComponent = require('frontend-js-metal-web$metal-component');

    var _metalComponent2 = _interopRequireDefault(_metalComponent);

    var _metalSoy = require('frontend-js-metal-web$metal-soy');

    var _metalSoy2 = _interopRequireDefault(_metalSoy);

    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { default: obj };
    }

    function _classCallCheck(instance, Constructor) {
      if (!(instance instanceof Constructor)) {
        throw new TypeError("Cannot call a class as a function");
      }
    }

    function _possibleConstructorReturn(self, call) {
      if (!self) {
        throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
      }return call && (typeof call === "object" || typeof call === "function") ? call : self;
    }

    function _inherits(subClass, superClass) {
      if (typeof superClass !== "function" && superClass !== null) {
        throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
      }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
    } /* jshint ignore:start */

    var templates;
    goog.loadModule(function (exports) {
      var soy = goog.require('soy');

      goog.require('soydata');

      // This file was automatically generated from ClayDropdownBase.soy.
      // Please don't edit this file by hand.

      /**
       * @fileoverview Templates in namespace ClayDropdownBase.
       * @hassoydeltemplate {ClayDropdownBase.Content.idom}
       * @hassoydelcall {ClayDropdownBase.Content.idom}
       * @public
       */

      goog.module('ClayDropdownBase.incrementaldom');

      goog.require('goog.soy.data.SanitizedContent');
      var incrementalDom = goog.require('incrementaldom');
      goog.require('soy');
      goog.require('soy.asserts');
      var soyIdom = goog.require('soy.idom');

      var $templateAlias2 = _metalSoy2.default.getTemplate('ClayButton.incrementaldom', 'render');

      var $templateAlias1 = _metalSoy2.default.getTemplate('ClayDropdownItem.incrementaldom', 'render');

      var $templateAlias3 = _metalSoy2.default.getTemplate('ClayLink.incrementaldom', 'render');

      var $templateAlias4 = _metalSoy2.default.getTemplate('ClayPortal.incrementaldom', 'render');

      /**
       * @param {{
       *  items: !Array<?>,
       *  label: (!goog.soy.data.SanitizedContent|function()|string),
       *  _filteredItems: (!Array<?>|null|undefined),
       *  _handleButtonClick: (*|null|undefined),
       *  _handleItemClick: (*|null|undefined),
       *  _handleItemKeyDown: (*|null|undefined),
       *  _handleSearch: (*|null|undefined),
       *  _handleTriggerKeyDown: (*|null|undefined),
       *  _showCaption: (boolean|null|undefined),
       *  button: (?),
       *  caption: (!goog.soy.data.SanitizedContent|function()|null|string|undefined),
       *  contentRenderer: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  disabled: (boolean|null|undefined),
       *  elementClasses: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  expanded: (boolean|null|undefined),
       *  helpText: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  id: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  itemsIconAlignment: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  portalElementId: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  searchable: (boolean|null|undefined),
       *  spritemap: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  style: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  triggerAriaLabel: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  triggerClasses: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  triggerSize: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  triggerTitle: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  useSearchableWithForm: (boolean|null|undefined)
       * }} opt_data
       * @param {Object<string, *>=} opt_ijData
       * @param {Object<string, *>=} opt_ijData_deprecated
       * @return {void}
       * @suppress {checkTypes}
       */
      function $render(opt_data, opt_ijData, opt_ijData_deprecated) {
        opt_ijData = opt_ijData_deprecated || opt_ijData;
        var $$temp;
        /** @type {!Array<?>} */
        var items = soy.asserts.assertType(goog.isArray(opt_data.items), 'items', opt_data.items, '!Array<?>');
        /** @type {!goog.soy.data.SanitizedContent|function()|string} */
        var label = soy.asserts.assertType(goog.isFunction(opt_data.label) || goog.isString(opt_data.label) || opt_data.label instanceof goog.soy.data.SanitizedContent, 'label', opt_data.label, '!goog.soy.data.SanitizedContent|function()|string');
        /** @type {!Array<?>|null|undefined} */
        var _filteredItems = soy.asserts.assertType(opt_data._filteredItems == null || goog.isArray(opt_data._filteredItems), '_filteredItems', opt_data._filteredItems, '!Array<?>|null|undefined');
        /** @type {*|null|undefined} */
        var _handleButtonClick = opt_data._handleButtonClick;
        /** @type {*|null|undefined} */
        var _handleItemClick = opt_data._handleItemClick;
        /** @type {*|null|undefined} */
        var _handleItemKeyDown = opt_data._handleItemKeyDown;
        /** @type {*|null|undefined} */
        var _handleSearch = opt_data._handleSearch;
        /** @type {*|null|undefined} */
        var _handleTriggerKeyDown = opt_data._handleTriggerKeyDown;
        /** @type {boolean|null|undefined} */
        var _showCaption = soy.asserts.assertType(opt_data._showCaption == null || goog.isBoolean(opt_data._showCaption) || opt_data._showCaption === 1 || opt_data._showCaption === 0, '_showCaption', opt_data._showCaption, 'boolean|null|undefined');
        /** @type {?} */
        var button = opt_data.button;
        /** @type {!goog.soy.data.SanitizedContent|function()|null|string|undefined} */
        var caption = soy.asserts.assertType(opt_data.caption == null || goog.isFunction(opt_data.caption) || goog.isString(opt_data.caption) || opt_data.caption instanceof goog.soy.data.SanitizedContent, 'caption', opt_data.caption, '!goog.soy.data.SanitizedContent|function()|null|string|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */
        var contentRenderer = soy.asserts.assertType(opt_data.contentRenderer == null || goog.isString(opt_data.contentRenderer) || opt_data.contentRenderer instanceof goog.soy.data.SanitizedContent, 'contentRenderer', opt_data.contentRenderer, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {boolean|null|undefined} */
        var disabled = soy.asserts.assertType(opt_data.disabled == null || goog.isBoolean(opt_data.disabled) || opt_data.disabled === 1 || opt_data.disabled === 0, 'disabled', opt_data.disabled, 'boolean|null|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */
        var elementClasses = soy.asserts.assertType(opt_data.elementClasses == null || goog.isString(opt_data.elementClasses) || opt_data.elementClasses instanceof goog.soy.data.SanitizedContent, 'elementClasses', opt_data.elementClasses, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {boolean|null|undefined} */
        var expanded = soy.asserts.assertType(opt_data.expanded == null || goog.isBoolean(opt_data.expanded) || opt_data.expanded === 1 || opt_data.expanded === 0, 'expanded', opt_data.expanded, 'boolean|null|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */
        var helpText = soy.asserts.assertType(opt_data.helpText == null || goog.isString(opt_data.helpText) || opt_data.helpText instanceof goog.soy.data.SanitizedContent, 'helpText', opt_data.helpText, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */
        var id = soy.asserts.assertType(opt_data.id == null || goog.isString(opt_data.id) || opt_data.id instanceof goog.soy.data.SanitizedContent, 'id', opt_data.id, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */
        var itemsIconAlignment = soy.asserts.assertType(opt_data.itemsIconAlignment == null || goog.isString(opt_data.itemsIconAlignment) || opt_data.itemsIconAlignment instanceof goog.soy.data.SanitizedContent, 'itemsIconAlignment', opt_data.itemsIconAlignment, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */
        var portalElementId = soy.asserts.assertType(opt_data.portalElementId == null || goog.isString(opt_data.portalElementId) || opt_data.portalElementId instanceof goog.soy.data.SanitizedContent, 'portalElementId', opt_data.portalElementId, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {boolean|null|undefined} */
        var searchable = soy.asserts.assertType(opt_data.searchable == null || goog.isBoolean(opt_data.searchable) || opt_data.searchable === 1 || opt_data.searchable === 0, 'searchable', opt_data.searchable, 'boolean|null|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */
        var spritemap = soy.asserts.assertType(opt_data.spritemap == null || goog.isString(opt_data.spritemap) || opt_data.spritemap instanceof goog.soy.data.SanitizedContent, 'spritemap', opt_data.spritemap, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */
        var style = soy.asserts.assertType(opt_data.style == null || goog.isString(opt_data.style) || opt_data.style instanceof goog.soy.data.SanitizedContent, 'style', opt_data.style, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */
        var triggerAriaLabel = soy.asserts.assertType(opt_data.triggerAriaLabel == null || goog.isString(opt_data.triggerAriaLabel) || opt_data.triggerAriaLabel instanceof goog.soy.data.SanitizedContent, 'triggerAriaLabel', opt_data.triggerAriaLabel, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */
        var triggerClasses = soy.asserts.assertType(opt_data.triggerClasses == null || goog.isString(opt_data.triggerClasses) || opt_data.triggerClasses instanceof goog.soy.data.SanitizedContent, 'triggerClasses', opt_data.triggerClasses, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */
        var triggerSize = soy.asserts.assertType(opt_data.triggerSize == null || goog.isString(opt_data.triggerSize) || opt_data.triggerSize instanceof goog.soy.data.SanitizedContent, 'triggerSize', opt_data.triggerSize, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */
        var triggerTitle = soy.asserts.assertType(opt_data.triggerTitle == null || goog.isString(opt_data.triggerTitle) || opt_data.triggerTitle instanceof goog.soy.data.SanitizedContent, 'triggerTitle', opt_data.triggerTitle, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {boolean|null|undefined} */
        var useSearchableWithForm = soy.asserts.assertType(opt_data.useSearchableWithForm == null || goog.isBoolean(opt_data.useSearchableWithForm) || opt_data.useSearchableWithForm === 1 || opt_data.useSearchableWithForm === 0, 'useSearchableWithForm', opt_data.useSearchableWithForm, 'boolean|null|undefined');

        incrementalDom.elementOpenStart('div');
        (function attributes__soy297() {
          incrementalDom.attr('class', 'dropdown' + (elementClasses ? ' ' + elementClasses : '') + (expanded ? ' show' : ''));
          if (id) {
            incrementalDom.attr('id', id);
          }
        })();
        incrementalDom.elementOpenEnd();
        $trigger({ _handleTriggerKeyDown: _handleTriggerKeyDown, ariaLabel: triggerAriaLabel, classes: triggerClasses, disabled: disabled, expanded: expanded, label: label, size: triggerSize, style: style, title: triggerTitle }, null, opt_ijData);
        $sections({ _handleButtonClick: _handleButtonClick, _handleItemClick: _handleItemClick, _handleItemKeyDown: _handleItemKeyDown, _handleSearch: _handleSearch, _showCaption: ($$temp = _showCaption) == null ? true : $$temp, button: button, caption: caption, contentRenderer: ($$temp = contentRenderer) == null ? '' : $$temp, expanded: expanded, helpText: helpText, items: ($$temp = _filteredItems) == null ? items : $$temp, itemsIconAlignment: itemsIconAlignment, portalElementId: portalElementId, searchable: searchable, spritemap: spritemap, useSearchableWithForm: ($$temp = useSearchableWithForm) == null ? true : $$temp }, null, opt_ijData);
        incrementalDom.elementClose('div');
      }
      exports.render = $render;
      /**
       * @typedef {{
       *  items: !Array<?>,
       *  label: (!goog.soy.data.SanitizedContent|function()|string),
       *  _filteredItems: (!Array<?>|null|undefined),
       *  _handleButtonClick: (*|null|undefined),
       *  _handleItemClick: (*|null|undefined),
       *  _handleItemKeyDown: (*|null|undefined),
       *  _handleSearch: (*|null|undefined),
       *  _handleTriggerKeyDown: (*|null|undefined),
       *  _showCaption: (boolean|null|undefined),
       *  button: (?),
       *  caption: (!goog.soy.data.SanitizedContent|function()|null|string|undefined),
       *  contentRenderer: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  disabled: (boolean|null|undefined),
       *  elementClasses: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  expanded: (boolean|null|undefined),
       *  helpText: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  id: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  itemsIconAlignment: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  portalElementId: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  searchable: (boolean|null|undefined),
       *  spritemap: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  style: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  triggerAriaLabel: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  triggerClasses: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  triggerSize: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  triggerTitle: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  useSearchableWithForm: (boolean|null|undefined)
       * }}
       */
      $render.Params;
      if (goog.DEBUG) {
        $render.soyTemplateName = 'ClayDropdownBase.render';
      }

      /**
       * @param {{
       *  items: !Array<?>,
       *  _handleItemClick: (*|null|undefined),
       *  _handleItemKeyDown: (*|null|undefined),
       *  contentRenderer: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  itemsIconAlignment: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  maxItems: (null|number|undefined),
       *  spritemap: (!goog.soy.data.SanitizedContent|null|string|undefined)
       * }} opt_data
       * @param {Object<string, *>=} opt_ijData
       * @param {Object<string, *>=} opt_ijData_deprecated
       * @return {void}
       * @suppress {checkTypes}
       */
      function $items(opt_data, opt_ijData, opt_ijData_deprecated) {
        opt_ijData = opt_ijData_deprecated || opt_ijData;
        /** @type {!Array<?>} */
        var items = soy.asserts.assertType(goog.isArray(opt_data.items), 'items', opt_data.items, '!Array<?>');
        /** @type {*|null|undefined} */
        var _handleItemClick = opt_data._handleItemClick;
        /** @type {*|null|undefined} */
        var _handleItemKeyDown = opt_data._handleItemKeyDown;
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */
        var contentRenderer = soy.asserts.assertType(opt_data.contentRenderer == null || goog.isString(opt_data.contentRenderer) || opt_data.contentRenderer instanceof goog.soy.data.SanitizedContent, 'contentRenderer', opt_data.contentRenderer, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */
        var itemsIconAlignment = soy.asserts.assertType(opt_data.itemsIconAlignment == null || goog.isString(opt_data.itemsIconAlignment) || opt_data.itemsIconAlignment instanceof goog.soy.data.SanitizedContent, 'itemsIconAlignment', opt_data.itemsIconAlignment, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {null|number|undefined} */
        var maxItems = soy.asserts.assertType(opt_data.maxItems == null || goog.isNumber(opt_data.maxItems), 'maxItems', opt_data.maxItems, 'null|number|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */
        var spritemap = soy.asserts.assertType(opt_data.spritemap == null || goog.isString(opt_data.spritemap) || opt_data.spritemap instanceof goog.soy.data.SanitizedContent, 'spritemap', opt_data.spritemap, '!goog.soy.data.SanitizedContent|null|string|undefined');
        var index356Limit = maxItems && maxItems < items.length ? maxItems : items.length;
        for (var index356 = 0; index356 < index356Limit; index356++) {
          var item__soy358 = items[index356];
          var variant__soy360 = '';
          var $tmp = null;
          if (contentRenderer != null && contentRenderer != '') {
            $tmp = contentRenderer;
          } else if (item__soy358.contentRenderer != null && item__soy358.contentRenderer != '') {
            $tmp = item__soy358.contentRenderer;
          } else if (item__soy358.type) {
            $tmp = item__soy358.type;
          } else {
            $tmp = 'item';
          }
          variant__soy360 += $tmp;
          $templateAlias1({ active: item__soy358.active, checked: item__soy358.checked, contentRenderer: variant__soy360, data: item__soy358.data, disabled: item__soy358.disabled, events: { itemClicked: _handleItemClick, itemKeyDown: _handleItemKeyDown }, href: item__soy358.href, icon: item__soy358.icon, icons: item__soy358.icons, inputName: item__soy358.inputName, inputValue: item__soy358.inputValue, items: item__soy358.items, itemsIconAlignment: itemsIconAlignment, label: item__soy358.label ? '' + item__soy358.label : '', maxItems: item__soy358.maxItems, ref: 'item' + index356, separator: item__soy358.separator, spritemap: spritemap, target: item__soy358.target, title: item__soy358.title, type: item__soy358.type }, null, opt_ijData);
          if (item__soy358.separator) {
            $templateAlias1({ contentRenderer: 'separator' }, null, opt_ijData);
          }
        }
      }
      exports.items = $items;
      /**
       * @typedef {{
       *  items: !Array<?>,
       *  _handleItemClick: (*|null|undefined),
       *  _handleItemKeyDown: (*|null|undefined),
       *  contentRenderer: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  itemsIconAlignment: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  maxItems: (null|number|undefined),
       *  spritemap: (!goog.soy.data.SanitizedContent|null|string|undefined)
       * }}
       */
      $items.Params;
      if (goog.DEBUG) {
        $items.soyTemplateName = 'ClayDropdownBase.items';
      }

      /**
       * @param {{
       *  spritemap: (!goog.soy.data.SanitizedContent|string),
       *  _handleSearch: (*|null|undefined),
       *  useSearchableWithForm: (boolean|null|undefined)
       * }} opt_data
       * @param {Object<string, *>=} opt_ijData
       * @param {Object<string, *>=} opt_ijData_deprecated
       * @return {void}
       * @suppress {checkTypes}
       */
      function $search(opt_data, opt_ijData, opt_ijData_deprecated) {
        opt_ijData = opt_ijData_deprecated || opt_ijData;
        /** @type {!goog.soy.data.SanitizedContent|string} */
        var spritemap = soy.asserts.assertType(goog.isString(opt_data.spritemap) || opt_data.spritemap instanceof goog.soy.data.SanitizedContent, 'spritemap', opt_data.spritemap, '!goog.soy.data.SanitizedContent|string');
        /** @type {*|null|undefined} */
        var _handleSearch = opt_data._handleSearch;
        /** @type {boolean|null|undefined} */
        var useSearchableWithForm = soy.asserts.assertType(opt_data.useSearchableWithForm == null || goog.isBoolean(opt_data.useSearchableWithForm) || opt_data.useSearchableWithForm === 1 || opt_data.useSearchableWithForm === 0, 'useSearchableWithForm', opt_data.useSearchableWithForm, 'boolean|null|undefined');
        var msg_2485__soy2486 = '';
        /** @desc  */
        var MSG_EXTERNAL_7283410932409447729 = Liferay.Language.get('search-for');
        msg_2485__soy2486 += MSG_EXTERNAL_7283410932409447729;
        var _searchPlaceholder__soy415 = '';
        _searchPlaceholder__soy415 += msg_2485__soy2486;
        var content__soy423 = function content__soy423() {
          incrementalDom.elementOpenStart('div');
          incrementalDom.attr('class', 'dropdown-section');
          incrementalDom.elementOpenEnd();
          incrementalDom.elementOpenStart('div');
          incrementalDom.attr('class', 'input-group input-group-sm');
          incrementalDom.elementOpenEnd();
          incrementalDom.elementOpenStart('div');
          incrementalDom.attr('class', 'input-group-item');
          incrementalDom.elementOpenEnd();
          incrementalDom.elementOpenStart('input');
          incrementalDom.attr('aria-label', _searchPlaceholder__soy415);
          incrementalDom.attr('class', 'form-control input-group-inset input-group-inset-after');
          incrementalDom.attr('data-oninput', _handleSearch);
          incrementalDom.attr('placeholder', _searchPlaceholder__soy415);
          incrementalDom.attr('type', 'text');
          incrementalDom.attr('ref', 'searchInput');
          incrementalDom.elementOpenEnd();
          incrementalDom.elementClose('input');
          incrementalDom.elementOpenStart('span');
          incrementalDom.attr('class', 'input-group-inset-item input-group-inset-item-after');
          incrementalDom.elementOpenEnd();
          $templateAlias2({ icon: 'search', spritemap: spritemap, style: 'link' }, null, opt_ijData);
          incrementalDom.elementClose('span');
          incrementalDom.elementClose('div');
          incrementalDom.elementClose('div');
          incrementalDom.elementClose('div');
        };
        if (useSearchableWithForm) {
          incrementalDom.elementOpen('form');
          content__soy423();
          incrementalDom.elementClose('form');
        } else {
          content__soy423();
        }
      }
      exports.search = $search;
      /**
       * @typedef {{
       *  spritemap: (!goog.soy.data.SanitizedContent|string),
       *  _handleSearch: (*|null|undefined),
       *  useSearchableWithForm: (boolean|null|undefined)
       * }}
       */
      $search.Params;
      if (goog.DEBUG) {
        $search.soyTemplateName = 'ClayDropdownBase.search';
      }

      /**
       * @param {{
       *  items: !Array<?>,
       *  _handleButtonClick: (*|null|undefined),
       *  _handleItemClick: (*|null|undefined),
       *  _handleItemKeyDown: (*|null|undefined),
       *  _handleSearch: (*|null|undefined),
       *  _showCaption: (boolean|null|undefined),
       *  button: (?),
       *  caption: (!goog.soy.data.SanitizedContent|function()|null|string|undefined),
       *  contentRenderer: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  expanded: (boolean|null|undefined),
       *  helpText: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  itemsIconAlignment: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  portalElementId: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  searchable: (boolean|null|undefined),
       *  spritemap: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  useSearchableWithForm: (boolean|null|undefined)
       * }} opt_data
       * @param {Object<string, *>=} opt_ijData
       * @param {Object<string, *>=} opt_ijData_deprecated
       * @return {void}
       * @suppress {checkTypes}
       */
      function $sections(opt_data, opt_ijData, opt_ijData_deprecated) {
        opt_ijData = opt_ijData_deprecated || opt_ijData;
        var $$temp;
        /** @type {!Array<?>} */
        soy.asserts.assertType(goog.isArray(opt_data.items), 'items', opt_data.items, '!Array<?>');

        /** @type {*|null|undefined} */
        var _handleButtonClick = opt_data._handleButtonClick;
        /** @type {*|null|undefined} */
        opt_data._handleItemClick;
        opt_data._handleItemKeyDown;
        opt_data._handleSearch;

        /** @type {boolean|null|undefined} */
        var _showCaption = soy.asserts.assertType(opt_data._showCaption == null || goog.isBoolean(opt_data._showCaption) || opt_data._showCaption === 1 || opt_data._showCaption === 0, '_showCaption', opt_data._showCaption, 'boolean|null|undefined');
        /** @type {?} */
        var button = opt_data.button;
        /** @type {!goog.soy.data.SanitizedContent|function()|null|string|undefined} */
        var caption = soy.asserts.assertType(opt_data.caption == null || goog.isFunction(opt_data.caption) || goog.isString(opt_data.caption) || opt_data.caption instanceof goog.soy.data.SanitizedContent, 'caption', opt_data.caption, '!goog.soy.data.SanitizedContent|function()|null|string|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */
        var contentRenderer = soy.asserts.assertType(opt_data.contentRenderer == null || goog.isString(opt_data.contentRenderer) || opt_data.contentRenderer instanceof goog.soy.data.SanitizedContent, 'contentRenderer', opt_data.contentRenderer, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {boolean|null|undefined} */
        var expanded = soy.asserts.assertType(opt_data.expanded == null || goog.isBoolean(opt_data.expanded) || opt_data.expanded === 1 || opt_data.expanded === 0, 'expanded', opt_data.expanded, 'boolean|null|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */
        var helpText = soy.asserts.assertType(opt_data.helpText == null || goog.isString(opt_data.helpText) || opt_data.helpText instanceof goog.soy.data.SanitizedContent, 'helpText', opt_data.helpText, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */
        var itemsIconAlignment = soy.asserts.assertType(opt_data.itemsIconAlignment == null || goog.isString(opt_data.itemsIconAlignment) || opt_data.itemsIconAlignment instanceof goog.soy.data.SanitizedContent, 'itemsIconAlignment', opt_data.itemsIconAlignment, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */
        var portalElementId = soy.asserts.assertType(opt_data.portalElementId == null || goog.isString(opt_data.portalElementId) || opt_data.portalElementId instanceof goog.soy.data.SanitizedContent, 'portalElementId', opt_data.portalElementId, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {boolean|null|undefined} */
        var searchable = soy.asserts.assertType(opt_data.searchable == null || goog.isBoolean(opt_data.searchable) || opt_data.searchable === 1 || opt_data.searchable === 0, 'searchable', opt_data.searchable, 'boolean|null|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */
        var spritemap = soy.asserts.assertType(opt_data.spritemap == null || goog.isString(opt_data.spritemap) || opt_data.spritemap instanceof goog.soy.data.SanitizedContent, 'spritemap', opt_data.spritemap, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {boolean|null|undefined} */
        soy.asserts.assertType(opt_data.useSearchableWithForm == null || goog.isBoolean(opt_data.useSearchableWithForm) || opt_data.useSearchableWithForm === 1 || opt_data.useSearchableWithForm === 0, 'useSearchableWithForm', opt_data.useSearchableWithForm, 'boolean|null|undefined');

        var dropdownMenu__soy465 = function dropdownMenu__soy465() {
          incrementalDom.elementOpenStart('div');
          (function listAttributes__soy467() {
            incrementalDom.attr('class', 'dropdown-menu' + (itemsIconAlignment == 'left' || itemsIconAlignment == 'left-right' ? ' dropdown-menu-indicator-start' : '') + (itemsIconAlignment == 'right' || itemsIconAlignment == 'left-right' ? ' dropdown-menu-indicator-end' : '') + (expanded ? ' show' : ''));
            incrementalDom.attr('ref', 'menu');
          })();
          incrementalDom.elementOpenEnd();
          if (helpText) {
            incrementalDom.elementOpenStart('div');
            incrementalDom.attr('class', 'alert alert-fluid alert-info');
            incrementalDom.attr('role', 'alert');
            incrementalDom.elementOpenEnd();
            soyIdom.print(helpText);
            incrementalDom.elementClose('div');
          }
          if (searchable && spritemap) {
            $search(opt_data, null, opt_ijData);
          }
          var listItemsContent__soy499 = function listItemsContent__soy499() {
            soy.$$getDelegateFn(soy.$$getDelTemplateId('ClayDropdownBase.Content.idom'), contentRenderer, false)(opt_data, null, opt_ijData);
          };
          var captionContent__soy510 = function captionContent__soy510() {
            if (_showCaption && caption && caption != null) {
              incrementalDom.elementOpenStart('div');
              incrementalDom.attr('class', 'dropdown-caption');
              incrementalDom.elementOpenEnd();
              soyIdom.print(caption);
              incrementalDom.elementClose('div');
            }
          };
          if (button) {
            incrementalDom.elementOpen('form');
            incrementalDom.elementOpenStart('div');
            incrementalDom.attr('class', 'inline-scroller');
            incrementalDom.elementOpenEnd();
            listItemsContent__soy499();
            incrementalDom.elementClose('div');
            captionContent__soy510();
            incrementalDom.elementOpenStart('div');
            incrementalDom.attr('class', 'dropdown-section');
            incrementalDom.elementOpenEnd();
            if (button.href != null) {
              $templateAlias3({ buttonStyle: button.buttonStyle, elementClasses: 'btn-block', events: { click: _handleButtonClick }, href: button.href, label: button.label, ref: 'dropdownButton' }, null, opt_ijData);
            } else {
              $templateAlias2({ block: true, events: { click: _handleButtonClick }, label: button.label, ref: 'dropdownButton', style: button.style, type: ($$temp = button.type) == null ? 'button' : $$temp }, null, opt_ijData);
            }
            incrementalDom.elementClose('div');
            incrementalDom.elementClose('form');
          } else {
            listItemsContent__soy499();
            captionContent__soy510();
          }
          incrementalDom.elementClose('div');
        };

        $templateAlias4({ content: function param557() {
            dropdownMenu__soy465();
          }, portalElement: '#' + portalElementId, ref: 'portal' }, null, opt_ijData);
      }
      exports.sections = $sections;
      /**
       * @typedef {{
       *  items: !Array<?>,
       *  _handleButtonClick: (*|null|undefined),
       *  _handleItemClick: (*|null|undefined),
       *  _handleItemKeyDown: (*|null|undefined),
       *  _handleSearch: (*|null|undefined),
       *  _showCaption: (boolean|null|undefined),
       *  button: (?),
       *  caption: (!goog.soy.data.SanitizedContent|function()|null|string|undefined),
       *  contentRenderer: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  expanded: (boolean|null|undefined),
       *  helpText: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  itemsIconAlignment: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  portalElementId: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  searchable: (boolean|null|undefined),
       *  spritemap: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  useSearchableWithForm: (boolean|null|undefined)
       * }}
       */
      $sections.Params;
      if (goog.DEBUG) {
        $sections.soyTemplateName = 'ClayDropdownBase.sections';
      }

      /**
       * @param {{
       *  label: (!goog.soy.data.SanitizedContent|function()|string),
       *  _handleTriggerKeyDown: (*|null|undefined),
       *  ariaLabel: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  classes: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  disabled: (boolean|null|undefined),
       *  expanded: (boolean|null|undefined),
       *  size: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  style: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  title: (!goog.soy.data.SanitizedContent|null|string|undefined)
       * }} opt_data
       * @param {Object<string, *>=} opt_ijData
       * @param {Object<string, *>=} opt_ijData_deprecated
       * @return {void}
       * @suppress {checkTypes}
       */
      function $trigger(opt_data, opt_ijData, opt_ijData_deprecated) {
        opt_ijData = opt_ijData_deprecated || opt_ijData;
        /** @type {!goog.soy.data.SanitizedContent|function()|string} */
        var label = soy.asserts.assertType(goog.isFunction(opt_data.label) || goog.isString(opt_data.label) || opt_data.label instanceof goog.soy.data.SanitizedContent, 'label', opt_data.label, '!goog.soy.data.SanitizedContent|function()|string');
        /** @type {*|null|undefined} */
        var _handleTriggerKeyDown = opt_data._handleTriggerKeyDown;
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */
        var ariaLabel = soy.asserts.assertType(opt_data.ariaLabel == null || goog.isString(opt_data.ariaLabel) || opt_data.ariaLabel instanceof goog.soy.data.SanitizedContent, 'ariaLabel', opt_data.ariaLabel, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */
        var classes = soy.asserts.assertType(opt_data.classes == null || goog.isString(opt_data.classes) || opt_data.classes instanceof goog.soy.data.SanitizedContent, 'classes', opt_data.classes, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {boolean|null|undefined} */
        var disabled = soy.asserts.assertType(opt_data.disabled == null || goog.isBoolean(opt_data.disabled) || opt_data.disabled === 1 || opt_data.disabled === 0, 'disabled', opt_data.disabled, 'boolean|null|undefined');
        /** @type {boolean|null|undefined} */
        var expanded = soy.asserts.assertType(opt_data.expanded == null || goog.isBoolean(opt_data.expanded) || opt_data.expanded === 1 || opt_data.expanded === 0, 'expanded', opt_data.expanded, 'boolean|null|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */
        var size = soy.asserts.assertType(opt_data.size == null || goog.isString(opt_data.size) || opt_data.size instanceof goog.soy.data.SanitizedContent, 'size', opt_data.size, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */
        var style = soy.asserts.assertType(opt_data.style == null || goog.isString(opt_data.style) || opt_data.style instanceof goog.soy.data.SanitizedContent, 'style', opt_data.style, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */
        var title = soy.asserts.assertType(opt_data.title == null || goog.isString(opt_data.title) || opt_data.title instanceof goog.soy.data.SanitizedContent, 'title', opt_data.title, '!goog.soy.data.SanitizedContent|null|string|undefined');

        incrementalDom.elementOpenStart('button');
        (function buttonAttributes__soy575() {
          if (expanded) {
            incrementalDom.attr('aria-expanded', 'true');
          } else {
            incrementalDom.attr('aria-expanded', 'false');
          }
          incrementalDom.attr('aria-haspopup', 'true');
          if (ariaLabel) {
            incrementalDom.attr('aria-label', ariaLabel);
          }
          incrementalDom.attr('class', 'dropdown-toggle btn' + (classes ? ' ' + classes : '') + (size ? ' btn-' + size : '') + (style ? ' btn-' + style : ' btn-unstyled'));
          if (disabled) {
            incrementalDom.attr('disabled', '');
          } else {
            incrementalDom.attr('data-onclick', 'toggle');
            incrementalDom.attr('data-onkeydown', _handleTriggerKeyDown);
          }
          incrementalDom.attr('ref', 'triggerButton');
          if (title) {
            incrementalDom.attr('title', title);
          }
          incrementalDom.attr('type', 'button');
        })();
        incrementalDom.elementOpenEnd();
        soyIdom.print(label);
        incrementalDom.elementClose('button');
      }
      exports.trigger = $trigger;
      /**
       * @typedef {{
       *  label: (!goog.soy.data.SanitizedContent|function()|string),
       *  _handleTriggerKeyDown: (*|null|undefined),
       *  ariaLabel: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  classes: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  disabled: (boolean|null|undefined),
       *  expanded: (boolean|null|undefined),
       *  size: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  style: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  title: (!goog.soy.data.SanitizedContent|null|string|undefined)
       * }}
       */
      $trigger.Params;
      if (goog.DEBUG) {
        $trigger.soyTemplateName = 'ClayDropdownBase.trigger';
      }

      /**
       * @param {{
       *  _handleItemClick: (*|null|undefined),
       *  _handleItemKeyDown: (*|null|undefined),
       *  contentRenderer: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  items: (!Array<?>|null|undefined),
       *  itemsIconAlignment: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  spritemap: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  maxItems: (null|number|undefined)
       * }} opt_data
       * @param {Object<string, *>=} opt_ijData
       * @param {Object<string, *>=} opt_ijData_deprecated
       * @return {void}
       * @suppress {checkTypes}
       */
      function __deltemplate_s628_c28eeb45(opt_data, opt_ijData, opt_ijData_deprecated) {
        opt_ijData = opt_ijData_deprecated || opt_ijData;
        opt_data = opt_data || {};
        /** @type {*|null|undefined} */
        opt_data._handleItemClick;
        opt_data._handleItemKeyDown;
        soy.asserts.assertType(opt_data.contentRenderer == null || goog.isString(opt_data.contentRenderer) || opt_data.contentRenderer instanceof goog.soy.data.SanitizedContent, 'contentRenderer', opt_data.contentRenderer, '!goog.soy.data.SanitizedContent|null|string|undefined');

        /** @type {!Array<?>|null|undefined} */
        var items = soy.asserts.assertType(opt_data.items == null || goog.isArray(opt_data.items), 'items', opt_data.items, '!Array<?>|null|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */
        soy.asserts.assertType(opt_data.itemsIconAlignment == null || goog.isString(opt_data.itemsIconAlignment) || opt_data.itemsIconAlignment instanceof goog.soy.data.SanitizedContent, 'itemsIconAlignment', opt_data.itemsIconAlignment, '!goog.soy.data.SanitizedContent|null|string|undefined');
        soy.asserts.assertType(opt_data.spritemap == null || goog.isString(opt_data.spritemap) || opt_data.spritemap instanceof goog.soy.data.SanitizedContent, 'spritemap', opt_data.spritemap, '!goog.soy.data.SanitizedContent|null|string|undefined');

        if (items) {
          incrementalDom.elementOpenStart('ul');
          incrementalDom.attr('class', 'list-unstyled');
          incrementalDom.elementOpenEnd();
          $items(opt_data, null, opt_ijData);
          incrementalDom.elementClose('ul');
        }
      }
      exports.__deltemplate_s628_c28eeb45 = __deltemplate_s628_c28eeb45;
      /**
       * @typedef {{
       *  _handleItemClick: (*|null|undefined),
       *  _handleItemKeyDown: (*|null|undefined),
       *  contentRenderer: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  items: (!Array<?>|null|undefined),
       *  itemsIconAlignment: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  spritemap: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  maxItems: (null|number|undefined)
       * }}
       */
      __deltemplate_s628_c28eeb45.Params;
      if (goog.DEBUG) {
        __deltemplate_s628_c28eeb45.soyTemplateName = 'ClayDropdownBase.__deltemplate_s628_c28eeb45';
      }
      soy.$$registerDelegateFn(soy.$$getDelTemplateId('ClayDropdownBase.Content.idom'), '', 0, __deltemplate_s628_c28eeb45);

      exports.render.params = ["items", "label", "_filteredItems", "_handleButtonClick", "_handleItemClick", "_handleItemKeyDown", "_handleSearch", "_handleTriggerKeyDown", "_showCaption", "button", "caption", "contentRenderer", "disabled", "elementClasses", "expanded", "helpText", "id", "itemsIconAlignment", "portalElementId", "searchable", "spritemap", "style", "triggerAriaLabel", "triggerClasses", "triggerSize", "triggerTitle", "useSearchableWithForm"];
      exports.render.types = { "items": "list<?>", "label": "html|string", "_filteredItems": "list<?>", "_handleButtonClick": "any", "_handleItemClick": "any", "_handleItemKeyDown": "any", "_handleSearch": "any", "_handleTriggerKeyDown": "any", "_showCaption": "bool", "button": "?", "caption": "html|string", "contentRenderer": "string", "disabled": "bool", "elementClasses": "string", "expanded": "bool", "helpText": "string", "id": "string", "itemsIconAlignment": "string", "portalElementId": "string", "searchable": "bool", "spritemap": "string", "style": "string", "triggerAriaLabel": "string", "triggerClasses": "string", "triggerSize": "string", "triggerTitle": "string", "useSearchableWithForm": "bool" };
      exports.items.params = ["items", "_handleItemClick", "_handleItemKeyDown", "contentRenderer", "itemsIconAlignment", "maxItems", "spritemap"];
      exports.items.types = { "items": "list<?>", "_handleItemClick": "any", "_handleItemKeyDown": "any", "contentRenderer": "string", "itemsIconAlignment": "string", "maxItems": "int", "spritemap": "string" };
      exports.search.params = ["spritemap", "_handleSearch", "useSearchableWithForm"];
      exports.search.types = { "spritemap": "string", "_handleSearch": "any", "useSearchableWithForm": "bool" };
      exports.sections.params = ["items", "_handleButtonClick", "_handleItemClick", "_handleItemKeyDown", "_handleSearch", "_showCaption", "button", "caption", "contentRenderer", "expanded", "helpText", "itemsIconAlignment", "portalElementId", "searchable", "spritemap", "useSearchableWithForm"];
      exports.sections.types = { "items": "list<?>", "_handleButtonClick": "any", "_handleItemClick": "any", "_handleItemKeyDown": "any", "_handleSearch": "any", "_showCaption": "bool", "button": "?", "caption": "html|string", "contentRenderer": "string", "expanded": "bool", "helpText": "string", "itemsIconAlignment": "string", "portalElementId": "string", "searchable": "bool", "spritemap": "string", "useSearchableWithForm": "bool" };
      exports.trigger.params = ["label", "_handleTriggerKeyDown", "ariaLabel", "classes", "disabled", "expanded", "size", "style", "title"];
      exports.trigger.types = { "label": "html|string", "_handleTriggerKeyDown": "any", "ariaLabel": "string", "classes": "string", "disabled": "bool", "expanded": "bool", "size": "string", "style": "string", "title": "string" };
      exports.templates = templates = exports;
      return exports;
    });

    var ClayDropdownBase = function (_Component) {
      _inherits(ClayDropdownBase, _Component);

      function ClayDropdownBase() {
        _classCallCheck(this, ClayDropdownBase);

        return _possibleConstructorReturn(this, (ClayDropdownBase.__proto__ || Object.getPrototypeOf(ClayDropdownBase)).apply(this, arguments));
      }

      return ClayDropdownBase;
    }(_metalComponent2.default);

    _metalSoy2.default.register(ClayDropdownBase, templates);
    exports.ClayDropdownBase = ClayDropdownBase;
    exports.templates = templates;
    exports.default = templates;
    /* jshint ignore:end */
    //# sourceMappingURL=ClayDropdownBase.soy.js.map
  }
});
//# sourceMappingURL=ClayDropdownBase.soy.js.map