Liferay.Loader.define("commerce-frontend-taglib@10.1.5/user_utils/UserInvitation.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.default = exports.templates = exports.UserInvitation = void 0;

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

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

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

    function _typeof(obj) {
      "@babel/helpers - typeof";
      if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
        _typeof = function _typeof(obj) {
          return typeof obj;
        };
      } else {
        _typeof = function _typeof(obj) {
          return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
        };
      }return _typeof(obj);
    }

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

    function _possibleConstructorReturn(self, call) {
      if (call && (_typeof(call) === "object" || typeof call === "function")) {
        return call;
      }return _assertThisInitialized(self);
    }

    function _assertThisInitialized(self) {
      if (self === void 0) {
        throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
      }return self;
    }

    function _getPrototypeOf(o) {
      _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
        return o.__proto__ || Object.getPrototypeOf(o);
      };return _getPrototypeOf(o);
    }

    function _inherits(subClass, superClass) {
      if (typeof superClass !== "function" && superClass !== null) {
        throw new TypeError("Super expression must either be null or a function");
      }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });if (superClass) _setPrototypeOf(subClass, superClass);
    }

    function _setPrototypeOf(o, p) {
      _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
        o.__proto__ = p;return o;
      };return _setPrototypeOf(o, p);
    }

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

      goog.require('soydata');

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

      /**
       * @fileoverview Templates in namespace UserInvitation.
       * @public
       */

      goog.module('UserInvitation.incrementaldom');

      goog.require('goog.soy.data.SanitizedContent');

      var incrementalDom = goog.require('incrementaldom');

      goog.require('soy.asserts');

      goog.require('soy.idom');

      var $templateAlias1 = _metalSoy.default.getTemplate('ClayIcon.incrementaldom', 'render');

      var $templateAlias2 = _metalSoy.default.getTemplate('UserInputItem.incrementaldom', 'render');

      var $templateAlias3 = _metalSoy.default.getTemplate('UserListItem.incrementaldom', 'render');
      /**
       * @param {{
       *  users: (!Array<{email: (!goog.soy.data.SanitizedContent|string), name: (!goog.soy.data.SanitizedContent|string), thumbnail: (!goog.soy.data.SanitizedContent|string), userId: (!goog.soy.data.SanitizedContent|number|string)}>|null|undefined),
       *  addedUsers: (!Array<{email: (!goog.soy.data.SanitizedContent|string), name: (!goog.soy.data.SanitizedContent|string), thumbnail: (!goog.soy.data.SanitizedContent|string), userId: (!goog.soy.data.SanitizedContent|number|string)}>|null|undefined),
       *  query: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  spritemap: (!goog.soy.data.SanitizedContent|string),
       *  _toggleInvitation: (*|null|undefined),
       *  _handleInputBox: (*|null|undefined),
       *  _handleFormSubmit: (*|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;
        /** @type {!Array<{email: (!goog.soy.data.SanitizedContent|string), name: (!goog.soy.data.SanitizedContent|string), thumbnail: (!goog.soy.data.SanitizedContent|string), userId: (!goog.soy.data.SanitizedContent|number|string)}>|null|undefined} */

        var users = soy.asserts.assertType(opt_data.users == null || goog.isArray(opt_data.users), 'users', opt_data.users, '!Array<{email: (!goog.soy.data.SanitizedContent|string), name: (!goog.soy.data.SanitizedContent|string), thumbnail: (!goog.soy.data.SanitizedContent|string), userId: (!goog.soy.data.SanitizedContent|number|string)}>|null|undefined');
        /** @type {!Array<{email: (!goog.soy.data.SanitizedContent|string), name: (!goog.soy.data.SanitizedContent|string), thumbnail: (!goog.soy.data.SanitizedContent|string), userId: (!goog.soy.data.SanitizedContent|number|string)}>|null|undefined} */

        var addedUsers = soy.asserts.assertType(opt_data.addedUsers == null || goog.isArray(opt_data.addedUsers), 'addedUsers', opt_data.addedUsers, '!Array<{email: (!goog.soy.data.SanitizedContent|string), name: (!goog.soy.data.SanitizedContent|string), thumbnail: (!goog.soy.data.SanitizedContent|string), userId: (!goog.soy.data.SanitizedContent|number|string)}>|null|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */

        var query = soy.asserts.assertType(opt_data.query == null || goog.isString(opt_data.query) || opt_data.query instanceof goog.soy.data.SanitizedContent, 'query', opt_data.query, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @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 _toggleInvitation = opt_data._toggleInvitation;
        /** @type {*|null|undefined} */

        var _handleInputBox = opt_data._handleInputBox;
        /** @type {*|null|undefined} */

        var _handleFormSubmit = opt_data._handleFormSubmit;
        var formattedQuery__soy4950 = '';
        formattedQuery__soy4950 += query != null ? query : '';
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'user-invitation-wrapper');
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'autocomplete-input user-invitation__input');
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'autocomplete-input__icon');
        incrementalDom.elementOpenEnd();
        $templateAlias1({
          spritemap: spritemap,
          symbol: 'search'
        }, null, opt_ijData);
        incrementalDom.elementClose('div');
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'autocomplete-input__wrapper');
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'autocomplete-input__content');
        incrementalDom.elementOpenEnd();

        if (addedUsers != null) {
          var addedUser4975List = addedUsers;
          var addedUser4975ListLen = addedUser4975List.length;

          for (var addedUser4975Index = 0; addedUser4975Index < addedUser4975ListLen; addedUser4975Index++) {
            var addedUser4975Data = addedUser4975List[addedUser4975Index];
            $templateAlias2({
              events: {
                removeItem: _toggleInvitation
              },
              userId: addedUser4975Data.userId,
              email: addedUser4975Data.email,
              name: addedUser4975Data.name,
              thumbnail: addedUser4975Data.thumbnail,
              spritemap: spritemap
            }, null, opt_ijData);
          }
        }

        incrementalDom.elementOpenStart('form');
        incrementalDom.attr('data-onsubmit', _handleFormSubmit);
        incrementalDom.attr('ref', 'form');
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('input');
        incrementalDom.attr('class', 'autocomplete-input__box');
        incrementalDom.attr('type', 'text');
        incrementalDom.attr('value', formattedQuery__soy4950);
        incrementalDom.attr('data-onkeyup', _handleInputBox);
        incrementalDom.elementOpenEnd();
        incrementalDom.elementClose('input');
        incrementalDom.elementClose('form');
        incrementalDom.elementClose('div');
        incrementalDom.elementClose('div');
        incrementalDom.elementClose('div');
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'user-invitation__list');
        incrementalDom.elementOpenEnd();

        if (users != null && users.length > 0) {
          var user4998List = users;
          var user4998ListLen = user4998List.length;

          for (var user4998Index = 0; user4998Index < user4998ListLen; user4998Index++) {
            var user4998Data = user4998List[user4998Index];
            $templateAlias3({
              events: {
                toggleInvitation: _toggleInvitation
              },
              userId: user4998Data.userId,
              name: user4998Data.name,
              email: user4998Data.email,
              thumbnail: user4998Data.thumbnail,
              addedUsers: addedUsers,
              query: formattedQuery__soy4950
            }, null, opt_ijData);
          }
        }

        if (users != null && users.length == 0 && formattedQuery__soy4950 != '') {
          $templateAlias3({
            events: {
              toggleInvitation: _toggleInvitation
            },
            email: formattedQuery__soy4950,
            addedUsers: addedUsers
          }, null, opt_ijData);
        }

        incrementalDom.elementClose('div');
        incrementalDom.elementClose('div');
      }

      exports.render = $render;
      /**
       * @typedef {{
       *  users: (!Array<{email: (!goog.soy.data.SanitizedContent|string), name: (!goog.soy.data.SanitizedContent|string), thumbnail: (!goog.soy.data.SanitizedContent|string), userId: (!goog.soy.data.SanitizedContent|number|string)}>|null|undefined),
       *  addedUsers: (!Array<{email: (!goog.soy.data.SanitizedContent|string), name: (!goog.soy.data.SanitizedContent|string), thumbnail: (!goog.soy.data.SanitizedContent|string), userId: (!goog.soy.data.SanitizedContent|number|string)}>|null|undefined),
       *  query: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  spritemap: (!goog.soy.data.SanitizedContent|string),
       *  _toggleInvitation: (*|null|undefined),
       *  _handleInputBox: (*|null|undefined),
       *  _handleFormSubmit: (*|null|undefined)
       * }}
       */

      $render.Params;

      if (goog.DEBUG) {
        $render.soyTemplateName = 'UserInvitation.render';
      }

      exports.render.params = ["users", "addedUsers", "query", "spritemap", "_toggleInvitation", "_handleInputBox", "_handleFormSubmit"];
      exports.render.types = {
        "users": "list<[\n\t\tuserId: string | number,\n\t\tthumbnail: string,\n\t\tname: string,\n\t\temail: string\n\t]>",
        "addedUsers": "list<[\n\t\tuserId: string | number,\n\t\tthumbnail: string,\n\t\tname: string,\n\t\temail: string\n\t]>",
        "query": "string ",
        "spritemap": "string ",
        "_toggleInvitation": "any ",
        "_handleInputBox": "any ",
        "_handleFormSubmit": "any "
      };
      exports.templates = templates = exports;
      return exports;
    });

    var UserInvitation = /*#__PURE__*/function (_Component) {
      _inherits(UserInvitation, _Component);

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

        return _possibleConstructorReturn(this, _getPrototypeOf(UserInvitation).apply(this, arguments));
      }

      return UserInvitation;
    }(_metalComponent.default);

    exports.UserInvitation = UserInvitation;

    _metalSoy.default.register(UserInvitation, templates);

    var _default = templates;
    /* jshint ignore:end */

    exports.default = _default;
    //# sourceMappingURL=UserInvitation.soy.js.map
  }
});
//# sourceMappingURL=UserInvitation.soy.js.map