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

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

      goog.module('CommerceInputText.incrementaldom');

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

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

      goog.require('soy.asserts');

      var soyIdom = goog.require('soy.idom');
      /**
       * @param {{
       *  contextName: (!goog.soy.data.SanitizedContent|string),
       *  name: (!goog.soy.data.SanitizedContent|string),
       *  label: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  value: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  type: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  pattern: (!goog.soy.data.SanitizedContent|function()|null|string|undefined),
       *  required: (boolean|null|undefined),
       *  _handleInputKeyUp: (*|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 {!goog.soy.data.SanitizedContent|string} */

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

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

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

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

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

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

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

        var _handleInputKeyUp = opt_data._handleInputKeyUp;
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'commerce-input-text');
        incrementalDom.elementOpenEnd();

        if (label != null) {
          incrementalDom.elementOpenStart('label');
          incrementalDom.attr('for', contextName + '-' + name);
          incrementalDom.attr('class', 'commerce-modal__label');
          incrementalDom.elementOpenEnd();
          soyIdom.print(label);

          if (required) {
            incrementalDom.elementOpenStart('span');
            incrementalDom.attr('class', 'required-mark');
            incrementalDom.elementOpenEnd();
            incrementalDom.elementClose('span');
          }

          incrementalDom.elementClose('label');
        }

        var inputValue__soy2487 = '';
        inputValue__soy2487 += value != null ? value : '';
        var inputType__soy2498 = '';
        inputType__soy2498 += type != null ? type : 'text';

        var inputAttributes__soy2509 = function inputAttributes__soy2509() {
          incrementalDom.attr('type', inputType__soy2498);
          incrementalDom.attr('id', contextName + '-' + name);
          incrementalDom.attr('name', name);
          incrementalDom.attr('class', 'commerce-modal__input commerce-modal__input--with-margin');
          incrementalDom.attr('value', inputValue__soy2487);
          incrementalDom.attr('data-onkeyup', _handleInputKeyUp);

          if (pattern != null && required != '') {
            incrementalDom.attr('pattern', pattern);
          }

          if (required != null && required == true) {
            incrementalDom.attr('required', '');
          }
        };

        incrementalDom.elementOpenStart('input');
        inputAttributes__soy2509();
        incrementalDom.elementOpenEnd();
        incrementalDom.elementClose('input');
        incrementalDom.elementClose('div');
      }

      exports.render = $render;
      /**
       * @typedef {{
       *  contextName: (!goog.soy.data.SanitizedContent|string),
       *  name: (!goog.soy.data.SanitizedContent|string),
       *  label: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  value: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  type: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  pattern: (!goog.soy.data.SanitizedContent|function()|null|string|undefined),
       *  required: (boolean|null|undefined),
       *  _handleInputKeyUp: (*|null|undefined)
       * }}
       */

      $render.Params;

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

      exports.render.params = ["contextName", "name", "label", "value", "type", "pattern", "required", "_handleInputKeyUp"];
      exports.render.types = {
        "contextName": "string ",
        "name": "string ",
        "label": "string ",
        "value": "string ",
        "type": "string",
        "pattern": "html|string ",
        "required": "bool ",
        "_handleInputKeyUp": "any "
      };
      exports.templates = templates = exports;
      return exports;
    });

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

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

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

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

    exports.CommerceInputText = CommerceInputText;

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

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

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