Liferay.Loader.define("commerce-frontend-taglib@10.1.5/user_utils/UserListItem.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.UserListItem = 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 UserListItem.soy.
      // Please don't edit this file by hand.

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

      goog.module('UserListItem.incrementaldom');

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

      goog.require('goog.string');

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

      goog.require('soy.asserts');

      goog.require('soy.idom');

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

      var $templateAlias1 = _metalSoy.default.getTemplate('AutocompleteItem.incrementaldom', 'render');
      /**
       * @param {{
       *  email: (!goog.soy.data.SanitizedContent|string),
       *  name: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  query: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  thumbnail: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  _invited: (boolean|null|undefined),
       *  _status: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  _handleToggleInvitation: (?)
       * }} 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 {!goog.soy.data.SanitizedContent|string} */

        var email = soy.asserts.assertType(goog.isString(opt_data.email) || opt_data.email instanceof goog.soy.data.SanitizedContent, 'email', opt_data.email, '!goog.soy.data.SanitizedContent|string');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */

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

        var thumbnail = soy.asserts.assertType(opt_data.thumbnail == null || goog.isString(opt_data.thumbnail) || opt_data.thumbnail instanceof goog.soy.data.SanitizedContent, 'thumbnail', opt_data.thumbnail, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {boolean|null|undefined} */

        var _invited = soy.asserts.assertType(opt_data._invited == null || goog.isBoolean(opt_data._invited) || opt_data._invited === 1 || opt_data._invited === 0, '_invited', opt_data._invited, 'boolean|null|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */

        var _status = soy.asserts.assertType(opt_data._status == null || goog.isString(opt_data._status) || opt_data._status instanceof goog.soy.data.SanitizedContent, '_status', opt_data._status, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {?} */

        var _handleToggleInvitation = opt_data._handleToggleInvitation;
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'user-item');
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'user-item__content');
        incrementalDom.elementOpenEnd();

        if (thumbnail != null) {
          incrementalDom.elementOpenStart('div');
          incrementalDom.attr('class', 'user-item__thumbnail');
          incrementalDom.elementOpenEnd();
          incrementalDom.elementOpenStart('img');
          incrementalDom.attr('src', thumbnail);
          incrementalDom.elementOpenEnd();
          incrementalDom.elementClose('img');
          incrementalDom.elementClose('div');
        }

        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'user-item__info');
        incrementalDom.elementOpenEnd();

        if (name != null) {
          incrementalDom.elementOpenStart('span');
          incrementalDom.attr('class', 'user-item__primary');
          incrementalDom.elementOpenEnd();
          $templateAlias1({
            text: name,
            query: query
          }, null, opt_ijData);
          incrementalDom.elementClose('span');
          incrementalDom.elementOpenStart('span');
          incrementalDom.attr('class', 'user-item__secondary');
          incrementalDom.elementOpenEnd();
          $templateAlias1({
            text: email,
            query: query
          }, null, opt_ijData);
          incrementalDom.elementClose('span');
        } else {
          incrementalDom.elementOpenStart('span');
          incrementalDom.attr('class', 'user-item__primary');
          incrementalDom.elementOpenEnd();
          $templateAlias1({
            text: email,
            query: query
          }, null, opt_ijData);
          incrementalDom.elementClose('span');
          incrementalDom.elementOpenStart('span');
          incrementalDom.attr('class', 'user-item__secondary');
          incrementalDom.elementOpenEnd();
          var $tmp = _status;

          switch (goog.isObject($tmp) ? $tmp.toString() : $tmp) {
            case 'user-not-found':
              /** @desc User not found. You could invite a new user by typing his/her email address. */
              var MSG_EXTERNAL_7888170205792139533 = Liferay.Language.get('user-not-found-you-could-invite-a-new-user');
              incrementalDom.text(goog.string.unescapeEntities(MSG_EXTERNAL_7888170205792139533));
              break;

            case 'email-not-valid':
              /** @desc Please add a valid email address. */
              var MSG_EXTERNAL_2064066333055348042 = Liferay.Language.get('please-add-a-valid-email-address');
              incrementalDom.text(goog.string.unescapeEntities(MSG_EXTERNAL_2064066333055348042));
              break;

            case 'valid':
              /** @desc Click to add to your organization. */
              var MSG_EXTERNAL_3345097235816056892 = Liferay.Language.get('click-to-add-to-your-organization');
              incrementalDom.text(goog.string.unescapeEntities(MSG_EXTERNAL_3345097235816056892));
              break;

            default:
          }

          incrementalDom.elementClose('span');
        }

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

        if (_status == 'valid') {
          incrementalDom.elementOpenStart('button');
          incrementalDom.attr('class', 'user-item__action');
          incrementalDom.attr('data-onclick', _handleToggleInvitation);
          incrementalDom.elementOpenEnd();
          $templateAlias2({
            added: _invited
          }, null, opt_ijData);
          incrementalDom.elementClose('button');
        }

        incrementalDom.elementClose('div');
      }

      exports.render = $render;
      /**
       * @typedef {{
       *  email: (!goog.soy.data.SanitizedContent|string),
       *  name: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  query: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  thumbnail: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  _invited: (boolean|null|undefined),
       *  _status: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  _handleToggleInvitation: (?)
       * }}
       */

      $render.Params;

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

      exports.render.params = ["email", "name", "query", "thumbnail", "_invited", "_status", "_handleToggleInvitation"];
      exports.render.types = {
        "email": "string ",
        "name": "string ",
        "query": "string ",
        "thumbnail": "string ",
        "_invited": "bool ",
        "_status": "string",
        "_handleToggleInvitation": "?"
      };
      exports.templates = templates = exports;
      return exports;
    });

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

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

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

      return UserListItem;
    }(_metalComponent.default);

    exports.UserListItem = UserListItem;

    _metalSoy.default.register(UserListItem, templates);

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

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