<?php
/**
 * The template for displaying all pages
 *
 * This is the template that displays all pages by default.
 * Please note that this is the iOne360 construct of pages
 * and that other 'pages' on your iOne360 site may use a
 * different template.
 * @link              www.colijn-it.nl
 * @since             1.0.0
 * @package           ione360_configurator
 *
 */

/*
Template name: configurator
*/
?>



<?php
	/* General settings */
	$configurator_bundle = esc_attr(get_option("configurator_bundle_selections"));
	$configurator_url = esc_attr(get_option("configurator_endpoint_setting"));
	$configurator_schema = esc_attr(get_option("configurator_scheme_setting"));
	$configurator_version = esc_attr(get_option("configurator_version_setting"));
	$configurator_cdn = esc_attr(get_option("configurator_cdn_setting"));
	$configurator_assets = esc_attr(get_option("configurator_assets_setting"));
	$configurator_language = esc_attr(get_option("configurator_language_setting"));
	$configurator_currency = esc_attr(get_option("configurator_currency_setting"));	
	if ($configurator_currency) {
		if ($configurator_currency === '€') {
			$currency_format = 'EUR';
		} else if ($configurator_currency === '£') {
			$currency_format = 'GBP';		
		} else if ($configurator_currency === '$') {
			$currency_format = 'USD';
		} else {
			$configurator_currency = '€';
			$currency_format = 'EUR';
		}
	} else {
		$configurator_currency = '€';
		$currency_format = 'EUR';
	}
	$configurator_AREnabled = esc_attr(get_option("configurator_AREnabled_setting"));
	if (esc_textarea($floor === 'false')) {
		$configurator_standaloneFloors = false;
	} else {
		$configurator_standaloneFloors = esc_attr(get_option("configurator_standaloneFloors_setting"));
	}
	$configurator_showAsConfigured = esc_attr(get_option("configurator_showAsConfigured_setting"));
	$configurator_camera = esc_attr(get_option("configurator_camera_setting"));
	$configurator_light = esc_attr(get_option("configurator_light_setting"));
	$configurator_background = esc_attr(get_option("configurator_background_setting"));
	$configurator_gtm = esc_attr(get_option("configurator_gtm_setting"));
	$configurator_show3dwatermark = esc_attr(get_option("configurator_show3dwatermark_setting"));
	$configurator_showiOneicon_setting = esc_attr(get_option("configurator_showiOnewatermark_setting"));
	$configurator_showtagfilter = esc_attr(get_option("configurator_showtagfilter_setting"));
	$configurator_showzoombutton = esc_attr(get_option("configurator_showzoombutton_setting"));
	$configurator_showdimensions = esc_attr(get_option("configurator_showdimensions_setting"));  
	$configurator_showdownload = esc_attr(get_option("configurator_showdownload_setting"));
	/* Render settings */
	$configurator_useioneimages = esc_attr(get_option("configurator_use_ione_images_setting"));
	$configurator_userenders = esc_attr(get_option("configurator_use_renders_setting"));
/* 	$configurator_renderhost = esc_attr(get_option("configurator_render_host_setting"));
	$configurator_renderport = esc_attr(get_option("configurator_render_port_setting"));
	$configurator_enviromentIntensity = esc_attr(get_option("configurator_render_environmentIntensity"));
	$configurator_render_imageWidth = esc_attr(get_option("configurator_render_imageWidth"));
	$configurator_render_imageHeight = esc_attr(get_option("configurator_render_imageHeight"));
	$configurator_render_iterations = esc_attr(get_option("configurator_render_iterations")); */
	$configurator_renderButton = esc_attr(get_option("configurator_render_button"));
	$configurator_renderLoader = esc_attr(get_option("configurator_render_loader"));
	/* Layout settings */
	$configurator_layout = esc_attr(get_option("configurator_layout"));
	$configurator_layout_selections = esc_attr(get_option("configurator_layout_selections"));
	$configurator_printButton = esc_attr(get_option("configurator_showprint_button"));
	$configurator_printText = esc_attr(get_option("configurator_printtext_setting"));	
	$configurator_buttonsScene = esc_attr(get_option("configurator_colorbtn_threed"));
	$configurator_buttonsCta = esc_attr(get_option("configurator_colorbtn_cta"));
	$configurator_radiusCta = esc_attr(get_option("configurator_cta_radius"));
	$configurator_buttonsTextScene = esc_attr(get_option("configurator_colorbtntext_threed"));
	$configurator_buttonsTextCta = esc_attr(get_option("configurator_colorbtn_ctatext"));
	$configurator_sceneWidth = esc_attr(get_option("configurator_scenewidth_canvas"));
	$configurator_headingColor = esc_attr(get_option("configurator_colorheading_config"));
	$configurator_labelsColor = esc_attr(get_option("configurator_colorlabel_config"));
	$configurator_textColor = esc_attr(get_option("configurator_colortext_config"));
	$configurator_btnRadius = esc_attr(get_option("configurator_button_radius"));
	$configurator_showName = esc_attr(get_option("configurator_showname_text"));
	$configurator_showConfigureText = esc_attr(get_option("configurator_show_configure"));
	$configurator_customConfigureText = esc_attr(get_option("configurator_text_configure"));
	$configurator_show_from_price = esc_attr(get_option("configurator_show_from_price"));
	$configurator_text_from_price = esc_attr(get_option("configurator_text_from_price"));
	$configurator_customTotalsText = esc_attr(get_option("configurator_text_totals"));	
	$configurator_hideTotalPrice = esc_attr(get_option("configurator_hideprice_text"));
	$configurator_customCss = esc_attr(get_option("configurator_custom_css_setting"));
	$configurator_customPreloader = esc_attr(get_option("configurator_custom_preloader"));
	/* Contact settings */
	$configurator_contactButton = esc_attr(get_option("configurator_enable_contact_form"));
	$configurator_contactText = esc_attr(get_option("configurator_contact_text_setting"));	
?>
<?php if($configurator_customTotalsText !== ''): ?>
	<style>span.sum-label{font-size: 0px;}span.sum-label:after{font-size: initial;content:'<?php echo $configurator_customTotalsText ?>';</style>
	<style>div.sum label{font-size: 0px !important;}div.sum label:after{font-size: initial;content:'<?php echo $configurator_customTotalsText ?>';</style>
<?php endif; ?>
<?php if ($external): ?>
	<style>body header, body footer, body .threed-thumb-layover, body .config-title, .addtoprint, .quote-btn, .force-expand  {display: none !important;}
	body .configurator-image threed-configurator{max-height: 100vh;}body .product-essential, body .configurator-image {height: 100vh;} body .controls-bottom {bottom: 15px !important;}
	body .ione360 {bottom: 5px}</style>
	<?php if ($external === 'hayvenhurst'): ?>
		<?php
			$configurator_bundle = esc_attr(get_option("configurator_bundle_selections"));
			$configurator_url = 'https://vandesant.ionecloud.nl/ione/';
			$configurator_schema = '32878';
			$configurator_version = '255';
			$configurator_cdn = esc_attr(get_option("configurator_cdn_setting"));
			$configurator_assets = esc_attr(get_option("configurator_assets_setting"));
			$configurator_language = esc_attr(get_option("configurator_language_setting"));
			$configurator_currency = esc_attr(get_option("configurator_currency_setting"));
		?>
	<?php elseif ($external === 'gjohns'): ?>
		<?php
			$configurator_bundle = esc_attr(get_option("configurator_bundle_selections"));
			$configurator_url = 'https://gjohns.ionecloud.nl/ione/';
			$configurator_schema = '133503';
			$configurator_version = '250';
			$configurator_cdn = 'https://cdn.ione360.com/content387/';
			$configurator_assets = esc_attr(get_option("configurator_assets_setting"));
			$configurator_language = 'EN';
			$configurator_currency = esc_attr(get_option("configurator_currency_setting"));
			$configurator_showAsConfigured = false;
			$configurator_show_from_price = false;
		?>		
	<?php endif; ?>
<?php endif; ?>
<?php if ($configurator_layout || esc_textarea($layout === 'new')): ?>
<?php
wp_enqueue_style(
	"general_new",
	plugin_dir_url(__FILE__) . "public/css/general_new.css",
	1.1,
	"all"
  );
if ($configurator_contactButton) {
wp_enqueue_style(
	"contact",
	plugin_dir_url(__FILE__) . "public/css/contact-form.css",
	1.1,
	"all"
  );	
}
if ($configurator_printButton) {
wp_enqueue_style(
	"print",
	plugin_dir_url(__FILE__) . "public/css/print.css",
	1.1,
	"all"
  );
}
if ($configurator_bundle === 'production') {	
	wp_enqueue_script(
	  "configurator",
	  "https://configurator.ione360.com/js/wordpress/production/threedconfigurator-standalone.bundle.min.js",
	  [],
	  true
	);
} elseif ($configurator_bundle === '254') {
	wp_enqueue_script(
	  "configurator",
	  "https://configurator.ione360.com/js/wordpress/254/threedconfigurator-standalone.bundle.min.js",
	  [],
	  true
	);	
} elseif ($configurator_bundle === '255') {
	wp_enqueue_script(
	  "configurator",
	  "https://configurator.ione360.com/js/wordpress/255/threedconfigurator-standalone.bundle.min.js",
	  [],
	  true
	);	
} elseif ($configurator_bundle === 'develop') {
	wp_enqueue_script(
	  "configurator",
	  "https://configurator.ione360.com/js/backup_develop/threedconfigurator-standalone.bundle.min.js",
	  [],
	  true
	);	
} else {
	wp_enqueue_script(
	  "configurator",
	  "https://configurator.ione360.com/js/wordpress/production/threedconfigurator-standalone.bundle.min.js",
	  [],
	  true
	);	
}
?>
<style>
	.co-summary-line .total-price {background: transparent !important;}
	<?php if ($configurator_buttonsScene): ?>
		.configurator-image button, div.mobile.mobile-selections-header:after {background-color:<?php echo $configurator_buttonsScene ?> !important}
	<?php endif; ?>
	<?php if ($configurator_buttonsTextScene): ?>
		.configurator-image div:not(.powered-by-wrapper) button, button#standalone_show_measurements:after {color:<?php echo $configurator_buttonsTextScene ?> !important}
		.configurator-image div:not(.powered-by-wrapper) svg path, .configurator-image div:not(.powered-by-wrapper) svg polygon, .configurator-image div:not(.powered-by-wrapper) svg circle {fill:<?php echo $configurator_buttonsTextScene ?> !important} 	
	<?php endif; ?>
	<?php if ($configurator_buttonsCta): ?>
		.product-info .cta-buttons button, .fta-buttons button, .fcf-form-group .fcf-btn-primary {background-color:<?php echo $configurator_buttonsCta ?> !important; border: none !important;}
	<?php endif; ?>
	<?php if ($configurator_buttonsTextCta): ?>
		.product-info .cta-buttons button span {color:<?php echo $configurator_buttonsTextCta ?> !important}
	<?php endif; ?>	
	<?php if ($configurator_radiusCta): ?>
		.cta-buttons button {border-radius: <?php echo $configurator_radiusCta ?>px !important;}
	<?php endif; ?>
	<?php if ($configurator_hideTotalPrice): ?>
		.selections .sum {display:none !important;}
		.product-info .cta-buttons {margin-top: 30px;display:block;width:100%;float:left}
	<?php endif; ?>
	<?php if ($configurator_headingColor): ?>
		.configurator-data h4, .mobile-selections-header span, .selections .answer-slideout .title h3, .answer-slideout .selections .title span {color:<?php echo $configurator_headingColor ?> !important}
	<?php endif; ?>	
	<?php if ($configurator_textColor): ?>
		.selections .titles span, .selections .sum .price, .selections .answer-slideout .cards .description-wrapper span {color:<?php echo $configurator_textColor ?> !important}
	<?php endif; ?>	
	<?php if ($configurator_labelsColor): ?>
		.selections label {color:<?php echo $configurator_labelsColor ?> !important}
		.heart:after {color: <?php echo $configurator_labelsColor ?> !important}
	<?php endif; ?>
	<?php if ($configurator_btnRadius): ?>
		.configurator-image .product-placeholder button, .configurator-image .threed-thumb-layover button, .configurator-image .controls-bottom button img, .configurator-image .controls-bottom button {border-radius: <?php echo $configurator_btnRadius?>% !important;} 
	<?php endif; ?>
	<?php if ($configurator_sceneWidth): ?>
		<?php $configurator_selectionsWidth = 100 - $configurator_sceneWidth; ?>
		@media (min-width: 992px) {
			body.expanded .product-essential .configurator-image {width: 100% !important;}			
			.configurator-image threed-configurator {max-width:100% !important}
			<?php if($configurator_contactButton && $configurator_printButton): ?>
				div.sum {right: 340px !important;}
			<?php endif; ?>			
		}
	<?php endif; ?>	
	<?php if($configurator_customCss && $configurator_customCss !== ''): ?>
		<?php echo $configurator_customCss ?>
	<?php endif; ?>
</style>
<div class="selections-expand-wrapper" id="selections-expand test<?php echo esc_textarea($sku); ?>" style="min-height:650px;">
	<div class="product-main-information" style="display:none;">
		<div class="product-essential-wrapper">
			<div class="product-essential">
				<div class="configurator-image active threed" id="threedconfigurator">
					<?php if ($configurator_customPreloader): ?>
						<div class="configurator-preloader" id="conf_preloader">
							<img src="<?php echo esc_url($configurator_customPreloader) ?>"/>
						</div>
						<script>
							document.addEventListener("click", function(event) {
								var preloader = document.getElementById("conf_preloader");
								if (preloader && !preloader.contains(event.target)) {
									preloader.style.display = "none";
								}
							});
						</script>
					<?php endif; ?>				
					<div class="threed-thumb-layover">
						<button class="threed-thumb">
							<span id="three">
								<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50">
									<path d="m10.13,34.62c-1.61.07-3.64-.36-4.94-1.34-1.32-.75-2.64-.38-4.16-.26,1.22.91,2.73,1.55,4.23,1.83,1.64.26,3.97-.17,4.88-.23"/><path d="m7.11,16.13c-1.89-.16-3.93.65-5.38,1.84,1.09.08,2.19.16,3.28.23.52.04,2-1.16,2.59-1.36.88-.31,1.81-.48,2.74-.4-1.08-.1-2.16-.21-3.24-.31"/><path d="m19.4,31.31c-.11-3.08-2.05-6.03-5.17-6.68,1.48-1.18,2.95-1.83,3.78-3.69.39-1.03.58-2.06.58-3.16-.21-5.4-4.4-6.23-8.82-6.92,3.18.5,5.49,2.93,5.74,6.15.14,1.82-.28,3.74-1.39,5.21-.84,1.12-2.09,1.56-3.04,2.38,3.34.71,5.29,3.97,5.29,7.24,0,4.21-2.85,7.57-7.02,8.25,3.48-.57,7.28-1.07,9.09-4.48.71-1.31,1.01-2.83.95-4.31" opacity=".5"/><path d="m30.73,14.8c.18-.04.4-.08.63-.11.24-.04.5-.07.79-.1.29-.03.61-.05.96-.06.21-.01.43-.01.63-.01s.41,0,.62.02c.2.01.4.03.6.05.2.02.39.05.58.07-.33-.06-.71-.13-2.61-.42-.2-.03-.4-.06-.6-.08-.2-.02-.41-.04-.61-.05-.21,0-.42-.01-.63-.01s-.43,0-.65.01c-.36.02-.68.04-.99.07-.3.03-.57.07-.82.1-.24.04-.46.08-.65.12-.19.04-.35.08-.49.13v21.11h0s0,0,0,0h0s0,0,0,0c.01,0,.03,0,.04.01.02,0,.03,0,.05.01.01,0,.03,0,.05.01.01,0,.03,0,.05.01.03,0,.05.01.08.02.03,0,.06,0,.08.01s.06.01.09.01c0,0,0,0,0,0s0,0,0,0,0,0,0,0c.02,0,.05,0,.07.01.07,0,.14.02.21.03.07,0,.15.02.22.02.02,0,.04,0,.05,0h.01s.01,0,.02,0c.05,0,.1,0,.14.01.08,0,.16,0,.23.01.04,0,.08,0,.12,0,.03,0,.07,0,.1,0,.05,0,.1,0,.15,0,.02,0,.03,0,.05,0,.07,0,.13,0,.2.01.07,0,.13,0,.2,0,0,0,.02,0,.02,0,0,0,.02,0,.03,0h.03s.02,0,.03,0c.08,0,.17,0,.25,0,.08,0,.16,0,.24,0h.24c.08,0,.16,0,.24,0,.08,0,.16,0,.24-.01,0,0,.01,0,.02,0h0s.05,0,.08,0c.12,0,.23-.01.34-.02.04,0,.07,0,.11-.01.02,0,.04,0,.06,0,.02,0,.03,0,.05,0,.04,0,.08,0,.13-.01.11-.01.22-.03.33-.04,0,0,.01,0,.02,0,0,0,.01,0,.02,0h.02s.01,0,.02,0c.86-.13,1.72-.26,2.58-.4,0,0,.01,0,.02,0,0,0,.01,0,.02,0,0,0,.01,0,.02,0-.19.03-.38.05-.57.07-.18.02-.36.03-.54.04-.05,0-.09,0-.14,0-.16,0-.31.01-.47.01h-.05c-.19,0-.39,0-.59-.01h-.02s-.02,0-.03,0c0,0-.02,0-.02,0-.01,0-.02,0-.03,0-.19,0-.39-.02-.59-.03-.2-.01-.4-.02-.6-.04-.19-.02-.38-.04-.55-.06-.17-.03-.33-.06-.46-.1V14.92c.13-.04.29-.08.48-.12Z" opacity=".5"/><path d="m50,23.9c0-4.43-1.49-9.03-4.94-11.83-2.25-1.78-4.69-2.4-7.45-3.1,7.29,1.88,10.39,8.85,10.21,15.91-.19,7.48-3.77,14.24-11.43,16.1,4.33-1.05,8.38-2.36,10.88-6.3,2.03-3.25,2.73-6.98,2.73-10.78" opacity=".5"/><path d="m42.29,11.18c.84.62,1.6,1.34,2.28,2.18.68.85,1.27,1.81,1.75,2.88.49,1.08.86,2.28,1.12,3.6.26,1.32.4,2.76.4,4.32,0,1.67-.15,3.22-.41,4.64-.27,1.41-.65,2.69-1.14,3.85-.48,1.15-1.06,2.18-1.71,3.08-.65.9-1.37,1.68-2.13,2.34-.84.71-1.79,1.3-2.84,1.79-1.03.49-2.16.87-3.36,1.15-1.19.28-2.45.46-3.77.54-1.31.08-2.68.08-4.09-.02-.84-.05-1.61-.12-2.32-.2-.71-.07-1.36-.15-1.95-.24-.59-.08-1.12-.17-1.6-.26-.48-.09-.9-.17-1.27-.26V9.76c.56-.15,1.17-.29,1.82-.42.65-.13,1.34-.25,2.05-.36.72-.11,1.47-.2,2.25-.29.78-.08,1.58-.15,2.4-.21,1.39-.1,2.68-.12,3.88-.07,1.2.05,2.31.18,3.34.4,1.03.22,1.98.52,2.86.91.89.39,1.7.88,2.46,1.46Zm-12.43,24.7c1.49.06,2.87-.11,4.1-.53,1.24-.42,2.33-1.1,3.24-2.04.91-.95,1.63-2.15,2.12-3.63.49-1.48.75-3.23.75-5.24,0-1.83-.24-3.41-.69-4.75-.45-1.34-1.12-2.43-1.97-3.28-.84-.85-1.87-1.46-3.05-1.84-1.17-.38-2.48-.53-3.92-.46-.36.02-.68.04-.99.07-.3.03-.57.07-.82.1-.24.04-.46.08-.65.12-.19.04-.35.08-.49.13v21.11c.14.04.3.07.47.1.18.03.37.05.57.07.2.02.41.03.61.04.21,0,.41.02.61.03,0,0,.02,0,.02,0,0,0,.02,0,.03,0h.03s.02,0,.03,0"/><path d="m7.62,10.79c1.23-.08,2.34.05,3.31.35.98.31,1.81.79,2.49,1.41.69.63,1.21,1.39,1.57,2.25.36.86.54,1.82.54,2.84,0,.79-.09,1.53-.28,2.23s-.47,1.35-.84,1.94c-.37.59-.84,1.11-1.39,1.57-.55.45-1.2.84-1.94,1.14v.09c.72.15,1.41.44,2.03.83.63.4,1.2.92,1.68,1.53.48.62.88,1.35,1.15,2.17.27.82.42,1.72.42,2.7,0,1.3-.24,2.51-.7,3.58-.46,1.07-1.13,1.99-2,2.74-.86.74-1.9,1.31-3.1,1.66-1.18.35-2.52.49-3.98.39-.74-.05-1.44-.16-2.1-.31-.66-.15-1.27-.34-1.83-.56-.56-.22-1.07-.46-1.51-.71C.7,38.39.31,38.13,0,37.87l1.03-4.84c.23.17.53.37.88.57.36.21.77.42,1.23.61.45.19.95.37,1.47.5.52.13,1.06.23,1.6.25.69.03,1.31-.05,1.84-.21.53-.17.98-.42,1.34-.75.36-.33.63-.73.81-1.18.18-.45.27-.95.27-1.49,0-.72-.15-1.35-.4-1.88-.26-.53-.62-.97-1.06-1.31-.43-.34-.94-.6-1.49-.77-.54-.17-1.12-.25-1.69-.26l-2.15-.02v-4.7l2.04-.02c.45,0,.92-.07,1.39-.19.47-.13.92-.32,1.32-.59.4-.27.74-.61.99-1.04.24-.43.39-.95.39-1.56,0-.43-.07-.84-.21-1.2-.14-.36-.35-.67-.64-.93-.29-.26-.64-.46-1.07-.58-.43-.13-.93-.19-1.5-.16-.47.02-.94.1-1.39.22-.46.12-.89.28-1.3.47-.41.18-.78.38-1.12.58-.33.2-.61.4-.83.58l-1.04-4.64c.33-.29.73-.57,1.2-.85.47-.28,1.02-.54,1.61-.77.6-.24,1.25-.44,1.93-.6.69-.16,1.42-.27,2.18-.32Z"/>
								</svg>
							</span>
						</button>
					</div>
					<?php if($configurator_showName): ?>
						<div id="title_drop">
							<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
								<path d="M283.3 256l-22.6 22.6-160 160L78 461.3 32.7 416l22.6-22.6L192.7 256 55.4 118.6 32.7 96 78 50.7l22.6 22.6 160 160L283.3 256z"/>
							</svg>
						</div>				
						<div class="configurator-data">

							<div class="product-name">
								<h4 id="title_wrapper"></h4>
							</div>
							<?php if ($configurator_show_from_price): ?>
								<div class="product-price">
									<?php if ($configurator_text_from_price !== ''): ?>
										<span id="price_heading"><?php echo $configurator_text_from_price ?></span>
									<?php else: ?>
										<span id="price_heading">Price from</span>
									<?php endif; ?>
									<span id="price_wrapper"></span>
								</div>
							<?php endif; ?>							
							<div class="product-description">
								<p id="desc_wrapper"></p>
							</div>
						</div>
					<?php else: ?>
						<span style="display: none !important;" id="title_wrapper"></span>						
					<?php endif; ?>				
					<threed-configurator id="threed_wrapper"></threed-configurator>					
					<div class="product-placeholder">
						<div class="image-wrapper">
							<img id="render_img" src="" />
							<?php if ($configurator_renderLoader !== ''): ?>
								<div id="loading-gif" style="text-align: center; width:100%;">
									<img style="max-width:50px;" src="<?php echo $configurator_renderLoader?>"/>
								</div>							
							<?php else: ?>
								<div id="loading-gif" style="text-align: center; width:100%;">
									<img style="max-width:50px;" src="<?php echo esc_url(plugins_url("public/images/loading.gif", __FILE__)); ?>"/>
								</div>
							<?php endif; ?>							
						</div>
						<button id="SwitchView">	
							<span id="two">
								<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50">
									<path d="M25,11c7.72,0,14,6.28,14,14s-6.28,14-14,14-14-6.28-14-14,6.28-14,14-14m0-1c-8.29,0-15,6.72-15,15s6.71,15,15,15,15-6.71,15-15-6.72-15-15-15h0Z" fill="#484f60"/><g><path d="M23.34,30.72h-7.34v-1.85c.56-.49,1.12-1,1.68-1.55,.56-.55,1.01-1.02,1.35-1.42,.51-.59,.87-1.1,1.08-1.54,.21-.44,.32-.87,.32-1.3,0-.51-.14-.91-.41-1.19-.27-.28-.67-.42-1.18-.42-.38,0-.79,.1-1.21,.29-.43,.19-.82,.43-1.18,.73h-.2v-2.49c.3-.16,.74-.31,1.31-.47,.58-.16,1.16-.23,1.74-.23,1.17,0,2.06,.3,2.68,.88,.62,.59,.92,1.43,.92,2.5,0,.71-.15,1.38-.44,2.02-.3,.64-.75,1.3-1.35,1.97-.38,.42-.76,.81-1.15,1.16-.38,.35-.66,.6-.82,.74h4.2v2.15Z" fill="#484f60"/><path d="M33.44,22.29c-.37-.8-.88-1.44-1.52-1.91-.38-.28-.84-.5-1.39-.65-.55-.15-1.21-.23-1.97-.23h-3.39v11.21h3.29c.74,0,1.39-.07,1.93-.2,.54-.13,1.04-.36,1.5-.69,.61-.44,1.11-1.08,1.51-1.9,.4-.83,.6-1.76,.6-2.81s-.19-2.03-.56-2.83Zm-2.24,4.68c-.21,.5-.53,.91-.97,1.21-.26,.17-.52,.28-.78,.34-.27,.06-.69,.09-1.26,.09h-.61v-7.02h.61c.52,0,.91,.03,1.16,.08,.26,.05,.51,.15,.76,.3,.49,.3,.84,.71,1.06,1.23,.22,.52,.34,1.16,.34,1.89s-.1,1.37-.31,1.87Z" fill="#484f60"/></g></g></g></g><g id="c"/>
								</svg>
							</span>
						</button>	
						<div class="force-expand fixedElement" id="scroller-anchor" <?php if(!$configurator_userenders): ?>style="left: 0px;" <?php endif; ?>>
							<button id="ExpandIcon" class="getexpand" onclick="getExpandView()" title="Get expand">
								<span id="ExpandText">									
									<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50">
										<path d="M38,38.17H12v-26H38ZM13.24,36.93H36.76V13.4H13.24Z" fill="#484f60"/><polygon points="17.35 32.81 17.35 26.75 19.46 28.86 28.69 19.63 26.59 17.52 32.65 17.52 32.65 23.58 30.54 21.47 21.31 30.71 23.41 32.81 17.35 32.81" fill="#484f60"/>
									</svg>
								</span>
							</button>
							<span id="ScrollGesture">scroll</span>	
						</div>	
						<?php if($configurator_renderButton): ?>
							<div class="force-render">
								<button id="RenderIcon" onclick="getRenderImage()" class="getrender" title="Get render">
									<span>
										<svg id="Icons" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50">
											<defs><style>.cls-1{fill:none;stroke:#484f5f;stroke-miterlimit:10;}.cls-2{fill:#484f5f;}.cls-3{fill:#fff;}</style></defs>
											<g id="Icons-2" data-name="Icons"><rect class="cls-1" x="16" y="21.97" width="26" height="19.07"/>
											<polygon class="cls-2" points="42 38.49 33.33 31.5 29 35.01 23.8 28.9 16 37.65 16 41.03 42 41.03 42 38.49"/>
											<circle class="cls-2" cx="37.23" cy="26.73" r="2.17"/><circle class="cls-3" cx="18" cy="18.97" r="10"/>
											<path class="cls-2" d="M18,9.63A9.34,9.34,0,1,1,8.67,19,9.34,9.34,0,0,1,18,9.63M18,9A10,10,0,1,0,28,19,10,10,0,0,0,18,9Z"/>
											<path class="cls-2" d="M22.22,17.18a5.19,5.19,0,0,0-.42-.77,4.6,4.6,0,0,0-.56-.68,4.5,4.5,0,0,0-.68-.56,4.21,4.21,0,0,0-.78-.42,4.1,4.1,0,0,0-.86-.27,4.75,4.75,0,0,0-1.84,0,4.1,4.1,0,0,0-.86.27,4.21,4.21,0,0,0-.78.42,4.5,4.5,0,0,0-.68.56l-.27.29L14,15.6a3.26,3.26,0,0,1,.31-.33A5.31,5.31,0,0,1,16,14.14a5.65,5.65,0,0,1,1-.3,5.3,5.3,0,0,1,2.1,0,5.65,5.65,0,0,1,1,.3,5.31,5.31,0,0,1,1.66,1.13,4.76,4.76,0,0,1,.64.77,5.1,5.1,0,0,1,.48.89Z"/><polygon class="cls-2" points="12 14.23 16.94 16.79 13.19 17.98 12 14.23"/><path class="cls-2" d="M18,24.2A5.27,5.27,0,0,1,17,24.09a5.65,5.65,0,0,1-1-.3,5.86,5.86,0,0,1-.89-.48,6.7,6.7,0,0,1-.77-.64,5.31,5.31,0,0,1-.64-.78,5.1,5.1,0,0,1-.48-.89l.6-.25a5.86,5.86,0,0,0,.42.78,4.77,4.77,0,0,0,2,1.66,4.77,4.77,0,0,0,.86.26,4.39,4.39,0,0,0,1.84,0,4.77,4.77,0,0,0,.86-.26,4.55,4.55,0,0,0,.78-.43,4.5,4.5,0,0,0,.68-.56l.27-.29.5.42c-.1.12-.2.23-.31.34a6.7,6.7,0,0,1-.77.64,5.86,5.86,0,0,1-.89.48,5.65,5.65,0,0,1-1,.3A5.27,5.27,0,0,1,18,24.2Z"/><polygon class="cls-2" points="24 23.7 19.06 21.15 22.81 19.95 24 23.7"/></g>
										</svg>
									</span>
								</button>
							</div>
						<?php endif; ?>						
					</div>	
				</div>
				<div class="product-info">
					<div class="selections" id="selections">
						<div class="mobile mobile-selections-header" id="mobheader" onclick="getMobileSelections()">
							<?php if ($configurator_showConfigureText): ?>
								<?php if($configurator_customConfigureText !== ''): ?>
									<span><?php echo $configurator_customConfigureText ?></span>
								<?php else: ?>
									<span>Configure</span>
								<?php endif;?>
							<?php endif;?>
						</div>
						<threed-selections id="selector"></threed-selections>
						<div class="heart">
							<svg viewBox="0 0 32 29.6">
							  <path d="M23.6,0c-3.4,0-6.3,2.7-7.6,5.6C14.7,2.7,11.8,0,8.4,0C3.8,0,0,3.8,0,8.4c0,9.4,9.5,11.9,16,21.2
								c6.1-9.3,16-12.1,16-21.2C32,3.8,28.2,0,23.6,0z"/>
							</svg>
						</div>
					</div>
				</div>
				<div class="cta-buttons">
					<?php if ($configurator_showAsConfigured): ?>
						<div class="price-wrapper">
							<div class="config-price">
								<span class="sum-label">Price as configured</span>
								<span class="sum-price" id="sum_price"></span>
							</div>
						</div>
					<?php endif; ?>				
					<?php if($configurator_printButton): ?>
						<div class="addtoprint" id="pdf_click">
							<button class="addto primary to-pdf">
								<?php if($configurator_printText !== ''): ?>
									<span><?php echo $configurator_printText ?></span>
								<?php else: ?>
									<span>Print to pdf</span>
								<?php endif; ?>
							</button>
						</div>
						<span class="print-config" id="print_config"></span>							
					<?php endif; ?>
					<?php if($configurator_contactButton): ?>
						<div class="quote-btn" id="quote_btn">
							<button class="addto primary to-mail">
								<?php if($configurator_contactText !== ''): ?>	
									<span><?php echo $configurator_contactText ?></span>
								<?php else: ?>
									<span>Contact us</span>
								<?php endif; ?>
							</button>
						</div>							
					<?php endif; ?>
					<?php if ($configurator_showiOneicon_setting): ?>
						<div class="ione360">
							<a href="https://www.ione360.com" target="_blank"><img style="max-width:32px;" src="<?php echo esc_url(plugins_url("public/images/ione360.png", __FILE__)); ?>"/></a>
						</div>
					<?php else: ?>
						<style>body .controls-bottom{right:0 !important;}</style>
					<?php endif; ?>
				</div>				
				<?php if($configurator_contactButton): ?>
					<?php include(plugin_dir_path(__FILE__) . 'templates/contact-form.php'); ?>
				<?php endif; ?>				
			</div>
		</div>
	</div>
</div>
<?php else: ?>
<?php
if ($configurator_layout_selections === 'layout1') {
	wp_enqueue_style(
		"general_new",
		plugin_dir_url(__FILE__) . "public/css/general.css",
		1.1,
		"all"
	  );
} elseif ($configurator_layout_selections === 'layout2') {
	wp_enqueue_style(
		"general_new",
		plugin_dir_url(__FILE__) . "public/css/general_new_selections.css",
		1.1,
		"all"
	  );
} else {
	wp_enqueue_style(
		"general_new",
		plugin_dir_url(__FILE__) . "public/css/general.css",
		1.1,
		"all"
	  );
}
if ($configurator_printButton) {
wp_enqueue_style(
	"print",
	plugin_dir_url(__FILE__) . "public/css/print.css",
	1.1,
	"all"
  );
}
if ($configurator_contactButton) {
wp_enqueue_style(
	"contact",
	plugin_dir_url(__FILE__) . "public/css/contact-form.css",
	1.1,
	"all"
  );	
}
if ($configurator_bundle === 'production') {	
	wp_enqueue_script(
	  "configurator",
	  "https://configurator.ione360.com/js/wordpress/production/threedconfigurator-standalone.bundle.min.js",
	  [],
	  true
	);
} elseif ($configurator_bundle === '254') {
	wp_enqueue_script(
	  "configurator",
	  "https://configurator.ione360.com/js/wordpress/254/threedconfigurator-standalone.bundle.min.js",
	  [],
	  true
	);	
} elseif ($configurator_bundle === '255') {
	wp_enqueue_script(
	  "configurator",
	  "https://configurator.ione360.com/js/wordpress/255/threedconfigurator-standalone.bundle.min.js",
	  [],
	  true
	);	
} elseif ($configurator_bundle === 'develop') {
	wp_enqueue_script(
	  "configurator",
	  "https://configurator.ione360.com/js/backup_develop/threedconfigurator-standalone.bundle.min.js",
	  [],
	  true
	);	
} else {
	wp_enqueue_script(
	  "configurator",
	  "https://configurator.ione360.com/js/wordpress/production/threedconfigurator-standalone.bundle.min.js",
	  [],
	  true
	);	
}
?>
<style>
	.co-summary-line .total-price {background: transparent !important;}
	<?php if ($configurator_buttonsScene): ?>
		.configurator-image button, div.mobile.mobile-selections-header:after {background-color:<?php echo $configurator_buttonsScene ?> !important}
	<?php endif; ?>
	<?php if ($configurator_buttonsTextScene): ?>
		.configurator-image div:not(.powered-by-wrapper) button, button#standalone_show_measurements:after {color:<?php echo $configurator_buttonsTextScene ?> !important}
		.configurator-image div:not(.powered-by-wrapper) svg path, .configurator-image div:not(.powered-by-wrapper) svg polygon, .configurator-image div:not(.powered-by-wrapper) svg circle {fill:<?php echo $configurator_buttonsTextScene ?> !important} 	
	<?php endif; ?>
	<?php if ($configurator_buttonsCta): ?>
		.product-info .cta-buttons button, .fta-buttons button {background-color:<?php echo $configurator_buttonsCta ?> !important}
	<?php endif; ?>
	<?php if ($configurator_buttonsTextCta): ?>
		.product-info .cta-buttons button span {color:<?php echo $configurator_buttonsTextCta ?> !important}
	<?php endif; ?>	
	<?php if ($configurator_hideTotalPrice): ?>
		.selections .sum {display:none !important;}
		.product-info .cta-buttons {margin-top: 30px;display:block;width:100%;float:left}
	<?php endif; ?>
	<?php if ($configurator_headingColor): ?>
		.configurator-data h4, .mobile-selections-header span, .selections .answer-slideout .title h3, .answer-slideout .selections .title span {color:<?php echo $configurator_headingColor ?> !important}
	<?php endif; ?>	
	<?php if ($configurator_textColor): ?>
		.selections .titles span, .selections .sum .price, .selections .answer-slideout .cards .description-wrapper span {color:<?php echo $configurator_textColor ?> !important}
	<?php endif; ?>	
	<?php if ($configurator_labelsColor): ?>
		.selections label {color:<?php echo $configurator_labelsColor ?> !important}
	<?php endif; ?>
	<?php if ($configurator_btnRadius): ?>
		.configurator-image button, .configurator-image button img, .configurator-image .controls-bottom button {border-radius: <?php echo $configurator_btnRadius?>% !important;} 
	<?php endif; ?>
	<?php if ($configurator_sceneWidth): ?>
		<?php $configurator_selectionsWidth = 100 - $configurator_sceneWidth; ?>
		@media (min-width: 992px) {
			.product-essential .configurator-image {width:<?php echo $configurator_sceneWidth ?>% !important}
			.product-essential .product-info {width: <?php echo $configurator_selectionsWidth ?>% !important}
			body.expanded .product-essential .configurator-image {width: 100% !important;}			
			.configurator-image threed-configurator {max-width:100% !important}
		}
	<?php endif; ?>	
	<?php if($configurator_customCss && $configurator_customCss !== ''): ?>
		<?php echo $configurator_customCss ?>
	<?php endif; ?>	
</style>
<div class="selections-expand-wrapper test<?php echo $layout ?>" id="selections-expand test<?php echo esc_textarea($sku); ?>" style="min-height:600px;">
	<div class="product-main-information" style="display:none;">
		<div class="product-essential-wrapper">
			<div class="product-essential">
				<div class="configurator-image active threed" id="threedconfigurator">
					<?php if ($configurator_customPreloader): ?>
						<div class="configurator-preloader" id="conf_preloader">
							<img src="<?php echo esc_url($configurator_customPreloader) ?>"/>
						</div>
						<script>
							document.addEventListener("click", function(event) {
								var preloader = document.getElementById("conf_preloader");
								if (preloader && !preloader.contains(event.target)) {
									preloader.style.display = "none";
								}
							});
						</script>
					<?php endif; ?>				
					<threed-configurator id="threed_wrapper" <?php if($configurator_useioneimages): ?>style="display:none;"<?php endif;?>></threed-configurator>
					<?php if($configurator_useioneimages): ?>
						<div class="product-placeholder" <?php if($configurator_useioneimages): ?>style="left:0;"<?php endif;?>>
							<?php if ($configurator_renderLoader !== ''): ?>
								<div id="loading-gif" style="text-align: center; width:100%;">
									<img style="max-width:100px;" src="<?php echo $configurator_renderLoader?>"/>
								</div>							
							<?php else: ?>
								<div id="loading-gif" style="text-align: center; width:100%;">
									<img style="max-width:100px;" src="<?php echo esc_url(plugins_url("public/images/loading.gif", __FILE__)); ?>"/>
								</div>
							<?php endif; ?>					
							<div class="image-wrapper" <?php if($configurator_useioneimages): ?>style="display:flex;justify-content:center;"<?php endif;?>>
								<img id="render_img" src="" />
							</div>
						</div>							
					<?php else: ?>					
						<div class="animated-wrapper">
						
							<!--div class="hamburger-icon" id="icon">
								<div class="icon-1" id="a"></div>
								<div class="icon-2" id="b"></div>
								<div class="icon-3" id="c"></div>
								<div class="clear"></div>
							</div-->
							<button id="SwitchView">	
								<span id="two_old">
									<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50">
										<path d="M25,11c7.72,0,14,6.28,14,14s-6.28,14-14,14-14-6.28-14-14,6.28-14,14-14m0-1c-8.29,0-15,6.72-15,15s6.71,15,15,15,15-6.71,15-15-6.72-15-15-15h0Z" fill="#484f60"/><g><path d="M23.34,30.72h-7.34v-1.85c.56-.49,1.12-1,1.68-1.55,.56-.55,1.01-1.02,1.35-1.42,.51-.59,.87-1.1,1.08-1.54,.21-.44,.32-.87,.32-1.3,0-.51-.14-.91-.41-1.19-.27-.28-.67-.42-1.18-.42-.38,0-.79,.1-1.21,.29-.43,.19-.82,.43-1.18,.73h-.2v-2.49c.3-.16,.74-.31,1.31-.47,.58-.16,1.16-.23,1.74-.23,1.17,0,2.06,.3,2.68,.88,.62,.59,.92,1.43,.92,2.5,0,.71-.15,1.38-.44,2.02-.3,.64-.75,1.3-1.35,1.97-.38,.42-.76,.81-1.15,1.16-.38,.35-.66,.6-.82,.74h4.2v2.15Z" fill="#484f60"/><path d="M33.44,22.29c-.37-.8-.88-1.44-1.52-1.91-.38-.28-.84-.5-1.39-.65-.55-.15-1.21-.23-1.97-.23h-3.39v11.21h3.29c.74,0,1.39-.07,1.93-.2,.54-.13,1.04-.36,1.5-.69,.61-.44,1.11-1.08,1.51-1.9,.4-.83,.6-1.76,.6-2.81s-.19-2.03-.56-2.83Zm-2.24,4.68c-.21,.5-.53,.91-.97,1.21-.26,.17-.52,.28-.78,.34-.27,.06-.69,.09-1.26,.09h-.61v-7.02h.61c.52,0,.91,.03,1.16,.08,.26,.05,.51,.15,.76,.3,.49,.3,.84,.71,1.06,1.23,.22,.52,.34,1.16,.34,1.89s-.1,1.37-.31,1.87Z" fill="#484f60"/></g></g></g></g><g id="c"/>
									</svg>
								</span>
								<span id="three_old">
									<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50">
										<path d="M25,11A14,14,0,1,1,11,25,14,14,0,0,1,25,11m0-1A15,15,0,1,0,40,25,15,15,0,0,0,25,10Z" fill="#484f60"/><path d="M19.65,28.46A2.94,2.94,0,0,1,17.87,28a2.46,2.46,0,0,0-1.5-.09,3.7,3.7,0,0,0,1.52.66,7.71,7.71,0,0,0,1.76-.09" fill="#484f60" opacity="0.5"/><path d="M18.56,21.81a2.83,2.83,0,0,0-1.94.66l1.19.08c.18,0,.72-.41.93-.49a2.38,2.38,0,0,1,1-.14l-1.17-.11" fill="#484f60" opacity="0.5"/><path d="M23,27.27a2.46,2.46,0,0,0-1.86-2.4c.54-.42,1.06-.66,1.36-1.33a3.16,3.16,0,0,0,.21-1.14c-.08-1.94-1.59-2.24-3.17-2.49a2.4,2.4,0,0,1,2.06,2.22,2.81,2.81,0,0,1-.5,1.88,5.74,5.74,0,0,1-1.09.85,2.58,2.58,0,0,1,1.9,2.61,3,3,0,0,1-2.52,3c1.25-.21,2.62-.39,3.27-1.62A3,3,0,0,0,23,27.27" fill="#484f60" opacity="0.5"/><path d="M27.06,21.33l.23,0,.29,0,.34,0h.45l.22,0,.21,0-.94-.15-.22,0H27l-.36,0-.29,0-.24,0-.17.05v7.6h1.72l.93-.14h0l-.21,0-.19,0h-.91l-.2,0-.17,0V21.37Z" fill="#484f60" opacity="0.5"/><path d="M34,24.6a5.42,5.42,0,0,0-1.78-4.26,6.62,6.62,0,0,0-2.68-1.11c2.63.67,3.74,3.18,3.68,5.72-.07,2.7-1.36,5.13-4.12,5.8,1.56-.38,3-.85,3.92-2.27a7.2,7.2,0,0,0,1-3.88" fill="#484f60" opacity="0.5"/><path d="M31.23,20a4.27,4.27,0,0,1,.81.78,4.5,4.5,0,0,1,.63,1,5.5,5.5,0,0,1,.41,1.3,8.27,8.27,0,0,1,.14,1.55,8.71,8.71,0,0,1-.15,1.67,6,6,0,0,1-.41,1.38A4.92,4.92,0,0,1,32,28.86a4.43,4.43,0,0,1-.76.84,4.91,4.91,0,0,1-1,.65,6.62,6.62,0,0,1-1.21.41,8.4,8.4,0,0,1-1.36.2,10.34,10.34,0,0,1-1.47,0l-.84-.07-.7-.09-.58-.09-.45-.09V19.51l.65-.15.74-.13.81-.1.86-.08a13.33,13.33,0,0,1,1.4,0,8.59,8.59,0,0,1,1.2.14,5.4,5.4,0,0,1,1,.33A4.45,4.45,0,0,1,31.23,20Zm-4.48,8.89a4.15,4.15,0,0,0,1.48-.19A2.85,2.85,0,0,0,29.39,28a3.27,3.27,0,0,0,.76-1.3,5.94,5.94,0,0,0,.27-1.89,5.14,5.14,0,0,0-.25-1.71,3,3,0,0,0-.7-1.18,2.77,2.77,0,0,0-1.1-.67A4,4,0,0,0,27,21.08l-.36,0-.29,0-.24,0-.17.05v7.6l.17,0,.2,0,.22,0h.26" fill="#484f60"/><path d="M18.74,19.88a3.43,3.43,0,0,1,1.19.13,2.33,2.33,0,0,1,.9.51,2.3,2.3,0,0,1,.57.81,2.85,2.85,0,0,1,.19,1,3,3,0,0,1-.1.81,2.45,2.45,0,0,1-.8,1.26,3,3,0,0,1-.7.41v0a2.45,2.45,0,0,1,.73.3,2.48,2.48,0,0,1,.61.56,2.63,2.63,0,0,1,.41.78,3,3,0,0,1,.15,1,3.19,3.19,0,0,1-.25,1.29,2.68,2.68,0,0,1-.72,1,3,3,0,0,1-1.11.6,3.93,3.93,0,0,1-1.44.14,5.63,5.63,0,0,1-.75-.11,5.16,5.16,0,0,1-.66-.2,4.72,4.72,0,0,1-.55-.26,2.25,2.25,0,0,1-.41-.28l.37-1.74.32.21.44.21a3.65,3.65,0,0,0,.53.19,3.56,3.56,0,0,0,.57.09,1.93,1.93,0,0,0,.66-.08,1.12,1.12,0,0,0,.48-.27,1.19,1.19,0,0,0,.3-.43,1.51,1.51,0,0,0,.1-.53,1.58,1.58,0,0,0-.15-.68,1.26,1.26,0,0,0-.38-.47,1.73,1.73,0,0,0-.54-.28,2,2,0,0,0-.61-.09h-.77V24.06h.74a1.77,1.77,0,0,0,.5-.07,1.42,1.42,0,0,0,.47-.21,1.06,1.06,0,0,0,.36-.37,1.11,1.11,0,0,0,.14-.56,1.18,1.18,0,0,0-.08-.43.79.79,0,0,0-.23-.34,1.07,1.07,0,0,0-.38-.21,1.55,1.55,0,0,0-.54-.06,2.74,2.74,0,0,0-.5.08,4.24,4.24,0,0,0-.47.17l-.41.21-.3.21-.37-1.67a3.2,3.2,0,0,1,.43-.31,5.26,5.26,0,0,1,.58-.27A4.78,4.78,0,0,1,18,20,4.88,4.88,0,0,1,18.74,19.88Z" fill="#484f60"/>
									</svg>
								</span>
							</button>						
						</div>						
						<div class="product-placeholder">
							<?php if ($configurator_renderLoader !== ''): ?>
								<div id="loading-gif" style="text-align: center; width:100%;">
									<img style="max-width:100px;" src="<?php echo $configurator_renderLoader?>"/>
								</div>							
							<?php else: ?>
								<div id="loading-gif" style="text-align: center; width:100%;">
									<img style="max-width:100px;" src="<?php echo esc_url(plugins_url("public/images/loading.gif", __FILE__)); ?>"/>
								</div>
							<?php endif; ?>					
							<div class="image-wrapper">
								<img id="render_img" src="" />
							</div>
						</div>
						<?php if($configurator_renderButton): ?>
							<div class="force-render">
								<button id="RenderIcon" onclick="getRenderImage()" class="getrender" title="Get render">
									<span>
										<svg id="Icons" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50">
											<defs><style>.cls-1{fill:none;stroke:#484f5f;stroke-miterlimit:10;}.cls-2{fill:#484f5f;}.cls-3{fill:#fff;}</style></defs>
											<g id="Icons-2" data-name="Icons"><rect class="cls-1" x="16" y="21.97" width="26" height="19.07"/>
											<polygon class="cls-2" points="42 38.49 33.33 31.5 29 35.01 23.8 28.9 16 37.65 16 41.03 42 41.03 42 38.49"/>
											<circle class="cls-2" cx="37.23" cy="26.73" r="2.17"/><circle class="cls-3" cx="18" cy="18.97" r="10"/>
											<path class="cls-2" d="M18,9.63A9.34,9.34,0,1,1,8.67,19,9.34,9.34,0,0,1,18,9.63M18,9A10,10,0,1,0,28,19,10,10,0,0,0,18,9Z"/>
											<path class="cls-2" d="M22.22,17.18a5.19,5.19,0,0,0-.42-.77,4.6,4.6,0,0,0-.56-.68,4.5,4.5,0,0,0-.68-.56,4.21,4.21,0,0,0-.78-.42,4.1,4.1,0,0,0-.86-.27,4.75,4.75,0,0,0-1.84,0,4.1,4.1,0,0,0-.86.27,4.21,4.21,0,0,0-.78.42,4.5,4.5,0,0,0-.68.56l-.27.29L14,15.6a3.26,3.26,0,0,1,.31-.33A5.31,5.31,0,0,1,16,14.14a5.65,5.65,0,0,1,1-.3,5.3,5.3,0,0,1,2.1,0,5.65,5.65,0,0,1,1,.3,5.31,5.31,0,0,1,1.66,1.13,4.76,4.76,0,0,1,.64.77,5.1,5.1,0,0,1,.48.89Z"/><polygon class="cls-2" points="12 14.23 16.94 16.79 13.19 17.98 12 14.23"/><path class="cls-2" d="M18,24.2A5.27,5.27,0,0,1,17,24.09a5.65,5.65,0,0,1-1-.3,5.86,5.86,0,0,1-.89-.48,6.7,6.7,0,0,1-.77-.64,5.31,5.31,0,0,1-.64-.78,5.1,5.1,0,0,1-.48-.89l.6-.25a5.86,5.86,0,0,0,.42.78,4.77,4.77,0,0,0,2,1.66,4.77,4.77,0,0,0,.86.26,4.39,4.39,0,0,0,1.84,0,4.77,4.77,0,0,0,.86-.26,4.55,4.55,0,0,0,.78-.43,4.5,4.5,0,0,0,.68-.56l.27-.29.5.42c-.1.12-.2.23-.31.34a6.7,6.7,0,0,1-.77.64,5.86,5.86,0,0,1-.89.48,5.65,5.65,0,0,1-1,.3A5.27,5.27,0,0,1,18,24.2Z"/><polygon class="cls-2" points="24 23.7 19.06 21.15 22.81 19.95 24 23.7"/></g>
										</svg>
									</span>
								</button>
							</div>
						<?php endif; ?>					
						<div class="force-expand fixedElement" id="scroller-anchor">
							<button id="ExpandIcon" class="getexpand" onclick="getExpandView()" title="Get expand">
								<span id="ExpandText">									
									<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50">
										<path d="M38,38.17H12v-26H38ZM13.24,36.93H36.76V13.4H13.24Z" fill="#484f60"/><polygon points="17.35 32.81 17.35 26.75 19.46 28.86 28.69 19.63 26.59 17.52 32.65 17.52 32.65 23.58 30.54 21.47 21.31 30.71 23.41 32.81 17.35 32.81" fill="#484f60"/>
									</svg>
								</span>
							</button>
							<span id="ScrollGesture">scroll</span>	
						</div>
					<?php endif; ?>
				</div>
				<div class="product-info">
					<?php if($configurator_showName): ?>
						<div class="configurator-data">
							<div class="product-name">
								<h4 id="title_wrapper"></h4>
							</div>
						</div>
					<?php else: ?>
						<span style="display: none !important;" id="title_wrapper"></span>						
					<?php endif; ?>
					<div class="selections" id="selections">
						<div class="mobile mobile-selections-header" id="mobheader" onclick="getMobileSelections()">
							<?php if ($configurator_showConfigureText): ?>
								<?php if($configurator_customConfigureText !== ''): ?>
									<span><?php echo $configurator_customConfigureText ?></span>
								<?php else: ?>
									<span>Configure</span>
								<?php endif;?>
							<?php endif;?>						
						</div>
						<threed-selections id=selector></threed-selections>
					</div>
					<div class="cta-buttons">
						<?php if($configurator_printButton): ?>
							<div class="addtoprint" id="pdf_click">
								<button class="addto primary to-pdf">
									<?php if($configurator_printText !== ''): ?>
										<span><?php echo $configurator_printText ?></span>
									<?php else: ?>
										<span>Print to pdf</span>
									<?php endif; ?>
								</button>
							</div>
							<span class="print-config" id="print_config" style="display:none"></span>							
						<?php endif; ?>
						<?php if($configurator_contactButton): ?>
							<div class="quote-btn" id="quote_btn">
								<button class="addto primary to-mail">
									<?php if($configurator_contactText !== ''): ?>	
										<span><?php echo $configurator_contactText ?></span>
									<?php else: ?>
										<span>Contact us</span>
									<?php endif; ?>
								</button>
							</div>							
						<?php endif; ?>
					</div>
				</div>
				<?php if($configurator_contactButton): ?>
					<?php include(plugin_dir_path(__FILE__) . 'templates/contact-form.php'); ?>
				<?php endif; ?>					
			</div>
		</div>
	</div>
</div>
<?php endif; ?>
<script>

/* iOne connection settings */


	

	 connectorSettings = {
 		url: '<?php echo esc_url($configurator_url); ?>', // iOne url
		ajaxUrl: '<?php echo esc_url($configurator_url); ?>',
 		schema: '<?php echo esc_attr($configurator_schema); ?>', // iOne scheme
 		version: '<?php echo esc_attr($configurator_version); ?>', // iOne version
 		assetPath: 'https://cdn.ione360.com/content43/', // image cdn 3d models
 		assetIndex: '<?php echo esc_textarea($configurator_assets); ?>',
		threeDAssetPath: '<?php echo esc_textarea($configurator_cdn); ?>',
		cameraConfig: '<?php echo esc_textarea($configurator_camera); ?>',
		lightPresetsIndex: '<?php echo esc_textarea($configurator_light); ?>',
		sceneBackground: '<?php echo esc_textarea($configurator_background); ?>',
 		languageCode: '<?php echo esc_textarea($configurator_language); ?>', // German -> DE, English -> EN
		currencySymbol: '<?php echo esc_textarea($configurator_currency); ?>',
 		gtm: '<?php echo esc_textarea($configurator_gtm); ?>', // GTM code
		options: {
				showStandaloneARButton: <?php if (empty($configurator_AREnabled)) {echo "false";} else {echo "true";} ?>,
				arEnabled: <?php if (empty($configurator_AREnabled)) {echo "false"; } else {echo "true";} ?>,
				useStandaloneFloors: <?php if (empty($configurator_standaloneFloors)) {echo "false"; } else {echo "true"; } ?>,
				inlineAnswers: false,
				useStandaloneHighLight: false,
				showAsConfigured: <?php if (empty($configurator_showAsConfigured)) {echo "false"; } else {echo "true"; } ?>,
				/*vrEnabled: <?php if (empty($configurator_vrEnabled)) {echo "false"; } else {echo "true"; } ?>,*/
				show3DWatermark: <?php if (empty($configurator_show3dwatermark)) {echo "false";} else {echo "true"; } ?>,
				showTagFilter: <?php if (empty($configurator_showtagfilter)) {echo "false"; } else {echo "true"; } ?>,
				showZoomButton: <?php if (empty($configurator_showzoombutton)) {echo "false"; } else {echo "true"; } ?>,
				showMeasurementsButton: <?php if (empty($configurator_showdimensions)) {echo "false"; } else {echo "true"; } ?>,
				showDownloadButton: <?php if (empty($configurator_showdownload)) {echo "false";} else {echo "true";} ?>,				  
				useNewRender: false,
				useThumbnailImage: <?php if (empty($configurator_contactButton)) {echo "false";} else {echo "true";} ?>,	
				useCanvasImage: <?php if (empty($configurator_userenders)) {echo "false";} else {echo "true";} ?>,
			},
		}
		document.addEventListener('DOMContentLoaded', function(){
    
    	let sku = '<?=$sku?>';
		let render = '<?=$render?>';
		console.log(render);

			/* Setting sku and settings on selector object */
			document.getElementById('selector').setAttribute('sku', sku);
			document.getElementById('selector').setAttribute('settings', JSON.stringify(connectorSettings));
			document.getElementById('selector').addEventListener('onImageReceived', function (event) {
			})
			<?php if($configurator_userenders && !$configurator_useioneimages): ?>
				document.getElementById('selector').addEventListener('onCanvasImageReceived', function (event) {
					document.getElementById("render_img").src = event.detail;
					document.getElementById("loading-gif").style.display = "none";
					document.getElementById("render_img").style.opacity = "1";
				});

				document.getElementById('selector').addEventListener('onReadyToRender', function (event) {
					document.getElementById('selector').forceRenderImage();
				});	
			<?php elseif ($configurator_useioneimages): ?>
				document.getElementById("loading-gif").style.display = "none";
			<?php else: ?>
				document.getElementById("loading-gif").style.display = "none";
				document.getElementById("SwitchView").style.display = "none";
			<?php endif; ?>	
			<?php if($configurator_contactButton): ?>
					document.getElementById('selector').addEventListener('onThumbnailReceived', function (event) {
						document.getElementById("cart_image").src = event.detail;
					});	
			<?php endif; ?>			
			document.getElementById('selector').addEventListener('onArticleReceived', function (event) {
				console.log(event.detail);
				document.getElementById('title_wrapper').innerHTML = event.detail.name;
				<?php if($configurator_showName): ?>
					
					<?php if ($configurator_layout || esc_textarea($layout === 'new')): ?>
						const formatter = new Intl.NumberFormat('en-US', {
						  style: 'currency',
						  currency: '<?php echo $currency_format ?>',
						});					
						<?php if ($configurator_show_from_price): ?>
							document.getElementById('price_wrapper').innerHTML = formatter.format(event.detail.price);
						<?php endif; ?>
						if(event.detail.texts['0']) {
							event.detail.texts.forEach(function(element) {
								document.getElementById('desc_wrapper').innerHTML += element['text'];
							});
						};
					<?php endif; ?>	
				<?php endif; ?>	
				<?php if($configurator_useioneimages): ?>
					if(event.detail.images['0']) {
						document.getElementById('render_img').src = ('data:image/png;base64,') + event.detail.images['0'].documentBody;
					}
					document.getElementById("loading-gif").style.display = "none";
				<?php endif; ?>
			})			
			document.getElementById('selector').addEventListener('onAnswersAvailable', function (event) {
				if (event.detail == false) {
					console.log('show cart');
				} else {
					console.log('hide cart');
				}
			})
			document.getElementById('selector').addEventListener('onSelectionsReceived', function (event) {
				<?php if($configurator_userenders): ?>
					document.getElementById("loading-gif").style.display = "block";
				<?php elseif($configurator_useioneimages): ?>
					document.getElementById("loading-gif").style.display = "none";
				<?php endif; ?>
				var titleDiv = document.getElementById('title_wrapper').innerHTML;
				let answerString = 'Article: ' + titleDiv + '\n';
				event.detail.forEach(function(element) {
					if (element.node !== 0) {
						if(element.grouped === true) {
							if(element.selection !== '') {
								answerString += element.selection + ' - ' + element.lastAnswer + '\n';
							}
						} else {
							if(element.selection !== '') {
								answerString += element.selection + '\n';
							}
						}
						//answerString += element.selection;
					}
					<?php if ($configurator_showAsConfigured && ($configurator_layout || esc_textarea($layout === 'new'))): ?>
						const formatter = new Intl.NumberFormat('en-US', {
						  style: 'currency',
						  currency: '<?php echo $currency_format ?>',
						});						
						if (element.totalRetailPrice && element.totalRetailPrice > 0) {
							let totalPrice = element.totalRetailPrice;
							document.getElementById("sum_price").innerHTML = formatter.format(element.totalRetailPrice);
						} else {
							let totalPrice = 'no price';
							document.getElementById("sum_price").innerHTML = totalPrice;
						}
					<?php endif; ?>
				});			
				jQuery("#Configuration").val(answerString);	
				<?php if($configurator_printButton): ?>
					jQuery("#print_config").html(answerString);
				<?php endif; ?>
			})
			/* Mobile selection drop (bottom) */
			jQuery("#selections-click").click(function(){
				jQuery("#selections-expand").toggleClass("expand-mobile");
			});
			jQuery("#title_drop").click(function(){
				jQuery(".product-essential").toggleClass("name");
			});	
			<?php if(!$configurator_useioneimages): ?>
				if(jQuery(window).width() < 786) {
					var $anchor = jQuery(".fixedElement");
					var $scroller = jQuery('#ExpandIcon');
					var $bottom = jQuery(".product-info");
					var $gesture = jQuery(".force-expand:after");
					var move = function() {
						var st = jQuery(window).scrollTop();
						var ot = $anchor.offset().top;
						var bt = $bottom.offset().top;
						if(st > ot && st < (bt - 70)) {
							$scroller.css({
								//position: "fixed",
								//top: "0px",
								//right: "15px"
							});
							$anchor.addClass('gesture');
						} else if (st > (bt - 70)){
							$scroller.css({
								//position: "absolute",
								//bottom: "0px",
								//top: "initial",
								//right: "0px"
							});
						} else {
							$scroller.css({
								//position: "absolute",
								//bottom: "initial",
								//top: "0px",
								//right: "0px"
							});	
							$anchor.removeClass('gesture');
						}
					};
					jQuery(window).scroll(move);
					move();
				}
			<?php endif; ?>
			setTimeout(function() {
				jQuery('#loading-gif').fadeOut();
				jQuery('.product-main-information').fadeIn();
			},2000);
			/*var icon = document.getElementById("icon");
			var icon1 = document.getElementById("a");
			var icon2 = document.getElementById("b");
			var icon3 = document.getElementById("c");
			var body = document.body;
			icon.addEventListener('click', function() {
			  icon1.classList.toggle('a');
			  icon2.classList.toggle('c');
			  icon3.classList.toggle('b');
			  body.classList.toggle("nav-config");
			});		*/				
			jQuery(".threed-thumb-layover").click(function() {
				jQuery('.configurator-image').toggleClass('twod');
				jQuery('.configurator-image').toggleClass('threed');
				//jQuery(".product-essential").toggleClass("name");
			});	
			jQuery("#two_old").click(function() {
				jQuery('.configurator-image').addClass('twod');
				jQuery('.configurator-image').removeClass('threed');
				//jQuery(".product-essential").toggleClass("name");
			});
			jQuery("#three_old").click(function() {
				jQuery('.configurator-image').removeClass('twod');
				jQuery('.configurator-image').addClass('threed');
				//jQuery(".product-essential").toggleClass("name");
			});				
			jQuery("#render_img").click(function() {
				jQuery('body').toggleClass('full-render');
			});	
			<?php if($configurator_printButton): ?>				
				jQuery("#pdf_click").click(function() {
					window.addEventListener('afterprint', function() {
						jQuery(wrapperDiv).remove();
					});											
					var dataURL = document.getElementById('selector').getCanvasImage();
					var prodInfo = document.getElementById('print_config');
					<?php if($configurator_showName): ?>
						var prodName = document.getElementById('title_wrapper');
					<?php endif; ?>
					var prodCopy = jQuery(prodInfo).clone();
					var selectInfo = jQuery('.summary-line');
					var selectCopy = jQuery(selectInfo).clone();
					var wrapperDiv = document.createElement('div');
					var innerDiv = document.createElement('div');
					var headerDiv = document.createElement('div');
					var topDiv = document.createElement('div');
					var bottomDiv = document.createElement('div');
					var bot_leftDiv = document.createElement('div');
					var bot_rightDiv = document.createElement('div');
					var imageDiv = document.createElement('img');
					jQuery(wrapperDiv).append(innerDiv);
					jQuery(innerDiv).append(headerDiv);
					jQuery(innerDiv).append(topDiv);	
					jQuery(innerDiv).append(bottomDiv);
					jQuery(topDiv).append(imageDiv);					
					jQuery(bottomDiv).append(bot_leftDiv);
					jQuery(bottomDiv).append(bot_rightDiv);					
					jQuery(wrapperDiv).addClass('pdf-container');
					jQuery(innerDiv).addClass('pdf-inner');
					jQuery(headerDiv).addClass('pdf-header');
					jQuery(topDiv).addClass('pdf-top');
					jQuery(bottomDiv).addClass('pdf-bottom');
					jQuery(bot_leftDiv).addClass('pdf-left');
					jQuery(bot_rightDiv).addClass('pdf-right');					
					<?php if($configurator_showName): ?>
						var prodName = document.getElementById('title_wrapper');
						var nameCopy = jQuery(prodName).clone();
						jQuery(headerDiv).append(nameCopy);
					<?php endif; ?>					
					jQuery('body').append(wrapperDiv);
					
					jQuery(imageDiv).attr('src', dataURL);
					jQuery(bot_leftDiv).html(prodCopy);
					jQuery(bot_rightDiv).html(selectCopy);
					setTimeout(function() {
						window.print();		
					},200);					
				});					  			
			<?php endif; ?>			
			jQuery("#gif").click(function() {
				jQuery('#gif').hide();
			});				
		}, false);

		function getRenderImage() {
			document.getElementById("loading-gif").style.display = "block";
			document.getElementById('selector').forceRenderImage();
		}
		
		function getExpandView() {
			 document.body.classList.toggle("expanded");
		}
		function getMobileSelections() {
			 document.getElementById("selections").classList.toggle("expanded");
		}	
		
	</script>
