PageSourceSearch

https://unicarshonda.com/wp-content/themes/shopperexpress/assets/dist/js/app.js?ver=2.0.99

js unicarshonda.com collected 2026-09-29 16:38:02 UTC 685,977 bytes, 12,821 lines download raw bytes

1// Google Reviews init
2function initGoogleReviews() {
3	document.querySelectorAll('[data-google-reviews]').forEach((holder) => {
4		new GoogleReviews(holder, {
5			onRender: function() {
6				jQuery(this.listElement)
7					.add(this.modalListElement)
8					.find('[data-toggle="tooltip"]:not([data-original-title])')
9					.tooltip();
10			}
11		});
12	});
13}
14
15// Search Modal init
16function initSearchModal() {
17	document.querySelectorAll('.toggle-search-modal').forEach((holder) => {
18		new SearchModal(holder);
19	});
20}
21
22// Confirm Delete Modal init
23function initConfirmDeleteModal() {
24	const $doc = jQuery(document);
25	const $body = jQuery('body');
26	const $editModal = jQuery('#editModal');
27	const $confirmModal = jQuery('#confirmDelete');
28
29	let savedBodyPaddingRight = null;
30	let savedScrollbarWidth = null;
31
32	function getComputedBodyPR() {
33		return window.getComputedStyle(document.body).paddingRight || '';
34	}
35
36	function measureScrollbarWidth() {
37		return window.innerWidth - document.documentElement.clientWidth;
38	}
39
40	function computeSafePaddingRight() {
41		if (savedBodyPaddingRight && savedBodyPaddingRight !== '0px') {
42			return savedBodyPaddingRight;
43		}
44
45		const sw =
46			savedScrollbarWidth != null
47				? savedScrollbarWidth
48				: measureScrollbarWidth();
49
50		return sw > 0 ? sw + 'px' : '';
51	}
52
53	function lockBodyIfEditOpen() {
54		if ($editModal.hasClass('show')) {
55			$body
56				.addClass('modal-open')
57				.css('padding-right', computeSafePaddingRight());
58
59			return true;
60		}
61
62		return false;
63	}
64
65	function lockBodyDeferred() {
66		lockBodyIfEditOpen();
67		setTimeout(lockBodyIfEditOpen, 0);
68
69		if (window.requestAnimationFrame) {
70			requestAnimationFrame(lockBodyIfEditOpen);
71		}
72	}
73
74	$confirmModal.on('show.bs.modal', function() {
75		setTimeout(function() {
76			jQuery('.modal-backdrop').last().addClass('confirm-delete-backdrop');
77		}, 10);
78	});
79
80	$doc.on('show.bs.modal', '.modal', function() {
81		if (jQuery('.modal.show').length === 0) {
82			savedScrollbarWidth = measureScrollbarWidth();
83		}
84	});
85
86	$doc.on('shown.bs.modal', '.modal', function() {
87		if (jQuery('.modal.show').length === 1) {
88			savedBodyPaddingRight = getComputedBodyPR();
89		}
90	});
91
92	$confirmModal.on('hide.bs.modal', function() {
93		if ($editModal.hasClass('show')) {
94			savedBodyPaddingRight = getComputedBodyPR();
95			lockBodyDeferred();
96		}
97	});
98
99	$confirmModal.on('hidden.bs.modal', function() {
100		if ($editModal.hasClass('show')) {
101			lockBodyDeferred();
102		}
103	});
104
105	$confirmModal
106		.find('#confirmYes')
107		.off('click.initConfirmDelete')
108		.on('click.initConfirmDelete', function() {
109			let remaining = 2;
110
111			function afterHidden() {
112				remaining--;
113				if (remaining === 0) {
114					$body.removeClass('modal-open').css('padding-right', '');
115					savedBodyPaddingRight = null;
116					savedScrollbarWidth = null;
117				}
118			}
119
120			savedBodyPaddingRight = getComputedBodyPR();
121			lockBodyDeferred();
122
123			$confirmModal.one('hidden.bs.modal', afterHidden);
124			$editModal.one('hidden.bs.modal', afterHidden);
125
126			$confirmModal.modal('hide');
127			$editModal.modal('hide');
128		});
129
130	$doc.on('show.bs.modal.stacked', '.modal', function() {
131		const z = 1040 + 10 * jQuery('.modal.show').length;
132
133		jQuery(this).css('z-index', z);
134
135		setTimeout(function() {
136			jQuery('.modal-backdrop')
137				.not('.modal-stack')
138				.css('z-index', z - 1)
139				.addClass('modal-stack');
140		}, 0);
141	});
142
143	$doc.on('hidden.bs.modal', '.modal', function() {
144		setTimeout(function() {
145			if (jQuery('.modal.show').length) {
146				savedBodyPaddingRight = getComputedBodyPR() || savedBodyPaddingRight;
147				lockBodyDeferred();
148			} else {
149				$body.removeClass('modal-open').css('padding-right', '');
150				savedBodyPaddingRight = null;
151				savedScrollbarWidth = null;
152			}
153		}, 0);
154	});
155}
156
157// Hover class init
158function initHoverClass() {
159	const activeClass = 'custom-hover';
160	const holders = document.querySelectorAll('.card-team');
161
162	if (!holders.length) return;
163
164	function setActiveHolder(activeHolder) {
165		holders.forEach((holder) => {
166			holder.classList.toggle(activeClass, holder === activeHolder);
167		});
168	}
169
170	holders.forEach((holder) => {
171		holder.addEventListener('mouseenter', () => {
172			setActiveHolder(holder);
173		});
174
175		holder.addEventListener('mouseleave', () => {
176			if (!holder.contains(document.activeElement)) {
177				holder.classList.remove(activeClass);
178			}
179		});
180
181		holder.addEventListener('focusin', () => {
182			setActiveHolder(holder);
183		});
184
185		holder.addEventListener('focusout', (e) => {
186			if (!holder.contains(e.relatedTarget) && !holder.matches(':hover')) {
187				holder.classList.remove(activeClass);
188			}
189		});
190	});
191
192	document.addEventListener('click', (e) => {
193		setActiveHolder(e.target.closest('.card-team'));
194	});
195}
196
197function initOpenPdfInNewTab() {
198	document.querySelectorAll('.details-badges').forEach((holder) => {
199		const links = holder.querySelectorAll('a[data-pdf]');
200
201		if (!links.length) return;
202
203		links.forEach((link) => {
204			link.addEventListener('click', (e) => {
205				e.preventDefault();
206
207				const gaLabel = link.getAttribute('data-ga-label');
208				if (gaLabel && typeof gtag === 'function') {
209					gtag('event', 'vdr_download', {
210						event_category: 'VDR',
211						event_label: gaLabel
212					});
213				}
214
215				const url = link.getAttribute('href');
216				sendRequest(url, link);
217			});
218		});
219
220		async function sendRequest(url, link) {
221			if (!url) return;
222
223			try {
224				const response = await fetch(url, {
225					method: 'GET'
226				});
227
228				if (!response.ok) {
229					throw new Error(`HTTP ${response.status}`);
230				}
231
232				const data = await response.json();
233
234				onSuccess(data, link);
235			} catch (error) {
236				console.error('Error:', error);
237				showVdrError(link);
238			}
239		}
240
241		function onSuccess(response, link) {
242			if (response.success) {
243				if (response.data.url) {
244					window.open(response.data.url, '_blank');
245				}
246			} else {
247				showVdrError(link);
248			}
249		}
250
251		function showVdrError(link) {
252			const li = link.closest('li');
253			if (li) li.style.display = 'none';
254
255			const errorMessage = link.getAttribute('data-error-message') || 'Sorry, we could not generate the vehicle report at this time. Please try again later.';
256
257			let modal = document.getElementById('vdrErrorModal');
258			if (!modal) {
259				modal = document.createElement('div');
260				modal.id = 'vdrErrorModal';
261				modal.className = 'modal fade';
262				modal.setAttribute('tabindex', '-1');
263				modal.setAttribute('role', 'dialog');
264				modal.setAttribute('aria-hidden', 'true');
265				modal.innerHTML = '<div class="modal-dialog modal-dialog-centered" role="document">'
266					+ '<div class="modal-content">'
267					+ '<div class="modal-header">'
268					+ '<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>'
269					+ '</div>'
270					+ '<div class="modal-body" id="vdrErrorModalBody"></div>'
271					+ '</div></div>';
272				document.body.appendChild(modal);
273			}
274
275			document.getElementById('vdrErrorModalBody').textContent = errorMessage;
276
277			if (typeof jQuery !== 'undefined' && jQuery.fn.modal) {
278				jQuery('#vdrErrorModal').modal('show');
279			}
280		}
281	});
282}
283
284// Content tabs init
285function initTabs() {
286	const activeClass = 'filter-mileage-active';
287	const modal = jQuery('#filterSchedule');
288
289	if (jQuery('.filter-list').length) {
290		jQuery('.filter-list').tabset({
291			tabLinks: 'a',
292			attrib: 'data-tab',
293			tabAttrib: 'data-id',
294			defaultTab: false,
295			onChange: function() {
296				toggleClass();
297			}
298		});
299	}
300
301	if (modal.length) {
302		modal.on('shown.bs.modal', function() {
303			toggleClass();
304		});
305	}
306
307	function toggleClass() {
308		if (modal.length) {
309			modal.find('.modal-range-box').each(function() {
310				if (jQuery(this).closest('[data-id].active').length) {
311					modal.addClass(activeClass);
312				} else {
313					modal.removeClass(activeClass);
314				}
315			});
316		}
317	}
318}
319
320// Edit modal init
321function initEditModal() {
322	document.querySelectorAll('.modal-edit').forEach((modal) => {
323		// API mode: form id is api-edit-form — handled separately below.
324		if (!modal.querySelector('#api-edit-form')) {
325			new EditModal(modal);
326		}
327	});
328
329	// API mode edit modal — save to Intice Nexus via wps_api_save_vehicle.
330	const $apiModal = jQuery('#editModal:has(#api-edit-form)');
331	if ($apiModal.length) {
332		const $form         = $apiModal.find('#api-edit-form');
333		const $errorAlert   = $apiModal.find('.alert.bg-danger');
334		const $successAlert = $apiModal.find('.alert.bg-success');
335
336		$apiModal.on('click', '[data-save]', function(e) {
337			e.preventDefault();
338
339			const formData = new FormData($form[0]);
340			formData.append('action', 'wps_api_save_vehicle');
341
342			$form.addClass('loading');
343			$errorAlert.removeClass('show');
344			$successAlert.removeClass('show');
345
346			jQuery.ajax({
347				url: window.ajax.admin,
348				type: 'POST',
349				data: formData,
350				processData: false,
351				contentType: false,
352				success: function(response) {
353					$form.removeClass('loading');
354					if (response.success) {
355						$successAlert.addClass('show');
356					} else {
357						$errorAlert.addClass('show');
358						console.error(response.data?.message || 'API save error');
359					}
360				},
361				error: function(xhr) {
362					$form.removeClass('loading');
363					$errorAlert.addClass('show');
364					console.error('AJAX Error:', xhr);
365				}
366			});
367		});
368
369		$apiModal.on('click', '.close-alert', function() {
370			jQuery(this).closest('.alert').removeClass('show');
371		});
372
373		$apiModal.on('hidden.bs.modal', function() {
374			$errorAlert.removeClass('show');
375			$successAlert.removeClass('show');
376		});
377
378		// API mode: per-vehicle cache clear (same 'clear' action/handler as legacy mode).
379		$apiModal.on('click', '[data-clear]', function(e) {
380			e.preventDefault();
381
382			const postType = jQuery(this).data('clear');
383
384			$form.addClass('loading');
385			$errorAlert.removeClass('show');
386			$successAlert.removeClass('show');
387
388			jQuery.ajax({
389				url: window.ajax.admin,
390				type: 'POST',
391				data: {
392					action: 'clear',
393					post_type: postType
394				},
395				success: function(response) {
396					$form.removeClass('loading');
397					if (response.success) {
398						$successAlert.find('strong').text(response.data.message);
399						$successAlert.addClass('show');
400					} else {
401						$errorAlert.find('strong').text(response.data?.message || 'Clear cache error');
402						$errorAlert.addClass('show');
403						console.error(response.data?.message || 'Clear cache error');
404					}
405				},
406				error: function(xhr) {
407					$form.removeClass('loading');
408					$errorAlert.find('strong').text('Clear cache request failed.');
409					$errorAlert.addClass('show');
410					console.error('AJAX Error:', xhr);
411				}
412			});
413		});
414	}
415
416	// Confirm delete button handler
417	jQuery('#confirmYes').on('click', function(e) {
418		e.preventDefault();
419
420		const $btn = jQuery(this);
421		const vin  = $btn.data('vin');
422
423		// API mode: trash the vehicle via Intice Nexus (soft-delete), keyed by VIN.
424		if (vin) {
425			const nonce = jQuery('#api-edit-form input[name="delete_nonce"]').val();
426
427			jQuery.ajax({
428				url: window.ajax.admin,
429				type: 'POST',
430				data: {
431					action: 'wps_api_delete_vehicle',
432					vin: vin,
433					nonce: nonce
434				},
435				success: function(response) {
436					if (response.success) {
437						window.location.href = '/';
438					} else {
439						console.error('Error: ' + (response.data?.message || response.data));
440					}
441				},
442				error: function() {
443					console.error('AJAX request failed');
444				}
445			});
446
447			return;
448		}
449
450		const post_id = $btn.data('post-id');
451
452		jQuery.ajax({
453			url: window.ajax.admin,
454			type: 'POST',
455			data: {
456				action: 'delete_listings',
457				post_id: post_id
458			},
459			success: function(response) {
460				if (response.success) {
461					window.location.href = '/';
462				} else {
463					console.error('Error: ' + response.data);
464				}
465			},
466			error: function() {
467				console.error('AJAX request failed');
468			}
469		});
470	});
471}
472
473// Add css variables
474function initAddCssVariales() {
475	const header = document.querySelector('#header');
476
477	if (!header) return;
478
479	setCssVariable();
480	window.addEventListener('load', setCssVariable);
481	window.addEventListener('resize', setCssVariable);
482
483	function setCssVariable() {
484		header.style.setProperty('--header-height', `${header.offsetHeight}px`);
485	}
486}
487
488function initChat() {
489	document.querySelectorAll('.ai-chat').forEach((holder) => {
490		new Chat(holder);
491	});
492}
493
494/*
495 * Chat module
496 */
497class Chat {
498	constructor(holder, options) {
499		this.options = {
500			inputSelector: '.ai-chat__input',
501			footerSelector: '.ai-chat__footer-holder',
502			submitSelector: '.ai-chat__submit',
503			focusClass: 'input-focus',
504			activeClass: 'input-active',
505			...options
506		};
507
508		if (!holder) return;
509
510		this.holder = holder;
511
512		this.init();
513	}
514
515	init() {
516		this.inputField = this.holder.querySelector(this.options.inputSelector);
517		this.footerBlock = this.holder.querySelector(this.options.footerSelector);
518		this.submitButton = this.holder.querySelector(this.options.submitSelector);
519
520		if (!this.inputField || !this.footerBlock) return;
521
522		this.placeholderText = this.inputField.innerHTML;
523
524		if (this.getInputValue() !== '') {
525			this.footerBlock.classList.add(this.options.activeClass);
526		}
527
528		this.attachEvents();
529	}
530
531	attachEvents() {
532		this.inputField.addEventListener('focus', () => {
533			this.footerBlock.classList.add(this.options.focusClass);
534		});
535
536		this.inputField.addEventListener('input', () => {
537			this.toggleActiveState();
538		});
539
540		this.inputField.addEventListener('keydown', (e) => {
541			this.handleEnterKey(e);
542		}, true);
543
544		this.inputField.addEventListener('beforeinput', (e) => {
545			this.handleBeforeInput(e);
546		});
547
548		this.inputField.addEventListener('blur', () => {
549			this.footerBlock.classList.remove(this.options.focusClass);
550			this.toggleActiveState();
551		});
552	}
553
554	handleEnterKey(e) {
555		const isEnter = e.key === 'Enter';
556
557		if (!isEnter || e.shiftKey || e.isComposing) return;
558
559		e.preventDefault();
560		e.stopPropagation();
561		this.submitMessage();
562	}
563
564	handleBeforeInput(e) {
565		if (e.inputType !== 'insertParagraph') return;
566
567		e.preventDefault();
568	}
569
570	submitMessage() {
571		if (!this.submitButton) return;
572		if (this.getInputValue() === '') return;
573
574		this.submitButton.click();
575		this.footerBlock.classList.remove(this.options.activeClass);
576		this.inputField.blur();
577	}
578
579	getInputValue() {
580		return this.inputField.textContent.replace(/\u00a0/g, ' ').trim();
581	}
582
583	toggleActiveState() {
584		const hasValue = this.getInputValue() !== '';
585
586		this.footerBlock.classList.toggle(this.options.activeClass, hasValue);
587
588		if (!hasValue) {
589			this.inputField.innerHTML = this.placeholderText;
590		}
591	}
592}
593
594/*
595 * Edit Modal module
596 */
597class EditModal {
598	constructor(holder, options) {
599		this.options = {
600			formID: 'custom-acf-form',
601			loadingClass: 'loading',
602			errorAlert: '.alert.bg-danger',
603			successAlert: '.alert.bg-success',
604			btnClearCashSelector: '[data-clear]',
605			btnSaveSelector: '[data-save]',
606			showClass: 'show',
607			closeAlertButton: '.close-alert',
608			...options
609		};
610
611		if (holder) {
612			this.holder = holder;
613
614			this.init();
615		}
616	}
617
618	init() {
619		this.form = this.holder.querySelector(`#${this.options.formID}`);
620		this.errorAlert = this.holder.querySelector(this.options.errorAlert);
621		this.successAlert = this.holder.querySelector(this.options.successAlert);
622		this.closeAlertButtons = this.holder.querySelectorAll(this.options.closeAlertButton);
623
624		if (!this.form) return;
625
626		this.attachEvents();
627	}
628
629	attachEvents() {
630		acf.unload.disable();
631
632		this.holder.addEventListener('click', (e) => {
633			const target = e.target;
634
635			if (target.closest(this.options.btnSaveSelector)) {
636				e.preventDefault();
637
638				this.formData = new FormData(this.form);
639
640				this.formData.append('action', 'save_listing');
641
642				this.validateAcfForm();
643			} else if (target.closest(this.options.btnClearCashSelector)) {
644				e.preventDefault();
645
646				this.clearCash(target.dataset.clear);
647			}
648		});
649
650		jQuery(this.holder).on('hidden.bs.modal', () => {
651			this.hideAlerts();
652		});
653
654		this.closeAlertButtons?.forEach((btn) => {
655			const alert = btn.closest('.alert');
656
657			btn.addEventListener('click', (e) => {
658				e.preventDefault();
659
660				if (alert) {
661					alert.classList.remove(this.options.showClass);
662				}
663			});
664		});
665	}
666
667	submitForm() {
668		jQuery.ajax({
669			url: window.ajax.admin,
670			type: 'POST',
671			data: this.formData,
672			processData: false,
673			contentType: false,
674			beforeSend: () => {
675				this.form.classList.add(this.options.loadingClass);
676			},
677			success: (response) => {
678				this.form.classList.remove(this.options.loadingClass);
679
680				if (response.success) {
681					this.onSuccess(response.data.message);
682				} else {
683					console.error(response.data?.message || 'Error saving fields');
684				}
685			},
686			error: (xhr) => {
687				this.form.classList.remove(this.options.loadingClass);
688
689				console.error('AJAX Error:', xhr);
690			}
691		});
692	}
693
694	clearCash(postType) {
695		jQuery.ajax({
696			url: window.ajax.admin,
697			type: 'POST',
698			data: {
699				action: 'clear',
700				post_type: postType
701			},
702			beforeSend: () => {
703				this.form.classList.add(this.options.loadingClass);
704			},
705			success: (response) => {
706				this.form.classList.remove(this.options.loadingClass);
707
708				this.onSuccess(response.data.message);
709			},
710			error: (xhr) => {
711				this.form.classList.remove(this.options.loadingClass);
712
713				console.error('AJAX Error:', xhr);
714			}
715		});
716	}
717
718	validateAcfForm() {
719		if (typeof acf === 'undefined') return;
720
721		this.hideAlerts();
722
723		const fields = acf.getFields({
724			parent: this.form
725		});
726
727		let isValid = true;
728		let firstInvalidField = null;
729
730		fields.forEach((field) => {
731			// Clear previous errors
732			if (typeof field.removeError === 'function') {
733				field.removeError();
734			}
735
736			// Validate required fields
737			if (field.get('required') && !field.val()) {
738				isValid = false;
739
740				if (!firstInvalidField) {
741					firstInvalidField = field.$el[0];
742				}
743
744				if (typeof field.showError === 'function') {
745					field.showError(acf.__('This field is required'));
746				}
747			}
748		});
749
750		if (isValid) {
751			this.submitForm();
752		} else {
753			this.onError();
754			this.focusFirstInvalidField(firstInvalidField);
755		}
756	}
757
758	hideAlerts() {
759		if (this.errorAlert) {
760			this.errorAlert.classList.remove(this.options.showClass);
761		}
762
763		if (this.successAlert) {
764			this.successAlert.classList.remove(this.options.showClass);
765		}
766	}
767
768	onSuccess(message) {
769		if (this.successAlert && message.trim() !== '') {
770			const messageElem = this.successAlert.querySelector('strong');
771
772			if (messageElem) {
773				messageElem.textContent = message;
774			}
775
776			this.successAlert.classList.add(this.options.showClass);
777		}
778	}
779
780	onError() {
781		if (this.errorAlert) {
782			this.errorAlert.classList.add(this.options.showClass);
783		}
784	}
785
786	focusFirstInvalidField(fieldElement) {
787		if (!fieldElement) return;
788
789		const tabPane = fieldElement.closest('.tab-pane');
790
791		if (tabPane && !tabPane.classList.contains('active')) {
792			const tabId = tabPane.getAttribute('id');
793			const tabTrigger = this.holder.querySelector(`[data-toggle="tab"][data-target="#${tabId}"]`);
794
795			if (tabTrigger) {
796				const tab = new bootstrap.Tab(tabTrigger);
797
798				tab.show();
799			}
800		}
801
802		setTimeout(() => {
803			const modalBody = this.holder.querySelector('.modal-body');
804
805			if (modalBody) {
806				const fieldRect = fieldElement.getBoundingClientRect();
807				const modalRect = modalBody.getBoundingClientRect();
808
809				const offset = fieldRect.top - modalRect.top + modalBody.scrollTop - 50;
810
811				modalBody.scrollTo({
812					top: offset,
813					behavior: 'smooth'
814				});
815			}
816		}, 300);
817	}
818}
819
820/**
821 * Lock buttons for a specified duration after click
822 *
823 * @param {string} selector
824 * @param {number} duration
825 */
826const ButtonLocker = (() => {
827	const STORAGE_KEY = 'buttonLockUntil';
828
829	function init(selector = '[data-clear]', duration = 60000) {
830		const buttons = document.querySelectorAll(selector);
831
832		if (!buttons.length) return;
833
834		applyLock(selector);
835
836		buttons.forEach((btn) => {
837			btn.addEventListener('click', (e) => {
838				if (btn.disabled) {
839					e.preventDefault();
840
841					return;
842				}
843
844				const unblockAt = Date.now() + duration;
845
846				localStorage.setItem(STORAGE_KEY, unblockAt);
847
848				lockButtons(selector);
849				setTimeout(() => applyLock(selector), duration + 50);
850			});
851		});
852
853		setInterval(() => applyLock(selector), 10000);
854	}
855
856	function applyLock(selector) {
857		const buttons = document.querySelectorAll(selector);
858
859		if (!buttons.length) return;
860
861		const unblockAt = Number(localStorage.getItem(STORAGE_KEY)) || 0;
862		const now = Date.now();
863
864		if (now >= unblockAt) {
865			unlockButtons(selector);
866			localStorage.removeItem(STORAGE_KEY);
867		} else {
868			lockButtons(selector);
869		}
870	}
871
872	function lockButtons(selector) {
873		const buttons = document.querySelectorAll(selector);
874
875		buttons.forEach((btn) => {
876			btn.disabled = true;
877			btn.classList.add('disabled');
878		});
879	}
880
881	function unlockButtons(selector) {
882		const buttons = document.querySelectorAll(selector);
883
884		buttons.forEach((btn) => {
885			btn.disabled = false;
886			btn.classList.remove('disabled');
887		});
888	}
889
890	return { init, applyLock };
891})();
892
893// Stretch iframe on page resize
894function initStretchIframe() {
895	const iframes = document.querySelectorAll('.evo-slider iframe.ratio-custom');
896
897	if (!iframes.length) return;
898
899	const iframeData = Array.from(iframes).map((iframe) => {
900		const width = iframe.width;
901		const height = iframe.height;
902		const ratio = width / height;
903
904		return {
905			iframe,
906			ratio
907		};
908	});
909
910	const triggerUpdateSliderHeight = debounce(() => {
911		window.dispatchEvent(new CustomEvent('updateSliderHeight'));
912	}, 250);
913
914	function updateIframes() {
915		iframeData.forEach(({ iframe, ratio }) => {
916			iframe.style.height = `${iframe.parentNode.offsetWidth / ratio}px`;
917		});
918
919		triggerUpdateSliderHeight();
920	}
921
922	const debouncedUpdate = debounce(updateIframes, 200);
923
924	updateIframes();
925
926	window.addEventListener('resize', debouncedUpdate);
927
928	function debounce(func, delay = 250) {
929		let timer = null;
930
931		return (...args) => {
932			clearTimeout(timer);
933
934			timer = setTimeout(() => func.apply(this, args), delay);
935		};
936	}
937}
938
939// Hide info button init
940function initHideInfoButton() {
941	document.querySelectorAll('.evo-slider-holder').forEach((iframeHolder) => {
942		const overlay = iframeHolder.querySelector('.evo-slider-btn-overlay');
943
944		if (!overlay) return;
945
946		overlay.addEventListener('click', hideInfoButton);
947
948		function hideInfoButton() {
949			overlay.style.display = 'none';
950
951			overlay.removeEventListener('click', hideInfoButton);
952		}
953	});
954}
955
956// Priority Navigation init
957function initPriorityNav() {
958	let originalNavHTML = null;
959
960	const saveOriginalHTML = () => {
961		const navHolder = jQuery('.nav-holder');
962
963		if (navHolder.length && !originalNavHTML) {
964			originalNavHTML = navHolder.prop('outerHTML');
965		}
966	};
967
968	saveOriginalHTML();
969
970	ResponsiveHelper.addRange({
971		'..991': {
972			on: () => {
973				const navHolder = jQuery('.nav-holder');
974
975				if (navHolder.length && originalNavHTML) {
976					navHolder.replaceWith(originalNavHTML);
977				}
978
979				jQuery('.main-navigation > li').openClose({
980					activeClass: 'active',
981					opener: '.drop-opener',
982					slider: '.slide',
983					animSpeed: 400,
984					effect: 'slide'
985				});
986			}
987		},
988		'992..': {
989			on: () => {
990				jQuery('.main-navigation > li').openClose('destroy');
991
992				priorityNav.init({
993					mainNavWrapper: '.nav-holder',
994					mainNav: 'ul.main-navigation',
995					navDropdownLabel: 'More',
996					breakPoint: 1
997				});
998
999				jQuery('.nav-holder .priority-nav__dropdown').attr('id', 'menu');
1000			}
1001		}
1002	});
1003}
1004
1005// Switch Logos init
1006function initSwitchLogos() {
1007	const activeClass = 'active';
1008
1009	document.querySelectorAll('.logo-slider').forEach((holder) => {
1010		if (holder.dataset.sliderInitialized === 'true') return;
1011
1012		const brands = [...holder.querySelectorAll('.slider-item')];
1013		const intervalTime =  Number.parseInt(holder.dataset.autoplaySpeed, 10) || 3000;
1014
1015		let currentIndex = 0;
1016
1017		if (!brands.length) return;
1018
1019		holder.dataset.sliderInitialized = 'true';
1020
1021		function updateHolderWidth() {
1022			const activeBrand = brands[currentIndex];
1023			const image = activeBrand?.querySelector('img');
1024
1025			if (!image) return;
1026
1027			requestAnimationFrame(() => {
1028				const imageWidth = image.getBoundingClientRect().width;
1029
1030				if (imageWidth > 0) {
1031					holder.style.width = `${imageWidth}px`;
1032				}
1033			});
1034		}
1035
1036		function setActiveBrand(index) {
1037			brands.forEach((brand, brandIndex) => {
1038				const isActive = brandIndex === index;
1039
1040				brand.classList.toggle(activeClass, isActive);
1041				brand.setAttribute('aria-hidden', String(!isActive));
1042				brand.tabIndex = isActive ? 0 : -1;
1043			});
1044
1045			updateHolderWidth();
1046		}
1047
1048		function switchBrand() {
1049			currentIndex = (currentIndex + 1) % brands.length;
1050			setActiveBrand(currentIndex);
1051		}
1052
1053		brands.forEach((brand) => {
1054			const image = brand.querySelector('img');
1055
1056			if (!image) return;
1057
1058			if (!image.complete) {
1059				image.addEventListener(
1060					'load',
1061					() => {
1062						if (brand.classList.contains(activeClass)) {
1063							updateHolderWidth();
1064						}
1065					},
1066					{ once: true }
1067				);
1068			}
1069		});
1070
1071		setActiveBrand(currentIndex);
1072
1073		window.addEventListener('resize', updateHolderWidth);
1074
1075		if (brands.length > 1) {
1076			window.setInterval(switchBrand, intervalTime);
1077		}
1078	});
1079}
1080
1081initSwitchLogos();
1082
1083// Update favorite
1084function initUpdateFavorite() {
1085	const activeClass = 'active';
1086	const url = window.location.origin + '/wp-json/favorite/v1/favorite-count';
1087	const btnUser = jQuery('#header .btn-user');
1088	const favoriteList = jQuery('#header .dropdown-menu [data-user]');
1089	const favoriteListingsCount = jQuery('#header .dropdown-menu .favorite-listings');
1090	const favoriteUsedListingsCount = jQuery('#header .dropdown-menu .favorite-used-listings');
1091	const favoriteConditionalOffersCount = jQuery('#header .dropdown-menu .favorite-conditional-offers');
1092	const favoriteLeaseOffersCount = jQuery('#header .dropdown-menu .favorite-lease-offers');
1093	const favoriteFinanceOffersCount = jQuery('#header .dropdown-menu .favorite-finance-offers');
1094	const favoriteOffersCount = jQuery('#header .dropdown-menu .favorite-offers');
1095
1096	jQuery(document).on('favorites-updated-single', function() {
1097		getFavorite();
1098	});
1099
1100	getFavorite();
1101
1102	function getFavorite() {
1103		jQuery.ajax({
1104			url,
1105			data: {
1106				user: favoriteList.length ? favoriteList.data('user') : 0
1107			},
1108			type: 'POST',
1109			success: function(data) {
1110				onSuccess(data);
1111			}
1112		});
1113	}
1114
1115	function onSuccess(data) {
1116		let total = 0;
1117
1118		// Helper function to update element and sum values
1119		function updateCount(item, key) {
1120			if (item && item.length) {
1121				const value = +data[key] || 0;
1122
1123				item.text(value);
1124				total += value;
1125			}
1126		}
1127
1128		updateCount(favoriteListingsCount, 'listings');
1129		updateCount(favoriteUsedListingsCount, 'used-listings');
1130		updateCount(favoriteConditionalOffersCount, 'conditional-offers');
1131		updateCount(favoriteLeaseOffersCount, 'lease-offers');
1132		updateCount(favoriteFinanceOffersCount, 'finance-offers');
1133		updateCount(favoriteOffersCount, 'offers');
1134
1135		btnUser.toggleClass(activeClass, total > 0);
1136	}
1137
1138	const type = window.ajax ? window.ajax.request.saved : undefined;
1139
1140	if (type) {
1141		if (window.ajax && window.ajax.api_mode) {
1142			jQuery.ajax({
1143				url: window.ajax.admin,
1144				type: 'POST',
1145				data: { action: 'wps_api_favorites_list' },
1146				success: function(response) {
1147					if (!response.success || !response.data) return;
1148					const vins = response.data[type] || [];
1149					if (!vins.length) return;
1150
1151					jQuery.post(
1152						window.location.origin + `/wp-json/favorite/v1/render?action=${type}`,
1153						{ post_id: vins.join(',') },
1154						function(resp) {
1155							if (resp.success) {
1156								jQuery('#listings-container').html(resp.html);
1157								initUnlockSavings();
1158								initApiFavoriteButtons();
1159							}
1160						}
1161					);
1162				}
1163			});
1164		} else {
1165			jQuery.ajax({
1166				url: window.ajax.admin,
1167				type: 'POST',
1168				data: {
1169					action: 'favorites_array'
1170				},
1171				success: function(response) {
1172					if (response.status === 'success') {
1173						const favorites = response.favorites;
1174						const posts = Object.values(favorites[0].posts);
1175						const postIDs = [];
1176
1177						if (posts.length > 0) {
1178							posts.forEach(function(post) {
1179								postIDs.push(post.post_id);
1180							});
1181
1182							const data = {
1183								post_id: postIDs.join(',')
1184							};
1185
1186							jQuery.post(window.location.origin + `/wp-json/favorite/v1/render?action=${type}`, data, function(response) {
1187								if (response.success) {
1188									jQuery('#listings-container').html(response.html);
1189									initUnlockSavings();
1190								}
1191							});
1192						}
1193					}
1194				}
1195			});
1196		}
1197	}
1198}
1199
1200function initRemoveBlock() {
1201	jQuery('#block-1 .payment-info').each(function() {
1202		const holder = jQuery(this);
1203		const items = holder.find('> li');
1204
1205		items.each(function() {
1206			const item = jQuery(this);
1207			const textHolder = item.find('.text-holder');
1208			const siblings = textHolder.siblings();
1209
1210			if (!siblings.length) {
1211				item.remove();
1212			}
1213		});
1214	});
1215}
1216
1217// init touch device
1218function initTouchDevice() {
1219	const isTouchDevice = /Windows Phone/.test(navigator.userAgent) || ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch;
1220
1221	if (isTouchDevice) {
1222		jQuery('html').addClass('touch-device');
1223	}
1224}
1225
1226// Favorite button sync (syncs favorite buttons on page load and on mutation)
1227function initFavoriteButtonSync() {
1228	const selector = '.simplefavorite-button[data-postid]';
1229	const activeClass = 'active';
1230	const emptyIconClass = 'sf-icon-star-empty';
1231	const fullIconClass = 'sf-icon-star-full';
1232
1233	function syncFrom(button) {
1234		const postid = button.dataset.postid;
1235		const isActive = button.classList.contains(activeClass);
1236
1237		document.querySelectorAll(selector).forEach((other) => {
1238			if (other === button || other.dataset.postid !== postid) return;
1239			if (other.classList.contains(activeClass) === isActive) return;
1240
1241			other.classList.toggle(activeClass, isActive);
1242			other.querySelectorAll('i').forEach((icon) => {
1243				icon.classList.toggle(emptyIconClass, !isActive);
1244				icon.classList.toggle(fullIconClass, isActive);
1245			});
1246		});
1247	}
1248
1249	new MutationObserver((mutations) => {
1250		mutations.forEach((mutation) => {
1251			if (mutation.target.matches && mutation.target.matches(selector)) {
1252				syncFrom(mutation.target);
1253			}
1254		});
1255	}).observe(document.body, { attributes: true, attributeFilter: ['class'], subtree: true });
1256}
1257
1258// API-mode favorite buttons (VIN-based toggle via custom AJAX handler).
1259function initApiFavoriteButtons() {
1260	if (!window.ajax || !window.ajax.api_mode) return;
1261
1262	const activeClass = 'active';
1263
1264	function setIcon($btn, isFav) {
1265		$btn.find('i')
1266			.toggleClass('sf-icon-star-empty', !isFav)
1267			.toggleClass('sf-icon-star-full', isFav);
1268	}
1269
1270	// Mark already-favorited buttons on page load.
1271	jQuery.ajax({
1272		url: window.ajax.admin,
1273		type: 'POST',
1274		data: { action: 'wps_api_favorites_list' },
1275		success: function(response) {
1276			if (!response.success) return;
1277			const allFavs = response.data || {};
1278			jQuery('.api-favorite-button[data-postid]').each(function() {
1279				const $btn = jQuery(this);
1280				const vin = String($btn.data('postid'));
1281				const postType = $btn.data('posttype') || 'listings';
1282				const isFav = (allFavs[postType] || []).indexOf(vin) !== -1;
1283				$btn.toggleClass(activeClass, isFav);
1284				setIcon($btn, isFav);
1285			});
1286		}
1287	});
1288
1289	// Toggle on click (delegated so it works after AJAX-injected content).
1290	jQuery(document).off('click.apiFav').on('click.apiFav', '.api-favorite-button[data-postid]', function(e) {
1291		if (!window.ajax || !window.ajax.api_mode) return;
1292
1293		e.preventDefault();
1294		e.stopImmediatePropagation();
1295
1296		const $btn = jQuery(this);
1297		const vin = String($btn.data('postid'));
1298		if (!vin) return;
1299
1300		const postType = $btn.data('posttype') || 'listings';
1301		const isActive = $btn.hasClass(activeClass);
1302		const newActive = !isActive;
1303
1304		$btn.toggleClass(activeClass, newActive);
1305		setIcon($btn, newActive);
1306
1307		jQuery.ajax({
1308			url: window.ajax.admin,
1309			type: 'POST',
1310			data: {
1311				action: 'wps_api_favorite_toggle',
1312				vin: vin,
1313				post_type: postType,
1314				status: newActive ? 'active' : 'inactive'
1315			},
1316			success: function(response) {
1317				if (!response.success) {
1318					$btn.toggleClass(activeClass, isActive);
1319					setIcon($btn, isActive);
1320					return;
1321				}
1322				jQuery(document).trigger('favorites-updated-single');
1323			},
1324			error: function() {
1325				$btn.toggleClass(activeClass, isActive);
1326				setIcon($btn, isActive);
1327			}
1328		});
1329	});
1330}
1331
1332// SRP incentive-offer badges share one modal (#conditionalOffersDetailModal-srp,
1333// see template-parts/conditionalOffersDetail-modal-srp.php) instead of one per
1334// card — fill it in from the clicked badge's data-* attributes just before
1335// Bootstrap's own data-toggle="modal" handler opens it.
1336function initIncentiveOfferSrpModal() {
1337	jQuery(document).off('click.incentiveOfferSrp').on('click.incentiveOfferSrp', '.js-incentive-offer-info', function(e) {
1338		e.preventDefault();
1339
1340		const $btn = jQuery(this);
1341		const $modal = jQuery('#conditionalOffersDetailModal-srp');
1342		if (!$modal.length) return;
1343
1344		$modal.find('.js-incentive-offer-modal-title').text($btn.data('programName') || '');
1345		$modal.find('.js-incentive-offer-modal-desc').html($btn.data('incentiveDesc') || '');
1346
1347		const startsOn = $btn.data('startsOn') || '';
1348		const endsOn = $btn.data('endsOn') || '';
1349		$modal.find('.js-incentive-offer-modal-dates').text(
1350			startsOn && endsOn ? `Valid from: ${startsOn} through ${endsOn}` : ''
1351		);
1352
1353		const incentiveId = $btn.data('incentiveId') || '';
1354		$modal.find('.js-incentive-offer-modal-id').text(incentiveId ? `Incentive Id: ${incentiveId}` : '');
1355
1356		$modal.modal('show');
1357	});
1358}
1359
1360// checked classes when element active
1361function initFieldsSwitcher() {
1362	const holder = jQuery('.form-offer');
1363
1364	holder.each(function() {
1365		const checkedClass = 'input-checked';
1366		const buttons = holder.find('[data-name]');
1367		const fields = holder.find('[data-field]');
1368
1369		buttons.each(function() {
1370			const button = jQuery(this);
1371
1372			if (button.is(':checked')) {
1373				refreshState(button);
1374			}
1375		});
1376
1377		buttons.on('click', function() {
1378			refreshState(jQuery(this));
1379		});
1380
1381		function refreshState(button) {
1382			fields.hide().val('');
1383			buttons.parent().removeClass(checkedClass);
1384
1385			jQuery('[data-field="' + button.data('name') + '"]').show();
1386
1387			button.parent().addClass(checkedClass);
1388		}
1389	});
1390}
1391
1392// copy to clipboard init
1393function initCopyToClipboard() {
1394	// fix bug with negative tabindex in modal
1395	jQuery.fn.modal.Constructor.prototype._enforceFocus = function() {};
1396
1397	document.querySelectorAll('[data-copied]').forEach((btn) => {
1398		const textElem = btn.querySelector('.btn-text');
1399
1400		// Set url to clipboard text if not set
1401		if (!btn.dataset.clipboardText) {
1402			btn.setAttribute('data-clipboard-text', window.location.href);
1403		}
1404
1405		const clipboard = new ClipboardJS(btn);
1406
1407		if (!textElem) return;
1408
1409		const defaultText = textElem.textContent;
1410
1411		btn.addEventListener('click', (e) => {
1412			e.preventDefault();
1413		});
1414
1415		clipboard.on('success', function() {
1416			const copiedText = btn.dataset.copied || 'Copied';
1417
1418			textElem.textContent = copiedText;
1419
1420			setTimeout(() => {
1421				textElem.textContent = defaultText;
1422			}, 2000);
1423		});
1424	});
1425}
1426
1427// initialize smooth anchor links
1428function initAnchors() {
1429	new SmoothScroll({
1430		anchorLinks: 'a.anchor',
1431		extraOffset: 0,
1432		wheelBehavior: 'none'
1433	});
1434
1435	new SmoothScroll({
1436		anchorLinks: 'a.btn-anchor',
1437		extraOffset: function() {
1438			let totalHeight = 0;
1439
1440			jQuery('#header').each(function() {
1441				const $box = jQuery(this);
1442				const stickyInstance = $box.data('StickyScrollBlock');
1443
1444				if (stickyInstance) {
1445					stickyInstance.stickyFlag = false;
1446					stickyInstance.stickyOn();
1447					totalHeight += $box.outerHeight();
1448					stickyInstance.onResize();
1449				} else {
1450					totalHeight += $box.css('position') === 'fixed' ? $box.outerHeight() : 0;
1451				}
1452			});
1453
1454			return totalHeight;
1455		},
1456		wheelBehavior: 'none'
1457	});
1458}
1459
1460// Sticky summary block init
1461function initStickySummary() {
1462	document.querySelectorAll('.detail-section').forEach((holder) => {
1463		new StickySummary(holder, {
1464			fixedClass: 'fixed-summary',
1465			cloneBlockClass: 'sticky-clone',
1466			stickyBlock: '.sticky-summary .summary-holder',
1467			triggerBlock: '.info-block--top'
1468		});
1469	});
1470}
1471
1472/*
1473 * Sticky Summary module
1474 */
1475class StickySummary {
1476	constructor(holder, options) {
1477		this.options = {
1478			fixedClass: 'fixed-block',
1479			cloneBlockClass: 'sticky-clone',
1480			stickyBlock: '.sticky-summary',
1481			triggerBlock: '.info-block--top',
1482			...options
1483		};
1484
1485		if (holder) {
1486			this.holder = holder;
1487
1488			this.init();
1489		}
1490	}
1491
1492	init() {
1493		this.header = document.querySelector('#header');
1494		this.stickyBlock = this.holder.querySelector(this.options.stickyBlock);
1495		this.triggerBlock = this.holder.querySelector(this.options.triggerBlock);
1496
1497		if (!this.stickyBlock || !this.triggerBlock) return;
1498
1499		this.cloneBlock = null;
1500		this.isFixed = false;
1501		this.isDisabled = false;
1502
1503		this.attachEvents();
1504	}
1505
1506	attachEvents() {
1507		this.handleResize = this.resizeHandler.bind(this);
1508		this.handleScroll = this.scrollHandler.bind(this);
1509
1510		this.resizeHandler();
1511
1512		window.addEventListener('resize', this.debounce(this.handleResize));
1513		window.addEventListener('scroll', this.handleScroll);
1514	}
1515
1516	createCloneBlock() {
1517		if (this.cloneBlock) return;
1518
1519		this.cloneBlock = document.createElement('div');
1520		this.cloneBlock.classList.add(this.options.cloneBlockClass);
1521		this.stickyBlock.parentNode.insertBefore(this.cloneBlock, this.stickyBlock);
1522
1523		this.cloneBlock.style.height = this.stickyBlock.offsetHeight + 'px';
1524		this.stickyBlock.style.width = this.cloneBlock.offsetWidth + 'px';
1525	}
1526
1527	removeCloneBlock() {
1528		if (this.cloneBlock) {
1529			this.cloneBlock.parentNode.removeChild(this.cloneBlock);
1530			this.cloneBlock = null;
1531		}
1532	}
1533
1534	scrollHandler() {
1535		if (this.isDisabled) {
1536			this.removeCloneBlock();
1537			this.holder.classList.remove(this.options.fixedClass);
1538
1539			this.isFixed = false;
1540
1541			return;
1542		}
1543
1544		const scrollY = window.scrollY;
1545
1546		if (this.triggerBlockOffset + this.triggerBlockHeight <= scrollY + this.headerHeight && scrollY + this.windowHeight < this.holderOffset + this.holderHeight - this.stickyBlock.offsetHeight) {
1547			if (!this.isFixed) {
1548				this.createCloneBlock();
1549				this.holder.classList.add(this.options.fixedClass);
1550
1551				this.isFixed = true;
1552			}
1553		} else {
1554			if (this.isFixed) {
1555				this.removeCloneBlock();
1556				this.holder.classList.remove(this.options.fixedClass);
1557
1558				this.isFixed = false;
1559			}
1560		}
1561	}
1562
1563	resizeHandler() {
1564		this.triggerBlockOffset = this.triggerBlock.getBoundingClientRect().top + window.scrollY;
1565		this.triggerBlockHeight = this.triggerBlock.offsetHeight;
1566		this.holderOffset = this.holder.getBoundingClientRect().top + window.scrollY;
1567		this.holderHeight = this.holder.offsetHeight;
1568		this.headerHeight = this.header.offsetHeight || 0;
1569		this.windowHeight = window.innerHeight;
1570
1571		if (this.cloneBlock) {
1572			this.cloneBlock.style.height = this.stickyBlock.offsetHeight + 'px';
1573			this.stickyBlock.style.width = this.cloneBlock.offsetWidth + 'px';
1574		}
1575
1576		if (this.stickyBlock.offsetHeight > this.windowHeight - this.headerHeight - 200) {
1577			this.isDisabled = true;
1578		} else {
1579			this.isDisabled = false;
1580
1581		}
1582		this.scrollHandler();
1583	}
1584
1585	debounce(func, delay = 250) {
1586		let timer = null;
1587
1588		return (...args) => {
1589			clearTimeout(timer);
1590			timer = setTimeout(() => func.apply(this, args), delay);
1591		};
1592	}
1593}
1594
1595// search autocomplete
1596function initSearchForms() {
1597	const postTypeStr = '&post_type[]=listings&post_type[]=used-listings';
1598
1599	// Search form on homepage
1600	jQuery('.search-row:not(.filter-section .search-row)').each(function() {
1601		const holder = jQuery(this);
1602		const redirectURL = holder.data('redirect-url');
1603
1604		if (!redirectURL) return;
1605
1606		const searchLinkNew = holder.find('.search-link-new');
1607		const searchLinkUsed = holder.find('.search-link-used');
1608		const newItemURL = searchLinkNew.attr('href');
1609		const usedItemURL = searchLinkUsed.attr('href');
1610		const searchText = holder.find('.search-text');
1611
1612		holder.autocomplete({
1613			inputField: '[type="search"]',
1614			dataAttr: 'search',
1615			dataType: 'json',
1616			highlightMatches: true,
1617			showOnFocus: true,
1618			filterResults: false,
1619			alwaysRefresh: true,
1620			queryStr: postTypeStr,
1621			noResultClass: 'no-results',
1622			preventEnterClick: true,
1623			listItems: 'li',
1624			onInit: function() {
1625				// Prevent form submission
1626				this.form.on('submit', (e) => {
1627					e.preventDefault();
1628				});
1629
1630				// Prevent "Enter" key
1631				this.input.on('keydown', (e) => {
1632					if (e.keyCode === 'Enter') {
1633						e.preventDefault();
1634					}
1635				});
1636			},
1637			onKeyup: function(value) {
1638				/**
1639				 * Updates search URL for new and used cars into autocomplete box
1640				 * @param {jQuery} searchText - element that contains text to be updated
1641				 * @param {jQuery} searchLinkNew - element that contains link to new cars page
1642				 * @param {jQuery} searchLinkUsed - element that contains link to used cars page
1643				 * @param {string} newItemURL - URL of new cars page
1644				 * @param {string} usedItemURL - URL of used cars page
1645				 * @param {string} value - search query
1646				 */
1647				updateSearchURL(searchText, searchLinkNew, searchLinkUsed, newItemURL, usedItemURL, value);
1648			},
1649			onLoadData: function(data) {
1650				const { isNewResults, isUsedResults } = data;
1651
1652				if (!isNewResults) {
1653					searchLinkNew.hide();
1654				} else {
1655					searchLinkNew.show();
1656				}
1657
1658				if (!isUsedResults) {
1659					searchLinkUsed.hide();
1660				} else {
1661					searchLinkUsed.show();
1662				}
1663			},
1664			parseData: function(data) {
1665				return createAutocompleteItems(this, data);
1666			},
1667			onSelectedItem: function(item) {
1668				const searchFilters = item.data('search');
1669				const url = item.data('url') || redirectURL;
1670
1671				if (!searchFilters) return;
1672
1673				const value = Object.entries(searchFilters)
1674					.map(([key, val]) => {
1675						// Should change "vin" or "stock" to "search" for the correct search
1676						if (key.toLowerCase() === 'vin' || key.toLowerCase() === 'stock') {
1677							key = 'search';
1678						}
1679
1680						return `${key}=${encodeURIComponent((val ?? '').toString().toLowerCase())}`;
1681					})
1682					.join('&');
1683
1684				if (value !== '') {
1685					window.location.href = `${url}?${value}`;
1686				}
1687			}
1688		});
1689	});
1690}
1691
1692// initialize sticky class
1693function initStickyClass() {
1694	const win = jQuery(window);
1695	const page = jQuery('body');
1696	const searchPanel = page.find('.sticky-wrap-sticky-panel');
1697	const activeClass = 'sticky-search';
1698	const fixedClass = 'fixed-position';
1699
1700	function scrollHandler() {
1701		if (searchPanel.hasClass(fixedClass)) {
1702			page.addClass(activeClass);
1703		} else {
1704			page.removeClass(activeClass);
1705		}
1706	}
1707
1708	scrollHandler();
1709	win.on('load resize orientationchange scroll', scrollHandler);
1710}
1711
1712function initOfferForm() {
1713	jQuery('.form-offer').each(function() {
1714		const form = jQuery(this);
1715		const btnSubmit = form.find('.btn-submit');
1716		const injectPlateField = form.find('.inject-plate');
1717		const injectVinField = form.find('.inject-vin');
1718		const injectStateField = form.find('.inject-state');
1719		const injectMilesField = form.find('.inject-miles');
1720		const allFields = form.find('.form-control');
1721		let injectPlate, injectVin, injectState, injectMiles;
1722
1723		function onClickChange() {
1724			injectPlate = injectPlateField.val() || '';
1725			injectVin = injectVinField.val() || '';
1726			injectState = injectStateField.val() || '';
1727			injectMiles = injectMilesField.val() || '';
1728		}
1729
1730		allFields.on('keyup', onClickChange);
1731
1732		btnSubmit.on('click', function(e) {
1733			e.preventDefault();
1734			onClickChange();
1735
1736			if (inticeEvents !== undefined) {
1737				inticeEvents.launchExpressCashOffer('519', injectPlate, injectVin, injectState, injectMiles);
1738			}
1739		});
1740	});
1741}
1742
1743function initStickyScrollBlock() {
1744	jQuery('.sticky-box').stickyScrollBlock({
1745		setBoxHeight: false,
1746		activeClass: 'fixed-position',
1747		container: '.detail-section',
1748		positionType: 'fixed',
1749		extraTop: function() {
1750			let totalHeight = 0;
1751
1752			jQuery('#header').each(function() {
1753				totalHeight += jQuery(this).outerHeight();
1754			});
1755
1756			return totalHeight;
1757		}
1758	});
1759
1760	jQuery('.sticky-panel').stickyScrollBlock({
1761		setBoxHeight: true,
1762		activeClass: 'fixed-position',
1763		positionType: 'fixed',
1764		extraTop: function() {
1765			let totalHeight = 0;
1766
1767			jQuery('#header').each(function() {
1768				totalHeight += jQuery(this).outerHeight();
1769			});
1770
1771			return totalHeight;
1772		}
1773	});
1774
1775	jQuery('.new-landing #header').stickyScrollBlock({
1776		setBoxHeight: false,
1777		activeClass: 'fixed-position',
1778		positionType: 'fixed',
1779		extraTop: function() {
1780			let totalHeight = 0;
1781
1782			jQuery('0').each(function() {
1783				totalHeight += jQuery(this).outerHeight();
1784			});
1785
1786			return totalHeight;
1787		}
1788	});
1789
1790	const vinButtons = jQuery('#vinButtons');
1791	let loadTimer = null;
1792
1793	if (vinButtons.length) {
1794		loadTimer = setInterval(() => {
1795			if (vinButtons.find('>*').length) {
1796				jQuery(window).trigger('refreshStikyBlock');
1797				clearInterval(loadTimer);
1798			}
1799		}, 1000);
1800
1801		setTimeout(() => {
1802			clearInterval(loadTimer);
1803		}, 120000);
1804	}
1805}
1806
1807function initTooltip() {
1808	if (jQuery('[data-toggle="tooltip"]').length && bootstrap.Tooltip) {
1809		jQuery('[data-toggle="tooltip"]').tooltip();
1810	}
1811}
1812
1813function initRegistration() {
1814	jQuery('.register-form').formValidation({
1815		errorClass: 'input-error',
1816		addClassToParent: '.form-group',
1817		successSendClass: 'success-send',
1818		errorFormClass: 'error-send'
1819	});
1820
1821	const loadingClass = 'loading';
1822
1823	jQuery('.form-unlock').each(function() {
1824		const form = jQuery(this);
1825		const btnRegister = form.find('#register-button');
1826		const message = form.find('.register-message');
1827
1828		btnRegister.on('click', function(e) {
1829			e.preventDefault();
1830
1831			const data = form.serialize() + '&action=register_user';
1832
1833			form.addClass(loadingClass);
1834
1835			jQuery.ajax({
1836				type: 'POST',
1837				url: ajax.admin,
1838				data: data,
1839				success: function(results) {
1840					if (results['error']) {
1841						message.text(results['error']).show();
1842					} else {
1843						window.location.replace(results);
1844					}
1845
1846					form.removeClass(loadingClass);
1847				},
1848				error: function(results) {
1849					message.text(results).show();
1850					form.removeClass(loadingClass);
1851				}
1852			});
1853		});
1854	});
1855}
1856
1857// slick init
1858function initSlickCarousel() {
1859	const win = jQuery(window);
1860	const activeClass = 'active';
1861
1862	// Init visual slider on product page
1863	jQuery('.visual--banner .visual-slider-srp').slick({
1864		slidesToScroll: 1,
1865		rows: 0,
1866		prevArrow: '<button class="slick-control slick-prev slick-arrow" aria-label="Previous"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" height="24px" viewBox="0 -960 960 960" width="24px" fill="#000000"><path d="m432-480 156 156q11 11 11 28t-11 28q-11 11-28 11t-28-11L348-452q-6-6-8.5-13t-2.5-15q0-8 2.5-15t8.5-13l184-184q11-11 28-11t28 11q11 11 11 28t-11 28L432-480Z"/></svg></button>',
1867		nextArrow: '<button class="slick-control slick-next slick-arrow" aria-label="Next"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" height="24px" viewBox="0 -960 960 960" width="24px" fill="#000000">
1867<path d="M504-480 348-636q-11-11-11-28t11-28q11-11 28-11t28 11l184 184q6 6 8.5 13t2.5 15q0 8-2.5 15t-8.5 13L404-268q-11 11-28 11t-28-11q-11-11-11-28t11-28l156-156Z"/></svg></button>',
1868		dots: true,
1869		dotsClass: 'slick-dots',
1870		autoplay: true
1871	});
1872
1873	jQuery('.detail-slider-holder').each(function() {
1874		const holder = jQuery(this);
1875		const slider = holder.find('.detail-slider');
1876		const thumbs = holder.find('.detail-slider-nav .slide');
1877		const thumbsSlider = holder.find('.detail-slider-nav');
1878		const autoplay = slider.data('autoplay') || false;
1879		const autoplaySpeed = slider.data('autoplay-speed') || 3000;
1880		const range = holder.find('.range-box input');
1881		const sliderHolder = holder.find('.slider-nav-holder');
1882		let totalWidth = 0;
1883		let thumbsWidth = 0;
1884		let diffWidth = 0;
1885
1886		thumbs.eq(0).addClass(activeClass);
1887
1888		slider.slick({
1889			slidesToScroll: 1,
1890			rows: 0,
1891			infinite: false,
1892			prevArrow: '<button class="slick-control slick-prev slick-arrow" aria-label="Previous"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" height="24px" viewBox="0 -960 960 960" width="24px" fill="#000000"><path d="m432-480 156 156q11 11 11 28t-11 28q-11 11-28 11t-28-11L348-452q-6-6-8.5-13t-2.5-15q0-8 2.5-15t8.5-13l184-184q11-11 28-11t28 11q11 11 11 28t-11 28L432-480Z"/></svg></button>',
1893			nextArrow: '<button class="slick-control slick-next slick-arrow" aria-label="Next"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" height="24px" viewBox="0 -960 960 960" width="24px" fill="#000000"><path d="M504-480 348-636q-11-11-11-28t11-28q11-11 28-11t28 11l184 184q6 6 8.5 13t2.5 15q0 8-2.5 15t-8.5 13L404-268q-11 11-28 11t-28-11q-11-11-11-28t11-28l156-156Z"/></svg></button>',
1894			autoplay: autoplay,
1895			autoplaySpeed: autoplaySpeed,
1896			focusOnSelect: true
1897		});
1898
1899		function resizeHandler() {
1900			totalWidth = thumbs.length * thumbs.outerWidth(true);
1901			thumbsWidth = thumbsSlider.outerWidth();
1902			diffWidth = totalWidth - thumbsWidth;
1903		}
1904
1905		resizeHandler();
1906		win.on('resize orientationchange', resizeHandler);
1907
1908		slider.on('beforeChange', function(event, slick, currentSlide, nextSlide) {
1909			thumbs.removeClass(activeClass);
1910			thumbs.eq(nextSlide).addClass(activeClass);
1911		});
1912
1913		thumbs.on('click', function(e) {
1914			e.preventDefault();
1915			const item = jQuery(this);
1916			const index = thumbs.index(item);
1917
1918			thumbs.removeClass(activeClass);
1919			item.addClass(activeClass);
1920
1921			slider.slick('slickGoTo', index);
1922		});
1923
1924		range.on('input', onChange);
1925
1926		function onChange() {
1927			const value = parseFloat(range.data('jcfInstance').values[0]);
1928
1929			sliderHolder.css({
1930				marginLeft: -(diffWidth / 100) * value,
1931				marginRight: (diffWidth / 100) * value
1932			});
1933		}
1934	});
1935
1936	jQuery('.model-slider').each(function() {
1937		const slider = jQuery(this);
1938
1939		initSlider();
1940
1941		function initSlider() {
1942			slider.slick({
1943				slidesToScroll: 1,
1944				rows: 0,
1945				slide: '.slide:not(.hidden)',
1946				slidesToShow: 4,
1947				prevArrow: '<button class="slick-control slick-prev slick-arrow" aria-label="Previous"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" height="24px" viewBox="0 -960 960 960" width="24px" fill="#000000"><path d="m432-480 156 156q11 11 11 28t-11 28q-11 11-28 11t-28-11L348-452q-6-6-8.5-13t-2.5-15q0-8 2.5-15t8.5-13l184-184q11-11 28-11t28 11q11 11 11 28t-11 28L432-480Z"/></svg></button>',
1948				nextArrow: '<button class="slick-control slick-next slick-arrow" aria-label="Next"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" height="24px" viewBox="0 -960 960 960" width="24px" fill="#000000"><path d="M504-480 348-636q-11-11-11-28t11-28q11-11 28-11t28 11l184 184q6 6 8.5 13t2.5 15q0 8-2.5 15t-8.5 13L404-268q-11 11-28 11t-28-11q-11-11-11-28t11-28l156-156Z"/></svg></button>',
1949				responsive: [{
1950					breakpoint: 1200,
1951					settings: {
1952						slidesToShow: 3
1953					}
1954				}, {
1955					breakpoint: 992,
1956					settings: {
1957						slidesToShow: 2
1958					}
1959				}, {
1960					breakpoint: 768,
1961					settings: {
1962						slidesToShow: 1
1963					}
1964				}]
1965			});
1966		}
1967
1968		function destroySlider() {
1969			slider.slick('destroy');
1970		}
1971
1972		slider.on('beforeFilter', function() {
1973			destroySlider();
1974		});
1975
1976		slider.on('rebuild', function() {
1977			initSlider();
1978		});
1979	});
1980
1981	jQuery('.visual').each(function() {
1982		const holder = jQuery(this);
1983		const slider = holder.find('.visual-slider:not(.visual-slider-srp)');
1984		const controlsHolder = holder.find('.slick-controls');
1985		const buttonsHolder = controlsHolder.find('.buttons-holder');
1986		const dotsHolder = holder.find('.dots-holder');
1987		const btnPlayPause = controlsHolder.find('.slick-play-pause');
1988		const progress = controlsHolder.find('.indicator circle');
1989		const hideSearchWidgetClass = 'hide-search-widget';
1990		const widgetInvisibleClass = 'widget-invisible';
1991		const playingClass = 'playing';
1992		const pauseClass = 'pause';
1993		const resetClass = 'reset';
1994		const speed = slider.data('speed') || 300;
1995		const interval = slider.data('autoplay-speed') || 3000;
1996		const strokeDashoffset = 40;
1997		let startTime = null;
1998		let elapsedTime = 0;
1999		let animationRequest = null;
2000		let currentInterval = 0;
2001		let rotationTimer = null;
2002
2003		slider.slick({
2004			slidesToScroll: 1,
2005			rows: 0,
2006			appendDots: dotsHolder,
2007			appendArrows: buttonsHolder,
2008			prevArrow: '<button class="slick-control slick-prev slick-arrow" aria-label="Previous"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" height="24px" viewBox="0 -960 960 960" width="24px" fill="#FFFFFF"><path d="m432-480 156 156q11 11 11 28t-11 28q-11 11-28 11t-28-11L348-452q-6-6-8.5-13t-2.5-15q0-8 2.5-15t8.5-13l184-184q11-11 28-11t28 11q11 11 11 28t-11 28L432-480Z"/></svg></button>',
2009			nextArrow: '<button class="slick-control slick-next slick-arrow" aria-label="Next"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" height="24px" viewBox="0 -960 960 960" width="24px" fill="#FFFFFF">
2009<path d="M504-480 348-636q-11-11-11-28t11-28q11-11 28-11t28 11l184 184q6 6 8.5 13t2.5 15q0 8-2.5 15t-8.5 13L404-268q-11 11-28 11t-28-11q-11-11-11-28t11-28l156-156Z"/></svg></button>',
2010			dots: true,
2011			fade: true,
2012			dotsClass: 'slick-dots',
2013			speed: speed,
2014			autoplaySpeed: interval,
2015			pauseOnFocus: false,
2016			pauseOnHover: false,
2017			pauseOnDotsHover: false,
2018			autoplay: false
2019		});
2020
2021		const btnPrev = buttonsHolder.find('.slick-prev');
2022		const btnNext = buttonsHolder.find('.slick-next');
2023
2024		toggleSearchWidget(slider.find('.slide').eq(slider.slick('slickCurrentSlide')));
2025
2026		slider.on('beforeChange', function(event, slick, currentSlide, nextSlide) {
2027			toggleSearchWidget(slider.find('.slide').eq(nextSlide));
2028			resetProgress();
2029		}).on('afterChange', function() {
2030			if (!controlsHolder.hasClass(pauseClass)) {
2031				slider.slick('slickSetOption', 'autoplaySpeed', interval, false);
2032				startProgress();
2033			}
2034		});
2035
2036		function toggleSearchWidget(activeSlide) {
2037			holder.toggleClass(hideSearchWidgetClass, activeSlide.hasClass(widgetInvisibleClass));
2038		}
2039
2040		btnPlayPause.on('click', function(e) {
2041			e.preventDefault();
2042
2043			if (controlsHolder.hasClass(playingClass)) {
2044				pauseRotation();
2045			} else {
2046				startRotation();
2047			}
2048		});
2049
2050		btnPrev.add(btnNext).add(dotsHolder).on('click', stopRotation);
2051
2052		startRotation();
2053
2054		function startRotation() {
2055			slider.slick('slickSetOption', 'autoplaySpeed', interval - currentInterval, false);
2056			slider.slick('slickPlay');
2057			controlsHolder.addClass(playingClass).removeClass(pauseClass);
2058
2059			currentInterval = 0;
2060
2061			startProgress();
2062		}
2063
2064		function pauseRotation() {
2065			slider.slick('slickPause');
2066			controlsHolder.removeClass(playingClass).addClass(pauseClass);
2067			stopProgress();
2068		}
2069
2070		function stopRotation() {
2071			slider.slick('slickPause');
2072			controlsHolder.removeClass(playingClass).addClass(pauseClass);
2073			currentInterval = 0;
2074
2075			resetProgress();
2076		}
2077
2078		function startProgress() {
2079			startTime = Date.now();
2080			animationRequest = requestAnimationFrame(updateProgress);
2081			currentInterval = 0;
2082
2083			controlsHolder.removeClass(resetClass);
2084
2085			rotationTimer = setInterval(() => {
2086				currentInterval += 100;
2087			}, 100);
2088		}
2089
2090		function resetProgress() {
2091			cancelAnimationFrame(animationRequest);
2092			clearInterval(rotationTimer);
2093
2094			controlsHolder.addClass(resetClass);
2095
2096			elapsedTime = 0;
2097
2098			progress.css({
2099				strokeDashoffset: strokeDashoffset
2100			});
2101		}
2102
2103		function stopProgress() {
2104			cancelAnimationFrame(animationRequest);
2105			clearInterval(rotationTimer);
2106
2107			const currentTime = Date.now();
2108
2109			elapsedTime += currentTime - startTime;
2110
2111			const progressValue = strokeDashoffset - (strokeDashoffset * elapsedTime / interval);
2112
2113			progress.css({
2114				strokeDashoffset: progressValue
2115			});
2116		}
2117
2118		function updateProgress() {
2119			const currentTime = Date.now();
2120			const totalElapsed = elapsedTime + (currentTime - startTime);
2121			const progressValue = strokeDashoffset - (strokeDashoffset * totalElapsed / interval);
2122
2123			progress.css({
2124				'stroke-dashoffset': Math.max(progressValue, 0)
2125			});
2126
2127			if (totalElapsed >= interval) {
2128				cancelAnimationFrame(animationRequest);
2129				elapsedTime = 0;
2130			} else {
2131				animationRequest = requestAnimationFrame(updateProgress);
2132			}
2133		}
2134	});
2135
2136	jQuery('.specials-slider').each(function() {
2137		const slider = jQuery(this);
2138		const slides = slider.find('> div');
2139		const videoBlocks = slider.find('[data-video]');
2140		const speed = slider.data('speed') || 300;
2141		const autoplaySpeed = slider.data('autoplay-speed') || 5000;
2142
2143		slider.on('init', function() {
2144			const firstBlock = slides.eq(0).find('[data-video]');
2145
2146			if (firstBlock.length && firstBlock.data('BgVideo') && !firstBlock.hasClass('video-loaded')) {
2147				firstBlock.data('BgVideo').initPlayer();
2148			}
2149		});
2150
2151		slider.slick({
2152			slidesToScroll: 1,
2153			rows: 0,
2154			prevArrow: '<button class="slick-control slick-prev slick-arrow" aria-label="Previous"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" height="24px" viewBox="0 -960 960 960" width="24px" fill="#FFFFFF"><path d="m432-480 156 156q11 11 11 28t-11 28q-11 11-28 11t-28-11L348-452q-6-6-8.5-13t-2.5-15q0-8 2.5-15t8.5-13l184-184q11-11 28-11t28 11q11 11 11 28t-11 28L432-480Z"/></svg></button>',
2155			nextArrow: '<button class="slick-control slick-next slick-arrow" aria-label="Next"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" height="24px" viewBox="0 -960 960 960" width="24px" fill="#FFFFFF"><path d="M504-480 348-636q-11-11-11-28t11-28q11-11 28-11t28 11l184 184q6 6 8.5 13t2.5 15q0 8-2.5 15t-8.5 13L404-268q-11 11-28 11t-28-11q-11-11-11-28t11-28l156-156Z"/></svg></button>',
2156			dots: true,
2157			dotsClass: 'slick-dots',
2158			autoplay: true,
2159			speed: speed,
2160			autoplaySpeed: autoplaySpeed
2161		});
2162
2163		videoBlocks.each(function() {
2164			const holder = jQuery(this);
2165			const videoAPI = holder.data('BgVideo');
2166
2167			if (videoAPI) {
2168				holder.on('playingVideo', () => {
2169					slider.slick('slickPause');
2170				}).on('pauseVideo', () => {
2171					slider.slick('slickPlay');
2172				}).on('endedVideo', () => {
2173					slider.slick('slickPlay');
2174				});
2175			}
2176		});
2177
2178		slider.on('beforeChange', function(event, slick, currentSlide, nextSlide) {
2179			const currVideoBlock = slides.eq(currentSlide).find('[data-video]');
2180			const nextVideoBlock = slides.eq(nextSlide).find('[data-video]');
2181
2182			if (nextVideoBlock.length && nextVideoBlock.data('BgVideo') && !nextVideoBlock.hasClass('video-loaded')) {
2183				nextVideoBlock.data('BgVideo').initPlayer();
2184			}
2185
2186			if (currVideoBlock.length && currVideoBlock.data('BgVideo').player) {
2187				currVideoBlock.data('BgVideo').player.pause();
2188			}
2189		});
2190	});
2191
2192	const evoSlider = jQuery('.evo-slider');
2193
2194	evoSlider.slick({
2195		slidesToScroll: 1,
2196		rows: 0,
2197		arrows: false,
2198		dots: true,
2199		fade: true,
2200		speed: 0,
2201		dotsClass: 'slick-dots'
2202	});
2203
2204	window.addEventListener('updateSliderHeight', resizeHandler);
2205	window.addEventListener('resize', debounce(resizeHandler, 500));
2206
2207	resizeHandler();
2208
2209	function resizeHandler() {
2210		evoSlider.slick('setPosition');
2211	}
2212
2213	function debounce(func, delay = 250) {
2214		let timer = null;
2215
2216		return function(...args) {
2217			clearTimeout(timer);
2218
2219			timer = setTimeout(() => func.apply(this, args), delay);
2220		};
2221	}
2222
2223	jQuery('.full-width-image-slider').each(function() {
2224		const slider = jQuery(this);
2225		const speed = slider.data('speed') || 300;
2226		const autoplaySpeed = slider.data('autoplay-speed') || 5000;
2227
2228		slider.slick({
2229			rows: 0,
2230			slidesToScroll: 1,
2231			slidesToShow: 1,
2232			arrows: false,
2233			dots: true,
2234			dotsClass: 'slick-dots',
2235			autoplay: true,
2236			pauseOnHover: true,
2237			speed: speed,
2238			autoplaySpeed: autoplaySpeed
2239		});
2240	});
2241
2242	jQuery('.offers-slider').each(function() {
2243		const slider = jQuery(this);
2244
2245		initSlider();
2246
2247		function initSlider() {
2248			slider.slick({
2249				slidesToScroll: 1,
2250				rows: 0,
2251				slidesToShow: 5,
2252				prevArrow: '<button class="slick-control slick-prev slick-arrow" aria-label="Previous"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" height="24px" viewBox="0 -960 960 960" width="24px" fill="#000000"><path d="m432-480 156 156q11 11 11 28t-11 28q-11 11-28 11t-28-11L348-452q-6-6-8.5-13t-2.5-15q0-8 2.5-15t8.5-13l184-184q11-11 28-11t28 11q11 11 11 28t-11 28L432-480Z"/></svg></button>',
2253				nextArrow: '<button class="slick-control slick-next slick-arrow" aria-label="Next"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" height="24px" viewBox="0 -960 960 960" width="24px" fill="#000000"><path d="M504-480 348-636q-11-11-11-28t11-28q11-11 28-11t28 11l184 184q6 6 8.5 13t2.5 15q0 8-2.5 15t-8.5 13L404-268q-11 11-28 11t-28-11q-11-11-11-28t11-28l156-156Z"/></svg></button>',
2254				responsive: [{
2255					breakpoint: 1480,
2256					settings: {
2257						slidesToShow: 4
2258					}
2259				}, {
2260					breakpoint: 1200,
2261					settings: {
2262						slidesToShow: 3
2263					}
2264				}, {
2265					breakpoint: 992,
2266					settings: {
2267						slidesToShow: 2
2268					}
2269				}, {
2270					breakpoint: 576,
2271					settings: {
2272						slidesToShow: 1
2273					}
2274				}]
2275			});
2276		}
2277	});
2278
2279	jQuery('.reviews-slider').not('[data-google-reviews-list]').each(function() {
2280		const slider = jQuery(this);
2281
2282		slider.slick({
2283			slidesToScroll: 1,
2284			rows: 0,
2285			slidesToShow: 6,
2286			prevArrow: '<button class="slick-prev slick-arrow" aria-label="Previous"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" height="24px" viewBox="0 -960 960 960" width="24px" fill="#fff"><path d="m432-480 156 156q11 11 11 28t-11 28q-11 11-28 11t-28-11L348-452q-6-6-8.5-13t-2.5-15q0-8 2.5-15t8.5-13l184-184q11-11 28-11t28 11q11 11 11 28t-11 28L432-480Z"/></svg></button>',
2287			nextArrow: '<button class="slick-next slick-arrow" aria-label="Next"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" height="24px" viewBox="0 -960 960 960" width="24px" fill="#fff"><path d="M504-480 348-636q-11-11-11-28t11-28q11-11 28-11t28 11l184 184q6 6 8.5 13t2.5 15q0 8-2.5 15t-8.5 13L404-268q-11 11-28 11t-28-11q-11-11-11-28t11-28l156-156Z"/></svg></button>',
2288			responsive: [{
2289				breakpoint: 1570,
2290				settings: {
2291					slidesToShow: 5
2292				}
2293			}, {
2294				breakpoint: 1310,
2295				settings: {
2296					slidesToShow: 4
2297				}
2298			}, {
2299				breakpoint: 1050,
2300				settings: {
2301					slidesToShow: 3
2302				}
2303			}, {
2304				breakpoint: 576,
2305				settings: {
2306					slidesToShow: 1
2307				}
2308			}]
2309		});
2310	});
2311}
2312
2313function initVideo() {
2314	jQuery('[data-video]').bgVideo();
2315}
2316
2317// filtering modal init
2318function initFilteringModal() {
2319	const win = jQuery(window);
2320	const page = jQuery('body');
2321	const header = jQuery('#header');
2322	const introBlock = jQuery('.intro');
2323	const filterList = jQuery('.filter-list');
2324	const filterModal = jQuery('.modal-filter');
2325	const btnClose = filterModal.find('[data-dismiss="modal"]:not(.btn-back)');
2326	const activeClass = 'filter-modal-active';
2327
2328	jQuery('[data-modal]').on('click', function(e) {
2329		e.preventDefault();
2330		resizeHandler();
2331		filterModal.modal('show');
2332	});
2333
2334	function resizeHandler() {
2335		if (introBlock.length && getWindowWidth() >= 1200) {
2336			if (introBlock.offset().top + introBlock.outerHeight() >= win.scrollTop() + header.outerHeight()) {
2337				page.removeClass(activeClass);
2338
2339				filterModal.css({
2340					marginTop: (introBlock.outerHeight() + header.outerHeight()) - win.scrollTop()
2341				});
2342
2343				filterModal.on('shown.bs.modal', function() {
2344					const modalBackDrop = jQuery('.modal-backdrop');
2345
2346					modalBackDrop.css({
2347						top: (introBlock.outerHeight() + header.outerHeight()) - win.scrollTop()
2348					});
2349				});
2350			} else {
2351				filterModal.css({
2352					marginTop: 0
2353				});
2354
2355				filterModal.on('shown.bs.modal', function() {
2356					const modalBackDrop = jQuery('.modal-backdrop');
2357
2358					modalBackDrop.css({
2359						top: 0
2360					});
2361				});
2362
2363				page.addClass(activeClass);
2364			}
2365		} else {
2366			page.removeClass(activeClass);
2367		}
2368
2369		if (!introBlock.length && getWindowWidth() >= 1200) {
2370			page.addClass(activeClass);
2371		}
2372	}
2373
2374	resizeHandler();
2375
2376	win.on('resize orientationchange', function() {
2377		resizeHandler();
2378	});
2379
2380	ResponsiveHelper.addRange({
2381		'..991': {
2382			on: function() {
2383				btnClose.on('click.modal', function() {
2384					page.removeClass('filter-active');
2385				});
2386			}
2387		},
2388		'992..': {
2389			on: function() {
2390				btnClose.off('click.modal', function() {
2391					page.removeClass('filter-active');
2392				});
2393			}
2394		}
2395	});
2396
2397	filterModal.on('shown.bs.modal', function() {
2398		const modal = jQuery('.modal-backdrop');
2399
2400		if (modal.length) {
2401			modal.addClass('modal-filter-backdrop');
2402		}
2403	}).on('hidden.bs.modal', function() {
2404		filterList.find('.active').removeClass('active');
2405	});
2406
2407	function getWindowWidth() {
2408		return typeof window.innerWidth === 'number' ? window.innerWidth : document.documentElement.clientWidth;
2409	}
2410}
2411
2412// Initialize custom form elements
2413function initCustomForms() {
2414	// Initialize custom selects
2415	jcf.setOptions('Select', {
2416		wrapNative: false,
2417		wrapNativeOnMobile: false
2418	});
2419
2420	jcf.replaceAll();
2421
2422	// Initialize custom range sliders for filters
2423	jQuery('.range-row').each(function() {
2424		const holder = jQuery(this);
2425		const field = holder.find('[type="range"]');
2426		const minPrice = holder.find('.min-price');
2427		const maxPrice = holder.find('.max-price');
2428		const errorMessage = holder.find('.range-error').hide();
2429		const minErrorMessage = holder.data('error-min') || 'Please enter a value less than';
2430		const maxErrorMessage = holder.data('error-max') || 'Please enter a value greater than';
2431		const hiddenField = holder.find('[type="hidden"]');
2432		const defaultValues = field.data('jcfInstance').values;
2433		let values = [];
2434		let minValue = 0;
2435		let maxValue = 0;
2436
2437		field.on('input', function() {
2438			values = field.data('jcfInstance').values;
2439
2440			minValue = +field.attr('min');
2441			maxValue = +field.attr('max');
2442
2443			updateInputValues(values);
2444
2445			errorMessage.hide();
2446		});
2447
2448		minPrice.add(maxPrice).on('input', function() {
2449			const input = jQuery(this);
2450			const value = input.val().replace(/[^\d]/g, '');
2451
2452			errorMessage.hide();
2453
2454			if (value) {
2455				input.val(transformValueToMoney(value));
2456			} else {
2457				input.val('');
2458			}
2459		}).on('blur', function() {
2460			const input = jQuery(this);
2461			let value = +input.val().replace(/[^\d]/g, '');
2462
2463			if (input.is(minPrice)) {
2464				if (value < minValue || value <= 0) {
2465					showErrorMessage(`${maxErrorMessage} ${minValue}`);
2466					value = minValue;
2467				} else if (value > values[1]) {
2468					showErrorMessage(`${minErrorMessage} ${values[1]}`);
2469					value = minValue;
2470				}
2471			}
2472
2473			if (input.is(maxPrice)) {
2474				if (value > maxValue) {
2475					showErrorMessage(`${minErrorMessage} ${maxValue}`);
2476					value = maxValue;
2477				} else if (value < values[0] || value <= 0) {
2478					showErrorMessage(`${maxErrorMessage} ${values[0]}`);
2479					value = maxValue;
2480				}
2481			}
2482
2483			if (value) {
2484				input.val(transformValueToMoney(value));
2485			}
2486
2487			const newMinValue = minPrice.val().replace(/[^\d]/g, '');
2488			const newMaxValue = maxPrice.val().replace(/[^\d]/g, '');
2489
2490			// Update range slider values
2491			field.data('jcfInstance').values = [newMinValue, newMaxValue];
2492			field.trigger('input');
2493			jcf.refresh(field);
2494
2495			// Trigger change event to filtration
2496			field.trigger('change');
2497		});
2498
2499		updateInputValues(defaultValues);
2500
2501		function showErrorMessage(message) {
2502			setTimeout(() => {
2503				errorMessage.text(message).show();
2504			}, 10);
2505		}
2506
2507		function updateInputValues(values) {
2508			const minValue = (Math.round(values[0] * 100) / 100).toString().trim();
2509			const maxValue = (Math.round(values[1] * 100) / 100).toString().trim();
2510
2511			// Update min and max price inputs
2512			minPrice.val(transformValueToMoney(minValue));
2513			maxPrice.val(transformValueToMoney(maxValue));
2514
2515			// Update hidden field with min and max values
2516			hiddenField.val((values[0]).toString().trim() + ',' + (values[1]).toString().trim());
2517		}
2518
2519		function transformValueToMoney(value) {
2520			const prefix = value > 0 ? '$' : '';
2521
2522			return prefix + parseInt(value, 10).toLocaleString('en-US');
2523		}
2524	});
2525
2526	jQuery('.modal-range-box').each(function() {
2527		const holder = jQuery(this);
2528		const field = holder.find('[type="range"]');
2529		const hiddenField = holder.find('[type="hidden"]');
2530
2531		field.on('input', function() {
2532			const values = field.data('jcfInstance').values;
2533
2534			hiddenField.val((values[0]).toString().trim() + ',' + (values[1]).toString().trim());
2535		});
2536	});
2537
2538	jQuery('.se-sbp-widget__range').each(function() {
2539		const holder = jQuery(this);
2540		const field = holder.find('[type="range"]');
2541		const rangeLine = holder.find('.jcf-range-display');
2542		const valueField = holder.find('.se-sbp-widget__range-input');
2543		const currency = field.data('currency');
2544		const rangeValue = field.data('range-value');
2545		const max = field.attr('max');
2546		const activeClass = 'half-path';
2547
2548		field.on('input', function() {
2549			onChange();
2550		});
2551
2552		onChange();
2553
2554		function onChange() {
2555			const values = field.data('jcfInstance').values;
2556
2557			if (+values[0] < +max / 2) {
2558				rangeLine.addClass(activeClass);
2559			} else {
2560				rangeLine.removeClass(activeClass);
2561			}
2562
2563			valueField.val(currency + formatToMoney(+values[0]) + '-' + currency + formatToMoney(+values[0] + rangeValue));
2564		}
2565	});
2566
2567	function formatToMoney(number) {
2568		return String(number).replace(/\B(?=(\d{3})+(?!\d))/g, ',');
2569	}
2570
2571	jQuery('#wpsl-wrap').find('select').each((i, it) => jcf.destroy(it));
2572}
2573
2574function initInputMask() {
2575	jQuery('.phone').mask('(000)000-0000');
2576	jQuery('.zip-code').mask('00000');
2577}
2578
2579// open-close init
2580function initOpenClose() {
2581	jQuery('#nav > li').openClose({
2582		activeClass: 'active',
2583		opener: '.slide-opener',
2584		slider: '.menu-slide',
2585		animSpeed: 400,
2586		effect: 'slide'
2587	});
2588}
2589
2590// lightbox init
2591function initFancybox() {
2592	const reverseClass = 'reverse-image';
2593	const bodyReverseClass = 'fancybox-has-reverse';
2594	const body = jQuery('body');
2595
2596	jQuery('a.lightbox:not(.btn-spin), [data-fancybox]:not(.btn-spin)').fancybox({
2597		parentEl: 'body',
2598		margin: [50, 0],
2599		backFocus: false,
2600		beforeShow: function(instance, current) {
2601			body.removeClass(bodyReverseClass);
2602			jQuery('.fancybox-container, .fancybox-image, .fancybox-content').removeClass(reverseClass);
2603
2604			const $opener = current.opts.$orig;
2605
2606			if ($opener && $opener.hasClass(reverseClass)) {
2607				body.addClass(bodyReverseClass);
2608				jQuery('.fancybox-container').addClass(reverseClass);
2609			}
2610		},
2611		afterShow: function() {
2612			if (jQuery('.fancybox-container').hasClass(reverseClass)) {
2613				jQuery('.fancybox-image, .fancybox-content').addClass(reverseClass);
2614			}
2615		},
2616		beforeClose: function() {
2617			jQuery('.fancybox-image, .fancybox-content').removeClass(reverseClass);
2618		},
2619		afterClose: function() {
2620			body.removeClass(bodyReverseClass);
2621			jQuery('.fancybox-container').removeClass(reverseClass);
2622		}
2623	});
2624}
2625
2626// Cookie modal init
2627function initCookieModal() {
2628	const activeStepClass = 'current-step';
2629	const hiddenClass = 'hidden-button';
2630
2631	document.querySelectorAll('.modal[data-cookie-expire-days]').forEach((modal) => {
2632		const ID = modal.getAttribute('id');
2633		const cookieKey = ID + '-is-cashed';
2634		const isShow = modal.dataset.show === 'true';
2635		const cookieExpireDays = modal.dataset.cookieExpireDays !== undefined ? Number(modal.dataset.cookieExpireDays) : 7;
2636		const steps = (modal.querySelectorAll('.modal-steps .step'));
2637		const btnNextStep = modal.querySelector('.btn-next');
2638		const modalContent = modal.querySelector('.modal-content');
2639		const totalSteps = steps.length;
2640		let currentStep = 0;
2641
2642		btnNextStep?.addEventListener('click', (e) => {
2643			e.preventDefault();
2644			goToNextStep();
2645		});
2646
2647		if (!Cookies.get(cookieKey) && isShow) {
2648			setTimeout(() => {
2649				showPopup();
2650			}, 1000);
2651		}
2652
2653		// Set cookie on close modal
2654		jQuery(modal).on('hidden.bs.modal', () => {
2655			setCookie();
2656		});
2657
2658		function goToNextStep() {
2659			currentStep++;
2660
2661			if (currentStep > totalSteps - 1) {
2662				currentStep = totalSteps - 1;
2663			}
2664
2665			if (currentStep === totalSteps - 1) {
2666				btnNextStep.classList.add(hiddenClass);
2667				modalContent?.classList.add('last-step');
2668			}
2669
2670			steps.forEach((step, i) => {
2671				step.classList.remove(activeStepClass);
2672
2673				if (i === currentStep) {
2674					step.classList.add(activeStepClass);
2675				}
2676			});
2677		}
2678
2679		function showPopup() {
2680			jQuery(modal).modal('show');
2681		}
2682
2683		function setCookie() {
2684			Cookies.set(cookieKey, 'true', {
2685				expires: cookieExpireDays,
2686				path: '/'
2687			});
2688		}
2689	});
2690}
2691
2692// mobile menu init
2693function initMobileNav() {
2694	jQuery('body').mobileNav({
2695		menuActiveClass: 'nav-active',
2696		hideOnClickOutside: true,
2697		menuOpener: '.nav-opener',
2698		menuDrop: 'ul'
2699	});
2700
2701	jQuery('body').mobileNav({
2702		menuActiveClass: 'navigation-active',
2703		menuOpener: '.navigation-opener',
2704		hideOnClickOutside: true,
2705		menuDrop: '.header-frame'
2706	});
2707
2708	jQuery('.form-box').mobileNav({
2709		menuActiveClass: 'form-active',
2710		menuOpener: '.form-opener'
2711	});
2712
2713	jQuery('.help-holder').mobileNav({
2714		menuActiveClass: 'popup-active',
2715		menuOpener: '.opener',
2716		hideOnClickOutside: true,
2717		menuDrop: '.popup'
2718	});
2719
2720	jQuery('.drop-models-popup').mobileNav({
2721		menuActiveClass: 'popup-active',
2722		menuOpener: '.btn-models',
2723		hideOnClickOutside: true,
2724		menuDrop: '.dropdown-models'
2725	});
2726
2727	jQuery('.drop-schedule-popup').mobileNav({
2728		menuActiveClass: 'popup-active',
2729		menuOpener: '.btn-schedule, .btn-close',
2730		hideOnClickOutside: true,
2731		menuDrop: '.dropdown-schedule'
2732	});
2733
2734	jQuery('body').mobileNav({
2735		menuActiveClass: 'chat-active',
2736		menuOpener: '.ai-chat__opener, .ai-chat__close',
2737		hideOnClickOutside: false,
2738		menuDrop: '.ai-chat'
2739	});
2740
2741	ResponsiveHelper.addRange({
2742		'..1200': {
2743			on: function() {
2744				jQuery('body').mobileNav({
2745					menuActiveClass: 'filter-active',
2746					menuOpener: '.filter-opener',
2747					hideOnClickOutside: true,
2748					menuDrop: '.aside'
2749				});
2750			},
2751			off: function() {
2752				jQuery('body').mobileNav('destroy');
2753			}
2754		}
2755	});
2756}
2757
2758// filtering init
2759function initFiltering() {
2760	jQuery('.filter-section, .dropdown-models').filteringItems({
2761		items: '.slide, .drop-model-list > li',
2762		filterHolder: '.models-filter, .drop-model-slider',
2763		filterItems: 'a[data-filter]',
2764		onInit: function() {
2765			this.slider = this.holder.find('.model-slider');
2766		},
2767		beforeFilter: function() {
2768			if (this.slider.length) {
2769				this.slider.trigger('beforeFilter');
2770			}
2771		},
2772		onFilter: function() {
2773			if (this.slider.length) {
2774				this.slider.trigger('rebuild');
2775			}
2776		}
2777	});
2778
2779	jQuery('.team-section').filteringItems({
2780		items: '.card-team',
2781		filterHolder: '.team-filters',
2782		filterItems: 'button[data-filter]'
2783	});
2784}
2785
2786function initSwitchModalText() {
2787	let currID = null;
2788
2789	jQuery('.section-specials .payment-info a[data-target]').each(function() {
2790		const link = jQuery(this);
2791		const modal = jQuery(link.data('target'));
2792		const ID = link.data('vehicle-id');
2793
2794		link.on('click', () => {
2795			currID = ID;
2796
2797			if (modal.length) {
2798				const textHolder = modal.find('.text-holder');
2799				const textBoxes = textHolder.find('> div');
2800
2801				textBoxes.hide();
2802
2803				if (currID !== null) {
2804					jQuery('#' + currID).show();
2805				}
2806
2807				jcf.refresh(textHolder);
2808			}
2809		});
2810	});
2811}
2812
2813// custom map init
2814function initCustomMap() {
2815	jQuery('.map-holder').each(function() {
2816		const holder = jQuery(this);
2817		const zoom = holder.data('zoom') || 16;
2818
2819		holder.customMap({
2820			zoom,
2821			coordinates: 'data-coordinates',
2822			stylesAttr: 'data-styles'
2823		});
2824	});
2825}
2826
2827function initAjaxForm() {
2828	jQuery(document).on('wpformsAjaxSubmitSuccess', function(event, formData) {
2829		const form = jQuery('<div>').html(formData.data.confirmation);
2830		const fieldBlock = form.find('.fields');
2831
2832		if (fieldBlock.length && window.utag) {
2833			const fieldData = JSON.parse(fieldBlock.text());
2834
2835			if (!fieldData) return;
2836
2837			const id = fieldData.fields['data-id'];
2838			const email = fieldData.fields['data-email'];
2839			const phone = fieldData.fields['data-phone'];
2840			const firstName = fieldData.fields['data-firstname'];
2841			const lastName = fieldData.fields['data-lastname'];
2842			let customer_email = '';
2843			let customer_phone = '';
2844			let customer_first_name = '';
2845			let customer_last_name = '';
2846
2847			if (email) {
2848				// lowercased and trimmed, then SHA256 hashed*
2849				customer_email = sha256(email.toLowerCase().trim());
2850			}
2851
2852			if (phone) {
2853				// digits only (1-9), no country code, then SHA256 hashed*
2854				customer_phone = sha256(phone.toLowerCase().trim().replace(/[^\w\s]/gi, '').replace(/\s+/g, ''));
2855			}
2856
2857			if (firstName) {
2858				// lowercased and all whitespace/special chars removed, then SHA256 hashed*
2859				customer_first_name = sha256(firstName.toLowerCase().trim().replace(/[^\w\s]/gi, '').replace(/\s+/g, ''));
2860			}
2861
2862			if (lastName) {
2863				// lowercased and all whitespace/special chars removed, then SHA256 hashed*
2864				customer_last_name = sha256(lastName.toLowerCase().trim().replace(/[^\w\s]/gi, '').replace(/\s+/g, ''));
2865			}
2866
2867			window.utag.link({
2868				tealium_event: id,
2869				customer_email: customer_email,
2870				customer_phone: customer_phone,
2871				customer_first_name: customer_first_name,
2872				customer_last_name: customer_last_name
2873			});
2874		}
2875	});
2876}
2877
2878function initSpinPopup() {
2879	jQuery('a.btn-spin[data-fancybox]').each((index, element) => {
2880		new SpinPopup(element);
2881	});
2882}
2883
2884/*
2885 * SpinPopup module
2886 */
2887class SpinPopup {
2888	constructor(button, options) {
2889		this.options = {
2890			vinSelector: '.detail-info .vin',
2891			dealerImageApiUrl: 'https://photon360.dealerimagepro.com/v4/vdpdata',
2892			autoportUrl: 'https://dev-api.dealerimagepro.com/sandbox/assets',
2893			...options
2894		};
2895
2896		if (!button) return;
2897
2898		this.btnSpin = jQuery(button);
2899		this.detailSection = this.btnSpin.closest('.detail-section');
2900		this.vin = this.detailSection.find(this.options.vinSelector);
2901		this.isMobile = false;
2902		this.additionalClass = '';
2903		this.responsiveInitialized = false;
2904
2905		this.init();
2906	}
2907
2908	init() {
2909		this.initResponsive();
2910		this.initButton();
2911		this.bindEvents();
2912	}
2913
2914	bindEvents() {
2915		this.btnSpin.fancybox({
2916			parentEl: 'body',
2917			margin: [50, 0],
2918			backFocus: false,
2919			iframe: {
2920				tpl: '<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" allow="autoplay; fullscreen" src=""></iframe>',
2921				preload: false
2922			},
2923			beforeShow: () => {
2924				jQuery('.fancybox-container').addClass(`spin-360 ${this.additionalClass}`);
2925			},
2926			afterShow: function() {
2927				// Trigger window resize for update iframes
2928				setTimeout(() => {
2929					jQuery(window).trigger('resize');
2930				}, 200);
2931			}
2932		});
2933	}
2934
2935	initResponsive() {
2936		if (this.responsiveInitialized) return;
2937
2938		this.responsiveInitialized = true;
2939
2940		ResponsiveHelper.addRange({
2941			'..767': {
2942				on: () => {
2943					this.isMobile = true;
2944				}
2945			},
2946			'768..': {
2947				on: () => {
2948					this.isMobile = false;
2949				}
2950			}
2951		});
2952	}
2953
2954	initButton() {
2955		this.btnSpin.hide();
2956
2957		if (this.btnSpin.hasClass('spin-evo')) {
2958			this.initEvo();
2959		}
2960
2961		if (!this.vin.length) return;
2962
2963		const fullVin = this.vin.text().trim();
2964
2965		switch (true) {
2966			case this.btnSpin.hasClass('spin-impel'):
2967				this.initImpel(fullVin);
2968				break;
2969			case this.btnSpin.hasClass('spin-dealerimage'):
2970				this.initDealerImage(fullVin);
2971				break;
2972			case this.btnSpin.hasClass('spin-autoexact'):
2973				this.initAutoexact(fullVin);
2974				break;
2975			case this.btnSpin.hasClass('spin-lesa'):
2976				this.initLesa(fullVin);
2977				break;
2978			case this.btnSpin.hasClass('spin-video'):
2979				this.initVideo();
2980				break;
2981			case this.btnSpin.hasClass('spin-autoport'):
2982				this.initAutoport(fullVin);
2983				break;
2984		}
2985	}
2986
2987	initEvo() {
2988		const href = this.btnSpin.attr('href');
2989
2990		if (!href || href === '#') return;
2991
2992		const evoModal = jQuery(`${href}`);
2993
2994		if (evoModal) {
2995			this.btnSpin.attr('data-type', 'inline');
2996			this.btnSpin.show();
2997			this.additionalClass = 'evo';
2998		}
2999	}
3000
3001	initImpel(fullVin) {
3002		const auth = this.btnSpin.data('auth');
3003		const clientID = this.btnSpin.data('clientid');
3004
3005		if (auth !== undefined && clientID !== undefined) {
3006			const url = `https://wa-detection-api.spincar.com/?auth=${auth}&cid=${clientID}&vin=${fullVin}`;
3007
3008			jQuery.ajax({
3009				url: url,
3010				type: 'GET',
3011				dataType: 'json',
3012				success: data => {
3013					if (data.url) {
3014						this.btnSpin.show().attr('data-src', data.url + '#!hidecarousel!disabledrawer');
3015						this.additionalClass = 'impel';
3016					}
3017				},
3018				error: function(data) {
3019					if (data.statusText === 'error') {
3020						console.error('Error:', data.statusText);
3021					}
3022				}
3023			});
3024		}
3025	}
3026
3027	initDealerImage(fullVin) {
3028		const dealerID = this.btnSpin.data('dealer-id') || this.btnSpin.data('clientid');
3029
3030		if (dealerID === undefined) return;
3031
3032		const url = `https://viewer.dealerimagepro.com/?dealer=${dealerID}&vin=${fullVin}&viewer=slider&activeView=images&excludeViews=imperfections,window-sticker`;
3033
3034		this.checkDealerImageURL(dealerID, fullVin, () => {
3035			this.btnSpin.show().attr('data-src', url);
3036			this.additionalClass = 'dealerimage';
3037		});
3038	}
3039
3040	initAutoexact(fullVin) {
3041		const url = `https://s3.amazonaws.com/cdn.360booth.com/player_s1.html?vin=${fullVin}`;
3042		const checkingURL = `https://s3.amazonaws.com/photos.autoexact.com/photos/${fullVin.slice(0, 9)}/${fullVin}_data.json`;
3043
3044		this.checkURL(checkingURL, () => {
3045			this.btnSpin.show().attr('data-src', url);
3046			this.additionalClass = 'autoexact';
3047		});
3048	}
3049
3050	initLesa(fullVin) {
3051		const postfix = this.isMobile ? '' : '&full_size=1';
3052		const url = `https://player1.lesautomotive.com/?mode=vdp&vin=${fullVin}${postfix}`;
3053
3054		this.checkURL(url, () => {
3055			this.btnSpin.show().attr('data-src', url);
3056			this.additionalClass = 'lesa';
3057		});
3058	}
3059
3060	initVideo() {
3061		const videoURL = this.btnSpin.data('url');
3062
3063		if (videoURL && videoURL !== '') {
3064			this.btnSpin.show().attr('data-src', videoURL).addClass('video-link');
3065			this.additionalClass = 'video';
3066		}
3067	}
3068
3069	initAutoport(fullVin) {
3070		const headers = {
3071			'Content-Type': 'application/json',
3072			Authorization: 'Bearer YOUR_ACCESS_TOKEN'
3073		};
3074
3075		const data = {
3076			autoport_id: 37,
3077			vin: fullVin,
3078			limit: 50,
3079			offset: 0,
3080			image_type: 'webp'
3081		};
3082
3083		fetch(this.options.autoportUrl, {
3084			method: 'POST',
3085			headers: headers,
3086			body: JSON.stringify(data)
3087		})
3088			.then(response => {
3089				if (!response.ok) {
3090					throw new Error(`HTTP error! status: ${response.status}`);
3091				}
3092
3093				return response.json();
3094			})
3095			.then(data => {
3096				this.btnSpin.show().attr('data-src', data.data[0].insta360).removeAttr('data-type');
3097			})
3098			.catch(error => {
3099				console.error('Error:', error.message);
3100			});
3101	}
3102
3103	checkURL(url, successCallback) {
3104		const request = new XMLHttpRequest();
3105
3106		request.open('GET', url, true);
3107
3108		request.onreadystatechange = function() {
3109			if (request.readyState === 4) {
3110				if (request.status !== 404) {
3111					successCallback();
3112				} else {
3113					console.error('Error:', request.statusText);
3114				}
3115			}
3116		};
3117
3118		request.send();
3119	}
3120
3121	checkDealerImageURL(dealerID, vin, successCallback) {
3122		jQuery.ajax({
3123			url: this.options.dealerImageApiUrl,
3124			type: 'POST',
3125			contentType: 'application/json',
3126			dataType: 'json',
3127			data: JSON.stringify({
3128				dealer: String(dealerID),
3129				vin: vin,
3130				viewer: 'slider',
3131				activeView: 'images'
3132			}),
3133			success: data => {
3134				successCallback();
3135			},
3136			error: function(data) {
3137				console.error('Error:', data.statusText);
3138			}
3139		});
3140	}
3141}
3142
3143/*
3144 * CompareProducts module
3145 */
3146class CompareProducts {
3147	constructor(holder, options) {
3148		this.options = {
3149			cookieName: 'compare_vehicles',
3150			defaultPosttype: 'listings',
3151			buttonSelector: '.compare__btn',
3152			activeClass: 'selected',
3153			tooltipAddLabel: '+Compare',
3154			tooltipRemoveLabel: '-Compare',
3155			popupSelector: '.compare-popup',
3156			popupActiveClass: 'is-active',
3157			popupCloseSelector: '.compare-popup__close',
3158			popupListSelector: '.compare-popup__list',
3159			popupDeleteButtonSelector: '.compare-popup__list-btn-del',
3160			popupItemTemplateSelector: '#compare-popup-item-template',
3161			popupTitleSelector: '.compare-popup__title',
3162			popupCountSelector: '.compare-popup__count',
3163			popupTextSelector: '.compare-popup__text',
3164			popupInfoSelector: '.compare-popup__info',
3165			popupCompareButtonSelector: '.compare-popup__footer .btn-compare',
3166			minItemsToCompare: 2,
3167			hiddenClass: 'd-none',
3168			compareModalSelector: '#compareModal',
3169			compareTableSelector: '.compare-table',
3170			compareColumnSelector: '.compare-table__column',
3171			compareColumnTemplateSelector: '#compare-column-template',
3172			emptyColumnTemplateSelector: '#compare-empty-column-template',
3173			skeletonColumnTemplateSelector: '#compare-skeleton-column-template',
3174			specRowsPartialSelector: '#compare-spec-rows-template',
3175			specRowsPartialName: 'compareSpecRows',
3176			compareDeleteButtonSelector: '.card-compare__btn-del',
3177			compareTextSelector: '.compare-table__text',
3178			termFieldSelector: '[data-term]',
3179			similaritySwitchSelector: '#compareSwitcher',
3180			similarClass: 'is-similar',
3181			emptyColumnClass: 'is-empty',
3182			maxItems: 5,
3183			compareSpecRowsStart: 3,
3184			...options
3185		};
3186
3187		if (!holder) return;
3188
3189		this.holder = holder;
3190		this.items = this.getStoredItems();
3191		this.vehicles = [];
3192
3193		this.init();
3194	}
3195
3196	init() {
3197		this.findElements();
3198		this.bindGridEvents();
3199		this.bindPopupEvents();
3200		this.bindModalEvents();
3201	}
3202
3203	findElements() {
3204		this.popup = document.querySelector(this.options.popupSelector);
3205		this.popupTitle = this.popup ? this.popup.querySelector(this.options.popupTitleSelector) : null;
3206		this.popupTitleHTML = this.popupTitle ? this.popupTitle.innerHTML : '';
3207		this.modal = document.querySelector(this.options.compareModalSelector);
3208		this.compareTable = this.modal ? this.modal.querySelector(this.options.compareTableSelector) : null;
3209		this.similaritySwitch = this.modal ? this.modal.querySelector(this.options.similaritySwitchSelector) : null;
3210		this.registerSpecRowsPartial();
3211
3212		this.popupItemTemplate = this.compileTemplate(this.options.popupItemTemplateSelector);
3213		this.columnTemplate = this.compileTemplate(this.options.compareColumnTemplateSelector);
3214		this.emptyColumnTemplate = this.compileTemplate(this.options.emptyColumnTemplateSelector);
3215		this.skeletonColumnTemplate = this.compileTemplate(this.options.skeletonColumnTemplateSelector);
3216	}
3217
3218	// Registers the shared spec-rows block so the real/empty/skeleton column templates can all include it
3219	registerSpecRowsPartial() {
3220		const source = document.querySelector(this.options.specRowsPartialSelector);
3221
3222		if (source) Handlebars.registerPartial(this.options.specRowsPartialName, source.innerHTML);
3223	}
3224
3225	// Toggles an item on click of a grid card's compare button
3226	bindGridEvents() {
3227		this.holder.addEventListener('click', (e) => {
3228			const button = e.target.closest(this.options.buttonSelector);
3229
3230			if (button) this.toggleItem(button);
3231		});
3232	}
3233
3234	// Handles the popup's close button and per-item delete buttons
3235	bindPopupEvents() {
3236		if (!this.popup) return;
3237
3238		this.popup.addEventListener('click', (e) => {
3239			if (e.target.closest(this.options.popupCloseSelector)) {
3240				this.closePopup();
3241				return;
3242			}
3243
3244			const deleteButton = e.target.closest(this.options.popupDeleteButtonSelector);
3245
3246			if (deleteButton) this.removeItem(this.getButtonIdentity(deleteButton));
3247		});
3248	}
3249
3250	// Renders the compare table on open and wires its delete buttons and similarity switch
3251	bindModalEvents() {
3252		if (!this.modal) return;
3253
3254		jQuery(this.modal).on('show.bs.modal', () => {
3255			this.closePopup();
3256			this.renderCompareTable();
3257		});
3258
3259		this.modal.addEventListener('click', (e) => {
3260			const deleteButton = e.target.closest(this.options.compareDeleteButtonSelector);
3261
3262			if (deleteButton) this.removeItem(this.getButtonIdentity(deleteButton));
3263		});
3264
3265		if (this.similaritySwitch) {
3266			this.similaritySwitch.addEventListener('change', () => this.updateSimilarityHighlight());
3267		}
3268	}
3269
3270	// Marks backend-rendered grid buttons as active if their item is already in the compare list
3271	syncButtons(items) {
3272		items.forEach((item) => {
3273			const button = item.querySelector(this.options.buttonSelector);
3274
3275			if (!button) return;
3276
3277			const isSelected = this.findItemIndex(this.getButtonIdentity(button)) !== -1;
3278
3279			button.classList.toggle(this.options.activeClass, isSelected);
3280			this.updateButtonTooltip(button, isSelected);
3281		});
3282	}
3283
3284	// Updates the compare button's tooltip label to reflect whether the item is selected
3285	updateButtonTooltip(button, isSelected) {
3286		const label = isSelected ? this.options.tooltipRemoveLabel : this.options.tooltipAddLabel;
3287
3288		button.setAttribute('title', label);
3289
3290		if (!jQuery.fn.tooltip) return;
3291
3292		jQuery(button).attr('data-original-title', label);
3293
3294		// Bootstrap only reads data-original-title when the tooltip opens, so if it's already
3295		// showing (e.g. clicked while hovering), the visible bubble needs its text patched directly.
3296		const tooltipId = button.getAttribute('aria-describedby');
3297		const tooltipInner = tooltipId && document.getElementById(tooltipId)?.querySelector('.tooltip-inner');
3298
3299		if (tooltipInner) tooltipInner.textContent = label;
3300	}
3301
3302	// Adds or removes an item from the compare list on grid button click
3303	toggleItem(button) {
3304		const identity = this.getButtonIdentity(button);
3305		const index = this.findItemIndex(identity);
3306		const isAdding = index === -1;
3307
3308		if (!isAdding) {
3309			this.items.splice(index, 1);
3310			button.classList.remove(this.options.activeClass);
3311		} else if (this.items.length < this.options.maxItems) {
3312			this.items.push(identity);
3313			button.classList.add(this.options.activeClass);
3314		} else {
3315			this.openPopup();
3316			return;
3317		}
3318
3319		this.updateButtonTooltip(button, isAdding);
3320		this.persistAndRerender();
3321
3322		if (isAdding) {
3323			this.openPopup();
3324		} else if (!this.items.length) {
3325			this.closePopup();
3326		}
3327	}
3328
3329	// Removes an item from the compare list and unselects its grid button, if rendered
3330	removeItem(identity) {
3331		const index = this.findItemIndex(identity);
3332
3333		if (index === -1) return;
3334
3335		this.items.splice(index, 1);
3336		this.persistAndRerender();
3337
3338		const gridButton = this.holder.querySelector(
3339			`${this.options.buttonSelector}[data-postid="${identity.postid}"][data-posttype="${identity.posttype}"]`
3340		);
3341
3342		if (gridButton) {
3343			gridButton.classList.remove(this.options.activeClass);
3344			this.updateButtonTooltip(gridButton, false);
3345		}
3346
3347		if (!this.items.length) this.closePopup();
3348	}
3349
3350	// Stores the vehicle data fetched via `data-vehicles`, used to render the popup and compare table
3351	setVehicles(vehicles) {
3352		this.vehicles = vehicles;
3353		this.renderPopupList();
3354	}
3355
3356	// Reads the postid/posttype pair a compare button is tagged with
3357	getButtonIdentity(button) {
3358		return {
3359			postid: button.dataset.postid,
3360			posttype: button.dataset.posttype || this.options.defaultPosttype
3361		};
3362	}
3363
3364	// Saves the compare list to the cookie and re-renders the popup and compare table
3365	persistAndRerender() {
3366		this.saveItems();
3367		this.renderPopupList();
3368		this.renderCompareTable();
3369	}
3370
3371	openPopup() {
3372		if (this.popup) {
3373			this.popup.classList.add(this.options.popupActiveClass);
3374		}
3375	}
3376
3377	closePopup() {
3378		if (this.popup) {
3379			this.popup.classList.remove(this.options.popupActiveClass);
3380		}
3381	}
3382
3383	renderPopupList() {
3384		if (!this.popup) return;
3385
3386		const list = this.popup.querySelector(this.options.popupListSelector);
3387		const text = this.popup.querySelector(this.options.popupTextSelector);
3388		const info = this.popup.querySelector(this.options.popupInfoSelector);
3389		const compareButton = this.popup.querySelector(this.options.popupCompareButtonSelector);
3390		const isMax = this.items.length >= this.options.maxItems;
3391
3392		if (list) {
3393			list.innerHTML = this.items.map((item) => this.buildPopupItemHTML(item)).join('');
3394		}
3395
3396		if (this.popupTitle) {
3397			if (isMax) {
3398				this.popupTitle.textContent = this.popupTitle.dataset.maxText || '';
3399			} else {
3400				this.popupTitle.innerHTML = this.popupTitleHTML;
3401				this.popupTitle.querySelector(this.options.popupCountSelector).textContent = this.options.maxItems - this.items.length;
3402			}
3403		}
3404
3405		if (text) {
3406			text.classList.toggle(this.options.hiddenClass, isMax);
3407		}
3408
3409		if (info) {
3410			info.classList.toggle(this.options.hiddenClass, !isMax);
3411		}
3412
3413		if (compareButton) {
3414			compareButton.disabled = this.items.length < this.options.minItemsToCompare;
3415		}
3416	}
3417
3418	// Renders one popup `<li>` from the item template
3419	buildPopupItemHTML(item) {
3420		if (!this.popupItemTemplate) return '';
3421
3422		const vehicle = this.findVehicleData(item.postid);
3423
3424		return this.popupItemTemplate({
3425			postid: item.postid,
3426			posttype: item.posttype,
3427			photo: vehicle ? vehicle.photo : '',
3428			title: vehicle ? vehicle.title : ''
3429		});
3430	}
3431
3432	// Finds the fetched vehicle entry matching a postid by parsing its embedded card HTML
3433	findVehicleData(postid) {
3434		return this.vehicles.find((vehicle) => this.extractPostId(vehicle.html) === postid);
3435	}
3436
3437	compileTemplate(selector) {
3438		const source = document.querySelector(selector);
3439
3440		return source ? Handlebars.compile(source.innerHTML) : null;
3441	}
3442
3443	renderCompareTable() {
3444		if (!this.compareTable || !this.columnTemplate) return;
3445
3446		const columnsHTML = this.items.map((item) => this.columnTemplate(this.buildCompareColumnData(item)));
3447
3448		columnsHTML.push(...this.buildEmptyColumnsHTML());
3449
3450		this.compareTable.innerHTML = columnsHTML.join('');
3451
3452		Array.from(this.compareTable.children).forEach((column, index) => {
3453			const item = this.items[index];
3454			const vehicle = item && this.findVehicleData(item.postid);
3455
3456			this.fillTermFields(column, (vehicle && vehicle.terms) || {});
3457		});
3458
3459		this.updateDeleteButtonVisibility();
3460		this.updateSimilarityHighlight();
3461	}
3462
3463	// Hides the delete button on the sole remaining column, so the last item can't be removed from the table
3464	updateDeleteButtonVisibility() {
3465		if (this.items.length !== 1) return;
3466
3467		const deleteButton = this.compareTable.querySelector(this.options.compareDeleteButtonSelector);
3468
3469		if (deleteButton) deleteButton.classList.add(this.options.hiddenClass);
3470	}
3471
3472	// Fills the remaining grid slots (up to maxItems): one "add more" prompt, then skeleton placeholders
3473	buildEmptyColumnsHTML() {
3474		const remaining = this.options.maxItems - this.items.length;
3475
3476		if (remaining <= 0) return [];
3477
3478		const columns = [];
3479
3480		if (this.emptyColumnTemplate) columns.push(this.emptyColumnTemplate({ remaining }));
3481
3482		while (columns.length < remaining && this.skeletonColumnTemplate) {
3483			columns.push(this.skeletonColumnTemplate());
3484		}
3485
3486		return columns;
3487	}
3488
3489	buildCompareColumnData(item) {
3490		const vehicle = this.findVehicleData(item.postid) || {};
3491
3492		return {
3493			postid: item.postid,
3494			posttype: item.posttype,
3495			photo: vehicle.photo || '',
3496			title: this.buildVehicleTitle(vehicle.terms || {}),
3497			link: vehicle.link || '',
3498			price: vehicle.price ? `MSRP: $${vehicle.price}` : '—',
3499			favoriteButton: this.extractFavoriteButtonHTML(vehicle.html)
3500		};
3501	}
3502
3503	// Reuses the grid card's own favorite button markup, so it keeps whatever attributes the plugin's JS relies on.
3504	// Matches either the WP-mode plugin's button (simplefavorite-button) or the API-mode one (api-favorite-button).
3505	extractFavoriteButtonHTML(html) {
3506		const match = /<button[^>
3506]*class="[^"]*(?:simplefavorite-button|api-favorite-button)[^"]*"[^>]*>[\s\S]*?<\/button>/.exec(html || '');
3507
3508		return match ? match[0] : '';
3509	}
3510
3511	// Builds the compare table's title from year/make/model terms instead of the full post title
3512	buildVehicleTitle(terms) {
3513		return ['year', 'make', 'model']
3514			.map((key) => (Array.isArray(terms[key]) && terms[key].length ? terms[key][0] : ''))
3515			.filter(Boolean)
3516			.join(' ');
3517	}
3518
3519	fillTermFields(column, terms) {
3520		column.querySelectorAll(this.options.termFieldSelector).forEach((field) => {
3521			const value = terms[field.dataset.term];
3522			const target = field.querySelector(this.options.compareTextSelector) || field;
3523			const emptyValue = field.dataset.emptyValue !== undefined ? field.dataset.emptyValue : '—';
3524
3525			target.textContent = Array.isArray(value) && value.length ? (field.dataset.valuePrefix || '') + value.join(', ') : emptyValue;
3526		});
3527	}
3528
3529	// Dims spec rows where every column has the same value, when "Hide Similarities" is on
3530	updateSimilarityHighlight() {
3531		if (!this.compareTable || !this.similaritySwitch) return;
3532
3533		const columns = Array.from(this.compareTable.querySelectorAll(this.options.compareColumnSelector))
3534			.filter((column) => !column.classList.contains(this.options.emptyColumnClass));
3535
3536		if (columns.length < 2) return;
3537
3538		const isEnabled = this.similaritySwitch.checked;
3539		const rowCount = columns[0].children.length;
3540
3541		for (let rowIndex = this.options.compareSpecRowsStart; rowIndex < rowCount; rowIndex++) {
3542			const values = columns.map((column) => this.getRowText(column, rowIndex));
3543			const isSimilar = values.every((value) => value === values[0]);
3544
3545			columns.forEach((column) => {
3546				if (column.children[rowIndex]) {
3547					column.children[rowIndex].classList.toggle(this.options.similarClass, isEnabled && isSim
3547ilar);
3548				}
3549			});
3550		}
3551	}
3552
3553	// Reads the trimmed text of a column's spec row, by index
3554	getRowText(column, rowIndex) {
3555		const row = column.children[rowIndex];
3556		const text = row && row.querySelector(this.options.compareTextSelector);
3557
3558		return text ? text.textContent.trim() : '';
3559	}
3560
3561	// Extracts the postid embedded in a vehicle's server-rendered card HTML.
3562	// Not digits-only: API-mode cards key on VIN (alphanumeric), WP-mode cards on the numeric post ID.
3563	extractPostId(html) {
3564		const match = /data-postid="([^"]+)"/.exec(html || '');
3565
3566		return match ? match[1] : null;
3567	}
3568
3569	// Finds the index of an item in the compare list by postid/posttype
3570	findItemIndex(identity) {
3571		return this.items.findIndex((item) => item.postid === identity.postid && item.posttype === identity.posttype);
3572	}
3573
3574	// Reads the compare list from the cookie
3575	getStoredItems() {
3576		try {
3577			return JSON.parse(Cookies.get(this.options.cookieName) || '[]');
3578		} catch (e) {
3579			return [];
3580		}
3581	}
3582
3583	// Persists the compare list to the cookie
3584	saveItems() {
3585		Cookies.set(this.options.cookieName, JSON.stringify(this.items));
3586	}
3587}
3588
3589// Products filtering init
3590function initProductsFiltration() {
3591	if (jQuery('.filter-section').length) {
3592		window.history.scrollRestoration = 'manual';
3593	}
3594
3595	if (jQuery('.detail-section').length && !sessionStorage.getItem('fromProductPage')) {
3596		sessionStorage.removeItem('fromProductPage');
3597	}
3598
3599	const compareProducts = new CompareProducts(document.querySelector('.filter-section'));
3600
3601	jQuery('.filter-section').filteringProducts({
3602		container: '.card-wrapp .row, .card-wrapp .d-grid-row',
3603		items: '.col-sm-6',
3604		filterHolder: '.filter-list',
3605		itemsPerPage: 20,
3606		delay: 0,
3607		onInit: function() {
3608			this.holder.on('click', '.card-body > a', () => {
3609				sessionStorage.setItem('fromProductPage', 'true');
3610				sessionStorage.setItem('scrollPosition', window.scrollY);
3611			});
3612		},
3613		onDataLoad: function(vehicles) {
3614			initAutocomplete();
3615			compareProducts.setVehicles(vehicles);
3616		},
3617		onLoadItems: function(items) {
3618			initFunctions(items);
3619			initUnlockSavings();
3620			initRemoveEmptyItems();
3621			initApiFavoriteButtons();
3622			initTooltip();
3623			compareProducts.syncButtons(Array.from(items));
3624		}
3625	});
3626
3627	function initFunctions(items) {
3628		if (window.blockFrame) {
3629			window.blockFrame.GetDealerInfoForMiniTools();
3630		}
3631
3632		items.find('.detail-slider-holder').each(function() {
3633			const holder = jQuery(this);
3634			const slider = holder.find('.detail-slider');
3635
3636			if (slider.length) {
3637				const slides = slider.find('.slide');
3638
3639				if (slides.length <= 1) return;
3640
3641				slider.slick({
3642					slidesToScroll: 1,
3643					rows: 0,
3644					infinite: false,
3645					prevArrow: '<button class="slick-control slick-prev slick-arrow" aria-label="Previous"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" height="24px" viewBox="0 -960 960 960" width="24px" fill="#000000"><path d="m432-480 156 156q11 11 11 28t-11 28q-11 11-28 11t-28-11L348-452q-6-6-8.5-13t-2.5-15q0-8 2.5-15t8.5-13l184-184q11-11 28-11t28 11q11 11 11 28t-11 28L432-480Z"/></svg></button>',
3646					nextArrow: '<button class="slick-control slick-next slick-arrow" aria-label="Next"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" height="24px" viewBox="0 -960 960 960" width="24px" fill="#000000"><path d="M504-480 348-636q-11-11-11-28t11-28q11-11 28-11t28 11l184 184q6 6 8.5 13t2.5 15q0 8-2.5 15t-8.5 13L404-268q-11 11-28 11t-28-11q-11-11-11-28t11-28l156-156Z"/></svg></button>',
3647					focusOnSelect: true
3648				});
3649			}
3650		});
3651	}
3652}
3653
3654function initUnlockSavings() {
3655	// Keyed by "action|post_id|form_id" → jQuery Deferred promise from prefetch
3656	const prefetchCache = {};
3657
3658	function getPrefetchKey(action, post_id, form_id) {
3659		return `${action}|${post_id}|${form_id}`;
3660	}
3661
3662	let prefetchDone = false;
3663
3664	jQuery('[data-target="#buttonModal"], [data-target="#unlockSavingsModal"], [data-target="#Disclosure_loan-acf"], [data-target="#Disclosure_lease-acf"], [data-target="#Disclosure_Cash-acf"]').each(function() {
3665		const unlockButton = jQuery(this);
3666
3667		if (!unlockButton.data('is-init')) {
3668			unlockButton.data('is-init', true);
3669
3670			unlockButton.on('mouseenter pointerdown', function onFirstHover() {
3671				if (prefetchDone) return;
3672				prefetchDone = true;
3673
3674				const post_id = unlockButton.data('post') || '';
3675				const form_id = unlockButton.data('form') || '';
3676				const target  = unlockButton.data('target');
3677
3678				let action;
3679				if (target === '#unlockSavingsModal' || target === '#buttonModal') {
3680					action = 'unlock_form';
3681				} else if (target === '#Disclosure_loan-acf' || target === '#Disclosure_lease-acf' || target === '#Disclosure_Cash-acf') {
3682					action = 'offers_form';
3683				} else {
3684					return;
3685				}
3686
3687				const key = getPrefetchKey(action, post_id, form_id);
3688				prefetchCache[key] = jQuery.ajax({
3689					url: window.location.href,
3690					type: 'POST',
3691					data: { action, form_id, post_id, target }
3692				});
3693			});
3694
3695			unlockButton.on('click', function(e) {
3696				e.preventDefault();
3697				unlockHandler(unlockButton);
3698			});
3699		}
3700	});
3701
3702	jQuery('#unlockSavingsModal, #contactModal, #buttonModal').on('shown.bs.modal', function() {
3703		setTimeout(() => {
3704			// Write the user journey to the input from the local storage
3705			updateJourneyField();
3706			updateFullCircleFields();
3707		}, 500);
3708	});
3709
3710	// Keep the FullCircle hidden fields fresh on focus and right before submit,
3711	// matching how the FullCircle tracker itself refreshes them.
3712	jQuery(document).on('focusin submit', '.wpforms-form', updateFullCircleFields);
3713	updateFullCircleFields();
3714
3715	jQuery('.wpforms-render-modern').each(function() {
3716		const form = jQuery(this);
3717		const btnSubmit = form.find('.wpforms-page-button');
3718
3719		if (!btnSubmit.length) return;
3720
3721		btnSubmit.on('click', () => {
3722			// Wait for the last page to be shown
3723			setTimeout(() => {
3724				initTwillioAPI(form, false);
3725			}, 100);
3726		});
3727	});
3728
3729	function showUnlockedPrices(modal) {
3730		jQuery('.payment-info a').each(function() {
3731			jQuery(this).closest('li').addClass('show');
3732		});
3733	}
3734
3735	const unlockSavingsModal = jQuery('#unlockSavingsModal');
3736
3737	unlockSavingsModal.on('click', `.wpforms-confirmation-container-full a[href^="${window.location.href}"]`, (e) => {
3738		e.preventDefault();
3739		unlockSavingsModal.modal('hide');
3740	}).on('hide.bs.modal', () => {
3741		showUnlockedPrices(unlockSavingsModal);
3742	});
3743
3744	function unlockHandler(button) {
3745		const post_id = button.data('post') || ''; // some buttons have post_id
3746		const form_id = button.data('form') || ''; // some buttons have form
3747		const target = button.data('target');
3748
3749		if (form_id && target === '#buttonModal') {
3750			const linkText = button.text().trim();
3751			const dataTitleElement = jQuery('[data-title]');
3752
3753			if (dataTitleElement.length) {
3754				dataTitleElement.text(linkText);
3755			}
3756		}
3757
3758		if (!target) return;
3759
3760		jQuery('#savings-form .wpforms-page-1').show(); // show first step
3761		jQuery('#savings-form .wpforms-page-2').hide(); // hide second step
3762
3763		// For button on listing and offers pages
3764		if (target === '#unlockSavingsModal') {
3765			sendRequest('unlock_form', post_id, form_id, target, '#savings-form');
3766		}
3767
3768		if (target === '#buttonModal') {
3769			sendRequest('unlock_form', post_id, form_id, target, '#button-form');
3770		}
3771
3772		// For buttons on homepage
3773		if (target === '#Disclosure_loan-acf' || target === '#Disclosure_lease-acf' || target === '#Disclosure_Cash-acf') {
3774			sendRequest('offers_form', post_id, form_id, target, '.modal-offer .wpforms-ajax-form');
3775		}
3776	}
3777
3778	function sendRequest(action, post_id, form_id, target, formSelector) {
3779		const key = getPrefetchKey(action, post_id, form_id);
3780
3781		// Use the prefetched promise if available, then clear it so next click always fires fresh
3782		const promise = prefetchCache[key] || jQuery.ajax({
3783			url: window.location.href,
3784			type: 'POST',
3785			data: { action, form_id, post_id, target }
3786		});
3787		delete prefetchCache[key];
3788
3789		promise.done(function(response) {
3790			const tempDiv = jQuery('<div>').html(response);
3791			const form = jQuery(formSelector);
3792
3793			jQuery('.post-id input').val(post_id);
3794
3795			// Replace the form with the new one
3796			form.html(tempDiv.children());
3797
3798			// Write the user journey to the input from the local storage
3799			updateJourneyField();
3800			updateFullCircleFields();
3801
3802			// Handle the form pages
3803			initFormPagesHandler(form);
3804
3805			form.find('select').each(function() {
3806				jcf.replace(jQuery(this));
3807			});
3808		});
3809	}
3810}
3811
3812/* Form pages handler */
3813function initFormPagesHandler(form) {
3814	const btnSubmit = document.querySelector('.wpforms-page-button');
3815	const lastPage = document.querySelector('.wpforms-page.last');
3816
3817	if (!btnSubmit) return;
3818
3819	btnSubmit.classList.remove('wpforms-disabled');
3820	btnSubmit.removeAttribute('aria-disabled');
3821
3822	btnSubmit.addEventListener('click', () => {
3823		// Wait for the last page to be shown
3824		setTimeout(() => {
3825			if (lastPage && lastPage.offsetParent !== null) {
3826				initTwillioAPI(form);
3827			}
3828		}, 100);
3829	});
3830}
3831
3832function initTwillioAPI(form, isHideStep = true) {
3833	console.log('Initializing Twillio API for SMS verification');
3834	const phoneField = form.find('div.sms-phone input[name*="wpforms[fields]"]');
3835	const codeField = form.find('div.sms-code input[name*="wpforms[fields]"]');
3836	const requestIdField = form.find('div.sms-request-id input[name*="wpforms[fields]"]');
3837	const phone = formatPhoneNumber(phoneField.val());
3838	const submitBtn = form.find('.wpforms-submit');
3839	let isSendingCode = false;
3840
3841	console.log('WPForms SMS Verification Script Loaded');
3842	console.log('Form found:', form.length ? 'Yes' : 'No');
3843
3844	if (!phone) {
3845		form.find('.sms-message').remove();
3846		codeField.closest('.wpforms-field').after('<div class="sms-message wpforms-error">Error: Phone number not provided</div>');
3847		switchToFirstFormStep(form);
3848
3849		return;
3850	}
3851
3852	if (isSendingCode) {
3853		console.log('SMS already being sent, ignoring');
3854
3855		return;
3856	}
3857
3858	isSendingCode = true;
3859
3860	submitBtn.hide();
3861
3862	form.find('.sms-message').remove();
3863
3864	jQuery.ajax({
3865		url: window.wpforms_settings ? window.wpforms_settings.ajaxurl : window.location.href,
3866		type: 'POST',
3867		data: {
3868			action: 'send_sms_for_verification',
3869			phone: phone
3870		},
3871		success: function(response) {
3872			isSendingCode = false;
3873
3874			if (response.success) {
3875				submitBtn.show();
3876				submitBtn.text('Validate');
3877
3878				requestIdField.val(response.data.requestId);
3879
3880				codeField.closest('.wpforms-field').after('<div class="sms-message wpforms-notice">SMS has been sent to ' + phone + '</div>');
3881			} else {
3882				codeField.closest('.wpforms-field').after('<div class="sms-message wpforms-notice">SMS sending error: ' + (response.data.message || 'Please try again') + '</div>');
3883				switchToFirstFormStep(form);
3884			}
3885		},
3886		error: function(xhr, status, error) {
3887			isSendingCode = false;
3888			console.error('SMS AJAX Error:', status, error);
3889
3890			codeField.closest('.wpforms-field').after('<div class="sms-message wpforms-notice">Server error while sending SMS</div>');
3891			switchToFirstFormStep(form);
3892		}
3893	});
3894}
3895
3896function switchToFirstFormStep(form) {
3897	setTimeout(function() {
3898		form.find('.wpforms-page-1').show();
3899		form.find('.wpforms-page-2').hide();
3900
3901		console.log('Returned to first page due to SMS error');
3902	}, 3000);
3903}
3904
3905function formatPhoneNumber(phone) {
3906	const digits = phone.replace(/\D/g, '');
3907
3908	if (digits.length === 10) {
3909		return `+1${digits}`;
3910	} else if (digits.length === 11 && digits.startsWith('1')) {
3911		return `+${digits}`;
3912	} else if (digits.startsWith('00')) {
3913		return `+${digits.slice(2)}`;
3914	} else if (digits.startsWith('+')) {
3915		return digits;
3916	} else {
3917		return `+${digits}`;
3918	}
3919}
3920
3921/* Filtering Products plugin */
3922(function($) {
3923	function FilteringProducts(options) {
3924		this.options = $.extend({
3925			container: '.items-holder',
3926			items: '.item',
3927			btnFilter: '[type="submit"]',
3928			searchField: '.search-panel [type="search"]',
3929			sortSelect: '[name="sort"]',
3930			rangeFields: '.aside [type="range"]',
3931			activeClass: 'active',
3932			hiddenClass: 'hidden',
3933			loadingClass: 'loading',
3934			disablesClass: 'disabled',
3935			noResultsClass: 'no-results',
3936			selectedFiltersHolder: '.selected-filters-list',
3937			pagingHolder: '.pagination-holder',
3938			currPageCountField: '.curr-page',
3939			btnPrev: '.btn-prev',
3940			btnNext: '.btn-next',
3941			btnReset: '.btn-reset',
3942			btnClear: '.modal-filter .btn-clear',
3943			totalPageCountField: '.total-pages',
3944			currResultsCount: '.result-current',
3945			totalResultsCount: '.result-total',
3946			itemsPerPage: 10,
3947			delay: 500
3948		}, options);
3949
3950		if (this.options.holder) {
3951			this.init();
3952			this.makeCallback('onInit', this);
3953		}
3954	}
3955
3956	FilteringProducts.prototype = {
3957		init: function() {
3958			this.win = $(window);
3959			this.page = $('html, body');
3960			this.header = $('#header');
3961			this.holder = $(this.options.holder);
3962			this.container = this.holder.find(this.options.container);
3963			this.visualSlider = this.holder.find('.visual-slider-srp');
3964			this.visualSliderItems = this.visualSlider.find('[data-key-word]');
3965			this.modalFilterHolder = $('.modal-filter-form');
3966			this.modalFilterLists = this.modalFilterHolder.find('.modal-filter-list');
3967			this.modalRanges = this.modalFilterHolder.find('[type="range"]');
3968			this.filterLists = this.modalFilterHolder.find('[data-filter-category]');
3969			this.modalBtnClear = $(this.options.btnClear);
3970			this.btnReset = this.holder.find(this.options.btnReset);
3971			this.rangeFields = this.holder.find(this.options.rangeFields);
3972			this.searchField = this.holder.find(this.options.searchField).val('');
3973			this.sortSelect = this.holder.find(this.options.sortSelect);
3974			this.selectedFiltersHolder = this.holder.find(this.options.selectedFiltersHolder);
3975			this.pagingHolder = this.holder.find(this.options.pagingHolder).addClass(this.options.hiddenClass);
3976			this.btnPrev = this.holder.find(this.options.btnPrev).addClass(this.options.disablesClass);
3977			this.btnNext = this.holder.find(this.options.btnNext);
3978			this.totalPageCountField = this.holder.find(this.options.totalPageCountField);
3979			this.currPageCountField = this.holder.find(this.options.currPageCountField);
3980			this.currentPage = 1;
3981			this.totalPages = 1;
3982			this.isGivenPage = false;
3983			this.currResultsCount = this.holder.find(this.options.currResultsCount);
3984			this.totalResultsCount = $(this.options.totalResultsCount);
3985			this.filterTemplate = this.modalFilterHolder.data('template');
3986			this.products = {};
3987			this.allProducts = {};
3988			this.cardsByPosition = {};
3989			this.filters = {};
3990			this.activeFilters = {};
3991			this.activeItems = {};
3992			this.modalActiveFilters = {};
3993			this.activeCheckboxCounts = {};
3994			this.rangesMinMaxValues = {};
3995			this.currentFilterType = '';
3996			this.addFilters = {};
3997			this.ajaxBusy = false;
3998			this.isItemsLoaded = false;
3999			this.isSyncingFromUrl = false;
4000			this.count = 0;
4001			this.mileageKey = 'mileage';
4002
4003			// Get extra filter type and value from holder data attributes
4004			this.extraFilterType = this.holder.data('key');
4005			this.extraFilterValue = this.holder.data('value');
4006
4007			let vehiclesURL = this.holder.data('vehicles');
4008
4009			if (vehiclesURL) {
4010				// The page shell can be served from cache, so the "loged" param baked into
4011				// data-vehicles may reflect whoever's visit generated the cache, not this
4012				// visitor. Override it with the real, current auth state from the cookie.
4013				// WordPress' own auth cookie is HttpOnly (unreadable here), so we read the
4014				// non-HttpOnly "wps_logged_in" mirror cookie instead (see theme-functions.php).
4015				const isLoggedIn = /(?:^|;\s*)wps_logged_in=1/.test(document.cookie);
4016
4017				if (/([?&])loged=/.test(vehiclesURL)) {
4018					vehiclesURL = vehiclesURL.replace(/([?&])loged=[^&]*/, `$1loged=${isLoggedIn}`);
4019				} else {
4020					vehiclesURL += (vehiclesURL.indexOf('?') >= 0 ? '&' : '?') + `loged=${isLoggedIn}`;
4021				}
4022
4023				this.holder.addClass(this.options.loadingClass);
4024
4025				const sortType = getUrlAttr('sort').toLocaleLowerCase();
4026
4027				if (sortType === 'custom') { // sort by custom tag
4028					if (vehiclesURL.indexOf('?') >= 0) {
4029						vehiclesURL += '&sort=custom';
4030					} else {
4031						vehiclesURL += '?sort=custom';
4032					}
4033				} else if (sortType === 'unique') { // sort by unique
4034					if (vehiclesURL.indexOf('similar=') >= 0) {
4035						vehiclesURL = vehiclesURL.replace('similar=false', 'similar=true');
4036					} else {
4037						if (vehiclesURL.indexOf('?') >= 0) {
4038							vehiclesURL += '&similar=true';
4039						} else {
4040							vehiclesURL += '?similar=true';
4041						}
4042					}
4043				}
4044
4045				jQuery.getJSON(vehiclesURL, ({vehicles, cards}
4045) => {
4046					this.allProducts = vehicles;
4047					this.cardsByPosition = this.groupCardsByPosition(Array.isArray(cards) ? cards : []);
4048
4049					console.log(this.allProducts);
4050
4051					// set values if payment or price not filled
4052					for (let i = 0; i < this.allProducts.length; i++) {
4053						this.allProducts[i].payment = this.allProducts[i].payment || 0;
4054						this.allProducts[i].price = this.allProducts[i].price || 0;
4055					}
4056
4057					this.products = this.allProducts;
4058					this.togglePaymentRangeVisibility();
4059
4060					this.makeCallback('onDataLoad', vehicles);
4061					this.afterLoadData();
4062				});
4063			}
4064
4065			if (this.visualSlider.length) {
4066				this.initSlider();
4067			}
4068		},
4069		initSlider: function() {
4070			if (!this.visualSlider.hasClass('slick-initialized')) {
4071				this.visualSlider.slick({
4072					slide: '[data-key-word]:not(.hidden)',
4073					slidesToScroll: 1,
4074					rows: 0,
4075					prevArrow: '<button class="slick-control slick-prev slick-arrow" aria-label="Previous"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" height="24px" viewBox="0 -960 960 960" width="24px" fill="#000000"><path d="m432-480 156 156q11 11 11 28t-11 28q-11 11-28 11t-28-11L348-452q-6-6-8.5-13t-2.5-15q0-8 2.5-15t8.5-13l184-184q11-11 28-11t28 11q11 11 11 28t-11 28L432-480Z"/></svg></button>',
4076					nextArrow: '<button class="slick-control slick-next slick-arrow" aria-label="Next"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" height="24px" viewBox="0 -960 960 960" width="24px" fill="#000000"><path d="M504-480 348-636q-11-11-11-28t11-28q11-11 28-11t28 11l184 184q6 6 8.5 13t2.5 15q0 8-2.5 15t-8.5 13L404-268q-11 11-28 11t-28-11q-11-11-11-28t11-28l156-156Z"/></svg></button>',
4077					dots: true,
4078					dotsClass: 'slick-dots',
4079					autoplay: true
4080				});
4081			}
4082		},
4083		destroySlider: function() {
4084			if (this.visualSlider.hasClass('slick-initialized')) {
4085				this.visualSlider.slick('destroy');
4086			}
4087		},
4088		afterLoadData: function() {
4089			const location = decodeURI(window.location.search);
4090
4091			// filter by specific categories from URL
4092			if (location !== '' || location !== '?') {
4093				const filters = location.slice(location.indexOf('?') + 1);
4094				let specialFilterArr = [];
4095
4096				if (filters !== '') {
4097					specialFilterArr = filters.split('&');
4098				}
4099
4100				for (let i = 0; i < specialFilterArr.length; i++) {
4101					const itemArr = specialFilterArr[i].split('=');
4102					const name = itemArr[0].toLowerCase();
4103
4104					if (name.indexOf('certified') === 0 || name.indexOf('dealer-special') === 0) {
4105						let key = '';
4106
4107						if (name.indexOf('certified') === 0) {
4108							key = 'certified';
4109						} else if (name.indexOf('dealer-special') === 0) {
4110							key = 'dealer-special';
4111						}
4112
4113						this.addFilters = {
4114							...this.addFilters,
4115							[key]: itemArr[1]
4116						};
4117					}
4118				}
4119
4120				// Filter by specific categories from URL (certified or dealer-special)
4121				$.each(this.addFilters, (key, value) => {
4122					this.products = this.products.filter((item) => {
4123						if (!item.terms[key]) return false;
4124
4125						const termValue = item.terms[key];
4126
4127						// Split values by comma and trim
4128						const values = value.split(',').map((v) => {
4129							return this.trimText(v).toLowerCase();
4130						});
4131
4132						// If term value is an array
4133						if (Array.isArray(termValue)) {
4134							return values.some((v) => termValue.some((term) => this.trimText(term).toLowerCase() === v));
4135						}
4136
4137						// If term value is a string
4138						const text = this.trimText(termValue).toLowerCase();
4139
4140						return values.some((v) => v === text);
4141					});
4142				});
4143			}
4144
4145			this.activeItems = this.products;
4146
4147			this.togglePaymentRangeVisibility();
4148			this.getAllFilters();
4149			this.createFilterCheckboxes();
4150			this.attachEvents();
4151
4152			// set default range values
4153			this.rangeFields.add(this.modalRanges).each((i, item) => {
4154				const field = $(item);
4155				const input = field.closest('.range-box').find('[type="hidden"]');
4156				const name = input.attr('name');
4157
4158				// hide range if min and max value are the same
4159				if (this.rangesMinMaxValues[this.mileageKey] && this.rangesMinMaxValues[this.mileageKey][0] === this.rangesMinMaxValues[this.mileageKey][1] && name === 'mileage') {
4160					if (this.holder.find('[data-tab="tab-mileage"]').parent().length) {
4161						this.holder.find('[data-tab="tab-mileage"]').parent().hide();
4162					}
4163				}
4164
4165				if (this.rangesMinMaxValues[name]) {
4166					if (this.currentFilterType === name) return;
4167
4168					const rangeAPI = jcf.getInstance(field);
4169
4170					field.attr('value', this.rangesMinMaxValues[name][0] + ',' + this.rangesMinMaxValues[name][1]);
4171					field.attr('min', this.rangesMinMaxValues[name][0]);
4172					field.attr('max', this.rangesMinMaxValues[name][1]);
4173
4174					rangeAPI.destroy();
4175					jcf.replace(field);
4176					field.trigger('input');
4177				}
4178			});
4179
4180			// apply searching after page loaded
4181			if (getUrlAttr('search')) {
4182				let searchValue = decodeURI(getUrlAttr('search'));
4183
4184				searchValue = searchValue.replace(/\+/g, ' ');
4185
4186				this.searchField.val(searchValue);
4187			}
4188
4189			// apply sorting after page loaded
4190			if (getUrlAttr('sort')) {
4191				this.sortSelect.val(getUrlAttr('sort'));
4192
4193				jcf.refresh(this.sortSelect);
4194			}
4195
4196			let filterArr = [];
4197
4198			// set checked state for selected filters from URL
4199			if (location !== '' || location !== '?') {
4200				const filters = location.slice(location.indexOf('?') + 1);
4201
4202				if (filters !== '') {
4203					filterArr = filters.split('&');
4204				}
4205
4206				for (let i = 0; i < filterArr.length; i++) {
4207					const itemArr = filterArr[i].split('=');
4208					const name = itemArr[0].toLowerCase();
4209					const filters = itemArr[1].split(',');
4210
4211					for (let i = 0; i < filters.length; i++) {
4212						const value = filters[i].toLowerCase();
4213						const field = $(`[name="${name}"][value="${value}"]`);
4214
4215						if (field.length && field.is(':checkbox')) {
4216							field.prop('checked', true);
4217							this.updateFilterStates(field, true);
4218						}
4219					}
4220
4221					if (name === 'value' || name === 'payment' || name === 'mileage') {
4222						const input = $(`[name="${name}"]`);
4223
4224						if (input.length) {
4225							const rangeField = input.closest('.range-box').find('[type="range"]');
4226
4227							rangeField.data('isChanged', true);
4228							jcf.getInstance(rangeField).values = itemArr[1].split(',');
4229							rangeField.trigger('input');
4230							jcf.refresh(rangeField);
4231							this.updateFilterStates(rangeField, true);
4232						}
4233					}
4234
4235					if (name === 'page') {
4236						this.currentPage = parseInt(itemArr[1]) || 1;
4237					}
4238				}
4239
4240				this.isGivenPage = this.currentPage === 1 ? false : true;
4241				this.isSyncingFromUrl = filterArr.length > 0;
4242
4243				this.filter();
4244				this.isSyncingFromUrl = false;
4245
4246				setTimeout(() => {
4247					this.goToHistoryPage();
4248
4249					if (sessionStorage.getItem('fromProductPage') === 'true') {
4250						const scrollPosition = sessionStorage.getItem('scrollPosition');
4251
4252						sessionStorage.removeItem('fromProductPage');
4253
4254						if (scrollPosition) {
4255							window.scrollTo(0, parseInt(scrollPosition));
4256							sessionStorage.removeItem('scrollPosition');
4257						}
4258					}
4259
4260					this.isGivenPage = false;
4261				}, 100);
4262			} else {
4263				this.loadItems(this.activeItems.slice(0, this.options.itemsPerPage));
4264			}
4265		},
4266		togglePaymentRangeVisibility: function() {
4267			const paymentRows = this.holder.find('.filter-row').has('[name="payment"]');
4268
4269			if (!paymentRows.length) return;
4270
4271			const hasPayment = Array.isArray(this.allProducts) && this.allProducts.some((item) => {
4272				if (!item) return false;
4273
4274				const value = parseFloat(item.payment);
4275
4276				return !Number.isNaN(value) && value > 0;
4277			});
4278
4279			if (hasPayment) {
4280				paymentRows.show();
4281			} else {
4282				paymentRows.hide();
4283			}
4284		},
4285		attachEvents: function() {
4286			this.searchField.on('keyup onSearch', (e) => {
4287				if (e.keyCode === 13) {
4288					if (this.ajaxBusy) return;
4289
4290					this.resetForm(false);
4291					this.updateHistory(this.searchField);
4292					this.filter();
4293				}
4294			});
4295
4296			this.sortSelect.on('change', (e) => {
4297				if (this.ajaxBusy) return;
4298
4299				const value = this.sortSelect.val().trim().toLowerCase();
4300
4301				this.isGivenPage = true;
4302
4303				this.updateHistory($(e.target));
4304
4305				if (value === 'unique' || value === 'all') {
4306					// reload page if "unique" or "all" selected
4307					window.location.reload();
4308				} else {
4309					this.filter();
4310				}
4311
4312				this.isGivenPage = false;
4313			});
4314
4315			this.filterCheckboxes.on('change', (e) => {
4316				if (this.ajaxBusy) return;
4317
4318				this.updateFilterStates($(e.target));
4319				this.filter();
4320			});
4321
4322			this.rangeFields.add(this.modalRanges).on('change', (e) => {
4323				if (this.ajaxBusy) return;
4324				const field = $(e.target);
4325				const input = field.closest('.range-box').find('[type="hidden"]');
4326				const value = input.val().split(',');
4327
4328				// set "isChanged" if field has been changed manually
4329				field.data('isChanged', true);
4330
4331				this.updateFilterStates(input);
4332
4333				if (value[0] === field.attr('min') && value[1] === field.attr('max')) {
4334					this.updateHistory(input, true);
4335				}
4336
4337				this.filter();
4338			});
4339
4340			this.filter = () => {
4341				this.holder.removeClass(this.options.noResultsClass);
4342				this.searchItems();
4343				this.filterItems(false);
4344				this.createFiltersList();
4345			};
4346
4347			this.selectedFiltersHolder.on('click', '.remove', (e) => {
4348				e.preventDefault();
4349
4350				const btnRemove = $(e.currentTarget);
4351				const field = $(btnRemove.data('field'));
4352				const parent = btnRemove.closest('li');
4353
4354				if (field.is(':checkbox')) {
4355					parent.remove();
4356					field.prop('checked', false);
4357					field.trigger('change');
4358				} else if (field.attr('type') === 'range') {
4359					const input = field.closest('.range-box').find('[type="hidden"]');
4360
4361					parent.remove();
4362
4363					field.val(field.attr('min').toString().trim() + ',' + field.attr('max').toString().trim());
4364					field.trigger('input');
4365					input.val('');
4366					field.trigger('change');
4367
4368					jcf.getInstance(field).values = [field.attr('min'), field.attr('max')];
4369
4370					setTimeout(() => {
4371						jcf.refresh(field);
4372					}, 200);
4373				}
4374
4375				if (!this.ajaxBusy) {
4376					this.filter();
4377				}
4378			});
4379
4380			// Set extra filter from data attributes on this.holder
4381			if (this.extraFilterType && this.extraFilterValue) {
4382				const extraFilter = this.modalFilterHolder.find(`[name="${this.trimText(this.extraFilterType)}"][value="${this.trimText(this.extraFilterValue)}"]`);
4383
4384				if (extraFilter.length) {
4385					extraFilter.prop('checked', true);
4386					extraFilter.trigger('change');
4387				}
4388			}
4389
4390			this.selectedFiltersHolder.on('click', '.btn-clear', (e) => {
4391				e.preventDefault();
4392				// clear search field
4393				this.searchField.val('');
4394				this.resetForm();
4395			});
4396
4397			this.modalBtnClear.add(this.btnReset).on('click', (e) => {
4398				e.preventDefault();
4399				this.resetForm();
4400			});
4401
4402			this.btnPrev.on('click', (e) => {
4403				e.preventDefault();
4404				this.prevPage();
4405			});
4406
4407			this.btnNext.on('click', (e) => {
4408				e.preventDefault();
4409				this.nextPage();
4410			});
4411
4412			this.win.on('goToPage', () => {
4413				this.currentPage = getUrlAttr('page');
4414
4415				this.goToHistoryPage();
4416			});
4417		},
4418		goToHistoryPage: function() {
4419			if (this.currentPage < 1) {
4420				this.currentPage = 1;
4421			}
4422
4423			if (this.currentPage >= this.totalPages) {
4424				this.currentPage = this.totalPages;
4425			}
4426
4427			this.switchPage();
4428		},
4429		prevPage: function() {
4430			if (this.ajaxBusy) return;
4431
4432			this.currentPage = this.currentPage - 1;
4433
4434			if (this.currentPage < 1) {
4435				this.currentPage = 1;
4436			}
4437
4438			this.switchPage();
4439
4440			this.page.animate({
4441				scrollTop: this.holder.offset().top
4442			}, 500);
4443		},
4444		nextPage: function() {
4445			if (this.ajaxBusy) return;
4446
4447			this.currentPage = this.currentPage + 1;
4448
4449			if (this.currentPage >= this.totalPages) {
4450				this.currentPage = this.totalPages;
4451			}
4452
4453			this.switchPage();
4454
4455			this.page.animate({
4456				scrollTop: this.holder.offset().top - this.header.outerHeight()
4457			}, 500);
4458		},
4459		switchPage: function() {
4460			this.count = (this.currentPage - 1) * this.options.itemsPerPage;
4461
4462			this.loadItems(this.activeItems.slice(this.count, this.count + this.options.itemsPerPage));
4463		},
4464		updatePagingButtonsState: function() {
4465			if (this.currentPage === 1) {
4466				this.btnPrev.addClass(this.options.disablesClass);
4467			} else {
4468				this.btnPrev.removeClass(this.options.disablesClass);
4469			}
4470
4471			if (this.currentPage >= this.totalPages) {
4472				this.btnNext.addClass(this.options.disablesClass);
4473			} else {
4474				this.btnNext.removeClass(this.options.disablesClass);
4475			}
4476		},
4477		getAllFilters: function() {
4478			this.activeCheckboxCounts = {};
4479			this.rangesMinMaxValues = {};
4480
4481			for (const item of this.activeItems) {
4482				for (const property in item.terms) {
4483					// create array of all checkboxes for setting counters
4484					if (!this.activeCheckboxCounts[property]) {
4485						this.activeCheckboxCounts[property] = [];
4486					}
4487
4488					if (item.terms[property]) {
4489						for (let i = 0; i < item.terms[property].length; i++) {
4490							const obj = this.activeCheckboxCounts[property].find(o => o.name === item.terms[property][i]);
4491
4492							if (!obj) {
4493								this.activeCheckboxCounts[property].push({
4494									name: item.terms[property][i],
4495									slug: item.terms[property][i].toLowerCase(),
4496									count: 1
4497								});
4498							} else {
4499								obj.count = obj.count + 1;
4500							}
4501						}
4502					}
4503				}
4504
4505				if (!this.isItemsLoaded) {
4506					if (item.price) {
4507						if (!this.rangesMinMaxValues.value) {
4508							this.rangesMinMaxValues.value = [];
4509						}
4510
4511						if (item.price) {
4512							this.rangesMinMaxValues.value.push(item.price);
4513						}
4514					}
4515
4516					if (item.payment) {
4517						if (!this.rangesMinMaxValues.payment) {
4518							this.rangesMinMaxValues.payment = [];
4519						}
4520
4521						if (item.payment) {
4522							this.rangesMinMaxValues.payment.push(item.payment);
4523						}
4524					}
4525
4526					if (item.terms[this.mileageKey] && item.terms[this.mileageKey].length) {
4527						if (!this.rangesMinMaxValues.mileage) {
4528							this.rangesMinMaxValues.mileage = [];
4529						}
4530
4531						if (item.terms[this.mileageKey][0] !== undefined) {
4532							this.rangesMinMaxValues.mileage.push(item.terms[this.mileageKey][0]);
4533						}
4534					}
4535				}
4536			}
4537
4538			if (!this.isItemsLoaded) {
4539				// Get min/max values for ranges fields
4540				for (const key in this.rangesMinMaxValues) {
4541					const max = Math.max(...this.rangesMinMaxValues[key]);
4542					const min = Math.min(...this.rangesMinMaxValues[key]);
4543
4544					this.rangesMinMaxValues[key] = [min, max];
4545				}
4546
4547				// Sort filters alphabetically
4548				for (const key in this.activeCheckboxCounts) {
4549					sortByProperty(this.activeCheckboxCounts[key], 'name', false);
4550				}
4551
4552				this.isItemsLoaded = true;
4553			}
4554		},
4555		createFilterCheckboxes: function() {
4556			this.filterLists.each((i, elem) => {
4557				const list = jQuery(elem);
4558				const filter = list.data('filter-category');
4559				const filterData = this.activeCheckboxCounts[filter];
4560
4561				if (filterData && filterData.length) {
4562					for (let i = 0; i < filterData.length; i++) {
4563						const source = jQuery(this.filterTemplate).html();
4564						const template = Handlebars.compile(source);
4565
4566						filterData[i].slug = filterData[i].slug.toLowerCase();
4567
4568						list.append(template({
4569							...filterData[i],
4570							filter
4571						}));
4572					}
4573				}
4574			});
4575
4576			this.filterCheckboxes = this.modalFilterHolder.find(':checkbox');
4577		},
4578		searchItems: function() {
4579			let value = this.trimText(this.searchField.val());
4580
4581			// Replace "crv" and "hrv" with "cr-v" and "hr-v"
4582			if (value.indexOf('crv') >= 0) {
4583				value = value.replace('crv', 'cr-v');
4584			} else if (value.indexOf('hrv') >= 0) {
4585				value = value.replace('hrv', 'hr-v');
4586			}
4587
4588			this.destroySlider();
4589			this.visualSliderItems.removeClass(this.options.hiddenClass);
4590
4591			// Filter items in "terms object" by search value
4592			this.activeItems = this.products.filter((item) => {
4593				let matched = false;
4594
4595				if (value !== '') {
4596					const searchWordsArr = value.toLowerCase().split(/\s+/); // Split value into words array
4597
4598					// Check if all search words are included in the item
4599					matched = this.containsAllWords(item.terms, searchWordsArr);
4600				} else {
4601					// If search value is empty, show all items
4602					matched = true;
4603				}
4604
4605				return matched;
4606			});
4607
4608			if (value !== '') {
4609				this.visualSliderItems.addClass(this.options.hiddenClass).filter((i, el) => {
4610					const item = $(el);
4611					const filter = this.trimText(item.data('key-word'));
4612
4613					if (filter !== '' && filter.indexOf(value) >= 0) {
4614						item.removeClass(this.options.hiddenClass);
4615					}
4616				});
4617			}
4618
4619			this.filterItems((value !== '') ? true : false);
4620		},
4621
4622		/**
4623		 * Check if all words in the wordsArr array are included in the terms object
4624		 * @param {object} terms - object with terms to search
4625		 * @param {array} wordsArr - array of search words
4626		 * @returns {boolean} - if all words are included in the terms object
4627		 */
4628		containsAllWords(terms, wordsArr) {
4629			const allValues = Object.entries(terms)
4630				.filter(([key]) => key !== 'dealer-special' && key !== 'dealer_special') // Exclude dealer special terms from keyword search
4631				.map(([, value]) => value)
4632				.flat() // Make a flat array of all values
4633				.map(value => {
4634					return value.toString().toLowerCase();
4635				});
4636
4637			return wordsArr.every(word => {
4638				return allValues.some(value => {
4639					return value.includes(word.toLowerCase());
4640				});
4641			});
4642		},
4643
4644		filterItems: function(ifSearchValue) {
4645			this.activeFilters = {};
4646
4647			this.filterCheckboxes.each((i, elem) => {
4648				const currCheckbox = $(elem);
4649
4650				if (currCheckbox.is(':checked')) {
4651					const value = this.trimText(currCheckbox.val());
4652					const category = currCheckbox.attr('name');
4653
4654					this.combineFilters(category, value);
4655				}
4656			});
4657
4658			this.rangeFields.add(this.modalRanges).each((i, item) => {
4659				const field = $(item);
4660				const input = field.closest('.range-box').find('[type="hidden"]');
4661				const value = input.val();
4662				const category = input.attr('name');
4663
4664				// Check that range field has not been changed
4665				if (value !== '' && field.data('isChanged')) {
4666					this.combineFilters(category, value);
4667				}
4668			});
4669
4670			// Add hidden class to all banner items if "model" filter is selected
4671			if (!ifSearchValue && Object.keys(this.activeFilters).length > 0 && Object.keys(this.activeFilters).filter(key => key.startsWith('model')).length) {
4672				this.visualSliderItems.addClass(this.options.hiddenClass);
4673			}
4674
4675			$.each(this.activeFilters, (key, value) => {
4676				// Filter banner items by "data-key-word" attribute
4677				this.visualSliderItems.filter((i, el) => {
4678					const item = $(el);
4679					const filter = this.trimText(item.data('key-word'));
4680
4681					// Check only "model" filter
4682					if (key.indexOf('model') === 0 && value.includes(filter)) {
4683						item.removeClass(this.options.hiddenClass);
4684					}
4685				});
4686
4687				this.activeItems = this.activeItems.filter((item) => {
4688					let matched = false;
4689
4690					if (key === 'value') { // Filter by price
4691						const textArr = +item.price;
4692						const arr = value[0].split(',');
4693
4694						if (textArr !== undefined) {
4695							if (textArr >= +arr[0] && textArr <= +arr[1]) {
4696								matched = true;
4697							}
4698						}
4699					} else if (key === 'payment') { // Filter by payment
4700						const textArr = +item.payment;
4701						const arr = value[0].split(',');
4702
4703						if (textArr !== undefined) {
4704							if (textArr >= +arr[0] && textArr <= +arr[1]) {
4705								matched = true;
4706							}
4707						}
4708					} else if (key === 'mileage') { // Filter by mileage
4709						const textArr = item.terms[this.mileageKey] ? +item.terms[this.mileageKey][0] : 0;
4710						const arr = value[0].split(',');
4711
4712						if (textArr !== undefined) {
4713							if (textArr >= +arr[0] && textArr <= +arr[1]) {
4714								matched = true;
4715							}
4716						}
4717					} else {
4718						if (item.terms[key]) {
4719							const textArr = item.terms[key];
4720
4721							for (let i = 0; i < textArr.length; i++) {
4722								if (value.includes(this.trimText(textArr[i]))) {
4723									matched = true;
4724								}
4725							}
4726						}
4727					}
4728
4729					return matched;
4730				});
4731			});
4732
4733			this.count = 0;
4734			this.totalPages = Math.ceil(this.activeItems.length / this.options.itemsPerPage);
4735
4736			if (!this.isGivenPage) {
4737				this.currentPage = 1;
4738			}
4739
4740			this.sortItems();
4741			this.initSlider();
4742			this.loadItems(this.activeItems.slice(0, this.options.itemsPerPage));
4743		},
4744		sortItems: function() {
4745			const sortValue = this.sortSelect.val();
4746
4747			switch (sortValue) {
4748				case 'highest':
4749					sortByProperty(this.activeItems, 'price', true);
4750					break;
4751				case 'lowest':
4752					sortByProperty(this.activeItems, 'price', false);
4753					break;
4754				case 'highest-payment':
4755					sortByProperty(this.activeItems, 'payment', true);
4756					break;
4757				case 'lowest-payment':
4758					sortByProperty(this.activeItems, 'payment', false);
4759					break;
4760				case 'newest':
4761					sortByDate(this.activeItems, 'year', true);
4762					break;
4763				case 'oldest':
4764					sortByDate(this.activeItems, 'year', false);
4765					break;
4766				case 'dateinstock-new':
4767					sortByDate(this.activeItems, 'dateinstock', true);
4768					break;
4769				case 'dateinstock-old':
4770					sortByDate(this.activeItems, 'dateinstock', false);
4771					break;
4772				case 'priority':
4773					sortByProperty(this.activeItems, 'priority', false);
4774					break;
4775				case 'model':
4776					sortByProperty(this.activeItems, 'model', false);
4777				default:
4778					break;
4779			}
4780		},
4781		/**
4782		 * Groups an array of cards by their position in the final rendered list
4783		 *
4784		 * @param {Array} cards - The array of cards to group
4785		 * @returns {Object} - A map where the keys are the positions and the values are arrays of card HTML
4786		 */
4787		groupCardsByPosition: function(cards) {
4788			const map = {};
4789
4790			for (let i = 0; i < cards.length; i++) {
4791				const card = cards[i];
4792				const position = parseInt(card && card.position, 10);
4793
4794				if (!position || position < 1 || !card.html) continue;
4795
4796				if (!map[position]) {
4797					map[position] = [];
4798				}
4799
4800				map[position].push(card.html);
4801			}
4802
4803			return map;
4804		},
4805		/**
4806		 * Checks whether this final list position is occupied by one or more cards
4807		 *
4808		 * @param {number} position - The position in the final rendered list
4809		 * @returns {boolean} - Whether the position is occupied by one or more cards
4810		 */
4811		hasCardsAtPosition: function(position) {
4812			return Boolean(this.cardsByPosition[position] && this.cardsByPosition[position].length);
4813		},
4814		loadItems: function(items) {
4815			this.updateResultCounters();
4816			this.updateFilterValues();
4817			this.updatePagingButtonsState();
4818
4819			if (this.activeItems.length === 0) {
4820				this.holder.addClass(this.options.noResultsClass);
4821			}
4822
4823			this.ajaxBusy = true;
4824			this.holder.addClass(this.options.loadingClass);
4825			this.container.empty();
4826
4827			const pageStartIndex = this.count || 0;
4828			let outputPosition = 1;
4829			let skippedProducts = 0;
4830
4831			// Appends cards that belong to current final-list position
4832			const appendCardsAtPosition = () => {
4833				const cardsAtPosition = this.cardsByPosition[outputPosition];
4834
4835				if (!cardsAtPosition || !cardsAtPosition.length) return;
4836
4837				for (let j = 0; j < cardsAtPosition.length; j++) {
4838					jQuery(cardsAtPosition[j]).appendTo(this.container);
4839					outputPosition++;
4840				}
4841			};
4842
4843			while (skippedProducts < pageStartIndex) {
4844				// Move through final-list positions until we skip required number of products
4845				if (!this.hasCardsAtPosition(outputPosition)) {
4846					skippedProducts++;
4847				}
4848
4849				outputPosition++;
4850			}
4851
4852			for (let i = 0; i < items.length; i++) {
4853				// Insert cards that belong to current final-list position before product
4854				while (this.hasCardsAtPosition(outputPosition)) appendCardsAtPosition();
4855
4856				// Append items to container
4857				jQuery(items[i].html).appendTo(this.container);
4858
4859				outputPosition++;
4860			}
4861
4862			this.makeCallback('onLoadItems', this.container.find(this.options.items));
4863
4864			setTimeout(() => {
4865				this.holder.removeClass(this.options.loadingClass);
4866				this.ajaxBusy = false;
4867			}, this.options.delay);
4868		},
4869		updateFilterStates: function(item, ifOnPageLoad) {
4870			let name = item.attr('name');
4871			let value = item.val();
4872			let match = true;
4873
4874			// this.currentFilterType should be empty when page is loading
4875			if (!ifOnPageLoad) {
4876				this.currentFilterType = name;
4877			}
4878
4879			if (item.is(':checkbox')) {
4880				if (item.is(':checked')) {
4881					if (this.modalActiveFilters[name]) {
4882						this.modalActiveFilters[name].push(value);
4883						this.modalActiveFilters[name] = [...new Set(this.modalActiveFilters[name])];
4884					} else {
4885						this.modalActiveFilters[name] = [value];
4886					}
4887				} else {
4888					if (this.modalActiveFilters[name]) {
4889						const currValue = this.modalActiveFilters[name];
4890
4891						for (let i = 0; i < currValue.length; i++) {
4892							if (currValue[i] === value) {
4893								currValue.splice(i, 1);
4894							}
4895						}
4896
4897						this.modalActiveFilters[name] = currValue;
4898					}
4899				}
4900			} else {
4901				const field = item.closest('.range-box').find('[type="hidden"]');
4902
4903				name = field.attr('name');
4904				value = field.val();
4905
4906				this.modalActiveFilters[name] = value;
4907			}
4908
4909			setTimeout(() => {
4910				this.modalRanges.each((i, elem) => {
4911					const field = $(elem);
4912					const input = field.closest('.range-box').find('[type="hidden"]');
4913
4914					if (input.val() !== '' && field.attr('value') !== input.val()) {
4915						match = false;
4916					}
4917				});
4918
4919				if (!match) {
4920					this.modalBtnClear.removeAttr('disabled');
4921				} else {
4922					if (this.filterCheckboxes.filter(':checked').length) {
4923						this.modalBtnClear.removeAttr('disabled');
4924					} else {
4925						this.modalBtnClear.attr('disabled', true);
4926					}
4927				}
4928			}, 100);
4929		},
4930		updateFilterValues: function() {
4931			this.getAllFilters();
4932
4933			if (Object.keys(this.activeCheckboxCounts).length) {
4934				this.filterCheckboxes.each((i, elem) => {
4935					const item = $(elem);
4936					const value = item.val();
4937					const parent = item.closest('li');
4938					const countItem = parent.find('.detail-count');
4939					const name = item.attr('name');
4940
4941					if (this.currentFilterType === name) return;
4942
4943					countItem.text(0);
4944
4945					if (this.activeCheckboxCounts[name]) {
4946						for (let i = 0; i < this.activeCheckboxCounts[name].length; i++) {
4947							if (this.activeCheckboxCounts[name][i].name.toLowerCase() === value) {
4948								countItem.text(this.activeCheckboxCounts[name][i].count);
4949							}
4950						}
4951					}
4952
4953					if (+countItem.text() === 0) {
4954						if (!item.is(':checked')) {
4955							parent.hide();
4956						}
4957					} else {
4958						parent.show();
4959					}
4960				});
4961			}
4962
4963			// Hide modal filters if there is no one of active filter
4964			this.modalFilterLists.each((i, item) => {
4965				const list = $(item);
4966				const parent = list.closest('[data-id]');
4967				const ID = parent.attr('data-id');
4968				const visibleItems = list.find('>li').filter((i, item) => $(item).css('display') !== 'none');
4969				const modalBtn = this.holder.find(`[data-tab="${ID}"]`);
4970
4971				if (visibleItems.length === 0) {
4972					modalBtn.parent().hide();
4973				} else {
4974					modalBtn.parent().show();
4975				}
4976			});
4977		},
4978		createFiltersList: function() {
4979			this.filtersArr = [];
4980			this.selectedFiltersHolder.empty();
4981
4982			this.getAllFilters();
4983			this.updateHistory();
4984
4985			this.filterCheckboxes.each((i, elem) => {
4986				const currCheckbox = $(elem);
4987				const currName = currCheckbox.siblings('.fake-label').find('.name');
4988
4989				if (currCheckbox.is(':checked')) {
4990					this.filtersArr.push({
4991						field: currCheckbox,
4992						title: currName.text(),
4993						name: currCheckbox.val()
4994					});
4995				}
4996			});
4997
4998			this.modalRanges.each((i, elem) => {
4999				const field = $(elem);
5000				const input = field.closest('.range-box').find('[type="hidden"]');
5001
5002				if (input.val() !== '' && input.val() !== undefined && getUrlAttr(input.attr('name')) !== '') {
5003					const value = input.val().split(',');
5004
5005					if (value[0] === field.attr('min') && value[1] === field.attr('max')) {
5006						return;
5007					}
5008
5009					this.filtersArr.push({
5010						field,
5011						title: value[0] + ' - ' + value[1] + ' ml',
5012						name: input.attr('name')
5013					});
5014				}
5015			});
5016
5017			let items = $();
5018			let btnClear = $();
5019			let counterItem = $();
5020
5021			if (!this.filtersArr.length) return;
5022
5023			for (let i = 0; i < this.filtersArr.length; i++) {
5024				const item = $('<li><span>' + this.filtersArr[i].title + '</span><a href="#" class="remove"><svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#000000"><path d="M480-424 284-228q-11 11-28 11t-28-11q-11-11-11-28t11-28l196-196-196-196q-11-11-11-28t11-28q11-11 28-11t28 11l196 196 196-196q11-11 28-11t28 11q11 11 11 28t-11 28L536-480l196 196q11 11 11 28t-11 28q-11 11-28 11t-28-11L480-424Z"/></svg></a></li>').appendTo(this.selectedFiltersHolder);
5025
5026				item.find('.remove').data('field', this.filtersArr[i].field);
5027			}
5028
5029			counterItem = $('<li class="counter-item"><a href="#"><span class="num"></span><span class="hide-text">Hide</span></a></li>').hide().appendTo(this.selectedFiltersHolder);
5030			btnClear = $('<li class="clear-item"><a href="#" class="btn-clear">Clear all filters</a></li>').appendTo(this.selectedFiltersHolder);
5031			items = this.selectedFiltersHolder.find('li').not('.counter-item').not('.clear-item');
5032
5033			const hideItems = () => {
5034				let count = 1;
5035
5036				const hide = () => {
5037					if (btnClear.position().top > 0) {
5038						counterItem.show();
5039						items.eq(items.length - count).addClass(this.options.hiddenClass);
5040						counterItem.find('.num').text('+' + items.filter('.' + this.options.hiddenClass).length + ' more');
5041						count++;
5042
5043						hide();
5044					}
5045				};
5046
5047				hide();
5048			};
5049
5050			if (this.selectedFiltersHolder.height <= 35) {
5051				counterItem.remove();
5052			} else {
5053				hideItems();
5054
5055				counterItem.on('click', (e) => {
5056					e.preventDefault();
5057
5058					if (!this.selectedFiltersHolder.hasClass(this.options.activeClass)) {
5059						this.selectedFiltersHolder.addClass(this.options.activeClass);
5060						items.removeClass(this.options.hiddenClass);
5061					} else {
5062						this.selectedFiltersHolder.removeClass(this.options.activeClass);
5063
5064						hideItems();
5065					}
5066				});
5067
5068				if (this.selectedFiltersHolder.hasClass(this.options.activeClass)) {
5069					this.selectedFiltersHolder.addClass(this.options.activeClass);
5070					items.removeClass(this.options.hiddenClass);
5071				}
5072			}
5073		},
5074
5075		/**
5076		 * Syncs URL query string with current filter state
5077		 * Uses pushState by default and replaceState during initial URL sync
5078		 *
5079		 * @param {jQuery} [item] - Filter input that triggered the update
5080		 * @param {boolean} [ifClear] - When true, removes item from query
5081		 */
5082		updateHistory: function(item, ifClear) {
5083			if (!window.history && !window.history.pushState) return;
5084
5085			// Determine if pushState or replaceState should be used
5086			const useReplace = this.isSyncingFromUrl === true;
5087
5088			if (item) {
5089				if (item.is(':checkbox')) {
5090					if (item.is(':checked')) {
5091						window.StorageHistory.set(item.attr('name'), item.val(), true, useReplace);
5092					} else {
5093						window.StorageHistory.remove(item.attr('name'), item.val(), useReplace);
5094					}
5095				} else {
5096					if (ifClear) {
5097						window.StorageHistory.remove(item.attr('name'), '', useReplace);
5098					} else {
5099						window.StorageHistory.set(item.attr('name'), item.val(), false, useReplace);
5100					}
5101				}
5102			} else {
5103				// Update all active modal filters in a single history entry
5104				const existingQuery = window.location.search.replace(/^\?/, '');
5105				let params = existingQuery ? existingQuery.split('&') : [];
5106				const filterKeys = Object.keys(this.modalActiveFilters);
5107				const newParams = [];
5108
5109				// Filter existing filters
5110				params = params.filter((pair) => {
5111					const name = pair.split('=')[0];
5112
5113					return filterKeys.indexOf(name) === -1;
5114				});
5115
5116				// Build new query string
5117				for (const key in this.modalActiveFilters) {
5118					const value = this.modalActiveFilters[key];
5119
5120					if (typeof value === 'string') {
5121						if (value !== '') {
5122							newParams.push(key + '=' + value);
5123						}
5124					} else if (value && value.length) {
5125						newParams.push(key + '=' + value.join(','));
5126					}
5127				}
5128
5129				const nextQuery = params.concat(newParams).join('&');
5130
5131				// Do nothing if the query hasn't changed
5132				if (nextQuery === existingQuery) return;
5133
5134				window.StorageHistory.setQuery(nextQuery, useReplace);
5135			}
5136		},
5137		updateResultCounters: function() {
5138			this.totalPages = Math.ceil(this.activeItems.length / this.options.itemsPerPage);
5139
5140			// show/hide pagination
5141			if (this.totalPages <= 1) {
5142				this.pagingHolder.addClass(this.options.hiddenClass);
5143			} else {
5144				this.pagingHolder.removeClass(this.options.hiddenClass);
5145			}
5146
5147			// total pages count
5148			this.totalPageCountField.text(this.totalPages);
5149
5150			// current page count
5151			this.currPageCountField.text(this.currentPage);
5152
5153			if (this.currentPage > 1) {
5154				window.StorageHistory.set('page', this.currentPage);
5155			} else {
5156				window.StorageHistory.remove('page');
5157			}
5158
5159			// current showing results count
5160			if (this.activeItems.length === 0) {
5161				this.currResultsCount.text(0);
5162			} else {
5163				if (this.activeItems.length < this.count + this.options.itemsPerPage) {
5164					this.currResultsCount.text((this.count + 1) + '-' + this.activeItems.length);
5165				} else {
5166					this.currResultsCount.text((this.count + 1) + '-' + (this.count + this.options.itemsPerPage));
5167				}
5168			}
5169
5170			// total results count
5171			let countText = '';
5172			const countTextItem = this.totalResultsCount.siblings('[data-singular-text]');
5173
5174			if (countTextItem.length) {
5175				const singularText = countTextItem.data('singular-text') || '';
5176				const pluralText = countTextItem.data('plural-text') || '';
5177
5178				if (this.activeItems.length === 1) {
5179					countText = singularText;
5180				} else {
5181					countText = pluralText;
5182				}
5183
5184				countTextItem.text(countText);
5185			}
5186
5187			this.totalResultsCount.text(this.activeItems.length);
5188		},
5189		resetForm: function(ifClearSearchField = true) {
5190			this.modalRanges.add(this.rangeFields).each((i, elem) => {
5191				const field = $(elem);
5192				const input = field.closest('.range-box').find('[type="hidden"]');
5193
5194				if (field.data('isChanged')) {
5195					field.removeData('isChanged');
5196				}
5197
5198				field.data('jcfInstance').values = field.attr('value').split(',');
5199				field.trigger('input');
5200				input.val('');
5201				jcf.refresh(field);
5202			});
5203
5204			// reset search and sort fields
5205			if (ifClearSearchField) {
5206				this.searchField.val('');
5207			}
5208
5209			this.sortSelect.prop('selectedIndex', 0);
5210
5211			jcf.refresh(this.sortSelect);
5212
5213			this.filterCheckboxes.each((i, elem) => {
5214				const currCheckbox = $(elem);
5215
5216				currCheckbox.prop('checked', false);
5217			});
5218
5219			this.destroySlider();
5220			this.visualSliderItems.removeClass(this.options.hiddenClass);
5221			this.initSlider();
5222
5223			this.currentPage = 1;
5224			this.count = 0;
5225			this.activeFilters = {};
5226			this.modalActiveFilters = {};
5227			this.modalBtnClear.attr('disabled', true);
5228			this.selectedFiltersHolder.empty();
5229
5230			this.activeItems = this.allProducts;
5231
5232			this.loadItems(this.activeItems.slice(0, this.options.itemsPerPage));
5233
5234			if (window.history && window.history.pushState) {
5235				window.StorageHistory.reset();
5236			}
5237		},
5238		trimText: function(text) {
5239			return text.toString().trim().toLowerCase();
5240		},
5241		combineFilters: function(category, value) {
5242			if (value !== 'all') {
5243				if (this.activeFilters[category]) {
5244					this.activeFilters[category].push(value);
5245				} else {
5246					this.activeFilters[category] = [];
5247					this.activeFilters[category].push(value);
5248				}
5249			}
5250		},
5251		makeCallback: function(name) {
5252			if (typeof this.options[name] === 'function') {
5253				const args = Array.prototype.slice.call(arguments);
5254
5255				args.shift();
5256				this.options[name].apply(this, args);
5257			}
5258		}
5259	};
5260
5261	function getUrlAttr(name) {
5262		const sectionName = name.replace(/[\[]/, '\\\[').replace(/[\]]/, '\\\]');
5263		const regexS = '[\\?&]' + sectionName + '=([^&#]*)';
5264		const regex = new RegExp(regexS);
5265		const results = regex.exec(window.location.href);
5266
5267		if (results === null) {
5268			return '';
5269		} else {
5270			return results[1];
5271		}
5272	}
5273
5274	function sortByProperty(array, propertyName, reverse) {
5275		return array.sort((a, b) => {
5276			let valA = a[propertyName];
5277			let valB = b[propertyName];
5278
5279			// Sort by model
5280			if (propertyName === 'model') {
5281				valA = a.terms[propertyName]?.[0] || null;
5282				valB = b.terms[propertyName]?.[0] || null;
5283
5284				return compareStrings(valA, valB, reverse);
5285			}
5286
5287			// Sort by name
5288			if (propertyName === 'name') {
5289				return compareStrings(valA, valB, reverse);
5290			}
5291
5292			return compareNumbers(valA, valB, reverse);
5293		});
5294	}
5295
5296	function sortByDate(array, propertyName, reverse) {
5297		return array.sort((a, b) => {
5298			const dateA = parseDate(a[propertyName]);
5299			const dateB = parseDate(b[propertyName]);
5300
5301			return reverse ? dateB - dateA : dateA - dateB;
5302		});
5303	}
5304
5305	function compareStrings(valA, valB, reverse) {
5306		if (valA === null && valB === null) return 0;
5307		if (valA === null) return 1;
5308		if (valB === null) return -1;
5309
5310		const a = valA.trim().toLowerCase();
5311		const b = valB.trim().toLowerCase();
5312		const comparison = a.localeCompare(b, undefined, { numeric: true });
5313
5314		return reverse ? -comparison : comparison;
5315	}
5316
5317	function compareNumbers(valA, valB, reverse) {
5318		const numA = parseFloat(valA);
5319		const numB = parseFloat(valB);
5320
5321		if (numA < numB) return reverse ? 1 : -1;
5322		if (numA > numB) return reverse ? -1 : 1;
5323
5324		return 0;
5325	}
5326
5327	function parseDate(str) {
5328		if (/^\d{14}$/.test(str)) {
5329			// yyyyMMddHHmmss → yyyy-MM-ddTHH:mm:ss
5330			return new Date(
5331				`${str.slice(0, 4)}-${str.slice(4, 6)}-${str.slice(6, 8)}T` +
5332				`${str.slice(8, 10)}:${str.slice(10, 12)}:${str.slice(12, 14)}`
5333			);
5334		}
5335
5336		if (/^\d{4}$/.test(str)) {
5337			// yyyy → yyyy-01-01T00:00:00
5338			return new Date(`${str}-01-01T00:00:00`);
5339		}
5340
5341		return new Date(str);
5342	}
5343
5344	$.fn.filteringProducts = function(opt) {
5345		return this.each(function() {
5346			$(this).data('FilteringProducts', new FilteringProducts($.extend(opt, {
5347				holder: this
5348			})));
5349		});
5350	};
5351}(jQuery));
5352
5353/*!
5354 * SmoothScroll module
5355 */
5356(function($, exports) {
5357	// private variables
5358	let page,
5359		win = $(window),
5360		activeBlock, activeWheelHandler,
5361		wheelEvents = ('onwheel' in document || document.documentMode >= 9 ? 'wheel' : 'mousewheel DOMMouseScroll');
5362
5363	// animation handlers
5364	function scrollTo(offset, options, callback) {
5365		// initialize variables
5366		let scrollBlock;
5367
5368		if (document.body) {
5369			if (typeof options === 'number') {
5370				options = {
5371					duration: options
5372				};
5373			} else {
5374				options = options || {};
5375			}
5376
5377			page = page || $('html, body');
5378			scrollBlock = options.container || page;
5379		} else {
5380			return;
5381		}
5382
5383		// treat single number as scrollTop
5384		if (typeof offset === 'number') {
5385			offset = {
5386				top: offset
5387			};
5388		}
5389
5390		// handle mousewheel/trackpad while animation is active
5391		if (activeBlock && activeWheelHandler) {
5392			activeBlock.off(wheelEvents, activeWheelHandler);
5393		}
5394
5395		if (options.wheelBehavior && options.wheelBehavior !== 'none') {
5396			activeWheelHandler = function(e) {
5397				if (options.wheelBehavior === 'stop') {
5398					scrollBlock.off(wheelEvents, activeWheelHandler);
5399					scrollBlock.stop();
5400				} else if (options.wheelBehavior === 'ignore') {
5401					e.preventDefault();
5402				}
5403			};
5404
5405			activeBlock = scrollBlock.on(wheelEvents, activeWheelHandler);
5406		}
5407
5408		// start scrolling animation
5409		scrollBlock.stop().animate({
5410			scrollLeft: offset.left,
5411			scrollTop: offset.top
5412		}, options.duration, function() {
5413			if (activeWheelHandler) {
5414				scrollBlock.off(wheelEvents, activeWheelHandler);
5415			}
5416
5417			if ($.isFunction(callback)) {
5418				callback();
5419			}
5420		});
5421	}
5422
5423	// smooth scroll contstructor
5424	function SmoothScroll(options) {
5425		this.options = $.extend({
5426			anchorLinks: 'a[href^="#"]', // selector or jQuery object
5427			container: null, // specify container for scrolling (default - whole page)
5428			extraOffset: null, // function or fixed number
5429			activeClasses: null, // null, "link", "parent"
5430			easing: 'swing', // easing of scrolling
5431			animMode: 'duration', // or "speed" mode
5432			animDuration: 800, // total duration for scroll (any distance)
5433			animSpeed: 1500, // pixels per second
5434			anchorActiveClass: 'anchor-active',
5435			sectionActiveClass: 'section-active',
5436			wheelBehavior: 'stop', // "stop", "ignore" or "none"
5437			useNativeAnchorScrolling: false // do not handle click in devices with native smooth scrolling
5438		}, options);
5439
5440		this.init();
5441	}
5442
5443	SmoothScroll.prototype = {
5444		init: function() {
5445			this.initStructure();
5446			this.attachEvents();
5447			this.isInit = true;
5448		},
5449		initStructure: function() {
5450			const self = this;
5451
5452			this.container = this.options.container ? $(this.options.container) : $('html,body');
5453			this.scrollContainer = this.options.container ? this.container : win;
5454
5455			this.anchorLinks = jQuery(this.options.anchorLinks).filter(function() {
5456				return jQuery(self.getAnchorTarget(jQuery(this))).length;
5457			});
5458		},
5459		getId: function(str) {
5460			try {
5461				return '#' + str.replace(/^.*?(#|$)/, '');
5462			} catch (err) {
5463				return null;
5464			}
5465		},
5466		getAnchorTarget: function(link) {
5467			// get target block from link href
5468			const targetId = this.getId($(link).attr('href'));
5469
5470			return $(targetId.length > 1 ? targetId : 'html');
5471		},
5472		getTargetOffset: function(block) {
5473			// get target offset
5474			let blockOffset = block.offset().top;
5475
5476			if (this.options.container) {
5477				blockOffset -= this.container.offset().top - this.container.prop('scrollTop');
5478			}
5479
5480			// handle extra offset
5481			if (typeof this.options.extraOffset === 'number') {
5482				blockOffset -= this.options.extraOffset;
5483			} else if (typeof this.options.extraOffset === 'function') {
5484				blockOffset -= this.options.extraOffset(block);
5485			}
5486
5487			return {
5488				top: blockOffset
5489			};
5490		},
5491		attachEvents: function() {
5492			const self = this;
5493
5494			// handle active classes
5495			if (this.options.activeClasses && this.anchorLinks.length) {
5496				// cache structure
5497				this.anchorData = [];
5498
5499				for (let i = 0; i < this.anchorLinks.length; i++) {
5500					var link = jQuery(this.anchorLinks[i]),
5501						targetBlock = self.getAnchorTarget(link),
5502						anchorDataItem = null;
5503
5504					$.each(self.anchorData, function(index, item) {
5505						if (item.block[0] === targetBlock[0]) {
5506							anchorDataItem = item;
5507						}
5508					});
5509
5510					if (anchorDataItem) {
5511						anchorDataItem.link = anchorDataItem.link.add(link);
5512					} else {
5513						self.anchorData.push({
5514							link: link,
5515							block: targetBlock
5516						});
5517					}
5518				}
5519
5520				// add additional event handlers
5521				this.resizeHandler = function() {
5522					if (!self.isInit) return;
5523					self.recalculateOffsets();
5524				};
5525
5526				this.scrollHandler = function() {
5527					self.refreshActiveClass();
5528				};
5529
5530				this.recalculateOffsets();
5531				this.scrollContainer.on('scroll', this.scrollHandler);
5532				win.on('resize.SmoothScroll load.SmoothScroll orientationchange.SmoothScroll refreshAnchor.SmoothScroll', this.resizeHandler);
5533			}
5534
5535			// handle click event
5536			this.clickHandler = function(e) {
5537				self.onClick(e);
5538			};
5539
5540			if (!this.options.useNativeAnchorScrolling) {
5541				this.anchorLinks.on('click', this.clickHandler);
5542			}
5543		},
5544		recalculateOffsets: function() {
5545			const self = this;
5546
5547			$.each(this.anchorData, function(index, data) {
5548				data.offset = self.getTargetOffset(data.block);
5549				data.height = data.block.outerHeight();
5550			});
5551
5552			this.refreshActiveClass();
5553		},
5554		toggleActiveClass: function(anchor, block, state) {
5555			anchor.toggleClass(this.options.anchorActiveClass, state);
5556			block.toggleClass(this.options.sectionActiveClass, state);
5557		},
5558		refreshActiveClass: function() {
5559			let self = this,
5560				foundFlag = false,
5561				containerHeight = this.container.prop('scrollHeight'),
5562				viewPortHeight = this.scrollContainer.height(),
5563				scrollTop = this.options.container ? this.container.prop('scrollTop') : win.scrollTop();
5564
5565			// user function instead of default handler
5566			if (this.options.customScrollHandler) {
5567				this.options.customScrollHandler.call(this, scrollTop, this.anchorData);
5568
5569				return;
5570			}
5571
5572			// sort anchor data by offsets
5573			this.anchorData.sort(function(a, b) {
5574				return a.offset.top - b.offset.top;
5575			});
5576
5577			// default active class handler
5578			$.each(this.anchorData, function(index) {
5579				const reverseIndex = self.anchorData.length - index - 1,
5580					data = self.anchorData[reverseIndex],
5581					anchorElement = (self.options.activeClasses === 'parent' ? data.link.parent() : data.link);
5582
5583				if (scrollTop >= containerHeight - viewPortHeight) {
5584					// handle last section
5585					if (reverseIndex === self.anchorData.length - 1) {
5586						self.toggleActiveClass(anchorElement, data.block, true);
5587					} else {
5588						self.toggleActiveClass(anchorElement, data.block, false);
5589					}
5590				} else {
5591					// handle other sections
5592					if (!foundFlag && (scrollTop >= data.offset.top - 1 || reverseIndex === 0)) {
5593						foundFlag = true;
5594						self.toggleActiveClass(anchorElement, data.block, true);
5595					} else {
5596						self.toggleActiveClass(anchorElement, data.block, false);
5597					}
5598				}
5599			});
5600		},
5601		calculateScrollDuration: function(offset) {
5602			let distance;
5603
5604			if (this.options.animMode === 'speed') {
5605				distance = Math.abs(this.scrollContainer.scrollTop() - offset.top);
5606
5607				return (distance / this.options.animSpeed) * 1000;
5608			} else {
5609				return this.options.animDuration;
5610			}
5611		},
5612		onClick: function(e) {
5613			const targetBlock = this.getAnchorTarget(e.currentTarget),
5614				targetOffset = this.getTargetOffset(targetBlock);
5615
5616			e.preventDefault();
5617
5618			scrollTo(targetOffset, {
5619				container: this.container,
5620				wheelBehavior: this.options.wheelBehavior,
5621				duration: this.calculateScrollDuration(targetOffset)
5622			});
5623
5624			this.makeCallback('onBeforeScroll', e.currentTarget);
5625		},
5626		makeCallback: function(name) {
5627			if (typeof this.options[name] === 'function') {
5628				const args = Array.prototype.slice.call(arguments);
5629
5630				args.shift();
5631				this.options[name].apply(this, args);
5632			}
5633		},
5634		destroy: function() {
5635			const self = this;
5636
5637			this.isInit = false;
5638
5639			if (this.options.activeClasses) {
5640				win.off('resize.SmoothScroll load.SmoothScroll orientationchange.SmoothScroll refreshAnchor.SmoothScroll', this.resizeHandler);
5641				this.scrollContainer.off('scroll', this.scrollHandler);
5642
5643				$.each(this.anchorData, function(index) {
5644					const reverseIndex = self.anchorData.length - index - 1,
5645						data = self.anchorData[reverseIndex],
5646						anchorElement = (self.options.activeClasses === 'parent' ? data.link.parent() : data.link);
5647
5648					self.toggleActiveClass(anchorElement, data.block, false);
5649				});
5650			}
5651
5652			this.anchorLinks.off('click', this.clickHandler);
5653		}
5654	};
5655
5656	// public API
5657	$.extend(SmoothScroll, {
5658		scrollTo: function(blockOrOffset, durationOrOptions, callback) {
5659			scrollTo(blockOrOffset, durationOrOptions, callback);
5660		}
5661	});
5662
5663	// export module
5664	exports.SmoothScroll = SmoothScroll;
5665}(jQuery, this));
5666
5667/* Filtering plugin */
5668(function($) {
5669	function FilteringItems(options) {
5670		this.options = $.extend({
5671			items: '.item',
5672			filterItems: '[data-filter]',
5673			filterHolder: '.models-filter',
5674			activeClass: 'active',
5675			hiddenClass: 'hidden',
5676			noResultsClass: 'no-results'
5677		}, options);
5678
5679		this.init();
5680	}
5681
5682	FilteringItems.prototype = {
5683		init: function() {
5684			if (this.options.holder) {
5685				this.findElements();
5686				this.attachEvents();
5687				this.makeCallback('onInit', this);
5688			}
5689		},
5690		findElements: function() {
5691			this.page = $('html, body');
5692			this.holder = $(this.options.holder);
5693			this.items = this.holder.find(this.options.items);
5694			this.filterHolder = this.holder.find(this.options.filterHolder);
5695			this.filterItems = this.holder.find(this.options.filterItems);
5696			this.filterParents = this.filterItems.parent();
5697			this.activeFilter = '';
5698			this.activeItems = $();
5699		},
5700		attachEvents: function() {
5701			const self = this;
5702
5703			this.filterItems.on('click', function(e) {
5704				e.preventDefault();
5705				const currItem = $(this);
5706
5707				if (!self.holder.hasClass('dropdown-models')) {
5708					self.holder.css({
5709						height: self.holder.outerHeight(true),
5710						overflow: 'hidden',
5711						position: 'relative'
5712					});
5713				}
5714
5715				setTimeout(function() {
5716					self.activeFilter = '';
5717					self.filterParents.removeClass(self.options.activeClass);
5718					currItem.parent().addClass(self.options.activeClass);
5719					self.activeFilter = currItem.data('filter');
5720					self.filtrationItems();
5721				}, 10);
5722			});
5723		},
5724		filtrationItems: function() {
5725			const self = this;
5726
5727			this.makeCallback('beforeFilter', this);
5728			this.items.addClass(this.options.hiddenClass);
5729			this.holder.removeClass(this.options.noResultsClass);
5730
5731			if (this.activeFilter !== 'all') {
5732				this.activeItems = this.items.filter(function(ind, item) {
5733					let matched = false;
5734
5735					$(item).find('.' + self.filterHolder.data('filter-group')).each(function() {
5736						const text = self.replaceStr($(this).text());
5737
5738						if (text.indexOf(self.replaceStr(self.activeFilter)) !== -1) {
5739							matched = true;
5740						}
5741					});
5742
5743					return matched;
5744				});
5745			} else {
5746				this.activeItems = this.items;
5747			}
5748
5749			this.activeItems.removeClass(this.options.hiddenClass);
5750
5751			this.makeCallback('onFilter', this);
5752
5753			if (!this.activeItems.length) {
5754				this.holder.addClass(this.options.noResultsClass);
5755			}
5756
5757			this.holder.css({
5758				height: '',
5759				overflow: '',
5760				position: ''
5761			});
5762		},
5763		replaceStr: function(str) {
5764			return str.trim().toLowerCase().replace(/ /g, '-').replace(/&/g, 'and').replace(/\//g, '-');
5765		},
5766		makeCallback: function(name) {
5767			if (typeof this.options[name] === 'function') {
5768				const args = Array.prototype.slice.call(arguments);
5769
5770				args.shift();
5771				this.options[name].apply(this, args);
5772			}
5773		}
5774	};
5775
5776	// jQuery plugin interface
5777	$.fn.filteringItems = function(opt) {
5778		return this.each(function() {
5779			$(this).data('FilteringItems', new FilteringItems($.extend(opt, {
5780				holder: this
5781			})));
5782		});
5783	};
5784}(jQuery));
5785
5786// history storage
5787(function($) {
5788	let stateObject = {};
5789
5790	window.StorageHistory = {
5791		/**
5792		 * Sets a query parameter in the current URL
5793		 *
5794		 * @param {string} name - Name of the query parameter to set
5795		 * @param {string} value - Value of the query parameter to set
5796		 * @param {string} group - Group name of the query parameter to set
5797		 * @param {boolean} useReplace - If true, uses replaceState instead of pushState
5798		 */
5799		set: function(name, value, group, useReplace) {
5800			let tempValues = '';
5801			const location = window.location.href;
5802
5803			if (location.indexOf('?') > 0) {
5804				const newLocation = location.split('?');
5805				const arr = newLocation[1].split('&');
5806				const index = getItemIndex(arr, name);
5807
5808				if (index === -1) {
5809					arr.push(name + '=' + value);
5810				} else {
5811					const item = arr[index].split('=');
5812
5813					if (group) {
5814						arr[index] = name + '=' + item[1] + ',' + value;
5815					} else {
5816						arr[index] = name + '=' + value;
5817					}
5818				}
5819
5820				tempValues = arr.join('&');
5821
5822				if (tempValues.indexOf('&') === 0) {
5823					tempValues = tempValues.slice(1);
5824				}
5825			} else {
5826				tempValues = name + '=' + value;
5827			}
5828
5829			const method = useReplace ? 'replaceState' : 'pushState';
5830
5831			window.history[method](stateObject, name, '?' + tempValues);
5832		},
5833
5834		/**
5835		 * Removes a query parameter from the current URL
5836		 *
5837		 * @param {string} name - Name of the query parameter to remove
5838		 * @param {string} value - Value of the query parameter to remove
5839		 * @param {boolean} useReplace - If true, uses replaceState instead of pushState
5840		 */
5841		remove: function(name, value, useReplace) {
5842			const location = window.location.href;
5843			const method = useReplace ? 'replaceState' : 'pushState';
5844
5845			if (location.indexOf('?') > 0) {
5846				const newLocation = location.split('?');
5847				const arr = newLocation[1].split('&');
5848				const index = getItemIndex(arr, name);
5849
5850				if (value === '') {
5851					const newArr = arr.filter(function(value, index, arr) {
5852						return value.indexOf(name) === -1;
5853					});
5854
5855					window.history[method](stateObject, name, '?' + newArr.join('&'));
5856				} else {
5857					if (index >= 0) {
5858						const item = arr[index].split('=');
5859						const valArray = item[1].split(',');
5860
5861						const getItem = getItemIndex(valArray, value);
5862
5863						valArray.splice(getItem, 1);
5864
5865						if (valArray.length === 0) {
5866							if (arr.length === 1) {
5867								window.history.replaceState(stateObject, null, newLocation[0]);
5868							} else {
5869								arr.splice(index, 1);
5870								window.history[method](stateObject, name, '?' + arr.join('&'));
5871							}
5872						} else {
5873							arr[index] = item[0] + '=' + valArray.join(',');
5874
5875							window.history[method](stateObject, name, '?' + arr.join('&'));
5876						}
5877					}
5878				}
5879			}
5880		},
5881
5882		/**
5883		 * Sets query string in the current URL
5884		 *
5885		 * @param {string} query - Query string to set
5886		 * @param {boolean} useReplace - If true, uses replaceState instead of pushState
5887		 */
5888		setQuery: function(query, useReplace) {
5889			const method = useReplace ? 'replaceState' : 'pushState';
5890			const base = window.location.pathname;
5891			const hash = window.location.hash;
5892			const url = query ? base + '?' + query + hash : base + hash;
5893
5894			window.history[method](stateObject, '', url);
5895		},
5896
5897		/**
5898		 * Resets the URL to its original state
5899		 */
5900		reset: function() {
5901			const url = window.location.origin + window.location.pathname;
5902
5903			stateObject = {};
5904
5905			window.history.replaceState(stateObject, '', url);
5906		}
5907	};
5908
5909	function getItemIndex(array, item) {
5910		let indexInArray = -1;
5911
5912		$.each(array, function(index, el) {
5913			const name = el.split('=');
5914
5915			if (item === name[0]) {
5916				indexInArray = index;
5917
5918				return false;
5919			}
5920		});
5921
5922		return indexInArray;
5923	}
5924})(jQuery);
5925
5926// checked classes when element active
5927function initCheckedClasses() {
5928	const checkedClass = 'input-checked',
5929		parentCheckedClass = 'input-checked-parent';
5930
5931	const pairs = [];
5932
5933	jQuery('label[for]').each(function(index, label) {
5934		const input = jQuery('#' + label.htmlFor);
5935
5936		label = jQuery(label);
5937
5938		// click handler
5939		if (input.length) {
5940			pairs.push({input: input,
5941				label: label});
5942
5943			input.bind('click change', function() {
5944				if (input.is(':radio')) {
5945					jQuery.each(pairs, function(index, pair) {
5946						refreshState(pair.input, pair.label);
5947					});
5948				} else {
5949					refreshState(input, label);
5950				}
5951			});
5952
5953			refreshState(input, label);
5954		}
5955	});
5956
5957	// refresh classes
5958	function refreshState(input, label) {
5959		if (input.length) {
5960			if (input.is(':checked')) {
5961				input.parent().addClass(parentCheckedClass);
5962				label.addClass(checkedClass);
5963			} else {
5964				input.parent().removeClass(parentCheckedClass);
5965				label.removeClass(checkedClass);
5966			}
5967		}
5968	}
5969}
5970
5971/*
5972 * Simple Mobile Navigation
5973 */
5974(function($) {
5975	function MobileNav(options) {
5976		this.options = $.extend({
5977			container: null,
5978			hideOnClickOutside: false,
5979			menuActiveClass: 'nav-active',
5980			menuOpener: '.nav-opener',
5981			menuDrop: '.nav-drop',
5982			toggleEvent: 'click',
5983			outsideClickEvent: 'click touchstart pointerdown MSPointerDown'
5984		}, options);
5985
5986		this.initStructure();
5987		this.attachEvents();
5988	}
5989
5990	MobileNav.prototype = {
5991		initStructure: function() {
5992			this.page = $('html');
5993			this.container = $(this.options.container);
5994			this.opener = this.container.find(this.options.menuOpener);
5995			this.drop = this.container.find(this.options.menuDrop);
5996		},
5997		attachEvents: function() {
5998			const self = this;
5999
6000			if (activateResizeHandler) {
6001				activateResizeHandler();
6002
6003				activateResizeHandler = null;
6004			}
6005
6006			this.outsideClickHandler = function(e) {
6007				if (self.isOpened()) {
6008					const target = $(e.target);
6009
6010					if (self.opener.hasClass('filter-opener')) {
6011						if (!target.closest(self.opener).length && !target.closest(self.drop).length && !target.closest('.modal-filter').length) {
6012							self.hide();
6013						}
6014					} else {
6015						if (!target.closest(self.opener).length && !target.closest(self.drop).length) {
6016							self.hide();
6017						}
6018					}
6019				}
6020			};
6021
6022			this.openerClickHandler = function(e) {
6023				e.preventDefault();
6024				self.toggle();
6025			};
6026
6027			this.opener.on(this.options.toggleEvent, this.openerClickHandler);
6028		},
6029		isOpened: function() {
6030			return this.container.hasClass(this.options.menuActiveClass);
6031		},
6032		show: function() {
6033			this.container.addClass(this.options.menuActiveClass);
6034
6035			if (this.options.hideOnClickOutside) {
6036				this.page.on(this.options.outsideClickEvent, this.outsideClickHandler);
6037			}
6038
6039			this.makeCallback('onShow', this);
6040		},
6041		hide: function() {
6042			this.container.removeClass(this.options.menuActiveClass);
6043
6044			if (this.options.hideOnClickOutside) {
6045				this.page.off(this.options.outsideClickEvent, this.outsideClickHandler);
6046			}
6047
6048			this.makeCallback('onHide', this);
6049		},
6050		toggle: function() {
6051			if (this.isOpened()) {
6052				this.hide();
6053			} else {
6054				this.show();
6055			}
6056		},
6057		makeCallback: function(name) {
6058			if (typeof this.options[name] === 'function') {
6059				const args = Array.prototype.slice.call(arguments);
6060
6061				args.shift();
6062				this.options[name].apply(this, args);
6063			}
6064		},
6065		destroy: function() {
6066			this.container.removeClass(this.options.menuActiveClass);
6067			this.opener.off(this.options.toggleEvent, this.clickHandler);
6068			this.page.off(this.options.outsideClickEvent, this.outsideClickHandler);
6069		}
6070	};
6071
6072	var activateResizeHandler = function() {
6073		let win = $(window),
6074			doc = $('html'),
6075			resizeClass = 'resize-active',
6076			flag, timer;
6077
6078		const removeClassHandler = function() {
6079			flag = false;
6080			doc.removeClass(resizeClass);
6081		};
6082
6083		const resizeHandler = function() {
6084			if (!flag) {
6085				flag = true;
6086				doc.addClass(resizeClass);
6087			}
6088
6089			clearTimeout(timer);
6090			timer = setTimeout(removeClassHandler, 500);
6091		};
6092
6093		win.on('resize orientationchange', resizeHandler);
6094	};
6095
6096	$.fn.mobileNav = function(opt) {
6097		const args = Array.prototype.slice.call(arguments);
6098		const method = args[0];
6099
6100		return this.each(function() {
6101			const $container = jQuery(this);
6102			const instance = $container.data('MobileNav');
6103
6104			if (typeof opt === 'object' || typeof opt === 'undefined') {
6105				$container.data('MobileNav', new MobileNav($.extend({
6106					container: this
6107				}, opt)));
6108			} else if (typeof method === 'string' && instance) {
6109				if (typeof instance[method] === 'function') {
6110					args.shift();
6111					instance[method].apply(instance, args);
6112				}
6113			}
6114		});
6115	};
6116}(jQuery));
6117
6118/*!
6119 * JavaScript Custom Forms
6120 *
6121 * Copyright 2014-2015 PSD2HTML - http://psd2html.com/jcf
6122 * Released under the MIT license (LICENSE.txt)
6123 *
6124 * Version: 1.1.3
6125 */
6126(function(root, factory) {
6127	'use strict';
6128
6129	if (typeof define === 'function' && define.amd) {
6130		define(['jquery'], factory);
6131	} else if (typeof exports === 'object') {
6132		module.exports = factory(require('jquery'));
6133	} else {
6134		root.jcf = factory(jQuery);
6135	}
6136}(this, function($) {
6137	'use strict';
6138
6139	// define version
6140	const version = '1.1.3';
6141
6142	// private variables
6143	const customInstances = [];
6144
6145	// default global options
6146	const commonOptions = {
6147		optionsKey: 'jcf',
6148		dataKey: 'jcf-instance',
6149		rtlClass: 'jcf-rtl',
6150		focusClass: 'jcf-focus',
6151		pressedClass: 'jcf-pressed',
6152		disabledClass: 'jcf-disabled',
6153		hiddenClass: 'jcf-hidden',
6154		resetAppearanceClass: 'jcf-reset-appearance',
6155		unselectableClass: 'jcf-unselectable'
6156	};
6157
6158	// detect device type
6159	const isTouchDevice = ('ontouchstart' in window) || window.DocumentTouch && document instanceof window.DocumentTouch,
6160		isWinPhoneDevice = /Windows Phone/.test(navigator.userAgent);
6161
6162	commonOptions.isMobileDevice = !!(isTouchDevice || isWinPhoneDevice);
6163
6164	let isIOS = /(iPad|iPhone).*OS ([0-9_]*) .*/.exec(navigator.userAgent);
6165
6166	if (isIOS) isIOS = parseFloat(isIOS[2].replace(/_/g, '.'));
6167	commonOptions.ios = isIOS;
6168
6169	// create global stylesheet if custom forms are used
6170	const createStyleSheet = function() {
6171		const styleTag = $('<style>').appendTo('head'),
6172			styleSheet = styleTag.prop('sheet') || styleTag.prop('styleSheet');
6173
6174		// crossbrowser style handling
6175		const addCSSRule = function(selector, rules, index) {
6176			if (styleSheet.insertRule) {
6177				styleSheet.insertRule(selector + '{' + rules + '}', index);
6178			} else {
6179				styleSheet.addRule(selector, rules, index);
6180			}
6181		};
6182
6183		// add special rules
6184		addCSSRule('.' + commonOptions.hiddenClass, 'position:absolute !important;left:-9999px !important;height:1px !important;width:1px !important;margin:0 !important;border-width:0 !important;-webkit-appearance:none;-moz-appearance:none;appearance:none');
6185		addCSSRule('.' + commonOptions.rtlClass + ' .' + commonOptions.hiddenClass, 'right:-9999px !important; left: auto !important');
6186		addCSSRule('.' + commonOptions.unselectableClass, '-webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; -webkit-tap-highlight-color: rgba(0,0,0,0);');
6187		addCSSRule('.' + commonOptions.resetAppearanceClass, 'background: none; border: none; -webkit-appearance: none; appearance: none; opacity: 0; filter: alpha(opacity=0);');
6188
6189		// detect rtl pages
6190		const html = $('html'),
6191			body = $('body');
6192
6193		if (html.css('direction') === 'rtl' || body.css('direction') === 'rtl') {
6194			html.addClass(commonOptions.rtlClass);
6195		}
6196
6197		// handle form reset event
6198		html.on('reset', function() {
6199			setTimeout(function() {
6200				api.refreshAll();
6201			}, 0);
6202		});
6203
6204		// mark stylesheet as created
6205		commonOptions.styleSheetCreated = true;
6206	};
6207
6208	// simplified pointer events handler
6209	(function() {
6210		let pointerEventsSupported = navigator.pointerEnabled || navigator.msPointerEnabled,
6211			touchEventsSupported = ('ontouchstart' in window) || window.DocumentTouch && document instanceof window.DocumentTouch,
6212			eventList,
6213			eventMap = {},
6214			eventPrefix = 'jcf-';
6215
6216		// detect events to attach
6217		if (pointerEventsSupported) {
6218			eventList = {
6219				pointerover: navigator.pointerEnabled ? 'pointerover' : 'MSPointerOver',
6220				pointerdown: navigator.pointerEnabled ? 'pointerdown' : 'MSPointerDown',
6221				pointermove: navigator.pointerEnabled ? 'pointermove' : 'MSPointerMove',
6222				pointerup: navigator.pointerEnabled ? 'pointerup' : 'MSPointerUp'
6223			};
6224		} else {
6225			eventList = {
6226				pointerover: 'mouseover',
6227				pointerdown: 'mousedown' + (touchEventsSupported ? ' touchstart' : ''),
6228				pointermove: 'mousemove' + (touchEventsSupported ? ' touchmove' : ''),
6229				pointerup: 'mouseup' + (touchEventsSupported ? ' touchend' : '')
6230			};
6231		}
6232
6233		// create event map
6234		$.each(eventList, function(targetEventName, fakeEventList) {
6235			$.each(fakeEventList.split(' '), function(index, fakeEventName) {
6236				eventMap[fakeEventName] = targetEventName;
6237			});
6238		});
6239
6240		// jQuery event hooks
6241		$.each(eventList, function(eventName, eventHandlers) {
6242			eventHandlers = eventHandlers.split(' ');
6243
6244			$.event.special[eventPrefix + eventName] = {
6245				setup: function() {
6246					const self = this;
6247
6248					$.each(eventHandlers, function(index, fallbackEvent) {
6249						if (self.addEventListener) self.addEventListener(fallbackEvent, fixEvent, false);
6250						else self['on' + fallbackEvent] = fixEvent;
6251					});
6252				},
6253				teardown: function() {
6254					const self = this;
6255
6256					$.each(eventHandlers, function(index, fallbackEvent) {
6257						if (self.addEventListener) self.removeEventListener(fallbackEvent, fixEvent, false);
6258						else self['on' + fallbackEvent] = null;
6259					});
6260				}
6261			};
6262		});
6263
6264		// check that mouse event are not simulated by mobile browsers
6265		let lastTouch = null;
6266
6267		const mouseEventSimulated = function(e) {
6268			const dx = Math.abs(e.pageX - lastTouch.x),
6269				dy = Math.abs(e.pageY - lastTouch.y),
6270				rangeDistance = 25;
6271
6272			if (dx <= rangeDistance && dy <= rangeDistance) {
6273				return true;
6274			}
6275		};
6276
6277		// normalize event
6278		var fixEvent = function(e) {
6279			let origEvent = e || window.event,
6280				touchEventData = null,
6281				targetEventName = eventMap[origEvent.type];
6282
6283			e = $.event.fix(origEvent);
6284			e.type = eventPrefix + targetEventName;
6285
6286			if (origEvent.pointerType) {
6287				switch (origEvent.pointerType) {
6288					case 2: e.pointerType = 'touch'; break;
6289					case 3: e.pointerType = 'pen'; break;
6290					case 4: e.pointerType = 'mouse'; break;
6291					default: e.pointerType = origEvent.pointerType;
6292				}
6293			} else {
6294				e.pointerType = origEvent.type.substr(0, 5); // "mouse" or "touch" word length
6295			}
6296
6297			if (!e.pageX && !e.pageY) {
6298				touchEventData = origEvent.changedTouches ? origEvent.changedTouches[0] : origEvent;
6299				e.pageX = touchEventData.pageX;
6300				e.pageY = touchEventData.pageY;
6301			}
6302
6303			if (origEvent.type === 'touchend') {
6304				lastTouch = {x: e.pageX,
6305					y: e.pageY};
6306			}
6307
6308			if (e.pointerType === 'mouse' && lastTouch && mouseEventSimulated(e)) {
6309				return;
6310			} else {
6311				return ($.event.dispatch || $.event.handle).call(this, e);
6312			}
6313		};
6314	}());
6315
6316	// custom mousewheel/trackpad handler
6317	(function() {
6318		const wheelEvents = ('onwheel' in document || document.documentMode >= 9 ? 'wheel' : 'mousewheel DOMMouseScroll').split(' '),
6319			shimEventName = 'jcf-mousewheel';
6320
6321		$.event.special[shimEventName] = {
6322			setup: function() {
6323				const self = this;
6324
6325				$.each(wheelEvents, function(index, fallbackEvent) {
6326					if (self.addEventListener) self.addEventListener(fallbackEvent, fixEvent, false);
6327					else self['on' + fallbackEvent] = fixEvent;
6328				});
6329			},
6330			teardown: function() {
6331				const self = this;
6332
6333				$.each(wheelEvents, function(index, fallbackEvent) {
6334					if (self.addEventListener) self.removeEventListener(fallbackEvent, fixEvent, false);
6335					else self['on' + fallbackEvent] = null;
6336				});
6337			}
6338		};
6339
6340		var fixEvent = function(e) {
6341			const origEvent = e || window.event;
6342
6343			e = $.event.fix(origEvent);
6344			e.type = shimEventName;
6345
6346			// old wheel events handler
6347			if ('detail' in origEvent) {
6348				e.deltaY = -origEvent.detail;
6349			}
6350
6351			if ('wheelDelta' in origEvent) {
6352				e.deltaY = -origEvent.wheelDelta;
6353			}
6354
6355			if ('wheelDeltaY' in origEvent) {
6356				e.deltaY = -origEvent.wheelDeltaY;
6357			}
6358
6359			if ('wheelDeltaX' in origEvent) {
6360				e.deltaX = -origEvent.wheelDeltaX;
6361			}
6362
6363			// modern wheel event handler
6364			if ('deltaY' in origEvent) {
6365				e.deltaY = origEvent.deltaY;
6366			}
6367
6368			if ('deltaX' in origEvent) {
6369				e.deltaX = origEvent.deltaX;
6370			}
6371
6372			// handle deltaMode for mouse wheel
6373			e.delta = e.deltaY || e.deltaX;
6374
6375			if (origEvent.deltaMode === 1) {
6376				const lineHeight = 16;
6377
6378				e.delta *= lineHeight;
6379				e.deltaY *= lineHeight;
6380				e.deltaX *= lineHeight;
6381			}
6382
6383			return ($.event.dispatch || $.event.handle).call(this, e);
6384		};
6385	}());
6386
6387	// extra module methods
6388	const moduleMixin = {
6389		// provide function for firing native events
6390		fireNativeEvent: function(elements, eventName) {
6391			$(elements).each(function() {
6392				let element = this,
6393					eventObject;
6394
6395				if (element.dispatchEvent) {
6396					eventObject = document.createEvent('HTMLEvents');
6397					eventObject.initEvent(eventName, true, true);
6398					element.dispatchEvent(eventObject);
6399				} else if (document.createEventObject) {
6400					eventObject = document.createEventObject();
6401					eventObject.target = element;
6402					element.fireEvent('on' + eventName, eventObject);
6403				}
6404			});
6405		},
6406		// bind event handlers for module instance (functions beggining with "on")
6407		bindHandlers: function() {
6408			const self = this;
6409
6410			$.each(self, function(propName, propValue) {
6411				if (propName.indexOf('on') === 0 && $.isFunction(propValue)) {
6412					// dont use $.proxy here because it doesn't create unique handler
6413					self[propName] = function() {
6414						return propValue.apply(self, arguments);
6415					};
6416				}
6417			});
6418		}
6419	};
6420
6421	// public API
6422	var api = {
6423		version: version,
6424		modules: {},
6425		getOptions: function() {
6426			return $.extend({}, commonOptions);
6427		},
6428		setOptions: function(moduleName, moduleOptions) {
6429			if (arguments.length > 1) {
6430				// set module options
6431				if (this.modules[moduleName]) {
6432					$.extend(this.modules[moduleName].prototype.options, moduleOptions);
6433				}
6434			} else {
6435				// set common options
6436				$.extend(commonOptions, moduleName);
6437			}
6438		},
6439		addModule: function(proto) {
6440			// add module to list
6441			const Module = function(options) {
6442				// save instance to collection
6443				if (!options.element.data(commonOptions.dataKey)) {
6444					options.element.data(commonOptions.dataKey, this);
6445				}
6446
6447				customInstances.push(this);
6448
6449				// save options
6450				this.options = $.extend({}, commonOptions, this.options, getInlineOptions(options.element), options);
6451
6452				// bind event handlers to instance
6453				this.bindHandlers();
6454
6455				// call constructor
6456				this.init.apply(this, arguments);
6457			};
6458
6459			// parse options from HTML attribute
6460			var getInlineOptions = function(element) {
6461				const dataOptions = element.data(commonOptions.optionsKey),
6462					attrOptions = element.attr(commonOptions.optionsKey);
6463
6464				if (dataOptions) {
6465					return dataOptions;
6466				} else if (attrOptions) {
6467					try {
6468						return $.parseJSON(attrOptions);
6469					} catch (e) {
6470						// ignore invalid attributes
6471					}
6472				}
6473			};
6474
6475			// set proto as prototype for new module
6476			Module.prototype = proto;
6477
6478			// add mixin methods to module proto
6479			$.extend(proto, moduleMixin);
6480
6481			if (proto.plugins) {
6482				$.each(proto.plugins, function(pluginName, plugin) {
6483					$.extend(plugin.prototype, moduleMixin);
6484				});
6485			}
6486
6487			// override destroy method
6488			const originalDestroy = Module.prototype.destroy;
6489
6490			Module.prototype.destroy = function() {
6491				this.options.element.removeData(this.options.dataKey);
6492
6493				for (let i = customInstances.length - 1; i >= 0; i--) {
6494					if (customInstances[i] === this) {
6495						customInstances.splice(i, 1);
6496						break;
6497					}
6498				}
6499
6500				if (originalDestroy) {
6501					originalDestroy.apply(this, arguments);
6502				}
6503			};
6504
6505			// save module to list
6506			this.modules[proto.name] = Module;
6507		},
6508		getInstance: function(element) {
6509			return $(element).data(commonOptions.dataKey);
6510		},
6511		replace: function(elements, moduleName, customOptions) {
6512			let self = this,
6513				instance;
6514
6515			if (!commonOptions.styleSheetCreated) {
6516				createStyleSheet();
6517			}
6518
6519			$(elements).each(function() {
6520				let moduleOptions,
6521					element = $(this);
6522
6523					instance = element.data(commonOptions.dataKey);
6524
6525				if (instance) {
6526					instance.refresh();
6527				} else {
6528					if (!moduleName) {
6529						$.each(self.modules, function(currentModuleName, module) {
6530							if (module.prototype.matchElement.call(module.prototype, element)) {
6531								moduleName = currentModuleName;
6532
6533								return false;
6534							}
6535						});
6536					}
6537
6538					if (moduleName) {
6539						moduleOptions = $.extend({element: element}, customOptions);
6540						instance = new self.modules[moduleName](moduleOptions);
6541					}
6542				}
6543			});
6544
6545			return instance;
6546		},
6547		refresh: function(elements) {
6548			$(elements).each(function() {
6549				const instance = $(this).data(commonOptions.dataKey);
6550
6551				if (instance) {
6552					instance.refresh();
6553				}
6554			});
6555		},
6556		destroy: function(elements) {
6557			$(elements).each(function() {
6558				const instance = $(this).data(commonOptions.dataKey);
6559
6560				if (instance) {
6561					instance.destroy();
6562				}
6563			});
6564		},
6565		replaceAll: function(context) {
6566			const self = this;
6567
6568			$.each(this.modules, function(moduleName, module) {
6569				$(module.prototype.selector, context).each(function() {
6570					if (this.className.indexOf('jcf-ignore') < 0) {
6571						self.replace(this, moduleName);
6572					}
6573				});
6574			});
6575		},
6576		refreshAll: function(context) {
6577			if (context) {
6578				$.each(this.modules, function(moduleName, module) {
6579					$(module.prototype.selector, context).each(function() {
6580						const instance = $(this).data(commonOptions.dataKey);
6581
6582						if (instance) {
6583							instance.refresh();
6584						}
6585					});
6586				});
6587			} else {
6588				for (let i = customInstances.length - 1; i >= 0; i--) {
6589					customInstances[i].refresh();
6590				}
6591			}
6592		},
6593		destroyAll: function(context) {
6594			if (context) {
6595				$.each(this.modules, function(moduleName, module) {
6596					$(module.prototype.selector, context).each(function(index, element) {
6597						const instance = $(element).data(commonOptions.dataKey);
6598
6599						if (instance) {
6600							instance.destroy();
6601						}
6602					});
6603				});
6604			} else {
6605				while (customInstances.length) {
6606					customInstances[0].destroy();
6607				}
6608			}
6609		}
6610	};
6611
6612	// always export API to the global window object
6613	window.jcf = api;
6614
6615	return api;
6616}));
6617
6618/*!
6619 * JavaScript Custom Forms : Select Module
6620 *
6621 * Copyright 2014-2015 PSD2HTML - http://psd2html.com/jcf
6622 * Released under the MIT license (LICENSE.txt)
6623 *
6624 * Version: 1.1.3
6625 */
6626(function($, window) {
6627	'use strict';
6628
6629	jcf.addModule({
6630		name: 'Select',
6631		selector: 'select:not(.eco-widget__form select)',
6632		options: {
6633			element: null,
6634			multipleCompactStyle: false
6635		},
6636		plugins: {
6637			ListBox: ListBox,
6638			ComboBox: ComboBox,
6639			SelectList: SelectList
6640		},
6641		matchElement: function(element) {
6642			return element.is('select');
6643		},
6644		init: function() {
6645			this.element = $(this.options.element);
6646			this.createInstance();
6647		},
6648		isListBox: function() {
6649			return this.element.is('[size]:not([jcf-size]), [multiple]');
6650		},
6651		createInstance: function() {
6652			if (this.instance) {
6653				this.instance.destroy();
6654			}
6655
6656			if (this.isListBox() && !this.options.multipleCompactStyle) {
6657				this.instance = new ListBox(this.options);
6658			} else {
6659				this.instance = new ComboBox(this.options);
6660			}
6661		},
6662		refresh: function() {
6663			const typeMismatch = (this.isListBox() && this.instance instanceof ComboBox)
6664								|| (!this.isListBox() && this.instance instanceof ListBox);
6665
6666			if (typeMismatch) {
6667				this.createInstance();
6668			} else {
6669				this.instance.refresh();
6670			}
6671		},
6672		destroy: function() {
6673			this.instance.destroy();
6674		}
6675	});
6676
6677	// combobox module
6678	function ComboBox(options) {
6679		this.options = $.extend({
6680			wrapNative: true,
6681			wrapNativeOnMobile: true,
6682			fakeDropInBody: true,
6683			useCustomScroll: true,
6684			flipDropToFit: true,
6685			maxVisibleItems: 10,
6686			fakeAreaStructure: '<span class="jcf-select"><span class="jcf-opener-holder"><span class="jcf-select-text"></span><span class="jcf-select-opener"></span></span></span>',
6687			fakeDropStructure: '<div class="jcf-select-drop"><div class="jcf-select-drop-content"></div></div>',
6688			optionClassPrefix: 'jcf-option-',
6689			selectClassPrefix: 'jcf-select-',
6690			dropContentSelector: '.jcf-select-drop-content',
6691			selectTextSelector: '.jcf-select-text',
6692			dropActiveClass: 'jcf-drop-active',
6693			flipDropClass: 'jcf-drop-flipped'
6694		}, options);
6695
6696		this.init();
6697	}
6698
6699	$.extend(ComboBox.prototype, {
6700		init: function() {
6701			this.initStructure();
6702			this.bindHandlers();
6703			this.attachEvents();
6704			this.refresh();
6705		},
6706		initStructure: function() {
6707			// prepare structure
6708			this.win = $(window);
6709			this.doc = $(document);
6710			this.realElement = $(this.options.element);
6711			this.fakeElement = $(this.options.fakeAreaStructure).insertAfter(this.realElement);
6712			this.selectTextContainer = this.fakeElement.find(this.options.selectTextSelector);
6713			this.selectText = $('<span></span>').appendTo(this.selectTextContainer);
6714			makeUnselectable(this.fakeElement);
6715
6716			// copy classes from original select
6717			this.fakeElement.addClass(getPrefixedClasses(this.realElement.prop('className'), this.options.selectClassPrefix));
6718
6719			// handle compact multiple style
6720			if (this.realElement.prop('multiple')) {
6721				this.fakeElement.addClass('jcf-compact-multiple');
6722			}
6723
6724			// detect device type and dropdown behavior
6725			if (this.options.isMobileDevice && this.options.wrapNativeOnMobile && !this.options.wrapNative) {
6726				this.options.wrapNative = true;
6727			}
6728
6729			if (this.options.wrapNative) {
6730				// wrap native select inside fake block
6731				this.realElement.prependTo(this.fakeElement).css({
6732					position: 'absolute',
6733					height: '100%',
6734					width: '100%'
6735				}).addClass(this.options.resetAppearanceClass);
6736			} else {
6737				// just hide native select
6738				this.realElement.addClass(this.options.hiddenClass);
6739				this.fakeElement.attr('title', this.realElement.attr('title'));
6740				this.fakeDropTarget = this.options.fakeDropInBody ? $('body') : this.fakeElement;
6741			}
6742		},
6743		attachEvents: function() {
6744			// delayed refresh handler
6745			const self = this;
6746
6747			this.delayedRefresh = function() {
6748				setTimeout(function() {
6749					self.refresh();
6750
6751					if (self.list) {
6752						self.list.refresh();
6753						self.list.scrollToActiveOption();
6754					}
6755				}, 1);
6756			};
6757
6758			// native dropdown event handlers
6759			if (this.options.wrapNative) {
6760				this.realElement.on({
6761					focus: this.onFocus,
6762					change: this.onChange,
6763					click: this.onChange,
6764					keydown: this.onChange
6765				});
6766			} else {
6767				// custom dropdown event handlers
6768				this.realElement.on({
6769					focus: this.onFocus,
6770					change: this.onChange,
6771					keydown: this.onKeyDown
6772				});
6773
6774				this.fakeElement.on({
6775					'jcf-pointerdown': this.onSelectAreaPress
6776				});
6777			}
6778		},
6779		onKeyDown: function(e) {
6780			if (e.which === 13) {
6781				this.toggleDropdown();
6782			} else if (this.dropActive) {
6783				this.delayedRefresh();
6784			}
6785		},
6786		onChange: function() {
6787			this.refresh();
6788		},
6789		onFocus: function() {
6790			if (!this.pressedFlag || !this.focusedFlag) {
6791				this.fakeElement.addClass(this.options.focusClass);
6792				this.realElement.on('blur', this.onBlur);
6793				this.toggleListMode(true);
6794				this.focusedFlag = true;
6795			}
6796		},
6797		onBlur: function() {
6798			if (!this.pressedFlag) {
6799				this.fakeElement.removeClass(this.options.focusClass);
6800				this.realElement.off('blur', this.onBlur);
6801				this.toggleListMode(false);
6802				this.focusedFlag = false;
6803			}
6804		},
6805		onResize: function() {
6806			if (this.dropActive) {
6807				this.hideDropdown();
6808			}
6809		},
6810		onSelectDropPress: function() {
6811			this.pressedFlag = true;
6812		},
6813		onSelectDropRelease: function(e, pointerEvent) {
6814			this.pressedFlag = false;
6815
6816			if (pointerEvent.pointerType === 'mouse') {
6817				this.realElement.focus();
6818			}
6819		},
6820		onSelectAreaPress: function(e) {
6821			// skip click if drop inside fake element or real select is disabled
6822			const dropClickedInsideFakeElement = !this.options.fakeDropInBody && $(e.target).closest(this.dropdown).length;
6823
6824			if (dropClickedInsideFakeElement || e.button > 1 || this.realElement.is(':disabled')) {
6825				return;
6826			}
6827
6828			// toggle dropdown visibility
6829			this.selectOpenedByEvent = e.pointerType;
6830			this.toggleDropdown();
6831
6832			// misc handlers
6833			if (!this.focusedFlag) {
6834				if (e.pointerType === 'mouse') {
6835					this.realElement.focus();
6836				} else {
6837					this.onFocus(e);
6838				}
6839			}
6840
6841			this.pressedFlag = true;
6842			this.fakeElement.addClass(this.options.pressedClass);
6843			this.doc.on('jcf-pointerup', this.onSelectAreaRelease);
6844		},
6845		onSelectAreaRelease: function(e) {
6846			if (this.focusedFlag && e.pointerType === 'mouse') {
6847				this.realElement.focus();
6848			}
6849
6850			this.pressedFlag = false;
6851			this.fakeElement.removeClass(this.options.pressedClass);
6852			this.doc.off('jcf-pointerup', this.onSelectAreaRelease);
6853		},
6854		onOutsideClick: function(e) {
6855			const target = $(e.target),
6856				clickedInsideSelect = target.closest(this.fakeElement).length || target.closest(this.dropdown).length;
6857
6858			if (!clickedInsideSelect) {
6859				this.hideDropdown();
6860			}
6861		},
6862		onSelect: function() {
6863			this.refresh();
6864
6865			if (this.realElement.prop('multiple')) {
6866				this.repositionDropdown();
6867			} else {
6868				this.hideDropdown();
6869			}
6870
6871			this.fireNativeEvent(this.realElement, 'change');
6872		},
6873		toggleListMode: function(state) {
6874			if (!this.options.wrapNative) {
6875				if (state) {
6876					// temporary change select to list to avoid appearing of native dropdown
6877					this.realElement.attr({
6878						size: 4,
6879						'jcf-size': ''
6880					});
6881				} else {
6882					// restore select from list mode to dropdown select
6883					if (!this.options.wrapNative) {
6884						this.realElement.removeAttr('size jcf-size');
6885					}
6886				}
6887			}
6888		},
6889		createDropdown: function() {
6890			// destroy previous dropdown if needed
6891			if (this.dropdown) {
6892				this.list.destroy();
6893				this.dropdown.remove();
6894			}
6895
6896			// create new drop container
6897			this.dropdown = $(this.options.fakeDropStructure).appendTo(this.fakeDropTarget);
6898			this.dropdown.addClass(getPrefixedClasses(this.realElement.prop('className'), this.options.selectClassPrefix));
6899			makeUnselectable(this.dropdown);
6900
6901			// handle compact multiple style
6902			if (this.realElement.prop('multiple')) {
6903				this.dropdown.addClass('jcf-compact-multiple');
6904			}
6905
6906			// set initial styles for dropdown in body
6907			if (this.options.fakeDropInBody) {
6908				this.dropdown.css({
6909					position: 'absolute',
6910					top: -9999
6911				});
6912			}
6913
6914			// create new select list instance
6915			this.list = new SelectList({
6916				useHoverClass: true,
6917				handleResize: false,
6918				alwaysPreventMouseWheel: true,
6919				maxVisibleItems: this.options.maxVisibleItems,
6920				useCustomScroll: this.options.useCustomScroll,
6921				holder: this.dropdown.find(this.options.dropContentSelector),
6922				multipleSelectWithoutKey: this.realElement.prop('multiple'),
6923				element: this.realElement
6924			});
6925
6926			$(this.list).on({
6927				select: this.onSelect,
6928				press: this.onSelectDropPress,
6929				release: this.onSelectDropRelease
6930			});
6931		},
6932		repositionDropdown: function() {
6933			let selectOffset = this.fakeElement.offset(),
6934				selectWidth = this.fakeElement.outerWidth(),
6935				selectHeight = this.fakeElement.outerHeight(),
6936				dropHeight = this.dropdown.css('width', selectWidth).outerHeight(),
6937				winScrollTop = this.win.scrollTop(),
6938				winHeight = this.win.height(),
6939				calcTop, calcLeft, bodyOffset,
6940				needFlipDrop = false;
6941
6942			// check flip drop position
6943			if (selectOffset.top + selectHeight + dropHeight > winScrollTop + winHeight && selectOffset.top - dropHeight > winScrollTop) {
6944				needFlipDrop = true;
6945			}
6946
6947			if (this.options.fakeDropInBody) {
6948				bodyOffset = this.fakeDropTarget.css('position') !== 'static' ? this.fakeDropTarget.offset().top : 0;
6949
6950				if (this.options.flipDropToFit && needFlipDrop) {
6951					// calculate flipped dropdown position
6952					calcLeft = selectOffset.left;
6953					calcTop = selectOffset.top - dropHeight - bodyOffset;
6954				} else {
6955					// calculate default drop position
6956					calcLeft = selectOffset.left;
6957					calcTop = selectOffset.top + selectHeight - bodyOffset;
6958				}
6959
6960				// update drop styles
6961				this.dropdown.css({
6962					width: selectWidth,
6963					left: calcLeft,
6964					top: calcTop
6965				});
6966			}
6967
6968			// refresh flipped class
6969			this.dropdown.add(this.fakeElement).toggleClass(this.options.flipDropClass, this.options.flipDropToFit && needFlipDrop);
6970		},
6971		showDropdown: function() {
6972			// do not show empty custom dropdown
6973			if (!this.realElement.prop('options').length) {
6974				return;
6975			}
6976
6977			// create options list if not created
6978			if (!this.dropdown) {
6979				this.createDropdown();
6980			}
6981
6982			// show dropdown
6983			this.dropActive = true;
6984			this.dropdown.appendTo(this.fakeDropTarget);
6985			this.fakeElement.addClass(this.options.dropActiveClass);
6986			this.refreshSelectedText();
6987			this.repositionDropdown();
6988			this.list.setScrollTop(this.savedScrollTop);
6989			this.list.refresh();
6990
6991			// add temporary event handlers
6992			this.win.on('resize', this.onResize);
6993			this.doc.on('jcf-pointerdown', this.onOutsideClick);
6994		},
6995		hideDropdown: function() {
6996			if (this.dropdown) {
6997				this.savedScrollTop = this.list.getScrollTop();
6998				this.fakeElement.removeClass(this.options.dropActiveClass + ' ' + this.options.flipDropClass);
6999				this.dropdown.removeClass(this.options.flipDropClass).detach();
7000				this.doc.off('jcf-pointerdown', this.onOutsideClick);
7001				this.win.off('resize', this.onResize);
7002				this.dropActive = false;
7003
7004				if (this.selectOpenedByEvent === 'touch') {
7005					this.onBlur();
7006				}
7007			}
7008		},
7009		toggleDropdown: function() {
7010			if (this.dropActive) {
7011				this.hideDropdown();
7012			} else {
7013				this.showDropdown();
7014			}
7015		},
7016		refreshSelectedText: function() {
7017			// redraw selected area
7018			let selectedIndex = this.realElement.prop('selectedIndex'),
7019				selectedOption = this.realElement.prop('options')[selectedIndex],
7020				selectedOptionImage = selectedOption ? selectedOption.getAttribute('data-image') : null,
7021				selectedOptionText = '',
7022				selectedOptionClasses,
7023				self = this;
7024
7025			if (this.realElement.prop('multiple')) {
7026				$.each(this.realElement.prop('options'), function(index, option) {
7027					if (option.selected) {
7028						selectedOptionText += (selectedOptionText ? ', ' : '') + option.innerHTML;
7029					}
7030				});
7031
7032				if (!selectedOptionText) {
7033					selectedOptionText = self.realElement.attr('placeholder') || '';
7034				}
7035
7036				this.selectText.removeAttr('class').html(selectedOptionText);
7037			} else if (!selectedOption) {
7038				if (this.selectImage) {
7039					this.selectImage.hide();
7040				}
7041
7042				this.selectText.removeAttr('class').empty();
7043			} else if (this.currentSelectedText !== selectedOption.innerHTML || this.currentSelectedImage !== selectedOptionImage) {
7044				selectedOptionClasses = getPrefixedClasses(selectedOption.className, this.options.optionClassPrefix);
7045				this.selectText.attr('class', selectedOptionClasses).html(selectedOption.innerHTML);
7046
7047				if (selectedOptionImage) {
7048					if (!this.selectImage) {
7049						this.selectImage = $('<img>').prependTo(this.selectTextContainer).hide();
7050					}
7051
7052					this.selectImage.attr('src', selectedOptionImage).show();
7053				} else if (this.selectImage) {
7054					this.selectImage.hide();
7055				}
7056
7057				this.currentSelectedText = selectedOption.innerHTML;
7058				this.currentSelectedImage = selectedOptionImage;
7059			}
7060		},
7061		refresh: function() {
7062			// refresh fake select visibility
7063			if (this.realElement.prop('style').display === 'none') {
7064				this.fakeElement.hide();
7065			} else {
7066				this.fakeElement.show();
7067			}
7068
7069			// refresh selected text
7070			this.refreshSelectedText();
7071
7072			// handle disabled state
7073			this.fakeElement.toggleClass(this.options.disabledClass, this.realElement.is(':disabled'));
7074		},
7075		destroy: function() {
7076			// restore structure
7077			if (this.options.wrapNative) {
7078				this.realElement.insertBefore(this.fakeElement).css({
7079					position: '',
7080					height: '',
7081					width: ''
7082				}).removeClass(this.options.resetAppearanceClass);
7083			} else {
7084				this.realElement.removeClass(this.options.hiddenClass);
7085
7086				if (this.realElement.is('[jcf-size]')) {
7087					this.realElement.removeAttr('size jcf-size');
7088				}
7089			}
7090
7091			// removing element will also remove its event handlers
7092			this.fakeElement.remove();
7093
7094			// remove other event handlers
7095			this.doc.off('jcf-pointerup', this.onSelectAreaRelease);
7096
7097			this.realElement.off({
7098				focus: this.onFocus
7099			});
7100		}
7101	});
7102
7103	// listbox module
7104	function ListBox(options) {
7105		this.options = $.extend({
7106			wrapNative: true,
7107			useCustomScroll: true,
7108			fakeStructure: '<span class="jcf-list-box"><span class="jcf-list-wrapper"></span></span>',
7109			selectClassPrefix: 'jcf-select-',
7110			listHolder: '.jcf-list-wrapper'
7111		}, options);
7112
7113		this.init();
7114	}
7115
7116	$.extend(ListBox.prototype, {
7117		init: function() {
7118			this.bindHandlers();
7119			this.initStructure();
7120			this.attachEvents();
7121		},
7122		initStructure: function() {
7123			this.realElement = $(this.options.element);
7124			this.fakeElement = $(this.options.fakeStructure).insertAfter(this.realElement);
7125			this.listHolder = this.fakeElement.find(this.options.listHolder);
7126			makeUnselectable(this.fakeElement);
7127
7128			// copy classes from original select
7129			this.fakeElement.addClass(getPrefixedClasses(this.realElement.prop('className'), this.options.selectClassPrefix));
7130			this.realElement.addClass(this.options.hiddenClass);
7131
7132			this.list = new SelectList({
7133				useCustomScroll: this.options.useCustomScroll,
7134				holder: this.listHolder,
7135				selectOnClick: false,
7136				element: this.realElement
7137			});
7138		},
7139		attachEvents: function() {
7140			// delayed refresh handler
7141			const self = this;
7142
7143			this.delayedRefresh = function(e) {
7144				if (e && e.which === 16) {
7145					// ignore SHIFT key
7146					return;
7147				} else {
7148					clearTimeout(self.refreshTimer);
7149
7150					self.refreshTimer = setTimeout(function() {
7151						self.refresh();
7152						self.list.scrollToActiveOption();
7153					}, 1);
7154				}
7155			};
7156
7157			// other event handlers
7158			this.realElement.on({
7159				focus: this.onFocus,
7160				click: this.delayedRefresh,
7161				keydown: this.delayedRefresh
7162			});
7163
7164			// select list event handlers
7165			$(this.list).on({
7166				select: this.onSelect,
7167				press: this.onFakeOptionsPress,
7168				release: this.onFakeOptionsRelease
7169			});
7170		},
7171		onFakeOptionsPress: function(e, pointerEvent) {
7172			this.pressedFlag = true;
7173
7174			if (pointerEvent.pointerType === 'mouse') {
7175				this.realElement.focus();
7176			}
7177		},
7178		onFakeOptionsRelease: function(e, pointerEvent) {
7179			this.pressedFlag = false;
7180
7181			if (pointerEvent.pointerType === 'mouse') {
7182				this.realElement.focus();
7183			}
7184		},
7185		onSelect: function() {
7186			this.fireNativeEvent(this.realElement, 'change');
7187			this.fireNativeEvent(this.realElement, 'click');
7188		},
7189		onFocus: function() {
7190			if (!this.pressedFlag || !this.focusedFlag) {
7191				this.fakeElement.addClass(this.options.focusClass);
7192				this.realElement.on('blur', this.onBlur);
7193				this.focusedFlag = true;
7194			}
7195		},
7196		onBlur: function() {
7197			if (!this.pressedFlag) {
7198				this.fakeElement.removeClass(this.options.focusClass);
7199				this.realElement.off('blur', this.onBlur);
7200				this.focusedFlag = false;
7201			}
7202		},
7203		refresh: function() {
7204			this.fakeElement.toggleClass(this.options.disabledClass, this.realElement.is(':disabled'));
7205			this.list.refresh();
7206		},
7207		destroy: function() {
7208			this.list.destroy();
7209			this.realElement.insertBefore(this.fakeElement).removeClass(this.options.hiddenClass);
7210			this.fakeElement.remove();
7211		}
7212	});
7213
7214	// options list module
7215	function SelectList(options) {
7216		this.options = $.extend({
7217			holder: null,
7218			maxVisibleItems: 10,
7219			selectOnClick: true,
7220			useHoverClass: false,
7221			useCustomScroll: false,
7222			handleResize: true,
7223			multipleSelectWithoutKey: false,
7224			alwaysPreventMouseWheel: false,
7225			indexAttribute: 'data-index',
7226			cloneClassPrefix: 'jcf-option-',
7227			containerStructure: '<span class="jcf-list"><span class="jcf-list-content"></span></span>',
7228			containerSelector: '.jcf-list-content',
7229			captionClass: 'jcf-optgroup-caption',
7230			disabledClass: 'jcf-disabled',
7231			optionClass: 'jcf-option',
7232			groupClass: 'jcf-optgroup',
7233			hoverClass: 'jcf-hover',
7234			selectedClass: 'jcf-selected',
7235			scrollClass: 'jcf-scroll-active'
7236		}, options);
7237
7238		this.init();
7239	}
7240
7241	$.extend(SelectList.prototype, {
7242		init: function() {
7243			this.initStructure();
7244			this.refreshSelectedClass();
7245			this.attachEvents();
7246		},
7247		initStructure: function() {
7248			this.element = $(this.options.element);
7249			this.indexSelector = '[' + this.options.indexAttribute + ']';
7250			this.container = $(this.options.containerStructure).appendTo(this.options.holder);
7251			this.listHolder = this.container.find(this.options.containerSelector);
7252			this.lastClickedIndex = this.element.prop('selectedIndex');
7253			this.rebuildList();
7254		},
7255		attachEvents: function() {
7256			this.bindHandlers();
7257			this.listHolder.on('jcf-pointerdown', this.indexSelector, this.onItemPress);
7258			this.listHolder.on('jcf-pointerdown', this.onPress);
7259
7260			if (this.options.useHoverClass) {
7261				this.listHolder.on('jcf-pointerover', this.indexSelector, this.onHoverItem);
7262			}
7263		},
7264		onPress: function(e) {
7265			$(this).trigger('press', e);
7266			this.listHolder.on('jcf-pointerup', this.onRelease);
7267		},
7268		onRelease: function(e) {
7269			$(this).trigger('release', e);
7270			this.listHolder.off('jcf-pointerup', this.onRelease);
7271		},
7272		onHoverItem: function(e) {
7273			const hoverIndex = parseFloat(e.currentTarget.getAttribute(this.options.indexAttribute));
7274
7275			this.fakeOptions.removeClass(this.options.hoverClass).eq(hoverIndex).addClass(this.options.hoverClass);
7276		},
7277		onItemPress: function(e) {
7278			if (e.pointerType === 'touch' || this.options.selectOnClick) {
7279				// select option after "click"
7280				this.tmpListOffsetTop = this.list.offset().top;
7281				this.listHolder.on('jcf-pointerup', this.indexSelector, this.onItemRelease);
7282			} else {
7283				// select option immediately
7284				this.onSelectItem(e);
7285			}
7286		},
7287		onItemRelease: function(e) {
7288			// remove event handlers and temporary data
7289			this.listHolder.off('jcf-pointerup', this.indexSelector, this.onItemRelease);
7290
7291			// simulate item selection
7292			if (this.tmpListOffsetTop === this.list.offset().top) {
7293				this.listHolder.on('click', this.indexSelector, {savedPointerType: e.pointerType}, this.onSelectItem);
7294			}
7295
7296			delete this.tmpListOffsetTop;
7297		},
7298		onSelectItem: function(e) {
7299			let clickedIndex = parseFloat(e.currentTarget.getAttribute(this.options.indexAttribute)),
7300				pointerType = e.data && e.data.savedPointerType || e.pointerType || 'mouse',
7301				range;
7302
7303			// remove click event handler
7304			this.listHolder.off('click', this.indexSelector, this.onSelectItem);
7305
7306			// ignore clicks on disabled options
7307			if (e.button > 1 || this.realOptions[clickedIndex].disabled) {
7308				return;
7309			}
7310
7311			if (this.element.prop('multiple')) {
7312				if (e.metaKey || e.ctrlKey || pointerType === 'touch' || this.options.multipleSelectWithoutKey) {
7313					// if CTRL/CMD pressed or touch devices - toggle selected option
7314					this.realOptions[clickedIndex].selected = !this.realOptions[clickedIndex].selected;
7315				} else if (e.shiftKey) {
7316					// if SHIFT pressed - update selection
7317					range = [this.lastClickedIndex, clickedIndex].sort(function(a, b) {
7318						return a - b;
7319					});
7320
7321					this.realOptions.each(function(index, option) {
7322						option.selected = (index >= range[0] && index <= range[1]);
7323					});
7324				} else {
7325					// set single selected index
7326					this.element.prop('selectedIndex', clickedIndex);
7327				}
7328			} else {
7329				this.element.prop('selectedIndex', clickedIndex);
7330			}
7331
7332			// save last clicked option
7333			if (!e.shiftKey) {
7334				this.lastClickedIndex = clickedIndex;
7335			}
7336
7337			// refresh classes
7338			this.refreshSelectedClass();
7339
7340			// scroll to active item in desktop browsers
7341			if (pointerType === 'mouse') {
7342				this.scrollToActiveOption();
7343			}
7344
7345			// make callback when item selected
7346			$(this).trigger('select');
7347		},
7348		rebuildList: function() {
7349			// rebuild options
7350			const self = this,
7351				rootElement = this.element[0];
7352
7353			// recursively create fake options
7354			this.storedSelectHTML = rootElement.innerHTML;
7355			this.optionIndex = 0;
7356			this.list = $(this.createOptionsList(rootElement));
7357			this.listHolder.empty().append(this.list);
7358			this.realOptions = this.element.find('option');
7359			this.fakeOptions = this.list.find(this.indexSelector);
7360			this.fakeListItems = this.list.find('.' + this.options.captionClass + ',' + this.indexSelector);
7361			delete this.optionIndex;
7362
7363			// detect max visible items
7364			let maxCount = this.options.maxVisibleItems,
7365				sizeValue = this.element.prop('size');
7366
7367			if (sizeValue > 1 && !this.element.is('[jcf-size]')) {
7368				maxCount = sizeValue;
7369			}
7370
7371			// handle scrollbar
7372			const needScrollBar = this.fakeOptions.length > maxCount;
7373
7374			this.container.toggleClass(this.options.scrollClass, needScrollBar);
7375
7376			if (needScrollBar) {
7377				// change max-height
7378				this.listHolder.css({
7379					maxHeight: this.getOverflowHeight(maxCount),
7380					overflow: 'auto'
7381				});
7382
7383				if (this.options.useCustomScroll && jcf.modules.Scrollable) {
7384					// add custom scrollbar if specified in options
7385					jcf.replace(this.listHolder, 'Scrollable', {
7386						handleResize: this.options.handleResize,
7387						alwaysPreventMouseWheel: this.options.alwaysPreventMouseWheel
7388					});
7389
7390					return;
7391				}
7392			}
7393
7394			// disable edge wheel scrolling
7395			if (this.options.alwaysPreventMouseWheel) {
7396				this.preventWheelHandler = function(e) {
7397					const currentScrollTop = self.listHolder.scrollTop(),
7398						maxScrollTop = self.listHolder.prop('scrollHeight') - self.listHolder.innerHeight();
7399
7400					// check edge cases
7401					if ((currentScrollTop <= 0 && e.deltaY < 0) || (currentScrollTop >= maxScrollTop && e.deltaY > 0)) {
7402						e.preventDefault();
7403					}
7404				};
7405
7406				this.listHolder.on('jcf-mousewheel', this.preventWheelHandler);
7407			}
7408		},
7409		refreshSelectedClass: function() {
7410			let self = this,
7411				selectedItem,
7412				isMultiple = this.element.prop('multiple'),
7413				selectedIndex = this.element.prop('selectedIndex');
7414
7415			if (isMultiple) {
7416				this.realOptions.each(function(index, option) {
7417					self.fakeOptions.eq(index).toggleClass(self.options.selectedClass, !!option.selected);
7418				});
7419			} else {
7420				this.fakeOptions.removeClass(this.options.selectedClass + ' ' + this.options.hoverClass);
7421				selectedItem = this.fakeOptions.eq(selectedIndex).addClass(this.options.selectedClass);
7422
7423				if (this.options.useHoverClass) {
7424					selectedItem.addClass(this.options.hoverClass);
7425				}
7426			}
7427		},
7428		scrollToActiveOption: function() {
7429			// scroll to target option
7430			const targetOffset = this.getActiveOptionOffset();
7431
7432			if (typeof targetOffset === 'number') {
7433				this.listHolder.prop('scrollTop', targetOffset);
7434			}
7435		},
7436		getSelectedIndexRange: function() {
7437			let firstSelected = -1,
7438				lastSelected = -1;
7439
7440			this.realOptions.each(function(index, option) {
7441				if (option.selected) {
7442					if (firstSelected < 0) {
7443						firstSelected = index;
7444					}
7445
7446					lastSelected = index;
7447				}
7448			});
7449
7450			return [firstSelected, lastSelected];
7451		},
7452		getChangedSelectedIndex: function() {
7453			let selectedIndex = this.element.prop('selectedIndex'),
7454				targetIndex;
7455
7456			if (this.element.prop('multiple')) {
7457				// multiple selects handling
7458				if (!this.previousRange) {
7459					this.previousRange = [selectedIndex, selectedIndex];
7460				}
7461
7462				this.currentRange = this.getSelectedIndexRange();
7463				targetIndex = this.currentRange[this.currentRange[0] !== this.previousRange[0] ? 0 : 1];
7464				this.previousRange = this.currentRange;
7465
7466				return targetIndex;
7467			} else {
7468				// single choice selects handling
7469				return selectedIndex;
7470			}
7471		},
7472		getActiveOptionOffset: function() {
7473			// calc values
7474			const dropHeight = this.listHolder.height(),
7475				dropScrollTop = this.listHolder.prop('scrollTop'),
7476				currentIndex = this.getChangedSelectedIndex(),
7477				fakeOption = this.fakeOptions.eq(currentIndex),
7478				fakeOptionOffset = fakeOption.offset().top - this.list.offset().top,
7479				fakeOptionHeight = fakeOption.innerHeight();
7480
7481			// scroll list
7482			if (fakeOptionOffset + fakeOptionHeight >= dropScrollTop + dropHeight) {
7483				// scroll down (always scroll to option)
7484				return fakeOptionOffset - dropHeight + fakeOptionHeight;
7485			} else if (fakeOptionOffset < dropScrollTop) {
7486				// scroll up to option
7487				return fakeOptionOffset;
7488			}
7489		},
7490		getOverflowHeight: function(sizeValue) {
7491			const item = this.fakeListItems.eq(sizeValue - 1),
7492				listOffset = this.list.offset().top,
7493				itemOffset = item.offset().top,
7494				itemHeight = item.innerHeight();
7495
7496			return itemOffset + itemHeight - listOffset;
7497		},
7498		getScrollTop: function() {
7499			return this.listHolder.scrollTop();
7500		},
7501		setScrollTop: function(value) {
7502			this.listHolder.scrollTop(value);
7503		},
7504		createOption: function(option) {
7505			const newOption = document.createElement('span');
7506
7507			newOption.className = this.options.optionClass;
7508			newOption.innerHTML = option.innerHTML;
7509			newOption.setAttribute(this.options.indexAttribute, this.optionIndex++);
7510
7511			let optionImage,
7512				optionImageSrc = option.getAttribute('data-image');
7513
7514			if (optionImageSrc) {
7515				optionImage = document.createElement('img');
7516				optionImage.src = optionImageSrc;
7517				newOption.insertBefore(optionImage, newOption.childNodes[0]);
7518			}
7519
7520			if (option.disabled) {
7521				newOption.className += ' ' + this.options.disabledClass;
7522			}
7523
7524			if (option.className) {
7525				newOption.className += ' ' + getPrefixedClasses(option.className, this.options.cloneClassPrefix);
7526			}
7527
7528			return newOption;
7529		},
7530		createOptGroup: function(optgroup) {
7531			let optGroupContainer = document.createElement('span'),
7532				optGroupName = optgroup.getAttribute('label'),
7533				optGroupCaption, optGroupList;
7534
7535			// create caption
7536			optGroupCaption = document.createElement('span');
7537			optGroupCaption.className = this.options.captionClass;
7538			optGroupCaption.innerHTML = optGroupName;
7539			optGroupContainer.appendChild(optGroupCaption);
7540
7541			// create list of options
7542			if (optgroup.children.length) {
7543				optGroupList = this.createOptionsList(optgroup);
7544				optGroupContainer.appendChild(optGroupList);
7545			}
7546
7547			optGroupContainer.className = this.options.groupClass;
7548
7549			return optGroupContainer;
7550		},
7551		createOptionContainer: function() {
7552			const optionContainer = document.createElement('li');
7553
7554			return optionContainer;
7555		},
7556		createOptionsList: function(container) {
7557			const self = this,
7558				list = document.createElement('ul');
7559
7560			$.each(container.children, function(index, currentNode) {
7561				let item = self.createOptionContainer(currentNode),
7562					newNode;
7563
7564				switch (currentNode.tagName.toLowerCase()) {
7565					case 'option': newNode = self.createOption(currentNode); break;
7566					case 'optgroup': newNode = self.createOptGroup(currentNode); break;
7567				}
7568
7569				list.appendChild(item).appendChild(newNode);
7570			});
7571
7572			return list;
7573		},
7574		refresh: function() {
7575			// check for select innerHTML changes
7576			if (this.storedSelectHTML !== this.element.prop('innerHTML')) {
7577				this.rebuildList();
7578			}
7579
7580			// refresh custom scrollbar
7581			const scrollInstance = jcf.getInstance(this.listHolder);
7582
7583			if (scrollInstance) {
7584				scrollInstance.refresh();
7585			}
7586
7587			// refresh selectes classes
7588			this.refreshSelectedClass();
7589		},
7590		destroy: function() {
7591			this.listHolder.off('jcf-mousewheel', this.preventWheelHandler);
7592			this.listHolder.off('jcf-pointerdown', this.indexSelector, this.onSelectItem);
7593			this.listHolder.off('jcf-pointerover', this.indexSelector, this.onHoverItem);
7594			this.listHolder.off('jcf-pointerdown', this.onPress);
7595		}
7596	});
7597
7598	// helper functions
7599	var getPrefixedClasses = function(className, prefixToAdd) {
7600		return className ? className.replace(/[\s]*([\S]+)+[\s]*/gi, prefixToAdd + '$1 ') : '';
7601	};
7602
7603	var makeUnselectable = (function() {
7604		const unselectableClass = jcf.getOptions().unselectableClass;
7605
7606		function preventHandler(e) {
7607			e.preventDefault();
7608		}
7609
7610		return function(node) {
7611			node.addClass(unselectableClass).on('selectstart', preventHandler);
7612		};
7613	}());
7614}(jQuery, this));
7615
7616/*!
7617 * JavaScript Custom Forms : Scrollbar Module
7618 *
7619 * Copyright 2014-2015 PSD2HTML - http://psd2html.com/jcf
7620 * Released under the MIT license (LICENSE.txt)
7621 *
7622 * Version: 1.1.3
7623 */
7624(function($, window) {
7625	'use strict';
7626
7627	jcf.addModule({
7628		name: 'Scrollable',
7629		selector: '.jcf-scrollable',
7630		plugins: {
7631			ScrollBar: ScrollBar
7632		},
7633		options: {
7634			mouseWheelStep: 150,
7635			handleResize: true,
7636			alwaysShowScrollbars: false,
7637			alwaysPreventMouseWheel: false,
7638			scrollAreaStructure: '<div class="jcf-scrollable-wrapper"></div>'
7639		},
7640		matchElement: function(element) {
7641			return element.is('.jcf-scrollable');
7642		},
7643		init: function() {
7644			this.initStructure();
7645			this.attachEvents();
7646			this.rebuildScrollbars();
7647		},
7648		initStructure: function() {
7649			// prepare structure
7650			this.doc = $(document);
7651			this.win = $(window);
7652			this.realElement = $(this.options.element);
7653			this.scrollWrapper = $(this.options.scrollAreaStructure).insertAfter(this.realElement);
7654
7655			// set initial styles
7656			this.scrollWrapper.css('position', 'relative');
7657			// this.realElement.css('overflow', 'hidden');
7658			this.realElement.css('overflow', this.options.ios && this.options.ios >= 10 ? 'auto' : 'hidden');
7659			this.vBarEdge = 0;
7660		},
7661		attachEvents: function() {
7662			// create scrollbars
7663			const self = this;
7664
7665			this.vBar = new ScrollBar({
7666				holder: this.scrollWrapper,
7667				vertical: true,
7668				onScroll: function(scrollTop) {
7669					self.realElement.scrollTop(scrollTop);
7670				}
7671			});
7672
7673			this.hBar = new ScrollBar({
7674				holder: this.scrollWrapper,
7675				vertical: false,
7676				onScroll: function(scrollLeft) {
7677					self.realElement.scrollLeft(scrollLeft);
7678				}
7679			});
7680
7681			// add event handlers
7682			this.realElement.on('scroll', this.onScroll);
7683
7684			if (this.options.handleResize) {
7685				this.win.on('resize orientationchange load', this.onResize);
7686			}
7687
7688			// add pointer/wheel event handlers
7689			this.realElement.on('jcf-mousewheel', this.onMouseWheel);
7690			this.realElement.on('jcf-pointerdown', this.onTouchBody);
7691		},
7692		onScroll: function() {
7693			this.redrawScrollbars();
7694		},
7695		onResize: function() {
7696			// do not rebuild scrollbars if form field is in focus
7697			if (!$(document.activeElement).is(':input')) {
7698				this.rebuildScrollbars();
7699			}
7700		},
7701		onTouchBody: function(e) {
7702			if (e.pointerType === 'touch') {
7703				this.touchData = {
7704					scrollTop: this.realElement.scrollTop(),
7705					scrollLeft: this.realElement.scrollLeft(),
7706					left: e.pageX,
7707					top: e.pageY
7708				};
7709
7710				this.doc.on({
7711					'jcf-pointermove': this.onMoveBody,
7712					'jcf-pointerup': this.onReleaseBody
7713				});
7714			}
7715		},
7716		onMoveBody: function(e) {
7717			let targetScrollTop,
7718				targetScrollLeft,
7719				verticalScrollAllowed = this.verticalScrollActive,
7720				horizontalScrollAllowed = this.horizontalScrollActive;
7721
7722			if (e.pointerType === 'touch') {
7723				targetScrollTop = this.touchData.scrollTop - e.pageY + this.touchData.top;
7724				targetScrollLeft = this.touchData.scrollLeft - e.pageX + this.touchData.left;
7725
7726				// check that scrolling is ended and release outer scrolling
7727				if (this.verticalScrollActive && (targetScrollTop < 0 || targetScrollTop > this.vBar.maxValue)) {
7728					verticalScrollAllowed = false;
7729				}
7730
7731				if (this.horizontalScrollActive && (targetScrollLeft < 0 || targetScrollLeft > this.hBar.maxValue)) {
7732					horizontalScrollAllowed = false;
7733				}
7734
7735				this.realElement.scrollTop(targetScrollTop);
7736				this.realElement.scrollLeft(targetScrollLeft);
7737
7738				if (verticalScrollAllowed || horizontalScrollAllowed) {
7739					e.preventDefault();
7740				} else {
7741					this.onReleaseBody(e);
7742				}
7743			}
7744		},
7745		onReleaseBody: function(e) {
7746			if (e.pointerType === 'touch') {
7747				delete this.touchData;
7748
7749				this.doc.off({
7750					'jcf-pointermove': this.onMoveBody,
7751					'jcf-pointerup': this.onReleaseBody
7752				});
7753			}
7754		},
7755		onMouseWheel: function(e) {
7756			let currentScrollTop = this.realElement.scrollTop(),
7757				currentScrollLeft = this.realElement.scrollLeft(),
7758				maxScrollTop = this.realElement.prop('scrollHeight') - this.embeddedDimensions.innerHeight,
7759				maxScrollLeft = this.realElement.prop('scrollWidth') - this.embeddedDimensions.innerWidth,
7760				extraLeft, extraTop, preventFlag;
7761
7762			// check edge cases
7763			if (!this.options.alwaysPreventMouseWheel) {
7764				if (this.verticalScrollActive && e.deltaY) {
7765					if (!(currentScrollTop <= 0 && e.deltaY < 0) && !(currentScrollTop >= maxScrollTop && e.deltaY > 0)) {
7766						preventFlag = true;
7767					}
7768				}
7769
7770				if (this.horizontalScrollActive && e.deltaX) {
7771					if (!(currentScrollLeft <= 0 && e.deltaX < 0) && !(currentScrollLeft >= maxScrollLeft && e.deltaX > 0)) {
7772						preventFlag = true;
7773					}
7774				}
7775
7776				if (!this.verticalScrollActive && !this.horizontalScrollActive) {
7777					return;
7778				}
7779			}
7780
7781			// prevent default action and scroll item
7782			if (preventFlag || this.options.alwaysPreventMouseWheel) {
7783				e.preventDefault();
7784			} else {
7785				return;
7786			}
7787
7788			extraLeft = e.deltaX / 100 * this.options.mouseWheelStep;
7789			extraTop = e.deltaY / 100 * this.options.mouseWheelStep;
7790
7791			this.realElement.scrollTop(currentScrollTop + extraTop);
7792			this.realElement.scrollLeft(currentScrollLeft + extraLeft);
7793		},
7794		setScrollBarEdge: function(edgeSize) {
7795			this.vBarEdge = edgeSize || 0;
7796			this.redrawScrollbars();
7797		},
7798		saveElementDimensions: function() {
7799			this.savedDimensions = {
7800				top: this.realElement.width(),
7801				left: this.realElement.height()
7802			};
7803
7804			return this;
7805		},
7806		restoreElementDimensions: function() {
7807			if (this.savedDimensions) {
7808				this.realElement.css({
7809					width: this.savedDimensions.width,
7810					height: this.savedDimensions.height
7811				});
7812			}
7813
7814			return this;
7815		},
7816		saveScrollOffsets: function() {
7817			this.savedOffsets = {
7818				top: this.realElement.scrollTop(),
7819				left: this.realElement.scrollLeft()
7820			};
7821
7822			return this;
7823		},
7824		restoreScrollOffsets: function() {
7825			if (this.savedOffsets) {
7826				this.realElement.scrollTop(this.savedOffsets.top);
7827				this.realElement.scrollLeft(this.savedOffsets.left);
7828			}
7829
7830			return this;
7831		},
7832		getContainerDimensions: function() {
7833			// save current styles
7834			let desiredDimensions,
7835				currentStyles,
7836				currentHeight,
7837				currentWidth;
7838
7839			if (this.isModifiedStyles) {
7840				desiredDimensions = {
7841					width: this.realElement.innerWidth() + this.vBar.getThickness(),
7842					height: this.realElement.innerHeight() + this.hBar.getThickness()
7843				};
7844			} else {
7845				// unwrap real element and measure it according to CSS
7846				this.saveElementDimensions().saveScrollOffsets();
7847				this.realElement.insertAfter(this.scrollWrapper);
7848				this.scrollWrapper.detach();
7849
7850				// measure element
7851				currentStyles = this.realElement.prop('style');
7852				currentWidth = parseFloat(currentStyles.width);
7853				currentHeight = parseFloat(currentStyles.height);
7854
7855				// reset styles if needed
7856				if (this.embeddedDimensions && currentWidth && currentHeight) {
7857					this.isModifiedStyles |= (currentWidth !== this.embeddedDimensions.width || currentHeight !== this.embeddedDimensions.height);
7858
7859					this.realElement.css({
7860						overflow: '',
7861						width: '',
7862						height: ''
7863					});
7864				}
7865
7866				// calculate desired dimensions for real element
7867				desiredDimensions = {
7868					width: this.realElement.outerWidth(),
7869					height: this.realElement.outerHeight()
7870				};
7871
7872				// restore structure and original scroll offsets
7873				this.scrollWrapper.insertAfter(this.realElement);
7874				this.realElement.css('overflow', this.options.ios && this.options.ios >= 10 ? 'auto' : 'hidden').prependTo(this.scrollWrapper);
7875				this.restoreElementDimensions().restoreScrollOffsets();
7876			}
7877
7878			return desiredDimensions;
7879		},
7880		getEmbeddedDimensions: function(dimensions) {
7881			// handle scrollbars cropping
7882			let fakeBarWidth = this.vBar.getThickness(),
7883				fakeBarHeight = this.hBar.getThickness(),
7884				paddingWidth = this.realElement.outerWidth() - this.realElement.width(),
7885				paddingHeight = this.realElement.outerHeight() - this.realElement.height(),
7886				resultDimensions;
7887
7888			if (this.options.alwaysShowScrollbars) {
7889				// simply return dimensions without custom scrollbars
7890				this.verticalScrollActive = true;
7891				this.horizontalScrollActive = true;
7892
7893				resultDimensions = {
7894					innerWidth: dimensions.width - fakeBarWidth,
7895					innerHeight: dimensions.height - fakeBarHeight
7896				};
7897			} else {
7898				// detect when to display each scrollbar
7899				this.saveElementDimensions();
7900				this.verticalScrollActive = false;
7901				this.horizontalScrollActive = false;
7902
7903				// fill container with full size
7904				this.realElement.css({
7905					width: dimensions.width - paddingWidth,
7906					height: dimensions.height - paddingHeight
7907				});
7908
7909				this.horizontalScrollActive = this.realElement.prop('scrollWidth') > this.containerDimensions.width;
7910				this.verticalScrollActive = this.realElement.prop('scrollHeight') > this.containerDimensions.height;
7911
7912				this.restoreElementDimensions();
7913
7914				resultDimensions = {
7915					innerWidth: dimensions.width - (this.verticalScrollActive ? fakeBarWidth : 0),
7916					innerHeight: dimensions.height - (this.horizontalScrollActive ? fakeBarHeight : 0)
7917				};
7918			}
7919
7920			$.extend(resultDimensions, {
7921				width: resultDimensions.innerWidth - paddingWidth,
7922				height: resultDimensions.innerHeight - paddingHeight
7923			});
7924
7925			return resultDimensions;
7926		},
7927		rebuildScrollbars: function() {
7928			// resize wrapper according to real element styles
7929			this.containerDimensions = this.getContainerDimensions();
7930			this.embeddedDimensions = this.getEmbeddedDimensions(this.containerDimensions);
7931
7932			// resize wrapper to desired dimensions
7933			this.scrollWrapper.css({
7934				width: this.containerDimensions.width,
7935				height: this.containerDimensions.height
7936			});
7937
7938			// resize element inside wrapper excluding scrollbar size
7939			this.realElement.css({
7940				overflow: this.options.ios && this.options.ios >= 10 ? 'auto' : 'hidden',
7941				width: this.embeddedDimensions.width,
7942				height: this.embeddedDimensions.height
7943			});
7944
7945			// redraw scrollbar offset
7946			this.redrawScrollbars();
7947		},
7948		redrawScrollbars: function() {
7949			let viewSize, maxScrollValue;
7950
7951			// redraw vertical scrollbar
7952			if (this.verticalScrollActive) {
7953				viewSize = this.vBarEdge ? this.containerDimensions.height - this.vBarEdge : this.embeddedDimensions.innerHeight;
7954				maxScrollValue = Math.max(this.realElement.prop('offsetHeight'), this.realElement.prop('scrollHeight')) - this.vBarEdge;
7955
7956				this.vBar.show().setMaxValue(maxScrollValue - viewSize).setRatio(viewSize / maxScrollValue).setSize(viewSize);
7957				this.vBar.setValue(this.realElement.scrollTop());
7958			} else {
7959				this.vBar.hide();
7960			}
7961
7962			// redraw horizontal scrollbar
7963			if (this.horizontalScrollActive) {
7964				viewSize = this.embeddedDimensions.innerWidth;
7965				maxScrollValue = this.realElement.prop('scrollWidth');
7966
7967				if (maxScrollValue === viewSize) {
7968					this.horizontalScrollActive = false;
7969				}
7970
7971				this.hBar.show().setMaxValue(maxScrollValue - viewSize).setRatio(viewSize / maxScrollValue).setSize(viewSize);
7972				this.hBar.setValue(this.realElement.scrollLeft());
7973			} else {
7974				this.hBar.hide();
7975			}
7976
7977			// set "touch-action" style rule
7978			let touchAction = '';
7979
7980			if (this.verticalScrollActive && this.horizontalScrollActive) {
7981				touchAction = 'none';
7982			} else if (this.verticalScrollActive) {
7983				touchAction = 'pan-x';
7984			} else if (this.horizontalScrollActive) {
7985				touchAction = 'pan-y';
7986			}
7987
7988			this.realElement.css('touchAction', touchAction);
7989		},
7990		refresh: function() {
7991			this.rebuildScrollbars();
7992		},
7993		destroy: function() {
7994			// remove event listeners
7995			this.win.off('resize orientationchange load', this.onResize);
7996
7997			this.realElement.off({
7998				'jcf-mousewheel': this.onMouseWheel,
7999				'jcf-pointerdown': this.onTouchBody
8000			});
8001
8002			this.doc.off({
8003				'jcf-pointermove': this.onMoveBody,
8004				'jcf-pointerup': this.onReleaseBody
8005			});
8006
8007			// restore structure
8008			this.saveScrollOffsets();
8009			this.vBar.destroy();
8010			this.hBar.destroy();
8011
8012			this.realElement.insertAfter(this.scrollWrapper).css({
8013				touchAction: '',
8014				overflow: '',
8015				width: '',
8016				height: ''
8017			});
8018
8019			this.scrollWrapper.remove();
8020			this.restoreScrollOffsets();
8021		}
8022	});
8023
8024	// custom scrollbar
8025	function ScrollBar(options) {
8026		this.options = $.extend({
8027			holder: null,
8028			vertical: true,
8029			inactiveClass: 'jcf-inactive',
8030			verticalClass: 'jcf-scrollbar-vertical',
8031			horizontalClass: 'jcf-scrollbar-horizontal',
8032			scrollbarStructure: '<div class="jcf-scrollbar"><div class="jcf-scrollbar-dec"></div><div class="jcf-scrollbar-slider"><div class="jcf-scrollbar-handle"></div></div><div class="jcf-scrollbar-inc"></div></div>',
8033			btnDecSelector: '.jcf-scrollbar-dec',
8034			btnIncSelector: '.jcf-scrollbar-inc',
8035			sliderSelector: '.jcf-scrollbar-slider',
8036			handleSelector: '.jcf-scrollbar-handle',
8037			scrollInterval: 300,
8038			scrollStep: 400 // px/sec
8039		}, options);
8040
8041		this.init();
8042	}
8043
8044	$.extend(ScrollBar.prototype, {
8045		init: function() {
8046			this.initStructure();
8047			this.attachEvents();
8048		},
8049		initStructure: function() {
8050			// define proporties
8051			this.doc = $(document);
8052			this.isVertical = !!this.options.vertical;
8053			this.sizeProperty = this.isVertical ? 'height' : 'width';
8054			this.fullSizeProperty = this.isVertical ? 'outerHeight' : 'outerWidth';
8055			this.invertedSizeProperty = this.isVertical ? 'width' : 'height';
8056			this.thicknessMeasureMethod = 'outer' + this.invertedSizeProperty.charAt(0).toUpperCase() + this.invertedSizeProperty.substr(1);
8057			this.offsetProperty = this.isVertical ? 'top' : 'left';
8058			this.offsetEventProperty = this.isVertical ? 'pageY' : 'pageX';
8059
8060			// initialize variables
8061			this.value = this.options.value || 0;
8062			this.maxValue = this.options.maxValue || 0;
8063			this.currentSliderSize = 0;
8064			this.handleSize = 0;
8065
8066			// find elements
8067			this.holder = $(this.options.holder);
8068			this.scrollbar = $(this.options.scrollbarStructure).appendTo(this.holder);
8069			this.btnDec = this.scrollbar.find(this.options.btnDecSelector);
8070			this.btnInc = this.scrollbar.find(this.options.btnIncSelector);
8071			this.slider = this.scrollbar.find(this.options.sliderSelector);
8072			this.handle = this.slider.find(this.options.handleSelector);
8073
8074			// set initial styles
8075			this.scrollbar.addClass(this.isVertical ? this.options.verticalClass : this.options.horizontalClass).css({
8076				touchAction: this.isVertical ? 'pan-x' : 'pan-y',
8077				position: 'absolute'
8078			});
8079
8080			this.slider.css({
8081				position: 'relative'
8082			});
8083
8084			this.handle.css({
8085				touchAction: 'none',
8086				position: 'absolute'
8087			});
8088		},
8089		attachEvents: function() {
8090			this.bindHandlers();
8091			this.handle.on('jcf-pointerdown', this.onHandlePress);
8092			this.slider.add(this.btnDec).add(this.btnInc).on('jcf-pointerdown', this.onButtonPress);
8093		},
8094		onHandlePress: function(e) {
8095			if (e.pointerType === 'mouse' && e.button > 1) {
8096				return;
8097			} else {
8098				e.preventDefault();
8099				this.handleDragActive = true;
8100				this.sliderOffset = this.slider.offset()[this.offsetProperty];
8101				this.innerHandleOffset = e[this.offsetEventProperty] - this.handle.offset()[this.offsetProperty];
8102
8103				this.doc.on('jcf-pointermove', this.onHandleDrag);
8104				this.doc.on('jcf-pointerup', this.onHandleRelease);
8105			}
8106		},
8107		onHandleDrag: function(e) {
8108			e.preventDefault();
8109			this.calcOffset = e[this.offsetEventProperty] - this.sliderOffset - this.innerHandleOffset;
8110			this.setValue(this.calcOffset / (this.currentSliderSize - this.handleSize) * this.maxValue);
8111			this.triggerScrollEvent(this.value);
8112		},
8113		onHandleRelease: function() {
8114			this.handleDragActive = false;
8115			this.doc.off('jcf-pointermove', this.onHandleDrag);
8116			this.doc.off('jcf-pointerup', this.onHandleRelease);
8117		},
8118		onButtonPress: function(e) {
8119			let direction, clickOffset;
8120
8121			if (e.pointerType === 'mouse' && e.button > 1) {
8122				return;
8123			} else {
8124				e.preventDefault();
8125
8126				if (!this.handleDragActive) {
8127					if (this.slider.is(e.currentTarget)) {
8128						// slider pressed
8129						direction = this.handle.offset()[this.offsetProperty] > e[this.offsetEventProperty] ? -1 : 1;
8130						clickOffset = e[this.offsetEventProperty] - this.slider.offset()[this.offsetProperty];
8131						this.startPageScrolling(direction, clickOffset);
8132					} else {
8133						// scrollbar buttons pressed
8134						direction = this.btnDec.is(e.currentTarget) ? -1 : 1;
8135						this.startSmoothScrolling(direction);
8136					}
8137
8138					this.doc.on('jcf-pointerup', this.onButtonRelease);
8139				}
8140			}
8141		},
8142		onButtonRelease: function() {
8143			this.stopPageScrolling();
8144			this.stopSmoothScrolling();
8145			this.doc.off('jcf-pointerup', this.onButtonRelease);
8146		},
8147		startPageScrolling: function(direction, clickOffset) {
8148			const self = this,
8149				stepValue = direction * self.currentSize;
8150
8151			// limit checker
8152			const isFinishedScrolling = function() {
8153				const handleTop = (self.value / self.maxValue) * (self.currentSliderSize - self.handleSize);
8154
8155				if (direction > 0) {
8156					return handleTop + self.handleSize >= clickOffset;
8157				} else {
8158					return handleTop <= clickOffset;
8159				}
8160			};
8161
8162			// scroll by page when track is pressed
8163			const doPageScroll = function() {
8164				self.value += stepValue;
8165				self.setValue(self.value);
8166				self.triggerScrollEvent(self.value);
8167
8168				if (isFinishedScrolling()) {
8169					clearInterval(self.pageScrollTimer);
8170				}
8171			};
8172
8173			// start scrolling
8174			this.pageScrollTimer = setInterval(doPageScroll, this.options.scrollInterval);
8175			doPageScroll();
8176		},
8177		stopPageScrolling: function() {
8178			clearInterval(this.pageScrollTimer);
8179		},
8180		startSmoothScrolling: function(direction) {
8181			let self = this,
8182				dt;
8183
8184			this.stopSmoothScrolling();
8185
8186			// simple animation functions
8187			const raf = window.requestAnimationFrame || function(func) {
8188				setTimeout(func, 16);
8189			};
8190
8191			const getTimestamp = function() {
8192				return Date.now ? Date.now() : new Date().getTime();
8193			};
8194
8195			// set animation limit
8196			const isFinishedScrolling = function() {
8197				if (direction > 0) {
8198					return self.value >= self.maxValue;
8199				} else {
8200					return self.value <= 0;
8201				}
8202			};
8203
8204			// animation step
8205			const doScrollAnimation = function() {
8206				const stepValue = (getTimestamp() - dt) / 1000 * self.options.scrollStep;
8207
8208				if (self.smoothScrollActive) {
8209					self.value += stepValue * direction;
8210					self.setValue(self.value);
8211					self.triggerScrollEvent(self.value);
8212
8213					if (!isFinishedScrolling()) {
8214						dt = getTimestamp();
8215						raf(doScrollAnimation);
8216					}
8217				}
8218			};
8219
8220			// start animation
8221			self.smoothScrollActive = true;
8222			dt = getTimestamp();
8223			raf(doScrollAnimation);
8224		},
8225		stopSmoothScrolling: function() {
8226			this.smoothScrollActive = false;
8227		},
8228		triggerScrollEvent: function(scrollValue) {
8229			if (this.options.onScroll) {
8230				this.options.onScroll(scrollValue);
8231			}
8232		},
8233		getThickness: function() {
8234			return this.scrollbar[this.thicknessMeasureMethod]();
8235		},
8236		setSize: function(size) {
8237			// resize scrollbar
8238			const btnDecSize = this.btnDec[this.fullSizeProperty](),
8239				btnIncSize = this.btnInc[this.fullSizeProperty]();
8240
8241			// resize slider
8242			this.currentSize = size;
8243			this.currentSliderSize = size - btnDecSize - btnIncSize;
8244			this.scrollbar.css(this.sizeProperty, size);
8245			this.slider.css(this.sizeProperty, this.currentSliderSize);
8246			this.currentSliderSize = this.slider[this.sizeProperty]();
8247
8248			// resize handle
8249			this.handleSize = Math.round(this.currentSliderSize * this.ratio);
8250			this.handle.css(this.sizeProperty, this.handleSize);
8251			this.handleSize = this.handle[this.fullSizeProperty]();
8252
8253			return this;
8254		},
8255		setRatio: function(ratio) {
8256			this.ratio = ratio;
8257
8258			return this;
8259		},
8260		setMaxValue: function(maxValue) {
8261			this.maxValue = maxValue;
8262			this.setValue(Math.min(this.value, this.maxValue));
8263
8264			return this;
8265		},
8266		setValue: function(value) {
8267			this.value = value;
8268
8269			if (this.value < 0) {
8270				this.value = 0;
8271			} else if (this.value > this.maxValue) {
8272				this.value = this.maxValue;
8273			}
8274
8275			this.refresh();
8276		},
8277		setPosition: function(styles) {
8278			this.scrollbar.css(styles);
8279
8280			return this;
8281		},
8282		hide: function() {
8283			this.scrollbar.detach();
8284
8285			return this;
8286		},
8287		show: function() {
8288			this.scrollbar.appendTo(this.holder);
8289
8290			return this;
8291		},
8292		refresh: function() {
8293			// recalculate handle position
8294			if (this.value === 0 || this.maxValue === 0) {
8295				this.calcOffset = 0;
8296			} else {
8297				this.calcOffset = (this.value / this.maxValue) * (this.currentSliderSize - this.handleSize);
8298			}
8299
8300			this.handle.css(this.offsetProperty, this.calcOffset);
8301
8302			// toggle inactive classes
8303			this.btnDec.toggleClass(this.options.inactiveClass, this.value === 0);
8304			this.btnInc.toggleClass(this.options.inactiveClass, this.value === this.maxValue);
8305			this.scrollbar.toggleClass(this.options.inactiveClass, this.maxValue === 0);
8306		},
8307		destroy: function() {
8308			// remove event handlers and scrollbar block itself
8309			this.btnDec.add(this.btnInc).off('jcf-pointerdown', this.onButtonPress);
8310			this.handle.off('jcf-pointerdown', this.onHandlePress);
8311			this.doc.off('jcf-pointermove', this.onHandleDrag);
8312			this.doc.off('jcf-pointerup', this.onHandleRelease);
8313			this.doc.off('jcf-pointerup', this.onButtonRelease);
8314			this.stopSmoothScrolling();
8315			this.stopPageScrolling();
8316			this.scrollbar.remove();
8317		}
8318	});
8319}(jQuery, this));
8320
8321/*!
8322 * JavaScript Custom Forms : Range Module
8323 *
8324 * Copyright 2014-2015 PSD2HTML - http://psd2html.com/jcf
8325 * Released under the MIT license (LICENSE.txt)
8326 *
8327 * Version: 1.1.3
8328 */
8329(function($) {
8330	'use strict';
8331
8332	jcf.addModule({
8333		name: 'Range',
8334		selector: 'input[type="range"]',
8335		options: {
8336			realElementClass: 'jcf-real-element',
8337			fakeStructure: '<span class="jcf-range"><span class="jcf-range-wrapper"><span class="jcf-range-track"><span class="jcf-range-handle"></span></span></span></span>',
8338			dataListMark: '<span class="jcf-range-mark"></span>',
8339			rangeDisplayWrapper: '<span class="jcf-range-display-wrapper"></span>',
8340			rangeDisplay: '<span class="jcf-range-display"></span>',
8341			handleSelector: '.jcf-range-handle',
8342			trackSelector: '.jcf-range-track',
8343			activeHandleClass: 'jcf-active-handle',
8344			verticalClass: 'jcf-vertical',
8345			orientation: 'horizontal',
8346			range: false, // or "min", "max", "all"
8347			dragHandleCenter: true,
8348			snapToMarks: true,
8349			snapRadius: 5
8350		},
8351		matchElement: function(element) {
8352			return element.is(this.selector);
8353		},
8354		init: function() {
8355			this.initStructure();
8356			this.attachEvents();
8357			this.refresh();
8358		},
8359		initStructure: function() {
8360			const self = this;
8361
8362			this.page = $('html');
8363			this.realElement = $(this.options.element).addClass(this.options.hiddenClass);
8364			this.fakeElement = $(this.options.fakeStructure).insertBefore(this.realElement).prepend(this.realElement);
8365			this.track = this.fakeElement.find(this.options.trackSelector);
8366			this.trackHolder = this.track.parent();
8367			this.handle = this.fakeElement.find(this.options.handleSelector);
8368			this.createdHandleCount = 0;
8369			this.activeDragHandleIndex = 0;
8370			this.isMultiple = this.realElement.prop('multiple') || typeof this.realElement.attr('multiple') === 'string';
8371			this.values = this.isMultiple ? this.realElement.attr('value').split(',') : [this.realElement.val()];
8372			this.handleCount = this.isMultiple ? this.values.length : 1;
8373
8374			// create range display
8375			this.rangeDisplayWrapper = $(this.options.rangeDisplayWrapper).insertBefore(this.track);
8376
8377			if (this.options.range === 'min' || this.options.range === 'all') {
8378				this.rangeMin = $(this.options.rangeDisplay).addClass('jcf-range-min').prependTo(this.rangeDisplayWrapper);
8379			}
8380
8381			if (this.options.range === 'max' || this.options.range === 'all') {
8382				this.rangeMax = $(this.options.rangeDisplay).addClass('jcf-range-max').prependTo(this.rangeDisplayWrapper);
8383			}
8384
8385			// clone handles if needed
8386			while (this.createdHandleCount < this.handleCount) {
8387				this.createdHandleCount++;
8388				this.handle.clone().addClass('jcf-index-' + this.createdHandleCount).insertBefore(this.handle);
8389
8390				// create mid ranges
8391				if (this.createdHandleCount > 1) {
8392					if (!this.rangeMid) {
8393						this.rangeMid = $();
8394					}
8395
8396					this.rangeMid = this.rangeMid.add($(this.options.rangeDisplay).addClass('jcf-range-mid').prependTo(this.rangeDisplayWrapper));
8397				}
8398			}
8399
8400			// grab all handles
8401			this.handle.detach();
8402			this.handle = null;
8403			this.handles = this.fakeElement.find(this.options.handleSelector);
8404			this.handles.eq(0).addClass(this.options.activeHandleClass);
8405
8406			if (this.realElement.attr('show-tooltip')) {
8407				this.handles.each(function(i) {
8408					jQuery('<span class="tooltip-range-value"></span>').text(self.values[i]).appendTo(jQuery(this));
8409				});
8410			}
8411
8412			// handle orientation
8413			this.isVertical = (this.options.orientation === 'vertical');
8414			this.directionProperty = this.isVertical ? 'top' : 'left';
8415			this.offsetProperty = this.isVertical ? 'bottom' : 'left';
8416			this.eventProperty = this.isVertical ? 'pageY' : 'pageX';
8417			this.sizeProperty = this.isVertical ? 'height' : 'width';
8418			this.sizeMethod = this.isVertical ? 'innerHeight' : 'innerWidth';
8419			this.fakeElement.css('touchAction', this.isVertical ? 'pan-x' : 'pan-y');
8420
8421			if (this.isVertical) {
8422				this.fakeElement.addClass(this.options.verticalClass);
8423			}
8424
8425			// set initial values
8426			this.minValue = parseFloat(this.realElement.attr('min'));
8427			this.maxValue = parseFloat(this.realElement.attr('max'));
8428			this.stepValue = parseFloat(this.realElement.attr('step')) || 1;
8429
8430			// check attribute values
8431			this.minValue = isNaN(this.minValue) ? 0 : this.minValue;
8432			this.maxValue = isNaN(this.maxValue) ? 100 : this.maxValue;
8433
8434			// handle range
8435			if (this.stepValue !== 1) {
8436				this.maxValue -= (this.maxValue - this.minValue) % this.stepValue;
8437			}
8438
8439			this.stepsCount = (this.maxValue - this.minValue) / this.stepValue;
8440			this.createDataList();
8441		},
8442		attachEvents: function() {
8443			this.realElement.on({
8444				focus: this.onFocus
8445			});
8446
8447			this.trackHolder.on('jcf-pointerdown', this.onTrackPress);
8448			this.handles.on('jcf-pointerdown', this.onHandlePress);
8449		},
8450		createDataList: function() {
8451			const self = this,
8452				dataValues = [],
8453				dataListId = this.realElement.attr('list');
8454
8455			if (dataListId) {
8456				$('#' + dataListId).find('option').each(function() {
8457					let itemValue = parseFloat(this.value || this.innerHTML),
8458						mark, markOffset;
8459
8460					if (!isNaN(itemValue)) {
8461						markOffset = self.valueToOffset(itemValue);
8462
8463						dataValues.push({
8464							value: itemValue,
8465							offset: markOffset
8466						});
8467
8468						mark = $(self.options.dataListMark).text(itemValue).attr({
8469							'data-mark-value': itemValue
8470						}).css(self.offsetProperty, markOffset + '%').appendTo(self.track);
8471					}
8472				});
8473
8474				if (dataValues.length) {
8475					self.dataValues = dataValues;
8476				}
8477			}
8478		},
8479		getDragHandleRange: function(handleIndex) {
8480			// calculate range for slider with multiple handles
8481			let minStep = -Infinity,
8482				maxStep = Infinity;
8483
8484			if (handleIndex > 0) {
8485				minStep = this.valueToStepIndex(this.values[handleIndex - 1]);
8486			}
8487
8488			if (handleIndex < this.handleCount - 1) {
8489				maxStep = this.valueToStepIndex(this.values[handleIndex + 1]);
8490			}
8491
8492			return {
8493				minStepIndex: minStep,
8494				maxStepIndex: maxStep
8495			};
8496		},
8497		getNearestHandle: function(percent) {
8498			// handle vertical sliders
8499			if (this.isVertical) {
8500				percent = 1 - percent;
8501			}
8502
8503			// detect closest handle when track is pressed
8504			let closestHandle = this.handles.eq(0),
8505				closestDistance = Infinity,
8506				self = this;
8507
8508			if (this.handleCount > 1) {
8509				this.handles.each(function() {
8510					const handleOffset = parseFloat(this.style[self.offsetProperty]) / 100,
8511						handleDistance = Math.abs(handleOffset - percent);
8512
8513					if (handleDistance < closestDistance) {
8514						closestDistance = handleDistance;
8515						closestHandle = $(this);
8516					}
8517				});
8518			}
8519
8520			return closestHandle;
8521		},
8522		onTrackPress: function(e) {
8523			let trackSize, trackOffset, innerOffset;
8524
8525			e.preventDefault();
8526
8527			if (!this.realElement.is(':disabled') && !this.activeDragHandle) {
8528				trackSize = this.track[this.sizeMethod]();
8529				trackOffset = this.track.offset()[this.directionProperty];
8530				this.activeDragHandle = this.getNearestHandle((e[this.eventProperty] - trackOffset) / this.trackHolder[this.sizeMethod]());
8531				this.activeDragHandleIndex = this.handles.index(this.activeDragHandle);
8532				this.handles.removeClass(this.options.activeHandleClass).eq(this.activeDragHandleIndex).addClass(this.options.activeHandleClass);
8533				innerOffset = this.activeDragHandle[this.sizeMethod]() / 2;
8534
8535				this.dragData = {
8536					trackSize: trackSize,
8537					innerOffset: innerOffset,
8538					trackOffset: trackOffset,
8539					min: trackOffset,
8540					max: trackOffset + trackSize
8541				};
8542
8543				this.page.on({
8544					'jcf-pointermove': this.onHandleMove,
8545					'jcf-pointerup': this.onHandleRelease
8546				});
8547
8548				if (e.pointerType === 'mouse') {
8549					this.realElement.focus();
8550				}
8551
8552				this.onHandleMove(e);
8553			}
8554		},
8555		onHandlePress: function(e) {
8556			let trackSize, trackOffset, innerOffset;
8557
8558			e.preventDefault();
8559
8560			if (!this.realElement.is(':disabled') && !this.activeDragHandle) {
8561				this.activeDragHandle = $(e.currentTarget);
8562				this.activeDragHandleIndex = this.handles.index(this.activeDragHandle);
8563				this.handles.removeClass(this.options.activeHandleClass).eq(this.activeDragHandleIndex).addClass(this.options.activeHandleClass);
8564				trackSize = this.track[this.sizeMethod]();
8565				trackOffset = this.track.offset()[this.directionProperty];
8566				innerOffset = this.options.dragHandleCenter ? this.activeDragHandle[this.sizeMethod]() / 2 : e[this.eventProperty] - this.handle.offset()[this.directionProperty];
8567
8568				this.dragData = {
8569					trackSize: trackSize,
8570					innerOffset: innerOffset,
8571					trackOffset: trackOffset,
8572					min: trackOffset,
8573					max: trackOffset + trackSize
8574				};
8575
8576				this.page.on({
8577					'jcf-pointermove': this.onHandleMove,
8578					'jcf-pointerup': this.onHandleRelease
8579				});
8580
8581				if (e.pointerType === 'mouse') {
8582					this.realElement.focus();
8583				}
8584			}
8585		},
8586		onHandleMove: function(e) {
8587			let self = this,
8588				newOffset, dragPercent, stepIndex, valuePercent, handleDragRange;
8589
8590			// calculate offset
8591			if (this.isVertical) {
8592				newOffset = this.dragData.max + (this.dragData.min - e[this.eventProperty]) - this.dragData.innerOffset;
8593			} else {
8594				newOffset = e[this.eventProperty] - this.dragData.innerOffset;
8595			}
8596
8597			// fit in range
8598			if (newOffset < this.dragData.min) {
8599				newOffset = this.dragData.min;
8600			} else if (newOffset > this.dragData.max) {
8601				newOffset = this.dragData.max;
8602			}
8603
8604			e.preventDefault();
8605
8606			if (this.options.snapToMarks && this.dataValues) {
8607				// snap handle to marks
8608				const dragOffset = newOffset - this.dragData.trackOffset;
8609
8610				dragPercent = (newOffset - this.dragData.trackOffset) / this.dragData.trackSize * 100;
8611
8612				$.each(this.dataValues, function(index, item) {
8613					const markOffset = item.offset / 100 * self.dragData.trackSize,
8614						markMin = markOffset - self.options.snapRadius,
8615						markMax = markOffset + self.options.snapRadius;
8616
8617					if (dragOffset >= markMin && dragOffset <= markMax) {
8618						dragPercent = item.offset;
8619
8620						return false;
8621					}
8622				});
8623			} else {
8624				// snap handle to steps
8625				dragPercent = (newOffset - this.dragData.trackOffset) / this.dragData.trackSize * 100;
8626			}
8627
8628			// move handle only in range
8629			stepIndex = Math.round(dragPercent * this.stepsCount / 100);
8630
8631			if (this.handleCount > 1) {
8632				handleDragRange = this.getDragHandleRange(this.activeDragHandleIndex);
8633
8634				if (stepIndex < handleDragRange.minStepIndex) {
8635					stepIndex = Math.max(handleDragRange.minStepIndex, stepIndex);
8636				} else if (stepIndex > handleDragRange.maxStepIndex) {
8637					stepIndex = Math.min(handleDragRange.maxStepIndex, stepIndex);
8638				}
8639			}
8640
8641			valuePercent = stepIndex * (100 / this.stepsCount);
8642
8643			if (this.dragData.stepIndex !== stepIndex) {
8644				this.dragData.stepIndex = stepIndex;
8645				this.dragData.offset = valuePercent;
8646				this.activeDragHandle.css(this.offsetProperty, this.dragData.offset + '%');
8647
8648				// update value(s) and trigger "input" event
8649				this.values[this.activeDragHandleIndex] = '' + this.stepIndexToValue(stepIndex);
8650				this.updateValues();
8651				this.realElement.trigger('input');
8652			}
8653		},
8654		onHandleRelease: function() {
8655			let newValue;
8656
8657			if (typeof this.dragData.offset === 'number') {
8658				newValue = this.stepIndexToValue(this.dragData.stepIndex);
8659				this.realElement.val(newValue).trigger('change');
8660			}
8661
8662			this.page.off({
8663				'jcf-pointermove': this.onHandleMove,
8664				'jcf-pointerup': this.onHandleRelease
8665			});
8666
8667			delete this.activeDragHandle;
8668			delete this.dragData;
8669		},
8670		onFocus: function() {
8671			if (!this.fakeElement.hasClass(this.options.focusClass)) {
8672				this.fakeElement.addClass(this.options.focusClass);
8673
8674				this.realElement.on({
8675					blur: this.onBlur,
8676					keydown: this.onKeyPress
8677				});
8678			}
8679		},
8680		onBlur: function() {
8681			this.fakeElement.removeClass(this.options.focusClass);
8682
8683			this.realElement.off({
8684				blur: this.onBlur,
8685				keydown: this.onKeyPress
8686			});
8687		},
8688		onKeyPress: function(e) {
8689			const incValue = (e.which === 38 || e.which === 39),
8690				decValue = (e.which === 37 || e.which === 40);
8691
8692			// handle TAB key in slider with multiple handles
8693			if (e.which === 9 && this.handleCount > 1) {
8694				if (e.shiftKey && this.activeDragHandleIndex > 0) {
8695					this.activeDragHandleIndex--;
8696				} else if (!e.shiftKey && this.activeDragHandleIndex < this.handleCount - 1) {
8697					this.activeDragHandleIndex++;
8698				} else {
8699					return;
8700				}
8701
8702				e.preventDefault();
8703				this.handles.removeClass(this.options.activeHandleClass).eq(this.activeDragHandleIndex).addClass(this.options.activeHandleClass);
8704			}
8705
8706			// handle cursor keys
8707			if (decValue || incValue) {
8708				e.preventDefault();
8709				this.step(incValue ? this.stepValue : -this.stepValue);
8710			}
8711		},
8712		updateValues: function() {
8713			const self = this;
8714			const value = this.values.join(',');
8715
8716			if (this.values.length > 1) {
8717				this.realElement.prop('valueLow', this.values[0]);
8718				this.realElement.prop('valueHigh', this.values[this.values.length - 1]);
8719				this.realElement.val(value);
8720
8721				if (this.realElement.attr('show-tooltip')) {
8722					this.handles.find('.tooltip-range-value').each(function(i) {
8723						jQuery(this).text(self.values[i]);
8724					});
8725				}
8726
8727				// if browser does not accept multiple values set only one
8728				if (this.realElement.val() !== value) {
8729					this.realElement.val(this.values[this.values.length - 1]);
8730				}
8731			} else {
8732				this.realElement.val(value);
8733			}
8734
8735			this.updateRanges();
8736		},
8737		updateRanges: function() {
8738			// update display ranges
8739			let self = this,
8740				handle;
8741
8742			if (this.rangeMin) {
8743				handle = this.handles[0];
8744				this.rangeMin.css(this.offsetProperty, 0).css(this.sizeProperty, handle.style[this.offsetProperty]);
8745			}
8746
8747			if (this.rangeMax) {
8748				handle = this.handles[this.handles.length - 1];
8749				this.rangeMax.css(this.offsetProperty, handle.style[this.offsetProperty]).css(this.sizeProperty, 100 - parseFloat(handle.style[this.offsetProperty]) + '%');
8750			}
8751
8752			if (this.rangeMid) {
8753				this.handles.each(function(index, curHandle) {
8754					let prevHandle, midBox;
8755
8756					if (index > 0) {
8757						prevHandle = self.handles[index - 1];
8758						midBox = self.rangeMid[index - 1];
8759						midBox.style[self.offsetProperty] = prevHandle.style[self.offsetProperty];
8760						midBox.style[self.sizeProperty] = parseFloat(curHandle.style[self.offsetProperty]) - parseFloat(prevHandle.style[self.offsetProperty]) + '%';
8761					}
8762				});
8763			}
8764
8765			if (this.realElement.attr('show-tooltip')) {
8766				this.handles.find('.tooltip-range-value').each(function(i) {
8767					jQuery(this).text(self.values[i]);
8768				});
8769			}
8770		},
8771		step: function(changeValue) {
8772			let originalValue = parseFloat(this.values[this.activeDragHandleIndex || 0]),
8773				newValue = originalValue,
8774				minValue = this.minValue,
8775				maxValue = this.maxValue;
8776
8777			if (isNaN(originalValue)) {
8778				newValue = 0;
8779			}
8780
8781			newValue += changeValue;
8782
8783			if (this.handleCount > 1) {
8784				if (this.activeDragHandleIndex > 0) {
8785					minValue = parseFloat(this.values[this.activeDragHandleIndex - 1]);
8786				}
8787
8788				if (this.activeDragHandleIndex < this.handleCount - 1) {
8789					maxValue = parseFloat(this.values[this.activeDragHandleIndex + 1]);
8790				}
8791			}
8792
8793			if (newValue > maxValue) {
8794				newValue = maxValue;
8795			} else if (newValue < minValue) {
8796				newValue = minValue;
8797			}
8798
8799			if (newValue !== originalValue) {
8800				this.values[this.activeDragHandleIndex || 0] = '' + newValue;
8801				this.updateValues();
8802				this.realElement.trigger('input').trigger('change');
8803				this.setSliderValue(this.values);
8804			}
8805		},
8806		valueToStepIndex: function(value) {
8807			return (value - this.minValue) / this.stepValue;
8808		},
8809		stepIndexToValue: function(stepIndex) {
8810			return this.minValue + this.stepValue * stepIndex;
8811		},
8812		valueToOffset: function(value) {
8813			const range = this.maxValue - this.minValue,
8814				percent = (value - this.minValue) / range;
8815
8816			return percent * 100;
8817		},
8818		getSliderValue: function() {
8819			return $.map(this.values, function(value) {
8820				return parseFloat(value) || 0;
8821			});
8822		},
8823		setSliderValue: function(values) {
8824			// set handle position accordion according to value
8825			const self = this;
8826
8827			this.handles.each(function(index, handle) {
8828				handle.style[self.offsetProperty] = self.valueToOffset(values[index]) + '%';
8829			});
8830		},
8831		refresh: function() {
8832			// handle disabled state
8833			const isDisabled = this.realElement.is(':disabled');
8834
8835			this.fakeElement.toggleClass(this.options.disabledClass, isDisabled);
8836
8837			// refresh handle position according to current value
8838			this.setSliderValue(this.getSliderValue());
8839			this.updateRanges();
8840		},
8841		destroy: function() {
8842			this.realElement.removeClass(this.options.hiddenClass).insertBefore(this.fakeElement);
8843			this.fakeElement.remove();
8844
8845			this.realElement.off({
8846				keydown: this.onKeyPress,
8847				focus: this.onFocus,
8848				blur: this.onBlur
8849			});
8850		}
8851	});
8852}(jQuery));
8853
8854/*
8855 * jQuery Open/Close plugin
8856 */
8857(function($) {
8858	function OpenClose(options) {
8859		this.options = $.extend({
8860			addClassBeforeAnimation: true,
8861			hideOnClickOutside: false,
8862			activeClass: 'active',
8863			opener: '.opener',
8864			slider: '.slide',
8865			animSpeed: 400,
8866			effect: 'fade',
8867			event: 'click'
8868		}, options);
8869
8870		this.init();
8871	}
8872
8873	OpenClose.prototype = {
8874		init: function() {
8875			if (this.options.holder) {
8876				this.findElements();
8877				this.attachEvents();
8878				this.makeCallback('onInit', this);
8879			}
8880		},
8881		findElements: function() {
8882			this.holder = $(this.options.holder);
8883			this.opener = this.holder.find(this.options.opener);
8884			this.slider = this.holder.find(this.options.slider);
8885		},
8886		attachEvents: function() {
8887			// add handler
8888			const self = this;
8889
8890			this.eventHandler = function(e) {
8891				e.preventDefault();
8892
8893				if (self.slider.hasClass(slideHiddenClass)) {
8894					self.showSlide();
8895				} else {
8896					self.hideSlide();
8897				}
8898			};
8899
8900			self.opener.on(self.options.event, this.eventHandler);
8901
8902			// hover mode handler
8903			if (self.options.event === 'hover') {
8904				self.opener.on('mouseenter', function() {
8905					if (!self.holder.hasClass(self.options.activeClass)) {
8906						self.showSlide();
8907					}
8908				});
8909
8910				self.holder.on('mouseleave', function() {
8911					self.hideSlide();
8912				});
8913			}
8914
8915			// outside click handler
8916			self.outsideClickHandler = function(e) {
8917				if (self.options.hideOnClickOutside) {
8918					const target = $(e.target);
8919
8920					if (!target.is(self.holder) && !target.closest(self.holder).length) {
8921						self.hideSlide();
8922					}
8923				}
8924			};
8925
8926			// set initial styles
8927			if (this.holder.hasClass(this.options.activeClass)) {
8928				$(document).on('click touchstart', self.outsideClickHandler);
8929			} else {
8930				this.slider.addClass(slideHiddenClass);
8931			}
8932		},
8933		showSlide: function() {
8934			const self = this;
8935
8936			if (self.options.addClassBeforeAnimation) {
8937				self.holder.addClass(self.options.activeClass);
8938			}
8939
8940			self.slider.removeClass(slideHiddenClass);
8941			$(document).on('click touchstart', self.outsideClickHandler);
8942
8943			self.makeCallback('animStart', true);
8944
8945			toggleEffects[self.options.effect].show({
8946				box: self.slider,
8947				speed: self.options.animSpeed,
8948				complete: function() {
8949					if (!self.options.addClassBeforeAnimation) {
8950						self.holder.addClass(self.options.activeClass);
8951					}
8952
8953					self.makeCallback('animEnd', true);
8954				}
8955			});
8956		},
8957		hideSlide: function() {
8958			const self = this;
8959
8960			if (self.options.addClassBeforeAnimation) {
8961				self.holder.removeClass(self.options.activeClass);
8962			}
8963
8964			$(document).off('click touchstart', self.outsideClickHandler);
8965
8966			self.makeCallback('animStart', false);
8967
8968			toggleEffects[self.options.effect].hide({
8969				box: self.slider,
8970				speed: self.options.animSpeed,
8971				complete: function() {
8972					if (!self.options.addClassBeforeAnimation) {
8973						self.holder.removeClass(self.options.activeClass);
8974					}
8975
8976					self.slider.addClass(slideHiddenClass);
8977					self.makeCallback('animEnd', false);
8978				}
8979			});
8980		},
8981		destroy: function() {
8982			this.slider.removeClass(slideHiddenClass).css({
8983				display: ''
8984			});
8985
8986			this.opener.off(this.options.event, this.eventHandler);
8987			this.holder.removeClass(this.options.activeClass).removeData('OpenClose');
8988			$(document).off('click touchstart', this.outsideClickHandler);
8989		},
8990		makeCallback: function(name) {
8991			if (typeof this.options[name] === 'function') {
8992				const args = Array.prototype.slice.call(arguments);
8993
8994				args.shift();
8995				this.options[name].apply(this, args);
8996			}
8997		}
8998	};
8999
9000	// add stylesheet for slide on DOMReady
9001	var slideHiddenClass = 'js-slide-hidden';
9002
9003	(function() {
9004		const tabStyleSheet = $('<style type="text/css">')[0];
9005		let tabStyleRule = '.' + slideHiddenClass;
9006
9007		tabStyleRule += '{position:absolute !important;left:-9999px !important;top:-9999px !important;display:block !important}';
9008
9009		if (tabStyleSheet.styleSheet) {
9010			tabStyleSheet.styleSheet.cssText = tabStyleRule;
9011		} else {
9012			tabStyleSheet.appendChild(document.createTextNode(tabStyleRule));
9013		}
9014
9015		$('head').append(tabStyleSheet);
9016	}());
9017
9018	// animation effects
9019	var toggleEffects = {
9020		slide: {
9021			show: function(o) {
9022				o.box.stop(true).hide().slideDown(o.speed, o.complete);
9023			},
9024			hide: function(o) {
9025				o.box.stop(true).slideUp(o.speed, o.complete);
9026			}
9027		},
9028		fade: {
9029			show: function(o) {
9030				o.box.stop(true).hide().fadeIn(o.speed, o.complete);
9031			},
9032			hide: function(o) {
9033				o.box.stop(true).fadeOut(o.speed, o.complete);
9034			}
9035		},
9036		none: {
9037			show: function(o) {
9038				o.box.hide().show(0, o.complete);
9039			},
9040			hide: function(o) {
9041				o.box.hide(0, o.complete);
9042			}
9043		}
9044	};
9045
9046	// jQuery plugin interface
9047	$.fn.openClose = function(opt) {
9048		const args = Array.prototype.slice.call(arguments);
9049		const method = args[0];
9050
9051		return this.each(function() {
9052			const $holder = jQuery(this);
9053			const instance = $holder.data('OpenClose');
9054
9055			if (typeof opt === 'object' || typeof opt === 'undefined') {
9056				$holder.data('OpenClose', new OpenClose($.extend({
9057					holder: this
9058				}, opt)));
9059			} else if (typeof method === 'string' && instance) {
9060				if (typeof instance[method] === 'function') {
9061					args.shift();
9062					instance[method].apply(instance, args);
9063				}
9064			}
9065		});
9066	};
9067}(jQuery));
9068
9069/*
9070* Responsive Layout helper
9071*/
9072ResponsiveHelper = (function($) {
9073	// init variables
9074	const handlers = [];
9075	let prevWinWidth;
9076	const win = $(window);
9077	let nativeMatchMedia = false;
9078
9079	// detect match media support
9080	if (window.matchMedia) {
9081		if (window.Window && window.matchMedia === Window.prototype.matchMedia) {
9082			nativeMatchMedia = true;
9083		} else if (window.matchMedia.toString().indexOf('native') > -1) {
9084			nativeMatchMedia = true;
9085		}
9086	}
9087
9088	// prepare resize handler
9089	function resizeHandler() {
9090		const winWidth = win.width();
9091
9092		if (winWidth !== prevWinWidth) {
9093			prevWinWidth = winWidth;
9094
9095			// loop through range groups
9096			$.each(handlers, function(index, rangeObject) {
9097				// disable current active area if needed
9098				$.each(rangeObject.data, function(property, item) {
9099					if (item.currentActive && !matchRange(item.range[0], item.range[1])) {
9100						item.currentActive = false;
9101
9102						if (typeof item.disableCallback === 'function') {
9103							item.disableCallback();
9104						}
9105					}
9106				});
9107
9108				// enable areas that match current width
9109				$.each(rangeObject.data, function(property, item) {
9110					if (!item.currentActive && matchRange(item.range[0], item.range[1])) {
9111						// make callback
9112						item.currentActive = true;
9113
9114						if (typeof item.enableCallback === 'function') {
9115							item.enableCallback();
9116						}
9117					}
9118				});
9119			});
9120		}
9121	}
9122
9123	win.bind('load resize orientationchange', resizeHandler);
9124
9125	// test range
9126	function matchRange(r1, r2) {
9127		let mediaQueryString = '';
9128
9129		if (r1 > 0) {
9130			mediaQueryString += '(min-width: ' + r1 + 'px)';
9131		}
9132
9133		if (r2 < Infinity) {
9134			mediaQueryString += (mediaQueryString ? ' and ' : '') + '(max-width: ' + r2 + 'px)';
9135		}
9136
9137		return matchQuery(mediaQueryString, r1, r2);
9138	}
9139
9140	// media query function
9141	function matchQuery(query, r1, r2) {
9142		if (window.matchMedia && nativeMatchMedia) {
9143			return matchMedia(query).matches;
9144		} else if (window.styleMedia) {
9145			return styleMedia.matchMedium(query);
9146		} else if (window.media) {
9147			return media.matchMedium(query);
9148		} else {
9149			return prevWinWidth >= r1 && prevWinWidth <= r2;
9150		}
9151	}
9152
9153	// range parser
9154	function parseRange(rangeStr) {
9155		const rangeData = rangeStr.split('..');
9156		const x1 = parseInt(rangeData[0], 10) || -Infinity;
9157		const x2 = parseInt(rangeData[1], 10) || Infinity;
9158
9159		return [x1, x2].sort(function(a, b) {
9160			return a - b;
9161		});
9162	}
9163
9164	// export public functions
9165	return {
9166		addRange: function(ranges) {
9167			// parse data and add items to collection
9168			const result = {
9169				data: {}
9170			};
9171
9172			$.each(ranges, function(property, data) {
9173				result.data[property] = {
9174					range: parseRange(property),
9175					enableCallback: data.on,
9176					disableCallback: data.off
9177				};
9178			});
9179
9180			handlers.push(result);
9181
9182			// call resizeHandler to recalculate all events
9183			prevWinWidth = null;
9184			resizeHandler();
9185		}
9186	};
9187}(jQuery));
9188
9189/*
9190 * jQuery form validation plugin
9191 */
9192(function($) {
9193	'use strict';
9194
9195	const FormValidation = (function() {
9196		const Validator = function($field, $fields) {
9197			this.$field = $field;
9198			this.$fields = $fields;
9199		};
9200
9201		Validator.prototype = {
9202			reg: {
9203				email: '^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$',
9204				number: '^[0-9]+$'
9205			},
9206
9207			checkField: function() {
9208				return {
9209					state: this.run(),
9210					$fields: this.$field.add(this.additionalFields)
9211				};
9212			},
9213
9214			run: function() {
9215				let fieldType;
9216
9217				switch (this.$field.get(0).tagName.toUpperCase()) {
9218					case 'SELECT':
9219						fieldType = 'select';
9220						break;
9221
9222					case 'TEXTAREA':
9223						fieldType = 'text';
9224						break;
9225
9226					default:
9227						fieldType = this.$field.data('type') || this.$field.attr('type');
9228				}
9229
9230				const functionName = 'check_' + fieldType.replace(/-/g, '_');
9231				let state = true;
9232
9233				if ($.isFunction(this[functionName])) {
9234					state = this[functionName]();
9235
9236					if (state && this.$field.data('confirm')) {
9237						state = this.check_confirm();
9238					}
9239				}
9240
9241				return state;
9242			},
9243
9244			check_email: function() {
9245				const value = this.getValue();
9246				const required = this.$field.data('required');
9247				const requiredOrValue = required || value.length;
9248
9249				if ((requiredOrValue && !this.check_regexp(value, this.reg.email))) {
9250					return false;
9251				}
9252
9253				return requiredOrValue ? true : null;
9254			},
9255
9256			check_number: function() {
9257				let value = this.getValue();
9258				const required = this.$field.data('required');
9259				const isNumber = this.check_regexp(value, this.reg.number);
9260				const requiredOrValue = required || value.length;
9261
9262				if (requiredOrValue && !isNumber) {
9263					return false;
9264				}
9265
9266				const min = this.$field.data('min');
9267				const max = this.$field.data('max');
9268
9269				value = +value;
9270
9271				if ((min && (value < min || !isNumber)) || (max && (value > max || !isNumber))) {
9272					return false;
9273				}
9274
9275				return (requiredOrValue || min || max) ? true : null;
9276			},
9277
9278			check_password: function() {
9279				return this.check_text();
9280			},
9281
9282			check_text: function() {
9283				const value = this.getValue();
9284				const required = this.$field.data('required');
9285
9286				if (this.$field.data('required') && !value.length) {
9287					return false;
9288				}
9289
9290				const min = +this.$field.data('min');
9291				const max = +this.$field.data('max');
9292
9293				if ((min && value.length < min) || (max && value.length > max)) {
9294					return false;
9295				}
9296
9297				const regExp = this.$field.data('regexp');
9298
9299				if (regExp && !this.check_regexp(value, regExp)) {
9300					return false;
9301				}
9302
9303				return (required || min || max || regExp) ? true : null;
9304			},
9305
9306			check_confirm: function() {
9307				const value = this.getValue();
9308				const $confirmFields = this.$fields.filter('[data-confirm="' + this.$field.data('confirm') + '"]');
9309				let confirmState = true;
9310
9311				for (let i = $confirmFields.length - 1; i >= 0; i--) {
9312					if ($confirmFields.eq(i).val() !== value || !value.length) {
9313						confirmState = false;
9314						break;
9315					}
9316				}
9317
9318				this.additionalFields = $confirmFields;
9319
9320				return confirmState;
9321			},
9322
9323			check_select: function() {
9324				const required = this.$field.data('required');
9325
9326				if (required && this.$field.get(0).selectedIndex === 0) {
9327					return false;
9328				}
9329
9330				return required ? true : null;
9331			},
9332
9333			check_radio: function() {
9334				const $fields = this.$fields.filter('[name="' + this.$field.attr('name') + '"]');
9335				const required = this.$field.data('required');
9336
9337				if (required && !$fields.filter(':checked').length) {
9338					return false;
9339				}
9340
9341				this.additionalFields = $fields;
9342
9343				return required ? true : null;
9344			},
9345
9346			check_checkbox: function() {
9347				const required = this.$field.data('required');
9348
9349				if (required && !this.$field.prop('checked')) {
9350					return false;
9351				}
9352
9353				return required ? true : null;
9354			},
9355
9356			check_at_least_one: function() {
9357				const $fields = this.$fields.filter('[data-name="' + this.$field.data('name') + '"]');
9358
9359				if (!$fields.filter(':checked').length) {
9360					return false;
9361				}
9362
9363				this.additionalFields = $fields;
9364
9365				return true;
9366			},
9367
9368			check_regexp: function(val, exp) {
9369				return new RegExp(exp).test(val);
9370			},
9371
9372			getValue: function() {
9373				if (this.$field.data('trim')) {
9374					this.$field.val($.trim(this.$field.val()));
9375				}
9376
9377				return this.$field.val();
9378			}
9379		};
9380
9381		const publicClass = function(form, options) {
9382			this.$form = $(form).attr('novalidate', 'novalidate');
9383			this.options = options;
9384		};
9385
9386		publicClass.prototype = {
9387			buildSelector: function(input) {
9388				return input + ':not(' + this.options.skipDefaultFields + (this.options.skipFields ? ',' + this.options.skipFields : '') + ')';
9389			},
9390
9391			init: function() {
9392				this.fieldsSelector = this.buildSelector(':input');
9393
9394				this.$form
9395					.on('submit', this.submitHandler.bind(this))
9396					.on('keyup blur', this.fieldsSelector, this.changeHandler.bind(this))
9397					.on('change', this.buildSelector('select'), this.changeHandler.bind(this))
9398					.on('focus', this.fieldsSelector, this.focusHandler.bind(this));
9399			},
9400
9401			submitHandler: function(e) {
9402				const self = this;
9403				const $fields = this.getFormFields();
9404
9405				this.getClassTarget($fields)
9406					.removeClass(this.options.errorClass + ' ' + this.options.successClass);
9407
9408				this.setFormState(true);
9409
9410				$fields.each(function(i, input) {
9411					const $field = $(input);
9412					const $classTarget = self.getClassTarget($field);
9413
9414					// continue iteration if $field has error class already
9415					if ($classTarget.hasClass(self.options.errorClass)) {
9416						return;
9417					}
9418
9419					self.setState(new Validator($field, $fields).checkField());
9420				});
9421
9422				return this.checkSuccess($fields, e);
9423			},
9424
9425			checkSuccess: function($fields, e) {
9426				const self = this;
9427
9428				const success = this.getClassTarget($fields || this.getFormFields())
9429									.filter('.' + this.options.errorClass).length === 0;
9430
9431				if (e && success && this.options.successSendClass) {
9432					e.preventDefault();
9433
9434					$.ajax({
9435						url: this.$form.removeClass(this.options.successSendClass).attr('action') || '/',
9436						type: this.$form.attr('method') || 'POST',
9437						data: this.$form.serialize() + '&action=register_user',
9438						success: function(data) {
9439							self.$form.addClass(self.options.successSendClass);
9440							self.makeCallback('onSuccess', data);
9441						},
9442						error: function(data) {
9443							self.makeCallback('onError', data);
9444						}
9445					});
9446				}
9447
9448				this.setFormState(success);
9449
9450				return success;
9451			},
9452
9453			changeHandler: function(e) {
9454				const $field = $(e.target);
9455
9456				if ($field.data('interactive')) {
9457					this.setState(new Validator($field, this.getFormFields()).checkField());
9458				}
9459
9460				this.checkSuccess();
9461			},
9462
9463			focusHandler: function(e) {
9464				const $field = $(e.target);
9465
9466				this.getClassTarget($field)
9467					.removeClass(this.options.errorClass + ' ' + this.options.successClass);
9468
9469				this.checkSuccess();
9470			},
9471
9472			setState: function(result) {
9473				this.getClassTarget(result.$fields)
9474					.toggleClass(this.options.errorClass, result.state !== null && !result.state)
9475					.toggleClass(this.options.successClass, result.state !== null && this.options.successClass && !!result.state);
9476			},
9477
9478			setFormState: function(state) {
9479				if (this.options.errorFormClass) {
9480					this.$form.toggleClass(this.options.errorFormClass, !state);
9481				}
9482			},
9483
9484			makeCallback: function(name) {
9485				if (typeof this.options[name] === 'function') {
9486					const args = Array.prototype.slice.call(arguments);
9487
9488					args.shift();
9489					this.options[name].apply(this, args);
9490				}
9491			},
9492
9493			getClassTarget: function($input) {
9494				return (this.options.addClassToParent ? $input.closest(this.options.addClassToParent) : $input);
9495			},
9496
9497			getFormFields: function() {
9498				return this.$form.find(this.fieldsSelector);
9499			}
9500		};
9501
9502		return publicClass;
9503	}());
9504
9505	$.fn.formValidation = function(options) {
9506		options = $.extend({}, {
9507			errorClass: 'input-error',
9508			successClass: '',
9509			errorFormClass: '',
9510			addClassToParent: '',
9511			skipDefaultFields: ':button, :submit, :image, :hidden, :reset',
9512			skipFields: '',
9513			successSendClass: ''
9514		}, options);
9515
9516		return this.each(function() {
9517			new FormValidation(this, options).init();
9518		});
9519	};
9520}(jQuery));
9521
9522/*
9523 * jQuery sticky box plugin
9524 */
9525(function($, $win) {
9526	'use strict';
9527
9528	function StickyScrollBlock($stickyBox, options) {
9529		this.options = options;
9530		this.$stickyBox = $stickyBox;
9531		this.init();
9532	}
9533
9534	const StickyScrollBlockPrototype = {
9535		init: function() {
9536			this.findElements();
9537			this.attachEvents();
9538			this.makeCallback('onInit');
9539		},
9540
9541		findElements: function() {
9542			// find parent container in which will be box move
9543			this.$container = this.$stickyBox.closest(this.options.container);
9544			// define box wrap flag
9545			this.isWrap = this.options.positionType === 'fixed' && this.options.setBoxHeight;
9546			// define box move flag
9547			this.moveInContainer = !!this.$container.length;
9548
9549			// wrapping box to set place in content
9550			if (this.isWrap) {
9551				this.$stickyBoxWrap = this.$stickyBox.wrap('<div class="' + this.getWrapClass() + '"/>').parent();
9552			}
9553
9554			//define block to add active class
9555			this.parentForActive = this.getParentForActive();
9556			this.isInit = true;
9557		},
9558
9559		attachEvents: function() {
9560			const self = this;
9561
9562			// bind events
9563			this.onResize = function() {
9564				if (!self.isInit) return;
9565				self.resetState();
9566				self.recalculateOffsets();
9567				self.checkStickyPermission();
9568				self.scrollHandler();
9569			};
9570
9571			this.onScroll = function() {
9572				self.scrollHandler();
9573			};
9574
9575			// initial handler call
9576			this.onResize();
9577
9578			// handle events
9579			$win.on('load resize orientationchange refreshStikyBlock', this.onResize)
9580				.on('scroll', this.onScroll);
9581		},
9582
9583		defineExtraTop: function() {
9584			// define box's extra top dimension
9585			let extraTop;
9586
9587			if (typeof this.options.extraTop === 'number') {
9588				extraTop = this.options.extraTop;
9589			} else if (typeof this.options.extraTop === 'function') {
9590				extraTop = this.options.extraTop();
9591			}
9592
9593			this.extraTop = this.options.positionType === 'absolute'
9594				? extraTop
9595				: Math.min(this.winParams.height - this.data.boxFullHeight, extraTop);
9596		},
9597
9598		checkStickyPermission: function() {
9599			// check the permission to set sticky
9600			this.isStickyEnabled = this.moveInContainer
9601				? this.data.containerOffsetTop + this.data.containerHeight > this.data.boxFullHeight + this.data.boxOffsetTop + this.options.extraBottom
9602				: true;
9603		},
9604
9605		getParentForActive: function() {
9606			if (this.isWrap) {
9607				return this.$stickyBoxWrap;
9608			}
9609
9610			if (this.$container.length) {
9611				return this.$container;
9612			}
9613
9614			return this.$stickyBox;
9615		},
9616
9617		getWrapClass: function() {
9618			// get set of container classes
9619			try {
9620				return this.$stickyBox.attr('class').split(' ').map(function(name) {
9621					return 'sticky-wrap-' + name;
9622				}).join(' ');
9623			} catch (err) {
9624				return 'sticky-wrap';
9625			}
9626		},
9627
9628		resetState: function() {
9629			// reset dimensions and state
9630			this.stickyFlag = false;
9631
9632			this.$stickyBox.css({
9633				'-webkit-transition': '',
9634				'-webkit-transform': '',
9635				transition: '',
9636				transform: '',
9637				position: '',
9638				width: '',
9639				left: '',
9640				top: ''
9641			}).removeClass(this.options.activeClass);
9642
9643			if (this.isWrap) {
9644				this.$stickyBoxWrap.removeClass(this.options.activeClass).removeAttr('style');
9645			}
9646
9647			if (this.moveInContainer) {
9648				this.$container.removeClass(this.options.activeClass);
9649			}
9650		},
9651
9652		recalculateOffsets: function() {
9653			// define box and container dimensions
9654			this.winParams = this.getWindowParams();
9655
9656			this.data = $.extend(
9657				this.getBoxOffsets(),
9658				this.getContainerOffsets()
9659			);
9660
9661			this.defineExtraTop();
9662		},
9663
9664		getBoxOffsets: function() {
9665			function offetTop(obj) {
9666				obj.top = 0;
9667
9668				return obj;
9669			}
9670
9671			const boxOffset = this.$stickyBox.css('position') === 'fixed' ? offetTop(this.$stickyBox.offset()) : this.$stickyBox.offset();
9672			const boxPosition = this.$stickyBox.position();
9673
9674			return {
9675				// sticky box offsets
9676				boxOffsetLeft: boxOffset.left,
9677				boxOffsetTop: boxOffset.top,
9678				// sticky box positions
9679				boxTopPosition: boxPosition.top,
9680				boxLeftPosition: boxPosition.left,
9681				// sticky box width/height
9682				boxFullHeight: this.$stickyBox.outerHeight(true),
9683				boxHeight: this.$stickyBox.outerHeight(),
9684				boxWidth: this.$stickyBox.outerWidth()
9685			};
9686		},
9687
9688		getContainerOffsets: function() {
9689			const containerOffset = this.moveInContainer ? this.$container.offset() : null;
9690
9691			return containerOffset ? {
9692				// container offsets
9693				containerOffsetLeft: containerOffset.left,
9694				containerOffsetTop: containerOffset.top,
9695				// container height
9696				containerHeight: this.$container.outerHeight()
9697			} : {};
9698		},
9699
9700		getWindowParams: function() {
9701			return {
9702				height: window.innerHeight || document.documentElement.clientHeight
9703			};
9704		},
9705
9706		makeCallback: function(name) {
9707			if (typeof this.options[name] === 'function') {
9708				const args = Array.prototype.slice.call(arguments);
9709
9710				args.shift();
9711				this.options[name].apply(this, args);
9712			}
9713		},
9714
9715		destroy: function() {
9716			this.isInit = false;
9717
9718			// remove event handlers and styles
9719			$win.off('load resize orientationchange', this.onResize)
9720				.off('scroll', this.onScroll);
9721
9722			this.resetState();
9723			this.$stickyBox.removeData('StickyScrollBlock');
9724
9725			if (this.isWrap) {
9726				this.$stickyBox.unwrap();
9727			}
9728
9729			this.makeCallback('onDestroy');
9730		}
9731	};
9732
9733	const stickyMethods = {
9734		fixed: {
9735			scrollHandler: function() {
9736				this.winScrollTop = $win.scrollTop();
9737
9738				const isActiveSticky = this.winScrollTop
9739					- (this.options.showAfterScrolled ? this.extraTop : 0)
9740					- (this.options.showAfterScrolled ? this.data.boxHeight + this.extraTop : 0)
9741					> this.data.boxOffsetTop - this.extraTop;
9742
9743				if (isActiveSticky) {
9744					this.isStickyEnabled && this.stickyOn();
9745				} else {
9746					this.stickyOff();
9747				}
9748			},
9749
9750			stickyOn: function() {
9751				if (!this.stickyFlag) {
9752					this.stickyFlag = true;
9753					this.parentForActive.addClass(this.options.activeClass);
9754
9755					this.$stickyBox.css({
9756						width: this.data.boxWidth,
9757						position: this.options.positionType
9758					});
9759
9760					if (this.isWrap) {
9761						this.$stickyBoxWrap.css({
9762							height: this.data.boxFullHeight
9763						});
9764					}
9765
9766					this.makeCallback('fixedOn');
9767				}
9768
9769				this.setDynamicPosition();
9770			},
9771
9772			stickyOff: function() {
9773				if (this.stickyFlag) {
9774					this.stickyFlag = false;
9775					this.resetState();
9776					this.makeCallback('fixedOff');
9777				}
9778			},
9779
9780			setDynamicPosition: function() {
9781				this.$stickyBox.css({
9782					top: this.getTopPosition(),
9783					left: this.data.boxOffsetLeft - $win.scrollLeft()
9784				});
9785			},
9786
9787			getTopPosition: function() {
9788				if (this.moveInContainer) {
9789					const currScrollTop = this.winScrollTop + this.data.boxHeight + this.options.extraBottom;
9790
9791					return Math.min(this.extraTop, (this.data.containerHeight + this.data.containerOffsetTop) - currScrollTop);
9792				} else {
9793					return this.extraTop;
9794				}
9795			}
9796		},
9797		absolute: {
9798			scrollHandler: function() {
9799				this.winScrollTop = $win.scrollTop();
9800				const isActiveSticky = this.winScrollTop > this.data.boxOffsetTop - this.extraTop;
9801
9802				if (isActiveSticky) {
9803					this.isStickyEnabled && this.stickyOn();
9804				} else {
9805					this.stickyOff();
9806				}
9807			},
9808
9809			stickyOn: function() {
9810				if (!this.stickyFlag) {
9811					this.stickyFlag = true;
9812					this.parentForActive.addClass(this.options.activeClass);
9813
9814					this.$stickyBox.css({
9815						width: this.data.boxWidth,
9816						transition: 'transform ' + this.options.animSpeed + 's ease',
9817						'-webkit-transition': 'transform ' + this.options.animSpeed + 's ease'
9818					});
9819
9820					if (this.isWrap) {
9821						this.$stickyBoxWrap.css({
9822							height: this.data.boxFullHeight
9823						});
9824					}
9825
9826					this.makeCallback('fixedOn');
9827				}
9828
9829				this.clearTimer();
9830
9831				this.timer = setTimeout(function() {
9832					this.setDynamicPosition();
9833				}.bind(this), this.options.animDelay * 1000);
9834			},
9835
9836			stickyOff: function() {
9837				if (this.stickyFlag) {
9838					this.clearTimer();
9839					this.stickyFlag = false;
9840
9841					this.timer = setTimeout(function() {
9842						this.setDynamicPosition();
9843
9844						setTimeout(function() {
9845							this.resetState();
9846						}.bind(this), this.options.animSpeed * 1000);
9847					}.bind(this), this.options.animDelay * 1000);
9848
9849					this.makeCallback('fixedOff');
9850				}
9851			},
9852
9853			clearTimer: function() {
9854				clearTimeout(this.timer);
9855			},
9856
9857			setDynamicPosition: function() {
9858				const topPosition = Math.max(0, this.getTopPosition());
9859
9860				this.$stickyBox.css({
9861					transform: 'translateY(' + topPosition + 'px)',
9862					'-webkit-transform': 'translateY(' + topPosition + 'px)'
9863				});
9864			},
9865
9866			getTopPosition: function() {
9867				const currTopPosition = this.winScrollTop - this.data.boxOffsetTop + this.extraTop;
9868
9869				if (this.moveInContainer) {
9870					const currScrollTop = this.winScrollTop + this.data.boxHeight + this.options.extraBottom;
9871					const diffOffset = Math.abs(Math.min(0, (this.data.containerHeight + this.data.containerOffsetTop) - currScrollTop - this.extraTop));
9872
9873					return currTopPosition - diffOffset;
9874				} else {
9875					return currTopPosition;
9876				}
9877			}
9878		}
9879	};
9880
9881	// jQuery plugin interface
9882	$.fn.stickyScrollBlock = function(opt) {
9883		const args = Array.prototype.slice.call(arguments);
9884		const method = args[0];
9885
9886		const options = $.extend({
9887			container: null,
9888			positionType: 'fixed', // 'fixed' or 'absolute'
9889			activeClass: 'fixed-position',
9890			setBoxHeight: true,
9891			showAfterScrolled: false,
9892			extraTop: 0,
9893			extraBottom: 0,
9894			animDelay: 0.1,
9895			animSpeed: 0.2
9896		}, opt);
9897
9898		return this.each(function() {
9899			const $stickyBox = jQuery(this);
9900			const instance = $stickyBox.data('StickyScrollBlock');
9901
9902			if (typeof opt === 'object' || typeof opt === 'undefined') {
9903				StickyScrollBlock.prototype = $.extend(stickyMethods[options.positionType], StickyScrollBlockPrototype);
9904				$stickyBox.data('StickyScrollBlock', new StickyScrollBlock($stickyBox, options));
9905			} else if (typeof method === 'string' && instance) {
9906				if (typeof instance[method] === 'function') {
9907					args.shift();
9908					instance[method].apply(instance, args);
9909				}
9910			}
9911		});
9912	};
9913
9914	// module exports
9915	window.StickyScrollBlock = StickyScrollBlock;
9916}(jQuery, jQuery(window)));
9917
9918/*
9919 * jQuery Tabs plugin
9920 */
9921(function($, $win) {
9922	'use strict';
9923
9924	function Tabset($holder, options) {
9925		this.$holder = $holder;
9926		this.options = options;
9927
9928		this.init();
9929	}
9930
9931	Tabset.prototype = {
9932		init: function() {
9933			this.$tabLinks = this.$holder.find(this.options.tabLinks);
9934
9935			this.setStartActiveIndex();
9936			this.setActiveTab();
9937
9938			if (this.options.autoHeight) {
9939				this.$tabHolder = $(this.$tabLinks.eq(0).attr(this.options.attrib)).parent();
9940			}
9941
9942			this.makeCallback('onInit', this);
9943		},
9944
9945		setStartActiveIndex: function() {
9946			const $classTargets = this.getClassTarget(this.$tabLinks);
9947			let $activeLink = $classTargets.filter('.' + this.options.activeClass);
9948			const $hashLink = this.$tabLinks.filter('[' + this.options.attrib + '="' + location.hash + '"]');
9949			let activeIndex;
9950
9951			if (this.options.checkHash && $hashLink.length) {
9952				$activeLink = $hashLink;
9953			}
9954
9955			activeIndex = $classTargets.index($activeLink);
9956
9957			this.activeTabIndex = this.prevTabIndex = (activeIndex === -1 ? (this.options.defaultTab ? 0 : null) : activeIndex);
9958		},
9959
9960		setActiveTab: function() {
9961			const self = this;
9962
9963			this.$tabLinks.each(function(i, link) {
9964				const $link = $(link);
9965				const $classTarget = self.getClassTarget($link);
9966				let $tab = $();
9967
9968				if (self.options.tabAttrib) {
9969					$tab = $('[' + self.options.tabAttrib + '="' + $link.attr(self.options.attrib) + '"]');
9970				} else {
9971					$tab = $($link.attr(self.options.attrib));
9972				}
9973
9974				if (i !== self.activeTabIndex) {
9975					$classTarget.removeClass(self.options.activeClass);
9976					$tab.addClass(self.options.tabHiddenClass).removeClass(self.options.activeClass);
9977				} else {
9978					$classTarget.addClass(self.options.activeClass);
9979					$tab.removeClass(self.options.tabHiddenClass).addClass(self.options.activeClass);
9980				}
9981
9982				self.attachTabLink($link, i);
9983			});
9984		},
9985
9986		attachTabLink: function($link, i) {
9987			const self = this;
9988
9989			$link.on(this.options.event + '.tabset', function(e) {
9990				e.preventDefault();
9991
9992				if (self.activeTabIndex === self.prevTabIndex && self.activeTabIndex !== i) {
9993					self.activeTabIndex = i;
9994					self.switchTabs();
9995				}
9996
9997				if (self.options.checkHash) {
9998					location.hash = jQuery(this).attr('href').split('#')[1];
9999				}
10000			});
10001		},
10002
10003		resizeHolder: function(height) {
10004			const self = this;
10005
10006			if (height) {
10007				this.$tabHolder.height(height);
10008
10009				setTimeout(function() {
10010					self.$tabHolder.addClass('transition');
10011				}, 10);
10012			} else {
10013				self.$tabHolder.removeClass('transition').height('');
10014			}
10015		},
10016
10017		switchTabs: function() {
10018			const self = this;
10019
10020			const $prevLink = this.$tabLinks.eq(this.prevTabIndex);
10021			const $nextLink = this.$tabLinks.eq(this.activeTabIndex);
10022
10023			const $prevTab = this.getTab($prevLink);
10024			const $nextTab = this.getTab($nextLink);
10025
10026			$prevTab.removeClass(this.options.activeClass);
10027
10028			if (self.haveTabHolder()) {
10029				this.resizeHolder($prevTab.outerHeight());
10030			}
10031
10032			setTimeout(function() {
10033				self.getClassTarget($prevLink).removeClass(self.options.activeClass);
10034
10035				$prevTab.addClass(self.options.tabHiddenClass);
10036				$nextTab.removeClass(self.options.tabHiddenClass).addClass(self.options.activeClass);
10037
10038				self.getClassTarget($nextLink).addClass(self.options.activeClass);
10039
10040				if (self.haveTabHolder()) {
10041					self.resizeHolder($nextTab.outerHeight());
10042
10043					setTimeout(function() {
10044						self.resizeHolder();
10045						self.prevTabIndex = self.activeTabIndex;
10046					}, self.options.animSpeed);
10047				} else {
10048					self.prevTabIndex = self.activeTabIndex;
10049				}
10050
10051				self.makeCallback('onChange', self);
10052			}, this.options.autoHeight ? this.options.animSpeed : 1);
10053		},
10054
10055		getClassTarget: function($link) {
10056			return this.options.addToParent ? $link.parent() : $link;
10057		},
10058
10059		getActiveTab: function() {
10060			return this.getTab(this.$tabLinks.eq(this.activeTabIndex));
10061		},
10062
10063		getTab: function($link) {
10064			if (this.options.tabAttrib) {
10065				return $('[' + this.options.tabAttrib + '="' + $link.attr(this.options.attrib) + '"]');
10066			} else {
10067				return $($link.attr(this.options.attrib));
10068			}
10069		},
10070
10071		haveTabHolder: function() {
10072			return this.$tabHolder && this.$tabHolder.length;
10073		},
10074
10075		destroy: function() {
10076			const self = this;
10077
10078			this.$tabLinks.off('.tabset').each(function() {
10079				const $link = $(this);
10080
10081				self.getClassTarget($link).removeClass(self.options.activeClass);
10082				$($link.attr(self.options.attrib)).removeClass(self.options.activeClass + ' ' + self.options.tabHiddenClass);
10083			});
10084
10085			this.$holder.removeData('Tabset');
10086		},
10087
10088		makeCallback: function(name) {
10089			if (typeof this.options[name] === 'function') {
10090				const args = Array.prototype.slice.call(arguments);
10091
10092				args.shift();
10093				this.options[name].apply(this, args);
10094			}
10095		}
10096	};
10097
10098	$.fn.tabset = function(opt) {
10099		const args = Array.prototype.slice.call(arguments);
10100		const method = args[0];
10101
10102		const options = $.extend({
10103			activeClass: 'active',
10104			addToParent: false,
10105			autoHeight: false,
10106			checkHash: false,
10107			defaultTab: true,
10108			animSpeed: 500,
10109			tabLinks: 'a',
10110			attrib: 'href',
10111			tabAttrib: null,
10112			event: 'click',
10113			tabHiddenClass: 'js-tab-hidden'
10114		}, opt);
10115
10116		options.autoHeight = options.autoHeight;
10117
10118		return this.each(function() {
10119			const $holder = jQuery(this);
10120			const instance = $holder.data('Tabset');
10121
10122			if (typeof opt === 'object' || typeof opt === 'undefined') {
10123				$holder.data('Tabset', new Tabset($holder, options));
10124			} else if (typeof method === 'string' && instance) {
10125				if (typeof instance[method] === 'function') {
10126					args.shift();
10127					instance[method].apply(instance, args);
10128				}
10129			}
10130		});
10131	};
10132}(jQuery, jQuery(window)));
10133
10134/*
10135* jQuery custom map plugin
10136*/
10137(function($) {
10138	function CustomMap(options) {
10139		this.options = {
10140			coordinates: null,
10141			mapOptions: {
10142				zoom: 16,
10143				panControl: true,
10144				zoomControl: true,
10145				scrollwheel: false,
10146				mapTypeControl: false,
10147				scaleControl: true,
10148				fullscreenControl: false,
10149				streetViewControl: false,
10150				overviewMapControl: false,
10151				rotateControl: false
10152			},
10153			...options
10154		};
10155
10156		this.init();
10157	}
10158
10159	CustomMap.prototype = {
10160		init: function() {
10161			if (!window.google || !window.google.maps) return;
10162
10163			if (this.options.holder) {
10164				this.findElements();
10165				this.attachEvents();
10166			}
10167		},
10168		findElements: function() {
10169			this.win = $(window);
10170			this.holder = $(this.options.holder);
10171			this.location = this.holder.data('coordinates');
10172			this.zoom = this.holder.data('zoom');
10173			this.markersArr = [];
10174		},
10175		attachEvents: function() {
10176			const id = Math.random().toString(36).slice(2, 11);
10177
10178			if (this.zoom) {
10179				this.options.mapOptions.zoom = this.zoom;
10180			}
10181
10182			this.mapOptions = {
10183				mapId: `map-${id}`,
10184				...this.options.mapOptions
10185			};
10186
10187			this.map = new google.maps.Map(this.holder[0], this.mapOptions);
10188			this.bounds = new google.maps.LatLngBounds();
10189
10190			$.getJSON(this.holder.data('markers'), (data) => {
10191				this.drawMarkers(data.markers);
10192			});
10193
10194			if (this.location) {
10195				const coordinate = this.location.split(',').map((c) => c.trim());
10196
10197				this.createMarker({
10198					lat: coordinate[0],
10199					lng: coordinate[1]
10200				});
10201			}
10202
10203			this.resizeHandler = () => {
10204				this.refreshMap();
10205			};
10206
10207			this.resizeHandler();
10208
10209			this.win.on('resize', this.resizeHandler);
10210		},
10211		drawMarkers: function(data) {
10212			for (let i = 0; i < data.length; i++) {
10213				this.createMarker(data[i]);
10214			}
10215
10216			this.refreshMap();
10217		},
10218		createMarker: function(item) {
10219			const coordinates = new google.maps.LatLng(item.lat, item.lng);
10220
10221			const marker = new google.maps.marker.AdvancedMarkerElement({
10222				position: coordinates,
10223				map: this.map
10224			});
10225
10226			this.markersArr.push(marker);
10227			this.bounds.extend(coordinates);
10228		},
10229		removeMarkers: function() {
10230			if (!this.markersArr.length) return;
10231
10232			for (let i = 0; i < this.markersArr.length; i++) {
10233				this.markersArr[i].setMap(null);
10234			}
10235
10236			this.markersArr.length = 0;
10237			this.bounds = new google.maps.LatLngBounds();
10238		},
10239		refreshMap: function() {
10240			google.maps.event.trigger(this.map, 'resize');
10241
10242			this.map.fitBounds(this.bounds);
10243
10244			const listener = google.maps.event.addListener(this.map, 'idle', () => {
10245				if (this.map.getZoom() > this.options.zoom) {
10246					this.map.setZoom(this.options.zoom);
10247				}
10248
10249				google.maps.event.removeListener(listener);
10250			});
10251		}
10252	};
10253
10254	$.fn.customMap = function(opt) {
10255		return this.each(function() {
10256			$(this).data('CustomMap', new CustomMap($.extend(opt, {
10257				holder: this
10258			})));
10259		});
10260	};
10261}(jQuery));
10262
10263/* video plugin */
10264(function($) {
10265	'use strict';
10266
10267	function BgVideo(options) {
10268		this.options = $.extend({
10269			containerClass: 'js-video',
10270			btnPlay: '.btn-play',
10271			btnPause: '.btn-pause',
10272			popupBtnClose: '<a href="#" class="close"></a>',
10273			loadedClass: 'video-loaded',
10274			playingClass: 'playing',
10275			pausedClass: 'paused',
10276			popupClass: 'js-video-popup',
10277			activePopupClass: 'active-popup',
10278			activePageClass: 'active-video-popup',
10279			fluidVideoClass: 'fluid-video',
10280			autoplayVideoClass: 'bg-video',
10281			vimeoAPI: '//player.vimeo.com/api/player.js',
10282			wistiaAPI: '//fast.wistia.com/assets/external/E-v1.js',
10283			youtubeAPI: '//www.youtube.com/iframe_api'
10284		}, options);
10285
10286		this.init();
10287	}
10288
10289	BgVideo.prototype = {
10290		init: function() {
10291			if (this.options.holder) {
10292				this.findElements();
10293				this.attachEvents();
10294				this.makeCallback('onInit', this);
10295			}
10296		},
10297		findElements: function() {
10298			const self = this;
10299
10300			this.win = $(window);
10301			this.page = $('body');
10302			this.holder = $(this.options.holder);
10303			this.videoContainer = null;
10304			this.player = null;
10305			this.videoData = this.holder.data('video');
10306			this.btnPlay = this.holder.find(this.options.btnPlay);
10307			this.btnPause = this.holder.find(this.options.btnPause);
10308			this.autoplay = this.videoData.autoplay === undefined ? true : this.videoData.autoplay;
10309			this.loop = this.videoData.loop === undefined ? false : this.videoData.loop;
10310			this.fluidWidth = this.videoData.fluidWidth === undefined ? false : this.videoData.fluidWidth;
10311			this.lazyLoad = this.videoData.lazyLoad === undefined ? false : this.videoData.lazyLoad;
10312			this.isPopup = this.holder.is('a');
10313			this.resizeTimer = null;
10314			this.loaded = false;
10315
10316			this.onScroll = function() {
10317				self.scrollHandler();
10318			};
10319
10320			if (this.isPopup) {
10321				this.popup = $('<div class="' + this.options.popupClass + '"/>').append($(this.options.popupBtnClose)).appendTo(this.page);
10322				this.holder = this.popup;
10323				this.btnOpen = $(this.options.holder);
10324				this.btnClose = this.popup.find('> a');
10325				this.autoplay = false;
10326			} else {
10327				if (this.autoplay) {
10328					this.holder.addClass(this.options.autoplayVideoClass);
10329				}
10330
10331				if (this.fluidWidth) {
10332					this.holder.addClass(this.options.fluidVideoClass);
10333				}
10334
10335				if (!this.lazyLoad) {
10336					this.initPlayer();
10337				} else if (!this.holder.closest('.specails-slider').length) {
10338					this.win.on('scroll', this.onScroll);
10339				}
10340			}
10341		},
10342		scrollHandler: function() {
10343			if (this.win.scrollTop() + (this.win.height() * 2) >= this.holder.offset().top && !this.loaded) {
10344				this.initPlayer();
10345				this.loaded = true;
10346				this.win.off('scroll', this.onScroll);
10347			}
10348		},
10349		initPlayer: function() {
10350			switch (this.videoData.type) {
10351				case 'youtube':
10352					this.initYoutube();
10353					break;
10354				case 'vimeo':
10355					this.initVimeo();
10356					break;
10357				case 'wistia':
10358					this.initWistia();
10359					break;
10360				case 'html5':
10361					this.initHTML5();
10362					break;
10363				default:
10364					return false;
10365			}
10366		},
10367		attachEvents: function() {
10368			const self = this;
10369
10370			this.playClickHandler = function(e) {
10371				e.preventDefault();
10372				self.playVideo();
10373			};
10374
10375			this.pauseClickHandler = function(e) {
10376				e.preventDefault();
10377				self.pauseVideo();
10378			};
10379
10380			this.openClickHandler = function(e) {
10381				e.preventDefault();
10382				self.showPopup();
10383			};
10384
10385			this.closeClickHandler = function(e) {
10386				e.preventDefault();
10387				self.hidePopup();
10388			};
10389
10390			this.resizeHandler = function() {
10391				if (self.videoContainer !== null && !self.fluidWidth) {
10392					clearTimeout(self.resizeTimer);
10393
10394					self.resizeTimer = setTimeout(function() {
10395						self.resizeVideo();
10396					}, 200);
10397				}
10398			};
10399
10400			this.holder.on('loaded.video', function() {
10401				self.resizeHandler();
10402				self.holder.addClass(self.options.loadedClass);
10403			}).on('playing.video', function() {
10404				// self.pauseAllVideos();
10405				self.holder.addClass(self.options.playingClass).removeClass(self.options.pausedClass).trigger('playingVideo');
10406				self.makeCallback('playingVideo', self);
10407			}).on('paused.video', function() {
10408				self.holder.addClass(self.options.pausedClass).trigger('pauseVideo');
10409				self.makeCallback('pauseVideo', self);
10410			}).on('ended.video', function() {
10411				self.holder.removeClass(self.options.playingClass + ' ' + self.options.pausedClass).trigger('endedVideo');
10412				self.makeCallback('endedVideo', self);
10413			});
10414
10415			if (this.isPopup) {
10416				this.btnOpen.on('click', this.openClickHandler);
10417				this.btnClose.on('click', this.closeClickHandler);
10418			}
10419
10420			this.btnPlay.on('click', this.playClickHandler);
10421			this.btnPause.on('click', this.pauseClickHandler);
10422			this.resizeHandler();
10423			this.win.on('load resize orientationchange', this.resizeHandler);
10424		},
10425		initYoutube: function() {
10426			const self = this;
10427			const container = $('<div />').addClass(this.options.containerClass).appendTo(this.holder);
10428
10429			const opt = {
10430				playlist: this.autoplay ? this.videoData.video : null,
10431				autoplay: this.autoplay || this.isPopup ? 1 : 0,
10432				loop: this.loop ? 1 : 0,
10433				controls: this.autoplay ? 0 : 1,
10434				showinfo: 0,
10435				modestbranding: 1,
10436				disablekb: 1,
10437				fs: this.autoplay ? 0 : 1,
10438				cc_load_policy: 0,
10439				iv_load_policy: 3
10440			};
10441
10442			const loadPlayer = function() {
10443				var player = new YT.Player(container[0], {
10444					videoId: self.videoData.video,
10445					playerVars: opt,
10446					events: {
10447						onReady: function() {
10448							if (self.autoplay) {
10449								player.mute();
10450							}
10451
10452							self.videoContainer = self.holder.find('iframe');
10453							self.holder.trigger('loaded.video');
10454
10455							self.player = {
10456								play: function() {
10457									player.playVideo();
10458								},
10459								pause: function() {
10460									player.pauseVideo();
10461								}
10462							};
10463						},
10464						onStateChange: function(state) {
10465							switch (state.data) {
10466								case 0:
10467									self.holder.trigger('ended.video');
10468									break;
10469								case 1:
10470									self.holder.trigger('playing.video');
10471									break;
10472								case 2:
10473									self.holder.trigger('paused.video');
10474									break;
10475								default:
10476									break;
10477							}
10478						}
10479					}
10480				});
10481			};
10482
10483			if (typeof YT === 'undefined' || typeof YT.Player === 'undefined') {
10484				const youtubeReady = window.onYouTubeIframeAPIReady;
10485
10486				window.onYouTubeIframeAPIReady = function() {
10487					if (youtubeReady) youtubeReady();
10488					loadPlayer();
10489				};
10490
10491				$.getScript(this.options.youtubeAPI);
10492			} else {
10493				loadPlayer();
10494			}
10495		},
10496		initVimeo: function() {
10497			const self = this;
10498			const blockId = this.getRandomId();
10499
10500			const opt = {
10501				id: this.videoData.video,
10502				autoplay: this.autoplay || this.isPopup,
10503				autopause: this.autoplay ? false : true,
10504				muted: this.autoplay ? true : false,
10505				loop: this.loop,
10506				controls: this.autoplay ? false : true,
10507				byline: this.autoplay ? false : true,
10508				title: this.autoplay ? false : true
10509			};
10510
10511			const loadPlayer = function() {
10512				self.holder.attr('id', blockId);
10513
10514				const player = new Vimeo.Player(blockId, opt);
10515
10516				player.ready().then(function() {
10517					self.videoContainer = self.holder.find('iframe').addClass(self.options.containerClass);
10518
10519					self.holder.trigger('loaded.video');
10520
10521					player.on('play', function() {
10522						self.holder.trigger('playing.video');
10523					});
10524
10525					player.on('pause', function() {
10526						self.holder.trigger('paused.video');
10527					});
10528
10529					player.on('ended', function() {
10530						self.holder.trigger('ended.video');
10531					});
10532
10533					self.player = {
10534						play: function() {
10535							player.play();
10536						},
10537						pause: function() {
10538							player.pause();
10539						}
10540					};
10541				});
10542			};
10543
10544			if (typeof Vimeo === 'undefined' || typeof Vimeo.Player === 'undefined') {
10545				$.getScript(this.options.vimeoAPI, loadPlayer);
10546			} else {
10547				loadPlayer();
10548			}
10549		},
10550		initWistia: function() {
10551			const self = this;
10552			const blockId = this.getRandomId();
10553
10554			const opt = {
10555				autoplay: this.isPopup ? true : this.autoplay,
10556				loop: this.loop,
10557				volume: this.autoplay ? 0 : 1,
10558				controls: this.autoplay ? (this.fluidWidth ? true : false) : true,
10559				endVideoBehavior: this.loop ? 'loop' : 'reset'
10560			};
10561
10562			const loadPlayer = function() {
10563				const src = '//fast.wistia.net/embed/iframe/' + self.videoData.video + '?controlsVisibleOnLoad=false&playbar=' + opt.controls + '&playButton=' + opt.controls + '&autoPlay=' + opt.autoplay + '&endVideoBehavior=' + opt.endVideoBehavior + '&fullscreenButton=' + opt.controls + '&smallPlayButton=false&volume=' + opt.volume + '&volumeControl=' + opt.controls;
10564
10565				self.videoContainer = $(`<iframe
10566						allowtransparency="true" id="${blockId}'"
10567						frameborder="0"
10568						scrolling="no"
10569						class="wistia_embed"
10570						name="wistia_embed"
10571						title="Video of ${(self.videoData.title || 'wistia')}"
10572						role="application"
10573						aria-label="Video of ${(self.videoData.title || 'wistia')}"
10574					/>`)
10575					.addClass(self.options.containerClass)
10576					.appendTo(self.holder)
10577					.attr('src', src);
10578
10579				window._wq = window._wq || [];
10580
10581				_wq.push({
10582					id: blockId,
10583					onReady: function(video) {
10584						self.holder.trigger('loaded.video');
10585
10586						self.player = {
10587							play: function() {
10588								video.play();
10589							},
10590							pause: function() {
10591								video.pause();
10592							},
10593							mute: function() {
10594								video.mute();
10595								video.volume(0);
10596							},
10597							unmute: function() {
10598								video.unmute();
10599								video.volume(100);
10600							}
10601						};
10602
10603						video.bind('play', function() {
10604							self.holder.trigger('playing.video');
10605						}).bind('pause', function() {
10606							self.holder.trigger('paused.video');
10607						}).bind('end', function() {
10608							self.holder.trigger('ended.video');
10609
10610							if (opt.loop) {
10611								video.play();
10612							}
10613						});
10614					}
10615				});
10616			};
10617
10618			if (typeof Wistia === 'undefined') {
10619				$.getScript(this.options.wistiaAPI, loadPlayer);
10620			} else {
10621				loadPlayer();
10622			}
10623		},
10624		initHTML5: function() {
10625			const self = this;
10626
10627			const opt = {
10628				controls: this.autoplay ? '' : 'controls',
10629				autoplay: this.isPopup ? 'autoplay playsinline' : this.autoplay ? 'autoplay playsinline muted' : '',
10630				loop: this.loop ? 'loop' : ''
10631			};
10632
10633			this.videoContainer = $(`<video ${opt.controls} ${opt.autoplay} ${opt.loop} />`).addClass(this.options.containerClass).appendTo(this.holder);
10634
10635			this.videoContainer[0].addEventListener('loadeddata', function() {
10636				self.holder.trigger('loaded.video');
10637			}, false);
10638
10639			this.videoContainer[0].addEventListener('progress', function() {
10640				self.holder.trigger('loaded.video');
10641			}, false);
10642
10643			this.videoContainer.prop('src', this.videoData.video);
10644
10645			this.videoContainer.on('play', function() {
10646				self.holder.trigger('playing.video');
10647			}).on('pause', function() {
10648				self.holder.trigger('paused.video');
10649			}).on('ended', function() {
10650				self.holder.trigger('ended.video');
10651			});
10652
10653			self.player = {
10654				play: function() {
10655					self.videoContainer[0].play();
10656				},
10657				pause: function() {
10658					self.videoContainer[0].pause();
10659				}
10660			};
10661		},
10662		pauseAllVideos: function() {
10663			if (this.autoplay && this.videoData.type === 'html5') {
10664				return;
10665			}
10666
10667			$('[data-video].' + this.options.playingClass).not(this.holder).not('.' + this.options.autoplayVideoClass).each(function() {
10668				const holder = $(this);
10669
10670				holder.data('BgVideo').player.pause();
10671			});
10672		},
10673		getDimensions: function(data) {
10674			const ratio = data.videoRatio || (data.videoWidth / data.videoHeight);
10675			let slideWidth = data.maskWidth;
10676			let slideHeight = slideWidth / ratio;
10677
10678			if (slideHeight < data.maskHeight) {
10679				slideHeight = data.maskHeight;
10680				slideWidth = slideHeight * ratio;
10681			}
10682
10683			return {
10684				width: slideWidth,
10685				height: slideHeight,
10686				top: (data.maskHeight - slideHeight) / 2,
10687				left: (data.maskWidth - slideWidth) / 2
10688			};
10689		},
10690		getRatio: function() {
10691			if (this.videoContainer.attr('width') && this.videoContainer.attr('height')) {
10692				return this.videoContainer.attr('width') / this.videoContainer.attr('height');
10693			} else {
10694				return 16 / 9;
10695			}
10696		},
10697		resizeVideo: function() {
10698			const styles = this.getDimensions({
10699				videoRatio: this.getRatio(this.videoContainer),
10700				maskWidth: this.holder.width(),
10701				maskHeight: this.holder.height()
10702			});
10703
10704			this.videoContainer.css({
10705				width: styles.width,
10706				height: styles.height,
10707				marginTop: styles.top,
10708				marginLeft: styles.left
10709			});
10710		},
10711		playVideo: function() {
10712			if (!this.holder.hasClass(this.options.loadedClass)) return;
10713
10714			if (!this.holder.hasClass(this.options.playingClass) || this.holder.hasClass(this.options.pausedClass)) {
10715				this.player.play();
10716				this.holder.blur();
10717			} else {
10718				if (!this.btnPause.length) {
10719					this.player.pause();
10720				}
10721			}
10722		},
10723		pauseVideo: function() {
10724			this.player.pause();
10725		},
10726		showPopup: function() {
10727			const self = this;
10728
10729			if (this.holder.hasClass(this.options.loadedClass)) {
10730				setTimeout(function() {
10731					self.player.play();
10732				}, 500);
10733			} else {
10734				this.initPlayer();
10735			}
10736
10737			this.page.addClass(this.options.activePageClass);
10738			this.popup.addClass(this.options.activePopupClass);
10739		},
10740		hidePopup: function() {
10741			if (this.player) {
10742				this.player.pause();
10743			}
10744
10745			this.page.removeClass(this.options.activePageClass);
10746			this.popup.removeClass(this.options.activePopupClass);
10747		},
10748		getRandomId: function() {
10749			const s4 = function() {
10750				return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
10751			};
10752
10753			return (s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4());
10754		},
10755		makeCallback: function(name) {
10756			if (typeof this.options[name] === 'function') {
10757				const args = Array.prototype.slice.call(arguments);
10758
10759				args.shift();
10760				this.options[name].apply(this, args);
10761			}
10762		},
10763		destroy: function() {
10764			this.videoContainer.remove();
10765			this.btnPlay.off('click', this.playClickHandler);
10766			this.btnPause.off('click', this.pauseClickHandler);
10767			this.win.off('load resize orientationchange', this.resizeHandler);
10768
10769			if (this.isPopup) {
10770				this.popup.remove();
10771				this.btnOpen.off('click', this.openClickHandler);
10772				this.btnClose.off('click', this.closeClickHandler);
10773			}
10774
10775			this.holder.removeClass(this.options.loadedClass + ' ' + this.options.playingClass).off('.video').removeData('BgVideo');
10776		}
10777	};
10778
10779	$.fn.bgVideo = function(opt) {
10780		return this.each(function() {
10781			$(this).data('BgVideo', new BgVideo($.extend(opt, {
10782				holder: this
10783			})));
10784		});
10785	};
10786})(jQuery);
10787
10788// Remove Empty Items
10789function initRemoveEmptyItems() {
10790	jQuery('.js-is-empty-parent').each(function() {
10791		const holder = jQuery(this);
10792		const wrapper = holder.closest('.showWidget');
10793		const items = holder.find('ul li');
10794		const opener = wrapper.find('span.showWidget');
10795
10796		items.each(function() {
10797			const item = jQuery(this);
10798			const textElem = item.find('.js-is-empty');
10799
10800			if (textElem.text().trim() === '') {
10801				item.remove();
10802			}
10803		});
10804
10805		if (!holder.find('ul li').length && opener.length) {
10806			opener.remove();
10807		}
10808	});
10809}
10810
10811// Tax Modal
10812function initTaxModal() {
10813	jQuery('#popUpDetails').on('show.bs.modal', function(event) {
10814		const button = jQuery(event.relatedTarget);
10815		let content = button.attr('data-content');
10816		const modal = jQuery(this);
10817		const textElement = modal.find('#popUpDetailsText');
10818
10819		try {
10820			content = JSON.parse(content);
10821		} catch (e) {
10822
10823		}
10824
10825		textElement.html(content);
10826	});
10827}
10828
10829// Autocomplete init
10830function initAutocomplete() {
10831	const filteringSection = jQuery('.filter-section');
10832	const filteringModal = jQuery('#filterSchedule');
10833	const filteringAPI = filteringSection.data('FilteringProducts');
10834
10835	if (!filteringAPI) return;
10836
10837	jQuery('.search-panel .search-row').each(function() {
10838		const holder = jQuery(this);
10839		const searchLinkNew = holder.find('.search-link-new');
10840		const searchLinkUsed = holder.find('.search-link-used');
10841		const newItemURL = searchLinkNew.attr('href');
10842		const usedItemURL = searchLinkUsed.attr('href');
10843		const searchText = holder.find('.search-text');
10844
10845		holder.autocomplete({
10846			inputField: '[type="search"]',
10847			dataAttr: 'search',
10848			dataType: 'json',
10849			highlightMatches: true,
10850			showOnFocus: true,
10851			filterResults: false,
10852			alwaysRefresh: true,
10853			noResultClass: 'no-results',
10854			listItems: 'li',
10855			onKeyup: function(value) {
10856				/**
10857				 * Updates search URL for new and used cars into autocomplete box
10858				 * @param {jQuery} searchText - element that contains text to be updated
10859				 * @param {jQuery} searchLinkNew - element that contains link to new cars page
10860				 * @param {jQuery} searchLinkUsed - element that contains link to used cars page
10861				 * @param {string} newItemURL - URL of new cars page
10862				 * @param {string} usedItemURL - URL of used cars page
10863				 * @param {string} value - search query
10864				 */
10865				updateSearchURL(searchText, searchLinkNew, searchLinkUsed, newItemURL, usedItemURL, value);
10866			},
10867			onLoadData: function(data) {
10868				const { isNewResults, isUsedResults } = data;
10869
10870				if (!isNewResults) {
10871					searchLinkNew.hide();
10872				} else {
10873					searchLinkNew.show();
10874				}
10875
10876				if (!isUsedResults) {
10877					searchLinkUsed.hide();
10878				} else {
10879					searchLinkUsed.show();
10880				}
10881			},
10882			parseData: function(data) {
10883				return createAutocompleteItems(this, data);
10884			},
10885			onSelectedItem: function(item) {
10886				const searchFilters = item.data('search');
10887
10888				if (!searchFilters) return;
10889
10890				// Reset the form
10891				filteringAPI.resetForm();
10892
10893				// Update the search filters
10894				Object.entries(searchFilters).forEach(([filterName, filterValue]) => {
10895					const name = filterName.toLowerCase();
10896
10897					// If filterName is 'vin' or 'stock' then we need to trigger search
10898					if (name === 'vin' || name === 'stock') {
10899						this.input.val(filterValue);
10900
10901						setTimeout(() => {
10902							// Trigger search event
10903							this.input.trigger('onSearch');
10904							// Update the history
10905							filteringAPI.updateHistory(this.input);
10906							// Clear the input after search
10907							this.input.val('');
10908						}, 100);
10909					} else {
10910						// Select the needed checkboxes
10911						const checkboxes = filteringModal.find(`input[type="checkbox"][name="${filterName}"]`);
10912
10913						checkboxes.each((i, item) => {
10914							const checkbox = jQuery(item);
10915
10916							if (checkbox.val().toLowerCase() === filterValue.toLowerCase()) {
10917								checkbox.prop('checked', true);
10918
10919								filteringAPI.updateFilterStates(checkbox);
10920							}
10921						});
10922					}
10923				});
10924
10925				// Filter the products
10926				filteringAPI.filter();
10927			}
10928		});
10929	});
10930}
10931
10932/**
10933 * Updates search URL for new and used cars into autocomplete box
10934 * @param {jQuery} searchText - element that contains text to be updated
10935 * @param {jQuery} searchLinkNew - element that contains link to new cars page
10936 * @param {jQuery} searchLinkUsed - element that contains link to used cars page
10937 * @param {string} newItemURL - URL of new cars page
10938 * @param {string} usedItemURL - URL of used cars page
10939 * @param {string} value - search query
10940 */
10941function updateSearchURL(searchText, searchLinkNew, searchLinkUsed, newItemURL, usedItemURL, value) {
10942	if (searchText.length) {
10943		searchText.text(value);
10944	}
10945
10946	if (value !== '') {
10947		if (searchLinkNew.length) {
10948			searchLinkNew.attr('href', newItemURL + ((newItemURL.indexOf('?') !== -1 ? '&' : '?') + 'search=' + value));
10949		}
10950
10951		if (searchLinkUsed.length) {
10952			searchLinkUsed.attr('href', usedItemURL + ((newItemURL.indexOf('?') !== -1 ? '&' : '?') + 'search=' + value));
10953		}
10954	} else {
10955		if (searchLinkNew.length) {
10956			searchLinkNew.attr('href', newItemURL);
10957		}
10958
10959		if (searchLinkUsed.length) {
10960			searchLinkUsed.attr('href', usedItemURL);
10961		}
10962	}
10963}
10964
10965/**
10966 * Creates a list of autocomplete suggestions based on the response from the server
10967 * @param {Object} self - the autocomplete instance
10968 * @param {Object} data - the response from the server
10969 * @return {String} - the HTML of the autocomplete list
10970 */
10971function createAutocompleteItems(self, data) {
10972	const {suggestions} = data;
10973	const searchData = jQuery('<div></div>');
10974	const value = self.input.val();
10975
10976	// If no suggestions are found, display an error message
10977	if (!suggestions.length && value !== '') {
10978		self.form.addClass(self.options.noResultClass);
10979
10980		return `<span class="error-message">Sorry, we couldn't find results matching "${value}".</span>`;
10981	} else {
10982		self.form.removeClass(self.options.noResultClass);
10983	}
10984
10985	const uniqueSuggestions = Array.from(
10986		new Map(suggestions.map(item => [JSON.stringify(item), item])).values()
10987	);
10988
10989	// Create a list of suggestions
10990	for (const key in uniqueSuggestions) {
10991		const searchText = uniqueSuggestions[key].suggestion;
10992		const search = JSON.stringify(uniqueSuggestions[key].facetInfo);
10993		const url = uniqueSuggestions[key].link;
10994
10995		if (searchText !== '') {
10996			jQuery(`<li data-search='${search}' data-url='${url}'><a href="#">${searchText}</a></li>`).appendTo(searchData);
10997		}
10998	}
10999
11000	return searchData.html();
11001}
11002
11003/*
11004 * Google Reviews module
11005 */
11006class GoogleReviews {
11007	constructor(holder, options = {}) {
11008		this.options = {
11009			placeId: holder?.dataset.googleReviewsPlaceId,
11010			style: holder?.dataset.googleReviewsStyle || 'list',
11011			keywordFilter: holder?.dataset.googleReviewsKeywordFilter || '',
11012			slidesPerView: parseInt(holder?.dataset.googleReviewsSlides, 10) || 6,
11013			minCount: parseInt(holder?.dataset.googleReviewsMinCount, 10) || 0,
11014			restUrl: window.ajax?.google_reviews_rest,
11015			loadingClass: 'is-loading',
11016			errorClass: 'has-error',
11017			...options,
11018		};
11019
11020		if (!holder) return;
11021
11022		this.holder = holder;
11023
11024		this.init();
11025	}
11026
11027	init() {
11028		this.ratingElement = this.holder.querySelector('[data-google-reviews-rating]');
11029		this.countElement = this.holder.querySelector('[data-google-reviews-count]');
11030		this.starsElement = this.holder.querySelector('[data-google-reviews-stars]');
11031		this.ctaElement = this.holder.querySelector('[data-google-reviews-cta]');
11032		this.listElement = this.holder.querySelector('[data-google-reviews-list]');
11033		this.moreReviewsElement = this.holder.querySelector('[data-more-reviews-link]');
11034		this.loadMoreHolderElement = this.holder.querySelector('[data-load-more-holder]');
11035		this.reviews = [];
11036		this.nextPageToken = '';
11037
11038		// Slider "Read more" opens a modal with the full, untruncated review list
11039		// instead of expanding the text inline (see data-google-reviews-modal).
11040		this.modalElement = this.holder.dataset.googleReviewsModal
11041			? document.querySelector(this.holder.dataset.googleReviewsModal)
11042			: null;
11043
11044		if (this.modalElement) {
11045			this.modalRatingElement = this.modalElement.querySelector('[data-google-reviews-rating]');
11046			this.modalCountElement = this.modalElement.querySelector('[data-google-reviews-count]');
11047			this.modalStarsElement = this.modalElement.querySelector('[data-google-reviews-stars]');
11048			this.modalListElement = this.modalElement.querySelector('[data-google-reviews-list]');
11049		}
11050
11051		this.holder.classList.add(this.options.loadingClass);
11052		this.holder.classList.remove(this.options.errorClass);
11053
11054		this.bindEvents();
11055		this.loadReviews();
11056	}
11057
11058	bindEvents() {
11059		if (this.moreReviewsElement) {
11060			this.moreReviewsElement.addEventListener('click', (event) => {
11061				// Business Profile connection: fetch the next page in place.
11062				// Places API fallback: let the default navigation to Google happen.
11063				if (this.nextPageToken) {
11064					event.preventDefault();
11065					this.handleLoadMore();
11066				}
11067			});
11068		}
11069	}
11070
11071	async fetchReviews(pageToken = '') {
11072		if (!this.options.restUrl) {
11073			throw new Error('Google Reviews REST endpoint is not configured.');
11074		}
11075
11076		if (!this.options.placeId) {
11077			throw new Error('Google Reviews: missing Place ID.');
11078		}
11079
11080		const params = new URLSearchParams({ place_id: this.options.placeId });
11081		if (pageToken) {
11082			params.set('page_token', pageToken);
11083		}
11084		if (this.options.keywordFilter) {
11085			params.set('keyword', this.options.keywordFilter);
11086		}
11087		if (!pageToken && this.options.minCount) {
11088			params.set('min_count', this.options.minCount);
11089		}
11090
11091		const response = await fetch(`${this.options.restUrl}?${params.toString()}`, {
11092			headers: { Accept: 'application/json' },
11093		});
11094		const data = await response.json();
11095
11096		if (!response.ok || data.error) {
11097			throw new Error(data.error || `Request failed with status ${response.status}`);
11098		}
11099
11100		return data;
11101	}
11102
11103	async loadReviews() {
11104		try {
11105			this.compileTemplates();
11106
11107			const data = await this.fetchReviews();
11108
11109			this.render(data);
11110		} catch (error) {
11111			console.error('GoogleReviews:', error);
11112			this.holder.classList.add(this.options.errorClass);
11113			this.renderFallback();
11114		} finally {
11115			this.holder.classList.remove(this.options.loadingClass);
11116		}
11117	}
11118
11119	async handleLoadMore() {
11120		if (!this.moreReviewsElement) return;
11121
11122		try {
11123			const data = await this.fetchReviews(this.nextPageToken);
11124			const newReviews = (data.reviews ?? []).map((review) => this.normalizeReview(review));
11125
11126			this.reviews = this.reviews.concat(newReviews);
11127			this.nextPageToken = data.next_page_token ?? '';
11128
11129			if (this.listElement && newReviews.length) {
11130				this.listElement.insertAdjacentHTML('beforeend', this.reviewsTemplate({ reviews: newReviews }));
11131			}
11132
11133			this.initSlider();
11134			this.setupReadMore();
11135
11136			if (this.loadMoreHolderElement) {
11137				this.loadMoreHolderElement.hidden = !newReviews.length || !this.nextPageToken;
11138			}
11139
11140			this.makeCallback('onRender', newReviews);
11141		} catch (error) {
11142			console.error('GoogleReviews:', error);
11143		}
11144	}
11145
11146	renderFallback() {
11147		if (this.moreReviewsElement && this.options.placeId) {
11148			this.moreReviewsElement.href = `https://search.google.com/local/reviews?placeid=${this.options.placeId}`;
11149		}
11150
11151		if (this.loadMoreHolderElement) {
11152			this.loadMoreHolderElement.hidden = !this.options.placeId;
11153		}
11154
11155		if (this.listElement) {
11156			this.listElement.innerHTML = '<p>Reviews are temporarily unavailable. See them on Google.</p>';
11157		}
11158	}
11159
11160	compileTemplates() {
11161		const template = this.holder.querySelector('[data-google-reviews-template="reviews"]');
11162
11163		this.reviewsTemplate = Handlebars.compile(template.textContent);
11164
11165		const modalTemplate = this.holder.querySelector('[data-google-reviews-template="modal-reviews"]');
11166
11167		if (modalTemplate) {
11168			this.modalReviewsTemplate = Handlebars.compile(modalTemplate.textContent);
11169		}
11170	}
11171
11172	normalizeReview(review) {
11173		return {
11174			rating: review.rating ?? 0,
11175			stars: this.renderStars(review.rating),
11176			text: review.text ?? '',
11177			relativePublishTimeDescription: review.relativePublishTimeDescription ?? '',
11178			publishTime: this.formatPublishTime(review.publishTime),
11179			googleMapsURI: review.googleMapsURI ?? '',
11180			authorAttribution: {
11181				displayName: review.authorAttribution?.displayName ?? 'Google user',
11182				photoURI: review.authorAttribution?.photoURI || 'images/review-avatar.png',
11183			},
11184		};
11185	}
11186
11187	formatPublishTime(publishTime) {
11188		if (!publishTime) return '';
11189
11190		const date = new Date(publishTime);
11191
11192		if (Number.isNaN(date.getTime())) return '';
11193
11194		return new Intl.DateTimeFormat('en-US', {
11195			month: 'long',
11196			day: 'numeric',
11197			year: 'numeric',
11198			hour: 'numeric',
11199			minute: '2-digit',
11200			hour12: true,
11201			timeZoneName: 'shortOffset',
11202		}).format(date);
11203	}
11204
11205	formatRating(rating) {
11206		const num = Number(rating);
11207		return Number.isFinite(num) ? num.toFixed(1) : '';
11208	}
11209
11210	renderStars(rating = 0) {
11211		const starsCount = 5;
11212		const normalizedRating = Math.max(0, Math.min(starsCount, Number(rating) || 0));
11213		const fill = (normalizedRating / starsCount) * 100;
11214		const stars = `<svg viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6.82617 11.442L3.54617 13.166C3.46353 13.2093 3.3704 13.2287 3.27732 13.2219C3.18425 13.2151 3.09494 13.1824 3.0195 13.1274C2.94406 13.0725 2.8855 12.9975 2.85045 12.911C2.8154 12.8245 2.80526 12.7299 2.82117 12.638L3.44817 8.98798C3.46192 8.908 3.456 8.82587 3.43091 8.74869C3.40582 8.67151 3.36232 8.6016 3.30417 8.54499L0.650168 5.95899C0.583317 5.89388 0.53602 5.81136 0.51363 5.72076C0.491239 5.63017 0.494647 5.53512 0.52347 5.44637C0.552292 5.35761 0.605378 5.27869 0.676721 5.21854C0.748065 5.15838 0.834818 5.1194 0.927168 5.10599L4.59317 4.57299C4.67344 4.56146 4.7497 4.53059 4.81537 4.48303C4.88105 4.43547 4.93418 4.37265 4.97017 4.29999L6.61017 0.977985C6.65153 0.894518 6.7154 0.824266 6.79455 0.775151C6.87371 0.726037 6.96501 0.700012 7.05817 0.700012C7.15132 0.700012 7.24263 0.726037 7.32178 0.775151C7.40094 0.824266 7.4648 0.894518 7.50617 0.977985L9.14717 4.29899C9.18307 4.37152 9.23604 4.43426 9.30153 4.48182C9.36702 4.52937 9.44308 4.56031 9.52317 4.57199L13.1892 5.10499C13.2815 5.1184 13.3683 5.15738 13.4396 5.21754C13.511 5.27769 13.564 5.35661 13.5929 5.44537C13.6217 5.53412 13.6251 5.62917 13.6027 5.71976C13.5803 5.81036 13.533 5.89288 13.4662 5.95798L10.8132 8.54398C10.7552 8.60049 10.7118 8.67024 10.6867 8.74723C10.6616 8.82422 10.6556 8.90616 10.6692 8.98598L11.2962 12.637C11.3122 12.7291 11.3021 12.8238 11.267 12.9105C11.232 12.9971 11.1733 13.0722 11.0977 13.1272C11.0221 13.1822 10.9326 13.2149 10.8393 13.2215C10.7461 13.2282 10.6528 13.2086 10.5702 13.165L7.29117 11.441C7.21946 11.4033 7.13967 11.3836 7.05867 11.3836C6.97767 11.3836 6.89788 11.4033 6.82617 11.441V11.442Z" fill="none"></path></svg>`.repeat(starsCount);
11215
11216		return `
11217			<span class="google-reviews__stars-row" role="img" aria-label="${normalizedRating} out of ${starsCount} stars" style="--fill: ${fill}%">
11218				<span class="google-reviews__stars-bg" aria-hidden="true">${stars}</span>
11219				<span class="google-reviews__stars-fg" aria-hidden="true">${stars}</span>
11220			</span>
11221		`;
11222	}
11223
11224	render(data) {
11225		this.reviews = (data.reviews ?? []).map((review) => this.normalizeReview(review));
11226
11227		if (this.ratingElement) {
11228			this.ratingElement.textContent = this.formatRating(data.average_rating);
11229		}
11230
11231		if (this.countElement) {
11232			this.countElement.textContent = data.total_review_count ? `(${data.total_review_count.toLocaleString()})` : '';
11233		}
11234
11235		if (this.starsElement) {
11236			this.starsElement.innerHTML = this.renderStars(data.average_rating);
11237		}
11238
11239		if (this.ctaElement && this.options.placeId) {
11240			this.ctaElement.href = `https://search.google.com/local/writereview?placeid=${this.options.placeId}`;
11241		}
11242
11243		this.nextPageToken = data.next_page_token ?? '';
11244
11245		if (this.moreReviewsElement) {
11246			if (this.nextPageToken) {
11247				// Business Profile connection: real pagination, fetched in place.
11248				this.moreReviewsElement.removeAttribute('href');
11249				this.moreReviewsElement.removeAttribute('target');
11250				this.moreReviewsElement.textContent = 'Load More';
11251			} else if (this.options.placeId) {
11252				// Places API fallback: Google caps this at 5 reviews with no
11253				// pagination — link out to the place's full review list instead.
11254				this.moreReviewsElement.href = `https://search.google.com/local/reviews?placeid=${this.options.placeId}`;
11255				this.moreReviewsElement.setAttribute('target', '_blank');
11256				this.moreReviewsElement.textContent = 'Show More Reviews';
11257			}
11258		}
11259
11260		if (this.loadMoreHolderElement) {
11261			this.loadMoreHolderElement.hidden = !this.reviews.length || (!this.nextPageToken && !this.options.placeId);
11262		}
11263
11264		if (this.listElement) {
11265			this.listElement.innerHTML = this.reviewsTemplate({ reviews: this.reviews });
11266		}
11267
11268		if (this.modalRatingElement) {
11269			this.modalRatingElement.textContent = this.formatRating(data.average_rating);
11270		}
11271
11272		if (this.modalCountElement) {
11273			this.modalCountElement.textContent = data.total_review_count ? `(${data.total_review_count.toLocaleString()})` : '';
11274		}
11275
11276		if (this.modalStarsElement) {
11277			this.modalStarsElement.innerHTML = this.renderStars(data.average_rating);
11278		}
11279
11280		if (this.modalListElement && this.modalReviewsTemplate) {
11281			this.modalListElement.innerHTML = this.modalReviewsTemplate({ reviews: this.reviews });
11282		}
11283
11284		this.initSlider();
11285		this.setupReadMore();
11286
11287		this.makeCallback('onRender', this.reviews);
11288	}
11289
11290	setupReadMore() {
11291		if (!this.listElement) return;
11292
11293		this.listElement.querySelectorAll('.review-item__text').forEach((textElement) => {
11294			const button = textElement.nextElementSibling;
11295
11296			if (!button || !button.classList.contains('review-item__read-more')) return;
11297
11298			button.hidden = textElement.scrollHeight <= textElement.clientHeight + 1;
11299
11300			// Bootstrap's data-api already opens the modal on click for these.
11301			if (button.dataset.toggle === 'modal') return;
11302
11303			if (button.dataset.bound) return;
11304			button.dataset.bound = '1';
11305
11306			button.addEventListener('click', () => {
11307				const expanded = textElement.classList.toggle('is-expanded');
11308
11309				button.textContent = expanded
11310					? this.options.readLessLabel || 'Read less'
11311					: this.options.readMoreLabel || 'Read more';
11312			});
11313		});
11314	}
11315
11316	initSlider() {
11317		if (this.options.style !== 'slider' || !this.listElement || !window.jQuery) return;
11318
11319		const $list = window.jQuery(this.listElement);
11320
11321		if ($list.hasClass('slick-initialized')) {
11322			$list.slick('unslick');
11323		}
11324
11325		if (!this.reviews.length) return;
11326
11327		const slidesToShow = Math.max(1, this.options.slidesPerView || 6);
11328
11329		$list.slick({
11330			slidesToScroll: 1,
11331			rows: 0,
11332			slidesToShow,
11333			prevArrow: '<button class="slick-prev slick-arrow" aria-label="Previous"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" height="24px" viewBox="0 -960 960 960" width="24px" fill="#fff"><path d="m432-480 156 156q11 11 11 28t-11 28q-11 11-28 11t-28-11L348-452q-6-6-8.5-13t-2.5-15q0-8 2.5-15t8.5-13l184-184q11-11 28-11t28 11q11 11 11 28t-11 28L432-480Z"/></svg></button>',
11334			nextArrow: '<button class="slick-next slick-arrow" aria-label="Next"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" height="24px" viewBox="0 -960 960 960" width="24px" fill="#fff">
11334<path d="M504-480 348-636q-11-11-11-28t11-28q11-11 28-11t28 11l184 184q6 6 8.5 13t2.5 15q0 8-2.5 15t-8.5 13L404-268q-11 11-28 11t-28-11q-11-11-11-28t11-28l156-156Z"/></svg></button>',
11335			responsive: [{
11336				breakpoint: 1570,
11337				settings: {
11338					slidesToShow: Math.min(slidesToShow, 5)
11339				}
11340			}, {
11341				breakpoint: 1310,
11342				settings: {
11343					slidesToShow: Math.min(slidesToShow, 4)
11344				}
11345			}, {
11346				breakpoint: 1050,
11347				settings: {
11348					slidesToShow: Math.min(slidesToShow, 3)
11349				}
11350			}, {
11351				breakpoint: 576,
11352				settings: {
11353					slidesToShow: 1
11354				}
11355			}]
11356		});
11357	}
11358
11359	makeCallback(callbackName, ...args) {
11360		if (typeof this.options[callbackName] === 'function') {
11361			this.options[callbackName].apply(this, args);
11362		}
11363	}
11364}
11365
11366/*
11367 * SearchModal module
11368 */
11369class SearchModal {
11370	constructor(holder, options = {}) {
11371		this.options = {
11372			modalSelector: '#searchModal',
11373			backdropSelector: '[data-search-modal-close]',
11374			inputSelector: '.search-modal__input',
11375			resultsSelector: '[data-search-modal-results]',
11376			emptySelector: '[data-search-modal-empty]',
11377			itemTemplateSelector: '#search-modal-item-template',
11378			viewAllTemplateSelector: '#search-modal-view-all-template',
11379			searchFields: ['year', 'make', 'model', 'trim', 'drivetrain', 'body_style'],
11380			lockClass: 'search-modal-open',
11381			loadingClass: 'loading',
11382			activeClass: 'active',
11383			maxItems: 20,
11384			imageTimeout: 5000,
11385			...options,
11386		};
11387
11388		if (!holder) return;
11389
11390		this.holder = holder;
11391		this.data = [];
11392		this.renderToken = 0;
11393
11394		this.init();
11395	}
11396
11397	init() {
11398		this.modal = document.querySelector(this.options.modalSelector);
11399
11400		if (!this.modal) return;
11401
11402		this.backdrop = this.modal.querySelector(this.options.backdropSelector);
11403		this.input = this.modal.querySelector(this.options.inputSelector);
11404		this.results = this.modal.querySelector(this.options.resultsSelector);
11405		this.empty = this.modal.querySelector(this.options.emptySelector);
11406		this.dataUrl = this.modal.dataset.searchUrl || window.ajax?.vehicles_feed_rest;
11407		this.itemTemplate = this.compileTemplate(this.options.itemTemplateSelector);
11408		this.viewAllTemplate = this.compileTemplate(this.options.viewAllTemplateSelector);
11409
11410		this.bindEvents();
11411		this.loadData();
11412	}
11413
11414	bindEvents() {
11415		this.holder.addEventListener('click', () => {
11416			this.toggleModal();
11417		});
11418
11419		this.backdrop?.addEventListener('click', () => {
11420			this.closeModal();
11421		});
11422
11423		this.input?.addEventListener('input', this.debounce(this.handleSearch, 250));
11424
11425		document.addEventListener('keydown', (event) => {
11426			if (event.key === 'Escape') {
11427				this.closeModal();
11428			}
11429		});
11430	}
11431
11432	compileTemplate(selector) {
11433		const source = document.querySelector(selector);
11434
11435		return source ? Handlebars.compile(source.innerHTML) : null;
11436	}
11437
11438	async loadData() {
11439		if (!this.dataUrl) return;
11440
11441		this.modal.classList.add(this.options.loadingClass);
11442
11443		try {
11444			const response = await fetch(this.dataUrl);
11445
11446			if (!response.ok) {
11447				throw new Error(`HTTP ${response.status}`);
11448			}
11449
11450			const data = await response.json();
11451
11452			this.data = (data.vehicles ?? []).filter((item) => item.make && item.model);
11453
11454			await this.showResults(this.data);
11455		} catch (error) {
11456			console.error('SearchModal:', error);
11457			this.modal.classList.remove(this.options.loadingClass);
11458		}
11459	}
11460
11461	async showResults(items, query = '') {
11462		const visibleItems = items.slice(0, this.options.maxItems);
11463		const token = ++this.renderToken;
11464
11465		this.modal.classList.add(this.options.loadingClass);
11466
11467		await this.preloadImages(visibleItems);
11468
11469		// A newer search/load started while we were preloading - drop this stale render
11470		if (token !== this.renderToken) return;
11471
11472		this.modal.classList.remove(this.options.loadingClass);
11473		this.renderResults(visibleItems, query);
11474	}
11475
11476	preloadImages(items) {
11477		const urls = items.map((item) => item.photo).filter(Boolean);
11478
11479		return Promise.allSettled(urls.map((url) => this.preloadImage(url)));
11480	}
11481
11482	preloadImage(url) {
11483		return new Promise((resolve) => {
11484			const image = new Image();
11485			const timer = setTimeout(resolve, this.options.imageTimeout);
11486
11487			image.onload = image.onerror = () => {
11488				clearTimeout(timer);
11489				resolve();
11490			};
11491			image.src = url;
11492		});
11493	}
11494
11495	renderResults(items, query = '') {
11496		if (!this.results || !this.itemTemplate) return;
11497
11498		const viewAllHTML = query && this.viewAllTemplate ? this.viewAllTemplate({ query }) : '';
11499
11500		this.results.innerHTML = viewAllHTML + items.map((item) => this.itemTemplate(this.buildItemData(item))).join('');
11501		this.results.hidden = false;
11502
11503		if (this.empty) {
11504			this.results.appendChild(this.empty);
11505			this.empty.hidden = items.length > 0;
11506		}
11507	}
11508
11509	handleSearch(event) {
11510		const query = event.target.value.trim().toLowerCase();
11511
11512		if (!query) {
11513			this.showResults(this.data);
11514			return;
11515		}
11516
11517		const filtered = this.data.filter((item) => this.matchesQuery(item, query));
11518
11519		this.showResults(filtered, query);
11520	}
11521
11522	matchesQuery(item, query) {
11523		const haystack = this.normalizeToken(
11524			this.options.searchFields.map((field) => String(item[field] ?? '').toLowerCase()).join(' ')
11525		);
11526		const tokens = query.split(/\s+/).filter(Boolean).map((token) => this.normalizeToken(token));
11527
11528		return tokens.every((token) => haystack.includes(token));
11529	}
11530
11531	normalizeToken(value) {
11532		return value.replace(/-/g, '');
11533	}
11534
11535	debounce(func, delay = 250) {
11536		let timer = null;
11537
11538		return (...args) => {
11539			clearTimeout(timer);
11540			timer = setTimeout(() => func.apply(this, args), delay);
11541		};
11542	}
11543
11544	buildItemData(item) {
11545		const title = [item.year, item.make, item.model, item.trim, item.drivetrain]
11546			.filter(Boolean)
11547			.join(' ');
11548
11549		return {
11550			link: item.link,
11551			photo: item.photo,
11552			title,
11553			price: this.formatPrice(item.price),
11554		};
11555	}
11556
11557	formatPrice(price) {
11558		const value = parseInt(price, 10);
11559
11560		return Number.isNaN(value) ? '' : `$${value.toLocaleString('en-US')}`;
11561	}
11562
11563	toggleModal() {
11564		if (this.modal.classList.contains(this.options.activeClass)) {
11565			this.closeModal();
11566		} else {
11567			this.openModal();
11568		}
11569	}
11570
11571	openModal() {
11572		this.modal.classList.add(this.options.activeClass);
11573		this.modal.setAttribute('aria-hidden', 'false');
11574		this.holder.setAttribute('aria-expanded', 'true');
11575		document.body.classList.add(this.options.lockClass);
11576		this.input?.focus();
11577	}
11578
11579	closeModal() {
11580		this.modal.classList.remove(this.options.activeClass);
11581		this.modal.setAttribute('aria-hidden', 'true');
11582		this.holder.setAttribute('aria-expanded', 'false');
11583		document.body.classList.remove(this.options.lockClass);
11584	}
11585}
11586
11587/*
11588 * jQuery Autocomplete
11589 */
11590(function($) {
11591	function Autocomplete(options) {
11592		this.options = $.extend({
11593			startCount: 1,
11594			maxHeight: false,
11595			scrollClass: 'scroll-active',
11596			dataAttr: 'search',
11597			dataType: 'text',
11598			listItems: 'li',
11599			listItemsFillsInput: true,
11600			searchingClass: 'searching',
11601			alwaysRefresh: false,
11602			filterResults: true,
11603			highlightMatches: false,
11604			showOnFocus: true,
11605			preventEnterClick: false,
11606			queryStr: '',
11607			selectedClass: 'selected-line',
11608			disabledClass: 'disabled-line',
11609			noResultClass: 'no-results',
11610			resultsBox: '.ajax-drop',
11611			resultsHolder: '.autocomplete-results',
11612			inputField: 'input.text-input',
11613			hideDelay: 200,
11614			urlAttr: 'data-url',
11615			noResultBox: '.no-results',
11616			parseData: null // need function for dataType:'json'
11617		}, options);
11618
11619		this.init();
11620	}
11621
11622	Autocomplete.prototype = {
11623		init: function() {
11624			if (this.options.holder) {
11625				this.findElements();
11626				this.attachEvents();
11627				this.makeCallback('onInit');
11628			}
11629		},
11630		findElements: function() {
11631			this.form = $(this.options.holder);
11632			this.target = this.form.attr(this.options.urlAttr);
11633			this.input = this.form.find(this.options.inputField).attr('autocomplete', 'off');
11634			this.resultsBox = this.form.find(this.options.resultsBox).hide();
11635			this.resultsHolder = this.form.find(this.options.resultsHolder).show();
11636			this.noResultBox = this.form.find(this.options.noResultBox);
11637			this.currentIndex = 0;
11638			this.typedTimer = null;
11639
11640			if (this.options.filterResults) this.options.alwaysRefresh = false;
11641		},
11642		attachEvents: function() {
11643			this.input.on('keyup', (e) => {
11644				if (e.keyCode === 27 || e.keyCode === 38 || e.keyCode === 40) return;
11645
11646				if (this.options.preventEnterClick && e.key === 'Enter') return;
11647
11648				if (e.key === 'Enter' || this.input.val().length < this.options.startCount) {
11649					this.hideDrop();
11650					clearTimeout(this.typedTimer);
11651
11652					this.typedTimer = null;
11653
11654					this.form.removeClass(this.options.searchingClass);
11655				} else {
11656					if (this.options.alwaysRefresh) {
11657						clearTimeout(this.typedTimer);
11658
11659						this.form.addClass(this.options.searchingClass);
11660
11661						this.typedTimer = setTimeout(() => {
11662							this.loadData();
11663							this.resultsHolder.empty();
11664						}, 1000);
11665					} else {
11666						if (!this.listItems) {
11667							this.loadData();
11668						}
11669
11670						this.filterData();
11671					}
11672				}
11673			}).on('keydown', (e) => {
11674				if (this.listItems) {
11675					this.visibleItems = this.listItems.filter(':visible').not('.' + this.options.disabledClass);
11676					this.visibleCount = this.visibleItems.length;
11677
11678					switch (e.keyCode) {
11679						case 27:
11680							this.hideDrop();
11681
11682							break;
11683						case 38:
11684							if (this.currentIndex >= 0) this.currentIndex--;
11685
11686							break;
11687						case 40:
11688							if (this.currentIndex < this.visibleCount - 1) this.currentIndex++;
11689
11690							break;
11691					}
11692
11693					this.listItems.removeClass(this.options.selectedClass);
11694
11695					if (this.currentIndex !== -1) {
11696						this.visibleItems.eq(this.currentIndex).addClass(this.options.selectedClass);
11697					}
11698				}
11699			}).on('focus', () => {
11700				clearTimeout(this.focusTimer);
11701
11702				this.inFocus = true;
11703
11704				if (this.input.val().trim() !== '' && this.form.hasClass(this.options.noResultClass)) {
11705					this.resultsHolder.empty();
11706					this.form.removeClass(this.options.noResultClass);
11707				}
11708
11709				if (this.options.showOnFocus) {
11710					this[this.itemsLoaded ? 'showDrop' : 'loadData']();
11711				}
11712			}).on('blur', () => {
11713				this.inFocus = false;
11714
11715				if (!this.options.showOnFocus) {
11716					this.focusTimer = setTimeout(() => {
11717						this.hideDrop();
11718					}, this.options.hideDelay);
11719				}
11720			}).on('input', () => {
11721				this.makeCallback('onKeyup', this.input.val());
11722			});
11723
11724			if (this.options.showOnFocus) {
11725				$(document).on('click', (e) => {
11726					const clickTarget = $(e.target);
11727
11728					if (!clickTarget.is(this.form) && clickTarget.closest(this.form).length === 0 && !this.inFocus) {
11729						this.hideDrop();
11730					}
11731				});
11732			}
11733		},
11734		loadData: function(callback) {
11735			if (this.acXHR && typeof this.acXHR.abort === 'function') this.acXHR.abort();
11736
11737			const self = this;
11738
11739			this.acXHR = $.ajax({
11740				url: this.target,
11741				dataType: this.options.dataType,
11742				data: self.options.dataAttr + '=' + self.input.val() + this.options.queryStr,
11743				success: function(msg) {
11744					if (!self.typedTimer) return;
11745
11746					self.updateDrop(msg);
11747					self.filterData();
11748					self.showDrop();
11749					self.itemsLoaded = true;
11750
11751					self.makeCallback('onLoadData', msg);
11752					self.form.removeClass(self.options.searchingClass);
11753
11754					if (typeof callback === 'function') callback();
11755				},
11756				error: function() {
11757					if (typeof self.options.onerror === 'function') {
11758						self.options.onerror.apply(this, arguments);
11759					}
11760				}
11761			});
11762		},
11763		filterData: function() {
11764			const self = this;
11765
11766			if (self.listItems) {
11767				self.showDrop();
11768
11769				if (self.options.filterResults) {
11770					self.hideNoResult();
11771
11772					if (self.options.maxHeight) {
11773						var summ = 0;
11774					}
11775
11776					self.listItems.show().each(function() {
11777						const item = $(this);
11778
11779						item.html(item.data('orightml'));
11780
11781						if (item.text().toLowerCase().indexOf(self.input.val().toLowerCase()) != -1) {
11782							item.show();
11783							if (self.options.maxHeight) summ += item.outerHeight(true);
11784						} else {
11785							item.hide();
11786						}
11787					});
11788
11789					if (self.options.maxHeight + 0) {
11790						if (summ > self.options.maxHeight) {
11791							self.resultsBox.addClass(self.options.scrollClass);
11792
11793							self.resultsHolder.css({
11794								height: self.options.maxHeight
11795							});
11796						} else {
11797							self.resultsBox.removeClass(self.options.scrollClass);
11798
11799							self.resultsHolder.css({
11800								height: ''
11801							});
11802						}
11803					}
11804
11805					if (!self.listItems.filter(':visible').length) {
11806						self.showNoResult();
11807					}
11808				}
11809
11810				if (self.options.highlightMatches) {
11811					self.listItems.children().each(function(i, obj) {
11812						if (self.input.val().length >= self.options.startCount) {
11813							$(obj).html(highlightWords($(obj).text(), self.input.val()));
11814						}
11815					});
11816				}
11817			}
11818		},
11819		updateDrop: function(text) {
11820			if (this.lastData !== text) {
11821				let data = null;
11822
11823				this.lastData = text;
11824				this.currentIndex = -1;
11825
11826				if (this.options.dataType.toLowerCase() === 'json' && typeof this.options.parseData === 'function') {
11827					data = this.options.parseData.call(this, text) || text;
11828				} else {
11829					data = text;
11830				}
11831
11832				this.resultsHolder.html(data);
11833
11834				this.listItems = this.resultsHolder.find(this.options.listItems);
11835
11836				this.listItems.each((i, item) => {
11837					const curItem = $(item);
11838
11839					curItem.data('orightml', curItem.html());
11840
11841					curItem.on('click', (e) => {
11842						e.preventDefault();
11843
11844						this.selectItem(curItem);
11845					});
11846
11847					curItem.on('hover', () => {
11848						this.listItems.removeClass(this.options.selectedClass);
11849						curItem.addClass(this.options.selectedClass);
11850						this.currentIndex = this.listItems.filter(':visible').index(curItem);
11851					});
11852				});
11853			}
11854		},
11855		showNoResult: function() {
11856			this.resultsHolder.hide();
11857			this.noResultBox.show();
11858			this.form.addClass(this.options.noResultClass);
11859		},
11860		hideNoResult: function() {
11861			this.resultsHolder.show();
11862			this.noResultBox.hide();
11863			this.form.removeClass(this.options.noResultClass);
11864		},
11865		showDrop: function() {
11866			if (this.input.val().length >= this.options.startCount) {
11867				this.resultsBox.show();
11868			} else {
11869				this.resultsBox.hide();
11870			}
11871
11872			if (this.options.showOnFocus) {
11873				this.resultsBox.show();
11874			}
11875		},
11876		hideDrop: function() {
11877			this.resultsBox.hide();
11878		},
11879		selectItem: function(item) {
11880			this.hideDrop();
11881			this.makeCallback('onSelectedItem', item);
11882		},
11883		makeCallback(callbackName, ...args) {
11884			if (typeof this.options[callbackName] === 'function') {
11885				this.options[callbackName].apply(this, args);
11886			}
11887		}
11888	};
11889
11890	function escapeRegExp(str) {
11891		return str.replace(new RegExp('[.*+?|()\\[\\]{}\\\\]', 'g'), '\\$&');
11892	}
11893
11894	function highlightWords(str, word) {
11895		const regex = new RegExp('(' + escapeRegExp(word) + ')', 'gi');
11896
11897		return str.replace(regex, '<strong>$1</strong>');
11898	}
11899
11900	$.fn.autocomplete = function(options) {
11901		return this.each(function() {
11902			$(this).data('AutoComplete', new Autocomplete($.extend(options, {
11903				holder: this
11904			})));
11905		});
11906	};
11907}(jQuery));
11908
11909// Add user journey to the input from the local storage
11910function updateJourneyField() {
11911	const userJourney = localStorage.getItem('UserJourney');
11912	const userJourneyField = document.querySelectorAll('.userjourney input');
11913
11914	if (userJourney && userJourneyField.length) {
11915		userJourneyField.forEach((elem) => {
11916			elem.value = userJourney;
11917		});
11918	}
11919}
11920
11921// Populate the FullCircle hidden fields from the browser tracker just before submit.
11922// Values are never generated here — only read from window.FullCircle, which the
11923// installed FullCircle tracker script owns. Empty when consent hasn't been granted yet.
11924function updateFullCircleFields() {
11925	const visitorId = (window.FullCircle && window.FullCircle.getVisitorId && window.FullCircle.getVisitorId()) || '';
11926	const sessionId = (window.FullCircle && window.FullCircle.getSessionId && window.FullCircle.getSessionId()) || '';
11927
11928	document.querySelectorAll('input[name="FullCircleVisitorID"]').forEach((elem) => {
11929		elem.value = visitorId;
11930	});
11931	document.querySelectorAll('input[name="FullCircleSessionID"]').forEach((elem) => {
11932		elem.value = sessionId;
11933	});
11934}
11935
11936/*
11937 * priority-nav - v1.0.13 | (c) 2018 @gijsroge | MIT license
11938 * Repository: https://github.com/gijsroge/priority-navigation.git
11939 * Description: Priority+ pattern navigation that hides menu items if they don't fit on screen.
11940 * Demo: http://gijsroge.github.io/priority-nav.js/
11941 */
11942(function(root, factory) {
11943	if (typeof define === "function" && define.amd) {
11944		define("priorityNav", factory(root));
11945	} else if (typeof exports === "object") {
11946		module.exports = factory(root);
11947	} else {
11948		root.priorityNav = factory(root);
11949	}
11950})(window || this, function(root) {
11951
11952	"use strict";
11953
11954	/**
11955	 * Variables
11956	 */
11957	var priorityNav = {}; // Object for public APIs
11958	var breaks = []; // Object to store instances with breakpoints where the instances menu item"s didin"t fit.
11959	var supports = !!document.querySelector && !!root.addEventListener; // Feature test
11960	var settings = {};
11961	var instance = 0;
11962	var count = 0;
11963	var mainNavWrapper, totalWidth, restWidth, mainNav, navDropdown, navDropdownToggle, dropDownWidth, toggleWrapper;
11964	var viewportWidth = 0;
11965
11966	/**
11967	 * Default settings
11968	 * @type {{initClass: string, navDropdown: string, navDropdownToggle: string, mainNavWrapper: string, moved: Function, movedBack: Function}}
11969	 */
11970	var defaults = {
11971		initClass: "js-priorityNav", // Class that will be printed on html element to allow conditional css styling.
11972		mainNavWrapper: "nav", // mainnav wrapper selector (must be direct parent from mainNav)
11973		mainNav: "ul", // mainnav selector. (must be inline-block)
11974		navDropdownClassName: "nav__dropdown", // class used for the dropdown.
11975		navDropdownToggleClassName: "nav__dropdown-toggle", // class used for the dropdown toggle.
11976		navDropdownLabel: "more", // Text that is used for the dropdown toggle.
11977		navDropdownBreakpointLabel: "menu", //button label for navDropdownToggle when the breakPoint is reached.
11978		breakPoint: 500, //amount of pixels when all menu items should be moved to dropdown to simulate a mobile menu
11979		throttleDelay: 50, // this will throttle the calculating logic on resize because i'm a responsible dev.
11980		offsetPixels: 0, // increase to decrease the time it takes to move an item.
11981		count: true, // prints the amount of items are moved to the attribute data-count to style with css counter.
11982
11983		//Callbacks
11984		moved: function() {
11985		},
11986		movedBack: function() {
11987		}
11988	};
11989
11990	/**
11991	 * A simple forEach() implementation for Arrays, Objects and NodeLists
11992	 * @private
11993	 * @param {Array|Object|NodeList} collection Collection of items to iterate
11994	 * @param {Function} callback Callback function for each iteration
11995	 * @param {Array|Object|NodeList} scope Object/NodeList/Array that forEach is iterating over (aka `this`)
11996	 */
11997	var forEach = function(collection, callback, scope) {
11998		if (Object.prototype.toString.call(collection) === "[object Object]") {
11999			for (var prop in collection) {
12000				if (Object.prototype.hasOwnProperty.call(collection, prop)) {
12001					callback.call(scope, collection[prop], prop, collection);
12002				}
12003			}
12004		} else {
12005			for (var i = 0, len = collection.length; i < len; i++) {
12006				callback.call(scope, collection[i], i, collection);
12007			}
12008		}
12009	};
12010
12011	/**
12012	 * Get the closest matching element up the DOM tree
12013	 * @param {Element} elem Starting element
12014	 * @param {String} selector Selector to match against (class, ID, or data attribute)
12015	 * @return {Boolean|Element} Returns false if not match found
12016	 */
12017	var getClosest = function(elem, selector) {
12018		var firstChar = selector.charAt(0);
vendor: 13,779 bytes, lines 12019-12516
12019		for (; elem && elem !== document; elem = elem.parentNode) {
12020			if (firstChar === ".") {
12021				if (elem.classList.contains(selector.substr(1))) {
12022					return elem;
12023				}
12024			} else if (firstChar === "#") {
12025				if (elem.id === selector.substr(1)) {
12026					return elem;
12027				}
12028			} else if (firstChar === "[") {
12029				if (elem.hasAttribute(selector.substr(1, selector.length - 2))) {
12030					return elem;
12031				}
12032			}
12033		}
12034		return false;
12035	};
12036
12037	/**
12038	 * Merge defaults with user options
12039	 * @private
12040	 * @param {Object} defaults Default settings
12041	 * @param {Object} options User options
12042	 * @returns {Object} Merged values of defaults and options
12043	 */
12044	var extend = function(defaults, options) {
12045		var extended = {};
12046		forEach(defaults, function(value, prop) {
12047			extended[prop] = defaults[prop];
12048		});
12049		forEach(options, function(value, prop) {
12050			extended[prop] = options[prop];
12051		});
12052		return extended;
12053	};
12054
12055	/**
12056	 * Debounced resize to throttle execution
12057	 * @param func
12058	 * @param wait
12059	 * @param immediate
12060	 * @returns {Function}
12061	 */
12062	function debounce(func, wait, immediate) {
12063		var timeout;
12064		return function() {
12065			var context = this, args = arguments;
12066			var later = function() {
12067				timeout = null;
12068				if (!immediate) func.apply(context, args);
12069			};
12070			var callNow = immediate && !timeout;
12071			clearTimeout(timeout);
12072			timeout = setTimeout(later, wait);
12073			if (callNow) func.apply(context, args);
12074		};
12075	}
12076
12077	/**
12078	 * Toggle class on element
12079	 * @param el
12080	 * @param className
12081	 */
12082	var toggleClass = function(el, className) {
12083		if (el.classList) {
12084			el.classList.toggle(className);
12085		} else {
12086			var classes = el.className.split(" ");
12087			var existingIndex = classes.indexOf(className);
12088
12089			if (existingIndex >= 0)
12090				classes.splice(existingIndex, 1); else
12091				classes.push(className);
12092
12093			el.className = classes.join(" ");
12094		}
12095	};
12096
12097	/**
12098	 * Check if dropdown menu is already on page before creating it
12099	 * @param mainNavWrapper
12100	 */
12101	var prepareHtml = function(_this, settings) {
12102
12103		/**
12104		 * Create dropdow menu
12105		 * @type {HTMLElement}
12106		 */
12107		toggleWrapper = document.createElement("span");
12108		navDropdown = document.createElement("ul");
12109		navDropdownToggle = document.createElement("button");
12110
12111		/**
12112		 * Set label for dropdown toggle
12113		 * @type {string}
12114		 */
12115		navDropdownToggle.innerHTML = settings.navDropdownLabel;
12116
12117		/**
12118		 * Set aria attributes for accessibility
12119		 */
12120		navDropdownToggle.setAttribute("aria-controls", "menu");
12121		navDropdownToggle.setAttribute("aria-label", "Show more menu items");
12122		navDropdownToggle.setAttribute("type", "button");
12123		navDropdown.setAttribute("aria-hidden", "true");
12124
12125
12126		/**
12127		 * Move elements to the right spot
12128		 */
12129		if (_this.querySelector(mainNav).parentNode !== _this) {
12130			console.warn("mainNav is not a direct child of mainNavWrapper, double check please");
12131			return;
12132		}
12133
12134		_this.insertAfter(toggleWrapper, _this.querySelector(mainNav));
12135
12136		toggleWrapper.appendChild(navDropdownToggle);
12137		toggleWrapper.appendChild(navDropdown);
12138
12139		/**
12140		 * Add classes so we can target elements
12141		 */
12142		navDropdown.classList.add(settings.navDropdownClassName);
12143		navDropdown.classList.add("priority-nav__dropdown");
12144
12145		navDropdownToggle.classList.add(settings.navDropdownToggleClassName);
12146		navDropdownToggle.classList.add("priority-nav__dropdown-toggle");
12147
12148		//fix so button is type="button" and do not submit forms
12149		navDropdownToggle.setAttribute("type", "button");
12150
12151		toggleWrapper.classList.add(settings.navDropdownClassName + "-wrapper");
12152		toggleWrapper.classList.add("priority-nav__wrapper");
12153
12154		_this.classList.add("priority-nav");
12155	};
12156
12157	/**
12158	 * Get innerwidth without padding
12159	 * @param element
12160	 * @returns {number}
12161	 */
12162	var getElementContentWidth = function(element) {
12163		var styles = window.getComputedStyle(element);
12164		var padding = parseFloat(styles.paddingLeft) +
12165			parseFloat(styles.paddingRight);
12166
12167		return element.clientWidth - padding;
12168	};
12169
12170	/**
12171	 * Get viewport size
12172	 * @returns {{width: number, height: number}}
12173	 */
12174	var viewportSize = function() {
12175		var doc = document, w = window;
12176		var docEl = (doc.compatMode && doc.compatMode === "CSS1Compat") ?
12177			doc.documentElement : doc.body;
12178
12179		var width = docEl.clientWidth;
12180		var height = docEl.clientHeight;
12181
12182		// mobile zoomed in?
12183		if (w.innerWidth && width > w.innerWidth) {
12184			width = w.innerWidth;
12185			height = w.innerHeight;
12186		}
12187
12188		return { width: width, height: height };
12189	};
12190
12191	/**
12192	 * Get width
12193	 * @param elem
12194	 * @returns {number}
12195	 */
12196	var calculateWidths = function(_this) {
12197		totalWidth = getElementContentWidth(_this);
12198		//Check if parent is the navwrapper before calculating its width
12199		if (_this.querySelector(navDropdown).parentNode === _this) {
12200			dropDownWidth = _this.querySelector(navDropdown).offsetWidth;
12201		} else {
12202			dropDownWidth = 0;
12203		}
12204		restWidth = getChildrenWidth(_this) + settings.offsetPixels;
12205		viewportWidth = viewportSize().width;
12206	};
12207
12208	/**
12209	 * Move item to array
12210	 * @param item
12211	 */
12212	priorityNav.doesItFit = function(_this) {
12213
12214		/**
12215		 * Check if it is the first run
12216		 */
12217		var delay = _this.getAttribute("instance") === 0 ? delay : settings.throttleDelay;
12218
12219		/**
12220		 * Increase instance
12221		 */
12222		instance++;
12223
12224		/**
12225		 * Debounced execution of the main logic
12226		 */
12227		(debounce(function() {
12228
12229			/**
12230			 * Get the current element"s instance
12231			 * @type {string}
12232			 */
12233			var identifier = _this.getAttribute("instance");
12234
12235			/**
12236			 * Update width
12237			 */
12238			calculateWidths(_this);
12239
12240			/**
12241			 * Keep executing until all menu items that are overflowing are moved
12242			 */
12243			while (totalWidth <= restWidth && _this.querySelector(mainNav).children.length > 0 || viewportWidth < settings.breakPoint && _this.querySelector(mainNav).children.length > 0) {
12244				//move item to dropdown
12245				priorityNav.toDropdown(_this, identifier);
12246				//recalculate widths
12247				calculateWidths(_this, identifier);
12248				//update dropdownToggle label
12249				if (viewportWidth < settings.breakPoint) updateLabel(_this, identifier, settings.navDropdownBreakpointLabel);
12250			}
12251
12252			/**
12253			 * Keep executing until all menu items that are able to move back are moved
12254			 */
12255			while (totalWidth >= breaks[identifier][breaks[identifier].length - 1] && viewportWidth > settings.breakPoint) {
12256				//move item to menu
12257				priorityNav.toMenu(_this, identifier);
12258				//update dropdownToggle label
12259				if (viewportWidth > settings.breakPoint) updateLabel(_this, identifier, settings.navDropdownLabel);
12260			}
12261
12262			/**
12263			 * If there are no items in dropdown hide dropdown
12264			 */
12265			if (breaks[identifier].length < 1) {
12266				_this.querySelector(navDropdown).classList.remove("show");
12267				//show navDropdownLabel
12268				updateLabel(_this, identifier, settings.navDropdownLabel);
12269			}
12270
12271			/**
12272			 * If there are no items in menu
12273			 */
12274			if (_this.querySelector(mainNav).children.length < 1) {
12275				//show navDropdownBreakpointLabel
12276				_this.classList.add("is-empty");
12277				updateLabel(_this, identifier, settings.navDropdownBreakpointLabel);
12278			} else {
12279				_this.classList.remove("is-empty");
12280			}
12281
12282			/**
12283			 * Check if we need to show toggle menu button
12284			 */
12285			showToggle(_this, identifier);
12286
12287		}, delay))();
12288	};
12289
12290	/**
12291	 * Show/hide toggle button
12292	 */
12293	var showToggle = function(_this, identifier) {
12294		if (breaks[identifier].length < 1) {
12295			_this.querySelector(navDropdownToggle).classList.add("priority-nav-is-hidden");
12296			_this.querySelector(navDropdownToggle).classList.remove("priority-nav-is-visible");
12297			_this.classList.remove("priority-nav-has-dropdown");
12298
12299			/**
12300			 * Set aria attributes for accessibility
12301			 */
12302			_this.querySelector(".priority-nav__wrapper").setAttribute("aria-haspopup", "false");
12303
12304		} else {
12305			_this.querySelector(navDropdownToggle).classList.add("priority-nav-is-visible");
12306			_this.querySelector(navDropdownToggle).classList.remove("priority-nav-is-hidden");
12307			_this.classList.add("priority-nav-has-dropdown");
12308
12309			/**
12310			 * Set aria attributes for accessibility
12311			 */
12312			_this.querySelector(".priority-nav__wrapper").setAttribute("aria-haspopup", "true");
12313		}
12314	};
12315
12316	/**
12317	 * Update count on dropdown toggle button
12318	 */
12319	var updateCount = function(_this, identifier) {
12320		_this.querySelector(navDropdownToggle).setAttribute("priorityNav-count", breaks[identifier].length);
12321	};
12322
12323	var updateLabel = function(_this, identifier, label) {
12324		_this.querySelector(navDropdownToggle).innerHTML = label;
12325	};
12326
12327	/**
12328	 * Move item to dropdown
12329	 */
12330	priorityNav.toDropdown = function(_this, identifier) {
12331
12332		/**
12333		 * move last child of navigation menu to dropdown
12334		 */
12335		if (_this.querySelector(navDropdown).firstChild && _this.querySelector(mainNav).children.length > 0) {
12336			_this.querySelector(navDropdown).insertBefore(_this.querySelector(mainNav).lastElementChild, _this.querySelector(navDropdown).firstChild);
12337		} else if (_this.querySelector(mainNav).children.length > 0) {
12338			_this.querySelector(navDropdown).appendChild(_this.querySelector(mainNav).lastElementChild);
12339		}
12340
12341		/**
12342		 * store breakpoints
12343		 */
12344		breaks[identifier].push(restWidth);
12345
12346		/**
12347		 * check if we need to show toggle menu button
12348		 */
12349		showToggle(_this, identifier);
12350
12351		/**
12352		 * update count on dropdown toggle button
12353		 */
12354		if (_this.querySelector(mainNav).children.length > 0 && settings.count) {
12355			updateCount(_this, identifier);
12356		}
12357
12358		/**
12359		 * If item has been moved to dropdown trigger the callback
12360		 */
12361		settings.moved();
12362	};
12363
12364	/**
12365	 * Move item to menu
12366	 */
12367	priorityNav.toMenu = function(_this, identifier) {
12368
12369		/**
12370		 * move last child of navigation menu to dropdown
12371		 */
12372		if (_this.querySelector(navDropdown).children.length > 0) _this.querySelector(mainNav).appendChild(_this.querySelector(navDropdown).firstElementChild);
12373
12374		/**
12375		 * remove last breakpoint
12376		 */
12377		breaks[identifier].pop();
12378
12379		/**
12380		 * Check if we need to show toggle menu button
12381		 */
12382		showToggle(_this, identifier);
12383
12384		/**
12385		 * update count on dropdown toggle button
12386		 */
12387		if (_this.querySelector(mainNav).children.length > 0 && settings.count) {
12388			updateCount(_this, identifier);
12389		}
12390
12391		/**
12392		 * If item has been moved back to the main menu trigger the callback
12393		 */
12394		settings.movedBack();
12395	};
12396
12397	/**
12398	 * Count width of children and return the value
12399	 * @param e
12400	 */
12401	var getChildrenWidth = function(e) {
12402		var children = e.childNodes;
12403		var sum = 0;
12404		for (var i = 0; i < children.length; i++) {
12405			if (children[i].nodeType !== 3) {
12406				if (!isNaN(children[i].offsetWidth)) {
12407					sum += children[i].offsetWidth;
12408				}
12409
12410			}
12411		}
12412		return sum;
12413	};
12414
12415	/**
12416	 * Bind eventlisteners
12417	 */
12418	var listeners = function(_this, settings) {
12419
12420		// Check if an item needs to move
12421		if (window.attachEvent) {
12422			window.attachEvent("onresize", function() {
12423				if (priorityNav.doesItFit) priorityNav.doesItFit(_this);
12424			});
12425		}
12426		else if (window.addEventListener) {
12427			window.addEventListener("resize", function() {
12428				if (priorityNav.doesItFit) priorityNav.doesItFit(_this);
12429			}, true);
12430		}
12431
12432		// Toggle dropdown
12433		_this.querySelector(navDropdownToggle).addEventListener("click", function() {
12434			toggleClass(_this.querySelector(navDropdown), "show");
12435			toggleClass(this, "is-open");
12436			toggleClass(_this, "is-open");
12437
12438			/**
12439			 * Toggle aria hidden for accessibility
12440			 */
12441			if (-1 !== _this.className.indexOf("is-open")) {
12442				_this.querySelector(navDropdown).setAttribute("aria-hidden", "false");
12443			} else {
12444				_this.querySelector(navDropdown).setAttribute("aria-hidden", "true");
12445				_this.querySelector(navDropdown).blur();
12446			}
12447		});
12448
12449		/*
12450		 * Remove when clicked outside dropdown
12451		 */
12452		document.addEventListener("click", function(event) {
12453			if (!getClosest(event.target, "." + settings.navDropdownClassName) && event.target !== _this.querySelector(navDropdownToggle)) {
12454				_this.querySelector(navDropdown).classList.remove("show");
12455				_this.querySelector(navDropdownToggle).classList.remove("is-open");
12456				_this.classList.remove("is-open");
12457			}
12458		});
12459
12460		/**
12461		 * Remove when escape key is pressed
12462		 */
12463		document.onkeydown = function(evt) {
12464			evt = evt || window.event;
12465			if (evt.keyCode === 27) {
12466				document.querySelector(navDropdown).classList.remove("show");
12467				document.querySelector(navDropdownToggle).classList.remove("is-open");
12468				mainNavWrapper.classList.remove("is-open");
12469			}
12470		};
12471	};
12472
12473	/**
12474	 * Remove function
12475	 */
12476	Element.prototype.remove = function() {
12477		// this.parentElement.removeChild(this);
12478	};
12479
12480	/*global HTMLCollection */
12481	NodeList.prototype.remove = HTMLCollection.prototype.remove = function() {
12482		for (var i = 0, len = this.length; i < len; i++) {
12483			if (this[i] && this[i].parentElement) {
12484				this[i].parentElement.removeChild(this[i]);
12485			}
12486		}
12487	};
12488
12489	/**
12490	 * Destroy the current initialization.
12491	 * @public
12492	 */
12493	priorityNav.destroy = function() {
12494		// If plugin isn"t already initialized, stop
12495		if (!settings) return;
12496		// Remove feedback class
12497		document.documentElement.classList.remove(settings.initClass);
12498		// Remove toggle
12499		toggleWrapper.remove();
12500		// Remove settings
12501		settings = null;
12502		delete priorityNav.init;
12503		delete priorityNav.doesItFit;
12504	};
12505
12506	/**
12507	 * insertAfter function
12508	 * @param n
12509	 * @param r
12510	 */
12511	if (supports && typeof Node !== "undefined") {
12512		Node.prototype.insertAfter = function(n, r) { this.insertBefore(n, r.nextSibling); };
12513	}
12514
12515	var checkForSymbols = function(string) {
12516		var firstChar = string.charAt(0);
12517		if (firstChar === "." || firstChar === "#") {
12518			return false;
12519		} else {
12520			return true;
12521		}
12522	};
12523
12524	/**
12525	 * Initialize Plugin
12526	 * @public
12527	 * @param {Object} options User settings
12528	 */
12529	priorityNav.init = function(options) {
12530
12531		/**
12532		 * Merge user options with defaults
12533		 * @type {Object}
12534		 */
12535		settings = extend(defaults, options || {});
12536
12537		// Feature test.
12538		if (!supports && typeof Node === "undefined") {
12539			console.warn("This browser doesn't support priorityNav");
12540			return;
12541		}
12542
12543		// Options check
12544		if (!checkForSymbols(settings.navDropdownClassName) || !checkForSymbols(settings.navDropdownToggleClassName)) {
12545			console.warn("No symbols allowed in navDropdownClassName & navDropdownToggleClassName. These are not selectors.");
12546			return;
12547		}
12548
12549		/**
12550		 * Store nodes
12551		 * @type {NodeList}
12552		 */
12553		var elements = document.querySelectorAll(settings.mainNavWrapper);
12554
12555		/**
12556		 * Loop over every instance and reference _this
12557		 */
12558		forEach(elements, function(_this) {
12559
12560			/**
12561			 * Create breaks array
12562			 * @type {number}
12563			 */
12564			breaks[count] = [];
12565
12566			/**
12567			 * Set the instance number as data attribute
12568			 */
12569			_this.setAttribute("instance", count++);
12570
12571			/**
12572			 * Store the wrapper element
12573			 */
12574			mainNavWrapper = _this;
12575			if (!mainNavWrapper) {
12576				console.warn("couldn't find the specified mainNavWrapper element");
12577				return;
12578			}
12579
12580			/**
12581			 * Store the menu elementStore the menu element
12582			 */
12583			mainNav = settings.mainNav;
12584			if (!_this.querySelector(mainNav)) {
12585				console.warn("couldn't find the specified mainNav element");
12586				return;
12587			}
12588
12589			/**
12590			 * Check if we need to create the dropdown elements
12591			 */
12592			prepareHtml(_this, settings);
12593
12594			/**
12595			 * Store the dropdown element
12596			 */
12597			navDropdown = "." + settings.navDropdownClassName;
12598			if (!_this.querySelector(navDropdown)) {
12599				console.warn("couldn't find the specified navDropdown element");
12600				return;
12601			}
12602
12603			/**
12604			 * Store the dropdown toggle element
12605			 */
12606			navDropdownToggle = "." + settings.navDropdownToggleClassName;
12607			if (!_this.querySelector(navDropdownToggle)) {
12608				console.warn("couldn't find the specified navDropdownToggle element");
12609				return;
12610			}
12611
12612			/**
12613			 * Event listeners
12614			 */
12615			listeners(_this, settings);
12616
12617			/**
12618			 * Start first check
12619			 */
12620			priorityNav.doesItFit(_this);
12621
12622		});
12623
12624		/**
12625		 * Count amount of instances
12626		 */
12627		instance++;
12628
12629		/**
12630		 * Add class to HTML element to activate conditional CSS
12631		 */
12632		document.documentElement.classList.add(settings.initClass);
12633	};
12634
12635	/**
12636	 * Public APIs
12637	 */
12638	return priorityNav;
12639});
12640
12641/* eslint-disable */
12642
12643// jQuery Mask Plugin v1.14.16
12644// github.com/igorescobar/jQuery-Mask-Plugin
12645var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,n,f){a instanceof String&&(a=String(a));for(var p=a.length,k=0;k<p;k++){var b=a[k];if(n.call(f,b,k,a))return{i:k,v:b}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;
12646$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,n,f){a!=Array.prototype&&a!=Object.prototype&&(a[n]=f.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);
12647$jscomp.polyfill=function(a,n,f,p){if(n){f=$jscomp.global;a=a.split(".");for(p=0;p<a.length-1;p++){var k=a[p];k in f||(f[k]={});f=f[k]}a=a[a.length-1];p=f[a];n=n(p);n!=p&&null!=n&&$jscomp.defineProperty(f,a,{configurable:!0,writable:!0,value:n})}};$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,f){return $jscomp.findInternal(this,a,f).v}},"es6","es3");
12648(function(a,n,f){"function"===typeof define&&define.amd?define(["jquery"],a):"object"===typeof exports&&"undefined"===typeof Meteor?module.exports=a(require("jquery")):a(n||f)})(function(a){var n=function(b,d,e){var c={invalid:[],getCaret:function(){try{var a=0,r=b.get(0),h=document.selection,d=r.selectionStart;if(h&&-1===navigator.appVersion.indexOf("MSIE 10")){var e=h.createRange();e.moveStart("character",-c.val().length);a=e.text.length}else if(d||"0"===d)a=d;return a}catch(C){}},setCaret:function(a){try{if(b.is(":focus")){var c=
12649b.get(0);if(c.setSelectionRange)c.setSelectionRange(a,a);else{var g=c.createTextRange();g.collapse(!0);g.moveEnd("character",a);g.moveStart("character",a);g.select()}}}catch(B){}}
vendor: 6,247 bytes, lines 12649-12661
12649,events:function(){b.on("keydown.mask",function(a){b.data("mask-keycode",a.keyCode||a.which);b.data("mask-previus-value",b.val());b.data("mask-previus-caret-pos",c.getCaret());c.maskDigitPosMapOld=c.maskDigitPosMap}).on(a.jMaskGlobals.useInput?"input.mask":"keyup.mask",c.behaviour).on("paste.mask drop.mask",function(){setTimeout(function(){b.keydown().keyup()},
12650100)}).on("change.mask",function(){b.data("changed",!0)}).on("blur.mask",function(){f===c.val()||b.data("changed")||b.trigger("change");b.data("changed",!1)}).on("blur.mask",function(){f=c.val()}).on("focus.mask",function(b){!0===e.selectOnFocus&&a(b.target).select()}).on("focusout.mask",function(){e.clearIfNotMatch&&!k.test(c.val())&&c.val("")})},getRegexMask:function(){for(var a=[],b,c,e,t,f=0;f<d.length;f++)(b=l.translation[d.charAt(f)])?(c=b.pattern.toString().replace(/.{1}$|^.{1}/g,""),e=b.optional,
12651(b=b.recursive)?(a.push(d.charAt(f)),t={digit:d.charAt(f),pattern:c}):a.push(e||b?c+"?":c)):a.push(d.charAt(f).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"));a=a.join("");t&&(a=a.replace(new RegExp("("+t.digit+"(.*"+t.digit+")?)"),"($1)?").replace(new RegExp(t.digit,"g"),t.pattern));return new RegExp(a)},destroyEvents:function(){b.off("input keydown keyup paste drop blur focusout ".split(" ").join(".mask "))},val:function(a){var c=b.is("input")?"val":"text";if(0<arguments.length){if(b[c]()!==a)b[c](a);
12652c=b}else c=b[c]();return c},calculateCaretPosition:function(a){var d=c.getMasked(),h=c.getCaret();if(a!==d){var e=b.data("mask-previus-caret-pos")||0;d=d.length;var g=a.length,f=a=0,l=0,k=0,m;for(m=h;m<d&&c.maskDigitPosMap[m];m++)f++;for(m=h-1;0<=m&&c.maskDigitPosMap[m];m--)a++;for(m=h-1;0<=m;m--)c.maskDigitPosMap[m]&&l++;for(m=e-1;0<=m;m--)c.maskDigitPosMapOld[m]&&k++;h>g?h=10*d:e>=h&&e!==g?c.maskDigitPosMapOld[h]||(e=h,h=h-(k-l)-a,c.maskDigitPosMap[h]&&(h=e)):h>e&&(h=h+(l-k)+f)}return h},behaviour:function(d){d=
12653d||window.event;c.invalid=[];var e=b.data("mask-keycode");if(-1===a.inArray(e,l.byPassKeys)){e=c.getMasked();var h=c.getCaret(),g=b.data("mask-previus-value")||"";setTimeout(function(){c.setCaret(c.calculateCaretPosition(g))},a.jMaskGlobals.keyStrokeCompensation);c.val(e);c.setCaret(h);return c.callbacks(d)}},getMasked:function(a,b){var h=[],f=void 0===b?c.val():b+"",g=0,k=d.length,n=0,p=f.length,m=1,r="push",u=-1,w=0;b=[];if(e.reverse){r="unshift";m=-1;var x=0;g=k-1;n=p-1;var A=function(){return-1<
12654g&&-1<n}}else x=k-1,A=function(){return g<k&&n<p};for(var z;A();){var y=d.charAt(g),v=f.charAt(n),q=l.translation[y];if(q)v.match(q.pattern)?(h[r](v),q.recursive&&(-1===u?u=g:g===x&&g!==u&&(g=u-m),x===u&&(g-=m)),g+=m):v===z?(w--,z=void 0):q.optional?(g+=m,n-=m):q.fallback?(h[r](q.fallback),g+=m,n-=m):c.invalid.push({p:n,v:v,e:q.pattern}),n+=m;else{if(!a)h[r](y);v===y?(b.push(n),n+=m):(z=y,b.push(n+w),w++);g+=m}}a=d.charAt(x);k!==p+1||l.translation[a]||h.push(a);h=h.join("");c.mapMaskdigitPositions(h,
12655b,p);return h},mapMaskdigitPositions:function(a,b,d){a=e.reverse?a.length-d:0;c.maskDigitPosMap={};for(d=0;d<b.length;d++)c.maskDigitPosMap[b[d]+a]=1},callbacks:function(a){var g=c.val(),h=g!==f,k=[g,a,b,e],l=function(a,b,c){"function"===typeof e[a]&&b&&e[a].apply(this,c)};l("onChange",!0===h,k);l("onKeyPress",!0===h,k);l("onComplete",g.length===d.length,k);l("onInvalid",0<c.invalid.length,[g,a,b,c.invalid,e])}};b=a(b);var l=this,f=c.val(),k;d="function"===typeof d?d(c.val(),void 0,b,e):d;l.mask=
12656d;l.options=e;l.remove=function(){var a=c.getCaret();l.options.placeholder&&b.removeAttr("placeholder");b.data("mask-maxlength")&&b.removeAttr("maxlength");c.destroyEvents();c.val(l.getCleanVal());c.setCaret(a);return b};l.getCleanVal=function(){return c.getMasked(!0)};l.getMaskedVal=function(a){return c.getMasked(!1,a)};l.init=function(g){g=g||!1;e=e||{};l.clearIfNotMatch=a.jMaskGlobals.clearIfNotMatch;l.byPassKeys=a.jMaskGlobals.byPassKeys;l.translation=a.extend({},a.jMaskGlobals.translation,e.translation);
12657l=a.extend(!0,{},l,e);k=c.getRegexMask();if(g)c.events(),c.val(c.getMasked());else{e.placeholder&&b.attr("placeholder",e.placeholder);b.data("mask")&&b.attr("autocomplete","off");g=0;for(var f=!0;g<d.length;g++){var h=l.translation[d.charAt(g)];if(h&&h.recursive){f=!1;break}}f&&b.attr("maxlength",d.length).data("mask-maxlength",!0);c.destroyEvents();c.events();g=c.getCaret();c.val(c.getMasked());c.setCaret(g)}};l.init(!b.is("input"))};a.maskWatchers={};var f=function(){var b=a(this),d={},e=b.attr("data-mask");
12658b.attr("data-mask-reverse")&&(d.reverse=!0);b.attr("data-mask-clearifnotmatch")&&(d.clearIfNotMatch=!0);"true"===b.attr("data-mask-selectonfocus")&&(d.selectOnFocus=!0);if(p(b,e,d))return b.data("mask",new n(this,e,d))},p=function(b,d,e){e=e||{};var c=a(b).data("mask"),f=JSON.stringify;b=a(b).val()||a(b).text();try{return"function"===typeof d&&(d=d(b)),"object"!==typeof c||f(c.options)!==f(e)||c.mask!==d}catch(w){}},k=function(a){var b=document.createElement("div");a="on"+a;var e=a in b;e||(b.setAttribute(a,
12659"return;"),e="function"===typeof b[a]);return e};a.fn.mask=function(b,d){d=d||{};var e=this.selector,c=a.jMaskGlobals,f=c.watchInterval;c=d.watchInputs||c.watchInputs;var k=function(){if(p(this,b,d))return a(this).data("mask",new n(this,b,d))};a(this).each(k);e&&""!==e&&c&&(clearInterval(a.maskWatchers[e]),a.maskWatchers[e]=setInterval(function(){a(document).find(e).each(k)},f));return this};a.fn.masked=function(a){return this.data("mask").getMaskedVal(a)};a.fn.unmask=function(){clearInterval(a.maskWatchers[this.selector]);
12660delete a.maskWatchers[this.selector];return this.each(function(){var b=a(this).data("mask");b&&b.remove().removeData("mask")})};a.fn.cleanVal=function(){return this.data("mask").getCleanVal()};a.applyDataMask=function(b){b=b||a.jMaskGlobals.maskElements;(b instanceof a?b:a(b)).filter(a.jMaskGlobals.dataMaskAttr).each(f)};k={maskElements:"input,td,span,div",dataMaskAttr:"*[data-mask]",dataMask:!0,watchInterval:300,watchInputs:!0,keyStrokeCompensation:10,useInput:!/Chrome\/[2-4][0-9]|SamsungBrowser/.test(window.navigator.userAgent)&&
12661k("input"),watchDataMask:!1,byPassKeys:[9,16,17,18,36,37,38,39,40,91],translation:{0:{pattern:/\d/},9:{pattern:/\d/,optional:!0},"#":{pattern:/\d/,recursive:!0},A:{pattern:/[a-zA-Z0-9]/},S:{pattern:/[a-zA-Z]/}}};
12661a.jMaskGlobals=a.jMaskGlobals||{};k=a.jMaskGlobals=a.extend(!0,{},k,a.jMaskGlobals);k.dataMask&&a.applyDataMask();setInterval(function(){a.jMaskGlobals.watchDataMask&&a.applyDataMask()},k.watchInterval)},window.jQuery,window.Zepto);
12662
12663/*!
12664 * clipboard.js v2.0.11
12665 * https://clipboardjs.com/
12666 *
12667 * Licensed MIT © Zeno Rocha
12668 */�
vendor: 9,068 bytes, lines 12668-12669
12668
12669!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return n={686:function(t,e,n){"use strict";n.d(e,{default:function(){return b}});var e=n(279),i=n.n(e),e=n(370),u=n.n(e),e=n(817),r=n.n(e);function c(t){try{return document.execCommand(t)}catch(t){return}}var a=function(t){t=r()(t);return c("cut"),t};function o(t,e){var n,o,t=(n=t,o="rtl"===document.documentElement.getAttribute("dir"),(t=document.createElement("textarea")).style.fontSize="12pt",t.style.border="0",t.style.padding="0",t.style.margin="0",t.style.position="absolute",t.style[o?"right":"left"]="-9999px",o=window.pageYOffset||document.documentElement.scrollTop,t.style.top="".concat(o,"px"),t.setAttribute("readonly",""),t.value=n,t);return e.container.appendChild(t),e=r()(t),c("copy"),t.remove(),e}var f=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{container:document.body},n="";return"string"==typeof t?n=o(t,e):t instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(null==t?void 0:t.type)?n=o(t.value,e):(n=r()(t),c("copy")),n};function l(t){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var s=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=t.action,n=void 0===e?"copy":e,o=t.container,e=t.target,t=t.text;if("copy"!==n&&"cut"!==n)throw new Error('Invalid "action" value, use either "copy" or "cut"');if(void 0!==e){if(!e||"object"!==l(e)||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===n&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===n&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes')}return t?f(t,{container:o}):e?"cut"===n?a(e):f(e,{container:o}):void 0};function p(t){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function d(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function y(t,e){return(y=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function h(n){var o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=v(n);return t=o?(t=v(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments),e=this,!(t=t)||"object"!==p(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}}function v(t){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function m(t,e){t="data-clipboard-".concat(t);if(e.hasAttribute(t))return e.getAttribute(t)}var b=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&y(t,e)}(r,i());var t,e,n,o=h(r);function r(t,e){var n;return function(t){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this),(n=o.call(this)).resolveOptions(e),n.listenClick(t),n}return t=r,n=[{key:"copy",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{container:document.body};return f(t,e)}},{key:"cut",value:function(t){return a(t)}},{key:"isSupported",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"==typeof t?[t]:t,e=!!document.queryCommandSupported;return t.forEach(function(t){e=e&&!!document.queryCommandSupported(t)}),e}}],(e=[{key:"resolveOptions",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===p(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=u()(t,"click",function(t){return e.onClick(t)})}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget,n=this.action(e)||"copy",t=s({action:n,container:this.container,target:this.target(e),text:this.text(e)});this.emit(t?"success":"error",{action:n,text:t,trigger:e,clearSelection:function(){e&&e.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(t){return m("action",t)}},{key:"defaultTarget",value:function(t){t=m("target",t);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(t){return m("text",t)}},{key:"destroy",value:function(){this.listener.destroy()}}])&&d(t.prototype,e),n&&d(t,n),r}()},828:function(t){var e;"undefined"==typeof Element||Element.prototype.matches||((e=Element.prototype).matches=e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector),t.exports=function(t,e){for(;t&&9!==t.nodeType;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}},438:function(t,e,n){var u=n(828);function i(t,e,n,o,r){var i=function(e,n,t,o){return function(t){t.delegateTarget=u(t.target,n),t.delegateTarget&&o.call(e,t)}}.apply(this,arguments);return t.addEventListener(n,i,r),{destroy:function(){t.removeEventListener(n,i,r)}}}t.exports=function(t,e,n,o,r){return"function"==typeof t.addEventListener?i.apply(null,arguments):"function"==typeof n?i.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,function(t){return i(t,e,n,o,r)}))}},879:function(t,n){n.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},n.nodeList=function(t){var e=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===e||"[object HTMLCollection]"===e)&&"length"in t&&(0===t.length||n.node(t[0]))},n.string=function(t){return"string"==typeof t||t instanceof String},n.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},370:function(t,e,n){var f=n(879),l=n(438);t.exports=function(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!f.string(e))throw new TypeError("Second argument must be a String");if(!f.fn(n))throw new TypeError("Third argument must be a Function");if(f.node(t))return c=e,a=n,(u=t).addEventListener(c,a),{destroy:function(){u.removeEventListener(c,a)}};if(f.nodeList(t))return o=t,r=e,i=n,Array.prototype.forEach.call(o,function(t){t.addEventListener(r,i)}),{destroy:function(){Array.prototype.forEach.call(o,function(t){t.removeEventListener(r,i)})}};if(f.string(t))return t=t,e=e,n=n,l(document.body,t,e,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");var o,r,i,u,c,a}},817:function(t){t.exports=function(t){var e,n="SELECT"===t.nodeName?(t.focus(),t.value):"INPUT"===t.nodeName||"TEXTAREA"===t.nodeName?((e=t.hasAttribute("readonly"))||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),e||t.removeAttribute("readonly"),t.value):(t.hasAttribute("contenteditable")&&t.focus(),n=window.getSelection(),(e=document.createRange()).selectNodeContents(t),n.removeAllRanges(),n.addRange(e),n.toString());return n}},279:function(t){function e(){}e.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){var o=this;function r(){o.off(t,r),e.apply(n,arguments)}return r._=e,this.on(t,r,n)},emit:function(t){for(var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,r=n.length;o<r;o++)n[o].fn.apply(n[o].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),o=n[t],r=[];if(o&&e)for(var i=0,u=o.length;i<u;i++)o[i].fn!==e&&o[i].fn._!==e&&r.push(o[i]);return r.length?n[t]=r:delete n[t],this}},t.exports=e,t.exports.TinyEmitter=e}},r={},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,{a:e}),e},o.d=function(t,e){for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o(686).default;function o(t){if(r[t])return r[t].exports;var e=r[t]={exports:{}};return n[t](e,e.exports,o),e.exports}var n,r});
12669
12670
12671/*
12672	 _ _      _       _
12673 ___| (_) ___| | __  (_)___
12674/ __| | |/ __| |/ /  | / __|
12675\__ \ | | (__|   < _ | \__ \
12676|___/_|_|\___|_|\_(_)/ |___/
12677					 |__/
12678 Version: 1.9.0
12679	Author: Ken Wheeler
12680 Website: http://kenwheeler.github.io
12681	Docs: http://kenwheeler.github.io/slick
12682	Repo: http://github.com/kenwheeler/slick
12683	Issues: http://github.com/kenwheeler/slick/issues
12684 */�
vendor: 32,027 bytes, lines 12684-12685
12684
12685(function(i){"use strict";"function"==typeof define&&define.amd?define(["jquery"],i):"undefined"!=typeof exports?module.exports=i(require("jquery")):i(jQuery)})(function(i){"use strict";var e=window.Slick||{};e=function(){function e(e,o){var s,n=this;n.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:i(e),appendDots:i(e),arrows:!0,asNavFor:null,prevArrow:'<button class="slick-prev" aria-label="Previous" type="button">Previous</button>',nextArrow:'<button class="slick-next" aria-label="Next" type="button">Next</button>',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(e,t){return i('<button type="button" />').text(t+1)},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,focusOnChange:!1,infinite:!0,initialSlide:0,lazyLoad:"ondemand",mobileFirst:!1,pauseOnHover:!0,pauseOnFocus:!0,pauseOnDotsHover:!1,respondTo:"window",responsive:null,rows:1,rtl:!1,slide:"",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,useTransform:!0,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0,zIndex:1e3},n.initials={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,scrolling:!1,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,swiping:!1,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1},i.extend(n,n.initials),n.activeBreakpoint=null,n.animType=null,n.animProp=null,n.breakpoints=[],n.breakpointSettings=[],n.cssTransitions=!1,n.focussed=!1,n.interrupted=!1,n.hidden="hidden",n.paused=!0,n.positionProp=null,n.respondTo=null,n.rowCount=1,n.shouldClick=!0,n.$slider=i(e),n.$slidesCache=null,n.transformType=null,n.transitionType=null,n.visibilityChange="visibilitychange",n.windowWidth=0,n.windowTimer=null,s=i(e).data("slick")||{},n.options=i.extend({},n.defaults,o,s),n.currentSlide=n.options.initialSlide,n.originalSettings=n.options,"undefined"!=typeof document.mozHidden?(n.hidden="mozHidden",n.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(n.hidden="webkitHidden",n.visibilityChange="webkitvisibilitychange"),n.autoPlay=i.proxy(n.autoPlay,n),n.autoPlayClear=i.proxy(n.autoPlayClear,n),n.autoPlayIterator=i.proxy(n.autoPlayIterator,n),n.changeSlide=i.proxy(n.changeSlide,n),n.clickHandler=i.proxy(n.clickHandler,n),n.selectHandler=i.proxy(n.selectHandler,n),n.setPosition=i.proxy(n.setPosition,n),n.swipeHandler=i.proxy(n.swipeHandler,n),n.dragHandler=i.proxy(n.dragHandler,n),n.keyHandler=i.proxy(n.keyHandler,n),n.instanceUid=t++,n.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/,n.registerBreakpoints(),n.init(!0)}var t=0;return e}(),e.prototype.activateADA=function(){var i=this;i.$slideTrack.find(".slick-active").attr({"aria-hidden":"false"}).find("a, input, button, select").attr({tabindex:"0"})},e.prototype.addSlide=e.prototype.slickAdd=function(e,t,o){var s=this;if("boolean"==typeof t)o=t,t=null;else if(t<0||t>=s.slideCount)return!1;s.unload(),"number"==typeof t?0===t&&0===s.$slides.length?i(e).appendTo(s.$slideTrack):o?i(e).insertBefore(s.$slides.eq(t)):i(e).insertAfter(s.$slides.eq(t)):o===!0?i(e).prependTo(s.$slideTrack):i(e).appendTo(s.$slideTrack),s.$slides=s.$slideTrack.children(this.options.slide),s.$slideTrack.children(this.options.slide).detach(),s.$slideTrack.append(s.$slides),s.$slides.each(function(e,t){i(t).attr("data-slick-index",e)}),s.$slidesCache=s.$slides,s.reinit()},e.prototype.animateHeight=function(){var i=this;if(1===i.options.slidesToShow&&i.options.adaptiveHeight===!0&&i.options.vertical===!1){var e=i.$slides.eq(i.currentSlide).outerHeight(!0);i.$list.animate({height:e},i.options.speed)}},e.prototype.animateSlide=function(e,t){var o={},s=this;s.animateHeight(),s.options.rtl===!0&&s.options.vertical===!1&&(e=-e),s.transformsEnabled===!1?s.options.vertical===!1?s.$slideTrack.animate({left:e},s.options.speed,s.options.easing,t):s.$slideTrack.animate({top:e},s.options.speed,s.options.easing,t):s.cssTransitions===!1?(s.options.rtl===!0&&(s.currentLeft=-s.currentLeft),i({animStart:s.currentLeft}).animate({animStart:e},{duration:s.options.speed,easing:s.options.easing,step:function(i){i=Math.ceil(i),s.options.vertical===!1?(o[s.animType]="translate("+i+"px, 0px)",s.$slideTrack.css(o)):(o[s.animType]="translate(0px,"+i+"px)",s.$slideTrack.css(o))},complete:function(){t&&t.call()}})):(s.applyTransition(),e=Math.ceil(e),s.options.vertical===!1?o[s.animType]="translate3d("+e+"px, 0px, 0px)":o[s.animType]="translate3d(0px,"+e+"px, 0px)",s.$slideTrack.css(o),t&&setTimeout(function(){s.disableTransition(),t.call()},s.options.speed))},e.prototype.getNavTarget=function(){var e=this,t=e.options.asNavFor;return t&&null!==t&&(t=i(t).not(e.$slider)),t},e.prototype.asNavFor=function(e){var t=this,o=t.getNavTarget();null!==o&&"object"==typeof o&&o.each(function(){var t=i(this).slick("getSlick");t.unslicked||t.slideHandler(e,!0)})},e.prototype.applyTransition=function(i){var e=this,t={};e.options.fade===!1?t[e.transitionType]=e.transformType+" "+e.options.speed+"ms "+e.options.cssEase:t[e.transitionType]="opacity "+e.options.speed+"ms "+e.options.cssEase,e.options.fade===!1?e.$slideTrack.css(t):e.$slides.eq(i).css(t)},e.prototype.autoPlay=function(){var i=this;i.autoPlayClear(),i.slideCount>i.options.slidesToShow&&(i.autoPlayTimer=setInterval(i.autoPlayIterator,i.options.autoplaySpeed))},e.prototype.autoPlayClear=function(){var i=this;i.autoPlayTimer&&clearInterval(i.autoPlayTimer)},e.prototype.autoPlayIterator=function(){var i=this,e=i.currentSlide+i.options.slidesToScroll;i.paused||i.interrupted||i.focussed||(i.options.infinite===!1&&(1===i.direction&&i.currentSlide+1===i.slideCount-1?i.direction=0:0===i.direction&&(e=i.currentSlide-i.options.slidesToScroll,i.currentSlide-1===0&&(i.direction=1))),i.slideHandler(e))},e.prototype.buildArrows=function(){var e=this;e.options.arrows===!0&&(e.$prevArrow=i(e.options.prevArrow).addClass("slick-arrow"),e.$nextArrow=i(e.options.nextArrow).addClass("slick-arrow"),e.slideCount>e.options.slidesToShow?(e.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),e.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),e.htmlExpr.test(e.options.prevArrow)&&e.$prevArrow.prependTo(e.options.appendArrows),e.htmlExpr.test(e.options.nextArrow)&&e.$nextArrow.appendTo(e.options.appendArrows),e.options.infinite!==!0&&e.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true")):e.$prevArrow.add(e.$nextArrow).addClass("slick-hidden").attr({"aria-disabled":"true",tabindex:"-1"}))},e.prototype.buildDots=function(){var e,t,o=this;if(o.options.dots===!0&&o.slideCount>o.options.slidesToShow){for(o.$slider.addClass("slick-dotted"),t=i("<ul />").addClass(o.options.dotsClass),e=0;e<=o.getDotCount();e+=1)t.append(i("<li />").append(o.options.customPaging.call(this,o,e)));o.$dots=t.appendTo(o.options.appendDots),o.$dots.find("li").first().addClass("slick-active")}},e.prototype.buildOut=function(){var e=this;e.$slides=e.$slider.children(e.options.slide+":not(.slick-cloned)").addClass("slick-slide"),e.slideCount=e.$slides.length,e.$slides.each(function(e,t){i(t).attr("data-slick-index",e).data("originalStyling",i(t).attr("style")||"")}),e.$slider.addClass("slick-slider"),e.$slideTrack=0===e.slideCount?i('<div class="slick-track"/>').appendTo(e.$slider):e.$slides.wrapAll('<div class="slick-track"/>').parent(),e.$list=e.$slideTrack.wrap('<div class="slick-list"/>').parent(),e.$slideTrack.css("opacity",0),e.options.centerMode!==!0&&e.options.swipeToSlide!==!0||(e.options.slidesToScroll=1),i("img[data-lazy]",e.$slider).not("[src]").addClass("slick-loading"),e.setupInfinite(),e.buildArrows(),e.buildDots(),e.updateDots(),e.setSlideClasses("number"==typeof e.currentSlide?e.currentSlide:0),e.options.draggable===!0&&e.$list.addClass("draggable")},e.prototype.buildRows=function(){var i,e,t,o,s,n,r,l=this;if(o=document.createDocumentFragment(),n=l.$slider.children(),l.options.rows>0){for(r=l.options.slidesPerRow*l.options.rows,s=Math.ceil(n.length/r),i=0;i<s;i++){var d=document.createElement("div");for(e=0;e<l.options.rows;e++){var a=document.createElement("div");for(t=0;t<l.options.slidesPerRow;t++){var c=i*r+(e*l.options.slidesPerRow+t);n.get(c)&&a.appendChild(n.get(c))}d.appendChild(a)}o.appendChild(d)}l.$slider.empty().append(o),l.$slider.children().children().children().css({width:100/l.options.slidesPerRow+"%",display:"inline-block"})}},e.prototype.checkResponsive=function(e,t){var o,s,n,r=this,l=!1,d=r.$slider.width(),a=window.innerWidth||i(window).width();if("window"===r.respondTo?n=a:"slider"===r.respondTo?n=d:"min"===r.respondTo&&(n=Math.min(a,d)),r.options.responsive&&r.options.responsive.length&&null!==r.options.responsive){s=null;for(o in r.breakpoints)r.breakpoints.hasOwnProperty(o)&&(r.originalSettings.mobileFirst===!1?n<r.breakpoints[o]&&(s=r.breakpoints[o]):n>r.breakpoints[o]&&(s=r.breakpoints[o]));null!==s?null!==r.activeBreakpoint?(s!==r.activeBreakpoint||t)&&(r.activeBreakpoint=s,"unslick"===r.breakpointSettings[s]?r.unslick(s):(r.options=i.extend({},r.originalSettings,r.breakpointSettings[s]),e===!0&&(r.currentSlide=r.options.initialSlide),r.refresh(e)),l=s):(r.activeBreakpoint=s,"unslick"===r.breakpointSettings[s]?r.unslick(s):(r.options=i.extend({},r.originalSettings,r.breakpointSettings[s]),e===!0&&(r.currentSlide=r.options.initialSlide),r.refresh(e)),l=s):null!==r.activeBreakpoint&&(r.activeBreakpoint=null,r.options=r.originalSettings,e===!0&&(r.currentSlide=r.options.initialSlide),r.refresh(e),l=s),e||l===!1||r.$slider.trigger("breakpoint",[r,l])}},e.prototype.changeSlide=function(e,t){var o,s,n,r=this,l=i(e.currentTarget);switch(l.is("a")&&e.preventDefault(),l.is("li")||(l=l.closest("li")),n=r.slideCount%r.options.slidesToScroll!==0,o=n?0:(r.slideCount-r.currentSlide)%r.options.slidesToScroll,e.data.message){case"previous":s=0===o?r.options.slidesToScroll:r.options.slidesToShow-o,r.slideCount>r.options.slidesToShow&&r.slideHandler(r.currentSlide-s,!1,t);break;case"next":s=0===o?r.options.slidesToScroll:o,r.slideCount>r.options.slidesToShow&&r.slideHandler(r.currentSlide+s,!1,t);break;case"index":var d=0===e.data.index?0:e.data.index||l.index()*r.options.slidesToScroll;r.slideHandler(r.checkNavigable(d),!1,t),l.children().trigger("focus");break;default:return}},e.prototype.checkNavigable=function(i){var e,t,o=this;if(e=o.getNavigableIndexes(),t=0,i>e[e.length-1])i=e[e.length-1];else for(var s in e){if(i<e[s]){i=t;break}t=e[s]}return i},e.prototype.cleanUpEvents=function(){var e=this;e.options.dots&&null!==e.$dots&&(i("li",e.$dots).off("click.slick",e.changeSlide).off("mouseenter.slick",i.proxy(e.interrupt,e,!0)).off("mouseleave.slick",i.proxy(e.interrupt,e,!1)),e.options.accessibility===!0&&e.$dots.off("keydown.slick",e.keyHandler)),e.$slider.off("focus.slick blur.slick"),e.options.arrows===!0&&e.slideCount>e.options.slidesToShow&&(e.$prevArrow&&e.$prevArrow.off("click.slick",e.changeSlide),e.$nextArrow&&e.$nextArrow.off("click.slick",e.changeSlide),e.options.accessibility===!0&&(e.$prevArrow&&e.$prevArrow.off("keydown.slick",e.keyHandler),e.$nextArrow&&e.$nextArrow.off("keydown.slick",e.keyHandler))),e.$list.off("touchstart.slick mousedown.slick",e.swipeHandler),e.$list.off("touchmove.slick mousemove.slick",e.swipeHandler),e.$list.off("touchend.slick mouseup.slick",e.swipeHandler),e.$list.off("touchcancel.slick mouseleave.slick",e.swipeHandler),e.$list.off("click.slick",e.clickHandler),i(document).off(e.visibilityChange,e.visibility),e.cleanUpSlideEvents(),e.options.accessibility===!0&&e.$list.off("keydown.slick",e.keyHandler),e.options.focusOnSelect===!0&&i(e.$slideTrack).children().off("click.slick",e.selectHandler),i(window).off("orientationchange.slick.slick-"+e.instanceUid,e.orientationChange),i(window).off("resize.slick.slick-"+e.instanceUid,e.resize),i("[draggable!=true]",e.$slideTrack).off("dragstart",e.preventDefault),i(window).off("load.slick.slick-"+e.instanceUid,e.setPosition)},e.prototype.cleanUpSlideEvents=function(){var e=this;e.$list.off("mouseenter.slick",i.proxy(e.interrupt,e,!0)),e.$list.off("mouseleave.slick",i.proxy(e.interrupt,e,!1))},e.prototype.cleanUpRows=function(){var i,e=this;e.options.rows>0&&(i=e.$slides.children().children(),i.removeAttr("style"),e.$slider.empty().append(i))},e.prototype.clickHandler=function(i){var e=this;e.shouldClick===!1&&(i.stopImmediatePropagation(),i.stopPropagation(),i.preventDefault())},e.prototype.destroy=function(e){var t=this;t.autoPlayClear(),t.touchObject={},t.cleanUpEvents(),i(".slick-cloned",t.$slider).detach(),t.$dots&&t.$dots.remove(),t.$prevArrow&&t.$prevArrow.length&&(t.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),t.htmlExpr.test(t.options.prevArrow)&&t.$prevArrow.remove()),t.$nextArrow&&t.$nextArrow.length&&(t.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),t.htmlExpr.test(t.options.nextArrow)&&t.$nextArrow.remove()),t.$slides&&(t.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function(){i(this).attr("style",i(this).data("originalStyling"))}),t.$slideTrack.children(this.options.slide).detach(),t.$slideTrack.detach(),t.$list.detach(),t.$slider.append(t.$slides)),t.cleanUpRows(),t.$slider.removeClass("slick-slider"),t.$slider.removeClass("slick-initialized"),t.$slider.removeClass("slick-dotted"),t.unslicked=!0,e||t.$slider.trigger("destroy",[t])},e.prototype.disableTransition=function(i){var e=this,t={};t[e.transitionType]="",e.options.fade===!1?e.$slideTrack.css(t):e.$slides.eq(i).css(t)},e.prototype.fadeSlide=function(i,e){var t=this;t.cssTransitions===!1?(t.$slides.eq(i).css({zIndex:t.options.zIndex}),t.$slides.eq(i).animate({opacity:1},t.options.speed,t.options.easing,e)):(t.applyTransition(i),t.$slides.eq(i).css({opacity:1,zIndex:t.options.zIndex}),e&&setTimeout(function(){t.disableTransition(i),e.call()},t.options.speed))},e.prototype.fadeSlideOut=function(i){var e=this;e.cssTransitions===!1?e.$slides.eq(i).animate({opacity:0,zIndex:e.options.zIndex-2},e.options.speed,e.options.easing):(e.applyTransition(i),e.$slides.eq(i).css({opacity:0,zIndex:e.options.zIndex-2}))},e.prototype.filterSlides=e.prototype.slickFilter=function(i){var e=this;null!==i&&(e.$slidesCache=e.$slides,e.unload(),e.$slideTrack.children(this.options.slide).detach(),e.$slidesCache.filter(i).appendTo(e.$slideTrack),e.reinit())},e.prototype.focusHandler=function(){var e=this;e.$slider.off("focus.slick blur.slick").on("focus.slick","*",function(t){var o=i(this);setTimeout(function(){e.options.pauseOnFocus&&o.is(":focus")&&(e.focussed=!0,e.autoPlay())},0)}).on("blur.slick","*",function(t){i(this);e.options.pauseOnFocus&&(e.focussed=!1,e.autoPlay())})},e.prototype.getCurrent=e.prototype.slickCurrentSlide=function(){var i=this;return i.currentSlide},e.prototype.getDotCount=function(){var i=this,e=0,t=0,o=0;if(i.options.infinite===!0)if(i.slideCount<=i.options.slidesToShow)++o;else for(;e<i.slideCount;)++o,e=t+i.options.slidesToScroll,t+=i.options.slidesToScroll<=i.options.slidesToShow?i.options.slidesToScroll:i.options.slidesToShow;else if(i.options.centerMode===!0)o=i.slideCount;else if(i.options.asNavFor)for(;e<i.slideCount;)++o,e=t+i.options.slidesToScroll,t+=i.options.slidesToScroll<=i.options.slidesToShow?i.options.slidesToScroll:i.options.slidesToShow;else o=1+Math.ceil((i.slideCount-i.options.slidesToShow)/i.options.slidesToScroll);return o-1},e.prototype.getLeft=function(i){var e,t,o,s,n=this,r=0;return n.slideOffset=0,t=n.$slides.first().outerHeight(!0),n.options.infinite===!0?(n.slideCount>n.options.slidesToShow&&(n.slideOffset=n.slideWidth*n.options.slidesToShow*-1,s=-1,n.options.vertical===!0&&n.options.centerMode===!0&&(2===n.options.slidesToShow?s=-1.5:1===n.options.slidesToShow&&(s=-2)),r=t*n.options.slidesToShow*s),n.slideCount%n.options.slidesToScroll!==0&&i+n.options.slidesToScroll>n.slideCount&&n.slideCount>n.options.slidesToShow&&(i>n.slideCount?(n.slideOffset=(n.options.slidesToShow-(i-n.slideCount))*n.slideWidth*-1,r=(n.options.slidesToShow-(i-n.slideCount))*t*-1):(n.slideOffset=n.slideCount%n.options.slidesToScroll*n.slideWidth*-1,r=n.slideCount%n.options.slidesToScroll*t*-1))):i+n.options.slidesToShow>n.slideCount&&(n.slideOffset=(i+n.options.slidesToShow-n.slideCount)*n.slideWidth,r=(i+n.options.slidesToShow-n.slideCount)*t),n.slideCount<=n.options.slidesToShow&&(n.slideOffset=0,r=0),n.options.centerMode===!0&&n.slideCount<=n.options.slidesToShow?n.slideOffset=n.slideWidth*Math.floor(n.options.slidesToShow)/2-n.slideWidth*n.slideCount/2:n.options.centerMode===!0&&n.options.infinite===!0?n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)-n.slideWidth:n.options.centerMode===!0&&(n.slideOffset=0,n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)),e=n.options.vertical===!1?i*n.slideWidth*-1+n.slideOffset:i*t*-1+r,n.options.variableWidth===!0&&(o=n.slideCount<=n.options.slidesToShow||n.options.infinite===!1?n.$slideTrack.children(".slick-slide").eq(i):n.$slideTrack.children(".slick-slide").eq(i+n.options.slidesToShow),e=n.options.rtl===!0?o[0]?(n.$slideTrack.width()-o[0].offsetLeft-o.width())*-1:0:o[0]?o[0].offsetLeft*-1:0,n.options.centerMode===!0&&(o=n.slideCount<=n.options.slidesToShow||n.options.infinite===!1?n.$slideTrack.children(".slick-slide").eq(i):n.$slideTrack.children(".slick-slide").eq(i+n.options.slidesToShow+1),e=n.options.rtl===!0?o[0]?(n.$slideTrack.width()-o[0].offsetLeft-o.width())*-1:0:o[0]?o[0].offsetLeft*-1:0,e+=(n.$list.width()-o.outerWidth())/2)),e},e.prototype.getOption=e.prototype.slickGetOption=function(i){var e=this;return e.options[i]},e.prototype.getNavigableIndexes=function(){var i,e=this,t=0,o=0,s=[];for(e.options.infinite===!1?i=e.slideCount:(t=e.options.slidesToScroll*-1,o=e.options.slidesToScroll*-1,i=2*e.slideCount);t<i;)s.push(t),t=o+e.options.slidesToScroll,o+=e.options.slidesToScroll<=e.options.slidesToShow?e.options.slidesToScroll:e.options.slidesToShow;return s},e.prototype.getSlick=function(){return this},e.prototype.getSlideCount=function(){var e,t,o,s,n=this;return s=n.options.centerMode===!0?Math.floor(n.$list.width()/2):0,o=n.swipeLeft*-1+s,n.options.swipeToSlide===!0?(n.$slideTrack.find(".slick-slide").each(function(e,s){var r,l,d;if(r=i(s).outerWidth(),l=s.offsetLeft,n.options.centerMode!==!0&&(l+=r/2),d=l+r,o<d)return t=s,!1}),e=Math.abs(i(t).attr("data-slick-index")-n.currentSlide)||1):n.options.slidesToScroll},e.prototype.goTo=e.prototype.slickGoTo=function(i,e){var t=this;t.changeSlide({data:{message:"index",index:parseInt(i)}},e)},e.prototype.init=function(e){var t=this;i(t.$slider).hasClass("slick-initialized")||(i(t.$slider).addClass("slick-initialized"),t.buildRows(),t.buildOut(),t.setProps(),t.startLoad(),t.loadSlider(),t.initializeEvents(),t.updateArrows(),t.updateDots(),t.checkResponsive(!0),t.focusHandler()),e&&t.$slider.trigger("init",[t]),t.options.accessibility===!0&&t.initADA(),t.options.autoplay&&(t.paused=!1,t.autoPlay())},e.prototype.initADA=function(){var e=this,t=Math.ceil(e.slideCount/e.options.slidesToShow),o=e.getNavigableIndexes().filter(function(i){return i>=0&&i<e.slideCount});e.$slides.add(e.$slideTrack.find(".slick-cloned")).attr({"aria-hidden":"true",tabindex:"-1"}).find("a, input, button, select").attr({tabindex:"-1"}),null!==e.$dots&&(e.$slides.not(e.$slideTrack.find(".slick-cloned")).each(function(t){var s=o.indexOf(t);if(i(this).attr({role:"tabpanel",id:"slick-slide"+e.instanceUid+t,tabindex:-1}),s!==-1){var n="slick-slide-control"+e.instanceUid+s;i("#"+n).length&&i(this).attr({"aria-describedby":n})}}),e.$dots.attr("role","tablist").find("li").each(function(s){var n=o[s];i(this).attr({role:"presentation"}),i(this).find("button").first().attr({role:"tab",id:"slick-slide-control"+e.instanceUid+s,"aria-controls":"slick-slide"+e.instanceUid+n,"aria-label":s+1+" of "+t,"aria-selected":null,tabindex:"-1"})}).eq(e.currentSlide).find("button").attr({"aria-selected":"true",tabindex:"0"}).end());for(var s=e.currentSlide,n=s+e.options.slidesToShow;s<n;s++)e.options.focusOnChange?e.$slides.eq(s).attr({tabindex:"0"}):e.$slides.eq(s).removeAttr("tabindex");e.activateADA()},e.prototype.initArrowEvents=function(){var i=this;i.options.arrows===!0&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.off("click.slick").on("click.slick",{message:"previous"},i.changeSlide),i.$nextArrow.off("click.slick").on("click.slick",{message:"next"},i.changeSlide),i.options.accessibility===!0&&(i.$prevArrow.on("keydown.slick",i.keyHandler),i.$nextArrow.on("keydown.slick",i.keyHandler)))},e.prototype.initDotEvents=function(){var e=this;e.options.dots===!0&&e.slideCount>e.options.slidesToShow&&(i("li",e.$dots).on("click.slick",{message:"index"},e.changeSlide),e.options.accessibility===!0&&e.$dots.on("keydown.slick",e.keyHandler)),e.options.dots===!0&&e.options.pauseOnDotsHover===!0&&e.slideCount>e.options.slidesToShow&&i("li",e.$dots).on("mouseenter.slick",i.proxy(e.interrupt,e,!0)).on("mouseleave.slick",i.proxy(e.interrupt,e,!1))},e.prototype.initSlideEvents=function(){var e=this;e.options.pauseOnHover&&(e.$list.on("mouseenter.slick",i.proxy(e.interrupt,e,!0)),e.$list.on("mouseleave.slick",i.proxy(e.interrupt,e,!1)))},e.prototype.initializeEvents=function(){var e=this;e.initArrowEvents(),e.initDotEvents(),e.initSlideEvents(),e.$list.on("touchstart.slick mousedown.slick",{action:"start"},e.swipeHandler),e.$list.on("touchmove.slick mousemove.slick",{action:"move"},e.swipeHandler),e.$list.on("touchend.slick mouseup.slick",{action:"end"},e.swipeHandler),e.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},e.swipeHandler),e.$list.on("click.slick",e.clickHandler),i(document).on(e.visibilityChange,i.proxy(e.visibility,e)),e.options.accessibility===!0&&e.$list.on("keydown.slick",e.keyHandler),e.options.focusOnSelect===!0&&i(e.$slideTrack).children().on("click.slick",e.selectHandler),i(window).on("orientationchange.slick.slick-"+e.instanceUid,i.proxy(e.orientationChange,e)),i(window).on("resize.slick.slick-"+e.instanceUid,i.proxy(e.resize,e)),i("[draggable!=true]",e.$slideTrack).on("dragstart",e.preventDefault),i(window).on("load.slick.slick-"+e.instanceUid,e.setPosition),i(e.setPosition)},e.prototype.initUI=function(){var i=this;i.options.arrows===!0&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.show(),i.$nextArrow.show()),i.options.dots===!0&&i.slideCount>i.options.slidesToShow&&i.$dots.show()},e.prototype.keyHandler=function(i){var e=this;i.target.tagName.match("TEXTAREA|INPUT|SELECT")||(37===i.keyCode&&e.options.accessibility===!0?e.changeSlide({data:{message:e.options.rtl===!0?"next":"previous"}}):39===i.keyCode&&e.options.accessibility===!0&&e.changeSlide({data:{message:e.options.rtl===!0?"previous":"next"}}))},e.prototype.lazyLoad=function(){function e(e){i("img[data-lazy]",e).each(function(){var e=i(this),t=i(this).attr("data-lazy"),o=i(this).attr("data-srcset"),s=i(this).attr("data-sizes")||r.$slider.attr("data-sizes"),n=document.createElement("img");n.onload=function(){e.animate({opacity:0},100,function(){o&&(e.attr("srcset",o),s&&e.attr("sizes",s)),e.attr("src",t).animate({opacity:1},200,function(){e.removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading")}),r.$slider.trigger("lazyLoaded",[r,e,t])})},n.onerror=function(){e.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),r.$slider.trigger("lazyLoadError",[r,e,t])},n.src=t})}var t,o,s,n,r=this;if(r.options.centerMode===!0?r.options.infinite===!0?(s=r.currentSlide+(r.options.slidesToShow/2+1),n=s+r.options.slidesToShow+2):(s=Math.max(0,r.currentSlide-(r.options.slidesToShow/2+1)),n=2+(r.options.slidesToShow/2+1)+r.currentSlide):(s=r.options.infinite?r.options.slidesToShow+r.currentSlide:r.currentSlide,n=Math.ceil(s+r.options.slidesToShow),r.options.fade===!0&&(s>0&&s--,n<=r.slideCount&&n++)),t=r.$slider.find(".slick-slide").slice(s,n),"anticipated"===r.options.lazyLoad)for(var l=s-1,d=n,a=r.$slider.find(".slick-slide"),c=0;c<r.options.slidesToScroll;c++)l<0&&(l=r.slideCount-1),t=t.add(a.eq(l)),t=t.add(a.eq(d)),l--,d++;e(t),r.slideCount<=r.options.slidesToShow?(o=r.$slider.find(".slick-slide"),e(o)):r.currentSlide>=r.slideCount-r.options.slidesToShow?(o=r.$slider.find(".slick-cloned").slice(0,r.options.slidesToShow),e(o)):0===r.currentSlide&&(o=r.$slider.find(".slick-cloned").slice(r.options.slidesToShow*-1),e(o))},e.prototype.loadSlider=function(){var i=this;i.setPosition(),i.$slideTrack.css({opacity:1}),i.$slider.removeClass("slick-loading"),i.initUI(),"progressive"===i.options.lazyLoad&&i.progressiveLazyLoad()},e.prototype.next=e.prototype.slickNext=function(){var i=this;i.changeSlide({data:{message:"next"}})},e.prototype.orientationChange=function(){var i=this;i.checkResponsive(),i.setPosition()},e.prototype.pause=e.prototype.slickPause=function(){var i=this;i.autoPlayClear(),i.paused=!0},e.prototype.play=e.prototype.slickPlay=function(){var i=this;i.autoPlay(),i.options.autoplay=!0,i.paused=!1,i.focussed=!1,i.interrupted=!1},e.prototype.postSlide=function(e){var t=this;if(!t.unslicked&&(t.$slider.trigger("afterChange",[t,e]),t.animating=!1,t.slideCount>t.options.slidesToShow&&t.setPosition(),t.swipeLeft=null,t.options.autoplay&&t.autoPlay(),t.options.accessibility===!0&&(t.initADA(),t.options.focusOnChange))){var o=i(t.$slides.get(t.currentSlide));o.attr("tabindex",0).focus()}},e.prototype.prev=e.prototype.slickPrev=function(){var i=this;i.changeSlide({data:{message:"previous"}})},e.prototype.preventDefault=function(i){i.preventDefault()},e.prototype.progressiveLazyLoad=function(e){e=e||1;var t,o,s,n,r,l=this,d=i("img[data-lazy]",l.$slider);d.length?(t=d.first(),o=t.attr("data-lazy"),s=t.attr("data-srcset"),n=t.attr("data-sizes")||l.$slider.attr("data-sizes"),r=document.createElement("img"),r.onload=function(){s&&(t.attr("srcset",s),n&&t.attr("sizes",n)),t.attr("src",o).removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading"),l.options.adaptiveHeight===!0&&l.setPosition(),l.$slider.trigger("lazyLoaded",[l,t,o]),l.progressiveLazyLoad()},r.onerror=function(){e<3?setTimeout(function(){l.progressiveLazyLoad(e+1)},500):(t.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),l.$slider.trigger("lazyLoadError",[l,t,o]),l.progressiveLazyLoad())},r.src=o):l.$slider.trigger("allImagesLoaded",[l])},e.prototype.refresh=function(e){var t,o,s=this;o=s.slideCount-s.options.slidesToShow,!s.options.infinite&&s.currentSlide>o&&(s.currentSlide=o),s.slideCount<=s.options.slidesToShow&&(s.currentSlide=0),t=s.currentSlide,s.destroy(!0),i.extend(s,s.initials,{currentSlide:t}),s.init(),e||s.changeSlide({data:{message:"index",index:t}},!1)},e.prototype.registerBreakpoints=function(){var e,t,o,s=this,n=s.options.responsive||null;if("array"===i.type(n)&&n.length){s.respondTo=s.options.respondTo||"window";for(e in n)if(o=s.breakpoints.length-1,n.hasOwnProperty(e)){for(t=n[e].breakpoint;o>=0;)s.breakpoints[o]&&s.breakpoints[o]===t&&s.breakpoints.splice(o,1),o--;s.breakpoints.push(t),s.breakpointSettings[t]=n[e].settings}s.breakpoints.sort(function(i,e){return s.options.mobileFirst?i-e:e-i})}},e.prototype.reinit=function(){var e=this;e.$slides=e.$slideTrack.children(e.options.slide).addClass("slick-slide"),e.slideCount=e.$slides.length,e.currentSlide>=e.slideCount&&0!==e.currentSlide&&(e.currentSlide=e.currentSlide-e.options.slidesToScroll),e.slideCount<=e.options.slidesToShow&&(e.currentSlide=0),e.registerBreakpoints(),e.setProps(),e.setupInfinite(),e.buildArrows(),e.updateArrows(),e.initArrowEvents(),e.buildDots(),e.updateDots(),e.initDotEvents(),e.cleanUpSlideEvents(),e.initSlideEvents(),e.checkResponsive(!1,!0),e.options.focusOnSelect===!0&&i(e.$slideTrack).children().on("click.slick",e.selectHandler),e.setSlideClasses("number"==typeof e.currentSlide?e.currentSlide:0),e.setPosition(),e.focusHandler(),e.paused=!e.options.autoplay,e.autoPlay(),e.$slider.trigger("reInit",[e])},e.prototype.resize=function(){var e=this;i(window).width()!==e.windowWidth&&(clearTimeout(e.windowDelay),e.windowDelay=window.setTimeout(function(){e.windowWidth=i(window).width(),e.checkResponsive(),e.unslicked||e.setPosition()},50))},e.prototype.removeSlide=e.prototype.slickRemove=function(i,e,t){var o=this;return"boolean"==typeof i?(e=i,i=e===!0?0:o.slideCount-1):i=e===!0?--i:i,!(o.slideCount<1||i<0||i>o.slideCount-1)&&(o.unload(),t===!0?o.$slideTrack.children().remove():o.$slideTrack.children(this.options.slide).eq(i).remove(),o.$slides=o.$slideTrack.children(this.options.slide),o.$slideTrack.children(this.options.slide).detach(),o.$slideTrack.append(o.$slides),o.$slidesCache=o.$slides,void o.reinit())},e.prototype.setCSS=function(i){var e,t,o=this,s={};o.options.rtl===!0&&(i=-i),e="left"==o.positionProp?Math.ceil(i)+"px":"0px",t="top"==o.positionProp?Math.ceil(i)+"px":"0px",s[o.positionProp]=i,o.transformsEnabled===!1?o.$slideTrack.css(s):(s={},o.cssTransitions===!1?(s[o.animType]="translate("+e+", "+t+")",o.$slideTrack.css(s)):(s[o.animType]="translate3d("+e+", "+t+", 0px)",o.$slideTrack.css(s)))},e.prototype.setDimensions=function(){var i=this;i.options.vertical===!1?i.options.centerMode===!0&&i.$list.css({padding:"0px "+i.options.centerPadding}):(i.$list.height(i.$slides.first().outerHeight(!0)*i.options.slidesToShow),i.options.centerMode===!0&&i.$list.css({padding:i.options.centerPadding+" 0px"})),i.listWidth=i.$list.width(),i.listHeight=i.$list.height(),i.options.vertical===!1&&i.options.variableWidth===!1?(i.slideWidth=Math.ceil(i.listWidth/i.options.slidesToShow),i.$slideTrack.width(Math.ceil(i.slideWidth*i.$slideTrack.children(".slick-slide").length))):i.options.variableWidth===!0?i.$slideTrack.width(5e3*i.slideCount):(i.slideWidth=Math.ceil(i.listWidth),i.$slideTrack.height(Math.ceil(i.$slides.first().outerHeight(!0)*i.$slideTrack.children(".slick-slide").length)));var e=i.$slides.first().outerWidth(!0)-i.$slides.first().width();i.options.variableWidth===!1&&i.$slideTrack.children(".slick-slide").width(i.slideWidth-e)},e.prototype.setFade=function(){var e,t=this;t.$slides.each(function(o,s){e=t.slideWidth*o*-1,t.options.rtl===!0?i(s).css({position:"relative",right:e,top:0,zIndex:t.options.zIndex-2,opacity:0}):i(s).css({position:"relative",left:e,top:0,zIndex:t.options.zIndex-2,opacity:0})}),t.$slides.eq(t.currentSlide).css({zIndex:t.options.zIndex-1,opacity:1})},e.prototype.setHeight=function(){var i=this;if(1===i.options.slidesToShow&&i.options.adaptiveHeight===!0&&i.options.vertical===!1){var e=i.$slides.eq(i.currentSlide).outerHeight(!0);i.$list.css("height",e)}},e.prototype.setOption=e.prototype.slickSetOption=function(){var e,t,o,s,n,r=this,l=!1;if("object"===i.type(arguments[0])?(o=arguments[0],l=arguments[1],n="multiple"):"string"===i.type(arguments[0])&&(o=arguments[0],s=arguments[1],l=arguments[2],"responsive"===arguments[0]&&"array"===i.type(arguments[1])?n="responsive":"undefined"!=typeof arguments[1]&&(n="single")),"single"===n)r.options[o]=s;else if("multiple"===n)i.each(o,function(i,e){r.options[i]=e});else if("responsive"===n)for(t in s)if("array"!==i.type(r.options.responsive))r.options.responsive=[s[t]];else{for(e=r.options.responsive.length-1;e>=0;)r.options.responsive[e].breakpoint===s[t].breakpoint&&r.options.responsive.splice(e,1),e--;r.options.responsive.push(s[t])}l&&(r.unload(),r.reinit())},e.prototype.setPosition=function(){var i=this;i.setDimensions(),i.setHeight(),i.options.fade===!1?i.setCSS(i.getLeft(i.currentSlide)):i.setFade(),i.$slider.trigger("setPosition",[i])},e.prototype.setProps=function(){var i=this,e=document.body.style;i.positionProp=i.options.vertical===!0?"top":"left",
12685
12686	
vendor: 11,465 bytes, line 12686
12686"top"===i.positionProp?i.$slider.addClass("slick-vertical"):i.$slider.removeClass("slick-vertical"),void 0===e.WebkitTransition&&void 0===e.MozTransition&&void 0===e.msTransition||i.options.useCSS===!0&&(i.cssTransitions=!0),i.options.fade&&("number"==typeof i.options.zIndex?i.options.zIndex<3&&(i.options.zIndex=3):i.options.zIndex=i.defaults.zIndex),void 0!==e.OTransform&&(i.animType="OTransform",i.transformType="-o-transform",i.transitionType="OTransition",void 0===e.perspectiveProperty&&void 0===e.webkitPerspective&&(i.animType=!1)),void 0!==e.MozTransform&&(i.animType="MozTransform",i.transformType="-moz-transform",i.transitionType="MozTransition",void 0===e.perspectiveProperty&&void 0===e.MozPerspective&&(i.animType=!1)),void 0!==e.webkitTransform&&(i.animType="webkitTransform",i.transformType="-webkit-transform",i.transitionType="webkitTransition",void 0===e.perspectiveProperty&&void 0===e.webkitPerspective&&(i.animType=!1)),void 0!==e.msTransform&&(i.animType="msTransform",i.transformType="-ms-transform",i.transitionType="msTransition",void 0===e.msTransform&&(i.animType=!1)),void 0!==e.transform&&i.animType!==!1&&(i.animType="transform",i.transformType="transform",i.transitionType="transition"),i.transformsEnabled=i.options.useTransform&&null!==i.animType&&i.animType!==!1},e.prototype.setSlideClasses=function(i){var e,t,o,s,n=this;if(t=n.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true"),n.$slides.eq(i).addClass("slick-current"),n.options.centerMode===!0){var r=n.options.slidesToShow%2===0?1:0;e=Math.floor(n.options.slidesToShow/2),n.options.infinite===!0&&(i>=e&&i<=n.slideCount-1-e?n.$slides.slice(i-e+r,i+e+1).addClass("slick-active").attr("aria-hidden","false"):(o=n.options.slidesToShow+i,t.slice(o-e+1+r,o+e+2).addClass("slick-active").attr("aria-hidden","false")),0===i?t.eq(t.length-1-n.options.slidesToShow).addClass("slick-center"):i===n.slideCount-1&&t.eq(n.options.slidesToShow).addClass("slick-center")),n.$slides.eq(i).addClass("slick-center")}else i>=0&&i<=n.slideCount-n.options.slidesToShow?n.$slides.slice(i,i+n.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"):t.length<=n.options.slidesToShow?t.addClass("slick-active").attr("aria-hidden","false"):(s=n.slideCount%n.options.slidesToShow,o=n.options.infinite===!0?n.options.slidesToShow+i:i,n.options.slidesToShow==n.options.slidesToScroll&&n.slideCount-i<n.options.slidesToShow?t.slice(o-(n.options.slidesToShow-s),o+s).addClass("slick-active").attr("aria-hidden","false"):t.slice(o,o+n.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"));"ondemand"!==n.options.lazyLoad&&"anticipated"!==n.options.lazyLoad||n.lazyLoad()},e.prototype.setupInfinite=function(){var e,t,o,s=this;if(s.options.fade===!0&&(s.options.centerMode=!1),s.options.infinite===!0&&s.options.fade===!1&&(t=null,s.slideCount>s.options.slidesToShow)){for(o=s.options.centerMode===!0?s.options.slidesToShow+1:s.options.slidesToShow,e=s.slideCount;e>s.slideCount-o;e-=1)t=e-1,i(s.$slides[t]).clone(!0).attr("id","").attr("data-slick-index",t-s.slideCount).prependTo(s.$slideTrack).addClass("slick-cloned");for(e=0;e<o+s.slideCount;e+=1)t=e,i(s.$slides[t]).clone(!0).attr("id","").attr("data-slick-index",t+s.slideCount).appendTo(s.$slideTrack).addClass("slick-cloned");s.$slideTrack.find(".slick-cloned").find("[id]").each(function(){i(this).attr("id","")})}},e.prototype.interrupt=function(i){var e=this;i||e.autoPlay(),e.interrupted=i},e.prototype.selectHandler=function(e){var t=this,o=i(e.target).is(".slick-slide")?i(e.target):i(e.target).parents(".slick-slide"),s=parseInt(o.attr("data-slick-index"));return s||(s=0),t.slideCount<=t.options.slidesToShow?void t.slideHandler(s,!1,!0):void t.slideHandler(s)},e.prototype.slideHandler=function(i,e,t){var o,s,n,r,l,d=null,a=this;if(e=e||!1,!(a.animating===!0&&a.options.waitForAnimate===!0||a.options.fade===!0&&a.currentSlide===i))return e===!1&&a.asNavFor(i),o=i,d=a.getLeft(o),r=a.getLeft(a.currentSlide),a.currentLeft=null===a.swipeLeft?r:a.swipeLeft,a.options.infinite===!1&&a.options.centerMode===!1&&(i<0||i>a.getDotCount()*a.options.slidesToScroll)?void(a.options.fade===!1&&(o=a.currentSlide,t!==!0&&a.slideCount>a.options.slidesToShow?a.animateSlide(r,function(){a.postSlide(o)}):a.postSlide(o))):a.options.infinite===!1&&a.options.centerMode===!0&&(i<0||i>a.slideCount-a.options.slidesToScroll)?void(a.options.fade===!1&&(o=a.currentSlide,t!==!0&&a.slideCount>a.options.slidesToShow?a.animateSlide(r,function(){a.postSlide(o)}):a.postSlide(o))):(a.options.autoplay&&clearInterval(a.autoPlayTimer),s=o<0?a.slideCount%a.options.slidesToScroll!==0?a.slideCount-a.slideCount%a.options.slidesToScroll:a.slideCount+o:o>=a.slideCount?a.slideCount%a.options.slidesToScroll!==0?0:o-a.slideCount:o,a.animating=!0,a.$slider.trigger("beforeChange",[a,a.currentSlide,s]),n=a.currentSlide,a.currentSlide=s,a.setSlideClasses(a.currentSlide),a.options.asNavFor&&(l=a.getNavTarget(),l=l.slick("getSlick"),l.slideCount<=l.options.slidesToShow&&l.setSlideClasses(a.currentSlide)),a.updateDots(),a.updateArrows(),a.options.fade===!0?(t!==!0?(a.fadeSlideOut(n),a.fadeSlide(s,function(){a.postSlide(s)})):a.postSlide(s),void a.animateHeight()):void(t!==!0&&a.slideCount>a.options.slidesToShow?a.animateSlide(d,function(){a.postSlide(s)}):a.postSlide(s)))},e.prototype.startLoad=function(){var i=this;i.options.arrows===!0&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.hide(),i.$nextArrow.hide()),i.options.dots===!0&&i.slideCount>i.options.slidesToShow&&i.$dots.hide(),i.$slider.addClass("slick-loading")},e.prototype.swipeDirection=function(){var i,e,t,o,s=this;return i=s.touchObject.startX-s.touchObject.curX,e=s.touchObject.startY-s.touchObject.curY,t=Math.atan2(e,i),o=Math.round(180*t/Math.PI),o<0&&(o=360-Math.abs(o)),o<=45&&o>=0?s.options.rtl===!1?"left":"right":o<=360&&o>=315?s.options.rtl===!1?"left":"right":o>=135&&o<=225?s.options.rtl===!1?"right":"left":s.options.verticalSwiping===!0?o>=35&&o<=135?"down":"up":"vertical"},e.prototype.swipeEnd=function(i){var e,t,o=this;if(o.dragging=!1,o.swiping=!1,o.scrolling)return o.scrolling=!1,!1;if(o.interrupted=!1,o.shouldClick=!(o.touchObject.swipeLength>10),void 0===o.touchObject.curX)return!1;if(o.touchObject.edgeHit===!0&&o.$slider.trigger("edge",[o,o.swipeDirection()]),o.touchObject.swipeLength>=o.touchObject.minSwipe){switch(t=o.swipeDirection()){case"left":case"down":e=o.options.swipeToSlide?o.checkNavigable(o.currentSlide+o.getSlideCount()):o.currentSlide+o.getSlideCount(),o.currentDirection=0;break;case"right":case"up":e=o.options.swipeToSlide?o.checkNavigable(o.currentSlide-o.getSlideCount()):o.currentSlide-o.getSlideCount(),o.currentDirection=1}"vertical"!=t&&(o.slideHandler(e),o.touchObject={},o.$slider.trigger("swipe",[o,t]))}else o.touchObject.startX!==o.touchObject.curX&&(o.slideHandler(o.currentSlide),o.touchObject={})},e.prototype.swipeHandler=function(i){var e=this;if(!(e.options.swipe===!1||"ontouchend"in document&&e.options.swipe===!1||e.options.draggable===!1&&i.type.indexOf("mouse")!==-1))switch(e.touchObject.fingerCount=i.originalEvent&&void 0!==i.originalEvent.touches?i.originalEvent.touches.length:1,e.touchObject.minSwipe=e.listWidth/e.options.touchThreshold,e.options.verticalSwiping===!0&&(e.touchObject.minSwipe=e.listHeight/e.options.touchThreshold),i.data.action){case"start":e.swipeStart(i);break;case"move":e.swipeMove(i);break;case"end":e.swipeEnd(i)}},e.prototype.swipeMove=function(i){var e,t,o,s,n,r,l=this;return n=void 0!==i.originalEvent?i.originalEvent.touches:null,!(!l.dragging||l.scrolling||n&&1!==n.length)&&(e=l.getLeft(l.currentSlide),l.touchObject.curX=void 0!==n?n[0].pageX:i.clientX,l.touchObject.curY=void 0!==n?n[0].pageY:i.clientY,l.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(l.touchObject.curX-l.touchObject.startX,2))),r=Math.round(Math.sqrt(Math.pow(l.touchObject.curY-l.touchObject.startY,2))),!l.options.verticalSwiping&&!l.swiping&&r>4?(l.scrolling=!0,!1):(l.options.verticalSwiping===!0&&(l.touchObject.swipeLength=r),t=l.swipeDirection(),void 0!==i.originalEvent&&l.touchObject.swipeLength>4&&(l.swiping=!0,i.preventDefault()),s=(l.options.rtl===!1?1:-1)*(l.touchObject.curX>l.touchObject.startX?1:-1),l.options.verticalSwiping===!0&&(s=l.touchObject.curY>l.touchObject.startY?1:-1),o=l.touchObject.swipeLength,l.touchObject.edgeHit=!1,l.options.infinite===!1&&(0===l.currentSlide&&"right"===t||l.currentSlide>=l.getDotCount()&&"left"===t)&&(o=l.touchObject.swipeLength*l.options.edgeFriction,l.touchObject.edgeHit=!0),l.options.vertical===!1?l.swipeLeft=e+o*s:l.swipeLeft=e+o*(l.$list.height()/l.listWidth)*s,l.options.verticalSwiping===!0&&(l.swipeLeft=e+o*s),l.options.fade!==!0&&l.options.touchMove!==!1&&(l.animating===!0?(l.swipeLeft=null,!1):void l.setCSS(l.swipeLeft))))},e.prototype.swipeStart=function(i){var e,t=this;return t.interrupted=!0,1!==t.touchObject.fingerCount||t.slideCount<=t.options.slidesToShow?(t.touchObject={},!1):(void 0!==i.originalEvent&&void 0!==i.originalEvent.touches&&(e=i.originalEvent.touches[0]),t.touchObject.startX=t.touchObject.curX=void 0!==e?e.pageX:i.clientX,t.touchObject.startY=t.touchObject.curY=void 0!==e?e.pageY:i.clientY,void(t.dragging=!0))},e.prototype.unfilterSlides=e.prototype.slickUnfilter=function(){var i=this;null!==i.$slidesCache&&(i.unload(),i.$slideTrack.children(this.options.slide).detach(),i.$slidesCache.appendTo(i.$slideTrack),i.reinit())},e.prototype.unload=function(){var e=this;i(".slick-cloned",e.$slider).remove(),e.$dots&&e.$dots.remove(),e.$prevArrow&&e.htmlExpr.test(e.options.prevArrow)&&e.$prevArrow.remove(),e.$nextArrow&&e.htmlExpr.test(e.options.nextArrow)&&e.$nextArrow.remove(),e.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")},e.prototype.unslick=function(i){var e=this;e.$slider.trigger("unslick",[e,i]),e.destroy()},e.prototype.updateArrows=function(){var i,e=this;i=Math.floor(e.options.slidesToShow/2),e.options.arrows===!0&&e.slideCount>e.options.slidesToShow&&!e.options.infinite&&(e.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false"),e.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false"),0===e.currentSlide?(e.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true"),e.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false")):e.currentSlide>=e.slideCount-e.options.slidesToShow&&e.options.centerMode===!1?(e.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),e.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")):e.currentSlide>=e.slideCount-1&&e.options.centerMode===!0&&(e.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),e.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")))},e.prototype.updateDots=function(){var i=this;null!==i.$dots&&(i.$dots.find("li").removeClass("slick-active").end(),i.$dots.find("li").eq(Math.floor(i.currentSlide/i.options.slidesToScroll)).addClass("slick-active"))},e.prototype.visibility=function(){var i=this;i.options.autoplay&&(document[i.hidden]?i.interrupted=!0:i.interrupted=!1)},i.fn.slick=function(){var i,t,o=this,s=arguments[0],n=Array.prototype.slice.call(arguments,1),r=o.length;for(i=0;i<r;i++)if("object"==typeof s||"undefined"==typeof s?o[i].slick=new e(o[i],s):t=o[i].slick[s].apply(o[i].slick,n),"undefined"!=typeof t)return t;return o}});
12686
12687
12688// ==================================================
12689// fancyBox v3.5.7
12690//
12691// Licensed GPLv3 for open source use
12692// or fancyBox Commercial License for commercial use
12693//
12694// http://fancyapps.com/fancybox/
12695// Copyright 2019 fancyApps
12696//
12697// ==================================================�
vendor: 31,973 bytes, lines 12697-12698
12697
12698!function(t,e,n,o){"use strict";function i(t,e){var o,i,a,s=[],r=0;t&&t.isDefaultPrevented()||(t.preventDefault(),e=e||{},t&&t.data&&(e=h(t.data.options,e)),o=e.$target||n(t.currentTarget).trigger("blur"),(a=n.fancybox.getInstance())&&a.$trigger&&a.$trigger.is(o)||(e.selector?s=n(e.selector):(i=o.attr("data-fancybox")||"",i?(s=t.data?t.data.items:[],s=s.length?s.filter('[data-fancybox="'+i+'"]'):n('[data-fancybox="'+i+'"]')):s=[o]),r=n(s).index(o),r<0&&(r=0),a=n.fancybox.open(s,e,r),a.$trigger=o))}if(t.console=t.console||{info:function(t){}},n){if(n.fn.fancybox)return void console.info("fancyBox already initialized");var a={closeExisting:!1,loop:!1,gutter:50,keyboard:!0,preventCaptionOverlap:!0,arrows:!0,infobar:!0,smallBtn:"auto",toolbar:"auto",buttons:["zoom","slideShow","thumbs","close"],idleTime:3,protect:!1,modal:!1,image:{preload:!1},ajax:{settings:{data:{fancybox:!0}}},iframe:{tpl:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" allowfullscreen="allowfullscreen" allow="autoplay; fullscreen" src=""></iframe>',preload:!0,css:{},attr:{scrolling:"auto"}},video:{tpl:'<video class="fancybox-video" controls controlsList="nodownload" poster="{{poster}}"><source src="{{src}}" type="{{format}}" />Sorry, your browser doesn\'t support embedded videos, <a href="{{src}}">download</a> and watch with your favorite video player!</video>',format:"",autoStart:!0},defaultType:"image",animationEffect:"zoom",animationDuration:366,zoomOpacity:"auto",transitionEffect:"fade",transitionDuration:366,slideClass:"",baseClass:"",baseTpl:'<div class="fancybox-container" role="dialog" tabindex="-1"><div class="fancybox-bg"></div><div class="fancybox-inner"><div class="fancybox-infobar"><span data-fancybox-index></span>&nbsp;/&nbsp;<span data-fancybox-count></span></div><div class="fancybox-toolbar">{{buttons}}</div><div class="fancybox-navigation">{{arrows}}</div><div class="fancybox-stage"></div><div class="fancybox-caption"><div class="fancybox-caption__body"></div></div></div></div>',spinnerTpl:'<div class="fancybox-loading"></div>',errorTpl:'<div class="fancybox-error"><p>{{ERROR}}</p></div>',btnTpl:{download:'<a download data-fancybox-download class="fancybox-button fancybox-button--download" title="{{DOWNLOAD}}" href="javascript:;"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.62 17.09V19H5.38v-1.91zm-2.97-6.96L17 11.45l-5 4.87-5-4.87 1.36-1.32 2.68 2.64V5h1.92v7.77z"/></svg></a>',zoom:'<button data-fancybox-zoom class="fancybox-button fancybox-button--zoom" title="{{ZOOM}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.7 17.3l-3-3a5.9 5.9 0 0 0-.6-7.6 5.9 5.9 0 0 0-8.4 0 5.9 5.9 0 0 0 0 8.4 5.9 5.9 0 0 0 7.7.7l3 3a1 1 0 0 0 1.3 0c.4-.5.4-1 0-1.5zM8.1 13.8a4 4 0 0 1 0-5.7 4 4 0 0 1 5.7 0 4 4 0 0 1 0 5.7 4 4 0 0 1-5.7 0z"/></svg></button>',close:'<button data-fancybox-close class="fancybox-button fancybox-button--close" title="{{CLOSE}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 10.6L6.6 5.2 5.2 6.6l5.4 5.4-5.4 5.4 1.4 1.4 5.4-5.4 5.4 5.4 1.4-1.4-5.4-5.4 5.4-5.4-1.4-1.4-5.4 5.4z"/></svg></button>',arrowLeft:'<button data-fancybox-prev class="fancybox-button fancybox-button--arrow_left" title="{{PREV}}"><div><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.28 15.7l-1.34 1.37L5 12l4.94-5.07 1.34 1.38-2.68 2.72H19v1.94H8.6z"/></svg></div></button>',arrowRight:'<button data-fancybox-next class="fancybox-button fancybox-button--arrow_right" title="{{NEXT}}"><div><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.4 12.97l-2.68 2.72 1.34 1.38L19 12l-4.94-5.07-1.34 1.38 2.68 2.72H5v1.94z"/></svg></div></button>',smallBtn:'<button type="button" data-fancybox-close class="fancybox-button fancybox-close-small" title="{{CLOSE}}"><svg xmlns="http://www.w3.org/2000/svg" version="1" viewBox="0 0 24 24"><path d="M13 12l5-5-1-1-5 5-5-5-1 1 5 5-5 5 1 1 5-5 5 5 1-1z"/></svg></button>'},parentEl:"body",hideScrollbar:!0,autoFocus:!0,backFocus:!0,trapFocus:!0,fullScreen:{autoStart:!1},touch:{vertical:!0,momentum:!0},hash:null,media:{},slideShow:{autoStart:!1,speed:3e3},thumbs:{autoStart:!1,hideOnClose:!0,parentEl:".fancybox-container",axis:"y"},wheel:"auto",onInit:n.noop,beforeLoad:n.noop,afterLoad:n.noop,beforeShow:n.noop,afterShow:n.noop,beforeClose:n.noop,afterClose:n.noop,onActivate:n.noop,onDeactivate:n.noop,clickContent:function(t,e){return"image"===t.type&&"zoom"},clickSlide:"close",clickOutside:"close",dblclickContent:!1,dblclickSlide:!1,dblclickOutside:!1,mobile:{preventCaptionOverlap:!1,idleTime:!1,clickContent:function(t,e){return"image"===t.type&&"toggleControls"},clickSlide:function(t,e){return"image"===t.type?"toggleControls":"close"},dblclickContent:function(t,e){return"image"===t.type&&"zoom"},dblclickSlide:function(t,e){return"image"===t.type&&"zoom"}},lang:"en",i18n:{en:{CLOSE:"Close",NEXT:"Next",PREV:"Previous",ERROR:"The requested content cannot be loaded. <br/> Please try again later.",PLAY_START:"Start slideshow",PLAY_STOP:"Pause slideshow",FULL_SCREEN:"Full screen",THUMBS:"Thumbnails",DOWNLOAD:"Download",SHARE:"Share",ZOOM:"Zoom"},de:{CLOSE:"Schlie&szlig;en",NEXT:"Weiter",PREV:"Zur&uuml;ck",ERROR:"Die angeforderten Daten konnten nicht geladen werden. <br/> Bitte versuchen Sie es sp&auml;ter nochmal.",PLAY_START:"Diaschau starten",PLAY_STOP:"Diaschau beenden",FULL_SCREEN:"Vollbild",THUMBS:"Vorschaubilder",DOWNLOAD:"Herunterladen",SHARE:"Teilen",ZOOM:"Vergr&ouml;&szlig;ern"}}},s=n(t),r=n(e),c=0,l=function(t){return t&&t.hasOwnProperty&&t instanceof n},d=function(){return t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||function(e){return t.setTimeout(e,1e3/60)}}(),u=function(){return t.cancelAnimationFrame||t.webkitCancelAnimationFrame||t.mozCancelAnimationFrame||t.oCancelAnimationFrame||function(e){t.clearTimeout(e)}}(),f=function(){var t,n=e.createElement("fakeelement"),o={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(t in o)if(void 0!==n.style[t])return o[t];return"transitionend"}(),p=function(t){return t&&t.length&&t[0].offsetHeight},h=function(t,e){var o=n.extend(!0,{},t,e);return n.each(e,function(t,e){n.isArray(e)&&(o[t]=e)}),o},g=function(t){var o,i;return!(!t||t.ownerDocument!==e)&&(n(".fancybox-container").css("pointer-events","none"),o={x:t.getBoundingClientRect().left+t.offsetWidth/2,y:t.getBoundingClientRect().top+t.offsetHeight/2},i=e.elementFromPoint(o.x,o.y)===t,n(".fancybox-container").css("pointer-events",""),i)},b=function(t,e,o){var i=this;i.opts=h({index:o},n.fancybox.defaults),n.isPlainObject(e)&&(i.opts=h(i.opts,e)),n.fancybox.isMobile&&(i.opts=h(i.opts,i.opts.mobile)),i.id=i.opts.id||++c,i.currIndex=parseInt(i.opts.index,10)||0,i.prevIndex=null,i.prevPos=null,i.currPos=0,i.firstRun=!0,i.group=[],i.slides={},i.addContent(t),i.group.length&&i.init()};n.extend(b.prototype,{init:function(){var o,i,a=this,s=a.group[a.currIndex],r=s.opts;r.closeExisting&&n.fancybox.close(!0),n("body").addClass("fancybox-active"),!n.fancybox.getInstance()&&!1!==r.hideScrollbar&&!n.fancybox.isMobile&&e.body.scrollHeight>t.innerHeight&&(n("head").append('<style id="fancybox-style-noscroll" type="text/css">.compensate-for-scrollbar{margin-right:'+(t.innerWidth-e.documentElement.clientWidth)+"px;}</style>"),n("body").addClass("compensate-for-scrollbar")),i="",n.each(r.buttons,function(t,e){i+=r.btnTpl[e]||""}),o=n(a.translate(a,r.baseTpl.replace("{{buttons}}",i).replace("{{arrows}}",r.btnTpl.arrowLeft+r.btnTpl.arrowRight))).attr("id","fancybox-container-"+a.id).addClass(r.baseClass).data("FancyBox",a).appendTo(r.parentEl),a.$refs={container:o},["bg","inner","infobar","toolbar","stage","caption","navigation"].forEach(function(t){a.$refs[t]=o.find(".fancybox-"+t)}),a.trigger("onInit"),a.activate(),a.jumpTo(a.currIndex)},translate:function(t,e){var n=t.opts.i18n[t.opts.lang]||t.opts.i18n.en;return e.replace(/\{\{(\w+)\}\}/g,function(t,e){return void 0===n[e]?t:n[e]})},addContent:function(t){var e,o=this,i=n.makeArray(t);n.each(i,function(t,e){var i,a,s,r,c,l={},d={};n.isPlainObject(e)?(l=e,d=e.opts||e):"object"===n.type(e)&&n(e).length?(i=n(e),d=i.data()||{},d=n.extend(!0,{},d,d.options),d.$orig=i,l.src=o.opts.src||d.src||i.attr("href"),l.type||l.src||(l.type="inline",l.src=e)):l={type:"html",src:e+""},l.opts=n.extend(!0,{},o.opts,d),n.isArray(d.buttons)&&(l.opts.buttons=d.buttons),n.fancybox.isMobile&&l.opts.mobile&&(l.opts=h(l.opts,l.opts.mobile)),a=l.type||l.opts.type,r=l.src||"",!a&&r&&((s=r.match(/\.(mp4|mov|ogv|webm)((\?|#).*)?$/i))?(a="video",l.opts.video.format||(l.opts.video.format="video/"+("ogv"===s[1]?"ogg":s[1]))):r.match(/(^data:image\/[a-z0-9+\/=]*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg|ico)((\?|#).*)?$)/i)?a="image":r.match(/\.(pdf)((\?|#).*)?$/i)?(a="iframe",l=n.extend(!0,l,{contentType:"pdf",opts:{iframe:{preload:!1}}})):"#"===r.charAt(0)&&(a="inline")),a?l.type=a:o.trigger("objectNeedsType",l),l.contentType||(l.contentType=n.inArray(l.type,["html","inline","ajax"])>-1?"html":l.type),l.index=o.group.length,"auto"==l.opts.smallBtn&&(l.opts.smallBtn=n.inArray(l.type,["html","inline","ajax"])>-1),"auto"===l.opts.toolbar&&(l.opts.toolbar=!l.opts.smallBtn),l.$thumb=l.opts.$thumb||null,l.opts.$trigger&&l.index===o.opts.index&&(l.$thumb=l.opts.$trigger.find("img:first"),l.$thumb.length&&(l.opts.$orig=l.opts.$trigger)),l.$thumb&&l.$thumb.length||!l.opts.$orig||(l.$thumb=l.opts.$orig.find("img:first")),l.$thumb&&!l.$thumb.length&&(l.$thumb=null),l.thumb=l.opts.thumb||(l.$thumb?l.$thumb[0].src:null),"function"===n.type(l.opts.caption)&&(l.opts.caption=l.opts.caption.apply(e,[o,l])),"function"===n.type(o.opts.caption)&&(l.opts.caption=o.opts.caption.apply(e,[o,l])),l.opts.caption instanceof n||(l.opts.caption=void 0===l.opts.caption?"":l.opts.caption+""),"ajax"===l.type&&(c=r.split(/\s+/,2),c.length>1&&(l.src=c.shift(),l.opts.filter=c.shift())),l.opts.modal&&(l.opts=n.extend(!0,l.opts,{trapFocus:!0,infobar:0,toolbar:0,smallBtn:0,keyboard:0,slideShow:0,fullScreen:0,thumbs:0,touch:0,clickContent:!1,clickSlide:!1,clickOutside:!1,dblclickContent:!1,dblclickSlide:!1,dblclickOutside:!1})),o.group.push(l)}),Object.keys(o.slides).length&&(o.updateControls(),(e=o.Thumbs)&&e.isActive&&(e.create(),e.focus()))},addEvents:function(){var e=this;e.removeEvents(),e.$refs.container.on("click.fb-close","[data-fancybox-close]",function(t){t.stopPropagation(),t.preventDefault(),e.close(t)}).on("touchstart.fb-prev click.fb-prev","[data-fancybox-prev]",function(t){t.stopPropagation(),t.preventDefault(),e.previous()}).on("touchstart.fb-next click.fb-next","[data-fancybox-next]",function(t){t.stopPropagation(),t.preventDefault(),e.next()}).on("click.fb","[data-fancybox-zoom]",function(t){e[e.isScaledDown()?"scaleToActual":"scaleToFit"]()}),s.on("orientationchange.fb resize.fb",function(t){t&&t.originalEvent&&"resize"===t.originalEvent.type?(e.requestId&&u(e.requestId),e.requestId=d(function(){e.update(t)})):(e.current&&"iframe"===e.current.type&&e.$refs.stage.hide(),setTimeout(function(){e.$refs.stage.show(),e.update(t)},n.fancybox.isMobile?600:250))}),r.on("keydown.fb",function(t){var o=n.fancybox?n.fancybox.getInstance():null,i=o.current,a=t.keyCode||t.which;if(9==a)return void(i.opts.trapFocus&&e.focus(t));if(!(!i.opts.keyboard||t.ctrlKey||t.altKey||t.shiftKey||n(t.target).is("input,textarea,video,audio,select")))return 8===a||27===a?(t.preventDefault(),void e.close(t)):37===a||38===a?(t.preventDefault(),void e.previous()):39===a||40===a?(t.preventDefault(),void e.next()):void e.trigger("afterKeydown",t,a)}),e.group[e.currIndex].opts.idleTime&&(e.idleSecondsCounter=0,r.on("mousemove.fb-idle mouseleave.fb-idle mousedown.fb-idle touchstart.fb-idle touchmove.fb-idle scroll.fb-idle keydown.fb-idle",function(t){e.idleSecondsCounter=0,e.isIdle&&e.showControls(),e.isIdle=!1}),e.idleInterval=t.setInterval(function(){++e.idleSecondsCounter>=e.group[e.currIndex].opts.idleTime&&!e.isDragging&&(e.isIdle=!0,e.idleSecondsCounter=0,e.hideControls())},1e3))},removeEvents:function(){var e=this;s.off("orientationchange.fb resize.fb"),r.off("keydown.fb .fb-idle"),this.$refs.container.off(".fb-close .fb-prev .fb-next"),e.idleInterval&&(t.clearInterval(e.idleInterval),e.idleInterval=null)},previous:function(t){return this.jumpTo(this.currPos-1,t)},next:function(t){return this.jumpTo(this.currPos+1,t)},jumpTo:function(t,e){var o,i,a,s,r,c,l,d,u,f=this,h=f.group.length;if(!(f.isDragging||f.isClosing||f.isAnimating&&f.firstRun)){if(t=parseInt(t,10),!(a=f.current?f.current.opts.loop:f.opts.loop)&&(t<0||t>=h))return!1;if(o=f.firstRun=!Object.keys(f.slides).length,r=f.current,f.prevIndex=f.currIndex,f.prevPos=f.currPos,s=f.createSlide(t),h>1&&((a||s.index<h-1)&&f.createSlide(t+1),(a||s.index>0)&&f.createSlide(t-1)),f.current=s,f.currIndex=s.index,f.currPos=s.pos,f.trigger("beforeShow",o),f.updateControls(),s.forcedDuration=void 0,n.isNumeric(e)?s.forcedDuration=e:e=s.opts[o?"animationDuration":"transitionDuration"],e=parseInt(e,10),i=f.isMoved(s),s.$slide.addClass("fancybox-slide--current"),o)return s.opts.animationEffect&&e&&f.$refs.container.css("transition-duration",e+"ms"),f.$refs.container.addClass("fancybox-is-open").trigger("focus"),f.loadSlide(s),void f.preload("image");c=n.fancybox.getTranslate(r.$slide),l=n.fancybox.getTranslate(f.$refs.stage),n.each(f.slides,function(t,e){n.fancybox.stop(e.$slide,!0)}),r.pos!==s.pos&&(r.isComplete=!1),r.$slide.removeClass("fancybox-slide--complete fancybox-slide--current"),i?(u=c.left-(r.pos*c.width+r.pos*r.opts.gutter),n.each(f.slides,function(t,o){o.$slide.removeClass("fancybox-animated").removeClass(function(t,e){return(e.match(/(^|\s)fancybox-fx-\S+/g)||[]).join(" ")});var i=o.pos*c.width+o.pos*o.opts.gutter;n.fancybox.setTranslate(o.$slide,{top:0,left:i-l.left+u}),o.pos!==s.pos&&o.$slide.addClass("fancybox-slide--"+(o.pos>s.pos?"next":"previous")),p(o.$slide),n.fancybox.animate(o.$slide,{top:0,left:(o.pos-s.pos)*c.width+(o.pos-s.pos)*o.opts.gutter},e,function(){o.$slide.css({transform:"",opacity:""}).removeClass("fancybox-slide--next fancybox-slide--previous"),o.pos===f.currPos&&f.complete()})})):e&&s.opts.transitionEffect&&(d="fancybox-animated fancybox-fx-"+s.opts.transitionEffect,r.$slide.addClass("fancybox-slide--"+(r.pos>s.pos?"next":"previous")),n.fancybox.animate(r.$slide,d,e,function(){r.$slide.removeClass(d).removeClass("fancybox-slide--next fancybox-slide--previous")},!1)),s.isLoaded?f.revealContent(s):f.loadSlide(s),f.preload("image")}},createSlide:function(t){var e,o,i=this;return o=t%i.group.length,o=o<0?i.group.length+o:o,!i.slides[t]&&i.group[o]&&(e=n('<div class="fancybox-slide"></div>').appendTo(i.$refs.stage),i.slides[t]=n.extend(!0,{},i.group[o],{pos:t,$slide:e,isLoaded:!1}),i.updateSlide(i.slides[t])),i.slides[t]},scaleToActual:function(t,e,o){var i,a,s,r,c,l=this,d=l.current,u=d.$content,f=n.fancybox.getTranslate(d.$slide).width,p=n.fancybox.getTranslate(d.$slide).height,h=d.width,g=d.height;l.isAnimating||l.isMoved()||!u||"image"!=d.type||!d.isLoaded||d.hasError||(l.isAnimating=!0,n.fancybox.stop(u),t=void 0===t?.5*f:t,e=void 0===e?.5*p:e,i=n.fancybox.getTranslate(u),i.top-=n.fancybox.getTranslate(d.$slide).top,i.left-=n.fancybox.getTranslate(d.$slide).left,r=h/i.width,c=g/i.height,a=.5*f-.5*h,s=.5*p-.5*g,h>f&&(a=i.left*r-(t*r-t),a>0&&(a=0),a<f-h&&(a=f-h)),g>p&&(s=i.top*c-(e*c-e),s>0&&(s=0),s<p-g&&(s=p-g)),l.updateCursor(h,g),n.fancybox.animate(u,{top:s,left:a,scaleX:r,scaleY:c},o||366,function(){l.isAnimating=!1}),l.SlideShow&&l.SlideShow.isActive&&l.SlideShow.stop())},scaleToFit:function(t){var e,o=this,i=o.current,a=i.$content;o.isAnimating||o.isMoved()||!a||"image"!=i.type||!i.isLoaded||i.hasError||(o.isAnimating=!0,n.fancybox.stop(a),e=o.getFitPos(i),o.updateCursor(e.width,e.height),n.fancybox.animate(a,{top:e.top,left:e.left,scaleX:e.width/a.width(),scaleY:e.height/a.height()},t||366,function(){o.isAnimating=!1}))},getFitPos:function(t){var e,o,i,a,s=this,r=t.$content,c=t.$slide,l=t.width||t.opts.width,d=t.height||t.opts.height,u={};return!!(t.isLoaded&&r&&r.length)&&(e=n.fancybox.getTranslate(s.$refs.stage).width,o=n.fancybox.getTranslate(s.$refs.stage).height,e-=parseFloat(c.css("paddingLeft"))+parseFloat(c.css("paddingRight"))+parseFloat(r.css("marginLeft"))+parseFloat(r.css("marginRight")),o-=parseFloat(c.css("paddingTop"))+parseFloat(c.css("paddingBottom"))+parseFloat(r.css("marginTop"))+parseFloat(r.css("marginBottom")),l&&d||(l=e,d=o),i=Math.min(1,e/l,o/d),l*=i,d*=i,l>e-.5&&(l=e),d>o-.5&&(d=o),"image"===t.type?(u.top=Math.floor(.5*(o-d))+parseFloat(c.css("paddingTop")),u.left=Math.floor(.5*(e-l))+parseFloat(c.css("paddingLeft"))):"video"===t.contentType&&(a=t.opts.width&&t.opts.height?l/d:t.opts.ratio||16/9,d>l/a?d=l/a:l>d*a&&(l=d*a)),u.width=l,u.height=d,u)},update:function(t){var e=this;n.each(e.slides,function(n,o){e.updateSlide(o,t)})},updateSlide:function(t,e){var o=this,i=t&&t.$content,a=t.width||t.opts.width,s=t.height||t.opts.height,r=t.$slide;o.adjustCaption(t),i&&(a||s||"video"===t.contentType)&&!t.hasError&&(n.fancybox.stop(i),n.fancybox.setTranslate(i,o.getFitPos(t)),t.pos===o.currPos&&(o.isAnimating=!1,o.updateCursor())),o.adjustLayout(t),r.length&&(r.trigger("refresh"),t.pos===o.currPos&&o.$refs.toolbar.add(o.$refs.navigation.find(".fancybox-button--arrow_right")).toggleClass("compensate-for-scrollbar",r.get(0).scrollHeight>r.get(0).clientHeight)),o.trigger("onUpdate",t,e)},centerSlide:function(t){var e=this,o=e.current,i=o.$slide;!e.isClosing&&o&&(i.siblings().css({transform:"",opacity:""}),i.parent().children().removeClass("fancybox-slide--previous fancybox-slide--next"),n.fancybox.animate(i,{top:0,left:0,opacity:1},void 0===t?0:t,function(){i.css({transform:"",opacity:""}),o.isComplete||e.complete()},!1))},isMoved:function(t){var e,o,i=t||this.current;return!!i&&(o=n.fancybox.getTranslate(this.$refs.stage),e=n.fancybox.getTranslate(i.$slide),!i.$slide.hasClass("fancybox-animated")&&(Math.abs(e.top-o.top)>.5||Math.abs(e.left-o.left)>.5))},updateCursor:function(t,e){var o,i,a=this,s=a.current,r=a.$refs.container;s&&!a.isClosing&&a.Guestures&&(r.removeClass("fancybox-is-zoomable fancybox-can-zoomIn fancybox-can-zoomOut fancybox-can-swipe fancybox-can-pan"),o=a.canPan(t,e),i=!!o||a.isZoomable(),r.toggleClass("fancybox-is-zoomable",i),n("[data-fancybox-zoom]").prop("disabled",!i),o?r.addClass("fancybox-can-pan"):i&&("zoom"===s.opts.clickContent||n.isFunction(s.opts.clickContent)&&"zoom"==s.opts.clickContent(s))?r.addClass("fancybox-can-zoomIn"):s.opts.touch&&(s.opts.touch.vertical||a.group.length>1)&&"video"!==s.contentType&&r.addClass("fancybox-can-swipe"))},isZoomable:function(){var t,e=this,n=e.current;if(n&&!e.isClosing&&"image"===n.type&&!n.hasError){if(!n.isLoaded)return!0;if((t=e.getFitPos(n))&&(n.width>t.width||n.height>t.height))return!0}return!1},isScaledDown:function(t,e){var o=this,i=!1,a=o.current,s=a.$content;return void 0!==t&&void 0!==e?i=t<a.width&&e<a.height:s&&(i=n.fancybox.getTranslate(s),i=i.width<a.width&&i.height<a.height),i},canPan:function(t,e){var o=this,i=o.current,a=null,s=!1;return"image"===i.type&&(i.isComplete||t&&e)&&!i.hasError&&(s=o.getFitPos(i),void 0!==t&&void 0!==e?a={width:t,height:e}:i.isComplete&&(a=n.fancybox.getTranslate(i.$content)),a&&s&&(s=Math.abs(a.width-s.width)>1.5||Math.abs(a.height-s.height)>1.5)),s},loadSlide:function(t){var e,o,i,a=this;if(!t.isLoading&&!t.isLoaded){if(t.isLoading=!0,!1===a.trigger("beforeLoad",t))return t.isLoading=!1,!1;switch(e=t.type,o=t.$slide,o.off("refresh").trigger("onReset").addClass(t.opts.slideClass),e){case"image":a.setImage(t);break;case"iframe":a.setIframe(t);break;case"html":a.setContent(t,t.src||t.content);break;case"video":a.setContent(t,t.opts.video.tpl.replace(/\{\{src\}\}/gi,t.src).replace("{{format}}",t.opts.videoFormat||t.opts.video.format||"").replace("{{poster}}",t.thumb||""));break;case"inline":n(t.src).length?a.setContent(t,n(t.src)):a.setError(t);break;case"ajax":a.showLoading(t),i=n.ajax(n.extend({},t.opts.ajax.settings,{url:t.src,success:function(e,n){"success"===n&&a.setContent(t,e)},error:function(e,n){e&&"abort"!==n&&a.setError(t)}})),o.one("onReset",function(){i.abort()});break;default:a.setError(t)}return!0}},setImage:function(t){var o,i=this;setTimeout(function(){var e=t.$image;i.isClosing||!t.isLoading||e&&e.length&&e[0].complete||t.hasError||i.showLoading(t)},50),i.checkSrcset(t),t.$content=n('<div class="fancybox-content"></div>').addClass("fancybox-is-hidden").appendTo(t.$slide.addClass("fancybox-slide--image")),!1!==t.opts.preload&&t.opts.width&&t.opts.height&&t.thumb&&(t.width=t.opts.width,t.height=t.opts.height,o=e.createElement("img"),o.onerror=function(){n(this).remove(),t.$ghost=null},o.onload=function(){i.afterLoad(t)},t.$ghost=n(o).addClass("fancybox-image").appendTo(t.$content).attr("src",t.thumb)),i.setBigImage(t)},checkSrcset:function(e){var n,o,i,a,s=e.opts.srcset||e.opts.image.srcset;if(s){i=t.devicePixelRatio||1,a=t.innerWidth*i,o=s.split(",").map(function(t){var e={};return t.trim().split(/\s+/).forEach(function(t,n){var o=parseInt(t.substring(0,t.length-1),10);if(0===n)return e.url=t;o&&(e.value=o,e.postfix=t[t.length-1])}),e}),o.sort(function(t,e){return t.value-e.value});for(var r=0;r<o.length;r++){var c=o[r];if("w"===c.postfix&&c.value>=a||"x"===c.postfix&&c.value>=i){n=c;break}}!n&&o.length&&(n=o[o.length-1]),n&&(e.src=n.url,e.width&&e.height&&"w"==n.postfix&&(e.height=e.width/e.height*n.value,e.width=n.value),e.opts.srcset=s)}},setBigImage:function(t){var o=this,i=e.createElement("img"),a=n(i);t.$image=a.one("error",function(){o.setError(t)}).one("load",function(){var e;t.$ghost||(o.resolveImageSlideSize(t,this.naturalWidth,this.naturalHeight),o.afterLoad(t)),o.isClosing||(t.opts.srcset&&(e=t.opts.sizes,e&&"auto"!==e||(e=(t.width/t.height>1&&s.width()/s.height()>1?"100":Math.round(t.width/t.height*100))+"vw"),a.attr("sizes",e).attr("srcset",t.opts.srcset)),t.$ghost&&setTimeout(function(){t.$ghost&&!o.isClosing&&t.$ghost.hide()},Math.min(300,Math.max(1e3,t.height/1600))),o.hideLoading(t))}).addClass("fancybox-image").attr("src",t.src).appendTo(t.$content),(i.complete||"complete"==i.readyState)&&a.naturalWidth&&a.naturalHeight?a.trigger("load"):i.error&&a.trigger("error")},resolveImageSlideSize:function(t,e,n){var o=parseInt(t.opts.width,10),i=parseInt(t.opts.height,10);t.width=e,t.height=n,o>0&&(t.width=o,t.height=Math.floor(o*n/e)),i>0&&(t.width=Math.floor(i*e/n),t.height=i)},setIframe:function(t){var e,o=this,i=t.opts.iframe,a=t.$slide;t.$content=n('<div class="fancybox-content'+(i.preload?" fancybox-is-hidden":"")+'"></div>').css(i.css).appendTo(a),a.addClass("fancybox-slide--"+t.contentType),t.$iframe=e=n(i.tpl.replace(/\{rnd\}/g,(new Date).getTime())).attr(i.attr).appendTo(t.$content),i.preload?(o.showLoading(t),e.on("load.fb error.fb",function(e){this.isReady=1,t.$slide.trigger("refresh"),o.afterLoad(t)}),a.on("refresh.fb",function(){var n,o,s=t.$content,r=i.css.width,c=i.css.height;if(1===e[0].isReady){try{n=e.contents(),o=n.find("body")}catch(t){}o&&o.length&&o.children().length&&(a.css("overflow","visible"),s.css({width:"100%","max-width":"100%",height:"9999px"}),void 0===r&&(r=Math.ceil(Math.max(o[0].clientWidth,o.outerWidth(!0)))),s.css("width",r||"").css("max-width",""),void 0===c&&(c=Math.ceil(Math.max(o[0].clientHeight,o.outerHeight(!0)))),s.css("height",c||""),a.css("overflow","auto")),s.removeClass("fancybox-is-hidden")}})):o.afterLoad(t),e.attr("src",t.src),a.one("onReset",function(){try{n(this).find("iframe").hide().unbind().attr("src","//about:blank")}catch(t){}n(this).off("refresh.fb").empty(),t.isLoaded=!1,t.isRevealed=!1})},setContent:function(t,e){var o=this;o.isClosing||(o.hideLoading(t),t.$content&&n.fancybox.stop(t.$content),t.$slide.empty(),l(e)&&e.parent().length?((e.hasClass("fancybox-content")||e.parent().hasClass("fancybox-content"))&&e.parents(".fancybox-slide").trigger("onReset"),t.$placeholder=n("<div>").hide().insertAfter(e),e.css("display","inline-block")):t.hasError||("string"===n.type(e)&&(e=n("<div>").append(n.trim(e)).contents()),t.opts.filter&&(e=n("<div>").html(e).find(t.opts.filter))),t.$slide.one("onReset",function(){n(this).find("video,audio").trigger("pause"),t.$placeholder&&(t.$placeholder.after(e.removeClass("fancybox-content").hide()).remove(),t.$placeholder=null),t.$smallBtn&&(t.$smallBtn.remove(),t.$smallBtn=null),t.hasError||(n(this).empty(),t.isLoaded=!1,t.isRevealed=!1)}),n(e).appendTo(t.$slide),n(e).is("video,audio")&&(n(e).addClass("fancybox-video"),n(e).wrap("<div></div>"),t.contentType="video",t.opts.width=t.opts.width||n(e).attr("width"),t.opts.height=t.opts.height||n(e).attr("height")),t.$content=t.$slide.children().filter("div,form,main,video,audio,article,.fancybox-content").first(),t.$content.siblings().hide(),t.$content.length||(t.$content=t.$slide.wrapInner("<div></div>").children().first()),t.$content.addClass("fancybox-content"),t.$slide.addClass("fancybox-slide--"+t.contentType),o.afterLoad(t))},setError:function(t){t.hasError=!0,t.$slide.trigger("onReset").removeClass("fancybox-slide--"+t.contentType).addClass("fancybox-slide--error"),t.contentType="html",this.setContent(t,this.translate(t,t.opts.errorTpl)),t.pos===this.currPos&&(this.isAnimating=!1)},showLoading:function(t){var e=this;(t=t||e.current)&&!t.$spinner&&(t.$spinner=n(e.translate(e,e.opts.spinnerTpl)).appendTo(t.$slide).hide().fadeIn("fast"))},hideLoading:function(t){var e=this;(t=t||e.current)&&t.$spinner&&(t.$spinner.stop().remove(),delete t.$spinner)},afterLoad:function(t){var e=this;e.isClosing||(t.isLoading=!1,t.isLoaded=!0,e.trigger("afterLoad",t),e.hideLoading(t),!t.opts.smallBtn||t.$smallBtn&&t.$smallBtn.length||(t.$smallBtn=n(e.translate(t,t.opts.btnTpl.smallBtn)).appendTo(t.$content)),t.opts.protect&&t.$content&&!t.hasError&&(t.$content.on("contextmenu.fb",function(t){return 2==t.button&&t.preventDefault(),!0}),"image"===t.type&&n('<div class="fancybox-spaceball"></div>').appendTo(t.$content)),e.adjustCaption(t),e.adjustLayout(t),t.pos===e.currPos&&e.updateCursor(),e.revealContent(t))},adjustCaption:function(t){var e,n=this,o=t||n.current,i=o.opts.caption,a=o.opts.preventCaptionOverlap,s=n.$refs.caption,r=!1;s.toggleClass("fancybox-caption--separate",a),a&&i&&i.length&&(o.pos!==n.currPos?(e=s.clone().appendTo(s.parent()),e.children().eq(0).empty().html(i),r=e.outerHeight(!0),e.empty().remove()):n.$caption&&(r=n.$caption.outerHeight(!0)),o.$slide.css("padding-bottom",r||""))},adjustLayout:function(t){var e,n,o,i,a=this,s=t||a.current;s.isLoaded&&!0!==s.opts.disableLayoutFix&&(s.$content.css("margin-bottom",""),s.$content.outerHeight()>s.$slide.height()+.5&&(o=s.$slide[0].style["padding-bottom"],i=s.$slide.css("padding-bottom"),parseFloat(i)>0&&(e=s.$slide[0].scrollHeight,s.$slide.css("padding-bottom",0),Math.abs(e-s.$slide[0].scrollHeight)<1&&(n=i),s.$slide.css("padding-bottom",o))),s.$content.css("margin-bottom",n))},revealContent:function(t){var e,o,i,a,s=this,r=t.$slide,c=!1,l=!1,d=s.isMoved(t),u=t.isRevealed;return t.isRevealed=!0,e=t.opts[s.firstRun?"animationEffect":"transitionEffect"],i=t.opts[s.firstRun?"animationDuration":"transitionDuration"],i=parseInt(void 0===t.forcedDuration?i:t.forcedDuration,10),!d&&t.pos===s.currPos&&i||(e=!1),"zoom"===e&&(t.pos===s.currPos&&i&&"image"===t.type&&!t.hasError&&(l=s.getThumbPos(t))?c=s.getFitPos(t):e="fade"),"zoom"===e?(s.isAnimating=!0,c.scaleX=c.width/l.width,c.scaleY=c.height/l.height,a=t.opts.zoomOpacity,"auto"==a&&(a=Math.abs(t.width/t.height-l.width/l.height)>.1),a&&(l.opacity=.1,c.opacity=1),n.fancybox.setTranslate(t.$content.removeClass("fancybox-is-hidden"),l),p(t.$content),void n.fancybox.animate(t.$content,c,i,function(){s.isAnimating=!1,s.complete()})):(s.updateSlide(t),e?(n.fancybox.stop(r),o="fancybox-slide--"+(t.pos>=s.prevPos?"next":"previous")+" fancybox-animated fancybox-fx-"+e,r.addClass(o).removeClass("fancybox-slide--current"),t.$content.removeClass("fancybox-is-hidden"),p(r),"image"!==t.type&&t.$content.hide().show(0),void n.fancybox.animate(r,"fancybox-slide--current",i,function(){r.removeClass(o).css({transform:"",opacity:""}),t.pos===s.currPos&&s.complete()},!0)):(t.$content.removeClass("fancybox-is-hidden"),u||!d||"image"!==t.type||t.hasError||t.$content.hide().fadeIn("fast"),void(t.pos===s.currPos&&s.complete())))},getThumbPos:function(t){var e,o,i,a,s,r=!1,c=t.$thumb;return!(!c||!g(c[0]))&&(e=n.fancybox.getTranslate(c),o=parseFloat(c.css("border-top-width")||0),i=parseFloat(c.css("border-right-width")||0),a=parseFloat(c.css("border-bottom-width")||0),s=parseFloat(c.css("border-left-width")||0),r={top:e.top+o,left:e.left+s,width:e.width-i-s,height:e.height-o-a,scaleX:1,scaleY:1},e.width>0&&e.height>0&&r)},complete:function(){var t,e=this,o=e.current,i={};!e.isMoved()&&o.isLoaded&&(o.isComplete||(o.isComplete=!0,o.$slide.siblings().trigger("onReset"),e.preload("inline"),p(o.$slide),o.$slide.addClass("fancybox-slide--complete"),n.each(e.slides,function(t,o){o.pos>=e.currPos-1&&o.pos<=e.currPos+1?i[o.pos]=o:o&&(n.fancybox.stop(o.$slide),o.$slide.off().remove())}),e.slides=i),e.isAnimating=!1,e.updateCursor(),e.trigger("afterShow"),o.opts.video.autoStart&&o.$slide.find("video,audio").filter(":visible:first").trigger("play").one("ended",function(){Document.exitFullscreen?Document.exitFullscreen():this.webkitExitFullscreen&&this.webkitExitFullscreen(),e.next()}),o.opts.autoFocus&&"html"===o.contentType&&(t=o.$content.find("input[autofocus]:enabled:visible:first"),t.length?t.trigger("focus"):e.focus(null,!0)),o.$slide.scrollTop(0).scrollLeft(0))},preload:function(t){var e,n,o=this;o.group.length<2||(n=o.slides[o.currPos+1],e=o.slides[o.currPos-1],e&&e.type===t&&o.loadSlide(e),n&&n.type===t&&o.loadSlide(n))},focus:function(t,o){var i,a,s=this,r=["a[href]","area[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","iframe","object","embed","video","audio","[contenteditable]",'[tabindex]:not([tabindex^="-"])'].join(",");s.isClosing||(i=!t&&s.current&&s.current.isComplete?s.current.$slide.find("*:visible"+(o?":not(.fancybox-close-small)":"")):s.$refs.container.find("*:visible"),i=i.filter(r).filter(function(){return"hidden"!==n(this).css("visibility")&&!n(this).hasClass("disabled")}),i.length?(a=i.index(e.activeElement),t&&t.shiftKey?(a<0||0==a)&&(t.preventDefault(),i.eq(i.length-1).trigger("focus")):(a<0||a==i.length-1)&&(t&&t.preventDefault(),i.eq(0).trigger("focus"))):s.$refs.container.trigger("focus"))},activate:function(){var t=this;n(".fancybox-container").each(function(){var e=n(this).data("FancyBox");e&&e.id!==t.id&&!e.isClosing&&(e.trigger("onDeactivate"),e.removeEvents(),e.isVisible=!1)}),t.isVisible=!0,(t.current||t.isIdle)&&(t.update(),t.updateControls()),t.trigger("onActivate"),t.addEvents()},close:function(t,e){var o,i,a,s,r,c,l,u=this,f=u.current,h=function(){u.cleanUp(t)};return!u.isClosing&&(u.isClosing=!0,!1===u.trigger("beforeClose",t)?(u.isClosing=!1,d(function(){u.update()}),!1):(u.removeEvents(),a=f.$content,o=f.opts.animationEffect,i=n.isNumeric(e)?e:o?f.opts.animationDuration:0,f.$slide.removeClass("fancybox-slide--complete fancybox-slide--next fancybox-slide--previous fancybox-animated"),!0!==t?n.fancybox.stop(f.$slide):o=!1,f.$slide.siblings().trigger("onReset").remove(),i&&u.$refs.container.removeClass("fancybox-is-open").addClass("fancybox-is-closing").css("transition-duration",i+"ms"),u.hideLoading(f),u.hideControls(!0),u.updateCursor(),"zoom"!==o||a&&i&&"image"===f.type&&!u.isMoved()&&!f.hasError&&(l=u.getThumbPos(f))||(o="fade"),"zoom"===o?(n.fancybox.stop(a),s=n.fancybox.getTranslate(a),c={top:s.top,left:s.left,scaleX:s.width/l.width,scaleY:s.height/l.height,width:l.width,height:l.height},r=f.opts.zoomOpacity,
12698�
vendor: 30,962 bytes, lines 12698-12699
12698
12699"auto"==r&&(r=Math.abs(f.width/f.height-l.width/l.height)>.1),r&&(l.opacity=0),n.fancybox.setTranslate(a,c),p(a),n.fancybox.animate(a,l,i,h),!0):(o&&i?n.fancybox.animate(f.$slide.addClass("fancybox-slide--previous").removeClass("fancybox-slide--current"),"fancybox-animated fancybox-fx-"+o,i,h):!0===t?setTimeout(h,i):h(),!0)))},cleanUp:function(e){var o,i,a,s=this,r=s.current.opts.$orig;s.current.$slide.trigger("onReset"),s.$refs.container.empty().remove(),s.trigger("afterClose",e),s.current.opts.backFocus&&(r&&r.length&&r.is(":visible")||(r=s.$trigger),r&&r.length&&(i=t.scrollX,a=t.scrollY,r.trigger("focus"),n("html, body").scrollTop(a).scrollLeft(i))),s.current=null,o=n.fancybox.getInstance(),o?o.activate():(n("body").removeClass("fancybox-active compensate-for-scrollbar"),n("#fancybox-style-noscroll").remove())},trigger:function(t,e){var o,i=Array.prototype.slice.call(arguments,1),a=this,s=e&&e.opts?e:a.current;if(s?i.unshift(s):s=a,i.unshift(a),n.isFunction(s.opts[t])&&(o=s.opts[t].apply(s,i)),!1===o)return o;"afterClose"!==t&&a.$refs?a.$refs.container.trigger(t+".fb",i):r.trigger(t+".fb",i)},updateControls:function(){var t=this,o=t.current,i=o.index,a=t.$refs.container,s=t.$refs.caption,r=o.opts.caption;o.$slide.trigger("refresh"),r&&r.length?(t.$caption=s,s.children().eq(0).html(r)):t.$caption=null,t.hasHiddenControls||t.isIdle||t.showControls(),a.find("[data-fancybox-count]").html(t.group.length),a.find("[data-fancybox-index]").html(i+1),a.find("[data-fancybox-prev]").prop("disabled",!o.opts.loop&&i<=0),a.find("[data-fancybox-next]").prop("disabled",!o.opts.loop&&i>=t.group.length-1),"image"===o.type?a.find("[data-fancybox-zoom]").show().end().find("[data-fancybox-download]").attr("href",o.opts.image.src||o.src).show():o.opts.toolbar&&a.find("[data-fancybox-download],[data-fancybox-zoom]").hide(),n(e.activeElement).is(":hidden,[disabled]")&&t.$refs.container.trigger("focus")},hideControls:function(t){var e=this,n=["infobar","toolbar","nav"];!t&&e.current.opts.preventCaptionOverlap||n.push("caption"),this.$refs.container.removeClass(n.map(function(t){return"fancybox-show-"+t}).join(" ")),this.hasHiddenControls=!0},showControls:function(){var t=this,e=t.current?t.current.opts:t.opts,n=t.$refs.container;t.hasHiddenControls=!1,t.idleSecondsCounter=0,n.toggleClass("fancybox-show-toolbar",!(!e.toolbar||!e.buttons)).toggleClass("fancybox-show-infobar",!!(e.infobar&&t.group.length>1)).toggleClass("fancybox-show-caption",!!t.$caption).toggleClass("fancybox-show-nav",!!(e.arrows&&t.group.length>1)).toggleClass("fancybox-is-modal",!!e.modal)},toggleControls:function(){this.hasHiddenControls?this.showControls():this.hideControls()}}),n.fancybox={version:"3.5.7",defaults:a,getInstance:function(t){var e=n('.fancybox-container:not(".fancybox-is-closing"):last').data("FancyBox"),o=Array.prototype.slice.call(arguments,1);return e instanceof b&&("string"===n.type(t)?e[t].apply(e,o):"function"===n.type(t)&&t.apply(e,o),e)},open:function(t,e,n){return new b(t,e,n)},close:function(t){var e=this.getInstance();e&&(e.close(),!0===t&&this.close(t))},destroy:function(){this.close(!0),r.add("body").off("click.fb-start","**")},isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),use3d:function(){var n=e.createElement("div");return t.getComputedStyle&&t.getComputedStyle(n)&&t.getComputedStyle(n).getPropertyValue("transform")&&!(e.documentMode&&e.documentMode<11)}(),getTranslate:function(t){var e;return!(!t||!t.length)&&(e=t[0].getBoundingClientRect(),{top:e.top||0,left:e.left||0,width:e.width,height:e.height,opacity:parseFloat(t.css("opacity"))})},setTranslate:function(t,e){var n="",o={};if(t&&e)return void 0===e.left&&void 0===e.top||(n=(void 0===e.left?t.position().left:e.left)+"px, "+(void 0===e.top?t.position().top:e.top)+"px",n=this.use3d?"translate3d("+n+", 0px)":"translate("+n+")"),void 0!==e.scaleX&&void 0!==e.scaleY?n+=" scale("+e.scaleX+", "+e.scaleY+")":void 0!==e.scaleX&&(n+=" scaleX("+e.scaleX+")"),n.length&&(o.transform=n),void 0!==e.opacity&&(o.opacity=e.opacity),void 0!==e.width&&(o.width=e.width),void 0!==e.height&&(o.height=e.height),t.css(o)},animate:function(t,e,o,i,a){var s,r=this;n.isFunction(o)&&(i=o,o=null),r.stop(t),s=r.getTranslate(t),t.on(f,function(c){(!c||!c.originalEvent||t.is(c.originalEvent.target)&&"z-index"!=c.originalEvent.propertyName)&&(r.stop(t),n.isNumeric(o)&&t.css("transition-duration",""),n.isPlainObject(e)?void 0!==e.scaleX&&void 0!==e.scaleY&&r.setTranslate(t,{top:e.top,left:e.left,width:s.width*e.scaleX,height:s.height*e.scaleY,scaleX:1,scaleY:1}):!0!==a&&t.removeClass(e),n.isFunction(i)&&i(c))}),n.isNumeric(o)&&t.css("transition-duration",o+"ms"),n.isPlainObject(e)?(void 0!==e.scaleX&&void 0!==e.scaleY&&(delete e.width,delete e.height,t.parent().hasClass("fancybox-slide--image")&&t.parent().addClass("fancybox-is-scaling")),n.fancybox.setTranslate(t,e)):t.addClass(e),t.data("timer",setTimeout(function(){t.trigger(f)},o+33))},stop:function(t,e){t&&t.length&&(clearTimeout(t.data("timer")),e&&t.trigger(f),t.off(f).css("transition-duration",""),t.parent().removeClass("fancybox-is-scaling"))}},n.fn.fancybox=function(t){var e;return t=t||{},e=t.selector||!1,e?n("body").off("click.fb-start",e).on("click.fb-start",e,{options:t},i):this.off("click.fb-start").on("click.fb-start",{items:this,options:t},i),this},r.on("click.fb-start","[data-fancybox]",i),r.on("click.fb-start","[data-fancybox-trigger]",function(t){n('[data-fancybox="'+n(this).attr("data-fancybox-trigger")+'"]').eq(n(this).attr("data-fancybox-index")||0).trigger("click.fb-start",{$trigger:n(this)})}),function(){var t=null;r.on("mousedown mouseup focus blur",".fancybox-button",function(e){switch(e.type){case"mousedown":t=n(this);break;case"mouseup":t=null;break;case"focusin":n(".fancybox-button").removeClass("fancybox-focus"),n(this).is(t)||n(this).is("[disabled]")||n(this).addClass("fancybox-focus");break;case"focusout":n(".fancybox-button").removeClass("fancybox-focus")}})}()}}(window,document,jQuery),function(t){"use strict";var e={youtube:{matcher:/(youtube\.com|youtu\.be|youtube\-nocookie\.com)\/(watch\?(.*&)?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*))(.*)/i,params:{autoplay:1,autohide:1,fs:1,rel:0,hd:1,wmode:"transparent",enablejsapi:1,html5:1},paramPlace:8,type:"iframe",url:"https://www.youtube-nocookie.com/embed/$4",thumb:"https://img.youtube.com/vi/$4/hqdefault.jpg"},vimeo:{matcher:/^.+vimeo.com\/(.*\/)?([\d]+)(.*)?/,params:{autoplay:1,hd:1,show_title:1,show_byline:1,show_portrait:0,fullscreen:1},paramPlace:3,type:"iframe",url:"//player.vimeo.com/video/$2"},instagram:{matcher:/(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i,type:"image",url:"//$1/p/$2/media/?size=l"},gmap_place:{matcher:/(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(((maps\/(place\/(.*)\/)?\@(.*),(\d+.?\d+?)z))|(\?ll=))(.*)?/i,type:"iframe",url:function(t){return"//maps.google."+t[2]+"/?ll="+(t[9]?t[9]+"&z="+Math.floor(t[10])+(t[12]?t[12].replace(/^\//,"&"):""):t[12]+"").replace(/\?/,"&")+"&output="+(t[12]&&t[12].indexOf("layer=c")>0?"svembed":"embed")}},gmap_search:{matcher:/(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(maps\/search\/)(.*)/i,type:"iframe",url:function(t){return"//maps.google."+t[2]+"/maps?q="+t[5].replace("query=","q=").replace("api=1","")+"&output=embed"}}},n=function(e,n,o){if(e)return o=o||"","object"===t.type(o)&&(o=t.param(o,!0)),t.each(n,function(t,n){e=e.replace("$"+t,n||"")}),o.length&&(e+=(e.indexOf("?")>0?"&":"?")+o),e};t(document).on("objectNeedsType.fb",function(o,i,a){var s,r,c,l,d,u,f,p=a.src||"",h=!1;s=t.extend(!0,{},e,a.opts.media),t.each(s,function(e,o){if(c=p.match(o.matcher)){if(h=o.type,f=e,u={},o.paramPlace&&c[o.paramPlace]){d=c[o.paramPlace],"?"==d[0]&&(d=d.substring(1)),d=d.split("&");for(var i=0;i<d.length;++i){var s=d[i].split("=",2);2==s.length&&(u[s[0]]=decodeURIComponent(s[1].replace(/\+/g," ")))}}return l=t.extend(!0,{},o.params,a.opts[e],u),p="function"===t.type(o.url)?o.url.call(this,c,l,a):n(o.url,c,l),r="function"===t.type(o.thumb)?o.thumb.call(this,c,l,a):n(o.thumb,c),"youtube"===e?p=p.replace(/&t=((\d+)m)?(\d+)s/,function(t,e,n,o){return"&start="+((n?60*parseInt(n,10):0)+parseInt(o,10))}):"vimeo"===e&&(p=p.replace("&%23","#")),!1}}),h?(a.opts.thumb||a.opts.$thumb&&a.opts.$thumb.length||(a.opts.thumb=r),"iframe"===h&&(a.opts=t.extend(!0,a.opts,{iframe:{preload:!1,attr:{scrolling:"no"}}})),t.extend(a,{type:h,src:p,origSrc:a.src,contentSource:f,contentType:"image"===h?"image":"gmap_place"==f||"gmap_search"==f?"map":"video"})):p&&(a.type=a.opts.defaultType)});var o={youtube:{src:"https://www.youtube.com/iframe_api",class:"YT",loading:!1,loaded:!1},vimeo:{src:"https://player.vimeo.com/api/player.js",class:"Vimeo",loading:!1,loaded:!1},load:function(t){var e,n=this;if(this[t].loaded)return void setTimeout(function(){n.done(t)});this[t].loading||(this[t].loading=!0,e=document.createElement("script"),e.type="text/javascript",e.src=this[t].src,"youtube"===t?window.onYouTubeIframeAPIReady=function(){n[t].loaded=!0,n.done(t)}:e.onload=function(){n[t].loaded=!0,n.done(t)},document.body.appendChild(e))},done:function(e){var n,o,i;"youtube"===e&&delete window.onYouTubeIframeAPIReady,(n=t.fancybox.getInstance())&&(o=n.current.$content.find("iframe"),"youtube"===e&&void 0!==YT&&YT?i=new YT.Player(o.attr("id"),{events:{onStateChange:function(t){0==t.data&&n.next()}}}):"vimeo"===e&&void 0!==Vimeo&&Vimeo&&(i=new Vimeo.Player(o),i.on("ended",function(){n.next()})))}};t(document).on({"afterShow.fb":function(t,e,n){e.group.length>1&&("youtube"===n.contentSource||"vimeo"===n.contentSource)&&o.load(n.contentSource)}})}(jQuery),function(t,e,n){"use strict";var o=function(){return t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||function(e){return t.setTimeout(e,1e3/60)}}(),i=function(){return t.cancelAnimationFrame||t.webkitCancelAnimationFrame||t.mozCancelAnimationFrame||t.oCancelAnimationFrame||function(e){t.clearTimeout(e)}}(),a=function(e){var n=[];e=e.originalEvent||e||t.e,e=e.touches&&e.touches.length?e.touches:e.changedTouches&&e.changedTouches.length?e.changedTouches:[e];for(var o in e)e[o].pageX?n.push({x:e[o].pageX,y:e[o].pageY}):e[o].clientX&&n.push({x:e[o].clientX,y:e[o].clientY});return n},s=function(t,e,n){return e&&t?"x"===n?t.x-e.x:"y"===n?t.y-e.y:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)):0},r=function(t){if(t.is('a,area,button,[role="button"],input,label,select,summary,textarea,video,audio,iframe')||n.isFunction(t.get(0).onclick)||t.data("selectable"))return!0;for(var e=0,o=t[0].attributes,i=o.length;e<i;e++)if("data-fancybox-"===o[e].nodeName.substr(0,14))return!0;return!1},c=function(e){var n=t.getComputedStyle(e)["overflow-y"],o=t.getComputedStyle(e)["overflow-x"],i=("scroll"===n||"auto"===n)&&e.scrollHeight>e.clientHeight,a=("scroll"===o||"auto"===o)&&e.scrollWidth>e.clientWidth;return i||a},l=function(t){for(var e=!1;;){if(e=c(t.get(0)))break;if(t=t.parent(),!t.length||t.hasClass("fancybox-stage")||t.is("body"))break}return e},d=function(t){var e=this;e.instance=t,e.$bg=t.$refs.bg,e.$stage=t.$refs.stage,e.$container=t.$refs.container,e.destroy(),e.$container.on("touchstart.fb.touch mousedown.fb.touch",n.proxy(e,"ontouchstart"))};d.prototype.destroy=function(){var t=this;t.$container.off(".fb.touch"),n(e).off(".fb.touch"),t.requestId&&(i(t.requestId),t.requestId=null),t.tapped&&(clearTimeout(t.tapped),t.tapped=null)},d.prototype.ontouchstart=function(o){var i=this,c=n(o.target),d=i.instance,u=d.current,f=u.$slide,p=u.$content,h="touchstart"==o.type;if(h&&i.$container.off("mousedown.fb.touch"),(!o.originalEvent||2!=o.originalEvent.button)&&f.length&&c.length&&!r(c)&&!r(c.parent())&&(c.is("img")||!(o.originalEvent.clientX>c[0].clientWidth+c.offset().left))){if(!u||d.isAnimating||u.$slide.hasClass("fancybox-animated"))return o.stopPropagation(),void o.preventDefault();i.realPoints=i.startPoints=a(o),i.startPoints.length&&(u.touch&&o.stopPropagation(),i.startEvent=o,i.canTap=!0,i.$target=c,i.$content=p,i.opts=u.opts.touch,i.isPanning=!1,i.isSwiping=!1,i.isZooming=!1,i.isScrolling=!1,i.canPan=d.canPan(),i.startTime=(new Date).getTime(),i.distanceX=i.distanceY=i.distance=0,i.canvasWidth=Math.round(f[0].clientWidth),i.canvasHeight=Math.round(f[0].clientHeight),i.contentLastPos=null,i.contentStartPos=n.fancybox.getTranslate(i.$content)||{top:0,left:0},i.sliderStartPos=n.fancybox.getTranslate(f),i.stagePos=n.fancybox.getTranslate(d.$refs.stage),i.sliderStartPos.top-=i.stagePos.top,i.sliderStartPos.left-=i.stagePos.left,i.contentStartPos.top-=i.stagePos.top,i.contentStartPos.left-=i.stagePos.left,n(e).off(".fb.touch").on(h?"touchend.fb.touch touchcancel.fb.touch":"mouseup.fb.touch mouseleave.fb.touch",n.proxy(i,"ontouchend")).on(h?"touchmove.fb.touch":"mousemove.fb.touch",n.proxy(i,"ontouchmove")),n.fancybox.isMobile&&e.addEventListener("scroll",i.onscroll,!0),((i.opts||i.canPan)&&(c.is(i.$stage)||i.$stage.find(c).length)||(c.is(".fancybox-image")&&o.preventDefault(),n.fancybox.isMobile&&c.parents(".fancybox-caption").length))&&(i.isScrollable=l(c)||l(c.parent()),n.fancybox.isMobile&&i.isScrollable||o.preventDefault(),(1===i.startPoints.length||u.hasError)&&(i.canPan?(n.fancybox.stop(i.$content),i.isPanning=!0):i.isSwiping=!0,i.$container.addClass("fancybox-is-grabbing")),2===i.startPoints.length&&"image"===u.type&&(u.isLoaded||u.$ghost)&&(i.canTap=!1,i.isSwiping=!1,i.isPanning=!1,i.isZooming=!0,n.fancybox.stop(i.$content),i.centerPointStartX=.5*(i.startPoints[0].x+i.startPoints[1].x)-n(t).scrollLeft(),i.centerPointStartY=.5*(i.startPoints[0].y+i.startPoints[1].y)-n(t).scrollTop(),i.percentageOfImageAtPinchPointX=(i.centerPointStartX-i.contentStartPos.left)/i.contentStartPos.width,i.percentageOfImageAtPinchPointY=(i.centerPointStartY-i.contentStartPos.top)/i.contentStartPos.height,i.startDistanceBetweenFingers=s(i.startPoints[0],i.startPoints[1]))))}},d.prototype.onscroll=function(t){var n=this;n.isScrolling=!0,e.removeEventListener("scroll",n.onscroll,!0)},d.prototype.ontouchmove=function(t){var e=this;return void 0!==t.originalEvent.buttons&&0===t.originalEvent.buttons?void e.ontouchend(t):e.isScrolling?void(e.canTap=!1):(e.newPoints=a(t),void((e.opts||e.canPan)&&e.newPoints.length&&e.newPoints.length&&(e.isSwiping&&!0===e.isSwiping||t.preventDefault(),e.distanceX=s(e.newPoints[0],e.startPoints[0],"x"),e.distanceY=s(e.newPoints[0],e.startPoints[0],"y"),e.distance=s(e.newPoints[0],e.startPoints[0]),e.distance>0&&(e.isSwiping?e.onSwipe(t):e.isPanning?e.onPan():e.isZooming&&e.onZoom()))))},d.prototype.onSwipe=function(e){var a,s=this,r=s.instance,c=s.isSwiping,l=s.sliderStartPos.left||0;if(!0!==c)"x"==c&&(s.distanceX>0&&(s.instance.group.length<2||0===s.instance.current.index&&!s.instance.current.opts.loop)?l+=Math.pow(s.distanceX,.8):s.distanceX<0&&(s.instance.group.length<2||s.instance.current.index===s.instance.group.length-1&&!s.instance.current.opts.loop)?l-=Math.pow(-s.distanceX,.8):l+=s.distanceX),s.sliderLastPos={top:"x"==c?0:s.sliderStartPos.top+s.distanceY,left:l},s.requestId&&(i(s.requestId),s.requestId=null),s.requestId=o(function(){s.sliderLastPos&&(n.each(s.instance.slides,function(t,e){var o=e.pos-s.instance.currPos;n.fancybox.setTranslate(e.$slide,{top:s.sliderLastPos.top,left:s.sliderLastPos.left+o*s.canvasWidth+o*e.opts.gutter})}),s.$container.addClass("fancybox-is-sliding"))});else if(Math.abs(s.distance)>10){if(s.canTap=!1,r.group.length<2&&s.opts.vertical?s.isSwiping="y":r.isDragging||!1===s.opts.vertical||"auto"===s.opts.vertical&&n(t).width()>800?s.isSwiping="x":(a=Math.abs(180*Math.atan2(s.distanceY,s.distanceX)/Math.PI),s.isSwiping=a>45&&a<135?"y":"x"),"y"===s.isSwiping&&n.fancybox.isMobile&&s.isScrollable)return void(s.isScrolling=!0);r.isDragging=s.isSwiping,s.startPoints=s.newPoints,n.each(r.slides,function(t,e){var o,i;n.fancybox.stop(e.$slide),o=n.fancybox.getTranslate(e.$slide),i=n.fancybox.getTranslate(r.$refs.stage),e.$slide.css({transform:"",opacity:"","transition-duration":""}).removeClass("fancybox-animated").removeClass(function(t,e){return(e.match(/(^|\s)fancybox-fx-\S+/g)||[]).join(" ")}),e.pos===r.current.pos&&(s.sliderStartPos.top=o.top-i.top,s.sliderStartPos.left=o.left-i.left),n.fancybox.setTranslate(e.$slide,{top:o.top-i.top,left:o.left-i.left})}),r.SlideShow&&r.SlideShow.isActive&&r.SlideShow.stop()}},d.prototype.onPan=function(){var t=this;if(s(t.newPoints[0],t.realPoints[0])<(n.fancybox.isMobile?10:5))return void(t.startPoints=t.newPoints);t.canTap=!1,t.contentLastPos=t.limitMovement(),t.requestId&&i(t.requestId),t.requestId=o(function(){n.fancybox.setTranslate(t.$content,t.contentLastPos)})},d.prototype.limitMovement=function(){var t,e,n,o,i,a,s=this,r=s.canvasWidth,c=s.canvasHeight,l=s.distanceX,d=s.distanceY,u=s.contentStartPos,f=u.left,p=u.top,h=u.width,g=u.height;return i=h>r?f+l:f,a=p+d,t=Math.max(0,.5*r-.5*h),e=Math.max(0,.5*c-.5*g),n=Math.min(r-h,.5*r-.5*h),o=Math.min(c-g,.5*c-.5*g),l>0&&i>t&&(i=t-1+Math.pow(-t+f+l,.8)||0),l<0&&i<n&&(i=n+1-Math.pow(n-f-l,.8)||0),d>0&&a>e&&(a=e-1+Math.pow(-e+p+d,.8)||0),d<0&&a<o&&(a=o+1-Math.pow(o-p-d,.8)||0),{top:a,left:i}},d.prototype.limitPosition=function(t,e,n,o){var i=this,a=i.canvasWidth,s=i.canvasHeight;return n>a?(t=t>0?0:t,t=t<a-n?a-n:t):t=Math.max(0,a/2-n/2),o>s?(e=e>0?0:e,e=e<s-o?s-o:e):e=Math.max(0,s/2-o/2),{top:e,left:t}},d.prototype.onZoom=function(){var e=this,a=e.contentStartPos,r=a.width,c=a.height,l=a.left,d=a.top,u=s(e.newPoints[0],e.newPoints[1]),f=u/e.startDistanceBetweenFingers,p=Math.floor(r*f),h=Math.floor(c*f),g=(r-p)*e.percentageOfImageAtPinchPointX,b=(c-h)*e.percentageOfImageAtPinchPointY,m=(e.newPoints[0].x+e.newPoints[1].x)/2-n(t).scrollLeft(),v=(e.newPoints[0].y+e.newPoints[1].y)/2-n(t).scrollTop(),y=m-e.centerPointStartX,x=v-e.centerPointStartY,w=l+(g+y),$=d+(b+x),S={top:$,left:w,scaleX:f,scaleY:f};e.canTap=!1,e.newWidth=p,e.newHeight=h,e.contentLastPos=S,e.requestId&&i(e.requestId),e.requestId=o(function(){n.fancybox.setTranslate(e.$content,e.contentLastPos)})},d.prototype.ontouchend=function(t){var o=this,s=o.isSwiping,r=o.isPanning,c=o.isZooming,l=o.isScrolling;if(o.endPoints=a(t),o.dMs=Math.max((new Date).getTime()-o.startTime,1),o.$container.removeClass("fancybox-is-grabbing"),n(e).off(".fb.touch"),e.removeEventListener("scroll",o.onscroll,!0),o.requestId&&(i(o.requestId),o.requestId=null),o.isSwiping=!1,o.isPanning=!1,o.isZooming=!1,o.isScrolling=!1,o.instance.isDragging=!1,o.canTap)return o.onTap(t);o.speed=100,o.velocityX=o.distanceX/o.dMs*.5,o.velocityY=o.distanceY/o.dMs*.5,r?o.endPanning():c?o.endZooming():o.endSwiping(s,l)},d.prototype.endSwiping=function(t,e){var o=this,i=!1,a=o.instance.group.length,s=Math.abs(o.distanceX),r="x"==t&&a>1&&(o.dMs>130&&s>10||s>50);o.sliderLastPos=null,"y"==t&&!e&&Math.abs(o.distanceY)>50?(n.fancybox.animate(o.instance.current.$slide,{top:o.sliderStartPos.top+o.distanceY+150*o.velocityY,opacity:0},200),i=o.instance.close(!0,250)):r&&o.distanceX>0?i=o.instance.previous(300):r&&o.distanceX<0&&(i=o.instance.next(300)),!1!==i||"x"!=t&&"y"!=t||o.instance.centerSlide(200),o.$container.removeClass("fancybox-is-sliding")},d.prototype.endPanning=function(){var t,e,o,i=this;i.contentLastPos&&(!1===i.opts.momentum||i.dMs>350?(t=i.contentLastPos.left,e=i.contentLastPos.top):(t=i.contentLastPos.left+500*i.velocityX,e=i.contentLastPos.top+500*i.velocityY),o=i.limitPosition(t,e,i.contentStartPos.width,i.contentStartPos.height),o.width=i.contentStartPos.width,o.height=i.contentStartPos.height,n.fancybox.animate(i.$content,o,366))},d.prototype.endZooming=function(){var t,e,o,i,a=this,s=a.instance.current,r=a.newWidth,c=a.newHeight;a.contentLastPos&&(t=a.contentLastPos.left,e=a.contentLastPos.top,i={top:e,left:t,width:r,height:c,scaleX:1,scaleY:1},n.fancybox.setTranslate(a.$content,i),r<a.canvasWidth&&c<a.canvasHeight?a.instance.scaleToFit(150):r>s.width||c>s.height?a.instance.scaleToActual(a.centerPointStartX,a.centerPointStartY,150):(o=a.limitPosition(t,e,r,c),n.fancybox.animate(a.$content,o,150)))},d.prototype.onTap=function(e){var o,i=this,s=n(e.target),r=i.instance,c=r.current,l=e&&a(e)||i.startPoints,d=l[0]?l[0].x-n(t).scrollLeft()-i.stagePos.left:0,u=l[0]?l[0].y-n(t).scrollTop()-i.stagePos.top:0,f=function(t){var o=c.opts[t];if(n.isFunction(o)&&(o=o.apply(r,[c,e])),o)switch(o){case"close":r.close(i.startEvent);break;case"toggleControls":r.toggleControls();break;case"next":r.next();break;case"nextOrClose":r.group.length>1?r.next():r.close(i.startEvent);break;case"zoom":"image"==c.type&&(c.isLoaded||c.$ghost)&&(r.canPan()?r.scaleToFit():r.isScaledDown()?r.scaleToActual(d,u):r.group.length<2&&r.close(i.startEvent))}};if((!e.originalEvent||2!=e.originalEvent.button)&&(s.is("img")||!(d>s[0].clientWidth+s.offset().left))){if(s.is(".fancybox-bg,.fancybox-inner,.fancybox-outer,.fancybox-container"))o="Outside";else if(s.is(".fancybox-slide"))o="Slide";else{if(!r.current.$content||!r.current.$content.find(s).addBack().filter(s).length)return;o="Content"}if(i.tapped){if(clearTimeout(i.tapped),i.tapped=null,Math.abs(d-i.tapX)>50||Math.abs(u-i.tapY)>50)return this;f("dblclick"+o)}else i.tapX=d,i.tapY=u,c.opts["dblclick"+o]&&c.opts["dblclick"+o]!==c.opts["click"+o]?i.tapped=setTimeout(function(){i.tapped=null,r.isAnimating||f("click"+o)},500):f("click"+o);return this}},n(e).on("onActivate.fb",function(t,e){e&&!e.Guestures&&(e.Guestures=new d(e))}).on("beforeClose.fb",function(t,e){e&&e.Guestures&&e.Guestures.destroy()})}(window,document,jQuery),function(t,e){"use strict";e.extend(!0,e.fancybox.defaults,{btnTpl:{slideShow:'<button data-fancybox-play class="fancybox-button fancybox-button--play" title="{{PLAY_START}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6.5 5.4v13.2l11-6.6z"/></svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.33 5.75h2.2v12.5h-2.2V5.75zm5.15 0h2.2v12.5h-2.2V5.75z"/></svg></button>'},slideShow:{autoStart:!1,speed:3e3,progress:!0}});var n=function(t){this.instance=t,this.init()};e.extend(n.prototype,{timer:null,isActive:!1,$button:null,init:function(){var t=this,n=t.instance,o=n.group[n.currIndex].opts.slideShow;t.$button=n.$refs.toolbar.find("[data-fancybox-play]").on("click",function(){t.toggle()}),n.group.length<2||!o?t.$button.hide():o.progress&&(t.$progress=e('<div class="fancybox-progress"></div>').appendTo(n.$refs.inner))},set:function(t){var n=this,o=n.instance,i=o.current;i&&(!0===t||i.opts.loop||o.currIndex<o.group.length-1)?n.isActive&&"video"!==i.contentType&&(n.$progress&&e.fancybox.animate(n.$progress.show(),{scaleX:1},i.opts.slideShow.speed),n.timer=setTimeout(function(){o.current.opts.loop||o.current.index!=o.group.length-1?o.next():o.jumpTo(0)},i.opts.slideShow.speed)):(n.stop(),o.idleSecondsCounter=0,o.showControls())},clear:function(){var t=this;clearTimeout(t.timer),t.timer=null,t.$progress&&t.$progress.removeAttr("style").hide()},start:function(){var t=this,e=t.instance.current;e&&(t.$button.attr("title",(e.opts.i18n[e.opts.lang]||e.opts.i18n.en).PLAY_STOP).removeClass("fancybox-button--play").addClass("fancybox-button--pause"),t.isActive=!0,e.isComplete&&t.set(!0),t.instance.trigger("onSlideShowChange",!0))},stop:function(){var t=this,e=t.instance.current;t.clear(),t.$button.attr("title",(e.opts.i18n[e.opts.lang]||e.opts.i18n.en).PLAY_START).removeClass("fancybox-button--pause").addClass("fancybox-button--play"),t.isActive=!1,t.instance.trigger("onSlideShowChange",!1),t.$progress&&t.$progress.removeAttr("style").hide()},toggle:function(){var t=this;t.isActive?t.stop():t.start()}}),e(t).on({"onInit.fb":function(t,e){e&&!e.SlideShow&&(e.SlideShow=new n(e))},"beforeShow.fb":function(t,e,n,o){var i=e&&e.SlideShow;o?i&&n.opts.slideShow.autoStart&&i.start():i&&i.isActive&&i.clear()},"afterShow.fb":function(t,e,n){var o=e&&e.SlideShow;o&&o.isActive&&o.set()},"afterKeydown.fb":function(n,o,i,a,s){var r=o&&o.SlideShow;!r||!i.opts.slideShow||80!==s&&32!==s||e(t.activeElement).is("button,a,input")||(a.preventDefault(),r.toggle())},"beforeClose.fb onDeactivate.fb":function(t,e){var n=e&&e.SlideShow;n&&n.stop()}}),e(t).on("visibilitychange",function(){var n=e.fancybox.getInstance(),o=n&&n.SlideShow;o&&o.isActive&&(t.hidden?o.clear():o.set())})}(document,jQuery),function(t,e){"use strict";var n=function(){for(var e=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],n={},o=0;o<e.length;o++){var i=e[o];if(i&&i[1]in t){for(var a=0;a<i.length;a++)n[e[0][a]]=i[a];return n}}return!1}();if(n){var o={request:function(e){e=e||t.documentElement,e[n.requestFullscreen](e.ALLOW_KEYBOARD_INPUT)},exit:function(){t[n.exitFullscreen]()},toggle:function(e){e=e||t.documentElement,this.isFullscreen()?this.exit():this.request(e)},isFullscreen:function(){return Boolean(t[n.fullscreenElement])},enabled:function(){return Boolean(t[n.fullscreenEnabled])}};e.extend(!0,e.fancybox.defaults,{btnTpl:{fullScreen:'<button data-fancybox-fullscreen class="fancybox-button fancybox-button--fsenter" title="{{FULL_SCREEN}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"/></svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5 16h3v3h2v-5H5zm3-8H5v2h5V5H8zm6 11h2v-3h3v-2h-5zm2-11V5h-2v5h5V8z"/></svg></button>'},fullScreen:{autoStart:!1}}),e(t).on(n.fullscreenchange,function(){var t=o.isFullscreen(),n=e.fancybox.getInstance();n&&(n.current&&"image"===n.current.type&&n.isAnimating&&(n.isAnimating=!1,n.update(!0,!0,0),n.isComplete||n.complete()),n.trigger("onFullscreenChange",t),n.$refs.container.toggleClass("fancybox-is-fullscreen",t),n.$refs.toolbar.find("[data-fancybox-fullscreen]").toggleClass("fancybox-button--fsenter",!t).toggleClass("fancybox-button--fsexit",t))})}e(t).on({"onInit.fb":function(t,e){var i;if(!n)return void e.$refs.toolbar.find("[data-fancybox-fullscreen]").remove();e&&e.group[e.currIndex].opts.fullScreen?(i=e.$refs.container,i.on("click.fb-fullscreen","[data-fancybox-fullscreen]",function(t){t.stopPropagation(),t.preventDefault(),o.toggle()}),e.opts.fullScreen&&!0===e.opts.fullScreen.autoStart&&o.request(),e.FullScreen=o):e&&e.$refs.toolbar.find("[data-fancybox-fullscreen]").hide()},"afterKeydown.fb":function(t,e,n,o,i){e&&e.FullScreen&&70===i&&(o.preventDefault(),e.FullScreen.toggle())},"beforeClose.fb":function(t,e){e&&e.FullScreen&&e.$refs.container.hasClass("fancybox-is-fullscreen")&&o.exit()}})}(document,jQuery),function(t,e){"use strict";var n="fancybox-thumbs";e.fancybox.defaults=e.extend(!0,{btnTpl:{thumbs:'<button data-fancybox-thumbs class="fancybox-button fancybox-button--thumbs" title="{{THUMBS}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14.59 14.59h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76H5.65v-3.76zm8.94-4.47h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76H5.65v-3.76zm8.94-4.47h3.76v3.76h-3.76V5.65zm-4.47 0h3.76v3.76h-3.76V5.65zm-4.47 0h3.76v3.76H5.65V5.65z"/></svg></button>'},thumbs:{autoStart:!1,hideOnClose:!0,parentEl:".fancybox-container",axis:"y"}},e.fancybox.defaults);var o=function(t){this.init(t)};e.extend(o.prototype,{$button:null,$grid:null,$list:null,isVisible:!1,isActive:!1,init:function(t){var e=this,n=t.group,o=0;e.instance=t,e.opts=n[t.currIndex].opts.thumbs,t.Thumbs=e,e.$button=t.$refs.toolbar.find("[data-fancybox-thumbs]");for(var i=0,a=n.length;i<a&&(n[i].thumb&&o++,!(o>1));i++);o>1&&e.opts?(e.$button.removeAttr("style").on("click",function(){e.toggle()}),e.isActive=!0):e.$button.hide()},create:function(){var t,o=this,i=o.instance,a=o.opts.parentEl,s=[];o.$grid||(o.$grid=e('<div class="'+n+" "+n+"-"+o.opts.axis+'"></div>').appendTo(i.$refs.container.find(a).addBack().filter(a)),o.$grid.on("click","a",function(){i.jumpTo(e(this).attr("data-index"))})),o.$list||(o.$list=e('<div class="'+n+'__list">').appendTo(o.$grid)),e.each(i.group,function(e,n){t=n.thumb,t||"image"!==n.type||(t=n.src),s.push('<a href="javascript:;" tabindex="0" data-index="'+e+'"'+(t&&t.length?' style="background-image:url('+t+')"':'class="fancybox-thumbs-missing"')+"></a>")}),o.$list[0].innerHTML=s.join(""),"x"===o.opts.axis&&o.$list.width(parseInt(o.$grid.css("padding-right"),10)+i.group.length*o.$list.children().eq(0).outerWidth(!0))},focus:function(t){var e,n,o=this,i=o.$list,a=o.$grid;o.instance.current&&(e=i.children().removeClass("fancybox-thumbs-active").filter('[data-index="'+o.instance.current.index+'"]').addClass("fancybox-thumbs-active"),n=e.position(),"y"===o.opts.axis&&(n.top<0||n.top>i.height()-e.outerHeight())?i.stop().animate({scrollTop:i.scrollTop()+n.top},t):"x"===o.opts.axis&&(n.left<a.scrollLeft()||n.left>a.scrollLeft()+(a.width()-e.outerWidth()))&&i.parent().stop().animate({scrollLeft:n.left},t))},update:function(){var t=this;t.instance.$refs.container.toggleClass("fancybox-show-thumbs",this.isVisible),t.isVisible?(t.$grid||t.create(),t.instance.trigger("onThumbsShow"),t.focus(0)):t.$grid&&t.instance.trigger("onThumbsHide"),t.instance.update()},hide:function(){this.isVisible=!1,this.update()},show:function(){this.isVisible=!0,this.update()},toggle:function(){this.isVisible=!this.isVisible,this.update()}}),e(t).on({"onInit.fb":function(t,e){var n;e&&!e.Thumbs&&(n=new o(e),n.isActive&&!0===n.opts.autoStart&&n.show())},"beforeShow.fb":function(t,e,n,o){var i=e&&e.Thumbs;i&&i.isVisible&&i.focus(o?0:250)},"afterKeydown.fb":function(t,e,n,o,i){var a=e&&e.Thumbs;a&&a.isActive&&71===i&&(o.preventDefault(),a.toggle())},"beforeClose.fb":function(t,e){var n=e&&e.Thumbs;n&&n.isVisible&&!1!==n.opts.hideOnClose&&n.$grid.hide()}})}(document,jQuery),function(t,e){"use strict";function n(t){var e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};return String(t).replace(/[&<>"'`=\/]/g,function(t){return e[t]})}e.extend(!0,e.fancybox.defaults,{btnTpl:{share:'<button data-fancybox-share class="fancybox-button fancybox-button--share" title="{{SHARE}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M2.55 19c1.4-8.4 9.1-9.8 11.9-9.8V5l7 7-7 6.3v-3.5c-2.8 0-10.5 2.1-11.9 4.2z"/></svg></button>'},share:{url:function(t,e){return!t.currentHash&&"inline"!==e.type&&"html"!==e.type&&(e.origSrc||e.src)||window.location},
vendor: 2,330 bytes, lines 12699-12700
12699
12700tpl:'<div class="fancybox-share"><h1>{{SHARE}}</h1><p><a class="fancybox-share__button fancybox-share__button--fb" href="https://www.facebook.com/sharer/sharer.php?u={{url}}"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m287 456v-299c0-21 6-35 35-35h38v-63c-7-1-29-3-55-3-54 0-91 33-91 94v306m143-254h-205v72h196" /></svg><span>Facebook</span></a><a class="fancybox-share__button fancybox-share__button--tw" href="https://twitter.com/intent/tweet?url={{url}}&text={{descr}}"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m456 133c-14 7-31 11-47 13 17-10 30-27 37-46-15 10-34 16-52 20-61-62-157-7-141 75-68-3-129-35-169-85-22 37-11 86 26 109-13 0-26-4-37-9 0 39 28 72 65 80-12 3-25 4-37 2 10 33 41 57 77 57-42 30-77 38-122 34 170 111 378-32 359-208 16-11 30-25 41-42z" /></svg><span>Twitter</span></a><a class="fancybox-share__button fancybox-share__button--pt" href="https://www.pinterest.com/pin/create/button/?url={{url}}&description={{descr}}&media={{media}}"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m265 56c-109 0-164 78-164 144 0 39 15 74 47 87 5 2 10 0 12-5l4-19c2-6 1-8-3-13-9-11-15-25-15-45 0-58 43-110 113-110 62 0 96 38 96 88 0 67-30 122-73 122-24 0-42-19-36-44 6-29 20-60 20-81 0-19-10-35-31-35-25 0-44 26-44 60 0 21 7 36 7 36l-30 125c-8 37-1 83 0 87 0 3 4 4 5 2 2-3 32-39 42-75l16-64c8 16 31 29 56 29 74 0 124-67 124-157 0-69-58-132-146-132z" fill="#fff"/></svg><span>Pinterest</span></a></p><p><input class="fancybox-share__input" type="text" value="{{url_raw}}" onclick="select()" /></p></div>'}}),e(t).on("click","[data-fancybox-share]",function(){var t,o,i=e.fancybox.getInstance(),a=i.current||null;a&&("function"===e.type(a.opts.share.url)&&(t=a.opts.share.url.apply(a,[i,a])),o=a.opts.share.tpl.replace(/\{\{media\}\}/g,"image"===a.type?encodeURIComponent(a.src):"").replace(/\{\{url\}\}/g,encodeURIComponent(t)).replace(/\{\{url_raw\}\}/g,n(t)).replace(/\{\{descr\}\}/g,i.$caption?encodeURIComponent(i.$caption.text()):""),e.fancybox.open({src:i.translate(i,o),type:"html",opts:{touch:!1,animationEffect:!1,afterLoad:function(t,e){i.$refs.container.one("beforeClose.fb",function(){t.close(null,0)}),e.$content.find(".fancybox-share__button").click(function(){return window.open(this.href,"Share","width=550, height=450"),!1})}
12700,mobile:{autoFocus:!1}}}))})}(document,jQuery),function(t,e,n){"use strict";function o(){var e=t.location.hash.substr(1),n=e.split("-"),o=n.length>1&&/^\+?\d+$/.test(n[n.length-1])?parseInt(n.pop(-1),10)||1:1,i=n.join("-");return{hash:e,index:o<1?1:o,gallery:i}}function i(t){""!==t.gallery&&n("[data-fancybox='"+n.escapeSelector(t.gallery)+"']").eq(t.index-1).focus().trigger("click.fb-start")}function a(t){var e,n;return!!t&&(e=t.current?t.current.opts:t.opts,""!==(n=e.hash||(e.$orig?e.$orig.data("fancybox")||e.$orig.data("fancybox-trigger"):""))&&n)}n.escapeSelector||(n.escapeSelector=function(t){return(t+"").replace(/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t})}),n(function(){!1!==n.fancybox.defaults.hash&&(n(e).on({"onInit.fb":function(t,e){var n,i;!1!==e.group[e.currIndex].opts.hash&&(n=o(),(i=a(e))&&n.gallery&&i==n.gallery&&(e.currIndex=n.index-1))},"beforeShow.fb":function(n,o,i,s){var r;i&&!1!==i.opts.hash&&(r=a(o))&&(o.currentHash=r+(o.group.length>1?"-"+(i.index+1):""),t.location.hash!=="#"+o.currentHash&&(s&&!o.origHash&&(o.origHash=t.location.hash),o.hashTimer&&clearTimeout(o.hashTimer),o.hashTimer=setTimeout(function(){"replaceState"in t.history?(t.history[s?"pushState":"replaceState"]({},e.title,t.location.pathname+t.location.search+"#"+o.currentHash),s&&(o.hasCreatedHistory=!0)):t.location.hash=o.currentHash,o.hashTimer=null},300)))},"beforeClose.fb":function(n,o,i){i&&!1!==i.opts.hash&&(clearTimeout(o.hashTimer),o.currentHash&&o.hasCreatedHistory?t.history.back():o.currentHash&&("replaceState"in t.history?t.history.replaceState({},e.title,t.location.pathname+t.location.search+(o.origHash||"")):t.location.hash=o.origHash),o.currentHash=null)}}),n(t).on("hashchange.fb",function(){var t=o(),e=null;n.each(n(".fancybox-container").get().reverse(),function(t,o){var i=n(o).data("FancyBox");if(i&&i.currentHash)return e=i,!1}),e?e.currentHash===t.gallery+"-"+t.index||1===t.index&&e.currentHash==t.gallery||(e.currentHash=null,e.close()):""!==t.gallery&&i(t)}),setTimeout(function(){n.fancybox.getInstance()||i(o())},50))})}(window,document,jQuery),function(t,e){"use strict";var n=(new Date).getTime();e(t).on({"onInit.fb":function(t,e,o){e.$refs.stage.on("mousewheel DOMMouseScroll wheel MozMousePixelScroll",function(t){var o=e.current,i=(new Date).getTime();e.group.length<2||!1===o.opts.wheel||"auto"===o.opts.wheel&&"image"!==o.type||(t.preventDefault(),t.stopPropagation(),o.$slide.hasClass("fancybox-animated")||(t=t.originalEvent||t,i-n<250||(n=i,e[(-t.deltaY||-t.deltaX||t.wheelDelta||-t.detail)<0?"next":"previous"]())))})}})}(document,jQuery);
12701
12702/**!
12703 handlebars v4.7.8
12704*/
12705!function(a,b){"object"==typeof exports&&"object"==typeof module?module.exports=b():"function"==typeof define&&define.amd?define([],b):"object"==typeof exports?exports.Handlebars=b():a.Handlebars=b()}(this,function(){return function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}var c={};return b.m=a,b.c=c,b.p="",b(0)}([function(a,b,c){"use strict";function d(){var a=r();return a.compile=function(b,c){return k.compile(b,c,a)},a.precompile=function(b,c){return k.precompile(b,c,a)},a.AST=i["default"],a.Compiler=k.Compiler,a.JavaScriptCompiler=m["default"],a.Parser=j.parser,a.parse=j.parse,a.parseWithoutProcessing=j.parseWithoutProcessing,a}var e=c(1)["default"];b.__esModule=!0;var f=c(2),g=e(f),h=c(84),i=e(h),j=c(85),k=c(90),l=c(91),m=e(l),n=c(88),o=e(n),p=c(83),q=e(p),r=g["default"].create,s=d();s.create=d,q["default"](s),s.Visitor=o["default"],s["default"]=s,b["default"]=s,a.exports=b["default"]},function(a,b){"use strict";b["default"]=function(a){return a&&a.__esModule?a:{"default":a}},b.__esModule=!0},function(a,b,c){"use strict";function d(){var a=new h.HandlebarsEnvironment;return n.extend(a,h),a.SafeString=j["default"],a.Exception=l["default"],a.Utils=n,a.escapeExpression=n.escapeExpression,a.VM=p,a.template=function(b){return p.template(b,a)},a}var e=c(3)["default"],f=c(1)["default"];b.__esModule=!0;var g=c(4),h=e(g),i=c(77),j=f(i),k=c(6),l=f(k),m=c(5),n=e(m),o=c(78),p=e(o),q=c(83),r=f(q),s=d();s.create=d,r["default"](s),s["default"]=s,b["default"]=s,a.exports=b["default"]},function(a,b){"use strict";
vendor: 4,325 bytes, line 12705
12705b["default"]=function(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b},b.__esModule=!0},function(a,b,c){"use strict";function d(a,b,c){this.helpers=a||{},this.partials=b||{},this.decorators=c||{},i.registerDefaultHelpers(this),j.registerDefaultDecorators(this)}var e=c(1)["default"];b.__esModule=!0,b.HandlebarsEnvironment=d;var f=c(5),g=c(6),h=e(g),i=c(10),j=c(70),k=c(72),l=e(k),m=c(73),n="4.7.8";b.VERSION=n;var o=8;b.COMPILER_REVISION=o;var p=7;b.LAST_COMPATIBLE_COMPILER_REVISION=p;var q={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};b.REVISION_CHANGES=q;var r="[object Object]";d.prototype={constructor:d,logger:l["default"],log:l["default"].log,registerHelper:function(a,b){if(f.toString.call(a)===r){if(b)throw new h["default"]("Arg not supported with multiple helpers");f.extend(this.helpers,a)}else this.helpers[a]=b},unregisterHelper:function(a){delete this.helpers[a]},registerPartial:function(a,b){if(f.toString.call(a)===r)f.extend(this.partials,a);else{if("undefined"==typeof b)throw new h["default"]('Attempting to register a partial called "'+a+'" as undefined');this.partials[a]=b}},unregisterPartial:function(a){delete this.partials[a]},registerDecorator:function(a,b){if(f.toString.call(a)===r){if(b)throw new h["default"]("Arg not supported with multiple decorators");f.extend(this.decorators,a)}else this.decorators[a]=b},unregisterDecorator:function(a){delete this.decorators[a]},resetLoggedPropertyAccesses:function(){m.resetLoggedProperties()}};var s=l["default"].log;b.log=s,b.createFrame=f.createFrame,b.logger=l["default"]},function(a,b){"use strict";function c(a){return k[a]}function d(a){for(var b=1;b<arguments.length;b++)for(var c in arguments[b])Object.prototype.hasOwnProperty.call(arguments[b],c)&&(a[c]=arguments[b][c]);return a}function e(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1}function f(a){if("string"!=typeof a){if(a&&a.toHTML)return a.toHTML();if(null==a)return"";if(!a)return a+"";a=""+a}return m.test(a)?a.replace(l,c):a}function g(a){return!a&&0!==a||!(!p(a)||0!==a.length)}function h(a){var b=d({},a);return b._parent=a,b}function i(a,b){return a.path=b,a}function j(a,b){return(a?a+".":"")+b}b.__esModule=!0,b.extend=d,b.indexOf=e,b.escapeExpression=f,b.isEmpty=g,b.createFrame=h,b.blockParams=i,b.appendContextPath=j;var k={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;","=":"&#x3D;"},l=/[&<>"'`=]/g,m=/[&<>"'`=]/,n=Object.prototype.toString;b.toString=n;var o=function(a){return"function"==typeof a};o(/x/)&&(b.isFunction=o=function(a){return"function"==typeof a&&"[object Function]"===n.call(a)}),b.isFunction=o;var p=Array.isArray||function(a){return!(!a||"object"!=typeof a)&&"[object Array]"===n.call(a)};b.isArray=p},function(a,b,c){"use strict";function d(a,b){var c=b&&b.loc,g=void 0,h=void 0,i=void 0,j=void 0;c&&(g=c.start.line,h=c.end.line,i=c.start.column,j=c.end.column,a+=" - "+g+":"+i);for(var k=Error.prototype.constructor.call(this,a),l=0;l<f.length;l++)this[f[l]]=k[f[l]];Error.captureStackTrace&&Error.captureStackTrace(this,d);try{c&&(this.lineNumber=g,this.endLineNumber=h,e?(Object.defineProperty(this,"column",{value:i,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:j,enumerable:!0})):(this.column=i,this.endColumn=j))}catch(m){}}var e=c(7)["default"];b.__esModule=!0;var f=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];d.prototype=new Error,b["default"]=d,a.exports=b["default"]},function(a,b,c){a.exports={"default":c(8),__esModule:!0}},function(a,b,c){var d=c(9);a.exports=function(a,b,c){return d.setDesc(a,b,c)}},function(a,b){var c=Object;a.exports={create:c.create,getProto:c.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:c.getOwnPropertyDescriptor,setDesc:c.defineProperty,setDescs:c.defineProperties,getKeys:c.keys,getNames:c.getOwnPropertyNames,getSymbols:c.getOwnPropertySymbols,each:[].forEach}},function(a,b,c){"use strict";function d(a){h["default"](a),j["default"](a),l["default"](a),n["default"](a),p["default"](a),r["default"](a),t["default"](a)}function e(a,b,c){a.helpers[b]&&(a.hooks[b]=a.helpers[b],c||delete a.helpers[b]
vendor: 14,607 bytes, line 12705
12705)}var f=c(1)["default"];b.__esModule=!0,b.registerDefaultHelpers=d,b.moveHelperToHooks=e;var g=c(11),h=f(g),i=c(12),j=f(i),k=c(65),l=f(k),m=c(66),n=f(m),o=c(67),p=f(o),q=c(68),r=f(q),s=c(69),t=f(s)},function(a,b,c){"use strict";b.__esModule=!0;var d=c(5);b["default"]=function(a){a.registerHelper("blockHelperMissing",function(b,c){var e=c.inverse,f=c.fn;if(b===!0)return f(this);if(b===!1||null==b)return e(this);if(d.isArray(b))return b.length>0?(c.ids&&(c.ids=[c.name]),a.helpers.each(b,c)):e(this);if(c.data&&c.ids){var g=d.createFrame(c.data);g.contextPath=d.appendContextPath(c.data.contextPath,c.name),c={data:g}}return f(b,c)})},a.exports=b["default"]},function(a,b,c){"use strict";var d=c(13)["default"],e=c(43)["default"],f=c(55)["default"],g=c(60)["default"],h=c(1)["default"];b.__esModule=!0;var i=c(5),j=c(6),k=h(j);b["default"]=function(a){a.registerHelper("each",function(a,b){function c(b,c,d){n&&(n.key=b,n.index=c,n.first=0===c,n.last=!!d,o&&(n.contextPath=o+b)),m+=h(a[b],{data:n,blockParams:i.blockParams([a[b],b],[o+b,null])})}if(!b)throw new k["default"]("Must pass iterator to #each");var h=b.fn,j=b.inverse,l=0,m="",n=void 0,o=void 0;if(b.data&&b.ids&&(o=i.appendContextPath(b.data.contextPath,b.ids[0])+"."),i.isFunction(a)&&(a=a.call(this)),b.data&&(n=i.createFrame(b.data)),a&&"object"==typeof a)if(i.isArray(a))for(var p=a.length;l<p;l++)l in a&&c(l,l,l===a.length-1);else if("function"==typeof d&&a[e]){for(var q=[],r=f(a),s=r.next();!s.done;s=r.next())q.push(s.value);a=q;for(var p=a.length;l<p;l++)c(l,l,l===a.length-1)}else!function(){var b=void 0;g(a).forEach(function(a){void 0!==b&&c(b,l-1),b=a,l++}),void 0!==b&&c(b,l-1,!0)}();return 0===l&&(m=j(this)),m})},a.exports=b["default"]},function(a,b,c){a.exports={"default":c(14),__esModule:!0}},function(a,b,c){c(15),c(42),a.exports=c(21).Symbol},function(a,b,c){"use strict";var d=c(9),e=c(16),f=c(17),g=c(18),h=c(20),i=c(24),j=c(19),k=c(27),l=c(28),m=c(30),n=c(29),o=c(31),p=c(36),q=c(37),r=c(38),s=c(39),t=c(32),u=c(26),v=d.getDesc,w=d.setDesc,x=d.create,y=p.get,z=e.Symbol,A=e.JSON,B=A&&A.stringify,C=!1,D=n("_hidden"),E=d.isEnum,F=k("symbol-registry"),G=k("symbols"),H="function"==typeof z,I=Object.prototype,J=g&&j(function(){return 7!=x(w({},"a",{get:function(){return w(this,"a",{value:7}).a}})).a})?function(a,b,c){var d=v(I,b);d&&delete I[b],w(a,b,c),d&&a!==I&&w(I,b,d)}:w,K=function(a){var b=G[a]=x(z.prototype);return b._k=a,g&&C&&J(I,a,{configurable:!0,set:function(b){f(this,D)&&f(this[D],a)&&(this[D][a]=!1),J(this,a,u(1,b))}}),b},L=function(a){return"symbol"==typeof a},M=function(a,b,c){return c&&f(G,b)?(c.enumerable?(f(a,D)&&a[D][b]&&(a[D][b]=!1),c=x(c,{enumerable:u(0,!1)})):(f(a,D)||w(a,D,u(1,{})),a[D][b]=!0),J(a,b,c)):w(a,b,c)},N=function(a,b){s(a);for(var c,d=q(b=t(b)),e=0,f=d.length;f>e;)M(a,c=d[e++],b[c]);return a},O=function(a,b){return void 0===b?x(a):N(x(a),b)},P=function(a){var b=E.call(this,a);return!(b||!f(this,a)||!f(G,a)||f(this,D)&&this[D][a])||b},Q=function(a,b){var c=v(a=t(a),b);return!c||!f(G,b)||f(a,D)&&a[D][b]||(c.enumerable=!0),c},R=function(a){for(var b,c=y(t(a)),d=[],e=0;c.length>e;)f(G,b=c[e++])||b==D||d.push(b);return d},S=function(a){for(var b,c=y(t(a)),d=[],e=0;c.length>e;)f(G,b=c[e++])&&d.push(G[b]);return d},T=function(a){if(void 0!==a&&!L(a)){for(var b,c,d=[a],e=1,f=arguments;f.length>e;)d.push(f[e++]);return b=d[1],"function"==typeof b&&(c=b),!c&&r(b)||(b=function(a,b){if(c&&(b=c.call(this,a,b)),!L(b))return b}),d[1]=b,B.apply(A,d)}},U=j(function(){var a=z();return"[null]"!=B([a])||"{}"!=B({a:a})||"{}"!=B(Object(a))});H||(z=function(){if(L(this))throw TypeError("Symbol is not a constructor");return K(m(arguments.length>0?arguments[0]:void 0))},i(z.prototype,"toString",function(){return this._k}),L=function(a){return a instanceof z},d.create=O,d.isEnum=P,d.getDesc=Q,d.setDesc=M,d.setDescs=N,d.getNames=p.get=R,d.getSymbols=S,g&&!c(41)&&i(I,"propertyIsEnumerable",P,!0));var V={"for":function(a){return f(F,a+="")?F[a]:F[a]=z(a)},keyFor:function(a){return o(F,a)},useSetter:function(){C=!0},useSimple:function(){C=!1}};d.each.call("hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),function(a){var b=n(a);V[a]=H?b:K(b)}),C=!0,h(h.G+h.W,{Symbol:z}),h(h.S,"Symbol",V),h(h.S+h.F*!H,"Object",{create:O,defineProperty:M,defineProperties:N,getOwnPropertyDescriptor:Q,getOwnPropertyNames:R,getOwnPropertySymbols:S}),A&&h(h.S+h.F*(!H||U),"JSON",{stringify:T}),l(z,"Symbol"),l(Math,"Math",!0),l(e.JSON,"JSON",!0)},function(a,b){var c=a.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=c)},function(a,b){var c={}.hasOwnProperty;a.exports=function(a,b){return c.call(a,b)}},function(a,b,c){a.exports=!c(19)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(a,b){a.exports=function(a){try{return!!a()}catch(b){return!0}}},function(a,b,c){var d=c(16),e=c(21),f=c(22),g="prototype",h=function(a,b,c){var i,j,k,l=a&h.F,m=a&h.G,n=a&h.S,o=a&h.P,p=a&h.B,q=a&h.W,r=m?e:e[b]||(e[b]={}),s=m?d:n?d[b]:(d[b]||{})[g];m&&(c=b);for(i in c)j=!l&&s&&i in s,j&&i in r||(k=j?s[i]:c[i],r[i]=m&&"function"!=typeof s[i]?c[i]:p&&j?f(k,d):q&&s[i]==k?function(a){var b=function(b){return this instanceof a?new a(b):a(b)};return b[g]=a[g],b}(k):o&&"function"==typeof k?f(Function.call,k):k,o&&((r[g]||(r[g]={}))[i]=k))};h.F=1,h.G=2,h.S=4,h.P=8,h.B=16,h.W=32,a.exports=h},function(a,b){var c=a.exports={version:"1.2.6"};"number"==typeof __e&&(__e=c)},function(a,b,c){var d=c(23);a.exports=function(a,b,c){if(d(a),void 0===b)return a;switch(c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)}}return function(){return a.apply(b,arguments)}}},function(a,b){a.exports=function(a){if("function"!=typeof a)throw TypeError(a+" is not a function!");return a}},function(a,b,c){a.exports=c(25)},function(a,b,c){var d=c(9),e=c(26);a.exports=c(18)?function(a,b,c){return d.setDesc(a,b,e(1,c))}:function(a,b,c){return a[b]=c,a}},function(a,b){a.exports=function(a,b){return{enumerable:!(1&a),configurable:!(2&a),writable:!(4&a),value:b}}},function(a,b,c){var d=c(16),e="__core-js_shared__",f=d[e]||(d[e]={});a.exports=function(a){return f[a]||(f[a]={})}},function(a,b,c){var d=c(9).setDesc,e=c(17),f=c(29)("toStringTag");a.exports=function(a,b,c){a&&!e(a=c?a:a.prototype,f)&&d(a,f,{configurable:!0,value:b})}},function(a,b,c){var d=c(27)("wks"),e=c(30),f=c(16).Symbol;a.exports=function(a){return d[a]||(d[a]=f&&f[a]||(f||e)("Symbol."+a))}},function(a,b){var c=0,d=Math.random();a.exports=function(a){return"Symbol(".concat(void 0===a?"":a,")_",(++c+d).toString(36))}},function(a,b,c){var d=c(9),e=c(32);a.exports=function(a,b){for(var c,f=e(a),g=d.getKeys(f),h=g.length,i=0;h>i;)if(f[c=g[i++]]===b)return c}},function(a,b,c){var d=c(33),e=c(35);a.exports=function(a){return d(e(a))}},function(a,b,c){var d=c(34);a.exports=Object("z").propertyIsEnumerable(0)?Object:function(a){return"String"==d(a)?a.split(""):Object(a)}},function(a,b){var c={}.toString;a.exports=function(a){return c.call(a).slice(8,-1)}},function(a,b){a.exports=function(a){if(void 0==a)throw TypeError("Can't call method on  "+a);return a}},function(a,b,c){var d=c(32),e=c(9).getNames,f={}.toString,g="object"==typeof window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],h=function(a){try{return e(a)}catch(b){return g.slice()}};a.exports.get=function(a){return g&&"[object Window]"==f.call(a)?h(a):e(d(a))}},function(a,b,c){var d=c(9);a.exports=function(a){var b=d.getKeys(a),c=d.getSymbols;if(c)for(var e,f=c(a),g=d.isEnum,h=0;f.length>h;)g.call(a,e=f[h++])&&b.push(e);return b}},function(a,b,c){var d=c(34);a.exports=Array.isArray||function(a){return"Array"==d(a)}},function(a,b,c){var d=c(40);a.exports=function(a){if(!d(a))throw TypeError(a+" is not an object!");return a}},function(a,b){a.exports=function(a){return"object"==typeof a?null!==a:"function"==typeof a}},function(a,b){a.exports=!0},function(a,b){},function(a,b,c){a.exports={"default":c(44),__esModule:!0}},function(a,b,c){c(45),c(51),a.exports=c(29)("iterator")},function(a,b,c){"use strict";var d=c(46)(!0);c(48)(String,"String",function(a){this._t=String(a),this._i=0},function(){var a,b=this._t,c=this._i;return c>=b.length?{value:void 0,done:!0}:(a=d(b,c),this._i+=a.length,{value:a,done:!1})})},function(a,b,c){var d=c(47),e=c(35);a.exports=function(a){return function(b,c){var f,g,h=String(e(b)),i=d(c),j=h.length;return i<0||i>=j?a?"":void 0:(f=h.charCodeAt(i),f<55296||f>56319||i+1===j||(g=h.charCodeAt(i+1))<56320||g>57343?a?h.charAt(i):f:a?h.slice(i,i+2):(f-55296<<10)+(g-56320)+65536)}}},function(a,b){var c=Math.ceil,d=Math.floor;a.exports=function(a){return isNaN(a=+a)?0:(a>0?d:c)(a)}},function(a,b,c){"use strict";var d=c(41),e=c(20),f=c(24),g=c(25),h=c(17),i=c(49),j=c(50),k=c(28),l=c(9).getProto,m=c(29)("iterator"),n=!([].keys&&"next"in[].keys()),o="@@iterator",p="keys",q="values",r=function(){return this};a.exports=function(a,b,c,s,t,u,v){j(c,b,s);var w,x,y=function(a){if(!n&&a in C)return C[a];switch(a){case p:return function(){return new c(this,a)};case q:return function(){return new c(this,a)}}return function(){return new c(this,a)}},z=b+" Iterator",A=t==q,B=!1,C=a.prototype,D=C[m]||C[o]||t&&C[t],E=D||y(t);if(D){var F=l(E.call(new a));k(F,z,!0),!d&&h(C,o)&&g(F,m,r),A&&D.name!==q&&(B=!0,E=function(){return D.call(this)})}if(d&&!v||!n&&!B&&C[m]||g(C,m,E),i[b]=E,i[z]=r,t)if(w={values:A?E:y(q),keys:u?E:y(p),entries:A?y("entries"):E},v)for(x in w)x in C||f(C,x,w[x]);else e(e.P+e.F*(n||B),b,w);return w}},function(a,b){a.exports={}},function(a,b,c){"use strict";var d=c(9),e=c(26),f=c(28),g={};c(25)(g,c(29)("iterator"),function(){return this}),a.exports=function(a,b,c){a.prototype=d.create(g,{next:e(1,c)}),f(a,b+" Iterator")}},function(a,b,c){c(52);var d=c(49);d.NodeList=d.HTMLCollection=d.Array},function(a,b,c){"use strict";var d=c(53),e=c(54),f=c(49),g=c(32);a.exports=c(48)(Array,"Array",function(a,b){this._t=g(a),this._i=0,this._k=b},function(){var a=this._t,b=this._k,c=this._i++;return!a||c>=a.length?(this._t=void 0,e(1)):"keys"==b?e(0,c):"values"==b?e(0,a[c]):e(0,[c,a[c]])},"values"),f.Arguments=f.Array,d("keys"),d("values"),d("entries")},function(a,b){a.exports=function(){}},function(a,b){a.exports=function(a,b){return{value:b,done:!!a}}},function(a,b,c){a.exports={"default":c(56),__esModule:!0}},function(a,b,c){c(51),c(45),a.exports=c(57)},function(a,b,c){var d=c(39),e=c(58);a.exports=c(21).getIterator=function(a){var b=e(a);if("function"!=typeof b)throw TypeError(a+" is not iterable!");return d(b.call(a))}},function(a,b,c){var d=c(59),e=c(29)("iterator"),f=c(49);a.exports=c(21).getIteratorMethod=function(a){if(void 0!=a)return a[e]||a["@@iterator"]||f[d(a)]}},function(a,b,c){var d=c(34),e=c(29)("toStringTag"),f="Arguments"==d(function(){return arguments}());a.exports=function(a){var b,c,g;return void 0===a?"Undefined":null===a?"Null":"string"==typeof(c=(b=Object(a))[e])?c:f?d(b):"Object"==(g=d(b))&&"function"==typeof b.callee?"Arguments":g}},function(a,b,c){a.exports={"default":c(61),__esModule:!0}},function(a,b,c){c(62),a.exports=c(21).Object.keys},function(a,b,c){var d=c(63);c(64)("keys",function(a){return function(b){return a(d(b))}})},function(a,b,c){var d=c(35);a.exports=function(a){return Object(d(a))}},function(a,b,c){var d=c(20),e=c(21),f=c(19);a.exports=function(a,b){var c=(e.Object||{})[a]||Object[a],g={};g[a]=b(c),d(d.S+d.F*f(function(){c(1)}),"Object",g)}},function(a,b,c){"use strict";var d=c(1)["default"];b.__esModule=!0;var e=c(6),f=d(e);b["default"]=function(a){a.registerHelper("helperMissing",function(){if(1!==arguments.length)throw new f["default"]('Missing helper: "'+arguments[arguments.length-1].name+'"')})},a.exports=b["default"]},function(a,b,c){"use strict";var d=c(1)["default"];b.__esModule=!0;var e=c(5),f=c(6),g=d(f);b["default"]=function(a){a.registerHelper("if",function(a,b){if(2!=arguments.length)throw new g["default"]("#if requires exactly one argument");return e.isFunction(a)&&(a=a.call(this)),!b.hash.includeZero&&!a||e.isEmpty(a)?b.inverse(this):b.fn(this)}),a.registerHelper("unless",function(b,c){if(2!=arguments.length)throw new g["default"]("#unless requires exactly one argument");return a.helpers["if"].call(this,b,{fn:c.inverse,inverse:c.fn,hash:c.hash})})},a.exports=b["default"]},function(a,b){"use strict";b.__esModule=!0,b["default"]=function(a){a.registerHelper("log",function(){for(var b=[void 0],c=arguments[arguments.length-1],d=0;d<arguments.length-1;d++)b.push(arguments[d]);var e=1;null!=c.hash.level?e=c.hash.level:c.data&&null!=c.data.level&&(e=c.data.level),b[0]=e,a.log.apply(a,b)})},a.exports=b["default"]},function(a,b){"use strict";b.__esModule=!0,b["default"]=function(a){a.registerHelper("lookup",function(a,b,c){return a?c.lookupProperty(a,b):a})},a.exports=b["default"]},function(a,b,c){"use strict";var d=c(1)["default"];b.__esModule=!0;var e=c(5),f=c(6),g=d(f);b["default"]=function(a){a.registerHelper("with",function(a,b){if(2!=arguments.length)throw new g["default"]("#with requires exactly one argument");e.isFunction(a)&&(a=a.call(this));var c=b.fn;if(e.isEmpty(a))return b.inverse(this);var d=b.data;return b.data&&b.ids&&(d=e.createFrame(b.data),d.contextPath=e.appendContextPath(b.data.contextPath,b.ids[0])),c(a,{data:d,blockParams:e.blockParams([a],[d&&d.contextPath])})})},a.exports=b["default"]},function(a,b,c){"use strict";function d(a){g["default"](a)}var e=c(1)["default"];b.__esModule=!0,b.registerDefaultDecorators=d;var f=c(71),g=e(f)},function(a,b,c){"use strict";b.__esModule=!0;var d=c(5);b["default"]=function(a){a.registerDecorator("inline",function(a,b,c,e){var f=a;return b.partials||(b.partials={},f=function(e,f){var g=c.partials;c.partials=d.extend({},g,b.partials);var h=a(e,f);return c.partials=g,h}),b.partials[e.args[0]]=e.fn,f})},a.exports=b["default"]},function(a,b,c){"use strict";b.__esModule=!0;var d=c(5),e={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(a){if("string"==typeof a){var b=d.indexOf(e.methodMap,a.toLowerCase());a=b>=0?b:parseInt(a,10)}return a},log:function(a){if(a=e.lookupLevel(a),"undefined"!=typeof console&&e.lookupLevel(e.level)<=a){var b=e.methodMap[a];console[b]||(b="log");for(var c=arguments.length,d=Array(c>1?c-1:0),f=1;f<c;f++)d[f-1]=arguments[f];console[b].apply(console,d)}}};b["default"]=e,a.exports=b["default"]},function(a,b,c){"use strict";function d(a){var b=i(null);b.
vendor: 9,978 bytes, line 12705
12705constructor=!1,b.__defineGetter__=!1,b.__defineSetter__=!1,b.__lookupGetter__=!1;var c=i(null);return c.__proto__=!1,{properties:{whitelist:l.createNewLookupObject(c,a.allowedProtoProperties),defaultValue:a.allowProtoPropertiesByDefault},methods:{whitelist:l.createNewLookupObject(b,a.allowedProtoMethods),defaultValue:a.allowProtoMethodsByDefault}}}function e(a,b,c){return"function"==typeof a?f(b.methods,c):f(b.properties,c)}function f(a,b){return void 0!==a.whitelist[b]?a.whitelist[b]===!0:void 0!==a.defaultValue?a.defaultValue:(g(b),!1)}function g(a){o[a]!==!0&&(o[a]=!0,n["default"].log("error",'Handlebars: Access has been denied to resolve the property "'+a+'" because it is not an "own property" of its parent.\nYou can add a runtime option to disable the check or this warning:\nSee https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details'))}function h(){j(o).forEach(function(a){delete o[a]})}var i=c(74)["default"],j=c(60)["default"],k=c(1)["default"];b.__esModule=!0,b.createProtoAccessControl=d,b.resultIsAllowed=e,b.resetLoggedProperties=h;var l=c(76),m=c(72),n=k(m),o=i(null)},function(a,b,c){a.exports={"default":c(75),__esModule:!0}},function(a,b,c){var d=c(9);a.exports=function(a,b){return d.create(a,b)}},function(a,b,c){"use strict";function d(){for(var a=arguments.length,b=Array(a),c=0;c<a;c++)b[c]=arguments[c];return f.extend.apply(void 0,[e(null)].concat(b))}var e=c(74)["default"];b.__esModule=!0,b.createNewLookupObject=d;var f=c(5)},function(a,b){"use strict";function c(a){this.string=a}b.__esModule=!0,c.prototype.toString=c.prototype.toHTML=function(){return""+this.string},b["default"]=c,a.exports=b["default"]},function(a,b,c){"use strict";function d(a){var b=a&&a[0]||1,c=v.COMPILER_REVISION;if(!(b>=v.LAST_COMPATIBLE_COMPILER_REVISION&&b<=v.COMPILER_REVISION)){if(b<v.LAST_COMPATIBLE_COMPILER_REVISION){var d=v.REVISION_CHANGES[c],e=v.REVISION_CHANGES[b];throw new u["default"]("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+d+") or downgrade your runtime to an older version ("+e+").")}throw new u["default"]("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+a[1]+").")}}function e(a,b){function c(c,d,e){e.hash&&(d=s.extend({},d,e.hash),e.ids&&(e.ids[0]=!0)),c=b.VM.resolvePartial.call(this,c,d,e);var f=s.extend({},e,{hooks:this.hooks,protoAccessControl:this.protoAccessControl}),g=b.VM.invokePartial.call(this,c,d,f);if(null==g&&b.compile&&(e.partials[e.name]=b.compile(c,a.compilerOptions,b),g=e.partials[e.name](d,f)),null!=g){if(e.indent){for(var h=g.split("\n"),i=0,j=h.length;i<j&&(h[i]||i+1!==j);i++)h[i]=e.indent+h[i];g=h.join("\n")}return g}throw new u["default"]("The partial "+e.name+" could not be compiled when running in runtime-only mode")}function d(b){function c(b){return""+a.main(g,b,g.helpers,g.partials,f,i,h)}var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],f=e.data;d._setup(e),!e.partial&&a.useData&&(f=j(b,f));var h=void 0,i=a.useBlockParams?[]:void 0;return a.useDepths&&(h=e.depths?b!=e.depths[0]?[b].concat(e.depths):e.depths:[b]),(c=k(a.main,c,g,e.depths||[],f,i))(b,e)}if(!b)throw new u["default"]("No environment passed to template");if(!a||!a.main)throw new u["default"]("Unknown template object: "+typeof a);a.main.decorator=a.main_d,b.VM.checkRevision(a.compiler);var e=a.compiler&&7===a.compiler[0],g={strict:function(a,b,c){if(!(a&&b in a))throw new u["default"]('"'+b+'" not defined in '+a,{loc:c});return g.lookupProperty(a,b)},lookupProperty:function(a,b){var c=a[b];return null==c?c:Object.prototype.hasOwnProperty.call(a,b)?c:y.resultIsAllowed(c,g.protoAccessControl,b)?c:void 0},lookup:function(a,b){for(var c=a.length,d=0;d<c;d++){var e=a[d]&&g.lookupProperty(a[d],b);if(null!=e)return a[d][b]}},lambda:function(a,b){return"function"==typeof a?a.call(b):a},escapeExpression:s.escapeExpression,invokePartial:c,fn:function(b){var c=a[b];return c.decorator=a[b+"_d"],c},programs:[],program:function(a,b,c,d,e){var g=this.programs[a],h=this.fn(a);return b||e||d||c?g=f(this,a,h,b,c,d,e):g||(g=this.programs[a]=f(this,a,h)),g},data:function(a,b){for(;a&&b--;)a=a._parent;return a},mergeIfNeeded:function(a,b){var c=a||b;return a&&b&&a!==b&&(c=s.extend({},b,a)),c},nullContext:n({}),noop:b.VM.noop,compilerInfo:a.compiler};return d.isTop=!0,d._setup=function(c){if(c.partial)g.protoAccessControl=c.protoAccessControl,g.helpers=c.helpers,g.partials=c.partials,g.decorators=c.decorators,g.hooks=c.hooks;else{var d=s.extend({},b.helpers,c.helpers);l(d,g),g.helpers=d,a.usePartial&&(g.partials=g.mergeIfNeeded(c.partials,b.partials)),(a.usePartial||a.useDecorators)&&(g.decorators=s.extend({},b.decorators,c.decorators)),g.hooks={},g.protoAccessControl=y.createProtoAccessControl(c);var f=c.allowCallsToHelperMissing||e;w.moveHelperToHooks(g,"helperMissing",f),w.moveHelperToHooks(g,"blockHelperMissing",f)}},d._child=function(b,c,d,e){if(a.useBlockParams&&!d)throw new u["default"]("must pass block params");if(a.useDepths&&!e)throw new u["default"]("must pass parent depths");return f(g,b,a[b],c,0,d,e)},d}function f(a,b,c,d,e,f,g){function h(b){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],h=g;return!g||b==g[0]||b===a.nullContext&&null===g[0]||(h=[b].concat(g)),c(a,b,a.helpers,a.partials,e.data||d,f&&[e.blockParams].concat(f),h)}return h=k(c,h,a,g,d,f),h.program=b,h.depth=g?g.length:0,h.blockParams=e||0,h}function g(a,b,c){return a?a.call||c.name||(c.name=a,a=c.partials[a]):a="@partial-block"===c.name?c.data["partial-block"]:c.partials[c.name],a}function h(a,b,c){var d=c.data&&c.data["partial-block"];c.partial=!0,c.ids&&(c.data.contextPath=c.ids[0]||c.data.contextPath);var e=void 0;if(c.fn&&c.fn!==i&&!function(){c.data=v.createFrame(c.data);var a=c.fn;e=c.data["partial-block"]=function(b){var c=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return c.data=v.createFrame(c.data),c.data["partial-block"]=d,a(b,c)},a.partials&&(c.partials=s.extend({},c.partials,a.partials))}(),void 0===a&&e&&(a=e),void 0===a)throw new u["default"]("The partial "+c.name+" could not be found");if(a instanceof Function)return a(b,c)}function i(){return""}function j(a,b){return b&&"root"in b||(b=b?v.createFrame(b):{},b.root=a),b}function k(a,b,c,d,e,f){if(a.decorator){var g={};b=a.decorator(b,g,c,d&&d[0],e,f,d),s.extend(b,g)}return b}function l(a,b){o(a).forEach(function(c){var d=a[c];a[c]=m(d,b)})}function m(a,b){var c=b.lookupProperty;return x.wrapHelper(a,function(a){return s.extend({lookupProperty:c},a)})}var n=c(79)["default"],o=c(60)["default"],p=c(3)["default"],q=c(1)["default"];b.__esModule=!0,b.checkRevision=d,b.template=e,b.wrapProgram=f,b.resolvePartial=g,b.invokePartial=h,b.noop=i;var r=c(5),s=p(r),t=c(6),u=q(t),v=c(4),w=c(10),x=c(82),y=c(73)},function(a,b,c){a.exports={"default":c(80),__esModule:!0}},function(a,b,c){c(81),a.exports=c(21).Object.seal},function(a,b,c){var d=c(40);c(64)("seal",function(a){return function(b){return a&&d(b)?a(b):b}})},function(a,b){"use strict";function c(a,b){if("function"!=typeof a)return a;var c=function(){var c=arguments[arguments.length-1];return arguments[arguments.length-1]=b(c),a.apply(this,arguments)};return c}b.__esModule=!0,b.wrapHelper=c},function(a,b){"use strict";b.__esModule=!0,b["default"]=function(a){!function(){"object"!=typeof globalThis&&(Object.prototype.__defineGetter__("__magic__",function(){return this}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)}();var b=globalThis.Handlebars;a.noConflict=function(){return globalThis.Handlebars===a&&(globalThis.Handlebars=b),a}},a.exports=b["default"]},function(a,b){"use strict";b.__esModule=!0;var c={helpers:{helperExpression:function(a){return"SubExpression"===a.type||("MustacheStatement"===a.type||"BlockStatement"===a.type)&&!!(a.params&&a.params.length||a.hash)},scopedId:function(a){return/^\.|this\b/.test(a.original)},simpleId:function(a){return 1===a.parts.length&&!c.helpers.scopedId(a)&&!a.depth}}};b["default"]=c,a.exports=b["default"]},function(a,b,c){"use strict";function d(a,b){if("Program"===a.type)return a;i["default"].yy=o,o.locInfo=function(a){return new o.SourceLocation(b&&b.srcName,a)};var c=i["default"].parse(a);return c}function e(a,b){var c=d(a,b),e=new k["default"](b);return e.accept(c)}var f=c(1)["default"],g=c(3)["default"];b.__esModule=!0,b.parseWithoutProcessing=d,b.parse=e;var h=c(86),i=f(h),j=c(87),k=f(j),l=c(89),m=g(l),n=c(5);b.parser=i["default"];var o={};n.extend(o,m)},function(a,b){"use strict";b.__esModule=!0;var c=function(){function a(){this.yy={}}var b={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,
12705EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA",87:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,0],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function(a,b,c,d,e,f,g){
vendor: 7,153 bytes, line 12706
12706var h=f.length-1;switch(e){case 1:return f[h-1];case 2:this.$=d.prepareProgram(f[h]);break;case 3:this.$=f[h];break;case 4:this.$=f[h];break;case 5:this.$=f[h];break;case 6:this.$=f[h];break;case 7:this.$=f[h];break;case 8:this.$=f[h];break;case 9:this.$={type:"CommentStatement",value:d.stripComment(f[h]),strip:d.stripFlags(f[h],f[h]),loc:d.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:f[h],value:f[h],loc:d.locInfo(this._$)};break;case 11:this.$=d.prepareRawBlock(f[h-2],f[h-1],f[h],this._$);break;case 12:this.$={path:f[h-3],params:f[h-2],hash:f[h-1]};break;case 13:this.$=d.prepareBlock(f[h-3],f[h-2],f[h-1],f[h],!1,this._$);break;case 14:this.$=d.prepareBlock(f[h-3],f[h-2],f[h-1],f[h],!0,this._$);break;case 15:this.$={open:f[h-5],path:f[h-4],params:f[h-3],hash:f[h-2],blockParams:f[h-1],strip:d.stripFlags(f[h-5],f[h])};break;case 16:this.$={path:f[h-4],params:f[h-3],hash:f[h-2],blockParams:f[h-1],strip:d.stripFlags(f[h-5],f[h])};break;case 17:this.$={path:f[h-4],params:f[h-3],hash:f[h-2],blockParams:f[h-1],strip:d.stripFlags(f[h-5],f[h])};break;case 18:this.$={strip:d.stripFlags(f[h-1],f[h-1]),program:f[h]};break;case 19:var i=d.prepareBlock(f[h-2],f[h-1],f[h],f[h],!1,this._$),j=d.prepareProgram([i],f[h-1].loc);j.chained=!0,this.$={strip:f[h-2].strip,program:j,chain:!0};break;case 20:this.$=f[h];break;case 21:this.$={path:f[h-1],strip:d.stripFlags(f[h-2],f[h])};break;case 22:this.$=d.prepareMustache(f[h-3],f[h-2],f[h-1],f[h-4],d.stripFlags(f[h-4],f[h]),this._$);break;case 23:this.$=d.prepareMustache(f[h-3],f[h-2],f[h-1],f[h-4],d.stripFlags(f[h-4],f[h]),this._$);break;case 24:this.$={type:"PartialStatement",name:f[h-3],params:f[h-2],hash:f[h-1],indent:"",strip:d.stripFlags(f[h-4],f[h]),loc:d.locInfo(this._$)};break;case 25:this.$=d.preparePartialBlock(f[h-2],f[h-1],f[h],this._$);break;case 26:this.$={path:f[h-3],params:f[h-2],hash:f[h-1],strip:d.stripFlags(f[h-4],f[h])};break;case 27:this.$=f[h];break;case 28:this.$=f[h];break;case 29:this.$={type:"SubExpression",path:f[h-3],params:f[h-2],hash:f[h-1],loc:d.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:f[h],loc:d.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:d.id(f[h-2]),value:f[h],loc:d.locInfo(this._$)};break;case 32:this.$=d.id(f[h-1]);break;case 33:this.$=f[h];break;case 34:this.$=f[h];break;case 35:this.$={type:"StringLiteral",value:f[h],original:f[h],loc:d.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(f[h]),original:Number(f[h]),loc:d.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:"true"===f[h],original:"true"===f[h],loc:d.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:d.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:d.locInfo(this._$)};break;case 40:this.$=f[h];break;case 41:this.$=f[h];break;case 42:this.$=d.preparePath(!0,f[h],this._$);break;case 43:this.$=d.preparePath(!1,f[h],this._$);break;case 44:f[h-2].push({part:d.id(f[h]),original:f[h],separator:f[h-1]}),this.$=f[h-2];break;case 45:this.$=[{part:d.id(f[h]),original:f[h]}];break;case 46:this.$=[];break;case 47:f[h-1].push(f[h]);break;case 48:this.$=[];break;case 49:f[h-1].push(f[h]);break;case 50:this.$=[];break;case 51:f[h-1].push(f[h]);break;case 58:this.$=[];break;case 59:f[h-1].push(f[h]);break;case 64:this.$=[];break;case 65:f[h-1].push(f[h]);break;case 70:this.$=[];break;case 71:f[h-1].push(f[h]);break;case 78:this.$=[];break;case 79:f[h-1].push(f[h]);break;case 82:this.$=[];break;case 83:f[h-1].push(f[h]);break;case 86:this.$=[];break;case 87:f[h-1].push(f[h]);break;case 90:this.$=[];break;case 91:f[h-1].push(f[h]);break;case 94:this.$=[];break;case 95:f[h-1].push(f[h]);break;case 98:this.$=[f[h]];break;case 99:f[h-1].push(f[h]);break;case 100:this.$=[f[h]];break;case 101:f[h-1].push(f[h])}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{15:[2,48],17:39,18:[2,48]},{20:41,56:40,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:44,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:45,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:41,56:48,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:49,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37
vendor: 4,114 bytes, line 12706
12706],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,50]},{72:[1,35],86:51},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:52,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:53,38:55,39:[1,57],43:56,44:[1,58],45:54,47:[2,54]},{28:59,43:60,44:[1,58],47:[2,56]},{13:62,15:[1,20],18:[1,61]},{33:[2,86],57:63,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:64,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:65,47:[1,66]},{30:67,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:68,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:69,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:70,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:74,33:[2,80],50:71,63:72,64:75,65:[1,43],69:73,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,79]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,50]},{20:74,53:80,54:[2,84],63:81,64:75,65:[1,43],69:82,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:83,47:[1,66]},{47:[2,55]},{4:84,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:85,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:86,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:87,47:[1,66]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:74,33:[2,88],58:88,63:89,64:75,65:[1,43],69:90,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:91,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:92,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,31:93,33:[2,60],63:94,64:75,65:[1,43],69:95,70:76,71:77,72:[1,78],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,66],36:96,63:97,64:75,65:[1,43],69:98,70:76,71:77,72:[1,78],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,22:99,23:[2,52],63:100,64:75,65:[1,43],69:101,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,92],62:102,63:103,64:75,65:[1,43],69:104,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,105]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]}
vendor: 11,272 bytes, line 12706
12706,{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:106,72:[1,107],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,108],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,109]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:55,39:[1,57],43:56,44:[1,58],45:111,46:110,47:[2,76]},{33:[2,70],40:112,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,113]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:74,63:115,64:75,65:[1,43],67:114,68:[2,96],69:116,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,117]},{32:118,33:[2,62],74:119,75:[1,120]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:121,74:122,75:[1,120]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,123]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,124]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,108]},{20:74,63:125,64:75,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:74,33:[2,72],41:126,63:127,64:75,65:[1,43],69:128,70:76,71:77,72:[1,78],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,129]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,130]},{33:[2,63]},{72:[1,132],76:131},{33:[1,133]},{33:[2,69]},{15:[2,12],18:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:134,74:135,75:[1,120]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,137],77:[1,136]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,138]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],54:[2,55],56:[2,20],60:[2,57],73:[2,81],82:[2,85],86:[2,18],90:[2,89],101:[2,53],104:[2,93],110:[2,19],111:[2,77],116:[2,97],119:[2,63],122:[2,69],135:[2,75],136:[2,32]},parseError:function(a,b){throw new Error(a)},parse:function(a){function b(){var a;return a=c.lexer.lex()||1,"number"!=typeof a&&(a=c.symbols_[a]||a),a}var c=this,d=[0],e=[null],f=[],g=this.table,h="",i=0,j=0,k=0;this.lexer.setInput(a),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,"undefined"==typeof this.lexer.yylloc&&(this.lexer.yylloc={});var l=this.lexer.yylloc;f.push(l);var m=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var n,o,p,q,r,s,t,u,v,w={};;){if(p=d[d.length-1],this.defaultActions[p]?q=this.defaultActions[p]:(null!==n&&"undefined"!=typeof n||(n=b()),q=g[p]&&g[p][n]),"undefined"==typeof q||!q.length||!q[0]){var x="";if(!k){v=[];for(s in g[p])this.terminals_[s]&&s>2&&v.push("'"+this.terminals_[s]+"'");x=this.lexer.showPosition?"Parse error on line "+(i+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[n]||n)+"'":"Parse error on line "+(i+1)+": Unexpected "+(1==n?"end of input":"'"+(this.terminals_[n]||n)+"'"),this.parseError(x,{text:this.lexer.match,token:this.terminals_[n]||n,line:this.lexer.yylineno,loc:l,expected:v})}}if(q[0]instanceof Array&&q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+p+", token: "+n);switch(q[0]){case 1:d.push(n),e.push(this.lexer.yytext),f.push(this.lexer.yylloc),d.push(q[1]),n=null,o?(n=o,o=null):(j=this.lexer.yyleng,h=this.lexer.yytext,i=this.lexer.yylineno,l=this.lexer.yylloc,k>0&&k--);break;case 2:if(t=this.productions_[q[1]][1],w.$=e[e.length-t],w._$={first_line:f[f.length-(t||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(t||1)].first_column,last_column:f[f.length-1].last_column},m&&(w._$.range=[f[f.length-(t||1)].range[0],f[f.length-1].range[1]]),r=this.performAction.call(w,h,j,i,this.yy,q[1],e,f),"undefined"!=typeof r)return r;t&&(d=d.slice(0,-1*t*2),e=e.slice(0,-1*t),f=f.slice(0,-1*t)),d.push(this.productions_[q[1]][0]),e.push(w.$),f.push(w._$),u=g[d[d.length-2]][d[d.length-1]],d.push(u);break;case 3:return!0}}return!0}},c=function(){var a={EOF:1,parseError:function(a,b){if(!this.yy.parser)throw new Error(a);this.yy.parser.parseError(a,b)},setInput:function(a){return this._input=a,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var b=a.match(/(?:\r\n?|\n).*/g);return b?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},unput:function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b-1),this.offset-=b;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var e=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this},more:function(){return this._more=!0,this},less:function(a){this.unput(this.match.slice(a))},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var a=this.pastInput(),b=new Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,b,c,d,e;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),g=0;g<f.length&&(c=this._input.match(this.rules[f[g]]),!c||b&&!(c[0].length>b[0].length)||(b=c,d=g,this.options.flex));g++);return b?(e=b[0].match(/(?:\r\n?|\n).*/g),e&&(this.yylineno+=e.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:e?e[e.length-1].length-e[e.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],a=this.performAction.call(this,this.yy,this,f[d],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a?a:void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var a=this.next();return"undefined"!=typeof a?a:this.lex()},begin:function(a){this.conditionStack.push(a)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(a){this.begin(a)}};return a.options={},a.performAction=function(a,b,c,d){function e(a,c){return b.yytext=b.yytext.substring(a,b.yyleng-c+a)}switch(c){case 0:if("\\\\"===b.yytext.slice(-2)?(e(0,1),this.begin("mu")):"\\"===b.yytext.slice(-1)?(e(0,1),this.begin("emu")):this.begin("mu"),b.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;case 3:return this.begin("raw"),15;case 4:return this.popState(),"raw"===this.conditionStack[this.conditionStack.length-1]?15:(e(5,9),"END_RAW_BLOCK");case 5:return 15;case 6:return this.popState(),14;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;case 16:return this.popState(),44;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(b.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;case 30:return this.popState(),33;case 31:return b.yytext=e(1,2).replace(/\\"/g,'"'),80;case 32:return b.yytext=e(1,2).replace(/\\'/g,"'"),80;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return b.yytext=b.yytext.replace(/\\([\\\]])/g,"$1"),72;case 43:return"INVALID";case 44:return 5}},a.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^
vendor: 2,187 bytes, line 12706
12706/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],a.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},a}();return b.lexer=c,a.prototype=b,b.Parser=a,new a}();b["default"]=c,a.exports=b["default"]},function(a,b,c){"use strict";function d(){var a=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.options=a}function e(a,b,c){void 0===b&&(b=a.length);var d=a[b-1],e=a[b-2];return d?"ContentStatement"===d.type?(e||!c?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(d.original):void 0:c}function f(a,b,c){void 0===b&&(b=-1);var d=a[b+1],e=a[b+2];return d?"ContentStatement"===d.type?(e||!c?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(d.original):void 0:c}function g(a,b,c){var d=a[null==b?0:b+1];if(d&&"ContentStatement"===d.type&&(c||!d.rightStripped)){var e=d.value;d.value=d.value.replace(c?/^\s+/:/^[ \t]*\r?\n?/,""),d.rightStripped=d.value!==e}}function h(a,b,c){var d=a[null==b?a.length-1:b-1];if(d&&"ContentStatement"===d.type&&(c||!d.leftStripped)){var e=d.value;return d.value=d.value.replace(c?/\s+$/:/[ \t]+$/,""),d.leftStripped=d.value!==e,d.leftStripped}}var i=c(1)["default"];b.__esModule=!0;var j=c(88
vendor: 6,533 bytes, line 12706
12706),k=i(j);d.prototype=new k["default"],d.prototype.Program=function(a){var b=!this.options.ignoreStandalone,c=!this.isRootSeen;this.isRootSeen=!0;for(var d=a.body,i=0,j=d.length;i<j;i++){var k=d[i],l=this.accept(k);if(l){var m=e(d,i,c),n=f(d,i,c),o=l.openStandalone&&m,p=l.closeStandalone&&n,q=l.inlineStandalone&&m&&n;l.close&&g(d,i,!0),l.open&&h(d,i,!0),b&&q&&(g(d,i),h(d,i)&&"PartialStatement"===k.type&&(k.indent=/([ \t]+$)/.exec(d[i-1].original)[1])),b&&o&&(g((k.program||k.inverse).body),h(d,i)),b&&p&&(g(d,i),h((k.inverse||k.program).body))}}return a},d.prototype.BlockStatement=d.prototype.DecoratorBlock=d.prototype.PartialBlockStatement=function(a){this.accept(a.program),this.accept(a.inverse);var b=a.program||a.inverse,c=a.program&&a.inverse,d=c,i=c;if(c&&c.chained)for(d=c.body[0].program;i.chained;)i=i.body[i.body.length-1].program;var j={open:a.openStrip.open,close:a.closeStrip.close,openStandalone:f(b.body),closeStandalone:e((d||b).body)};if(a.openStrip.close&&g(b.body,null,!0),c){var k=a.inverseStrip;k.open&&h(b.body,null,!0),k.close&&g(d.body,null,!0),a.closeStrip.open&&h(i.body,null,!0),!this.options.ignoreStandalone&&e(b.body)&&f(d.body)&&(h(b.body),g(d.body))}else a.closeStrip.open&&h(b.body,null,!0);return j},d.prototype.Decorator=d.prototype.MustacheStatement=function(a){return a.strip},d.prototype.PartialStatement=d.prototype.CommentStatement=function(a){var b=a.strip||{};return{inlineStandalone:!0,open:b.open,close:b.close}},b["default"]=d,a.exports=b["default"]},function(a,b,c){"use strict";function d(){this.parents=[]}function e(a){this.acceptRequired(a,"path"),this.acceptArray(a.params),this.acceptKey(a,"hash")}function f(a){e.call(this,a),this.acceptKey(a,"program"),this.acceptKey(a,"inverse")}function g(a){this.acceptRequired(a,"name"),this.acceptArray(a.params),this.acceptKey(a,"hash")}var h=c(1)["default"];b.__esModule=!0;var i=c(6),j=h(i);d.prototype={constructor:d,mutating:!1,acceptKey:function(a,b){var c=this.accept(a[b]);if(this.mutating){if(c&&!d.prototype[c.type])throw new j["default"]('Unexpected node type "'+c.type+'" found when accepting '+b+" on "+a.type);a[b]=c}},acceptRequired:function(a,b){if(this.acceptKey(a,b),!a[b])throw new j["default"](a.type+" requires "+b)},acceptArray:function(a){for(var b=0,c=a.length;b<c;b++)this.acceptKey(a,b),a[b]||(a.splice(b,1),b--,c--)},accept:function(a){if(a){if(!this[a.type])throw new j["default"]("Unknown type: "+a.type,a);this.current&&this.parents.unshift(this.current),this.current=a;var b=this[a.type](a);return this.current=this.parents.shift(),!this.mutating||b?b:b!==!1?a:void 0}},Program:function(a){this.acceptArray(a.body)},MustacheStatement:e,Decorator:e,BlockStatement:f,DecoratorBlock:f,PartialStatement:g,PartialBlockStatement:function(a){g.call(this,a),this.acceptKey(a,"program")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:e,PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},UndefinedLiteral:function(){},NullLiteral:function(){},Hash:function(a){this.acceptArray(a.pairs)},HashPair:function(a){this.acceptRequired(a,"value")}},b["default"]=d,a.exports=b["default"]},function(a,b,c){"use strict";function d(a,b){if(b=b.path?b.path.original:b,a.path.original!==b){var c={loc:a.path.loc};throw new q["default"](a.path.original+" doesn't match "+b,c)}}function e(a,b){this.source=a,this.start={line:b.first_line,column:b.first_column},this.end={line:b.last_line,column:b.last_column}}function f(a){return/^\[.*\]$/.test(a)?a.substring(1,a.length-1):a}function g(a,b){return{open:"~"===a.charAt(2),close:"~"===b.charAt(b.length-3)}}function h(a){return a.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function i(a,b,c){c=this.locInfo(c);for(var d=a?"@":"",e=[],f=0,g=0,h=b.length;g<h;g++){var i=b[g].part,j=b[g].original!==i;if(d+=(b[g].separator||"")+i,j||".."!==i&&"."!==i&&"this"!==i)e.push(i);else{if(e.length>0)throw new q["default"]("Invalid path: "+d,{loc:c});".."===i&&f++}}return{type:"PathExpression",data:a,depth:f,parts:e,original:d,loc:c}}function j(a,b,c,d,e,f){var g=d.charAt(3)||d.charAt(2),h="{"!==g&&"&"!==g,i=/\*/.test(d);return{type:i?"Decorator":"MustacheStatement",path:a,params:b,hash:c,escaped:h,strip:e,loc:this.locInfo(f)}}function k(a,b,c,e){d(a,c),e=this.locInfo(e);var f={type:"Program",body:b,strip:{},loc:e};return{type:"BlockStatement",path:a.path,params:a.params,hash:a.hash,program:f,openStrip:{},inverseStrip:{},closeStrip:{},loc:e}}function l(a,b,c,e,f,g){e&&e.path&&d(a,e);var h=/\*/.test(a.open);b.blockParams=a.blockParams;var i=void 0,j=void 0;if(c){if(h)throw new q["default"]("Unexpected inverse block on decorator",c);c.chain&&(c.program.body[0].closeStrip=e.strip),j=c.strip,i=c.program}return f&&(f=i,i=b,b=f),{type:h?"DecoratorBlock":"BlockStatement",path:a.path,params:a.params,hash:a.hash,program:b,inverse:i,openStrip:a.strip,inverseStrip:j,closeStrip:e&&e.strip,loc:this.locInfo(g)}}function m(a,b){if(!b&&a.length){var c=a[0].loc,d=a[a.length-1].loc;c&&d&&(b={source:c.source,start:{line:c.start.line,column:c.start.column},end:{line:d.end.line,column:d.end.column}})}return{type:"Program",body:a,strip:{},loc:b}}function n(a,b,c,e){return d(a,c),{type:"PartialBlockStatement",name:a.path,params:a.params,hash:a.hash,program:b,openStrip:a.strip,closeStrip:c&&c.strip,loc:this.locInfo(e)}}var o=c(1)["default"];b.__esModule=!0,b.SourceLocation=e,b.id=f,b.stripFlags=g,b.stripComment=h,b.preparePath=i,b.prepareMustache=j,b.prepareRawBlock=k,b.prepareBlock=l,b.prepareProgram=m,b.preparePartialBlock=n;var p=c(6),q=o(p)},function(a,b,c){"use strict";function d(){}function e(a,b,c){if(null==a||"string"!=typeof a&&"Program"!==a.type)throw new l["default"]("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+a);b=b||{},"data"in b||(b.data=!0),b.compat&&(b.useDepths=!0);var d=c.parse(a,b),e=(new c.Compiler).compile(d,b);return(new c.JavaScriptCompiler).compile(e,b)}function f(a,b,c){function d(){var d=c.parse(a,b),e=(new c.Compiler).compile(d,b),f=(new c.JavaScriptCompiler).compile(e,b,void 0,!0);return c.template(f)}function e(a,b){return f||(f=d()),f.call(this,a,b)}if(void 0===b&&(b={}),null==a||"string"!=typeof a&&"Program"!==a.type)throw new l["default"]("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+a);b=m.extend({},b),"data"in b||(b.data=!0),b.compat&&(b.useDepths=!0);var f=void 0;return e._setup=function(a){return f||(f=d()),f._setup(a)},e._child=function(a,b,c,e){return f||(f=d()),
vendor: 11,630 bytes, lines 12706-12707
12706f._child(a,b,c,e)},e}function g(a,b){if(a===b)return!0;if(m.isArray(a)&&m.isArray(b)&&a.length===b.length){for(var c=0;c<a.length;c++)if(!g(a[c],b[c]))return!1;return!0}}function h(a){if(!a.path.parts){var b=a.path;a.path={type:"PathExpression",data:!1,depth:0,parts:[b.original+""],original:b.original+"",loc:b.loc}}}var i=c(74)["default"],j=c(1)["default"];b.__esModule=!0,b.Compiler=d,b.precompile=e,b.compile=f;var k=c(6),l=j(k),m=c(5),n=c(84),o=j(n),p=[].slice;d.prototype={compiler:d,equals:function(a){var b=this.opcodes.length;if(a.opcodes.length!==b)return!1;for(var c=0;c<b;c++){var d=this.opcodes[c],e=a.opcodes[c];if(d.opcode!==e.opcode||!g(d.args,e.args))return!1}b=this.children.length;for(var c=0;c<b;c++)if(!this.children[c].equals(a.children[c]))return!1;
12707return!0},guid:0,compile:function(a,b){return this.sourceNode=[],this.opcodes=[],this.children=[],this.options=b,this.stringParams=b.stringParams,this.trackIds=b.trackIds,b.blockParams=b.blockParams||[],b.knownHelpers=m.extend(i(null),{helperMissing:!0,blockHelperMissing:!0,each:!0,"if":!0,unless:!0,"with":!0,log:!0,lookup:!0},b.knownHelpers),this.accept(a)},compileProgram:function(a){var b=new this.compiler,c=b.compile(a,this.options),d=this.guid++;return this.usePartial=this.usePartial||c.usePartial,this.children[d]=c,this.useDepths=this.useDepths||c.useDepths,d},accept:function(a){if(!this[a.type])throw new l["default"]("Unknown type: "+a.type,a);this.sourceNode.unshift(a);var b=this[a.type](a);return this.sourceNode.shift(),b},Program:function(a){this.options.blockParams.unshift(a.blockParams);for(var b=a.body,c=b.length,d=0;d<c;d++)this.accept(b[d]);return this.options.blockParams.shift(),this.isSimple=1===c,this.blockParams=a.blockParams?a.blockParams.length:0,this},BlockStatement:function(a){h(a);var b=a.program,c=a.inverse;b=b&&this.compileProgram(b),c=c&&this.compileProgram(c);var d=this.classifySexpr(a);"helper"===d?this.helperSexpr(a,b,c):"simple"===d?(this.simpleSexpr(a),this.opcode("pushProgram",b),this.opcode("pushProgram",c),this.opcode("emptyHash"),this.opcode("blockValue",a.path.original)):(this.ambiguousSexpr(a,b,c),this.opcode("pushProgram",b),this.opcode("pushProgram",c),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},DecoratorBlock:function(a){var b=a.program&&this.compileProgram(a.program),c=this.setupFullMustacheParams(a,b,void 0),d=a.path;this.useDecorators=!0,this.opcode("registerDecorator",c.length,d.original)},PartialStatement:function(a){this.usePartial=!0;var b=a.program;b&&(b=this.compileProgram(a.program));var c=a.params;if(c.length>1)throw new l["default"]("Unsupported number of partial arguments: "+c.length,a);c.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):c.push({type:"PathExpression",parts:[],depth:0}));var d=a.name.original,e="SubExpression"===a.name.type;e&&this.accept(a.name),this.setupFullMustacheParams(a,b,void 0,!0);var f=a.indent||"";this.options.preventIndent&&f&&(this.opcode("appendContent",f),f=""),this.opcode("invokePartial",e,d,f),this.opcode("append")},PartialBlockStatement:function(a){this.PartialStatement(a)},MustacheStatement:function(a){this.SubExpression(a),a.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function(a){this.DecoratorBlock(a)},ContentStatement:function(a){a.value&&this.opcode("appendContent",a.value)},CommentStatement:function(){},SubExpression:function(a){h(a);var b=this.classifySexpr(a);"simple"===b?this.simpleSexpr(a):"helper"===b?this.helperSexpr(a):this.ambiguousSexpr(a)},ambiguousSexpr:function(a,b,c){var d=a.path,e=d.parts[0],f=null!=b||null!=c;this.opcode("getContext",d.depth),this.opcode("pushProgram",b),this.opcode("pushProgram",c),d.strict=!0,this.accept(d),this.opcode("invokeAmbiguous",e,f)},simpleSexpr:function(a){var b=a.path;b.strict=!0,this.accept(b),this.opcode("resolvePossibleLambda")},helperSexpr:function(a,b,c){var d=this.setupFullMustacheParams(a,b,c),e=a.path,f=e.parts[0];if(this.options.knownHelpers[f])this.opcode("invokeKnownHelper",d.length,f);else{if(this.options.knownHelpersOnly)throw new l["default"]("You specified knownHelpersOnly, but used the unknown helper "+f,a);e.strict=!0,e.falsy=!0,this.accept(e),this.opcode("invokeHelper",d.length,e.original,o["default"].helpers.simpleId(e))}},PathExpression:function(a){this.addDepth(a.depth),this.opcode("getContext",a.depth);var b=a.parts[0],c=o["default"].helpers.scopedId(a),d=!a.depth&&!c&&this.blockParamIndex(b);d?this.opcode("lookupBlockParam",d,a.parts):b?a.data?(this.options.data=!0,this.opcode("lookupData",a.depth,a.parts,a.strict)):this.opcode("lookupOnContext",a.parts,a.falsy,a.strict,c):this.opcode("pushContext")},StringLiteral:function(a){this.opcode("pushString",a.value)},NumberLiteral:function(a){this.opcode("pushLiteral",a.value)},BooleanLiteral:function(a){this.opcode("pushLiteral",a.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(a){var b=a.pairs,c=0,d=b.length;for(this.opcode("pushHash");c<d;c++)this.pushParam(b[c].value);for(;c--;)this.opcode("assignToHash",b[c].key);this.opcode("popHash")},opcode:function(a){this.opcodes.push({opcode:a,args:p.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(a){a&&(this.useDepths=!0)},classifySexpr:function(a){var b=o["default"].helpers.simpleId(a.path),c=b&&!!this.blockParamIndex(a.path.parts[0]),d=!c&&o["default"].helpers.helperExpression(a),e=!c&&(d||b);if(e&&!d){var f=a.path.parts[0],g=this.options;g.knownHelpers[f]?d=!0:g.knownHelpersOnly&&(e=!1)}return d?"helper":e?"ambiguous":"simple"},pushParams:function(a){for(var b=0,c=a.length;b<c;b++)this.pushParam(a[b])},pushParam:function(a){var b=null!=a.value?a.value:a.original||"";if(this.stringParams)b.replace&&(b=b.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".")),a.depth&&this.addDepth(a.depth),this.opcode("getContext",a.depth||0),this.opcode("pushStringParam",b,a.type),"SubExpression"===a.type&&this.accept(a);else{if(this.trackIds){var c=void 0;if(!a.parts||o["default"].helpers.scopedId(a)||a.depth||(c=this.blockParamIndex(a.parts[0])),c){var d=a.parts.slice(1).join(".");this.opcode("pushId","BlockParam",c,d)}else b=a.original||b,b.replace&&(b=b.replace(/^this(?:\.|$)/,"").replace(/^\.\//,"").replace(/^\.$/,"")),this.opcode("pushId",a.type,b)}this.accept(a)}},setupFullMustacheParams:function(a,b,c,d){var e=a.params;return this.pushParams(e),this.opcode("pushProgram",b),this.opcode("pushProgram",c),a.hash?this.accept(a.hash):this.opcode("emptyHash",d),e},blockParamIndex:function(a){for(var b=0,c=this.options.blockParams.length;b<c;b++){var d=this.options.blockParams[b],e=d&&m.indexOf(d,a);if(d&&e>=0)return[b,e]}}}},function(a,b,c){"use strict";function d(a){this.value=a}function e(){}function f(a,b,c,d,e){var f=b.popStack(),g=c.length;for(a&&g--;d<g;d++)f=b.nameLookup(f,c[d],e);return a?[b.aliasable("container.strict"),"(",f,", ",b.quotedString(c[d]),", ",JSON.stringify(b.source.currentLocation)," )"]:f}var g=c(60)["default"],h=c(1)["default"];b.__esModule=!0;var i=c(4),j=c(6),k=h(j),l=c(5),m=c(92),n=h(m);e.prototype={nameLookup:function(a,b){return this.internalNameLookup(a,b)},depthedLookup:function(a){return[this.aliasable("container.lookup"),"(depths, ",JSON.stringify(a),")"]},compilerInfo:function(){var a=i.COMPILER_REVISION,b=i.REVISION_CHANGES[a];return[a,b]},appendToBuffer:function(a,b,c){return l.isArray(a)||(a=[a]),a=this.source.wrap(a,b),this.environment.isSimple?["return ",a,";"]:c?["buffer += ",a,";"]:(a.appendToBuffer=!0,a)},initializeBuffer:function(){return this.quotedString("")},internalNameLookup:function(a,b){return this.lookupPropertyFunctionIsUsed=!0,["lookupProperty(",a,",",JSON.stringify(b),")"]},lookupPropertyFunctionIsUsed:!1,compile:function(a,b,c,d){this.environment=a,this.options=b,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!d,this.name=this.environment.name,this.isChild=!!c,this.context=c||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(a,b),this.useDepths=this.useDepths||a.useDepths||a.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||a.useBlockParams;var e=a.opcodes,f=void 0,g=void 0,h=void 0,i=void 0;for(h=0,i=e.length;h<i;h++)f=e[h],this.source.currentLocation=f.loc,g=g||f.loc,this[f.opcode].apply(this,f.args);if(this.source.currentLocation=g,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new k["default"]("Compile completed with content left on stack");this.decorators.isEmpty()?this.decorators=void 0:(this.useDecorators=!0,this.decorators.prepend(["var decorators = container.decorators, ",this.lookupPropertyFunctionVarDeclaration(),";\n"]),this.decorators.push("return fn;"),d?this.decorators=Function.apply(this,["fn","props","container","depth0","data","blockParams","depths",this.decorators.merge()]):(this.decorators.prepend("function(fn, props, container, depth0, data, blockParams, depths) {\n"),this.decorators.push("}\n"),this.decorators=this.decorators.merge()));var j=this.createFunctionContext(d);if(this.isChild)return j;var l={compiler:this.compilerInfo(),main:j};this.decorators&&(l.main_d=this.decorators,l.useDecorators=!0);var m=this.context,n=m.programs,o=m.decorators;for(h=0,i=n.length;h<i;h++)n[h]&&(l[h]=n[h],o[h]&&(l[h+"_d"]=o[h],l.useDecorators=!0));return this.environment.usePartial&&(l.usePartial=!0),this.options.data&&(l.useData=!0),this.useDepths&&(l.useDepths=!0),this.useBlockParams&&(l.useBlockParams=!0),this.options.compat&&(l.compat=!0),d?l.compilerOptions=this.options:(l.compiler=JSON.stringify(l.compiler),this.source.currentLocation={start:{line:1,column:0}},l=this.objectLiteral(l),b.srcName?(l=l.toStringWithSourceMap({file:b.destName}),l.map=l.map&&l.map.toString()):l=l.toString()),l},preamble:function(){this.lastContext=0,this.source=new n["default"](this.options.srcName),this.decorators=new n["default"](this.options.srcName)},createFunctionContext:function(a){var b=this,c="",d=this.stackVars.concat(this.registers.list);d.length>0&&(c+=", "+d.join(", "));var e=0;g(this.aliases).forEach(function(a){var d=b.aliases[a];d.children&&d.referenceCount>1&&(c+=", alias"+ ++e+"="+a,d.children[0]="alias"+e)}),this.lookupPropertyFunctionIsUsed&&(c+=", "+this.lookupPropertyFunctionVarDeclaration());var f=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&f.push("blockParams"),this.useDepths&&f.push("depths");var h=this.mergeSource(c);return a?(f.push(h),Function.apply(this,f)):this.source.wrap(["function(",f.join(","),") {\n  ",h,"}"])},mergeSource:function(a){var b=this.environment.isSimple,c=!this.forceBuffer,d=void 0,e=void 0,f=void 0,g=void 0;return this.source.each(function(a){a.appendToBuffer?(f?a.prepend("  + "):f=a,g=a):(f&&(e?f.prepend("buffer += "):d=!0,g.add(";"),f=g=void 0),e=!0,b||(c=!1))}),c?f?(f.prepend("return "),g.add(";")):e||this.source.push('return "";'):(a+=", buffer = "+(d?"":this.initializeBuffer()),f?(f.prepend("return buffer + "),g.add(";")):this.source.push("return buffer;")),a&&this.source.prepend("var "+a.substring(2)+(d?"":";\n")),this.source.merge()},lookupPropertyFunctionVarDeclaration:function(){return"\n      lookupProperty = container.lookupProperty || function(parent, propertyName) {\n        if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\
12707n          return parent[propertyName];\n        }\n        return undefined\n    }\n    ".trim()},blockValue:function(a){var b=this.aliasable("container.hooks.blockHelperMissing"),c=[this.contextName(0)];this.setupHelperArgs(a,0,c);var d=this.popStack();c.splice(1,0,d),this.push(this.source.functionCall(b,"call",c))},ambiguousBlockValue:function(){var a=this.aliasable("container.hooks.blockHelperMissing"),b=[this.contextName(0)];this.setupHelperArgs("",0,b,!0),this.flushInline();var c=this.topStack();b.splice(1,0,c),this.pushSource(["if (!",this.lastHelper,") { ",c," = ",this.source.functionCall(a,"call",b),"}"])},appendContent:function(a){this.pendingContent?a=this.pendingContent+a:this.pendingLocation=this.source.currentLocation,this.pendingContent=a},append:function(){if(this.isInline())this.replaceStack(function(a){return[" != null ? ",a,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var a=this.popStack();this.pushSource(["if (",a," != null) { ",this.appendToBuffer(a,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(a){this.lastContext=a},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(a,b,c,d){var e=0;d||!this.options.compat||this.lastContext?this.pushContext():this.push(this.depthedLookup(a[e++])),this.resolvePath("context",a,e,b,c)},lookupBlockParam:function(a,b){this.useBlockParams=!0,this.push(["blockParams[",a[0],"][",a[1],"]"]),this.resolvePath("context",b,1)},lookupData:function(a,b,c){a?this.pushStackLiteral("container.data(data, "+a+")"):this.pushStackLiteral("data"),this.resolvePath("data",b,0,!0,c)},resolvePath:function(a,b,c,d,e){var g=this;if(this.options.strict||this.options.assumeObjects)return void this.push(f(this.options.strict&&e,this,b,c,a));for(var h=b.length;c<h;c++)this.replaceStack(function(e){var f=g.nameLookup(e,b[c],a);return d?[" && ",f]:[" != null ? ",f," : ",e]})},resolvePossibleLambda:function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function(a,b){this.pushContext(),this.pushString(b),"SubExpression"!==b&&("string"==typeof a?this.pushString(a):this.pushStackLiteral(a))},emptyHash:function(a){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(a?"undefined":"{}")},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:{},types:[],contexts:[],ids:[]}},popHash:function(){var a=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(a.ids)),this.stringParams&&(this.push(this.objectLiteral(a.contexts)),this.push(this.objectLiteral(a.types))),this.push(this.objectLiteral(a.values))},pushString:function(a){this.pushStackLiteral(this.quotedString(a))},pushLiteral:function(a){this.pushStackLiteral(a)},pushProgram:function(a){null!=a?this.pushStackLiteral(this.programExpression(a)):this.pushStackLiteral(null)},registerDecorator:function(a,b){var c=this.nameLookup("decorators",b,"decorator"),d=this.setupHelperArgs(b,a);this.decorators.push(["fn = ",this.decorators.functionCall(c,"",["fn","props","container",d])," || fn;"])},invokeHelper:function(a,b,c){var d=this.popStack(),e=this.setupHelper(a,b),f=[];c&&f.push(e.name),f.push(d),this.options.strict||f.push(this.aliasable("container.hooks.helperMissing"));var g=["(",this.itemsSeparatedBy(f,"||"),")"],h=this.source.functionCall(g,"call",e.callParams);this.push(h)},itemsSeparatedBy:function(a,b){var c=[];c.push(a[0]);for(var d=1;d<a.length;d++)c.push(b,a[d]);return c},invokeKnownHelper:function(a,b){var c=this.setupHelper(a,b);this.push(this.source.functionCall(c.name,"call",c.callParams))},invokeAmbiguous:function(a,b){this.useRegister("helper");var c=this.popStack();this.emptyHash();var d=this.setupHelper(0,a,b),e=this.lastHelper=this.nameLookup("helpers",a,"helper"),f=["(","(helper = ",e," || ",c,")"];this.options.strict||(f[0]="(helper = ",f.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"))),this.push(["(",f,d.paramsInit?["),(",d.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",d.callParams)," : helper))"])},invokePartial:function(a,b,c){var d=[],e=this.setupParams(b,1,d);a&&(b=this.popStack(),delete e.name),c&&(e.indent=JSON.stringify(c)),e.helpers="helpers",e.partials="partials",e.decorators="container.decorators",a?d.unshift(b):d.unshift(this.nameLookup("partials",b,"partial")),this.options.compat&&(e.depths="depths"),e=this.objectLiteral(e),d.push(e),this.push(this.source.functionCall("container.invokePartial","",d))},assignToHash:function(a){var b=this.popStack(),c=void 0,d=void 0,e=void 0;this.trackIds&&(e=this.popStack()),this.stringParams&&(d=this.popStack(),c=this.popStack());var f=this.hash;c&&(f.contexts[a]=c),d&&(f.types[a]=d),e&&(f.ids[a]=e),f.values[a]=b},pushId:function(a,b,c){"BlockParam"===a?this.pushStackLiteral("blockParams["+b[0]+"].path["+b[1]+"]"+(c?" + "+JSON.stringify("."+c):"")):"PathExpression"===a?this.pushString(b):"Sub
12707Expression"===a?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:e,compileChildren:function(a,b){for(var c=a.children,d=void 0,e=void 0,f=0,g=c.length;f<g;f++){d=c[f],e=new this.compiler;var h=this.matchExistingProgram(d);if(null==h){this.context.programs.push("");var i=this.context.programs.length
vendor: 6,822 bytes, line 12707
12707;d.index=i,d.name="program"+i,this.context.programs[i]=e.compile(d,b,this.context,!this.precompile),this.context.decorators[i]=e.decorators,this.context.environments[i]=d,this.useDepths=this.useDepths||e.useDepths,this.useBlockParams=this.useBlockParams||e.useBlockParams,d.useDepths=this.useDepths,d.useBlockParams=this.useBlockParams}else d.index=h.index,d.name="program"+h.index,this.useDepths=this.useDepths||h.useDepths,this.useBlockParams=this.useBlockParams||h.useBlockParams}},matchExistingProgram:function(a){for(var b=0,c=this.context.environments.length;b<c;b++){var d=this.context.environments[b];if(d&&d.equals(a))return d}},programExpression:function(a){var b=this.environment.children[a],c=[b.index,"data",b.blockParams];return(this.useBlockParams||this.useDepths)&&c.push("blockParams"),this.useDepths&&c.push("depths"),"container.program("+c.join(", ")+")"},useRegister:function(a){this.registers[a]||(this.registers[a]=!0,this.registers.list.push(a))},push:function(a){return a instanceof d||(a=this.source.wrap(a)),this.inlineStack.push(a),a},pushStackLiteral:function(a){this.push(new d(a))},pushSource:function(a){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),a&&this.source.push(a)},replaceStack:function(a){var b=["("],c=void 0,e=void 0,f=void 0;if(!this.isInline())throw new k["default"]("replaceStack on non-inline");var g=this.popStack(!0);if(g instanceof d)c=[g.value],b=["(",c],f=!0;else{e=!0;var h=this.incrStack();b=["((",this.push(h)," = ",g,")"],c=this.topStack()}var i=a.call(this,c);f||this.popStack(),e&&this.stackSlot--,this.push(b.concat(i,")"))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var a=this.inlineStack;this.inlineStack=[];for(var b=0,c=a.length;b<c;b++){var e=a[b];if(e instanceof d)this.compileStack.push(e);else{var f=this.incrStack();this.pushSource([f," = ",e,";"]),this.compileStack.push(f)}}},isInline:function(){return this.inlineStack.length},popStack:function(a){var b=this.isInline(),c=(b?this.inlineStack:this.compileStack).pop();if(!a&&c instanceof d)return c.value;if(!b){if(!this.stackSlot)throw new k["default"]("Invalid stack pop");this.stackSlot--}return c},topStack:function(){var a=this.isInline()?this.inlineStack:this.compileStack,b=a[a.length-1];return b instanceof d?b.value:b},contextName:function(a){return this.useDepths&&a?"depths["+a+"]":"depth"+a},quotedString:function(a){return this.source.quotedString(a)},objectLiteral:function(a){return this.source.objectLiteral(a)},aliasable:function(a){var b=this.aliases[a];return b?(b.referenceCount++,b):(b=this.aliases[a]=this.source.wrap(a),b.aliasable=!0,b.referenceCount=1,b)},setupHelper:function(a,b,c){var d=[],e=this.setupHelperArgs(b,a,d,c),f=this.nameLookup("helpers",b,"helper"),g=this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})");return{params:d,paramsInit:e,name:f,callParams:[g].concat(d)}},setupParams:function(a,b,c){var d={},e=[],f=[],g=[],h=!c,i=void 0;h&&(c=[]),d.name=this.quotedString(a),d.hash=this.popStack(),this.trackIds&&(d.hashIds=this.popStack()),this.stringParams&&(d.hashTypes=this.popStack(),d.hashContexts=this.popStack());var j=this.popStack(),k=this.popStack();(k||j)&&(d.fn=k||"container.noop",d.inverse=j||"container.noop");for(var l=b;l--;)i=this.popStack(),c[l]=i,this.trackIds&&(g[l]=this.popStack()),this.stringParams&&(f[l]=this.popStack(),e[l]=this.popStack());return h&&(d.args=this.source.generateArray(c)),this.trackIds&&(d.ids=this.source.generateArray(g)),this.stringParams&&(d.types=this.source.generateArray(f),d.contexts=this.source.generateArray(e)),this.options.data&&(d.data="data"),this.useBlockParams&&(d.blockParams="blockParams"),d},setupHelperArgs:function(a,b,c,d){var e=this.setupParams(a,b,c);return e.loc=JSON.stringify(this.source.currentLocation),e=this.objectLiteral(e),d?(this.useRegister("options"),c.push("options"),["options=",e]):c?(c.push(e),""):e}},function(){for(var a="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),b=e.RESERVED_WORDS={},c=0,d=a.length;c<d;c++)b[a[c]]=!0}(),e.isValidJavaScriptVariableName=function(a){return!e.RESERVED_WORDS[a]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(a)},b["default"]=e,a.exports=b["default"]},function(a,b,c){"use strict";function d(a,b,c){if(g.isArray(a)){for(var d=[],e=0,f=a.length;e<f;e++)d.push(b.wrap(a[e],c));return d}return"boolean"==typeof a||"number"==typeof a?a+"":a}function e(a){this.srcFile=a,this.source=[]}var f=c(60)["default"];b.__esModule=!0;var g=c(5),h=void 0;try{}catch(i){}h||(h=function(a,b,c,d){this.src="",d&&this.add(d)},h.prototype={add:function(a){g.isArray(a)&&(a=a.join("")),this.src+=a},prepend:function(a){g.isArray(a)&&(a=a.join("")),this.src=a+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}}),e.prototype={isEmpty:function(){return!this.source.length},prepend:function(a,b){this.source.unshift(this.wrap(a,b))},push:function(a,b){this.source.push(this.wrap(a,b))},merge:function(){var a=this.empty();return this.each(function(b){a.add(["  ",b,"\n"])}),a},each:function(a){for(var b=0,c=this.source.length;b<c;b++)a(this.source[b])},empty:function(){var a=this.currentLocation||{start:{}};return new h(a.start.line,a.start.column,this.srcFile)},wrap:function(a){var b=arguments.length<=1||void 0===arguments[1]?this.currentLocation||{start:{}}:arguments[1];return a instanceof h?a:(a=d(a,this,b),new h(b.start.line,b.start.column,this.srcFile,a))},functionCall:function(a,b,c){return c=this.generateList(c),this.wrap([a,b?"."+b+"(":"(",c,")"])},quotedString:function(a){return'"'+(a+"").replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function(a){var b=this,c=[];f(a).forEach(function(e){var f=d(a[e],b);"undefined"!==f&&c.push([b.quotedString(e),":",f])});var e=this.generateList(c);return e.prepend("{"),e.add("}"),e},generateList:function(a){for(var b=this.empty(),c=0,e=a.length;c<e;c++)c&&b.add(","),b.add(d(a[c],this));return b},generateArray:function(a){var b=this.generateList(a);return b.prepend("["),b.add("]"),b}},b["default"]=e,a.exports=b["default"]}])});
vendor: 7,309 bytes, lines 12707-12717
12707
12708
12709/**
12710 * [js-sha256]{@link https://github.com/emn178/js-sha256}
12711 *
12712 * @version 0.10.0
12713 * @author Chen, Yi-Cyuan [[email protected]]
12714 * @copyright Chen, Yi-Cyuan 2014-2023
12715 * @license MIT
12716 */
12717!function(){"use strict";function t(t,i){i?(d[0]=d[16]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=d[9]=d[10]=d[11]=d[12]=d[13]=d[14]=d[15]=0,this.blocks=d):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=t}function i(i,r,s){var e,n=typeof i;if("string"===n){var o,a=[],u=i.length,c=0;for(e=0;e<u;++e)(o=i.charCodeAt(e))<128?a[c++]=o:o<2048?(a[c++]=192|o>>6,a[c++]=128|63&o):o<55296||o>=57344?(a[c++]=224|o>>12,a[c++]=128|o>>6&63,a[c++]=128|63&o):(o=65536+((1023&o)<<10|1023&i.charCodeAt(++e)),a[c++]=240|o>>18,a[c++]=128|o>>12&63,a[c++]=128|o>>6&63,a[c++]=128|63&o);i=a}else{if("object"!==n)throw new Error(h);if(null===i)throw new Error(h);if(f&&i.constructor===ArrayBuffer)i=new Uint8Array(i);else if(!(Array.isArray(i)||f&&ArrayBuffer.isView(i)))throw new Error(h)}i.length>64&&(i=new t(r,!0).update(i).array());var y=[],p=[];for(e=0;e<64;++e){var l=i[e]||0;y[e]=92^l,p[e]=54^l}t.call(this,r,s),this.update(p),this.oKeyPad=y,this.inner=!0,this.sharedMemory=s}var h="input is invalid type",r="object"==typeof window,s=r?window:{};s.JS_SHA256_NO_WINDOW&&(r=!1);var e=!r&&"object"==typeof self,n=!s.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;n?s=global:e&&(s=self);var o=!s.JS_SHA256_NO_COMMON_JS&&"object"==typeof module&&module.exports,a="function"==typeof define&&define.amd,f=!s.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,u="0123456789abcdef".split(""),c=[-2147483648,8388608,32768,128],y=[24,16,8,0],p=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],l=["hex","array","digest","arrayBuffer"],d=[];!s.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!f||!s.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});var A=function(i,h){return function(r){return new t(h,!0).update(r)[i]()}},w=function(i){var h=A("hex",i);n&&(h=b(h,i)),h.create=function(){return new t(i)},h.update=function(t){return h.create().update(t)};for(var r=0;r<l.length;++r){var s=l[r];h[s]=A(s,i)}return h},b=function(t,i){var r,e=require("crypto"),n=require("buffer").Buffer,o=i?"sha224":"sha256";r=n.from&&!s.JS_SHA256_NO_BUFFER_FROM?n.from:function(t){return new n(t)};return function(i){if("string"==typeof i)return e.createHash(o).update(i,"utf8").digest("hex");if(null===i||void 0===i)throw new Error(h);return i.constructor===ArrayBuffer&&(i=new Uint8Array(i)),Array.isArray(i)||ArrayBuffer.isView(i)||i.constructor===n?e.createHash(o).update(r(i)).digest("hex"):t(i)}},_=function(t,h){return function(r,s){return new i(r,h,!0).update(s)[t]()}},v=function(t){var h=_("hex",t);h.create=function(h){return new i(h,t)},h.update=function(t,i){return h.create(t).update(i)};for(var r=0;r<l.length;++r){var s=l[r];h[s]=_(s,t)}return h};t.prototype.update=function(t){if(!this.finalized){var i,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(h);if(null===t)throw new Error(h);if(f&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||f&&ArrayBuffer.isView(t)))throw new Error(h);i=!0}for(var s,e,n=0,o=t.length,a=this.blocks;n<o;){if(this.hashed&&(this.hashed=!1,a[0]=this.block,a[16]=a[1]=a[2]=a[3]=a[4]=a[5]=a[6]=a[7]=a[8]=a[9]=a[10]=a[11]=a[12]=a[13]=a[14]=a[15]=0),i)for(e=this.start;n<o&&e<64;++n)a[e>>2]|=t[n]<<y[3&e++];else for(e=this.start;n<o&&e<64;++n)(s=t.charCodeAt(n))<128?a[e>>2]|=s<<y[3&e++]:s<2048?(a[e>>2]|=(192|s>>6)<<y[3&e++],a[e>>2]|=(128|63&s)<<y[3&e++]):s<55296||s>=57344?(a[e>>2]|=(224|s>>12)<<y[3&e++],a[e>>2]|=(128|s>>6&63)<<y[3&e++],a[e>>2]|=(128|63&s)<<y[3&e++]):(s=65536+((1023&s)<<10|1023&t.charCodeAt(++n)),a[e>>2]|=(240|s>>18)<<y[3&e++],a[e>>2]|=(128|s>>12&63)<<y[3&e++],a[e>>2]|=(128|s>>6&63)<<y[3&e++],a[e>>2]|=(128|63&s)<<y[3&e++]);this.lastByteIndex=e,this.bytes+=e-this.start,e>=64?(this.block=a[16],this.start=e-64,this.hash(),this.hashed=!0):this.start=e}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},t.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,i=this.lastByteIndex;t[16]=this.block,t[i>>2]|=c[3&i],this.block=t[16],i>=56&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash()}},t.prototype.hash=function(){var t,i,h,r,s,e,n,o,a,f=this.h0,u=this.h1,c=this.h2,y=this.h3,l=this.h4,d=this.h5,A=this.h6,w=this.h7,b=this.blocks;for(t=16;t<64;++t)i=((s=b[t-15])>>>7|s<<25)^(s>>>18|s<<14)^s>>>3,h=((s=b[t-2])>>>17|s<<15)^(s>>>19|s<<13)^s>>>10,b[t]=b[t-16]+i+b[t-7]+h<<0;for(a=u&c,t=0;t<64;t+=4)this.first?(this.is224?(e=300032,w=(s=b[0]-1413257819)-150054599<<0,y=s+24177077<<0):(e=704751109,w=(s=b[0]-210244248)-1521486534<<0,y=s+143694565<<0),this.first=!1):(i=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),r=(e=f&u)^f&c^a,w=y+(s=w+(h=(l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7))+(l&d^~l&A)+p[t]+b[t])<<0,y=s+(i+r)<<0),i=(y>>>2|y<<30)^(y>>>13|y<<19)^(y>>>22|y<<10),r=(n=y&f)^y&u^e,A=c+(s=A+(h=(w>>>6|w<<26)^(w>>>11|w<<21)^(w>>>25|w<<7))+(w&l^~w&d)+p[t+1]+b[t+1])<<0,i=((c=s+(i+r)<<0)>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),r=(o=c&y)^c&f^n,d=u+(s=d+(h=(A>>>6|A<<26)^(A>>>11|A<<21)^(A>>>25|A<<7))+(A&w^~A&l)+p[t+2]+b[t+2])<<0,i=((u=s+(i+r)<<0)>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),r=(a=u&c)^u&y^o,l=f+(s=l+(h=(d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7))+(d&A^~d&w)+p[t+3]+b[t+3])<<0,f=s+(i+r)<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+f<<0,this.h1=this.h1+u<<0,this.h2=this.h2+c<<0,this.h3=this.h3+y<<0,this.h4=this.h4+l<<0,this.h5=this.h5+d<<0,this.h6=this.h6+A<<0,this.h7=this.h7+w<<0},t.prototype.hex=function(){this.finalize();var t=this.h0,i=this.h1,h=this.h2,r=this.h3,s=this.h4,e=this.h5,n=this.h6,o=this.h7,a=u[t>>28&15]+u[t>>24&15]+u[t>>20&15]+u[t>>16&15]+u[t>>12&15]+u[t>>8&15]+u[t>>4&15]+u[15&t]+u[i>>28&15]+u[i>>24&15]+u[i>>20&15]+u[i>>16&15]+u[i>>12&15]+u[i>>8&15]+u[i>>4&15]+u[15&i]+u[h>>28&15]+u[h>>
1271724&15]+u[h>>20&15]+u[h>>16&15]+u[h>>12&15]+u[h>>8&15]+u[h>>4&15]+u[15&h]+u[r>>28&15]+u[r>>24&15]+u[r>>20&15]+u[r>>16&15]+u[r>>12&15]+u[r>>8&15]+u[r>>4&15]+u[15&r]+u[s>>28&15]+u[s>>24&15]+u[s>>20&15]+u[s>>16&15]+u[s>>12&15]+u[s>>8&15]+u[s>>4&15]+u[15&s]+u[e>>28&15]+u[e>>24&15]+u[e>>20&15]+u[e>>16&15]+u[e>>12&15]+u[e>>8&15]+u[e>>4&15]+u[15&e]+u[n>>28&15]+u[n>>24&15]+u[n>>20&15]+u[n>>16&15]+u[n>>12&15]+u[n>>8&15]+u[n>>4&15]+u[15&n];return this.is224||(a+=u[o>>28&15]+u[o>>24&15]+u[o>>20&15]+u[o>>16&15]+u[o>>12&15]+u[o>>8&15]+u[o>>4&15]+u[15&o]),a},t.prototype.toString=t.prototype.hex,t.prototype.digest=function(){this.finalize();var t=this.h0,i=this.h1,h=this.h2,r=this.h3,s=this.h4,e=this.h5,n=this.h6,o=this.h7,a=[t>>24&255,t>>16&255,t>>8&255,255&t,i>>24&255,i>>16&255,i>>8&255,255&i,h>>24&255,h>>16&255,h>>8&255,255&h,r>>24&255,r>>16&255,r>>8&255,255&r,s>>24&255,s>>16&255,s>>8&255,255&s,e>>24&255,e>>16&255,e>>8&255,255&e,n>>24&255,n>>16&255,n>>8&255,255&n];return this.is224||a.push(o>>24&255,o>>16&255,o>>8&255,255&o),a},t.prototype.array=t.prototype.digest,t.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(this.is224?28:32),i=new DataView(t);return i.setUint32(0,this.h0),i.setUint32(4,this.h1),i.setUint32(8,this.h2),i.setUint32(12,this.h3),i.setUint32(16,this.h4),i.setUint32(20,this.h5),i.setUint32(24,this.h6),this.is224||i.setUint32(28,this.h7),t},(i.prototype=new t).finalize=function(){if(t.prototype.finalize.call(this),this.inner){this.inner=!1;var i=this.array();t.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(i),t.prototype.finalize.call(this)}};var B=w();B.sha256=B,B.sha224=w(!0),B.sha256.hmac=v(),B.sha224.hmac=v(!0),o?module.exports=B:(s.sha256=B.sha256,s.sha224=B.sha224,a&&define(function(){return B}))}();
12718
12719/*! js-cookie v3.0.5 | MIT */
12720!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self,function(){var n=e.Cookies,o=e.Cookies=t();o.noConflict=function(){return e.Cookies=n,o}}())}(this,(function(){"use strict";function e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)e[o]=n[o]}return e}var t=function t(n,o){function r(t,r,i){if("undefined"!=typeof document){"number"==typeof(i=e({},o,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var c="";for(var u in i)i[u]&&(c+="; "+u,!0!==i[u]&&(c+="="+i[u].split(";")[0]));return document.cookie=t+"="+n.write(r,t)+c}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var t=document.cookie?document.cookie.split("; "):[],o={},r=0;r<t.length;r++){var i=t[r].split("="),c=i.slice(1).join("=");try{var u=decodeURIComponent(i[0]);if(o[u]=n.read(c,u),e===u)break}catch(e){}}return e?o[e]:o}},remove:function(t,n){r(t,"",e({},n,{expires:-1}))},withAttributes:function(n){return t(this.converter,e({},this.attributes,n))},withConverter:function(n){return t(e({},this.converter,n),this.attributes)}},{attributes:{value:Object.freeze(o)},converter:{value:Object.freeze(n)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});return t}));
12721
12722/**!
12723
12724 @license
12725 handlebars v4.7.9
12726
12727Copyright (C) 2011-2019 by Yehuda Katz
12728
12729Permission is hereby granted, free of charge, to any person obtaining a copy
12730of this software and associated documentation files (the "Software"), to deal
12731in the Software without restriction, including without limitation the rights
12732to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12733copies of the Software, and to permit persons to whom the Software is
12734furnished to do so, subject to the following conditions:
12735
12736The above copyright notice and this permission notice shall be included in
12737all copies or substantial portions of the Software.
12738
12739THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12740IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
12741FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
12742AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
12743LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
12744OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
12745THE SOFTWARE.
12746
12747*/�
vendor: 32,005 bytes, lines 12747-12748
12747
12748!function(a,b){"object"==typeof exports&&"object"==typeof module?module.exports=b():"function"==typeof define&&define.amd?define([],b):"object"==typeof exports?exports.Handlebars=b():a.Handlebars=b()}(this,function(){return function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}var c={};return b.m=a,b.c=c,b.p="",b(0)}([function(a,b,c){"use strict";function d(){var a=r();return a.compile=function(b,c){return k.compile(b,c,a)},a.precompile=function(b,c){return k.precompile(b,c,a)},a.AST=i["default"],a.Compiler=k.Compiler,a.JavaScriptCompiler=m["default"],a.Parser=j.parser,a.parse=j.parse,a.parseWithoutProcessing=j.parseWithoutProcessing,a}var e=c(1)["default"];b.__esModule=!0;var f=c(2),g=e(f),h=c(83),i=e(h),j=c(84),k=c(89),l=c(90),m=e(l),n=c(87),o=e(n),p=c(82),q=e(p),r=g["default"].create,s=d();s.create=d,q["default"](s),s.Visitor=o["default"],s["default"]=s,b["default"]=s,a.exports=b["default"]},function(a,b){"use strict";b["default"]=function(a){return a&&a.__esModule?a:{"default":a}},b.__esModule=!0},function(a,b,c){"use strict";function d(){var a=new h.HandlebarsEnvironment;return n.extend(a,h),a.SafeString=j["default"],a.Exception=l["default"],a.Utils=n,a.escapeExpression=n.escapeExpression,a.VM=p,a.template=function(b){return p.template(b,a)},a}var e=c(3)["default"],f=c(1)["default"];b.__esModule=!0;var g=c(4),h=e(g),i=c(76),j=f(i),k=c(6),l=f(k),m=c(5),n=e(m),o=c(77),p=e(o),q=c(82),r=f(q),s=d();s.create=d,r["default"](s),s["default"]=s,b["default"]=s,a.exports=b["default"]},function(a,b){"use strict";b["default"]=function(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b},b.__esModule=!0},function(a,b,c){"use strict";function d(a,b,c){this.helpers=a||{},this.partials=b||{},this.decorators=c||{},i.registerDefaultHelpers(this),j.registerDefaultDecorators(this)}var e=c(1)["default"];b.__esModule=!0,b.HandlebarsEnvironment=d;var f=c(5),g=c(6),h=e(g),i=c(10),j=c(70),k=c(72),l=e(k),m=c(73),n="4.7.9";b.VERSION=n;var o=8;b.COMPILER_REVISION=o;var p=7;b.LAST_COMPATIBLE_COMPILER_REVISION=p;var q={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};b.REVISION_CHANGES=q;var r="[object Object]";d.prototype={constructor:d,logger:l["default"],log:l["default"].log,registerHelper:function(a,b){if(f.toString.call(a)===r){if(b)throw new h["default"]("Arg not supported with multiple helpers");f.extend(this.helpers,a)}else this.helpers[a]=b},unregisterHelper:function(a){delete this.helpers[a]},registerPartial:function(a,b){if(f.toString.call(a)===r)f.extend(this.partials,a);else{if("undefined"==typeof b)throw new h["default"]('Attempting to register a partial called "'+a+'" as undefined');this.partials[a]=b}},unregisterPartial:function(a){delete this.partials[a]},registerDecorator:function(a,b){if(f.toString.call(a)===r){if(b)throw new h["default"]("Arg not supported with multiple decorators");f.extend(this.decorators,a)}else this.decorators[a]=b},unregisterDecorator:function(a){delete this.decorators[a]},resetLoggedPropertyAccesses:function(){m.resetLoggedProperties()}};var s=l["default"].log;b.log=s,b.createFrame=f.createFrame,b.logger=l["default"]},function(a,b){"use strict";function c(a){return k[a]}function d(a){for(var b=1;b<arguments.length;b++)for(var c in arguments[b])Object.prototype.hasOwnProperty.call(arguments[b],c)&&(a[c]=arguments[b][c]);return a}function e(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1}function f(a){if("string"!=typeof a){if(a&&a.toHTML)return a.toHTML();if(null==a)return"";if(!a)return a+"";a=""+a}return m.test(a)?a.replace(l,c):a}function g(a){return!a&&0!==a||!(!p(a)||0!==a.length)}function h(a){var b=d({},a);return b._parent=a,b}function i(a,b){return a.path=b,a}function j(a,b){return(a?a+".":"")+b}b.__esModule=!0,b.extend=d,b.indexOf=e,b.escapeExpression=f,b.isEmpty=g,b.createFrame=h,b.blockParams=i,b.appendContextPath=j;var k={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;","=":"&#x3D;"},l=/[&<>"'`=]/g,m=/[&<>"'`=]/,n=Object.prototype.toString;b.toString=n;var o=function(a){return"function"==typeof a};o(/x/)&&(b.isFunction=o=function(a){return"function"==typeof a&&"[object Function]"===n.call(a)}),b.isFunction=o;var p=Array.isArray||function(a){return!(!a||"object"!=typeof a)&&"[object Array]"===n.call(a)};b.isArray=p},function(a,b,c){"use strict";function d(a,b){var c=b&&b.loc,g=void 0,h=void 0,i=void 0,j=void 0;c&&(g=c.start.line,h=c.end.line,i=c.start.column,j=c.end.column,a+=" - "+g+":"+i);for(var k=Error.prototype.constructor.call(this,a),l=0;l<f.length;l++)this[f[l]]=k[f[l]];Error.captureStackTrace&&Error.captureStackTrace(this,d);try{c&&(this.lineNumber=g,this.endLineNumber=h,e?(Object.defineProperty(this,"column",{value:i,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:j,enumerable:!0})):(this.column=i,this.endColumn=j))}catch(m){}}var e=c(7)["default"];b.__esModule=!0;var f=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];d.prototype=new Error,b["default"]=d,a.exports=b["default"]},function(a,b,c){a.exports={"default":c(8),__esModule:!0}},function(a,b,c){var d=c(9);a.exports=function(a,b,c){return d.setDesc(a,b,c)}},function(a,b){var c=Object;a.exports={create:c.create,getProto:c.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:c.getOwnPropertyDescriptor,setDesc:c.defineProperty,setDescs:c.defineProperties,getKeys:c.keys,getNames:c.getOwnPropertyNames,getSymbols:c.getOwnPropertySymbols,each:[].forEach}},function(a,b,c){"use strict";function d(a){h["default"](a),j["default"](a),l["default"](a),n["default"](a),p["default"](a),r["default"](a),t["default"](a)}function e(a,b,c){a.helpers[b]&&(a.hooks[b]=a.helpers[b],c||(a.helpers[b]=void 0))}var f=c(1)["default"];b.__esModule=!0,b.registerDefaultHelpers=d,b.moveHelperToHooks=e;var g=c(11),h=f(g),i=c(12),j=f(i),k=c(65),l=f(k),m=c(66),n=f(m),o=c(67),p=f(o),q=c(68),r=f(q),s=c(69),t=f(s)},function(a,b,c){"use strict";b.__esModule=!0;var d=c(5);b["default"]=function(a){a.registerHelper("blockHelperMissing",function(b,c){var e=c.inverse,f=c.fn;if(b===!0)return f(this);if(b===!1||null==b)return e(this);if(d.isArray(b))return b.length>0?(c.ids&&(c.ids=[c.name]),a.helpers.each(b,c)):e(this);if(c.data&&c.ids){var g=d.createFrame(c.data);g.contextPath=d.appendContextPath(c.data.contextPath,c.name),c={data:g}}return f(b,c)})},a.exports=b["default"]},function(a,b,c){"use strict";var d=c(13)["default"],e=c(43)["default"],f=c(55)["default"],g=c(60)["default"],h=c(1)["default"];b.__esModule=!0;var i=c(5),j=c(6),k=h(j);b["default"]=function(a){a.registerHelper("each",function(a,b){function c(b,c,d){n&&(n.key=b,n.index=c,n.first=0===c,n.last=!!d,o&&(n.contextPath=o+b)),m+=h(a[b],{data:n,blockParams:i.blockParams([a[b],b],[o+b,null])})}if(!b)throw new k["default"]("Must pass iterator to #each");var h=b.fn,j=b.inverse,l=0,m="",n=void 0,o=void 0;if(b.data&&b.ids&&(o=i.appendContextPath(b.data.contextPath,b.ids[0])+"."),i.isFunction(a)&&(a=a.call(this)),b.data&&(n=i.createFrame(b.data)),a&&"object"==typeof a)if(i.isArray(a))for(var p=a.length;l<p;l++)l in a&&c(l,l,l===a.length-1);else if("function"==typeof d&&a[e]){for(var q=[],r=f(a),s=r.next();!s.done;s=r.next())q.push(s.value);a=q;for(var p=a.length;l<p;l++)c(l,l,l===a.length-1)}else!function(){var b=void 0;g(a).forEach(function(a){void 0!==b&&c(b,l-1),b=a,l++}),void 0!==b&&c(b,l-1,!0)}();return 0===l&&(m=j(this)),m})},a.exports=b["default"]},function(a,b,c){a.exports={"default":c(14),__esModule:!0}},function(a,b,c){c(15),c(42),a.exports=c(21).Symbol},function(a,b,c){"use strict";var d=c(9),e=c(16),f=c(17),g=c(18),h=c(20),i=c(24),j=c(19),k=c(27),l=c(28),m=c(30),n=c(29),o=c(31),p=c(36),q=c(37),r=c(38),s=c(39),t=c(32),u=c(26),v=d.getDesc,w=d.setDesc,x=d.create,y=p.get,z=e.Symbol,A=e.JSON,B=A&&A.stringify,C=!1,D=n("_hidden"),E=d.isEnum,F=k("symbol-registry"),G=k("symbols"),H="function"==typeof z,I=Object.prototype,J=g&&j(function(){return 7!=x(w({},"a",{get:function(){return w(this,"a",{value:7}).a}})).a})?function(a,b,c){var d=v(I,b);d&&delete I[b],w(a,b,c),d&&a!==I&&w(I,b,d)}:w,K=function(a){var b=G[a]=x(z.prototype);return b._k=a,g&&C&&J(I,a,{configurable:!0,set:function(b){f(this,D)&&f(this[D],a)&&(this[D][a]=!1),J(this,a,u(1,b))}}),b},L=function(a){return"symbol"==typeof a},M=function(a,b,c){return c&&f(G,b)?(c.enumerable?(f(a,D)&&a[D][b]&&(a[D][b]=!1),c=x(c,{enumerable:u(0,!1)})):(f(a,D)||w(a,D,u(1,{})),a[D][b]=!0),J(a,b,c)):w(a,b,c)},N=function(a,b){s(a);for(var c,d=q(b=t(b)),e=0,f=d.length;f>e;)M(a,c=d[e++],b[c]);return a},O=function(a,b){return void 0===b?x(a):N(x(a),b)},P=function(a){var b=E.call(this,a);return!(b||!f(this,a)||!f(G,a)||f(this,D)&&this[D][a])||b},Q=function(a,b){var c=v(a=t(a),b);return!c||!f(G,b)||f(a,D)&&a[D][b]||(c.enumerable=!0),c},R=function(a){for(var b,c=y(t(a)),d=[],e=0;c.length>e;)f(G,b=c[e++])||b==D||d.push(b);return d},S=function(a){for(var b,c=y(t(a)),d=[],e=0;c.length>e;)f(G,b=c[e++])&&d.push(G[b]);return d},T=function(a){if(void 0!==a&&!L(a)){for(var b,c,d=[a],e=1,f=arguments;f.length>e;)d.push(f[e++]);return b=d[1],"function"==typeof b&&(c=b),!c&&r(b)||(b=function(a,b){if(c&&(b=c.call(this,a,b)),!L(b))return b}),d[1]=b,B.apply(A,d)}},U=j(function(){var a=z();return"[null]"!=B([a])||"{}"!=B({a:a})||"{}"!=B(Object(a))});H||(z=function(){if(L(this))throw TypeError("Symbol is not a constructor");return K(m(arguments.length>0?arguments[0]:void 0))},i(z.prototype,"toString",function(){return this._k}),L=function(a){return a instanceof z},d.create=O,d.isEnum=P,d.getDesc=Q,d.setDesc=M,d.setDescs=N,d.getNames=p.get=R,d.getSymbols=S,g&&!c(41)&&i(I,"propertyIsEnumerable",P,!0));var V={"for":function(a){return f(F,a+="")?F[a]:F[a]=z(a)},keyFor:function(a){return o(F,a)},useSetter:function(){C=!0},useSimple:function(){C=!1}};d.each.call("hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),function(a){var b=n(a);V[a]=H?b:K(b)}),C=!0,h(h.G+h.W,{Symbol:z}),h(h.S,"Symbol",V),h(h.S+h.F*!H,"Object",{create:O,defineProperty:M,defineProperties:N,getOwnPropertyDescriptor:Q,getOwnPropertyNames:R,getOwnPropertySymbols:S}),A&&h(h.S+h.F*(!H||U),"JSON",{stringify:T}),l(z,"Symbol"),l(Math,"Math",!0),l(e.JSON,"JSON",!0)},function(a,b){var c=a.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=c)},function(a,b){var c={}.hasOwnProperty;a.exports=function(a,b){return c.call(a,b)}},function(a,b,c){a.exports=!c(19)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(a,b){a.exports=function(a){try{return!!a()}catch(b){return!0}}},function(a,b,c){var d=c(16),e=c(21),f=c(22),g="prototype",h=function(a,b,c){var i,j,k,l=a&h.F,m=a&h.G,n=a&h.S,o=a&h.P,p=a&h.B,q=a&h.W,r=m?e:e[b]||(e[b]={}),s=m?d:n?d[b]:(d[b]||{})[g];m&&(c=b);for(i in c)j=!l&&s&&i in s,j&&i in r||(k=j?s[i]:c[i],r[i]=m&&"function"!=typeof s[i]?c[i]:p&&j?f(k,d):q&&s[i]==k?function(a){var b=function(b){return this instanceof a?new a(b):a(b)};return b[g]=a[g],b}(k):o&&"function"==typeof k?f(Function.call,k):k,o&&((r[g]||(r[g]={}))[i]=k))};h.F=1,h.G=2,h.S=4,h.P=8,h.B=16,h.W=32,a.exports=h},function(a,b){var c=a.exports={version:"1.2.6"};"number"==typeof __e&&(__e=c)},function(a,b,c){var d=c(23);a.exports=function(a,b,c){if(d(a),void 0===b)return a;switch(c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)}}return function(){return a.apply(b,arguments)}}},function(a,b){a.exports=function(a){if("function"!=typeof a)throw TypeError(a+" is not a function!");return a}},function(a,b,c){a.exports=c(25)},function(a,b,c){var d=c(9),e=c(26);a.exports=c(18)?function(a,b,c){return d.setDesc(a,b,e(1,c))}:function(a,b,c){return a[b]=c,a}},function(a,b){a.exports=function(a,b){return{enumerable:!(1&a),configurable:!(2&a),writable:!(4&a),value:b}}},function(a,b,c){var d=c(16),e="__core-js_shared__",f=d[e]||(d[e]={});a.exports=function(a){return f[a]||(f[a]={})}},function(a,b,c){var d=c(9).setDesc,e=c(17),f=c(29)("toStringTag");a.exports=function(a,b,c){a&&!e(a=c?a:a.prototype,f)&&d(a,f,{configurable:!0,value:b})}},function(a,b,c){var d=c(27)("wks"),e=c(30),f=c(16).Symbol;a.exports=function(a){return d[a]||(d[a]=f&&f[a]||(f||e)("Symbol."+a))}},function(a,b){var c=0,d=Math.random();a.exports=function(a){return"Symbol(".concat(void 0===a?"":a,")_",(++c+d).toString(36))}},function(a,b,c){var d=c(9),e=c(32);a.exports=function(a,b){for(var c,f=e(a),g=d.getKeys(f),h=g.length,i=0;h>i;)if(f[c=g[i++]]===b)return c}},function(a,b,c){var d=c(33),e=c(35);a.exports=function(a){return d(e(a))}},function(a,b,c){var d=c(34);a.exports=Object("z").propertyIsEnumerable(0)?Object:function(a){return"String"==d(a)?a.split(""):Object(a)}},function(a,b){var c={}.toString;a.exports=function(a){return c.call(a).slice(8,-1)}},function(a,b){a.exports=function(a){if(void 0==a)throw TypeError("Can't call method on  "+a);return a}},function(a,b,c){var d=c(32),e=c(9).getNames,f={}.toString,g="object"==typeof window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],h=function(a){try{return e(a)}catch(b){return g.slice()}};a.exports.get=function(a){return g&&"[object Window]"==f.call(a)?h(a):e(d(a))}},function(a,b,c){var d=c(9);a.exports=function(a){var b=d.getKeys(a),c=d.getSymbols;if(c)for(var e,f=c(a),g=d.isEnum,h=0;f.length>h;)g.call(a,e=f[h++])&&b.push(e);return b}},function(a,b,c){var d=c(34);a.exports=Array.isArray||function(a){return"Array"==d(a)}},function(a,b,c){var d=c(40);a.exports=function(a){if(!d(a))throw TypeError(a+" is not an object!");return a}},function(a,b){a.exports=function(a){return"object"==typeof a?null!==a:"function"==typeof a}},function(a,b){a.exports=!0},function(a,b){},function(a,b,c){a.exports={"default":c(44),__esModule:!0}},function(a,b,c){c(45),c(51),a.exports=c(29)("iterator")},function(a,b,c){"use strict";var d=c(46)(!0);c(48)(String,"String",function(a){this._t=String(a),this._i=0},function(){var a,b=this._t,c=this._i;return c>=b.length?{value:void 0,done:!0}:(a=d(b,c),this._i+=a.length,{value:a,done:!1})})},function(a,b,c){var d=c(47),e=c(35);a.exports=function(a){return function(b,c){var f,g,h=String(e(b)),i=d(c),j=h.length;return i<0||i>=j?a?"":void 0:(f=h.charCodeAt(i),f<55296||f>56319||i+1===j||(g=h.charCodeAt(i+1))<56320||g>57343?a?h.charAt(i):f:a?h.slice(i,i+2):(f-55296<<10)+(g-56320)+65536)}}},function(a,b){var c=Math.ceil,d=Math.floor;a.exports=function(a){return isNaN(a=+a)?0:(a>0?d:c)(a)}},function(a,b,c){"use strict";var d=c(41),e=c(20),f=c(24),g=c(25),h=c(17),i=c(49),j=c(50),k=c(28),l=c(9).getProto,m=c(29)("iterator"),n=!([].keys&&"next"in[].keys()),o="@@iterator",p="keys",q="values",r=function(){return this};a.exports=function(a,b,c,s,t,u,v){j(c,b,s);var w,x,y=function(a){if(!n&&a in C)return C[a];switch(a){case p:return function(){return new c(this,a)};case q:return function(){return new c(this,a)}}return function(){return new c(this,a)}},z=b+" Iterator",A=t==q,B=!1,C=a.prototype,D=C[m]||C[o]||t&&C[t],E=D||y(t);if(D){var F=l(E.call(new a));k(F,z,!0),!d&&h(C,o)&&g(F,m,r),A&&D.name!==q&&(B=!0,E=function(){return D.call(this)})}if(d&&!v||!n&&!B&&C[m]||g(C,m,E),i[b]=E,i[z]=r,t)if(w={values:A?E:y(q),keys:u?E:y(p),entries:A?y("entries"):E},v)for(x in w)x in C||f(C,x,w[x]);else e(e.P+e.F*(n||B),b,w);return w}},function(a,b){a.exports={}},function(a,b,c){"use strict";var d=c(9),e=c(26),f=c(28),g={};c(25)(g,c(29)("iterator"),function(){return this}),a.exports=function(a,b,c){a.prototype=d.create(g,{next:e(1,c)}),f(a,b+" Iterator")}},function(a,b,c){c(52);var d=c(49);d.NodeList=d.HTMLCollection=d.Array},function(a,b,c){"use strict";var d=c(53),e=c(54),f=c(49),g=c(32);a.exports=c(48)(Array,"Array",function(a,b){this._t=g(a),this._i=0,this._k=b},function(){var a=this._t,b=this._k,c=this._i++;return!a||c>=a.length?(this._t=void 0,e(1)):"keys"==b?e(0,c):"values"==b?e(0,a[c]):e(0,[c,a[c]])},"values"),f.Arguments=f.Array,d("keys"),d("values"),d("entries")},function(a,b){a.exports=function(){}},function(a,b){a.exports=function(a,b){return{value:b,done:!!a}}},function(a,b,c){a.exports={"default":c(56),__esModule:!0}},function(a,b,c){c(51),c(45),a.exports=c(57)},function(a,b,c){var d=c(39),e=c(58);a.exports=c(21).getIterator=function(a){var b=e(a);if("function"!=typeof b)throw TypeError(a+" is not iterable!");return d(b.call(a))}},function(a,b,c){var d=c(59),e=c(29)("iterator"),f=c(49);a.exports=c(21).getIteratorMethod=function(a){if(void 0!=a)return a[e]||a["@@iterator"]||f[d(a)]}},function(a,b,c){var d=c(34),e=c(29)("toStringTag"),f="Arguments"==d(function(){return arguments}());a.exports=function(a){var b,c,g;return void 0===a?"Undefined":null===a?"Null":"string"==typeof(c=(b=Object(a))[e])?c:f?d(b):"Object"==(g=d(b))&&"function"==typeof b.callee?"Arguments":g}},function(a,b,c){a.exports={"default":c(61),__esModule:!0}},function(a,b,c){c(62),a.exports=c(21).Object.keys},function(a,b,c){var d=c(63);c(64)("keys",function(a){return function(b){return a(d(b))}})},function(a,b,c){var d=c(35);a.exports=function(a){return Object(d(a))}},function(a,b,c){var d=c(20),e=c(21),f=c(19);a.exports=function(a,b){var c=(e.Object||{})[a]||Object[a],g={};g[a]=b(c),d(d.S+d.F*f(function(){c(1)}),"Object",g)}},function(a,b,c){"use strict";var d=c(1)["default"];b.__esModule=!0;var e=c(6),f=d(e);b["default"]=function(a){a.registerHelper("helperMissing",function(){if(1!==arguments.length)throw new f["default"]('Missing helper: "'+arguments[arguments.length-1].name+'"')})},a.exports=b["default"]},function(a,b,c){"use strict";var d=c(1)["default"];b.__esModule=!0;var e=c(5),f=c(6),g=d(f);b["default"]=function(a){a.registerHelper("if",function(a,b){if(2!=arguments.length)throw new g["default"]("#if requires exactly one argument");return e.isFunction(a)&&(a=a.call(this)),!b.hash.includeZero&&!a||e.isEmpty(a)?b.inverse(this):b.fn(this)}),a.registerHelper("unless",function(b,c){if(2!=arguments.length)throw new g["default"]("#unless requires exactly one argument");return a.helpers["if"].call(this,b,{fn:c.inverse,inverse:c.fn,hash:c.hash})})},a.exports=b["default"]},function(a,b){"use strict";b.__esModule=!0,b["default"]=function(a){a.registerHelper("log",function(){for(var b=[void 0],c=arguments[arguments.length-1],d=0;d<arguments.length-1;d++)b.push(arguments[d]);var e=1;null!=c.hash.level?e=c.hash.level:c.data&&null!=c.data.level&&(e=c.data.level),b[0]=e,a.log.apply(a,b)})},a.exports=b["default"]},function(a,b){"use strict";b.__esModule=!0,b["default"]=function(a){a.registerHelper("lookup",function(a,b,c){return a?c.lookupProperty(a,b):a})},a.exports=b["default"]},function(a,b,c){"use strict";var d=c(1)["default"];b.__esModule=!0;var e=c(5),f=c(6),g=d(f);b["default"]=function(a){a.registerHelper("with",function(a,b){if(2!=arguments.length)throw new g["default"]("#with requires exactly one argument");e.isFunction(a)&&(a=a.call(this));var c=b.fn;if(e.isEmpty(a))return b.inverse(this);var d=b.data;return b.data&&b.ids&&(d=e.createFrame(b.data),d.contextPath=e.appendContextPath(b.data.contextPath,b.ids[0])),c(a,{data:d,blockParams:e.blockParams([a],[d&&d.contextPath])})})},a.exports=b["default"]},function(a,b,c){"use strict";function d(a){g["default"](a)}var e=c(1)["default"];b.__esModule=!0,b.registerDefaultDecorators=d;var f=c(71),g=e(f)},function(a,b,c){"use strict";b.__esModule=!0;var d=c(5);b["default"]=function(a){a.registerDecorator("inline",function(a,b,c,e){var f=a;return b.partials||(b.partials={},f=function(e,f){var g=c.partials;c.partials=d.extend({},g,b.partials);var h=a(e,f);return c.partials=g,h}),b.partials[e.args[0]]=e.fn,f})},a.exports=b["default"]},function(a,b,c){"use strict";b.__esModule=!0;var d=c(5),e={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(a){if("string"==typeof a){var b=d.indexOf(e.methodMap,a.toLowerCase());a=b>=0?b:parseInt(a,10)}return a},log:function(a){if(a=e.lookupLevel(a),"undefined"!=typeof console&&e.lookupLevel(e.level)<=a){var b=e.methodMap[a];console[b]||(b="log");for(var c=arguments.length,d=Array(c>1?c-1:0),f=1;f<c;f++)d[f-1]=arguments[f];console[b].apply(console,d)}}};b["default"]=e,a.exports=b["default"]},function(a,b,c){"use strict";function d(a){var b=i(null);b.__proto__=!1,l.extend(b,a.allowedProtoProperties);var c=i(null);return c.constructor=!1,c.__defineGetter__=!1,c.__defineSetter__=!1,c.__lookupGetter__=!1,c.__lookupSetter__=!1,l.extend(c,a.allowedProtoMethods),{properties:{whitelist:b,defaultValue:a.allowProtoPropertiesByDefault},methods:{whitelist:c,defaultValue:a.allowProtoMethodsByDefault}}}function e(a,b,c){return"function"==typeof a?f(b.methods,c):f(b.properties,c)}function f(a,b){return void 0!==a.whitelist[b]?a.whitelist[b]===!0:void 0!==a.defaultValue?a.defaultValue:(g(b),!1)}function g(a){o[a]!==!0&&(o[a]=!0,n["default"].log("error",'Handlebars: Access has been denied to resolve the property "'+a+'" because it is not an "own property" of its parent.\nYou can add a runtime option to disable the check or this warning:\nSee https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details'))}function h(){j(o).forEach(function(a){delete o[a]})}var i=c(74)["default"],j=c(60)["default"],k=c(1)["default"];b.__esModule=!0,b.createProtoAccessControl=d,b.resultIsAllowed=e,b.resetLoggedProperties=h;var l=c(5),m=c(72),n=k(m),o=i(null)},function(a,b,c){a.exports={"default":c(75),__esModule:!0}},function(a,b,c){var d=c(9);a.exports=function(a,b){return d.create(a,b)}},function(a,b){"use strict";function c(a){this.string=a}b.__esModule=!0,c.prototype.toString=c.prototype.toHTML=function(){return""+this.string},b["default"]=c,a.exports=b["default"]},function(a,b,c){"use strict";function d(a){var b=a&&a[0]||1,c=w.COMPILER_REVISION;if(!(b>=w.LAST_COMPATIBLE_COMPILER_REVISION&&b<=w.COMPILER_REVISION)){if(b<w.LAST_COMPATIBLE_COMPILER_REVISION){var d=w.REVISION_CHANGES[c],e=w.REVISION_CHANGES[b];throw new v["default"]("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+d+") or downgrade your runtime to an older version ("+e+").")}throw new v["default"]("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+a[1]+").")}}function e(a,b){function c(c,d,e){e.hash&&(d=t.extend({},d,e.hash),e.ids&&(e.ids[0]=!0)),c=b.VM.resolvePartial.call(this,c,d,e),e.hooks=this.hooks,e.protoAccessControl=this.protoAccessControl;var f=b.VM.invokePartial.call(this,c,d,e);if(null==f&&b.compile&&(e.partials[e.name]=b.compile(c,a.compilerOptions,b),f=e.partials[e.name](d,e)),null!=f){if(e.indent){for(var g=f.split("\n"),h=0,i=g.length;h<i&&(g[h]||h+1!==i);h++)g[h]=e.indent+g[h];f=g.join("\n")}return f}throw new v["default"]("The partial "+e.name+" could not be compiled when running in runtime-only mode")}function d(b){function c(b){return""+a.main(g,b,g.helpers,g.partials,f,i,h)}var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],f=e.data;d._setup(e),!e.partial&&a.useData&&(f=k(b,f));var h=void 0,i=a.useBlockParams?[]:void 0;return a.useDepths&&(h=e.depths?b!=e.depths[0]?[b].concat(e.depths):e.depths:[b]),(c=l(a.main,c,g,e.depths||[],f,i))(b,e)}if(!b)throw new v["default"]("No environment passed to template");if(!a||!a.main)throw new v["default"]("Unknown template object: "+typeof a);a.main.decorator=a.main_d,b.VM.checkRevision(a.compiler);var e=a.compiler&&7===a.compiler[0],g={strict:function(a,b,c){if(!(a&&b in a))throw new v["default"]('"'+b+'" not defined in '+a,{loc:c});return g.lookupProperty(a,b)},lookupProperty:function(a,b){var c=a[b];return null==c?c:Object.prototype.hasOwnProperty.call(a,b)?c:z.resultIsAllowed(c,g.protoAccessControl,b)?c:void 0},lookup:function(a,b){for(var c=a.length,d=0;d<c;d++){var e=a[d]&&g.lookupProperty(a[d],b);if(null!=e)return e}},lambda:function(a,b){return"function"==typeof a?a.call(b):a},escapeExpression:t.escapeExpression,invokePartial:c,fn:function(b){var c=a[b];return c.decorator=a[b+"_d"],c},programs:[],program:function(a,b,c,d,e){var g=this.programs[a],h=this.fn(a);return b||e||d||c?g=f(this,a,h,b,c,d,e):g||(g=this.programs[a]=f(this,a,h)),g},data:function(a,b){for(;a&&b--;)a=a._parent;return a},mergeIfNeeded:function(a,b){var c=a||b;return a&&b&&a!==b&&(c=t.extend({},b,a)),c},nullContext:o({}),noop:b.VM.noop,compilerInfo:a.compiler};return d.isTop=!0,d._setup=function(c){if(c.partial)g.protoAccessControl=c.protoAccessControl,g.helpers=c.helpers,g.partials=c.partials,g.decorators=c.decorators,g.hooks=c.hooks;else{var d={};m(d,b.helpers,g),m(d,c.helpers,g),g.helpers=d,a.usePartial&&(g.partials=g.mergeIfNeeded(c.partials,b.partials)),(a.usePartial||a.useDecorators)&&(g.decorators=t.extend({},b.decorators,c.decorators)),g.hooks={},g.protoAccessControl=z.createProtoAccessControl(c);var f=c.allowCallsToHelperMissing||e;x.moveHelperToHooks(g,"helperMissing",f),x.moveHelperToHooks(g,"blockHelperMissing",f)}},d._child=function(b,c,d,e){if(a.useBlockParams&&!d)throw new v["default"]("must pass block params");if(a.useDepths&&!e)throw new v["default"]("must pass parent depths");return f(g,b,a[b],c,0,d,e)},d}function f(a,b,c,d,e,f,g){function h(b){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],h=g;return!g||b==g[0]||b===a.nullContext&&null===g[0]||(h=[b].concat(g)),c(a,b,a.helpers,a.partials,e.data||d,f&&[e.blockParams].concat(f),h)}return h=l(c,h,a,g,d,f),h.program=b,h.depth=g?g.length:0,h.blockParams=e||0,h}function g(a,b,c){return a?a.call||c.name||(c.name=a,a=j(c.partials,a)):a="@partial-block"===c.name?j(c.data,"partial-block"):j(c.partials,c.name),a}function h(a,b,c){var d=j(c.data,"partial-block");c.partial=!0,c.ids&&(c.data.contextPath=c.ids[0]||c.data.contextPath);var e=void 0;if(c.fn&&c.fn!==i&&!function(){c.data=w.createFrame(c.data);var a=c.fn;e=c.data["partial-block"]=function(b){var c=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return c.data=w.createFrame(c.data),c.data["partial-block"]=d,a(b,c)},a.partials&&(c.partials=t.extend({},c.partials,a.partials))}(),void 0===a&&e&&(a=e),void 0===a)throw new v["default"]("The partial "+c.name+" could not be found");if(a instanceof Function)return a(b,c)}function i(){return""}function j(a,b){if(a&&Object.prototype.hasOwnProperty.call(a,b))return a[b]}function k(a,b){return b&&"root"in b||(b=b?w.createFrame(b):{},b.root=a),b}function l(a,b,c,d,e,f){if(a.decorator){var g={};b=a.decorator(b,g,c,d&&d[0],e,f,d),t.extend(b,g)}return b}function m(a,b,c){b&&p(b).forEach(function(d){var e=b[d];a[d]=n(e,c)})}function n(a,b){var c=b.lookupProperty;return y.wrapHelper(a,function(a){return a.lookupProperty=c,a})}var o=c(78)["default"],p=c(60)["default"],q=c(3)["default"],r=c(1)["default"];b.__esModule=!0,b.checkRevision=d,b.template=e,b.wrapProgram=f,b.resolvePartial=g,b.invokePartial=h,b.noop=i;var s=c(5),t=q(s),u=c(6),v=r(u),w=c(4),x=c(10),y=c(81),z=c(73)},function(a,b,c){a.exports={"default":c(79),__esModule:!0}},function(a,b,c){c(80),a.exports=c(21).Object.seal},function(a,b,c){var d=c(40);c(64)("seal",function(a){return function(b){return a&&d(b)?a(b):b}})},function(a,b){"use strict";function c(a,b){if("function"!=typeof a)return a;var c=function(){var c=arguments[arguments.length-1];return arguments[arguments.length-1]=b(c),a.apply(this,arguments)};return c}b.__esModule=!0,b.wrapHelper=c},function(a,b){"use strict";b.__esModule=!0,b["default"]=function(a){!function(){"object"!=typeof globalThis&&(Object.prototype.__defineGetter__("__magic__",function(){return this}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)}();var b=globalThis.Handlebars;a.noConflict=function(){return globalThis.Handlebars===a&&(globalThis.Handlebars=b),a}},a.exports=b["default"]},function(a,b){"use strict";b.__esModule=!0;var c={helpers:{helperExpression:function(a){return"SubExpression"===a.type||("MustacheStatement"===a.type||"BlockStatement"===a.type)&&!!(a.params&&a.params.length||a.hash)},scopedId:function(a){return/^\.|this\b/.test(a.original)},simpleId:function(a){return 1===a.parts.length&&!c.helpers.scopedId(a)&&!a.depth}}};b["default"]=c,a.exports=b["default"]},function(a,b,c){"use strict";function d(a,b){if("Program"===a.type)return f(a),a;m["default"].yy=u,u.locInfo=function(a){return new u.SourceLocation(b&&b.srcName,a)};var c=m["default"].parse(a);return c}function e(a,b){var c=d(a,b),e=new o["default"](b);return e.accept(c)}function f(a){g(a)}function g(a){if(null!=a){if(Array.isArray(a))return void a.forEach(g);if("object"==typeof a){if("PathExpression"===a.type){if(!h(a.depth))throw new s["default"]("Invalid AST: PathExpression.depth must be an integer");if(!Array.isArray(a.parts))throw new s["default"]("Invalid AST: PathExpression.parts must be an array");for(var b=0;b<a.parts.length;b++)if("string"!=typeof a.parts[b])throw new s["default"]("Invalid AST: PathExpression.parts must only contain strings")}else if("NumberLiteral"===a.type){if("number"!=typeof a.value||!isFinite(a.value))throw new s["default"]("Invalid AST: NumberLiteral.value must be a number")}else if("BooleanLiteral"===a.type&&"boolean"!=typeof a.value)throw new s["default"]("Invalid AST: BooleanLiteral.value must be a boolean");i(a).forEach(function(b){"loc"!==b&&g(a[b])})}}}function h(a){return"number"==typeof a&&isFinite(a)&&Math.floor(a)===a&&a>=0}var i=c(60)["default"],j=c(1)["default"],k=c(3)["default"];b.__esModule=!0,b.parseWithoutProcessing=d,b.parse=e;var l=c(85),m=j(l),n=c(86),o=j(n),p=c(88),q=k(p),r=c(6),s=j(r),t=c(5);b.parser=m["default"];var u={};t.extend(u,q)},function(a,b){"use strict";b.__esModule=!0;var c=function(){function a(){this.yy={}}var b={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA",
12748
vendor: 7,910 bytes, line 12749
1274987:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,0],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function(a,b,c,d,e,f,g){var h=f.length-1;switch(e){case 1:return f[h-1];case 2:this.$=d.prepareProgram(f[h]);break;case 3:this.$=f[h];break;case 4:this.$=f[h];break;case 5:this.$=f[h];break;case 6:this.$=f[h];break;case 7:this.$=f[h];break;case 8:this.$=f[h];break;case 9:this.$={type:"CommentStatement",value:d.stripComment(f[h]),strip:d.stripFlags(f[h],f[h]),loc:d.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:f[h],value:f[h],loc:d.locInfo(this._$)};break;case 11:this.$=d.prepareRawBlock(f[h-2],f[h-1],f[h],this._$);break;case 12:this.$={path:f[h-3],params:f[h-2],hash:f[h-1]};break;case 13:this.$=d.prepareBlock(f[h-3],f[h-2],f[h-1],f[h],!1,this._$);break;case 14:this.$=d.prepareBlock(f[h-3],f[h-2],f[h-1],f[h],!0,this._$);break;case 15:this.$={open:f[h-5],path:f[h-4],params:f[h-3],hash:f[h-2],blockParams:f[h-1],strip:d.stripFlags(f[h-5],f[h])};break;case 16:this.$={path:f[h-4],params:f[h-3],hash:f[h-2],blockParams:f[h-1],strip:d.stripFlags(f[h-5],f[h])};break;case 17:this.$={path:f[h-4],params:f[h-3],hash:f[h-2],blockParams:f[h-1],strip:d.stripFlags(f[h-5],f[h])};break;case 18:this.$={strip:d.stripFlags(f[h-1],f[h-1]),program:f[h]};break;case 19:var i=d.prepareBlock(f[h-2],f[h-1],f[h],f[h],!1,this._$),j=d.prepareProgram([i],f[h-1].loc);j.chained=!0,this.$={strip:f[h-2].strip,program:j,chain:!0};break;case 20:this.$=f[h];break;case 21:this.$={path:f[h-1],strip:d.stripFlags(f[h-2],f[h])};break;case 22:this.$=d.prepareMustache(f[h-3],f[h-2],f[h-1],f[h-4],d.stripFlags(f[h-4],f[h]),this._$);break;case 23:this.$=d.prepareMustache(f[h-3],f[h-2],f[h-1],f[h-4],d.stripFlags(f[h-4],f[h]),this._$);break;case 24:this.$={type:"PartialStatement",name:f[h-3],params:f[h-2],hash:f[h-1],indent:"",strip:d.stripFlags(f[h-4],f[h]),loc:d.locInfo(this._$)};break;case 25:this.$=d.preparePartialBlock(f[h-2],f[h-1],f[h],this._$);break;case 26:this.$={path:f[h-3],params:f[h-2],hash:f[h-1],strip:d.stripFlags(f[h-4],f[h])};break;case 27:this.$=f[h];break;case 28:this.$=f[h];break;case 29:this.$={type:"SubExpression",path:f[h-3],params:f[h-2],hash:f[h-1],loc:d.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:f[h],loc:d.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:d.id(f[h-2]),value:f[h],loc:d.locInfo(this._$)};break;case 32:this.$=d.id(f[h-1]);break;case 33:this.$=f[h];break;case 34:this.$=f[h];break;case 35:this.$={type:"StringLiteral",value:f[h],original:f[h],loc:d.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(f[h]),original:Number(f[h]),loc:d.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:"true"===f[h],original:"true"===f[h],loc:d.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:d.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:d.locInfo(this._$)};break;case 40:this.$=f[h];break;case 41:this.$=f[h];break;case 42:this.$=d.preparePath(!0,f[h],this._$);break;case 43:this.$=d.preparePath(!1,f[h],this._$);break;case 44:f[h-2].push({part:d.id(f[h]),original:f[h],separator:f[h-1]}),this.$=f[h-2];break;case 45:this.$=[{part:d.id(f[h]),original:f[h]}];break;case 46:this.$=[];break;case 47:f[h-1].push(f[h]);break;case 48:this.$=[];break;case 49:f[h-1].push(f[h]);break;case 50:this.$=[];break;case 51:f[h-1].push(f[h]);break;case 58:this.$=[];break;case 59:f[h-1].push(f[h]);break;case 64:this.$=[];break;case 65:f[h-1].push(f[h]);break;case 70:this.$=[];break;case 71:f[h-1].push(f[h]);break;case 78:this.$=[];break;case 79:f[h-1].push(f[h]);break;case 82:this.$=[];break;case 83:f[h-1].push(f[h]);break;case 86:this.$=[];break;case 87:f[h-1].push(f[h]);break;case 90:this.$=[];break;case 91:f[h-1].push(f[h]);break;case 94:this.$=[];break;case 95:f[h-1].push(f[h]);break;case 98:this.$=[f[h]];break;case 99:f[h-1].push(f[h]);break;case 100:this.$=[f[h]];break;case 101:f[h-1].push(f[h])}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{15:[2,48],17:39,18:[2,48]},{20:41,56:40,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:44,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:45,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:41,56:48,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:49,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37
vendor: 4,114 bytes, line 12749
12749],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,50]},{72:[1,35],86:51},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:52,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:53,38:55,39:[1,57],43:56,44:[1,58],45:54,47:[2,54]},{28:59,43:60,44:[1,58],47:[2,56]},{13:62,15:[1,20],18:[1,61]},{33:[2,86],57:63,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:64,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:65,47:[1,66]},{30:67,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:68,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:69,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:70,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:74,33:[2,80],50:71,63:72,64:75,65:[1,43],69:73,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,79]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,50]},{20:74,53:80,54:[2,84],63:81,64:75,65:[1,43],69:82,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:83,47:[1,66]},{47:[2,55]},{4:84,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:85,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:86,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:87,47:[1,66]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:74,33:[2,88],58:88,63:89,64:75,65:[1,43],69:90,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:91,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:92,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,31:93,33:[2,60],63:94,64:75,65:[1,43],69:95,70:76,71:77,72:[1,78],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,66],36:96,63:97,64:75,65:[1,43],69:98,70:76,71:77,72:[1,78],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,22:99,23:[2,52],63:100,64:75,65:[1,43],69:101,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,92],62:102,63:103,64:75,65:[1,43],69:104,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,105]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]}
vendor: 19,993 bytes, line 12749
12749,{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:106,72:[1,107],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,108],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,109]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:55,39:[1,57],43:56,44:[1,58],45:111,46:110,47:[2,76]},{33:[2,70],40:112,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,113]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:74,63:115,64:75,65:[1,43],67:114,68:[2,96],69:116,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,117]},{32:118,33:[2,62],74:119,75:[1,120]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:121,74:122,75:[1,120]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,123]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,124]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,108]},{20:74,63:125,64:75,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:74,33:[2,72],41:126,63:127,64:75,65:[1,43],69:128,70:76,71:77,72:[1,78],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,129]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,130]},{33:[2,63]},{72:[1,132],76:131},{33:[1,133]},{33:[2,69]},{15:[2,12],18:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:134,74:135,75:[1,120]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,137],77:[1,136]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,138]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],54:[2,55],56:[2,20],60:[2,57],73:[2,81],82:[2,85],86:[2,18],90:[2,89],101:[2,53],104:[2,93],110:[2,19],111:[2,77],116:[2,97],119:[2,63],122:[2,69],135:[2,75],136:[2,32]},parseError:function(a,b){throw new Error(a)},parse:function(a){function b(){var a;return a=c.lexer.lex()||1,"number"!=typeof a&&(a=c.symbols_[a]||a),a}var c=this,d=[0],e=[null],f=[],g=this.table,h="",i=0,j=0,k=0;this.lexer.setInput(a),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,"undefined"==typeof this.lexer.yylloc&&(this.lexer.yylloc={});var l=this.lexer.yylloc;f.push(l);var m=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var n,o,p,q,r,s,t,u,v,w={};;){if(p=d[d.length-1],this.defaultActions[p]?q=this.defaultActions[p]:(null!==n&&"undefined"!=typeof n||(n=b()),q=g[p]&&g[p][n]),"undefined"==typeof q||!q.length||!q[0]){var x="";if(!k){v=[];for(s in g[p])this.terminals_[s]&&s>2&&v.push("'"+this.terminals_[s]+"'");x=this.lexer.showPosition?"Parse error on line "+(i+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[n]||n)+"'":"Parse error on line "+(i+1)+": Unexpected "+(1==n?"end of input":"'"+(this.terminals_[n]||n)+"'"),this.parseError(x,{text:this.lexer.match,token:this.terminals_[n]||n,line:this.lexer.yylineno,loc:l,expected:v})}}if(q[0]instanceof Array&&q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+p+", token: "+n);switch(q[0]){case 1:d.push(n),e.push(this.lexer.yytext),f.push(this.lexer.yylloc),d.push(q[1]),n=null,o?(n=o,o=null):(j=this.lexer.yyleng,h=this.lexer.yytext,i=this.lexer.yylineno,l=this.lexer.yylloc,k>0&&k--);break;case 2:if(t=this.productions_[q[1]][1],w.$=e[e.length-t],w._$={first_line:f[f.length-(t||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(t||1)].first_column,last_column:f[f.length-1].last_column},m&&(w._$.range=[f[f.length-(t||1)].range[0],f[f.length-1].range[1]]),r=this.performAction.call(w,h,j,i,this.yy,q[1],e,f),"undefined"!=typeof r)return r;t&&(d=d.slice(0,-1*t*2),e=e.slice(0,-1*t),f=f.slice(0,-1*t)),d.push(this.productions_[q[1]][0]),e.push(w.$),f.push(w._$),u=g[d[d.length-2]][d[d.length-1]],d.push(u);break;case 3:return!0}}return!0}},c=function(){var a={EOF:1,parseError:function(a,b){if(!this.yy.parser)throw new Error(a);this.yy.parser.parseError(a,b)},setInput:function(a){return this._input=a,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var b=a.match(/(?:\r\n?|\n).*/g);return b?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},unput:function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b-1),this.offset-=b;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var e=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this},more:function(){return this._more=!0,this},less:function(a){this.unput(this.match.slice(a))},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var a=this.pastInput(),b=new Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,b,c,d,e;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),g=0;g<f.length&&(c=this._input.match(this.rules[f[g]]),!c||b&&!(c[0].length>b[0].length)||(b=c,d=g,this.options.flex));g++);return b?(e=b[0].match(/(?:\r\n?|\n).*/g),e&&(this.yylineno+=e.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:e?e[e.length-1].length-e[e.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],a=this.performAction.call(this,this.yy,this,f[d],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a?a:void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var a=this.next();return"undefined"!=typeof a?a:this.lex()},begin:function(a){this.conditionStack.push(a)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(a){this.begin(a)}};return a.options={},a.performAction=function(a,b,c,d){function e(a,c){return b.yytext=b.yytext.substring(a,b.yyleng-c+a)}switch(c){case 0:if("\\\\"===b.yytext.slice(-2)?(e(0,1),this.begin("mu")):"\\"===b.yytext.slice(-1)?(e(0,1),this.begin("emu")):this.begin("mu"),b.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;case 3:return this.begin("raw"),15;case 4:return this.popState(),"raw"===this.conditionStack[this.conditionStack.length-1]?15:(e(5,9),"END_RAW_BLOCK");case 5:return 15;case 6:return this.popState(),14;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;case 16:return this.popState(),44;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(b.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;case 30:return this.popState(),33;case 31:return b.yytext=e(1,2).replace(/\\"/g,'"'),80;case 32:return b.yytext=e(1,2).replace(/\\'/g,"'"),80;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return b.yytext=b.yytext.replace(/\\([\\\]])/g,"$1"),72;case 43:return"INVALID";case 44:return 5}},a.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^\/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],a.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},a}();return b.lexer=c,a.prototype=b,b.Parser=a,new a}();b["default"]=c,a.exports=b["default"]},function(a,b,c){"use strict";function d(){var a=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.options=a}function e(a,b,c){void 0===b&&(b=a.length);var d=a[b-1],e=a[b-2];return d?"ContentStatement"===d.type?(e||!c?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(d.original):void 0:c}function f(a,b,c){void 0===b&&(b=-1);var d=a[b+1],e=a[b+2];return d?"ContentStatement"===d.type?(e||!c?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(d.original):void 0:c}function g(a,b,c){var d=a[null==b?0:b+1];if(d&&"ContentStatement"===d.type&&(c||!d.rightStripped)){var e=d.value;d.value=d.value.replace(c?/^\s+/:/^[ \t]*\r?\n?/,""),d.rightStripped=d.value!==e}}function h(a,b,c){var d=a[null==b?a.length-1:b-1];if(d&&"ContentStatement"===d.type&&(c||!d.leftStripped)){var e=d.value;return d.value=d.value.replace(c?/\s+$/:/[ \t]+$/,""),d.leftStripped=d.value!==e,d.leftStripped}}var i=c(1)["default"];b.__esModule=!0;var j=c(87),k=i(j);d.prototype=new k["default"],d.prototype.Program=function(a){var b=!this.options.ignoreStandalone,c=!this.isRootSeen;this.isRootSeen=!0;for(var d=a.body,i=0,j=d.length;i<j;i++){var k=d[i],l=this.accept(k);if(l){var m=e(d,i,c),n=f(d,i,c),o=l.openStandalone&&m,p=l.closeStandalone&&n,q=l.inlineStandalone&&m&&n;l.close&&g(d,i,!0),l.open&&h(d,i,!0),b&&q&&(g(d,i),h(d,i)&&"PartialStatement"===k.type&&(k.indent=/([ \t]+$)/.exec(d[i-1].original)[1])),b&&o&&(g((k.program||k.inverse).body),h(d,i)),b&&p&&(g(d,i),h((k.inverse||k.program).body))}}return a},d.prototype.BlockStatement=d.prototype.DecoratorBlock=d.prototype.PartialBlockStatement=function(a){this.accept(a.program),this.accept(a.inverse);var b=a.program||a.inverse,c=a.program&&a.inverse,d=c,i=c;if(c&&c.chained)for(d=c.body[0].program;i.chained;)i=i.body[i.body.length-1].program;var j={open:a.openStrip.open,close:a.closeStrip.close,openStandalone:f(b.body),closeStandalone:e((d||b).body)};if(a.openStrip.close&&g(b.body,null,!0),c){var k=a.inverseStrip;k.open&&h(b.body,null,!0),k.close&&g(d.body,null,!0),a.closeStrip.open&&h(i.body,null,!0),!this.options.ignoreStandalone&&e(b.body)&&f(d.body)&&(h(b.body),g(d.body))}else a.closeStrip.open&&h(b.body,null,!0);return j},d.prototype.Decorator=d.prototype.MustacheStatement=function(a){return a.strip},d.prototype.PartialStatement=d.prototype.CommentStatement=function(a){var b=a.strip||{};return{inlineStandalone:!0,open:b.open,close:b.close}},b["default"]=d,a.exports=b["default"]},function(a,b,c){"use strict";function d(){this.parents=[]}function e(a){this.acceptRequired(a,"path"),this.acceptArray(a.params),this.acceptKey(a,"hash")}function f(a){e.call(this,a),this.acceptKey(a,"program"),this.acceptKey(a,"inverse")}function g(a){this.acceptRequired(a,"name"),this.acceptArray(a.params),this.acceptKey(a,"hash")}var h=c(1)["default"];b.__esModule=!0;var i=c(6),j=h(i);d.prototype={constructor:d,mutating:!1,acceptKey:function(a,b){var c=this.accept(a[b]);if(this.mutating){if(c&&!d.prototype[c.type])throw new j["default"]('Unexpected node type "'+c.type+'" found when accepting '+b+" on "+a.type);a[b]=c}},acceptRequired:function(a,b){if(this.acceptKey(a,b),!a[b])throw new j["default"](a.type+" requires "+b)},acceptArray:function(a){for(var b=0,c=a.length;b<c;b++)this.acceptKey(a,b),a[b]||(a.splice(b,1),b--,c--)},accept:function(a){if(a){if(!this[a.type])throw new j["default"]("Unknown type: "+a.type,a);this.current&&this.parents.unshift(this.current),this.current=a;var b=this[a.type](a);return this.current=this.parents.shift(),!this.mutating||b?b:b!==!1?a:void 0}},Program:function(a){this.acceptArray(a.body)},MustacheStatement:e,Decorator:e,BlockStatement:f,DecoratorBlock:f,PartialStatement:g,PartialBlockStatement:function(a){g.call(this,a),this.acceptKey(a,"program")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:e,PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},UndefinedLiteral:function(){},NullLiteral:function(){},Hash:function(a){this.acceptArray(a.pairs)},HashPair:function(a){this.acceptRequired(a,"value")}},b["default"]=d,a.exports=b["default"]},function(a,b,c){"use strict";function d(a,b){if(b=b.path?b.path.original:b,a.path.original!==b){var c={loc:a.path.loc};throw new q["default"](a.path.original+" doesn't match "+b,c)}}function e(a,b){this.source=a,this.start={line:b.first_line,column:b.first_column},this.end={line:b.last_line,column:b.last_column}}function f(a){return/^\[.*\]$/.test(a)?a.substring(1,a.length-1):a}function g(a,b){return{open:"~"===a.charAt(2),close:"~"===b.charAt(b.length-3)}}function h(a){return a.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function i(a,b,c){c=this.locInfo(c);for(var d=a?"@":"",e=[],f=0,g=0,h=b.length;g<h;g++){var i=b[g].part,j=b[g].original!==i;if(d+=(b[g].separator||"")+i,j||".."!==i&&"."!==i&&"this"!==i)e.push(i);else{if(e.length>0)throw new q["default"]("Invalid path: "+d,{loc:c});".."===i&&f++}}return{type:"PathExpression",data:a,depth:f,parts:e,original:d,loc:c}}function j(a,b,c,d,e,f){var g=d.charAt(3)||d.charAt(2),h="{"!==g&&"&"!==g,i=/\*/.test(d);return{type:i?"Decorator":"MustacheStatement",path:a,params:b,hash:c,escaped:h,strip:e,loc:this.locInfo(f)}}function k(a,b,c,e){d(a,c),e=this.locInfo(e);var f={type:"Program",body:b,strip:{},loc:e};return{type:"BlockStatement",path:a.path,params:a.params,hash:a.hash,program:f,openStrip:{},inverseStrip:{},closeStrip:{},loc:e}}function l(a,b,c,e,f,g){e&&e.path&&d(a,e);var h=/\*/.test(a.open);b.blockParams=a.blockParams;var i=void 0,j=void 0;if(c){if(h)throw new q["default"]("Unexpected inverse block on decorator",c);c.chain&&(c.program.body[0].closeStrip=e.strip),j=c.strip,i=c.program}return f&&(f=i,i=b,b=f),{type:h?"DecoratorBlock":"BlockStatement",path:a.path,params:a.params,hash:a.hash,program:b,inverse:i,openStrip:a.strip,inverseStrip:j,closeStrip:e&&e.strip,loc:this.locInfo(g)}}function m(a,b){if(!b&&a.length){var c=a[0].loc,d=a[a.length-1].loc;c&&d&&(b={source:c.source,start:{line:c.start.line,column:c.start.column},end:{line:d.end.line,column:d.end.column}})}return{type:"Program",body:a,strip:{},loc:b}}function n(a,b,c,e){return d(a,c),{type:"PartialBlockStatement",name:a.path,params:a.params,hash:a.hash,program:b,openStrip:a.strip,closeStrip:c&&c.strip,loc:this.locInfo(e)}}var o=c(1)["default"];b.__esModule=!0,b.SourceLocation=e,b.id=f,b.stripFlags=g,b.stripComment=h,b.preparePath=i,b.prepareMustache=j,b.prepareRawBlock=k,b.prepareBlock=l,b.prepareProgram=m,b.preparePartialBlock=n;var p=c(6),q=o(p)},function(a,b,c){"use strict";function d(){}function e(a,b,c){if(null==a||"string"!=typeof a&&"Program"!==a.type)throw new l["default"]("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+a);b=b||{},"data"in b||(b.data=!0),b.compat&&(b.useDepths=!0);var d=c.parse(a,b),e=(new c.Compiler).compile(d,b);return(new c.JavaScriptCompiler).compile(e,b)}function f(a,b,c){function d(){var d=c.parse(a,b),e=(new c.Compiler).compile(d,b),f=(new c.JavaScriptCompiler).compile(e,b,void 0,!0);return c.template(f)}function e(a,b){return f||(f=d()),f.call(this,a,b)}if(void 0===b&&(b={}),null==a||"string"!=typeof a&&"Program"!==a.type)throw new l["default"]("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+a);b=m.extend({},b),"data"in b||(b.data=!0),b.compat&&(b.useDepths=!0);var f=void 0;return e._setup=function(a){return f||(f=d()),f._setup(a)},e._child=function(a,b,c,e){return f||(f=d()),
12749�
vendor: 24,250 bytes, lines 12749-12750
12749
12750f._child(a,b,c,e)},e}function g(a,b){if(a===b)return!0;if(m.isArray(a)&&m.isArray(b)&&a.length===b.length){for(var c=0;c<a.length;c++)if(!g(a[c],b[c]))return!1;return!0}}function h(a){if(!a.path.parts){var b=a.path;a.path={type:"PathExpression",data:!1,depth:0,parts:[b.original+""],original:b.original+"",loc:b.loc}}}var i=c(74)["default"],j=c(1)["default"];b.__esModule=!0,b.Compiler=d,b.precompile=e,b.compile=f;var k=c(6),l=j(k),m=c(5),n=c(83),o=j(n),p=[].slice;d.prototype={compiler:d,equals:function(a){var b=this.opcodes.length;if(a.opcodes.length!==b)return!1;for(var c=0;c<b;c++){var d=this.opcodes[c],e=a.opcodes[c];if(d.opcode!==e.opcode||!g(d.args,e.args))return!1}b=this.children.length;for(var c=0;c<b;c++)if(!this.children[c].equals(a.children[c]))return!1;return!0},guid:0,compile:function(a,b){return this.sourceNode=[],this.opcodes=[],this.children=[],this.options=b,this.stringParams=b.stringParams,this.trackIds=b.trackIds,b.blockParams=b.blockParams||[],b.knownHelpers=m.extend(i(null),{helperMissing:!0,blockHelperMissing:!0,each:!0,"if":!0,unless:!0,"with":!0,log:!0,lookup:!0},b.knownHelpers),this.accept(a)},compileProgram:function(a){var b=new this.compiler,c=b.compile(a,this.options),d=this.guid++;return this.usePartial=this.usePartial||c.usePartial,this.children[d]=c,this.useDepths=this.useDepths||c.useDepths,d},accept:function(a){if(!this[a.type])throw new l["default"]("Unknown type: "+a.type,a);this.sourceNode.unshift(a);var b=this[a.type](a);return this.sourceNode.shift(),b},Program:function(a){this.options.blockParams.unshift(a.blockParams);for(var b=a.body,c=b.length,d=0;d<c;d++)this.accept(b[d]);return this.options.blockParams.shift(),this.isSimple=1===c,this.blockParams=a.blockParams?a.blockParams.length:0,this},BlockStatement:function(a){h(a);var b=a.program,c=a.inverse;b=b&&this.compileProgram(b),c=c&&this.compileProgram(c);var d=this.classifySexpr(a);"helper"===d?this.helperSexpr(a,b,c):"simple"===d?(this.simpleSexpr(a),this.opcode("pushProgram",b),this.opcode("pushProgram",c),this.opcode("emptyHash"),this.opcode("blockValue",a.path.original)):(this.ambiguousSexpr(a,b,c),this.opcode("pushProgram",b),this.opcode("pushProgram",c),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},DecoratorBlock:function(a){var b=a.program&&this.compileProgram(a.program),c=this.setupFullMustacheParams(a,b,void 0),d=a.path;this.useDecorators=!0,this.opcode("registerDecorator",c.length,d.original)},PartialStatement:function(a){this.usePartial=!0;var b=a.program;b&&(b=this.compileProgram(a.program));var c=a.params;if(c.length>1)throw new l["default"]("Unsupported number of partial arguments: "+c.length,a);c.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):c.push({type:"PathExpression",parts:[],depth:0}));var d=a.name.original,e="SubExpression"===a.name.type;e&&this.accept(a.name),this.setupFullMustacheParams(a,b,void 0,!0);var f=a.indent||"";this.options.preventIndent&&f&&(this.opcode("appendContent",f),f=""),this.opcode("invokePartial",e,d,f),this.opcode("append")},PartialBlockStatement:function(a){this.PartialStatement(a)},MustacheStatement:function(a){this.SubExpression(a),a.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function(a){this.DecoratorBlock(a)},ContentStatement:function(a){a.value&&this.opcode("appendContent",a.value)},CommentStatement:function(){},SubExpression:function(a){h(a);var b=this.classifySexpr(a);"simple"===b?this.simpleSexpr(a):"helper"===b?this.helperSexpr(a):this.ambiguousSexpr(a)},ambiguousSexpr:function(a,b,c){var d=a.path,e=d.parts[0],f=null!=b||null!=c;this.opcode("getContext",d.depth),this.opcode("pushProgram",b),this.opcode("pushProgram",c),d.strict=!0,this.accept(d),this.opcode("invokeAmbiguous",e,f)},simpleSexpr:function(a){var b=a.path;b.strict=!0,this.accept(b),this.opcode("resolvePossibleLambda")},helperSexpr:function(a,b,c){var d=this.setupFullMustacheParams(a,b,c),e=a.path,f=e.parts[0];if(this.options.knownHelpers[f])this.opcode("invokeKnownHelper",d.length,f);else{if(this.options.knownHelpersOnly)throw new l["default"]("You specified knownHelpersOnly, but used the unknown helper "+f,a);e.strict=!0,e.falsy=!0,this.accept(e),this.opcode("invokeHelper",d.length,e.original,o["default"].helpers.simpleId(e))}},PathExpression:function(a){this.addDepth(a.depth),this.opcode("getContext",a.depth);var b=a.parts[0],c=o["default"].helpers.scopedId(a),d=!a.depth&&!c&&this.blockParamIndex(b);d?this.opcode("lookupBlockParam",d,a.parts):b?a.data?(this.options.data=!0,this.opcode("lookupData",a.depth,a.parts,a.strict)):this.opcode("lookupOnContext",a.parts,a.falsy,a.strict,c):this.opcode("pushContext")},StringLiteral:function(a){this.opcode("pushString",a.value)},NumberLiteral:function(a){this.opcode("pushLiteral",a.value)},BooleanLiteral:function(a){this.opcode("pushLiteral",a.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(a){var b=a.pairs,c=0,d=b.length;for(this.opcode("pushHash");c<d;c++)this.pushParam(b[c].value);for(;c--;)this.opcode("assignToHash",b[c].key);this.opcode("popHash")},opcode:function(a){this.opcodes.push({opcode:a,args:p.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(a){a&&(this.useDepths=!0)},classifySexpr:function(a){var b=o["default"].helpers.simpleId(a.path),c=b&&!!this.blockParamIndex(a.path.parts[0]),d=!c&&o["default"].helpers.helperExpression(a),e=!c&&(d||b);if(e&&!d){var f=a.path.parts[0],g=this.options;g.knownHelpers[f]?d=!0:g.knownHelpersOnly&&(e=!1)}return d?"helper":e?"ambiguous":"simple"},pushParams:function(a){for(var b=0,c=a.length;b<c;b++)this.pushParam(a[b])},pushParam:function(a){var b=null!=a.value?a.value:a.original||"";if(this.stringParams)b.replace&&(b=b.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".")),a.depth&&this.addDepth(a.depth),this.opcode("getContext",a.depth||0),this.opcode("pushStringParam",b,a.type),"SubExpression"===a.type&&this.accept(a);else{if(this.trackIds){var c=void 0;if(!a.parts||o["default"].helpers.scopedId(a)||a.depth||(c=this.blockParamIndex(a.parts[0])),c){var d=a.parts.slice(1).join(".");this.opcode("pushId","BlockParam",c,d)}else b=a.original||b,b.replace&&(b=b.replace(/^this(?:\.|$)/,"").replace(/^\.\//,"").replace(/^\.$/,"")),this.opcode("pushId",a.type,b)}this.accept(a)}},setupFullMustacheParams:function(a,b,c,d){var e=a.params;return this.pushParams(e),this.opcode("pushProgram",b),this.opcode("pushProgram",c),a.hash?this.accept(a.hash):this.opcode("emptyHash",d),e},blockParamIndex:function(a){for(var b=0,c=this.options.blockParams.length;b<c;b++){var d=this.options.blockParams[b],e=d&&m.indexOf(d,a);if(d&&e>=0)return[b,e]}}}},function(a,b,c){"use strict";function d(a){this.value=a}function e(){}function f(a,b,c,d,e){var f=b.popStack(),g=c.length;a&&g--;for(var h=d;h<g;h++)f=b.nameLookup(f,c[h],e);return a?[b.aliasable("container.strict"),"(",f,", ",b.quotedString(c[g]),", ",JSON.stringify(b.source.currentLocation)," )"]:f}var g=c(60)["default"],h=c(1)["default"];b.__esModule=!0;var i=c(4),j=c(6),k=h(j),l=c(5),m=c(91),n=h(m);e.prototype={nameLookup:function(a,b){return this.internalNameLookup(a,b)},depthedLookup:function(a){return[this.aliasable("container.lookup"),"(depths, ",JSON.stringify(a),")"]},compilerInfo:function(){var a=i.COMPILER_REVISION,b=i.REVISION_CHANGES[a];return[a,b]},appendToBuffer:function(a,b,c){return l.isArray(a)||(a=[a]),a=this.source.wrap(a,b),this.environment.isSimple?["return ",a,";"]:c?["buffer += ",a,";"]:(a.appendToBuffer=!0,a)},initializeBuffer:function(){return this.quotedString("")},internalNameLookup:function(a,b){return this.lookupPropertyFunctionIsUsed=!0,["lookupProperty(",a,",",JSON.stringify(b),")"]},lookupPropertyFunctionIsUsed:!1,compile:function(a,b,c,d){this.environment=a,this.options=b,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!d,this.name=this.environment.name,this.isChild=!!c,this.context=c||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(a,b),this.useDepths=this.useDepths||a.useDepths||a.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||a.useBlockParams;var e=a.opcodes,f=void 0,g=void 0,h=void 0,i=void 0;for(h=0,i=e.length;h<i;h++)f=e[h],this.source.currentLocation=f.loc,g=g||f.loc,this[f.opcode].apply(this,f.args);if(this.source.currentLocation=g,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new k["default"]("Compile completed with content left on stack");this.decorators.isEmpty()?this.decorators=void 0:(this.useDecorators=!0,this.decorators.prepend(["var decorators = container.decorators, ",this.lookupPropertyFunctionVarDeclaration(),";\n"]),this.decorators.push("return fn;"),d?this.decorators=Function.apply(this,["fn","props","container","depth0","data","blockParams","depths",this.decorators.merge()]):(this.decorators.prepend("function(fn, props, container, depth0, data, blockParams, depths) {\n"),this.decorators.push("}\n"),this.decorators=this.decorators.merge()));var j=this.createFunctionContext(d);if(this.isChild)return j;var l={compiler:this.compilerInfo(),main:j};this.decorators&&(l.main_d=this.decorators,l.useDecorators=!0);var m=this.context,n=m.programs,o=m.decorators;for(h=0,i=n.length;h<i;h++)l[h]=n[h],o[h]&&(l[h+"_d"]=o[h],l.useDecorators=!0);return this.environment.usePartial&&(l.usePartial=!0),this.options.data&&(l.useData=!0),this.useDepths&&(l.useDepths=!0),this.useBlockParams&&(l.useBlockParams=!0),this.options.compat&&(l.compat=!0),d?l.compilerOptions=this.options:(l.compiler=JSON.stringify(l.compiler),this.source.currentLocation={start:{line:1,column:0}},l=this.objectLiteral(l),b.srcName?(l=l.toStringWithSourceMap({file:b.destName}),l.map=l.map&&l.map.toString()):l=l.toString()),l},preamble:function(){this.lastContext=0,this.source=new n["default"](this.options.srcName),this.decorators=new n["default"](this.options.srcName)},createFunctionContext:function(a){var b=this,c="",d=this.stackVars.concat(this.registers.list);d.length>0&&(c+=", "+d.join(", "));var e=0;g(this.aliases).forEach(function(a){var d=b.aliases[a];d.children&&d.referenceCount>1&&(c+=", alias"+ ++e+"="+a,d.children[0]="alias"+e)}),this.lookupPropertyFunctionIsUsed&&(c+=", "+this.lookupPropertyFunctionVarDeclaration());var f=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&f.push("blockParams"),this.useDepths&&f.push("depths");var h=this.mergeSource(c);return a?(f.push(h),Function.apply(this,f)):this.source.wrap(["function(",f.join(","),") {\n  ",h,"}"])},mergeSource:function(a){var b=this.environment.isSimple,c=!this.forceBuffer,d=void 0,e=void 0,f=void 0,g=void 0;return this.source.each(function(a){a.appendToBuffer?(f?a.prepend("  + "):f=a,g=a):(f&&(e?f.prepend("buffer += "):d=!0,g.add(";"),f=g=void 0),e=!0,b||(c=!1))}),c?f?(f.prepend("return "),g.add(";")):e||this.source.push('return "";'):(a+=", buffer = "+(d?"":this.initializeBuffer()),f?(f.prepend("return buffer + "),g.add(";")):this.source.push("return buffer;")),a&&this.source.prepend("var "+a.substring(2)+(d?"":";\n")),this.source.merge()},lookupPropertyFunctionVarDeclaration:function(){return"\n      lookupProperty = container.lookupProperty || function(parent, propertyName) {\n        if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n          return parent[propertyName];\n        }\n        return undefined\n    }\n    ".trim()},blockValue:function(a){var b=this.aliasable("container.hooks.blockHelperMissing"),c=[this.contextName(0)];this.setupHelperArgs(a,0,c);var d=this.popStack();c.splice(1,0,d),this.push(this.source.functionCall(b,"call",c))},ambiguousBlockValue:function(){var a=this.aliasable("container.hooks.blockHelperMissing"),b=[this.contextName(0)];this.setupHelperArgs("",0,b,!0),this.flushInline();var c=this.topStack();b.splice(1,0,c),this.pushSource(["if (!",this.lastHelper,") { ",c," = ",this.source.functionCall(a,"call",b),"}"])},appendContent:function(a){this.pendingContent?a=this.pendingContent+a:this.pendingLocation=this.source.currentLocation,this.pendingContent=a},append:function(){if(this.isInline())this.replaceStack(function(a){return[" != null ? ",a,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var a=this.popStack();this.pushSource(["if (",a," != null) { ",this.appendToBuffer(a,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(a){this.lastContext=a},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(a,b,c,d){var e=0;d||!this.options.compat||this.lastContext?this.pushContext():this.push(this.depthedLookup(a[e++])),this.resolvePath("context",a,e,b,c)},lookupBlockParam:function(a,b){this.useBlockParams=!0,this.push(["blockParams[",a[0],"][",a[1],"]"]),this.resolvePath("context",b,1)},lookupData:function(a,b,c){a?this.pushStackLiteral("container.data(data, "+a+")"):this.pushStackLiteral("data"),this.resolvePath("data",b,0,!0,c)},resolvePath:function(a,b,c,d,e){var g=this;if(this.options.strict||this.options.assumeObjects)return void this.push(f(this.options.strict&&e,this,b,c,a));for(var h=b.length,i=function(c){g.replaceStack(function(e){var f=g.nameLookup(e,b[c],a);return d?[" && ",f]:[" != null ? ",f," : ",e]})},j=c;j<h;j++)i(j)},resolvePossibleLambda:function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function(a,b){this.pushContext(),this.pushString(b),"SubExpression"!==b&&("string"==typeof a?this.pushString(a):this.pushStackLiteral(a))},emptyHash:function(a){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(a?"undefined":"{}")},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:{},types:[],contexts:[],ids:[]}},popHash:function(){var a=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(a.ids)),this.stringParams&&(this.push(this.objectLiteral(a.contexts)),this.push(this.objectLiteral(a.types))),this.push(this.objectLiteral(a.values))},pushString:function(a){this.pushStackLiteral(this.quotedString(a))},pushLiteral:function(a){this.pushStackLiteral(a)},pushProgram:function(a){null!=a?this.pushStackLiteral(this.programExpression(a)):this.pushStackLiteral(null)},registerDecorator:function(a,b){var c=this.nameLookup("decorators",b,"decorator"),d=this.setupHelperArgs(b,a);this.decorators.push(["var decorator = ",c,";"]),this.decorators.push(['if (typeof decorator !== "function") { throw new Error(',this.quotedString('Missing decorator: "'+b+'"'),"); }"]),this.decorators.push(["fn = ",this.decorators.functionCall("decorator","",["fn","props","container",d])," || fn;"])},invokeHelper:function(a,b,c){var d=this.popStack(),e=this.setupHelper(a,b),f=[];c&&f.push(e.name),f.push(d),this.options.strict||f.push(this.aliasable("container.hooks.helperMissing"));var g=["(",this.itemsSeparatedBy(f,"||"),")"],h=this.source.functionCall(g,"call",e.callParams);this.push(h)},itemsSeparatedBy:function(a,b){var c=[];c.push(a[0]);for(var d=1;d<a.length;d++)c.push(b,a[d]);return c},invokeKnownHelper:function(a,b){var c=this.setupHelper(a,b);this.push(this.source.functionCall(c.name,"call",c.callParams))},invokeAmbiguous:function(a,b){this.useRegister("helper");var c=this.popStack();this.emptyHash();var d=this.setupHelper(0,a,b),e=this.lastHelper=this.nameLookup("helpers",a,"helper"),f=["(","(helper = ",e," || ",c,")"];this.options.strict||(f[0]="(helper = ",f.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"))),this.push(["(",f,d.paramsInit?["),(",d.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",d.callParams)," : helper))"])},invokePartial:function(a,b,c){var d=[],e=this.setupParams(b,1,d);a&&(b=this.popStack(),delete e.name),c&&(e.indent=JSON.stringify(c)),e.helpers="helpers",e.partials="partials",e.decorators="container.decorators",a?d.unshift(b):d.unshift(this.nameLookup("partials",b,"partial")),this.options.compat&&(e.depths="depths"),e=this.objectLiteral(e),d.push(e),this.push(this.source.functionCall("container.invokePartial","",d))},assignToHash:function(a){var b=this.popStack(),c=void 0,d=void 0,e=void 0;this.trackIds&&(e=this.popStack()),this.stringParams&&(d=this.popStack(),c=this.popStack());var f=this.hash;c&&(f.contexts[a]=c),d&&(f.types[a]=d),e&&(f.ids[a]=e),f.values[a]=b},pushId:function(a,b,c){"BlockParam"===a?this.pushStackLiteral("blockParams["+b[0]+"].path["+b[1]+"]"+(c?" + "+JSON.stringify("."+c):"")):"PathExpression"===a?this.pushString(b):"SubExpression"===a?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:e,compileChildren:function(a,b){for(var c=a.children,d=void 0,e=void 0,f=0,g=c.length;f<g;f++){d=c[f],e=new this.compiler;var h=this.matchExistingProgram(d);if(null==h){var i=this.context.programs.push("")-1;d.index=i,d.name="program"+i,this.context.programs[i]=e.compile(d,b,this.context,!this.precompile),this.context.decorators[i]=e.decorators,this.context.environments[i]=d,this.useDepths=this.useDepths||e.useDepths,this.useBlockParams=this.useBlockParams||e.useBlockParams,d.useDepths=this.useDepths,d.useBlockParams=this.useBlockParams}else d.index=h.index,d.name="program"+h.index,this.useDepths=this.useDepths||h.useDepths,this.useBlockParams=this.useBlockParams||h.useBlockParams}},matchExistingProgram:function(a){for(var b=0,c=this.context.environments.length;b<c;b++){var d=this.context.environments[b];if(d&&d.equals(a))return d}},programExpression:function(a){var b=this.environment.children[a],c=[b.index,"data",b.blockParams];return(this.useBlockParams||this.useDepths)&&c.push("blockParams"),this.useDepths&&c.push("depths"),"container.program("+c.join(", ")+")"},useRegister:function(a){this.registers[a]||(this.registers[a]=!0,this.registers.list.push(a))},push:function(a){return a instanceof d||(a=this.source.wrap(a)),this.inlineStack.push(a),a},pushStackLiteral:function(a){this.push(new d(a))},pushSource:function(a){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),a&&this.source.push(a)},replaceStack:function(a){var b=["("],c=void 0,e=void 0,f=void 0;if(!this.isInline())throw new k["default"]("replaceStack on non-inline");var g=this.popStack(!0);if(g instanceof d)c=[g.value],b=["(",c],f=!0;else{e=!0;var h=this.incrStack();b=["((",this.push(h)," = ",g,")"],c=this.topStack()}var i=a.call(this,c);f||this.popStack(),e&&this.stackSlot--,this.push(b.concat(i,")"))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var a=this.inlineStack;this.inlineStack=[];for(var b=0,c=a.length;b<c;b++){var e=a[b];if(e instanceof d)this.compileStack.push(e);else{var f=this.incrStack();this.pushSource([f," = ",e,";"]),this.compileStack.push(f)}}},isInline:function(){return this.inlineStack.length},popStack:function(a){var b=this.isInline(),c=(b?this.inlineStack:this.compileStack).pop();if(!a&&c instanceof d)return c.value;if(!b){if(!this.stackSlot)throw new k["default"]("Invalid stack pop");this.stackSlot--}return c},topStack:function(){var a=this.isInline()?this.inlineStack:this.compileStack,b=a[a.length-1];return b instanceof d?b.value:b},contextName:function(a){return this.useDepths&&a?"depths["+a+"]":"depth"+a},quotedString:function(a){return this.source.quotedString(a)},objectLiteral:function(a){return this.source.objectLiteral(a)},aliasable:function(a){var b=this.aliases[a];return b?(b.referenceCount++,b):(b=this.aliases[a]=this.source.wrap(a),b.aliasable=!0,b.referenceCount=1,b)},setupHelper:function(a,b,c){var d=[],e=this.setupHelperArgs(b,a,d,c),f=this.nameLookup("helpers",b,"helper"),g=this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})");return{params:d,paramsInit:e,name:f,callParams:[g].concat(d)}},setupParams:function(a,b,c){var d={},e=[],f=[],g=[],h=!c,i=void 0;h&&(c=[]),d.name=this.quotedString(a),d.hash=this.popStack(),this.trackIds&&(d.hashIds=this.popStack()),this.stringParams&&(d.hashTypes=this.popStack(),d.hashContexts=this.popStack());var j=this.popStack(),k=this.popStack();(k||j)&&(d.fn=k||"container.noop",d.inverse=j||"container.noop");for(var l=b;l--;)i=this.popStack(),c[l]=i,this.trackIds&&(g[l]=this.popStack()),this.stringParams&&(f[l]=this.popStack(),e[l]=this.popStack());return h&&(d.args=this.source.generateArray(c)),this.trackIds&&(d.ids=this.source.generateArray(g)),this.stringParams&&(d.types=this.source.generateArray(f),d.contexts=this.source.generateArray(e)),this.options.data&&(d.data="data"),this.useBlockParams&&(d.blockParams="blockParams"),d},setupHelperArgs:function(a,b,c,d){var e=this.setupParams(a,b,c);return e.loc=JSON.stringify(this.source.currentLocation),e=this.objectLiteral(e),d?(this.useRegister("options"),c.push("options"),["options=",e]):c?(c.push(e),""):e}},function(){for(var a="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),b=e.RESERVED_WORDS={},c=0,d=a.length;c<d;c++)b[a[c]]=!0}(),e.isValidJavaScriptVariableName=function(a){return!e.RESERVED_WORDS[a]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(a)},b["default"]=e,a.exports=b["default"]},function(a,b,c){"use strict";function d(a,b,c){if(g.isArray(a)){for(var d=[],e=0,f=a.length;e<f;e++)d.push(b.wrap(a[e],c));return d}return"boolean"==typeof a||"number"==typeof a?a+"":a}function e(a){this.srcFile=a,this.source=[]}var f=c(60)["default"];b.__esModule=!0;var g=c(5),h=void 0;try{}catch(i){}h||(h=function(a,b,c,d){this.src="",d&&this.add(d)},h.prototype={add:function(a){g.isArray(a)&&(a=a.join("")),this.src+=a},prepend:function(a){g.isArray(a)&&(a=a.join("")),this.src=a+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}}),e.prototype={isEmpty:function(){return!this.source.length},prepend:function(a,b){this.source.unshift(this.wrap(a,b))},push:function(a,b){this.source.push(this.wrap(a,b))},merge:function(){var a=this.empty();return this.each(function(b){a.add(["  ",b,"\n"])}),a},each:function(a){for(var b=0,c=this.source.length;b<c;b++)a(this.source[b])},empty:function(){var a=this.currentLocation||{start:{}};return new h(a.start.line,a.start.column,this.srcFile)},wrap:function(a){var b=arguments.length<=1||void 0===arguments[1]?this.currentLocation||{start:{}}:arguments[1];return a instanceof h?a:(a=d(a,this,b),new h(b.start.line,b.start.column,this.srcFile,a))},functionCall:function(a,b,c){return c=this.generateList(c),this.wrap([a,b?"."+b+"(":"(",c,")"])},quotedString:function(a){return'"'+(a+"").replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function(a){var b=this,c=[];f(a).forEach(function(e){var f=d(a[e],b);"undefined"!==f&&c.push([b.quotedString(e),":",f])});var e=this.generateList(c);return e.prepend("{"),e.add("}"),e},generateList:function(a){for(var b=this.empty(),c=0,e=a.length;c<e;c++)c&&b.add(","),b.add(d(a[c],this));return b},generateArray:function(a){var b=this.generateList(a);return b.prepend("["),b.add("]"),b}},b["default"]=e,a.exports=b["default"]}])});
12750
12751
12752jQuery(function() {
12753	initOpenPdfInNewTab();
12754	initProductsFiltration();
12755	initVideo();
12756	initTabs();
12757	initRemoveBlock();
12758	initFiltering();
12759	initSlickCarousel();
12760	initStickyScrollBlock();
12761	initFancybox();
12762	initMobileNav();
12763	initOpenClose();
12764	initFieldsSwitcher();
12765	initOfferForm();
12766	initRegistration();
12767	initInputMask();
12768	initCheckedClasses();
12769	initAnchors();
12770	initSearchForms();
12771	initStickyClass();
12772	initTouchDevice();
12773	initCustomForms();
12774	initFilteringModal();
12775	initSwitchModalText();
12776	initTooltip();
12777	initAjaxForm();
12778	initRemoveEmptyItems();
12779	initCopyToClipboard();
12780	initUpdateFavorite();
12781	initApiFavoriteButtons();
12782	initIncentiveOfferSrpModal();
12783	initFavoriteButtonSync();
12784	initUnlockSavings();
12785	initTaxModal();
12786	initSpinPopup();
12787	initPriorityNav();
12788	initSwitchLogos();
12789	initStretchIframe();
12790	initHideInfoButton();
12791	initEditModal();
12792	initConfirmDeleteModal();
12793	initGoogleReviews();
12794	initSearchModal();
12795	initAddCssVariales();
12796	initChat();
12797	initHoverClass();
12798	jQuery('.payment-info .btn.btn-primary').on('click', function(e) {
12799		e.preventDefault();
12800	});
12801
12802	ButtonLocker.init('[data-clear]', 60000);
12803});
12804
12805jQuery(window).on('load', function() {
12806	jQuery('body').addClass('page-loaded');
12807
12808	setTimeout(function() {
12809		jcf.refreshAll(jQuery('.jcf-scrollable'));
12810	}, 500);
12811
12812	initCookieModal();
12813	updateJourneyField();
12814	initStickySummary();
12815});
12816
12817window.addEventListener('popstate', (event) => {
12818	if (!sessionStorage.getItem('fromProductPage') && jQuery('.filter-section').length) {
12819		jQuery(window).trigger('goToPage');
12820	}
12821});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.