text: define(["exports", "require", "../../@polymer/polymer/polymer-element.js"], function (_exports, _require, _polymerElement) {
    "use strict";
  
    Object.defineProperty(_exports, "__esModule", {
      value: true
    });
    _exports.SelectMenu = void 0;
    _require = babelHelpers.interopRequireWildcard(_require);
  
    function _templateObject_35a02ea0d1d911ea92952ff2097cf814() {
      var data = babelHelpers.taggedTemplateLiteral(["\n      <style>\n        paper-dropdown-menu,\n        paper-listbox {\n          width: 250px;\n        }\n        paper-dropdown-menu {\n          height: 200px;\n          margin: auto;\n          display: block;\n        }\n      </style>\n      <paper-dropdown-menu\n        id=\"menu\"\n        label$=\"[[label]]\"\n        on-click=\"_menubuttonTap\"\n        on-selected-item-changed=\"_setSelectedValue\"\n      >\n        <paper-listbox\n          id=\"listbox\"\n          slot=\"dropdown-content\"\n          selected=\"{{selectedIndex}}\"\n        >\n          <slot></slot>\n        </paper-listbox>\n      </paper-dropdown-menu>\n    "], ["\n      <style>\n        paper-dropdown-menu,\n        paper-listbox {\n          width: 250px;\n        }\n        paper-dropdown-menu {\n          height: 200px;\n          margin: auto;\n          display: block;\n        }\n      </style>\n      <paper-dropdown-menu\n        id=\"menu\"\n        label\\$=\"[[label]]\"\n        on-click=\"_menubuttonTap\"\n        on-selected-item-changed=\"_setSelectedValue\"\n      >\n        <paper-listbox\n          id=\"listbox\"\n          slot=\"dropdown-content\"\n          selected=\"{{selectedIndex}}\"\n        >\n          <slot></slot>\n        </paper-listbox>\n      </paper-dropdown-menu>\n    "]);
  
      _templateObject_35a02ea0d1d911ea92952ff2097cf814 = function _templateObject_35a02ea0d1d911ea92952ff2097cf814() {
        return data;
      };
  
      return data;
    }
  
    /**
     * `select-menu`
     * @element select-menu
     * accepts an array of values and human-readable text and creates a paper-dropdown-menu, provides the value fo the selected item
     *
    
     * @polymer
     * @polymerLegacy
     * @demo demo/index.html
     */
    var SelectMenu =
    /*#__PURE__*/
    function (_PolymerElement) {
      babelHelpers.inherits(SelectMenu, _PolymerElement);
  
      function SelectMenu() {
        var _this;
  
        babelHelpers.classCallCheck(this, SelectMenu);
        _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(SelectMenu).call(this));
        new Promise(function (res, rej) {
          return _require.default(["../../@polymer/paper-dropdown-menu/paper-dropdown-menu.js"], res, rej);
        });
        new Promise(function (res, rej) {
          return _require.default(["../../@polymer/paper-item/paper-item.js"], res, rej);
        });
        new Promise(function (res, rej) {
          return _require.default(["../../@polymer/paper-listbox/paper-listbox.js"], res, rej);
        });
        return _this;
      }
  
      babelHelpers.createClass(SelectMenu, [{
        key: "_setSelectedValue",
  
        /**
         * Get the value of the selected item.
         */
        value: function _setSelectedValue(e) {
          if (e.detail.value !== null) {
            var val = e.detail.value.getAttribute("value");
            this.setAttribute("value", val);
            this.dispatchEvent(new CustomEvent("change", {
              bubbles: true,
              cancelable: true,
              composed: true,
              detail: {
                value: val
              }
            }));
          }
        }
        /**
         * Get the index of the default value.
         */
  
      }, {
        key: "_getSelectedIndex",
        value: function _getSelectedIndex() {
          this.__items = this.getElementsByTagName("paper-item");
  
          for (var i = 0; i < this.__items.length; i++) {
            console.log(this.value, this.__items[i], this.__items[i].getAttribute("value"));
  
            if (this.value == this.__items[i].getAttribute("value")) {
              return i;
            }
          }
  
          return null;
        }
      }], [{
        key: "template",
        get: function get() {
          return (0, _polymerElement.html)(_templateObject_35a02ea0d1d911ea92952ff2097cf814());
        }
      }, {
        key: "tag",
        get: function get() {
          return "select-menu";
        }
      }, {
        key: "properties",
        get: function get() {
          return {
            /**
             * The label of the select menu
             */
            label: {
              type: String,
              value: "Select an option."
            },
  
            /**
             * The default value
             */
            value: {
              type: String,
              value: null
            },
  
            /**
             * The index of the selected item
             */
            selectedIndex: {
              type: Number,
              reflectToAttribute: true,
              notify: true,
              computed: "_getSelectedIndex()"
            }
          };
        }
      }]);
      return SelectMenu;
    }(_polymerElement.PolymerElement);
  
    _exports.SelectMenu = SelectMenu;
    window.customElements.define(SelectMenu.tag, SelectMenu);
  });