';$body.appendChild($modal);$modalInner = $modal.querySelector('.inner');$modalImage = $modal.querySelector('img');$modalImage.addEventListener('load', function() {$modalImage.style.setProperty('--natural-width', $modalImage.naturalWidth + 'px');$modalImage.style.setProperty('--natural-height', $modalImage.naturalHeight + 'px');$modal.classList.add('done');setTimeout(function() {if (!$modal.classList.contains('visible'))return;$modal.classList.add('loaded');setTimeout(function() {$modal.classList.remove('switching', 'from-left', 'from-right', 'done');}, _this.delay);}, ($modal.classList.contains('switching') ? 0 : _this.delay));});$modalImage.addEventListener('contextmenu', function() {if (_this.protect)event.preventDefault();}, true);$modalImage.addEventListener('dragstart', function() {if (_this.protect)event.preventDefault();}, true);$modalCaption = $modal.querySelector('.caption');$modalNext = $modal.querySelector('.next');$modalPrevious = $modal.querySelector('.previous');switch (client.browser) {case 'safari':case 'firefox':$modalInner.style.boxShadow = 'none';break;default:break;}$modal.show = function(index, offset, direction) {var item,i, j, found;if (_this.locked)return;if (typeof index != 'number')index = _this.current;if (typeof offset == 'number') {found = false;j = 0;for (j = 0; j < _this.$links.length; j++) {index += offset;if (index < 0)index = _this.$links.length - 1; else if (index >= _this.$links.length)index = 0;if (index == _this.current)break;item = _this.$links.item(index);if (!item)break;if (item.dataset.lightboxIgnore != '1') {found = true;break;}}if (!found)return;} else {if (index < 0)index = _this.$links.length - 1; else if (index >= _this.$links.length)index = 0;if (index == _this.current)return;item = _this.$links.item(index);if (!item)return;if (item.dataset.lightboxIgnore == '1')return;}if (client.mobile)_this.zoomIntervalId = setInterval(function() {_this.zoomHandler();}, 250);_this.locked = true;if (_this.current !== null) {$modal.classList.remove('loaded');$modal.classList.add('switching');switch (direction) {case -1:$modal.classList.add('from-left');break;case 1:$modal.classList.add('from-right');break;default:break;}setTimeout(function() {_this.current = index;$modalImage.src = item.href;if (_this.captions)$modalCaption.innerHTML = item.querySelector('[data-caption]').dataset.caption;setTimeout(function() {$modal.focus();_this.locked = false;}, _this.delay);}, _this.delay);} else {_this.current = index;$modalImage.src = item.href;if (_this.captions)$modalCaption.innerHTML = item.querySelector('[data-caption]').dataset.caption;$modal.classList.add('visible');setTimeout(function() {$modal.focus();_this.locked = false;}, _this.delay);}};$modal.hide = function() {if (_this.locked)return;if (!$modal.classList.contains('visible'))return;_this.locked = true;$modal.classList.remove('visible');$modal.classList.remove('loaded');$modal.classList.remove('switching', 'from-left', 'from-right', 'done');clearInterval(_this.zoomIntervalId);setTimeout(function() {$modalImage.src = '';_this.locked = false;$body.focus();_this.current = null;}, _this.delay);};$modal.next = function(direction) {$modal.show(null, 1, direction);};$modal.previous = function(direction) {$modal.show(null, -1, direction);};$modal.first = function() {$modal.show(0);};$modal.last = function() {$modal.show(_this.$links.length - 1);};$modalInner.addEventListener('touchstart', function(event) {if (!_this.navigation)return;if (event.touches.length > 1)return;dragStart = {x: event.touches[0].clientX,y: event.touches[0].clientY};});$modalInner.addEventListener('touchmove', function(event) {var dx, dy;if (!_this.navigation)return;if (!dragStart|| event.touches.length > 1)return;dragEnd = {x: event.touches[0].clientX,y: event.touches[0].clientY};dx = dragStart.x - dragEnd.x;dy = dragStart.y - dragEnd.y;if (Math.abs(dx) < 50)return;event.preventDefault();if (dx > 0)$modal.next(-1); else if (dx < 0)$modal.previous(1);});$modalInner.addEventListener('touchend', function(event) {if (!_this.navigation)return;dragStart = null;dragEnd = null;});$modal.addEventListener('click', function(event) {if (event.target&& (event.target.tagName == 'A' || event.target.tagName == 'SPOILER-TEXT'))return;$modal.hide();});$modal.addEventListener('keydown', function(event) {if (!$modal.classList.contains('visible'))return;switch (event.keyCode) {case 39:case 32:if (!_this.navigation)break;event.preventDefault();event.stopPropagation();$modal.next();break;case 37:if (!_this.navigation)break;event.preventDefault();event.stopPropagation();$modal.previous();break;case 36:if (!_this.navigation)break;event.preventDefault();event.stopPropagation();$modal.first();break;case 35:if (!_this.navigation)break;event.preventDefault();event.stopPropagation();$modal.last();break;case 27:event.preventDefault();event.stopPropagation();$modal.hide();break;}});$modalNext.addEventListener('click', function(event) {$modal.next();});$modalPrevious.addEventListener('click', function(event) {$modal.previous();});this.$modal = $modal;this.$modalImage = $modalImage;this.$modalCaption = $modalCaption;this.$modalNext = $modalNext;this.$modalPrevious = $modalPrevious;};lightboxGallery.prototype.show = function(href, config) {this.$links = config.$links;this.navigation = config.navigation;this.captions = config.captions;this.mobile = config.mobile;this.mobileNavigation = config.mobileNavigation;this.scheme = config.scheme;this.protect = config.protect;this.$modal.classList.remove('light', 'dark');switch (this.scheme) {case 'light':this.$modal.classList.add('light');break;case 'dark':this.$modal.classList.add('dark');break;case 'auto':if (window.matchMedia('(prefers-color-scheme: light)').matches)this.$modal.classList.add('light'); else this.$modal.classList.add('dark');break;}if (this.navigation) {this.$modalNext.style.display = '';this.$modalPrevious.style.display = '';if (client.mobile&& !this.mobileNavigation) {this.$modalNext.style.display = 'none';this.$modalPrevious.style.display = 'none';}} else {this.$modalNext.style.display = 'none';this.$modalPrevious.style.display = 'none';}if (this.captions)this.$modalCaption.style.display = ''; else this.$modalCaption.style.display = 'none';if (this.protect) {this.$modalImage.style.WebkitTouchCallout = 'none';this.$modalImage.style.userSelect = 'none';} else {this.$modalImage.style.WebkitTouchCallout = '';this.$modalImage.style.userSelect = '';}if (client.mobile && !this.mobile)return;this.$modal.show(href);};lightboxGallery.prototype.zoomHandler = function() {var threshold = window.matchMedia('(orientation: portrait)').matches ? 50 : 100;if (window.outerWidth > window.innerWidth + threshold)this.$modal.classList.add('zooming'); else this.$modal.classList.remove('zooming');};var _lightboxGallery = new lightboxGallery;_lightboxGallery.init({id: 'gallery02',navigation: true,captions: false,mobile: true,mobileNavigation: true,scheme: 'dark',});function form(id, settings) {var _this = this;this.id = id;this.mode = settings.mode;this.method = settings.method;this.code = ('code' in settings ? settings.code : null);this.success = settings.success;this.initHandler = ('initHandler' in settings ? settings.initHandler : null);this.presubmitHandler = ('presubmitHandler' in settings ? settings.presubmitHandler : null);this.failure = ('failure' in settings ? settings.failure : null);this.optional = ('optional' in settings ? settings.optional : []);this.events = ('events' in settings ? settings.events : {});this.recaptcha = ('recaptcha' in settings ? settings.recaptcha : null);this.collectTrackingParameters = ('collectTrackingParameters' in settings ? settings.collectTrackingParameters : false);this.exportVariables = ('exportVariables' in settings ? settings.exportVariables : false);this.$form = $('#' + this.id);this.$form.addEventListener('change', function(event) {if (event.target.tagName != 'INPUT')return;_this.refreshInput(event.target);});this.$form.addEventListener('submit', function(event) {event.preventDefault();event.stopPropagation();_this.triggerSubmit();});this.$form.addEventListener('reset', function(event) {setTimeout(function() {_this.refreshInputs();}, 0);});this.$form.addEventListener('keydown', function(event) {if (event.keyCode == 13 && event.ctrlKey) {event.preventDefault();event.stopPropagation();_this.triggerSubmit();}});var x = $('#' + this.id + ' input[name="' + settings.hid + '"]');if (x) {x.disabled = true;x.parentNode.style.display = 'none';}this.$submit = $('#' + this.id + ' .actions button[type="submit"]');this.$submit.disabled = false;this.initInputs();if (this.initHandler) {errors.handle(function(message) {return _this.failureHandler(message);});if (!this.initHandler())errors.unhandle();}if (this.recaptcha) {grecaptcha.ready(function() {var id;id = grecaptcha.render(_this.$submit, {sitekey: _this.recaptcha.key,isolated: true,theme: (_this.recaptcha.darkMode ? 'dark' : 'light'),callback: function(token) {_this.submit({recaptchaToken: token},['g-recaptcha-response']);grecaptcha.reset(id);}});});}};form.prototype.completionHandler = function(properties, eventHandler, response) {if (eventHandler !== null)eventHandler.apply(this.$form, [ response ]);switch (properties.mode) {default:case 1:alert(this.expandVariables(properties.value));break;case 2:location.href = this.expandVariables(properties.value);break;case 3:properties.value.apply(this.$form, [ response ]);break;case 4:break;}};form.prototype.failureHandler = function(message) {var eventHandler;console.log('failed (' + message + ')');eventHandler = ('onfailure' in this.events) ? this.events.onfailure : null;if (message.match(/ALERT:/))this.completionHandler({mode: 1,value: message.substring(message.indexOf('ALERT:') + 7)},eventHandler,null); else if (this.failure)this.completionHandler(this.failure,eventHandler,null); else this.completionHandler({mode: 1,value: message},eventHandler,null);this.waiting(false);errors.unhandle();return true;};form.prototype.finalizeInput = function(input) {try {if (!input|| typeof input != 'object'|| !('name' in input))throw 'Not an input.';if (!('value' in input))throw 'Missing "value" property.';if (input.type == 'text'|| input.type == 'email'|| input.type == 'textarea'|| input.type == 'hidden')input.value = input.value.replace(/^\s+/, '').replace(/\s+$/, '');}catch (e) {}};form.prototype.formatDate = function(value, format) {var date, options,a, s;if (!value.match(/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/))return '';a = value.split('-');date = new Date(Date.UTC(a[0], parseInt(a[1]) - 1, parseInt(a[2]) + 1, 0, 0, 0, 0));switch (format) {default:case 'short':break;case 'medium':options = { dateStyle: 'medium' };break;case 'long':options = { dateStyle: 'long' };break;case 'full':options = { dateStyle: 'full' };break;}s = new Intl.DateTimeFormat(undefined, options).format(date);return s;};form.prototype.getAmount = function() {var x;x = this.getRequiredInputValue('amount', ['select-one', 'number']);if (!x)return null;x = parseFloat(x);if (isNaN(x)|| x < 1.00|| x > 100000.00)return null;return x;};form.prototype.getEmail = function() {return this.getRequiredInputValue('email', 'email');};form.prototype.getQuantity = function() {var x;x = this.getRequiredInputValue('quantity', ['select-one', 'number']);if (!x)return null;x = parseInt(x);if (isNaN(x)|| x < 1|| x > 100000)return null;return x;};form.prototype.getRequiredInputValue = function(name, type) {var input;for (input of this.$form.elements) {if (((Array.isArray(type) && type.includes(input.type)) || input.type == type)&& input.name == name&& input.value !== ''&& input.value !== null)return input.value;}return null;};form.prototype.initInputs = function() {var _this = this,i, input;for (i=0; i < this.$form.elements.length; i++) {input = this.$form.elements[i];switch (input.type) {case 'number':(function(input) {var p = input.parentNode,decrement = p.querySelector('button.decrement'),increment = p.querySelector('button.increment');input.addEventListener('blur', function(event) {_this.normalizeNumberInput(input);});if (decrement&& increment) {decrement.addEventListener('click', function(event) {event.preventDefault();_this.normalizeNumberInput(input);input.stepDown(1);_this.normalizeNumberInput(input);});increment.addEventListener('click', function(event) {event.preventDefault();_this.normalizeNumberInput(input);input.stepUp(1);_this.normalizeNumberInput(input);});}})(input);break;case 'file':(function(input) {var p = input.parentNode,select = p.querySelector('button.select');select.addEventListener('click', function(event) {event.preventDefault();input.click();});input.addEventListener('focus', function(event) {event.target.parentNode.classList.add('focus');});input.addEventListener('blur', function(event) {event.target.parentNode.classList.remove('focus');});})(input);break;case 'date':(function(input) {var p = input.parentNode,select = p.querySelector('button.select'),changeHandler,x, y, z;select.addEventListener('click', function(event) {event.preventDefault();input.click();input.focus();});switch (client.browser) {case 'safari':input.addEventListener('keydown', function(event) {switch (event.keyCode) {case 9:event.preventDefault();input.blur();break;case 27:event.preventDefault();input.blur();break;case 33:break;case 34:break;case 37:break;case 38:break;case 39:break;case 40:break;default:event.preventDefault();break;}});break;default:input.addEventListener('click', function(event) {event.preventDefault();input.focus();input.showPicker();});break;}changeHandler = function() {if (input.value)p.setAttribute('data-value', _this.formatDate(input.value, p.dataset.format)); else p.setAttribute('data-value', '');};input.addEventListener('change', function(event) {changeHandler();});changeHandler();})(input);break;case 'text':case 'textarea':case 'email':input.addEventListener('blur', function(event) {this.value = this.value.replace(/^\s+/, '').replace(/\s+$/, '');});break;}this.refreshInput(input);}};form.prototype.isAllowedInput = function(input, ignore) {try {if (!input|| typeof input != 'object'|| !('name' in input))throw 'Not an input.';if (ignore&& ignore.indexOf(input.name) != -1)throw 'Input is ignored.';if (input.disabled)throw 'Input is disabled.';switch (input.type) {case 'text':case 'email':case 'textarea':case 'select-one':case 'checkbox':case 'number':case 'tel':case 'file':case 'date':case 'hidden':break;default:throw 'Not an allowed input.';}}catch (e) {return false;}return true;};form.prototype.isValidInput = function(input) {var result = false;switch (input.type) {case 'email':result = input.value.match(new RegExp("^([a-zA-Z0-9\\_\\-\\.\\+]+)@([a-zA-Z0-9\\-\\.]+)\\.([a-zA-Z]+)$"));break;case 'select-one':result = input.value.match(new RegExp("^[^\\<\\>]+$"));break;case 'checkbox':result = true;break;case 'number':result = input.value.match(new RegExp("^[0-9\\-\\.]+$"));break;case 'tel':result = input.value.match(new RegExp("^[0-9\\-\\+\\(\\)\\ \\#\\*]+$"));break;case 'file':result = true;break;case 'date':result = input.value.match(new RegExp("^[0-9]{4}-[0-9]{2}-[0-9]{2}$"));break;default:case 'text':case 'textarea':case 'hidden':result = true;break;}return result;};form.prototype.normalizeNumberInput = function(input) {var min = parseFloat(input.min),max = parseFloat(input.max),step = parseFloat(input.step),v = parseFloat(input.value);if (isNaN(v)) {if (!input.required) {input.value = null;return;}v = isNaN(min) ? 0 : min;}if (!isNaN(min)&& v < min)v = min;if (!isNaN(max)&& v > max)v = max;if (!isNaN(step)&& (v % step) !== 0)v = Math.round(v / step) * step;switch (input.dataset.category) {case 'currency':v = parseFloat(v).toFixed(2);break;default:case 'decimal':v = parseFloat(v);break;case 'integer':v = parseInt(v);break;}input.value = v;};form.prototype.expandVariables = function(s) {if (typeof variables === 'undefined')return s;if (variables.hasVariables(s)) {for (input of this.$form.elements) {if (!this.isAllowedInput(input))continue;value = '';if (this.isValidInput(input)) {switch (input.type) {case 'checkbox':value = input.checked ? 'true' : 'false';break;case 'email':case 'select-one':case 'number':case 'tel':case 'text':case 'textarea':case 'hidden':value = input.value;break;default:value = '';break;}} else value = '';if (!!(s.match(/^(#[a-zA-Z0-9\_\-]+|[a-z0-9\-\.]+:[a-zA-Z0-9\~\!\@\#$\%\&\-\_\+\=\;\,\.\?\/\:\{\}\|]+)$/)))value = encodeURIComponent(value);s = variables.expandVariable(s, input.name, value);}}s = variables.expandVariableString(this.$form, s);return s;};form.prototype.exportVariableValues = function(source, values, suffix) {if (typeof variables === 'undefined'|| this.exportVariables !== true)return;variables.import(source + (suffix ? suffix : ''), values);variables.purge('form' + (suffix ? suffix : ''));variables.import('form' + (suffix ? suffix : ''), values);};form.prototype.pause = function(values, handler) {var _this = this;this.waiting(true);db.open('formData', function(objectStore) {db.delete(objectStore, _this.id, function() {db.put(objectStore, values, function() {handler.call(_this);});});});};form.prototype.refreshInput = function(input) {var a = [],p;switch (input.type) {case 'file':p = input.parentNode;if (input.files.length > 0)p.setAttribute('data-filename', input.files[0].name); else p.setAttribute('data-filename', '');break;case 'date':p = input.parentNode;if (input.value)p.setAttribute('data-value', this.formatDate(input.value, p.dataset.format)); else p.setAttribute('data-value', '');break;default:break;}};form.prototype.refreshInputs = function() {var i;for (i=0; i < this.$form.elements.length; i++)this.refreshInput(this.$form.elements[i]);};form.prototype.resume = function(handler) {var _this = this;this.waiting(true);this.scrollIntoView();db.open('formData', function(objectStore) {db.get(objectStore, _this.id, function(values) {db.delete(objectStore, _this.id, function() {var e, i, v;for (i in _this.$form.elements) {e = _this.$form.elements[i];if (!e.name)continue;v = (e.name in values ? values[e.name] : null);switch (e.type) {case 'checkbox':e.checked = (v == 'checked' ? true : false);break;case 'file':if (v)e.parentNode.setAttribute('data-filename', v.name);break;default:e.value = v;break;}}handler.call(_this, values);});});});};form.prototype.scrollIntoView = function() {window.scrollTo(0, this.$form.offsetTop);};form.prototype.submit = function(values, ignore) {var _this = this,input, result, _success, _failure,a, b, i, e, fd, k, x, usp;try {for (input of this.$form.elements) {if (!this.isAllowedInput(input, ignore))continue;if (this.optional.indexOf(input.name) !== -1&&(input.value === ''|| input.value === null|| (input.type == 'checkbox' && !input.checked)))continue;this.finalizeInput(input);if (!this.isValidInput(input))throw 'Not valid.';}}catch (e) {alert('Missing or invalid fields. Please try again.');return;}if ('onsubmit' in this.events) {if (this.events.onsubmit.apply(this.$form) === false)return;}a = this.values();if (values) {for (k in values)a[k] = values[k];}if (this.collectTrackingParameters) {usp = new URLSearchParams(window.location.search);b = ['utm_source','utm_medium','utm_campaign','utm_term','utm_content'];for (k of b) {x = usp.get(k);if (x&& x.match(/^[a-zA-Z0-9\-\_\%\+\s]+$/)&& x.length <= 256)a[k] = x;}}switch (this.method) {default:case 'ajax':break;case 'get':case 'post':for (k in a) {if (this.$form.elements[k])continue;e = document.createElement('input');e.setAttribute('type', 'hidden');e.setAttribute('name', k);this.$form.appendChild(e);e.value = a[k];}this.$form.submit();return;case 'code':if (typeof this.code == 'function') {this.waiting(true);_success = function() {_this.exportVariableValues(_this.id, a);_this.completionHandler(_this.success,('onsuccess' in _this.events) ? _this.events.onsuccess : null,null);_this.waiting(false);};_failure = function() {_this.completionHandler(_this.failure,('onfailure' in _this.events) ? _this.events.onfailure : null,null);_this.waiting(false);};result = this.code.apply(this.$form, [_success, _failure]);if (result === true)_success(); else if (result === false)_failure();}return;}if (x = $(':focus'))x.blur();errors.handle(function(message) {return _this.failureHandler(message);});if (this.presubmitHandler)this.presubmitHandler.call(this, a); else this.submitHandler(a);};form.prototype.submitHandler = function(values) {var _this = this,x, k, data;this.waiting(true);data = new FormData;for (k in values) {if (values[k]&& typeof values[k] == 'object'&& ('blob' in values[k]))data.append(k,values[k].blob,values[k].name); else data.append(k, values[k]);}x = new XMLHttpRequest();x.open('POST', ['', 'post', this.mode].join('/'));x.send(data);x.onreadystatechange = function() {var o;if (x.readyState != 4)return;if (x.status != 200)throw new Error('Failed server response (' + x.status + ')');try {o = JSON.parse(x.responseText);}catch (e) {throw new Error('Invalid server response');}if (!('result' in o)|| !('message' in o))throw new Error('Incomplete server response');if (o.result !== true)throw new Error(o.message);_this.exportVariableValues(_this.id, values);if ('response' in o)_this.exportVariableValues(_this.id, o.response, '_response');_this.completionHandler(_this.success,('onsuccess' in _this.events) ? _this.events.onsuccess : null,'response' in o ? o.response : null);_this.$form.reset();_this.waiting(false);errors.unhandle();};};form.prototype.triggerSubmit = function() {if (this.recaptcha)this.$submit.click(); else if (!this.$submit.disabled)this.submit();};form.prototype.values = function() {var a = {};for (i in this.$form.elements) {e = this.$form.elements[i];if (!e.name|| !e.value)continue;switch (e.type) {case 'checkbox':a[e.name] = (e.checked ? 'checked' : null);break;case 'file':a[e.name] = {name: e.files[0].name,blob: new Blob([e.files[0]], { type: e.files[0].type })};break;default:a[e.name] = e.value;break;}}a['id'] = this.id;return a;};form.prototype.waiting = function(x) {var _this = this;if (x) {$body.classList.add('is-instant');this.$submit.disabled = true;this.$submit.classList.add('waiting');if (this.recaptcha)setTimeout(function() {_this.$submit.disabled = true;}, 0);} else {$body.classList.remove('is-instant');this.$submit.classList.remove('waiting');this.$submit.disabled = false;}};new form('form02', {mode: 'contact',collectTrackingParameters: true,method: 'ajax',hid: 'web-url',success: {mode: 2,value: '#contact-done',},optional: ['phone'],});onvisible.add('#text05', { style: 'zoom-in', speed: 1000, intensity: 5, threshold: 3, delay: 0, replay: false });onvisible.add('#image01', { style: 'blur-in', speed: 875, intensity: 8, threshold: 4, delay: 0, replay: false });})();