Liferay.Loader.define("flags-taglib@5.0.21/flags/soy/Flags.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.Flags = 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 Flags.soy.
      // Please don't edit this file by hand.

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

      goog.module('Flags.incrementaldom');

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

      goog.require('goog.string');

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

      goog.require('soy');

      goog.require('soy.asserts');

      var soyIdom = goog.require('soy.idom');

      var $templateAlias1 = _metalSoy["default"].getTemplate('ClayButton.incrementaldom', 'render');

      var $templateAlias2 = _metalSoy["default"].getTemplate('liferay.frontend.Modal.incrementaldom', 'render');
      /**
       * @param {{
       *  companyName: (!goog.soy.data.SanitizedContent|string),
       *  enabled: boolean,
       *  flagsEnabled: boolean,
       *  id: (!goog.soy.data.SanitizedContent|string),
       *  label: boolean,
       *  message: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  pathTermsOfUse: (!goog.soy.data.SanitizedContent|string),
       *  pathThemeImages: (!goog.soy.data.SanitizedContent|string),
       *  portletNamespace: (!goog.soy.data.SanitizedContent|string),
       *  reasons: (?),
       *  signedIn: boolean,
       *  _handleCloseDialogClick: (*|null|undefined),
       *  _handleFlagButtonClick: (*|null|undefined),
       *  _handleReasonChange: (*|null|undefined),
       *  _handleReportButtonClick: (*|null|undefined),
       *  _reportDialogOpen: (boolean|null|undefined),
       *  _selectedReason: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  _showConfirmationMessage: (boolean|null|undefined),
       *  _showErrorMessage: (boolean|null|undefined),
       *  elementClasses: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  reporterEmailAddress: (!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 $render(opt_data, opt_ijData, opt_ijData_deprecated) {
        opt_ijData = opt_ijData_deprecated || opt_ijData;
        /** @type {!goog.soy.data.SanitizedContent|string} */

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

        var enabled = soy.asserts.assertType(goog.isBoolean(opt_data.enabled) || opt_data.enabled === 1 || opt_data.enabled === 0, 'enabled', opt_data.enabled, 'boolean');
        /** @type {boolean} */

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

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

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

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

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

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

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

        var reasons = opt_data.reasons;
        /** @type {boolean} */

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

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

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

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

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

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

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

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

        var _showErrorMessage = soy.asserts.assertType(opt_data._showErrorMessage == null || goog.isBoolean(opt_data._showErrorMessage) || opt_data._showErrorMessage === 1 || opt_data._showErrorMessage === 0, '_showErrorMessage', opt_data._showErrorMessage, '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 {!goog.soy.data.SanitizedContent|null|string|undefined} */

        var reporterEmailAddress = soy.asserts.assertType(opt_data.reporterEmailAddress == null || goog.isString(opt_data.reporterEmailAddress) || opt_data.reporterEmailAddress instanceof goog.soy.data.SanitizedContent, 'reporterEmailAddress', opt_data.reporterEmailAddress, '!goog.soy.data.SanitizedContent|null|string|undefined');

        var spritemap__soy34 = pathThemeImages + '/clay/icons.svg';
        incrementalDom.elementOpenStart('div');
        (function containerAttributes__soy25() {
          incrementalDom.attr('class', 'taglib-flags' + (elementClasses ? ' $elementClasses' : ''));
          incrementalDom.attr('id', id);
        })();
        incrementalDom.elementOpenEnd();
        $flagIcon({
          _handleFlagButtonClick: _handleFlagButtonClick,
          enabled: enabled,
          label: label,
          message: message,
          spritemap: spritemap__soy34
        }, null, opt_ijData);

        if (_reportDialogOpen) {
          $reportDialog({
            _handleCloseDialogClick: _handleCloseDialogClick,
            _handleReasonChange: _handleReasonChange,
            _handleReportButtonClick: _handleReportButtonClick,
            _selectedReason: _selectedReason,
            _showConfirmationMessage: _showConfirmationMessage,
            _showErrorMessage: _showErrorMessage,
            companyName: companyName,
            flagsEnabled: flagsEnabled,
            pathTermsOfUse: pathTermsOfUse,
            pathThemeImages: pathThemeImages,
            portletNamespace: portletNamespace,
            reasons: reasons,
            reporterEmailAddress: reporterEmailAddress,
            signedIn: signedIn,
            spritemap: spritemap__soy34
          }, null, opt_ijData);
        }

        incrementalDom.elementClose('div');
      }

      exports.render = $render;
      /**
       * @typedef {{
       *  companyName: (!goog.soy.data.SanitizedContent|string),
       *  enabled: boolean,
       *  flagsEnabled: boolean,
       *  id: (!goog.soy.data.SanitizedContent|string),
       *  label: boolean,
       *  message: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  pathTermsOfUse: (!goog.soy.data.SanitizedContent|string),
       *  pathThemeImages: (!goog.soy.data.SanitizedContent|string),
       *  portletNamespace: (!goog.soy.data.SanitizedContent|string),
       *  reasons: (?),
       *  signedIn: boolean,
       *  _handleCloseDialogClick: (*|null|undefined),
       *  _handleFlagButtonClick: (*|null|undefined),
       *  _handleReasonChange: (*|null|undefined),
       *  _handleReportButtonClick: (*|null|undefined),
       *  _reportDialogOpen: (boolean|null|undefined),
       *  _selectedReason: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  _showConfirmationMessage: (boolean|null|undefined),
       *  _showErrorMessage: (boolean|null|undefined),
       *  elementClasses: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  reporterEmailAddress: (!goog.soy.data.SanitizedContent|null|string|undefined)
       * }}
       */

      $render.Params;

      if (goog.DEBUG) {
        $render.soyTemplateName = 'Flags.render';
      }
      /**
       * @param {{
       *  _handleFlagButtonClick: (*|null|undefined),
       *  enabled: (boolean|null|undefined),
       *  label: boolean,
       *  message: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  spritemap: (!goog.soy.data.SanitizedContent|string)
       * }} opt_data
       * @param {Object<string, *>=} opt_ijData
       * @param {Object<string, *>=} opt_ijData_deprecated
       * @return {void}
       * @suppress {checkTypes}
       */

      function $flagIcon(opt_data, opt_ijData, opt_ijData_deprecated) {
        opt_ijData = opt_ijData_deprecated || opt_ijData;
        /** @type {*|null|undefined} */

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

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

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

        var message = soy.asserts.assertType(opt_data.message == null || goog.isString(opt_data.message) || opt_data.message instanceof goog.soy.data.SanitizedContent, 'message', opt_data.message, '!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');
        var msg_12022__soy12023 = '';
        /** @desc  */

        var MSG_EXTERNAL_1444501656744347415 = Liferay.Language.get('report');
        msg_12022__soy12023 += MSG_EXTERNAL_1444501656744347415;
        var defaultMessage__soy73 = '';
        defaultMessage__soy73 += msg_12022__soy12023;
        var labelMessage__soy80 = message == null ? defaultMessage__soy73 : message;

        incrementalDom.elementOpenStart('span');
        (function wrapperAttributes__soy82() {
          if (!label) {
            incrementalDom.attr('class', 'lfr-portal-tooltip');
            incrementalDom.attr('title', labelMessage__soy80);
          }
        })();
        incrementalDom.elementOpenEnd();
        $templateAlias1({
          ariaLabel: labelMessage__soy80,
          elementClasses: 'btn-outline-borderless btn-outline-secondary',
          events: {
            click: _handleFlagButtonClick
          },
          disabled: !enabled,
          icon: 'flag-empty',
          label: label ? labelMessage__soy80 : null,
          monospaced: !label,
          size: 'sm',
          spritemap: spritemap,
          style: false,
          type: 'button'
        }, null, opt_ijData);
        incrementalDom.elementClose('span');
      }

      exports.flagIcon = $flagIcon;
      /**
       * @typedef {{
       *  _handleFlagButtonClick: (*|null|undefined),
       *  enabled: (boolean|null|undefined),
       *  label: boolean,
       *  message: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  spritemap: (!goog.soy.data.SanitizedContent|string)
       * }}
       */

      $flagIcon.Params;

      if (goog.DEBUG) {
        $flagIcon.soyTemplateName = 'Flags.flagIcon';
      }
      /**
       * @param {{
       *  companyName: (!goog.soy.data.SanitizedContent|string),
       *  flagsEnabled: boolean,
       *  pathTermsOfUse: (!goog.soy.data.SanitizedContent|string),
       *  pathThemeImages: (!goog.soy.data.SanitizedContent|string),
       *  portletNamespace: (!goog.soy.data.SanitizedContent|string),
       *  reasons: (?),
       *  signedIn: boolean,
       *  spritemap: (!goog.soy.data.SanitizedContent|string),
       *  _handleCloseDialogClick: (*|null|undefined),
       *  _handleReasonChange: (*|null|undefined),
       *  _handleReportButtonClick: (*|null|undefined),
       *  _selectedReason: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  _showConfirmationMessage: (boolean|null|undefined),
       *  _showErrorMessage: (boolean|null|undefined),
       *  reporterEmailAddress: (!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 $reportDialog(opt_data, opt_ijData, opt_ijData_deprecated) {
        opt_ijData = opt_ijData_deprecated || opt_ijData;
        /** @type {!goog.soy.data.SanitizedContent|string} */

        soy.asserts.assertType(goog.isString(opt_data.companyName) || opt_data.companyName instanceof goog.soy.data.SanitizedContent, 'companyName', opt_data.companyName, '!goog.soy.data.SanitizedContent|string');

        /** @type {boolean} */

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

        soy.asserts.assertType(goog.isString(opt_data.pathTermsOfUse) || opt_data.pathTermsOfUse instanceof goog.soy.data.SanitizedContent, 'pathTermsOfUse', opt_data.pathTermsOfUse, '!goog.soy.data.SanitizedContent|string');
        soy.asserts.assertType(goog.isString(opt_data.pathThemeImages) || opt_data.pathThemeImages instanceof goog.soy.data.SanitizedContent, 'pathThemeImages', opt_data.pathThemeImages, '!goog.soy.data.SanitizedContent|string');
        soy.asserts.assertType(goog.isString(opt_data.portletNamespace) || opt_data.portletNamespace instanceof goog.soy.data.SanitizedContent, 'portletNamespace', opt_data.portletNamespace, '!goog.soy.data.SanitizedContent|string');
        opt_data.reasons;

        /** @type {boolean} */

        var signedIn = soy.asserts.assertType(goog.isBoolean(opt_data.signedIn) || opt_data.signedIn === 1 || opt_data.signedIn === 0, 'signedIn', opt_data.signedIn, 'boolean');
        /** @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 _handleCloseDialogClick = opt_data._handleCloseDialogClick;
        /** @type {*|null|undefined} */

        opt_data._handleReasonChange;

        /** @type {*|null|undefined} */

        var _handleReportButtonClick = opt_data._handleReportButtonClick;
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */

        soy.asserts.assertType(opt_data._selectedReason == null || goog.isString(opt_data._selectedReason) || opt_data._selectedReason instanceof goog.soy.data.SanitizedContent, '_selectedReason', opt_data._selectedReason, '!goog.soy.data.SanitizedContent|null|string|undefined');

        /** @type {boolean|null|undefined} */

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

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

        soy.asserts.assertType(opt_data.reporterEmailAddress == null || goog.isString(opt_data.reporterEmailAddress) || opt_data.reporterEmailAddress instanceof goog.soy.data.SanitizedContent, 'reporterEmailAddress', opt_data.reporterEmailAddress, '!goog.soy.data.SanitizedContent|null|string|undefined');


        var param124 = function param124() {
          if (flagsEnabled) {
            if (_showErrorMessage) {
              $errorMessage(null, null, opt_ijData);
            } else if (_showConfirmationMessage) {
              $confirmationMessage(opt_data, null, opt_ijData);
            } else {
              $reportForm(opt_data, null, opt_ijData);
            }
          } else {
            incrementalDom.elementOpen('p');
            /** @desc  */

            var MSG_EXTERNAL_838765900637014492 = Liferay.Language.get('please-sign-in-to-flag-this-as-inappropriate');
            incrementalDom.text(goog.string.unescapeEntities(MSG_EXTERNAL_838765900637014492));
            incrementalDom.elementClose('p');
          }
        };

        $templateAlias2({
          body: param124,
          dialogClasses: 'modal-dialog-sm',
          events: {
            hide: _handleCloseDialogClick
          },
          footer: function param161() {
            if (!(_showConfirmationMessage || _showErrorMessage || !signedIn && !flagsEnabled)) {
              incrementalDom.elementOpenStart('button');
              incrementalDom.attr('class', 'btn btn-primary');
              incrementalDom.attr('data-onclick', _handleReportButtonClick);
              incrementalDom.attr('type', 'button');
              incrementalDom.elementOpenEnd();
              /** @desc  */

              var MSG_EXTERNAL_1444501656744347415 = Liferay.Language.get('report');
              incrementalDom.text(goog.string.unescapeEntities(MSG_EXTERNAL_1444501656744347415));
              incrementalDom.elementClose('button');
              incrementalDom.elementOpenStart('button');
              incrementalDom.attr('class', 'btn btn-link');
              incrementalDom.attr('data-onclick', 'hide');
              incrementalDom.attr('type', 'button');
              incrementalDom.elementOpenEnd();
              /** @desc  */

              var MSG_EXTERNAL_503445309622982213 = Liferay.Language.get('cancel');
              incrementalDom.text(goog.string.unescapeEntities(MSG_EXTERNAL_503445309622982213));
              incrementalDom.elementClose('button');
            } else {
              incrementalDom.elementOpenStart('button');
              incrementalDom.attr('class', 'btn btn-secondary');
              incrementalDom.attr('data-onclick', 'hide');
              incrementalDom.attr('type', 'button');
              incrementalDom.elementOpenEnd();
              /** @desc  */

              var MSG_EXTERNAL_202442244688100878 = Liferay.Language.get('close');
              incrementalDom.text(goog.string.unescapeEntities(MSG_EXTERNAL_202442244688100878));
              incrementalDom.elementClose('button');
            }
          },
          header: function param183() {
            /** @desc  */
            var MSG_EXTERNAL_3184499331209924498 = Liferay.Language.get('report-inappropriate-content');
            incrementalDom.text(goog.string.unescapeEntities(MSG_EXTERNAL_3184499331209924498));
          },
          ref: 'modal',
          spritemap: spritemap
        }, null, opt_ijData);
      }

      exports.reportDialog = $reportDialog;
      /**
       * @typedef {{
       *  companyName: (!goog.soy.data.SanitizedContent|string),
       *  flagsEnabled: boolean,
       *  pathTermsOfUse: (!goog.soy.data.SanitizedContent|string),
       *  pathThemeImages: (!goog.soy.data.SanitizedContent|string),
       *  portletNamespace: (!goog.soy.data.SanitizedContent|string),
       *  reasons: (?),
       *  signedIn: boolean,
       *  spritemap: (!goog.soy.data.SanitizedContent|string),
       *  _handleCloseDialogClick: (*|null|undefined),
       *  _handleReasonChange: (*|null|undefined),
       *  _handleReportButtonClick: (*|null|undefined),
       *  _selectedReason: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  _showConfirmationMessage: (boolean|null|undefined),
       *  _showErrorMessage: (boolean|null|undefined),
       *  reporterEmailAddress: (!goog.soy.data.SanitizedContent|null|string|undefined)
       * }}
       */

      $reportDialog.Params;

      if (goog.DEBUG) {
        $reportDialog.soyTemplateName = 'Flags.reportDialog';
      }
      /**
       * @param {{
       *  pathTermsOfUse: (!goog.soy.data.SanitizedContent|string),
       *  pathThemeImages: (!goog.soy.data.SanitizedContent|string),
       *  portletNamespace: (!goog.soy.data.SanitizedContent|string),
       *  reasons: (?),
       *  signedIn: boolean,
       *  _handleReasonChange: (*|null|undefined),
       *  _selectedReason: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  reporterEmailAddress: (!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 $reportForm(opt_data, opt_ijData, opt_ijData_deprecated) {
        opt_ijData = opt_ijData_deprecated || opt_ijData;
        /** @type {!goog.soy.data.SanitizedContent|string} */

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

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

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

        var reasons = opt_data.reasons;
        /** @type {boolean} */

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

        var _handleReasonChange = opt_data._handleReasonChange;
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */

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

        var reporterEmailAddress = soy.asserts.assertType(opt_data.reporterEmailAddress == null || goog.isString(opt_data.reporterEmailAddress) || opt_data.reporterEmailAddress instanceof goog.soy.data.SanitizedContent, 'reporterEmailAddress', opt_data.reporterEmailAddress, '!goog.soy.data.SanitizedContent|null|string|undefined');
        incrementalDom.elementOpenStart('form');
        incrementalDom.attr('class', 'container-fluid-1280');
        incrementalDom.attr('method', 'post');
        incrementalDom.attr('name', portletNamespace + 'flagsForm');
        incrementalDom.attr('ref', 'form');
        incrementalDom.elementOpenEnd();

        var termsOfUse__soy205 = function termsOfUse__soy205() {
          incrementalDom.elementOpenStart('a');
          incrementalDom.attr('href', pathTermsOfUse);
          incrementalDom.attr('target', '_blank');
          incrementalDom.elementOpenEnd();
          /** @desc  */

          var MSG_EXTERNAL_2898360495953199567 = Liferay.Language.get('terms-of-use');
          incrementalDom.text(goog.string.unescapeEntities(MSG_EXTERNAL_2898360495953199567));
          incrementalDom.elementClose('a');
        };

        incrementalDom.elementOpen('p');
        /** @desc  */

        var MSG_EXTERNAL_6047645258311882210 = Liferay.Language.get('you-are-about-to-report-a-violation-of-our-x.-all-reports-are-strictly-confidential');
        MSG_EXTERNAL_6047645258311882210 = MSG_EXTERNAL_6047645258311882210.replace(/{(\d+)}/g, '\x01$1\x01');
        var lastIndex_214 = 0,
            partRe_214 = /\x01\d+\x01/g,
            match_214;

        do {
          match_214 = partRe_214.exec(MSG_EXTERNAL_6047645258311882210) || undefined;
          incrementalDom.text(goog.string.unescapeEntities(MSG_EXTERNAL_6047645258311882210.substring(lastIndex_214, match_214 && match_214.index)));
          lastIndex_214 = partRe_214.lastIndex;

          switch (match_214 && match_214[0]) {
            case "\x010\x01":
              termsOfUse__soy205();
              break;
          }
        } while (match_214);

        incrementalDom.elementClose('p');
        incrementalDom.elementOpen('fieldset');
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'form-group');
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('label');
        incrementalDom.attr('class', 'control-label');
        incrementalDom.attr('for', portletNamespace + 'reason');
        incrementalDom.elementOpenEnd();
        /** @desc  */

        var MSG_EXTERNAL_3195600027717448019 = Liferay.Language.get('reason-for-the-report');
        incrementalDom.text(goog.string.unescapeEntities(MSG_EXTERNAL_3195600027717448019));
        incrementalDom.elementClose('label');
        incrementalDom.elementOpenStart('select');
        incrementalDom.attr('class', 'form-control');
        incrementalDom.attr('data-onchange', _handleReasonChange);
        incrementalDom.attr('name', portletNamespace + 'reason');
        incrementalDom.attr('ref', 'reason');
        incrementalDom.elementOpenEnd();
        var key238List = soy.$$getMapKeys(reasons);
        var key238ListLen = key238List.length;

        for (var key238Index = 0; key238Index < key238ListLen; key238Index++) {
          var key238Data = key238List[key238Index];
          var reason__soy232 = reasons[key238Data];
          incrementalDom.elementOpenStart('option');
          incrementalDom.attr('value', key238Data);
          incrementalDom.elementOpenEnd();
          soyIdom.print(reason__soy232);
          incrementalDom.elementClose('option');
        }

        incrementalDom.elementOpenStart('option');
        incrementalDom.attr('value', 'other');
        incrementalDom.elementOpenEnd();
        /** @desc  */

        var MSG_EXTERNAL_3755260999292791485 = Liferay.Language.get('other-reason');
        incrementalDom.text(goog.string.unescapeEntities(MSG_EXTERNAL_3755260999292791485));
        incrementalDom.elementClose('option');
        incrementalDom.elementClose('select');
        incrementalDom.elementClose('div');

        if (_selectedReason == 'other') {
          incrementalDom.elementOpen('span');
          incrementalDom.elementOpenStart('div');
          incrementalDom.attr('class', 'form-group');
          incrementalDom.elementOpenEnd();
          incrementalDom.elementOpenStart('label');
          incrementalDom.attr('class', 'control-label');
          incrementalDom.attr('for', portletNamespace + 'otherReason');
          incrementalDom.elementOpenEnd();
          /** @desc  */

          var MSG_EXTERNAL_3755260999292791485$$1 = Liferay.Language.get('other-reason');
          incrementalDom.text(goog.string.unescapeEntities(MSG_EXTERNAL_3755260999292791485$$1));
          incrementalDom.elementClose('label');
          incrementalDom.elementOpenStart('input');
          incrementalDom.attr('class', 'form-control');
          incrementalDom.attr('name', portletNamespace + 'otherReason');
          incrementalDom.attr('ref', 'otherReason');
          incrementalDom.elementOpenEnd();
          incrementalDom.elementClose('input');
          incrementalDom.elementClose('div');
          incrementalDom.elementClose('span');
        }

        if (signedIn) {
          incrementalDom.elementOpenStart('input');
          incrementalDom.attr('name', portletNamespace + 'reporterEmailAddress');
          incrementalDom.attr('ref', 'reporterEmailAddress');
          incrementalDom.attr('type', 'hidden');
          incrementalDom.attr('value', reporterEmailAddress);
          incrementalDom.elementOpenEnd();
          incrementalDom.elementClose('input');
        } else {
          incrementalDom.elementOpenStart('label');
          incrementalDom.attr('class', 'control-label');
          incrementalDom.attr('for', portletNamespace + 'reporterEmailAddress');
          incrementalDom.elementOpenEnd();
          /** @desc  */

          var MSG_EXTERNAL_3202415828065565502 = Liferay.Language.get('email-address');
          incrementalDom.text(goog.string.unescapeEntities(MSG_EXTERNAL_3202415828065565502));
          incrementalDom.elementOpenStart('span');
          incrementalDom.attr('class', 'reference-mark text-warning');
          incrementalDom.elementOpenEnd();
          incrementalDom.elementOpenStart('svg');
          incrementalDom.attr('class', 'lexicon-icon');
          incrementalDom.elementOpenEnd();
          incrementalDom.elementOpenStart('use');
          incrementalDom.attr('xlink:href', pathThemeImages + '/clay/icons.svg#asterisk');
          incrementalDom.elementOpenEnd();
          incrementalDom.elementClose('use');
          incrementalDom.elementClose('svg');
          incrementalDom.elementClose('span');
          incrementalDom.elementClose('label');
          incrementalDom.elementOpenStart('input');
          incrementalDom.attr('class', 'form-control');
          incrementalDom.attr('name', portletNamespace + 'reporterEmailAddress');
          incrementalDom.attr('ref', 'reporterEmailAddress');
          incrementalDom.attr('required', '');
          incrementalDom.attr('type', 'email');
          incrementalDom.elementOpenEnd();
          incrementalDom.elementClose('input');
        }

        incrementalDom.elementClose('fieldset');
        incrementalDom.elementClose('form');
      }

      exports.reportForm = $reportForm;
      /**
       * @typedef {{
       *  pathTermsOfUse: (!goog.soy.data.SanitizedContent|string),
       *  pathThemeImages: (!goog.soy.data.SanitizedContent|string),
       *  portletNamespace: (!goog.soy.data.SanitizedContent|string),
       *  reasons: (?),
       *  signedIn: boolean,
       *  _handleReasonChange: (*|null|undefined),
       *  _selectedReason: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  reporterEmailAddress: (!goog.soy.data.SanitizedContent|null|string|undefined)
       * }}
       */

      $reportForm.Params;

      if (goog.DEBUG) {
        $reportForm.soyTemplateName = 'Flags.reportForm';
      }
      /**
       * @param {{
       *  companyName: (!goog.soy.data.SanitizedContent|string)
       * }} opt_data
       * @param {Object<string, *>=} opt_ijData
       * @param {Object<string, *>=} opt_ijData_deprecated
       * @return {void}
       * @suppress {checkTypes}
       */

      function $confirmationMessage(opt_data, opt_ijData, opt_ijData_deprecated) {
        opt_ijData = opt_ijData_deprecated || opt_ijData;
        /** @type {!goog.soy.data.SanitizedContent|string} */

        var companyName = soy.asserts.assertType(goog.isString(opt_data.companyName) || opt_data.companyName instanceof goog.soy.data.SanitizedContent, 'companyName', opt_data.companyName, '!goog.soy.data.SanitizedContent|string');
        incrementalDom.elementOpen('p');
        incrementalDom.elementOpen('strong');
        /** @desc  */

        var MSG_EXTERNAL_2297162991583584523 = Liferay.Language.get('thank-you-for-your-report');
        incrementalDom.text(goog.string.unescapeEntities(MSG_EXTERNAL_2297162991583584523));
        incrementalDom.elementClose('strong');
        incrementalDom.elementClose('p');
        incrementalDom.elementOpen('p');
        /** @desc  */

        var MSG_EXTERNAL_3162499675646537356 = Liferay.Language.get('although-we-cannot-disclose-our-final-decision,-we-do-review-every-report-and-appreciate-your-effort-to-make-sure-x-is-a-safe-environment-for-everyone');
        MSG_EXTERNAL_3162499675646537356 = MSG_EXTERNAL_3162499675646537356.replace(/{(\d+)}/g, '\x01$1\x01');
        var lastIndex_285 = 0,
            partRe_285 = /\x01\d+\x01/g,
            match_285;

        do {
          match_285 = partRe_285.exec(MSG_EXTERNAL_3162499675646537356) || undefined;
          incrementalDom.text(goog.string.unescapeEntities(MSG_EXTERNAL_3162499675646537356.substring(lastIndex_285, match_285 && match_285.index)));
          lastIndex_285 = partRe_285.lastIndex;

          switch (match_285 && match_285[0]) {
            case "\x010\x01":
              soyIdom.print(companyName);
              break;
          }
        } while (match_285);

        incrementalDom.elementClose('p');
      }

      exports.confirmationMessage = $confirmationMessage;
      /**
       * @typedef {{
       *  companyName: (!goog.soy.data.SanitizedContent|string)
       * }}
       */

      $confirmationMessage.Params;

      if (goog.DEBUG) {
        $confirmationMessage.soyTemplateName = 'Flags.confirmationMessage';
      }
      /**
       * @param {Object<string, *>=} opt_data
       * @param {Object<string, *>=} opt_ijData
       * @param {Object<string, *>=} opt_ijData_deprecated
       * @return {void}
       * @suppress {checkTypes}
       */

      function $errorMessage(opt_data, opt_ijData, opt_ijData_deprecated) {
        opt_ijData = opt_ijData_deprecated || opt_ijData;
        incrementalDom.elementOpen('p');
        incrementalDom.elementOpen('strong');
        /** @desc  */

        var MSG_EXTERNAL_7644181796194453889 = Liferay.Language.get('an-error-occurred-while-sending-the-report.-please-try-again-in-a-few-minutes');
        incrementalDom.text(goog.string.unescapeEntities(MSG_EXTERNAL_7644181796194453889));
        incrementalDom.elementClose('strong');
        incrementalDom.elementClose('p');
      }

      exports.errorMessage = $errorMessage;

      if (goog.DEBUG) {
        $errorMessage.soyTemplateName = 'Flags.errorMessage';
      }

      exports.render.params = ["companyName", "enabled", "flagsEnabled", "id", "label", "message", "pathTermsOfUse", "pathThemeImages", "portletNamespace", "reasons", "signedIn", "_handleCloseDialogClick", "_handleFlagButtonClick", "_handleReasonChange", "_handleReportButtonClick", "_reportDialogOpen", "_selectedReason", "_showConfirmationMessage", "_showErrorMessage", "elementClasses", "reporterEmailAddress"];
      exports.render.types = {
        "companyName": "string",
        "enabled": "bool",
        "flagsEnabled": "bool",
        "id": "string",
        "label": "bool",
        "message": "string|null",
        "pathTermsOfUse": "string",
        "pathThemeImages": "string",
        "portletNamespace": "string",
        "reasons": "?",
        "signedIn": "bool",
        "_handleCloseDialogClick": "any",
        "_handleFlagButtonClick": "any",
        "_handleReasonChange": "any",
        "_handleReportButtonClick": "any",
        "_reportDialogOpen": "bool",
        "_selectedReason": "string",
        "_showConfirmationMessage": "bool",
        "_showErrorMessage": "bool",
        "elementClasses": "string",
        "reporterEmailAddress": "string"
      };
      exports.flagIcon.params = ["_handleFlagButtonClick", "enabled", "label", "message", "spritemap"];
      exports.flagIcon.types = {
        "_handleFlagButtonClick": "any",
        "enabled": "bool",
        "label": "bool",
        "message": "string|null",
        "spritemap": "string"
      };
      exports.reportDialog.params = ["companyName", "flagsEnabled", "pathTermsOfUse", "pathThemeImages", "portletNamespace", "reasons", "signedIn", "spritemap", "_handleCloseDialogClick", "_handleReasonChange", "_handleReportButtonClick", "_selectedReason", "_showConfirmationMessage", "_showErrorMessage", "reporterEmailAddress"];
      exports.reportDialog.types = {
        "companyName": "string",
        "flagsEnabled": "bool",
        "pathTermsOfUse": "string",
        "pathThemeImages": "string",
        "portletNamespace": "string",
        "reasons": "?",
        "signedIn": "bool",
        "spritemap": "string",
        "_handleCloseDialogClick": "any",
        "_handleReasonChange": "any",
        "_handleReportButtonClick": "any",
        "_selectedReason": "string",
        "_showConfirmationMessage": "bool",
        "_showErrorMessage": "bool",
        "reporterEmailAddress": "string"
      };
      exports.reportForm.params = ["pathTermsOfUse", "pathThemeImages", "portletNamespace", "reasons", "signedIn", "_handleReasonChange", "_selectedReason", "reporterEmailAddress"];
      exports.reportForm.types = {
        "pathTermsOfUse": "string",
        "pathThemeImages": "string",
        "portletNamespace": "string",
        "reasons": "?",
        "signedIn": "bool",
        "_handleReasonChange": "any",
        "_selectedReason": "string",
        "reporterEmailAddress": "string"
      };
      exports.confirmationMessage.params = ["companyName"];
      exports.confirmationMessage.types = {
        "companyName": "string"
      };
      exports.errorMessage.params = [];
      exports.errorMessage.types = {};
      exports.templates = templates = exports;
      return exports;
    });

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

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

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

      return Flags;
    }(_metalComponent["default"]);

    exports.Flags = Flags;

    _metalSoy["default"].register(Flags, templates);

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

    exports["default"] = _default;
    //# sourceMappingURL=Flags.soy.js.map
  }
});
//# sourceMappingURL=Flags.soy.js.map