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

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

      goog.module('ProductDetailsModal.incrementaldom');

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

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

      goog.require('soy.asserts');

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

      var $templateAlias1 = _metalSoy.default.getTemplate('ClayModal.incrementaldom', 'render');
      /**
       * @param {{
       *  availability: (!goog.soy.data.SanitizedContent|string),
       *  sku: (!goog.soy.data.SanitizedContent|string),
       *  name: (!goog.soy.data.SanitizedContent|string),
       *  pictureUrl: (!goog.soy.data.SanitizedContent|string),
       *  detailsLink: (!goog.soy.data.SanitizedContent|string),
       *  categories: (!Array<{link: (!goog.soy.data.SanitizedContent|string), name: (!goog.soy.data.SanitizedContent|string)}>|null|undefined),
       *  description: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  addToOrderLink: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  settings: (null|undefined|{minQuantity: number}),
       *  _modalVisible: (boolean|null|undefined),
       *  _handleCloseModal: (*|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 availability = soy.asserts.assertType(goog.isString(opt_data.availability) || opt_data.availability instanceof goog.soy.data.SanitizedContent, 'availability', opt_data.availability, '!goog.soy.data.SanitizedContent|string');
        /** @type {!goog.soy.data.SanitizedContent|string} */

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

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

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

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

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

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

        var settings = soy.asserts.assertType(opt_data.settings == null || goog.isObject(opt_data.settings), 'settings', opt_data.settings, 'null|undefined|{minQuantity: number}');
        /** @type {boolean|null|undefined} */

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

        var _handleCloseModal = opt_data._handleCloseModal;
        var availabilityDotClasses__soy3151 = '';
        availabilityDotClasses__soy3151 += 'd-inline-block commerce-dot commerce-dot--';
        var $tmp = availability;

        switch (goog.isObject($tmp) ? $tmp.toString() : $tmp) {
          case 'inStock':
            availabilityDotClasses__soy3151 += 'good';
            break;

          case 'available':
            availabilityDotClasses__soy3151 += 'neutral';
            break;

          default:
            availabilityDotClasses__soy3151 += 'bad';
        }

        var body__soy3162 = function body__soy3162() {
          incrementalDom.elementOpenStart('div');
          incrementalDom.attr('class', 'commerce-modal');
          incrementalDom.elementOpenEnd();
          incrementalDom.elementOpenStart('div');
          incrementalDom.attr('class', 'commerce-modal__header');
          incrementalDom.elementOpenEnd();
          incrementalDom.elementOpenStart('button');
          incrementalDom.attr('class', 'commerce-modal__close');
          incrementalDom.attr('data-onclick', _handleCloseModal);
          incrementalDom.elementOpenEnd();
          incrementalDom.elementOpenStart('svg');
          incrementalDom.attr('class', 'commerce-icon');
          incrementalDom.attr('viewBox', '0 0 100 100');
          incrementalDom.attr('xmlns', 'http://www.w3.org/2000/svg');
          incrementalDom.elementOpenEnd();
          incrementalDom.elementOpenStart('rect');
          incrementalDom.attr('fill', 'currentColor');
          incrementalDom.attr('height', '90');
          incrementalDom.attr('rx', '10');
          incrementalDom.attr('ry', '10');
          incrementalDom.attr('width', '90');
          incrementalDom.attr('x', '5');
          incrementalDom.attr('y', '5');
          incrementalDom.elementOpenEnd();
          incrementalDom.elementClose('rect');
          incrementalDom.elementClose('svg');
          incrementalDom.elementClose('button');
          incrementalDom.elementClose('div');
          incrementalDom.elementOpenStart('div');
          incrementalDom.attr('class', 'commerce-product-details-modal__picture');
          incrementalDom.elementOpenEnd();
          incrementalDom.elementOpenStart('img');
          incrementalDom.attr('alt', name);
          incrementalDom.attr('src', pictureUrl);
          incrementalDom.elementOpenEnd();
          incrementalDom.elementClose('img');
          incrementalDom.elementClose('div');
          incrementalDom.elementOpenStart('div');
          incrementalDom.attr('class', 'commerce-product-details-modal__availability');
          incrementalDom.elementOpenEnd();
          incrementalDom.elementOpenStart('div');
          incrementalDom.attr('class', availabilityDotClasses__soy3151);
          incrementalDom.elementOpenEnd();
          incrementalDom.elementClose('div');
          incrementalDom.elementClose('div');
          incrementalDom.elementOpenStart('p');
          incrementalDom.attr('class', 'commerce-product-details-modal__sku');
          incrementalDom.elementOpenEnd();
          soyIdom.print(sku);
          incrementalDom.elementClose('p');

          if (settings != null && settings.minQuantity != null) {
            incrementalDom.elementOpenStart('span');
            incrementalDom.attr('class', 'commerce-product-details-modal__min-quantity');
            incrementalDom.elementOpenEnd();
            incrementalDom.text('Minimum quantity per order');
            incrementalDom.elementOpenStart('span');
            incrementalDom.attr('class', 'commerce-product-details-modal__min-quantity__value');
            incrementalDom.elementOpenEnd();
            soyIdom.print(settings.minQuantity != null);
            incrementalDom.elementClose('span');
            incrementalDom.elementClose('span');
          }

          incrementalDom.elementOpenStart('h3');
          incrementalDom.attr('class', 'commerce-product-details-modal__name');
          incrementalDom.elementOpenEnd();
          soyIdom.print(name);
          incrementalDom.elementClose('h3');

          if (categories != null && categories.length > 0) {
            incrementalDom.elementOpenStart('p');
            incrementalDom.attr('class', 'commerce-product-details-modal__categories');
            incrementalDom.elementOpenEnd();
            var category3194List = categories;
            var category3194ListLen = category3194List.length;

            for (var category3194Index = 0; category3194Index < category3194ListLen; category3194Index++) {
              var category3194Data = category3194List[category3194Index];

              if (category3194Index != 0) {
                incrementalDom.text(', ');
              }

              incrementalDom.elementOpenStart('a');
              incrementalDom.attr('href', category3194Data.link);
              incrementalDom.elementOpenEnd();
              soyIdom.print(category3194Data.name);
              incrementalDom.elementClose('a');
            }

            incrementalDom.elementClose('p');
          }

          if (description != null) {
            incrementalDom.elementOpenStart('p');
            incrementalDom.attr('class', 'commerce-product-details-modal__description');
            incrementalDom.elementOpenEnd();
            soyIdom.print(description);
            incrementalDom.elementClose('p');
          }

          incrementalDom.elementOpenStart('a');
          incrementalDom.attr('class', 'commerce-product-details-modal__view-details');
          incrementalDom.attr('href', detailsLink);
          incrementalDom.elementOpenEnd();
          incrementalDom.text('View product details');
          incrementalDom.elementClose('a');

          if (addToOrderLink != null) {
            incrementalDom.elementOpenStart('div');
            incrementalDom.attr('class', 'commerce-product-details-modal__add-to-order');
            incrementalDom.elementOpenEnd();
            incrementalDom.elementOpenStart('a');
            incrementalDom.attr('class', 'commerce-button');
            incrementalDom.attr('href', addToOrderLink);
            incrementalDom.elementOpenEnd();
            incrementalDom.text('Add to order');
            incrementalDom.elementClose('a');
            incrementalDom.elementClose('div');
          }

          incrementalDom.elementClose('div');
        };

        $templateAlias1({
          body: body__soy3162,
          visible: _modalVisible,
          ref: 'modal'
        }, null, opt_ijData);
      }

      exports.render = $render;
      /**
       * @typedef {{
       *  availability: (!goog.soy.data.SanitizedContent|string),
       *  sku: (!goog.soy.data.SanitizedContent|string),
       *  name: (!goog.soy.data.SanitizedContent|string),
       *  pictureUrl: (!goog.soy.data.SanitizedContent|string),
       *  detailsLink: (!goog.soy.data.SanitizedContent|string),
       *  categories: (!Array<{link: (!goog.soy.data.SanitizedContent|string), name: (!goog.soy.data.SanitizedContent|string)}>|null|undefined),
       *  description: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  addToOrderLink: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  settings: (null|undefined|{minQuantity: number}),
       *  _modalVisible: (boolean|null|undefined),
       *  _handleCloseModal: (*|null|undefined)
       * }}
       */

      $render.Params;

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

      exports.render.params = ["availability", "sku", "name", "pictureUrl", "detailsLink", "categories", "description", "addToOrderLink", "settings", "_modalVisible", "_handleCloseModal"];
      exports.render.types = {
        "availability": "string",
        "sku": "string",
        "name": "string",
        "pictureUrl": "string",
        "detailsLink": "string",
        "categories": "list<[\n\t\tname: string,\n\t\tlink: string\n\t]>",
        "description": "string",
        "addToOrderLink": "string",
        "settings": "[\n\t\tminQuantity: number\n\t]",
        "_modalVisible": "bool",
        "_handleCloseModal": "any"
      };
      exports.templates = templates = exports;
      return exports;
    });

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

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

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

      return ProductDetailsModal;
    }(_metalComponent.default);

    exports.ProductDetailsModal = ProductDetailsModal;

    _metalSoy.default.register(ProductDetailsModal, templates);

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

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