<%--
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * The contents of this file are subject to the terms of the Liferay Enterprise
 * Subscription License ("License"). You may not use this file except in
 * compliance with the License. You can obtain a copy of the License by
 * contacting Liferay, Inc. See the License for the specific language governing
 * permissions and limitations under the License, including but not limited to
 * distribution rights of the Software.
 *
 *
 *
 */
--%>

<%@ include file="/mini_cart/init.jsp" %>

<div class="cart-root" id="<%= miniCartId %>"></div>

<aui:script require="commerce-frontend-js/components/mini_cart/entry as Cart">
	var initialProps = {
		cartActionURLs: {
			checkoutURL: '<%= HtmlUtil.escapeJS(checkoutURL) %>',
			orderDetailURL: '<%= HtmlUtil.escapeJS(orderDetailURL) %>',
		},
		displayDiscountLevels: <%= displayDiscountLevels %>,
		displayTotalItemsQuantity: <%= displayTotalItemsQuantity %>,
		itemsQuantity: <%= itemsQuantity %>,
		orderId: <%= orderId %>,
		spritemap: '<%= HtmlUtil.escapeJS(spritemap) %>',
		toggleable: <%= toggleable %>,
	};

	<%
	if (!cartViews.isEmpty()) {
	%>

		initialProps.cartViews = {};

		<%
		for (Map.Entry<String, String> cartView : cartViews.entrySet()) {
		%>

			initialProps.cartViews['<%= cartView.getKey() %>'] = {
				contentRendererModuleUrl: '<%= cartView.getValue() %>',
			};

	<%
		}
	}
	%>

	<%
	if (!labels.isEmpty()) {
	%>

		initialProps.labels = {};

		<%
		for (Map.Entry<String, String> label : labels.entrySet()) {
		%>

			initialProps.labels['<%= label.getKey() %>'] = '<%= label.getValue() %>';

	<%
		}
	}
	%>

	Cart.default('<%= miniCartId %>', '<%= miniCartId %>', initialProps);
</aui:script>