Liferay.Loader.define("commerce-cart-taglib@4.0.14/add_to_cart/AddToCart.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.AddToCart = 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 AddToCart.soy.
      // Please don't edit this file by hand.

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

      goog.module('AddToCart.incrementaldom');

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

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

      goog.require('soy.asserts');

      var soyIdom = goog.require('soy.idom');
      /**
       * @param {{
       *  cpDefinitionId: (!goog.soy.data.SanitizedContent|string),
       *  cpInstanceId: (!goog.soy.data.SanitizedContent|string),
       *  id: (!goog.soy.data.SanitizedContent|string),
       *  label: (!goog.soy.data.SanitizedContent|string),
       *  elementClasses: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  _handleClick: (?)
       * }} 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 cpDefinitionId = soy.asserts.assertType(goog.isString(opt_data.cpDefinitionId) || opt_data.cpDefinitionId instanceof goog.soy.data.SanitizedContent, 'cpDefinitionId', opt_data.cpDefinitionId, '!goog.soy.data.SanitizedContent|string');
        /** @type {!goog.soy.data.SanitizedContent|string} */

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

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

        var _handleClick = opt_data._handleClick;

        incrementalDom.elementOpenStart('button');
        (function containerAttributes__soy10() {
          incrementalDom.attr('class', 'taglib-add-to-cart btn' + (elementClasses ? ' ' + elementClasses : ''));
          incrementalDom.attr('cp-definition-id', cpDefinitionId);
          incrementalDom.attr('cp-instance-id', cpInstanceId);

          if (cpInstanceId == '0') {
            incrementalDom.attr('disabled', 'true');
          }

          incrementalDom.attr('id', id);
          incrementalDom.attr('onclick', _handleClick);
          incrementalDom.attr('title', label);
          incrementalDom.attr('type', 'button');
        })();
        incrementalDom.elementOpenEnd();
        soyIdom.print(label);
        incrementalDom.elementClose('button');
      }

      exports.render = $render;
      /**
       * @typedef {{
       *  cpDefinitionId: (!goog.soy.data.SanitizedContent|string),
       *  cpInstanceId: (!goog.soy.data.SanitizedContent|string),
       *  id: (!goog.soy.data.SanitizedContent|string),
       *  label: (!goog.soy.data.SanitizedContent|string),
       *  elementClasses: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  _handleClick: (?)
       * }}
       */

      $render.Params;

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

      exports.render.params = ["cpDefinitionId", "cpInstanceId", "id", "label", "elementClasses", "_handleClick"];
      exports.render.types = {
        "cpDefinitionId": "string",
        "cpInstanceId": "string",
        "id": "string",
        "label": "string",
        "elementClasses": "string",
        "_handleClick": "?"
      };
      exports.templates = templates = exports;
      return exports;
    });

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

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

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

      return AddToCart;
    }(_metalComponent.default);

    exports.AddToCart = AddToCart;

    _metalSoy.default.register(AddToCart, templates);

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

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