"undefined"==typeof jQuery.migrateMute&&(jQuery.migrateMute=!0),function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],function(e){return t(e,window)}):"object"==typeof module&&module.exports?module.exports=t(require("jquery"),window):t(jQuery,window)}(function(s,n){"use strict";function e(e){return 0<=function(e,t){for(var r=/^(\d+)\.(\d+)\.(\d+)/,n=r.exec(e)||[],o=r.exec(t)||[],a=1;a<=3;a++){if(+o[a]<+n[a])return 1;if(+n[a]<+o[a])return-1}return 0}(s.fn.jquery,e)}s.migrateVersion="3.4.1";var t=Object.create(null);s.migrateDisablePatches=function(){for(var e=0;e<arguments.length;e++)t[arguments[e]]=!0},s.migrateEnablePatches=function(){for(var e=0;e<arguments.length;e++)delete t[arguments[e]]},s.migrateIsPatchEnabled=function(e){return!t[e]},n.console&&n.console.log&&(s&&e("3.0.0")&&!e("5.0.0")||n.console.log("JQMIGRATE: jQuery 3.x-4.x REQUIRED"),s.migrateWarnings&&n.console.log("JQMIGRATE: Migrate plugin loaded multiple times"),n.console.log("JQMIGRATE: Migrate is installed"+(s.migrateMute?"":" with logging active")+", version "+s.migrateVersion));var o={};function u(e,t){var r=n.console;!s.migrateIsPatchEnabled(e)||s.migrateDeduplicateWarnings&&o[t]||(o[t]=!0,s.migrateWarnings.push(t+" ["+e+"]"),r&&r.warn&&!s.migrateMute&&(r.warn("JQMIGRATE: "+t),s.migrateTrace&&r.trace&&r.trace()))}function r(e,t,r,n,o){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){return u(n,o),r},set:function(e){u(n,o),r=e}})}function a(e,t,r,n,o){var a=e[t];e[t]=function(){return o&&u(n,o),(s.migrateIsPatchEnabled(n)?r:a||s.noop).apply(this,arguments)}}function c(e,t,r,n,o){if(!o)throw new Error("No warning message provided");return a(e,t,r,n,o),0}function i(e,t,r,n){return a(e,t,r,n),0}s.migrateDeduplicateWarnings=!0,s.migrateWarnings=[],void 0===s.migrateTrace&&(s.migrateTrace=!0),s.migrateReset=function(){o={},s.migrateWarnings.length=0},"BackCompat"===n.document.compatMode&&u("quirks","jQuery is not compatible with Quirks Mode");var d,l,p,f={},m=s.fn.init,y=s.find,h=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/,g=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g,v=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;for(d in i(s.fn,"init",function(e){var t=Array.prototype.slice.call(arguments);return s.migrateIsPatchEnabled("selector-empty-id")&&"string"==typeof e&&"#"===e&&(u("selector-empty-id","jQuery('#') is not a valid selector"),t[0]=[]),m.apply(this,t)},"selector-empty-id"),s.fn.init.prototype=s.fn,i(s,"find",function(t){var r=Array.prototype.slice.call(arguments);if("string"==typeof t&&h.test(t))try{n.document.querySelector(t)}catch(e){t=t.replace(g,function(e,t,r,n){return"["+t+r+'"'+n+'"]'});try{n.document.querySelector(t),u("selector-hash","Attribute selector with '#' must be quoted: "+r[0]),r[0]=t}catch(e){u("selector-hash","Attribute selector with '#' was not fixed: "+r[0])}}return y.apply(this,r)},"selector-hash"),y)Object.prototype.hasOwnProperty.call(y,d)&&(s.find[d]=y[d]);c(s.fn,"size",function(){return this.length},"size","jQuery.fn.size() is deprecated and removed; use the .length property"),c(s,"parseJSON",function(){return JSON.parse.apply(null,arguments)},"parseJSON","jQuery.parseJSON is deprecated; use JSON.parse"),c(s,"holdReady",s.holdReady,"holdReady","jQuery.holdReady is deprecated"),c(s,"unique",s.uniqueSort,"unique","jQuery.unique is deprecated; use jQuery.uniqueSort"),r(s.expr,"filters",s.expr.pseudos,"expr-pre-pseudos","jQuery.expr.filters is deprecated; use jQuery.expr.pseudos"),r(s.expr,":",s.expr.pseudos,"expr-pre-pseudos","jQuery.expr[':'] is deprecated; use jQuery.expr.pseudos"),e("3.1.1")&&c(s,"trim",function(e){return null==e?"":(e+"").replace(v,"$1")},"trim","jQuery.trim is deprecated; use String.prototype.trim"),e("3.2.0")&&(c(s,"nodeName",function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},"nodeName","jQuery.nodeName is deprecated"),c(s,"isArray",Array.isArray,"isArray","jQuery.isArray is deprecated; use Array.isArray")),e("3.3.0")&&(c(s,"isNumeric",function(e){var t=typeof e;return("number"==t||"string"==t)&&!isNaN(e-parseFloat(e))},"isNumeric","jQuery.isNumeric() is deprecated"),s.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){f["[object "+t+"]"]=t.toLowerCase()}),c(s,"type",function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?f[Object.prototype.toString.call(e)]||"object":typeof e},"type","jQuery.type is deprecated"),c(s,"isFunction",function(e){return"function"==typeof e},"isFunction","jQuery.isFunction() is deprecated"),c(s,"isWindow",function(e){return null!=e&&e===e.window},"isWindow","jQuery.isWindow() is deprecated")),s.ajax&&(l=s.ajax,p=/(=)\?(?=&|$)|\?\?/,i(s,"ajax",function(){var e=l.apply(this,arguments);return e.promise&&(c(e,"success",e.done,"jqXHR-methods","jQXHR.success is deprecated and removed"),c(e,"error",e.fail,"jqXHR-methods","jQXHR.error is deprecated and removed"),c(e,"complete",e.always,"jqXHR-methods","jQXHR.complete is deprecated and removed")),e},"jqXHR-methods"),e("4.0.0")||s.ajaxPrefilter("+json",function(e){!1!==e.jsonp&&(p.test(e.url)||"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&p.test(e.data))&&u("jsonp-promotion","JSON-to-JSONP auto-promotion is deprecated")}));var j=s.fn.removeAttr,b=s.fn.toggleClass,w=/\S+/g;function x(e){return e.replace(/-([a-z])/g,function(e,t){return t.toUpperCase()})}i(s.fn,"removeAttr",function(e){var r=this,n=!1;return s.each(e.match(w),function(e,t){s.expr.match.bool.test(t)&&r.each(function(){if(!1!==s(this).prop(t))return!(n=!0)}),n&&(u("removeAttr-bool","jQuery.fn.removeAttr no longer sets boolean properties: "+t),r.prop(t,!1))}),j.apply(this,arguments)},"removeAttr-bool"),i(s.fn,"toggleClass",function(t){return void 0!==t&&"boolean"!=typeof t?b.apply(this,arguments):(u("toggleClass-bool","jQuery.fn.toggleClass(boolean) is deprecated"),this.each(function(){var e=this.getAttribute&&this.getAttribute("class")||"";e&&s.data(this,"__className__",e),this.setAttribute&&this.setAttribute("class",!e&&!1!==t&&s.data(this,"__className__")||"")}))},"toggleClass-bool");var Q,A,R=!1,C=/^[a-z]/,N=/^(?:Border(?:Top|Right|Bottom|Left)?(?:Width|)|(?:Margin|Padding)?(?:Top|Right|Bottom|Left)?|(?:Min|Max)?(?:Width|Height))$/;s.swap&&s.each(["height","width","reliableMarginRight"],function(e,t){var r=s.cssHooks[t]&&s.cssHooks[t].get;r&&(s.cssHooks[t].get=function(){var e;return R=!0,e=r.apply(this,arguments),R=!1,e})}),i(s,"swap",function(e,t,r,n){var o,a,i={};for(a in R||u("swap","jQuery.swap() is undocumented and deprecated"),t)i[a]=e.style[a],e.style[a]=t[a];for(a in o=r.apply(e,n||[]),t)e.style[a]=i[a];return o},"swap"),e("3.4.0")&&"undefined"!=typeof Proxy&&(s.cssProps=new Proxy(s.cssProps||{},{set:function(){return u("cssProps","jQuery.cssProps is deprecated"),Reflect.set.apply(this,arguments)}})),e("4.0.0")?(A={animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},"undefined"!=typeof Proxy?s.cssNumber=new Proxy(A,{get:function(){return u("css-number","jQuery.cssNumber is deprecated"),Reflect.get.apply(this,arguments)},set:function(){return u("css-number","jQuery.cssNumber is deprecated"),Reflect.set.apply(this,arguments)}}):s.cssNumber=A):A=s.cssNumber,Q=s.fn.css,i(s.fn,"css",function(e,t){var r,n,o=this;return e&&"object"==typeof e&&!Array.isArray(e)?(s.each(e,function(e,t){s.fn.css.call(o,e,t)}),this):("number"==typeof t&&(r=x(e),n=r,C.test(n)&&N.test(n[0].toUpperCase()+n.slice(1))||A[r]||u("css-number",'Number-typed values are deprecated for jQuery.fn.css("'+e+'", value)')),Q.apply(this,arguments))},"css-number");var S,P,k,H,E=s.data;i(s,"data",function(e,t,r){var n,o,a;if(t&&"object"==typeof t&&2===arguments.length){for(a in n=s.hasData(e)&&E.call(this,e),o={},t)a!==x(a)?(u("data-camelCase","jQuery.data() always sets/gets camelCased names: "+a),n[a]=t[a]):o[a]=t[a];return E.call(this,e,o),t}return t&&"string"==typeof t&&t!==x(t)&&(n=s.hasData(e)&&E.call(this,e))&&t in n?(u("data-camelCase","jQuery.data() always sets/gets camelCased names: "+t),2<arguments.length&&(n[t]=r),n[t]):E.apply(this,arguments)},"data-camelCase"),s.fx&&(k=s.Tween.prototype.run,H=function(e){return e},i(s.Tween.prototype,"run",function(){1<s.easing[this.easing].length&&(u("easing-one-arg","'jQuery.easing."+this.easing.toString()+"' should use only one argument"),s.easing[this.easing]=H),k.apply(this,arguments)},"easing-one-arg"),S=s.fx.interval,P="jQuery.fx.interval is deprecated",n.requestAnimationFrame&&Object.defineProperty(s.fx,"interval",{configurable:!0,enumerable:!0,get:function(){return n.document.hidden||u("fx-interval",P),s.migrateIsPatchEnabled("fx-interval")&&void 0===S?13:S},set:function(e){u("fx-interval",P),S=e}}));var M=s.fn.load,q=s.event.add,O=s.event.fix;s.event.props=[],s.event.fixHooks={},r(s.event.props,"concat",s.event.props.concat,"event-old-patch","jQuery.event.props.concat() is deprecated and removed"),i(s.event,"fix",function(e){var t,r=e.type,n=this.fixHooks[r],o=s.event.props;if(o.length){u("event-old-patch","jQuery.event.props are deprecated and removed: "+o.join());while(o.length)s.event.addProp(o.pop())}if(n&&!n._migrated_&&(n._migrated_=!0,u("event-old-patch","jQuery.event.fixHooks are deprecated and removed: "+r),(o=n.props)&&o.length))while(o.length)s.event.addProp(o.pop());return t=O.call(this,e),n&&n.filter?n.filter(t,e):t},"event-old-patch"),i(s.event,"add",function(e,t){return e===n&&"load"===t&&"complete"===n.document.readyState&&u("load-after-event","jQuery(window).on('load'...) called after load event occurred"),q.apply(this,arguments)},"load-after-event"),s.each(["load","unload","error"],function(e,t){i(s.fn,t,function(){var e=Array.prototype.slice.call(arguments,0);return"load"===t&&"string"==typeof e[0]?M.apply(this,e):(u("shorthand-removed-v3","jQuery.fn."+t+"() is deprecated"),e.splice(0,0,t),arguments.length?this.on.apply(this,e):(this.triggerHandler.apply(this,e),this))},"shorthand-removed-v3")}),s.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,r){c(s.fn,r,function(e,t){return 0<arguments.length?this.on(r,null,e,t):this.trigger(r)},"shorthand-deprecated-v3","jQuery.fn."+r+"() event shorthand is deprecated")}),s(function(){s(n.document).triggerHandler("ready")}),s.event.special.ready={setup:function(){this===n.document&&u("ready-event","'ready' event is deprecated")}},c(s.fn,"bind",function(e,t,r){return this.on(e,null,t,r)},"pre-on-methods","jQuery.fn.bind() is deprecated"),c(s.fn,"unbind",function(e,t){return this.off(e,null,t)},"pre-on-methods","jQuery.fn.unbind() is deprecated"),c(s.fn,"delegate",function(e,t,r,n){return this.on(t,e,r,n)},"pre-on-methods","jQuery.fn.delegate() is deprecated"),c(s.fn,"undelegate",function(e,t,r){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",r)},"pre-on-methods","jQuery.fn.undelegate() is deprecated"),c(s.fn,"hover",function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)},"pre-on-methods","jQuery.fn.hover() is deprecated");function T(e){var t=n.document.implementation.createHTMLDocument("");return t.body.innerHTML=e,t.body&&t.body.innerHTML}var F=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi;s.UNSAFE_restoreLegacyHtmlPrefilter=function(){s.migrateEnablePatches("self-closed-tags")},i(s,"htmlPrefilter",function(e){var t,r;return(r=(t=e).replace(F,"<$1></$2>"))!==t&&T(t)!==T(r)&&u("self-closed-tags","HTML tags must be properly nested and closed: "+t),e.replace(F,"<$1></$2>")},"self-closed-tags"),s.migrateDisablePatches("self-closed-tags");var D,W,_,I=s.fn.offset;return i(s.fn,"offset",function(){var e=this[0];return!e||e.nodeType&&e.getBoundingClientRect?I.apply(this,arguments):(u("offset-valid-elem","jQuery.fn.offset() requires a valid DOM element"),arguments.length?this:void 0)},"offset-valid-elem"),s.ajax&&(D=s.param,i(s,"param",function(e,t){var r=s.ajaxSettings&&s.ajaxSettings.traditional;return void 0===t&&r&&(u("param-ajax-traditional","jQuery.param() no longer uses jQuery.ajaxSettings.traditional"),t=r),D.call(this,e,t)},"param-ajax-traditional")),c(s.fn,"andSelf",s.fn.addBack,"andSelf","jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()"),s.Deferred&&(W=s.Deferred,_=[["resolve","done",s.Callbacks("once memory"),s.Callbacks("once memory"),"resolved"],["reject","fail",s.Callbacks("once memory"),s.Callbacks("once memory"),"rejected"],["notify","progress",s.Callbacks("memory"),s.Callbacks("memory")]],i(s,"Deferred",function(e){var a=W(),i=a.promise();function t(){var o=arguments;return s.Deferred(function(n){s.each(_,function(e,t){var r="function"==typeof o[e]&&o[e];a[t[1]](function(){var e=r&&r.apply(this,arguments);e&&"function"==typeof e.promise?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[t[0]+"With"](this===i?n.promise():this,r?[e]:arguments)})}),o=null}).promise()}return c(a,"pipe",t,"deferred-pipe","deferred.pipe() is deprecated"),c(i,"pipe",t,"deferred-pipe","deferred.pipe() is deprecated"),e&&e.call(a,a),a},"deferred-pipe"),s.Deferred.exceptionHook=W.exceptionHook),s});
setTimeout(function(){!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,document,'script','https://connect.facebook.net/en_US/fbevents.js');fbq('init','917531868581056');fbq('track','PageView');jQuery('body').append('<noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=917531868581056&ev=PageView&noscript=1"/><noscript>');(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-N7HBTPN');},10000);
setTimeout(function(){jQuery('body').append('<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-N7HBTPN" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>');},10000);
const lazyloadRunObserver=()=>{const lazyloadBackgrounds=document.querySelectorAll(`.e-con.e-parent:not(.e-lazyloaded)`);const lazyloadBackgroundObserver=new IntersectionObserver((entries)=>{entries.forEach((entry)=>{if(entry.isIntersecting){let lazyloadBackground=entry.target;if(lazyloadBackground){lazyloadBackground.classList.add('e-lazyloaded');}
lazyloadBackgroundObserver.unobserve(entry.target);}});},{rootMargin:'200px 0px 200px 0px'});lazyloadBackgrounds.forEach((lazyloadBackground)=>{lazyloadBackgroundObserver.observe(lazyloadBackground);});};const events=['DOMContentLoaded','elementor/lazyload/observe',];events.forEach((event)=>{document.addEventListener(event,lazyloadRunObserver);});
!function(t,e){"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,(function(){function t(){}let e=t.prototype;return e.on=function(t,e){if(!t||!e)return this;let i=this._events=this._events||{},s=i[t]=i[t]||[];return s.includes(e)||s.push(e),this},e.once=function(t,e){if(!t||!e)return this;this.on(t,e);let i=this._onceEvents=this._onceEvents||{};return(i[t]=i[t]||{})[e]=!0,this},e.off=function(t,e){let i=this._events&&this._events[t];if(!i||!i.length)return this;let s=i.indexOf(e);return-1!=s&&i.splice(s,1),this},e.emitEvent=function(t,e){let i=this._events&&this._events[t];if(!i||!i.length)return this;i=i.slice(0),e=e||[];let s=this._onceEvents&&this._onceEvents[t];for(let n of i){s&&s[n]&&(this.off(t,n),delete s[n]),n.apply(this,e)}return this},e.allOff=function(){return delete this._events,delete this._onceEvents,this},t})),
function(t,e){"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter")):t.imagesLoaded=e(t,t.EvEmitter)}("undefined"!=typeof window?window:this,(function(t,e){let i=t.jQuery,s=t.console;function n(t,e,o){if(!(this instanceof n))return new n(t,e,o);let r=t;var h;("string"==typeof t&&(r=document.querySelectorAll(t)),r)?(this.elements=(h=r,Array.isArray(h)?h:"object"==typeof h&&"number"==typeof h.length?[...h]:[h]),this.options={},"function"==typeof e?o=e:Object.assign(this.options,e),o&&this.on("always",o),this.getImages(),i&&(this.jqDeferred=new i.Deferred),setTimeout(this.check.bind(this))):s.error(`Bad element for imagesLoaded ${r||t}`)}n.prototype=Object.create(e.prototype),n.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)};const o=[1,9,11];n.prototype.addElementImages=function(t){"IMG"===t.nodeName&&this.addImage(t),!0===this.options.background&&this.addElementBackgroundImages(t);let{nodeType:e}=t;if(!e||!o.includes(e))return;let i=t.querySelectorAll("img");for(let t of i)this.addImage(t);if("string"==typeof this.options.background){let e=t.querySelectorAll(this.options.background);for(let t of e)this.addElementBackgroundImages(t)}};const r=/url\((['"])?(.*?)\1\)/gi;function h(t){this.img=t}function d(t,e){this.url=t,this.element=e,this.img=new Image}return n.prototype.addElementBackgroundImages=function(t){let e=getComputedStyle(t);if(!e)return;let i=r.exec(e.backgroundImage);for(;null!==i;){let s=i&&i[2];s&&this.addBackground(s,t),i=r.exec(e.backgroundImage)}},n.prototype.addImage=function(t){let e=new h(t);this.images.push(e)},n.prototype.addBackground=function(t,e){let i=new d(t,e);this.images.push(i)},n.prototype.check=function(){if(this.progressedCount=0,this.hasAnyBroken=!1,!this.images.length)return void this.complete();let t=(t,e,i)=>{setTimeout((()=>{this.progress(t,e,i)}))};this.images.forEach((function(e){e.once("progress",t),e.check()}))},n.prototype.progress=function(t,e,i){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!t.isLoaded,this.emitEvent("progress",[this,t,e]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,t),this.progressedCount===this.images.length&&this.complete(),this.options.debug&&s&&s.log(`progress: ${i}`,t,e)},n.prototype.complete=function(){let t=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(t,[this]),this.emitEvent("always",[this]),this.jqDeferred){let t=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[t](this)}},h.prototype=Object.create(e.prototype),h.prototype.check=function(){this.getIsImageComplete()?this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.img.crossOrigin&&(this.proxyImage.crossOrigin=this.img.crossOrigin),this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.proxyImage.src=this.img.currentSrc||this.img.src)},h.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},h.prototype.confirm=function(t,e){this.isLoaded=t;let{parentNode:i}=this.img,s="PICTURE"===i.nodeName?i:this.img;this.emitEvent("progress",[this,s,e])},h.prototype.handleEvent=function(t){let e="on"+t.type;this[e]&&this[e](t)},h.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},h.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},h.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},d.prototype=Object.create(h.prototype),d.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url,this.getIsImageComplete()&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},d.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},d.prototype.confirm=function(t,e){this.isLoaded=t,this.emitEvent("progress",[this,this.element,e])},n.makeJQueryPlugin=function(e){(e=e||t.jQuery)&&(i=e,i.fn.imagesLoaded=function(t,e){return new n(this,t,e).jqDeferred.promise(i(this))})},n.makeJQueryPlugin(),n}));
!function(t,e){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("jquery")):t.jQueryBridget=e(t,t.jQuery)}(window,function(t,e){"use strict";function i(i,r,a){function h(t,e,n){var o,r="$()."+i+'("'+e+'")';return t.each(function(t,h){var u=a.data(h,i);if(!u)return void s(i+" not initialized. Cannot call methods, i.e. "+r);var d=u[e];if(!d||"_"==e.charAt(0))return void s(r+" is not a valid method");var l=d.apply(u,n);o=void 0===o?l:o}),void 0!==o?o:t}function u(t,e){t.each(function(t,n){var o=a.data(n,i);o?(o.option(e),o._init()):(o=new r(n,e),a.data(n,i,o))})}a=a||e||t.jQuery,a&&(r.prototype.option||(r.prototype.option=function(t){a.isPlainObject(t)&&(this.options=a.extend(!0,this.options,t))}),a.fn[i]=function(t){if("string"==typeof t){var e=o.call(arguments,1);return h(this,t,e)}return u(this,t),this},n(a))}function n(t){!t||t&&t.bridget||(t.bridget=i)}var o=Array.prototype.slice,r=t.console,s="undefined"==typeof r?function(){}:function(t){r.error(t)};return n(e||t.jQuery),i}),function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return-1==n.indexOf(e)&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},n=i[t]=i[t]||{};return n[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=i.indexOf(e);return-1!=n&&i.splice(n,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){i=i.slice(0),e=e||[];for(var n=this._onceEvents&&this._onceEvents[t],o=0;o<i.length;o++){var r=i[o],s=n&&n[r];s&&(this.off(t,r),delete n[r]),r.apply(this,e)}return this}},e.allOff=function(){delete this._events,delete this._onceEvents},t}),function(t,e){"function"==typeof define&&define.amd?define("get-size/get-size",e):"object"==typeof module&&module.exports?module.exports=e():t.getSize=e()}(window,function(){"use strict";function t(t){var e=parseFloat(t),i=-1==t.indexOf("%")&&!isNaN(e);return i&&e}function e(){}function i(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0;u>e;e++){var i=h[e];t[i]=0}return t}function n(t){var e=getComputedStyle(t);return e||a("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),e}function o(){if(!d){d=!0;var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style.boxSizing="border-box";var i=document.body||document.documentElement;i.appendChild(e);var o=n(e);s=200==Math.round(t(o.width)),r.isBoxSizeOuter=s,i.removeChild(e)}}function r(e){if(o(),"string"==typeof e&&(e=document.querySelector(e)),e&&"object"==typeof e&&e.nodeType){var r=n(e);if("none"==r.display)return i();var a={};a.width=e.offsetWidth,a.height=e.offsetHeight;for(var d=a.isBorderBox="border-box"==r.boxSizing,l=0;u>l;l++){var c=h[l],f=r[c],m=parseFloat(f);a[c]=isNaN(m)?0:m}var p=a.paddingLeft+a.paddingRight,g=a.paddingTop+a.paddingBottom,y=a.marginLeft+a.marginRight,v=a.marginTop+a.marginBottom,_=a.borderLeftWidth+a.borderRightWidth,z=a.borderTopWidth+a.borderBottomWidth,E=d&&s,b=t(r.width);b!==!1&&(a.width=b+(E?0:p+_));var x=t(r.height);return x!==!1&&(a.height=x+(E?0:g+z)),a.innerWidth=a.width-(p+_),a.innerHeight=a.height-(g+z),a.outerWidth=a.width+y,a.outerHeight=a.height+v,a}}var s,a="undefined"==typeof console?e:function(t){console.error(t)},h=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],u=h.length,d=!1;return r}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("desandro-matches-selector/matches-selector",e):"object"==typeof module&&module.exports?module.exports=e():t.matchesSelector=e()}(window,function(){"use strict";var t=function(){var t=window.Element.prototype;if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],i=0;i<e.length;i++){var n=e[i],o=n+"MatchesSelector";if(t[o])return o}}();return function(e,i){return e[t](i)}}),function(t,e){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["desandro-matches-selector/matches-selector"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("desandro-matches-selector")):t.fizzyUIUtils=e(t,t.matchesSelector)}(window,function(t,e){var i={};i.extend=function(t,e){for(var i in e)t[i]=e[i];return t},i.modulo=function(t,e){return(t%e+e)%e};var n=Array.prototype.slice;i.makeArray=function(t){if(Array.isArray(t))return t;if(null===t||void 0===t)return[];var e="object"==typeof t&&"number"==typeof t.length;return e?n.call(t):[t]},i.removeFrom=function(t,e){var i=t.indexOf(e);-1!=i&&t.splice(i,1)},i.getParent=function(t,i){for(;t.parentNode&&t!=document.body;)if(t=t.parentNode,e(t,i))return t},i.getQueryElement=function(t){return"string"==typeof t?document.querySelector(t):t},i.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},i.filterFindElements=function(t,n){t=i.makeArray(t);var o=[];return t.forEach(function(t){if(t instanceof HTMLElement){if(!n)return void o.push(t);e(t,n)&&o.push(t);for(var i=t.querySelectorAll(n),r=0;r<i.length;r++)o.push(i[r])}}),o},i.debounceMethod=function(t,e,i){i=i||100;var n=t.prototype[e],o=e+"Timeout";t.prototype[e]=function(){var t=this[o];clearTimeout(t);var e=arguments,r=this;this[o]=setTimeout(function(){n.apply(r,e),delete r[o]},i)}},i.docReady=function(t){var e=document.readyState;"complete"==e||"interactive"==e?setTimeout(t):document.addEventListener("DOMContentLoaded",t)},i.toDashed=function(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()};var o=t.console;return i.htmlInit=function(e,n){i.docReady(function(){var r=i.toDashed(n),s="data-"+r,a=document.querySelectorAll("["+s+"]"),h=document.querySelectorAll(".js-"+r),u=i.makeArray(a).concat(i.makeArray(h)),d=s+"-options",l=t.jQuery;u.forEach(function(t){var i,r=t.getAttribute(s)||t.getAttribute(d);try{i=r&&JSON.parse(r)}catch(a){return void(o&&o.error("Error parsing "+s+" on "+t.className+": "+a))}var h=new e(t,i);l&&l.data(t,n,h)})})},i}),function(t,e){"function"==typeof define&&define.amd?define("outlayer/item",["ev-emitter/ev-emitter","get-size/get-size"],e):"object"==typeof module&&module.exports?module.exports=e(require("ev-emitter"),require("get-size")):(t.Outlayer={},t.Outlayer.Item=e(t.EvEmitter,t.getSize))}(window,function(t,e){"use strict";function i(t){for(var e in t)return!1;return e=null,!0}function n(t,e){t&&(this.element=t,this.layout=e,this.position={x:0,y:0},this._create())}function o(t){return t.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}var r=document.documentElement.style,s="string"==typeof r.transition?"transition":"WebkitTransition",a="string"==typeof r.transform?"transform":"WebkitTransform",h={WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[s],u={transform:a,transition:s,transitionDuration:s+"Duration",transitionProperty:s+"Property",transitionDelay:s+"Delay"},d=n.prototype=Object.create(t.prototype);d.constructor=n,d._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},d.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},d.getSize=function(){this.size=e(this.element)},d.css=function(t){var e=this.element.style;for(var i in t){var n=u[i]||i;e[n]=t[i]}},d.getPosition=function(){var t=getComputedStyle(this.element),e=this.layout._getOption("originLeft"),i=this.layout._getOption("originTop"),n=t[e?"left":"right"],o=t[i?"top":"bottom"],r=parseFloat(n),s=parseFloat(o),a=this.layout.size;-1!=n.indexOf("%")&&(r=r/100*a.width),-1!=o.indexOf("%")&&(s=s/100*a.height),r=isNaN(r)?0:r,s=isNaN(s)?0:s,r-=e?a.paddingLeft:a.paddingRight,s-=i?a.paddingTop:a.paddingBottom,this.position.x=r,this.position.y=s},d.layoutPosition=function(){var t=this.layout.size,e={},i=this.layout._getOption("originLeft"),n=this.layout._getOption("originTop"),o=i?"paddingLeft":"paddingRight",r=i?"left":"right",s=i?"right":"left",a=this.position.x+t[o];e[r]=this.getXValue(a),e[s]="";var h=n?"paddingTop":"paddingBottom",u=n?"top":"bottom",d=n?"bottom":"top",l=this.position.y+t[h];e[u]=this.getYValue(l),e[d]="",this.css(e),this.emitEvent("layout",[this])},d.getXValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&!e?t/this.layout.size.width*100+"%":t+"px"},d.getYValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&e?t/this.layout.size.height*100+"%":t+"px"},d._transitionTo=function(t,e){this.getPosition();var i=this.position.x,n=this.position.y,o=t==this.position.x&&e==this.position.y;if(this.setPosition(t,e),o&&!this.isTransitioning)return void this.layoutPosition();var r=t-i,s=e-n,a={};a.transform=this.getTranslate(r,s),this.transition({to:a,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},d.getTranslate=function(t,e){var i=this.layout._getOption("originLeft"),n=this.layout._getOption("originTop");return t=i?t:-t,e=n?e:-e,"translate3d("+t+"px, "+e+"px, 0)"},d.goTo=function(t,e){this.setPosition(t,e),this.layoutPosition()},d.moveTo=d._transitionTo,d.setPosition=function(t,e){this.position.x=parseFloat(t),this.position.y=parseFloat(e)},d._nonTransition=function(t){this.css(t.to),t.isCleaning&&this._removeStyles(t.to);for(var e in t.onTransitionEnd)t.onTransitionEnd[e].call(this)},d.transition=function(t){if(!parseFloat(this.layout.options.transitionDuration))return void this._nonTransition(t);var e=this._transn;for(var i in t.onTransitionEnd)e.onEnd[i]=t.onTransitionEnd[i];for(i in t.to)e.ingProperties[i]=!0,t.isCleaning&&(e.clean[i]=!0);if(t.from){this.css(t.from);var n=this.element.offsetHeight;n=null}this.enableTransition(t.to),this.css(t.to),this.isTransitioning=!0};var l="opacity,"+o(a);d.enableTransition=function(){if(!this.isTransitioning){var t=this.layout.options.transitionDuration;t="number"==typeof t?t+"ms":t,this.css({transitionProperty:l,transitionDuration:t,transitionDelay:this.staggerDelay||0}),this.element.addEventListener(h,this,!1)}},d.onwebkitTransitionEnd=function(t){this.ontransitionend(t)},d.onotransitionend=function(t){this.ontransitionend(t)};var c={"-webkit-transform":"transform"};d.ontransitionend=function(t){if(t.target===this.element){var e=this._transn,n=c[t.propertyName]||t.propertyName;if(delete e.ingProperties[n],i(e.ingProperties)&&this.disableTransition(),n in e.clean&&(this.element.style[t.propertyName]="",delete e.clean[n]),n in e.onEnd){var o=e.onEnd[n];o.call(this),delete e.onEnd[n]}this.emitEvent("transitionEnd",[this])}},d.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(h,this,!1),this.isTransitioning=!1},d._removeStyles=function(t){var e={};for(var i in t)e[i]="";this.css(e)};var f={transitionProperty:"",transitionDuration:"",transitionDelay:""};return d.removeTransitionStyles=function(){this.css(f)},d.stagger=function(t){t=isNaN(t)?0:t,this.staggerDelay=t+"ms"},d.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},d.remove=function(){return s&&parseFloat(this.layout.options.transitionDuration)?(this.once("transitionEnd",function(){this.removeElem()}),void this.hide()):void this.removeElem()},d.reveal=function(){delete this.isHidden,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("visibleStyle");e[i]=this.onRevealTransitionEnd,this.transition({from:t.hiddenStyle,to:t.visibleStyle,isCleaning:!0,onTransitionEnd:e})},d.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},d.getHideRevealTransitionEndProperty=function(t){var e=this.layout.options[t];if(e.opacity)return"opacity";for(var i in e)return i},d.hide=function(){this.isHidden=!0,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("hiddenStyle");e[i]=this.onHideTransitionEnd,this.transition({from:t.visibleStyle,to:t.hiddenStyle,isCleaning:!0,onTransitionEnd:e})},d.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},d.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},n}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("outlayer/outlayer",["ev-emitter/ev-emitter","get-size/get-size","fizzy-ui-utils/utils","./item"],function(i,n,o,r){return e(t,i,n,o,r)}):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter"),require("get-size"),require("fizzy-ui-utils"),require("./item")):t.Outlayer=e(t,t.EvEmitter,t.getSize,t.fizzyUIUtils,t.Outlayer.Item)}(window,function(t,e,i,n,o){"use strict";function r(t,e){var i=n.getQueryElement(t);if(!i)return void(h&&h.error("Bad element for "+this.constructor.namespace+": "+(i||t)));this.element=i,u&&(this.$element=u(this.element)),this.options=n.extend({},this.constructor.defaults),this.option(e);var o=++l;this.element.outlayerGUID=o,c[o]=this,this._create();var r=this._getOption("initLayout");r&&this.layout()}function s(t){function e(){t.apply(this,arguments)}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e}function a(t){if("number"==typeof t)return t;var e=t.match(/(^\d*\.?\d*)(\w*)/),i=e&&e[1],n=e&&e[2];if(!i.length)return 0;i=parseFloat(i);var o=m[n]||1;return i*o}var h=t.console,u=t.jQuery,d=function(){},l=0,c={};r.namespace="outlayer",r.Item=o,r.defaults={containerStyle:{position:"relative"},initLayout:!0,originLeft:!0,originTop:!0,resize:!0,resizeContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}};var f=r.prototype;n.extend(f,e.prototype),f.option=function(t){n.extend(this.options,t)},f._getOption=function(t){var e=this.constructor.compatOptions[t];return e&&void 0!==this.options[e]?this.options[e]:this.options[t]},r.compatOptions={initLayout:"isInitLayout",horizontal:"isHorizontal",layoutInstant:"isLayoutInstant",originLeft:"isOriginLeft",originTop:"isOriginTop",resize:"isResizeBound",resizeContainer:"isResizingContainer"},f._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),n.extend(this.element.style,this.options.containerStyle);var t=this._getOption("resize");t&&this.bindResize()},f.reloadItems=function(){this.items=this._itemize(this.element.children)},f._itemize=function(t){for(var e=this._filterFindItemElements(t),i=this.constructor.Item,n=[],o=0;o<e.length;o++){var r=e[o],s=new i(r,this);n.push(s)}return n},f._filterFindItemElements=function(t){return n.filterFindElements(t,this.options.itemSelector)},f.getItemElements=function(){return this.items.map(function(t){return t.element})},f.layout=function(){this._resetLayout(),this._manageStamps();var t=this._getOption("layoutInstant"),e=void 0!==t?t:!this._isLayoutInited;this.layoutItems(this.items,e),this._isLayoutInited=!0},f._init=f.layout,f._resetLayout=function(){this.getSize()},f.getSize=function(){this.size=i(this.element)},f._getMeasurement=function(t,e){var n,o=this.options[t];o?("string"==typeof o?n=this.element.querySelector(o):o instanceof HTMLElement&&(n=o),this[t]=n?i(n)[e]:o):this[t]=0},f.layoutItems=function(t,e){t=this._getItemsForLayout(t),this._layoutItems(t,e),this._postLayout()},f._getItemsForLayout=function(t){return t.filter(function(t){return!t.isIgnored})},f._layoutItems=function(t,e){if(this._emitCompleteOnItems("layout",t),t&&t.length){var i=[];t.forEach(function(t){var n=this._getItemLayoutPosition(t);n.item=t,n.isInstant=e||t.isLayoutInstant,i.push(n)},this),this._processLayoutQueue(i)}},f._getItemLayoutPosition=function(){return{x:0,y:0}},f._processLayoutQueue=function(t){this.updateStagger(),t.forEach(function(t,e){this._positionItem(t.item,t.x,t.y,t.isInstant,e)},this)},f.updateStagger=function(){var t=this.options.stagger;return null===t||void 0===t?void(this.stagger=0):(this.stagger=a(t),this.stagger)},f._positionItem=function(t,e,i,n,o){n?t.goTo(e,i):(t.stagger(o*this.stagger),t.moveTo(e,i))},f._postLayout=function(){this.resizeContainer()},f.resizeContainer=function(){var t=this._getOption("resizeContainer");if(t){var e=this._getContainerSize();e&&(this._setContainerMeasure(e.width,!0),this._setContainerMeasure(e.height,!1))}},f._getContainerSize=d,f._setContainerMeasure=function(t,e){if(void 0!==t){var i=this.size;i.isBorderBox&&(t+=e?i.paddingLeft+i.paddingRight+i.borderLeftWidth+i.borderRightWidth:i.paddingBottom+i.paddingTop+i.borderTopWidth+i.borderBottomWidth),t=Math.max(t,0),this.element.style[e?"width":"height"]=t+"px"}},f._emitCompleteOnItems=function(t,e){function i(){o.dispatchEvent(t+"Complete",null,[e])}function n(){s++,s==r&&i()}var o=this,r=e.length;if(!e||!r)return void i();var s=0;e.forEach(function(e){e.once(t,n)})},f.dispatchEvent=function(t,e,i){var n=e?[e].concat(i):i;if(this.emitEvent(t,n),u)if(this.$element=this.$element||u(this.element),e){var o=u.Event(e);o.type=t,this.$element.trigger(o,i)}else this.$element.trigger(t,i)},f.ignore=function(t){var e=this.getItem(t);e&&(e.isIgnored=!0)},f.unignore=function(t){var e=this.getItem(t);e&&delete e.isIgnored},f.stamp=function(t){t=this._find(t),t&&(this.stamps=this.stamps.concat(t),t.forEach(this.ignore,this))},f.unstamp=function(t){t=this._find(t),t&&t.forEach(function(t){n.removeFrom(this.stamps,t),this.unignore(t)},this)},f._find=function(t){return t?("string"==typeof t&&(t=this.element.querySelectorAll(t)),t=n.makeArray(t)):void 0},f._manageStamps=function(){this.stamps&&this.stamps.length&&(this._getBoundingRect(),this.stamps.forEach(this._manageStamp,this))},f._getBoundingRect=function(){var t=this.element.getBoundingClientRect(),e=this.size;this._boundingRect={left:t.left+e.paddingLeft+e.borderLeftWidth,top:t.top+e.paddingTop+e.borderTopWidth,right:t.right-(e.paddingRight+e.borderRightWidth),bottom:t.bottom-(e.paddingBottom+e.borderBottomWidth)}},f._manageStamp=d,f._getElementOffset=function(t){var e=t.getBoundingClientRect(),n=this._boundingRect,o=i(t),r={left:e.left-n.left-o.marginLeft,top:e.top-n.top-o.marginTop,right:n.right-e.right-o.marginRight,bottom:n.bottom-e.bottom-o.marginBottom};return r},f.handleEvent=n.handleEvent,f.bindResize=function(){t.addEventListener("resize",this),this.isResizeBound=!0},f.unbindResize=function(){t.removeEventListener("resize",this),this.isResizeBound=!1},f.onresize=function(){this.resize()},n.debounceMethod(r,"onresize",100),f.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},f.needsResizeLayout=function(){var t=i(this.element),e=this.size&&t;return e&&t.innerWidth!==this.size.innerWidth},f.addItems=function(t){var e=this._itemize(t);return e.length&&(this.items=this.items.concat(e)),e},f.appended=function(t){var e=this.addItems(t);e.length&&(this.layoutItems(e,!0),this.reveal(e))},f.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this._manageStamps(),this.layoutItems(e,!0),this.reveal(e),this.layoutItems(i)}},f.reveal=function(t){if(this._emitCompleteOnItems("reveal",t),t&&t.length){var e=this.updateStagger();t.forEach(function(t,i){t.stagger(i*e),t.reveal()})}},f.hide=function(t){if(this._emitCompleteOnItems("hide",t),t&&t.length){var e=this.updateStagger();t.forEach(function(t,i){t.stagger(i*e),t.hide()})}},f.revealItemElements=function(t){var e=this.getItems(t);this.reveal(e)},f.hideItemElements=function(t){var e=this.getItems(t);this.hide(e)},f.getItem=function(t){for(var e=0;e<this.items.length;e++){var i=this.items[e];if(i.element==t)return i}},f.getItems=function(t){t=n.makeArray(t);var e=[];return t.forEach(function(t){var i=this.getItem(t);i&&e.push(i)},this),e},f.remove=function(t){var e=this.getItems(t);this._emitCompleteOnItems("remove",e),e&&e.length&&e.forEach(function(t){t.remove(),n.removeFrom(this.items,t)},this)},f.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="",this.items.forEach(function(t){t.destroy()}),this.unbindResize();var e=this.element.outlayerGUID;delete c[e],delete this.element.outlayerGUID,u&&u.removeData(this.element,this.constructor.namespace)},r.data=function(t){t=n.getQueryElement(t);var e=t&&t.outlayerGUID;return e&&c[e]},r.create=function(t,e){var i=s(r);return i.defaults=n.extend({},r.defaults),n.extend(i.defaults,e),i.compatOptions=n.extend({},r.compatOptions),i.namespace=t,i.data=r.data,i.Item=s(o),n.htmlInit(i,t),u&&u.bridget&&u.bridget(t,i),i};var m={ms:1,s:1e3};return r.Item=o,r}),function(t,e){"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size"],e):"object"==typeof module&&module.exports?module.exports=e(require("outlayer"),require("get-size")):t.Masonry=e(t.Outlayer,t.getSize)}(window,function(t,e){var i=t.create("masonry");i.compatOptions.fitWidth="isFitWidth";var n=i.prototype;return n._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns(),this.colYs=[];for(var t=0;t<this.cols;t++)this.colYs.push(0);this.maxY=0,this.horizontalColIndex=0},n.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var t=this.items[0],i=t&&t.element;this.columnWidth=i&&e(i).outerWidth||this.containerWidth}var n=this.columnWidth+=this.gutter,o=this.containerWidth+this.gutter,r=o/n,s=n-o%n,a=s&&1>s?"round":"floor";r=Math[a](r),this.cols=Math.max(r,1)},n.getContainerWidth=function(){var t=this._getOption("fitWidth"),i=t?this.element.parentNode:this.element,n=e(i);this.containerWidth=n&&n.innerWidth},n._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth%this.columnWidth,i=e&&1>e?"round":"ceil",n=Math[i](t.size.outerWidth/this.columnWidth);n=Math.min(n,this.cols);for(var o=this.options.horizontalOrder?"_getHorizontalColPosition":"_getTopColPosition",r=this[o](n,t),s={x:this.columnWidth*r.col,y:r.y},a=r.y+t.size.outerHeight,h=n+r.col,u=r.col;h>u;u++)this.colYs[u]=a;return s},n._getTopColPosition=function(t){var e=this._getTopColGroup(t),i=Math.min.apply(Math,e);return{col:e.indexOf(i),y:i}},n._getTopColGroup=function(t){if(2>t)return this.colYs;for(var e=[],i=this.cols+1-t,n=0;i>n;n++)e[n]=this._getColGroupY(n,t);return e},n._getColGroupY=function(t,e){if(2>e)return this.colYs[t];var i=this.colYs.slice(t,t+e);return Math.max.apply(Math,i)},n._getHorizontalColPosition=function(t,e){var i=this.horizontalColIndex%this.cols,n=t>1&&i+t>this.cols;i=n?0:i;var o=e.size.outerWidth&&e.size.outerHeight;return this.horizontalColIndex=o?i+t:this.horizontalColIndex,{col:i,y:this._getColGroupY(i,t)}},n._manageStamp=function(t){var i=e(t),n=this._getElementOffset(t),o=this._getOption("originLeft"),r=o?n.left:n.right,s=r+i.outerWidth,a=Math.floor(r/this.columnWidth);a=Math.max(0,a);var h=Math.floor(s/this.columnWidth);h-=s%this.columnWidth?0:1,h=Math.min(this.cols-1,h);for(var u=this._getOption("originTop"),d=(u?n.top:n.bottom)+i.outerHeight,l=a;h>=l;l++)this.colYs[l]=Math.max(d,this.colYs[l])},n._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this._getOption("fitWidth")&&(t.width=this._getContainerFitWidth()),t},n._getContainerFitWidth=function(){for(var t=0,e=this.cols;--e&&0===this.colYs[e];)t++;return(this.cols-t)*this.columnWidth-this.gutter},n.needsResizeLayout=function(){var t=this.containerWidth;return this.getContainerWidth(),t!=this.containerWidth},i});
!function(t,e){"use strict";function r(r,a,i,u,l){function f(){L=t.devicePixelRatio>1,i=c(i),a.delay>=0&&setTimeout(function(){s(!0)},a.delay),(a.delay<0||a.combined)&&(u.e=v(a.throttle,function(t){"resize"===t.type&&(w=B=-1),s(t.all)}),u.a=function(t){t=c(t),i.push.apply(i,t)},u.g=function(){return i=n(i).filter(function(){return!n(this).data(a.loadedName)})},u.f=function(t){for(var e=0;e<t.length;e++){var r=i.filter(function(){return this===t[e]});r.length&&s(!1,r)}},s(),n(a.appendScroll).on("scroll."+l+" resize."+l,u.e))}function c(t){var i=a.defaultImage,o=a.placeholder,u=a.imageBase,l=a.srcsetAttribute,f=a.loaderAttribute,c=a._f||{};t=n(t).filter(function(){var t=n(this),r=m(this);return!t.data(a.handledName)&&(t.attr(a.attribute)||t.attr(l)||t.attr(f)||c[r]!==e)}).data("plugin_"+a.name,r);for(var s=0,d=t.length;s<d;s++){var A=n(t[s]),g=m(t[s]),h=A.attr(a.imageBaseAttribute)||u;g===N&&h&&A.attr(l)&&A.attr(l,b(A.attr(l),h)),c[g]===e||A.attr(f)||A.attr(f,c[g]),g===N&&i&&!A.attr(E)?A.attr(E,i):g===N||!o||A.css(O)&&"none"!==A.css(O)||A.css(O,"url('"+o+"')")}return t}function s(t,e){if(!i.length)return void(a.autoDestroy&&r.destroy());for(var o=e||i,u=!1,l=a.imageBase||"",f=a.srcsetAttribute,c=a.handledName,s=0;s<o.length;s++)if(t||e||A(o[s])){var g=n(o[s]),h=m(o[s]),b=g.attr(a.attribute),v=g.attr(a.imageBaseAttribute)||l,p=g.attr(a.loaderAttribute);g.data(c)||a.visibleOnly&&!g.is(":visible")||!((b||g.attr(f))&&(h===N&&(v+b!==g.attr(E)||g.attr(f)!==g.attr(F))||h!==N&&v+b!==g.css(O))||p)||(u=!0,g.data(c,!0),d(g,h,v,p))}u&&(i=n(i).filter(function(){return!n(this).data(c)}))}function d(t,e,r,i){++z;var o=function(){y("onError",t),p(),o=n.noop};y("beforeLoad",t);var u=a.attribute,l=a.srcsetAttribute,f=a.sizesAttribute,c=a.retinaAttribute,s=a.removeAttribute,d=a.loadedName,A=t.attr(c);if(i){var g=function(){s&&t.removeAttr(a.loaderAttribute),t.data(d,!0),y(T,t),setTimeout(p,1),g=n.noop};t.off(I).one(I,o).one(D,g),y(i,t,function(e){e?(t.off(D),g()):(t.off(I),o())})||t.trigger(I)}else{var h=n(new Image);h.one(I,o).one(D,function(){t.hide(),e===N?t.attr(C,h.attr(C)).attr(F,h.attr(F)).attr(E,h.attr(E)):t.css(O,"url('"+h.attr(E)+"')"),t[a.effect](a.effectTime),s&&(t.removeAttr(u+" "+l+" "+c+" "+a.imageBaseAttribute),f!==C&&t.removeAttr(f)),t.data(d,!0),y(T,t),h.remove(),p()});var m=(L&&A?A:t.attr(u))||"";h.attr(C,t.attr(f)).attr(F,t.attr(l)).attr(E,m?r+m:null),h.complete&&h.trigger(D)}}function A(t){var e=t.getBoundingClientRect(),r=a.scrollDirection,n=a.threshold,i=h()+n>e.top&&-n<e.bottom,o=g()+n>e.left&&-n<e.right;return"vertical"===r?i:"horizontal"===r?o:i&&o}function g(){return w>=0?w:w=n(t).width()}function h(){return B>=0?B:B=n(t).height()}function m(t){return t.tagName.toLowerCase()}function b(t,e){if(e){var r=t.split(",");t="";for(var a=0,n=r.length;a<n;a++)t+=e+r[a].trim()+(a!==n-1?",":"")}return t}function v(t,e){var n,i=0;return function(o,u){function l(){i=+new Date,e.call(r,o)}var f=+new Date-i;n&&clearTimeout(n),f>t||!a.enableThrottle||u?l():n=setTimeout(l,t-f)}}function p(){--z,i.length||z||y("onFinishedAll")}function y(t,e,n){return!!(t=a[t])&&(t.apply(r,[].slice.call(arguments,1)),!0)}var z=0,w=-1,B=-1,L=!1,T="afterLoad",D="load",I="error",N="img",E="src",F="srcset",C="sizes",O="background-image";"event"===a.bind||o?f():n(t).on(D+"."+l,f)}function a(a,o){var u=this,l=n.extend({},u.config,o),f={},c=l.name+"-"+ ++i;return u.config=function(t,r){return r===e?l[t]:(l[t]=r,u)},u.addItems=function(t){return f.a&&f.a("string"===n.type(t)?n(t):t),u},u.getItems=function(){return f.g?f.g():{}},u.update=function(t){return f.e&&f.e({},!t),u},u.force=function(t){return f.f&&f.f("string"===n.type(t)?n(t):t),u},u.loadAll=function(){return f.e&&f.e({all:!0},!0),u},u.destroy=function(){return n(l.appendScroll).off("."+c,f.e),n(t).off("."+c),f={},e},r(u,l,a,f,c),l.chainable?a:u}var n=t.jQuery||t.Zepto,i=0,o=!1;n.fn.Lazy=n.fn.lazy=function(t){return new a(this,t)},n.Lazy=n.lazy=function(t,r,i){if(n.isFunction(r)&&(i=r,r=[]),n.isFunction(i)){t=n.isArray(t)?t:[t],r=n.isArray(r)?r:[r];for(var o=a.prototype.config,u=o._f||(o._f={}),l=0,f=t.length;l<f;l++)(o[t[l]]===e||n.isFunction(o[t[l]]))&&(o[t[l]]=i);for(var c=0,s=r.length;c<s;c++)u[r[c]]=t[0]}},a.prototype.config={name:"lazy",chainable:!0,autoDestroy:!0,bind:"load",threshold:500,visibleOnly:!1,appendScroll:t,scrollDirection:"both",imageBase:null,defaultImage:"data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",placeholder:null,delay:-1,combined:!1,attribute:"data-src",srcsetAttribute:"data-srcset",sizesAttribute:"data-sizes",retinaAttribute:"data-retina",loaderAttribute:"data-loader",imageBaseAttribute:"data-imagebase",removeAttribute:!0,handledName:"handled",loadedName:"loaded",effect:"show",effectTime:0,enableThrottle:!0,throttle:250,beforeLoad:e,afterLoad:e,onError:e,onFinishedAll:e},n(t).on("load",function(){o=!0})}(window);
jQuery(function($){jQuery("img.lazy").each(function(){var currentImg=jQuery(this);jQuery(this).Lazy({onFinishedAll:function(){currentImg.parent("div.post_img_hover").removeClass("lazy");currentImg.parent(".tg_gallery_lightbox").parent("div.gallery_grid_item").removeClass("lazy");currentImg.parent("div.gallery_grid_item").removeClass("lazy");}});});});
!function(){var t=window,s=0;t.requestAnimationFrame=t.requestAnimationFrame||t.webkitRequestAnimationFrame,t.requestAnimationFrame||(t.requestAnimationFrame=function(t){var e=(new Date).getTime(),i=Math.max(0,16-(e-s));return t=setTimeout(t,i),s=e+i,t}),t.cancelAnimationFrame||(t.cancelAnimationFrame=function(t){clearTimeout(t)})}(),function(t,e){"function"==typeof define&&define.amd?define("themeone-utils/utils",e):"object"==typeof module&&module.exports?module.exports=e():t.ThemeoneUtils=e()}(this,function(){var t={},e=window.console;return t.error=function(t){void 0!==e&&e.error(t)},t.extend=function(t,e){if(t)if("object"!=typeof t)this.error("Custom options must be an object");else for(var i in e)e.hasOwnProperty(i)&&t.hasOwnProperty(i)&&(e[i]=t[i]);return e},t.prop=function(t){for(var e=this.createEl(),i=["","Webkit","Moz","ms","O"],s=0,o=i.length;s<o;s++){var n=i[s]?i[s]+t.charAt(0).toUpperCase()+t.slice(1):t;if(void 0!==e.style[n])return n}return""},t.cloneObject=function(t){var e,i={};for(e in t)t.hasOwnProperty(e)&&(i[e]=t[e]);return i},t.createEl=function(t,e){var i=document.createElement(t||"div");return e&&(i.className=e),i},t.camelize=function(t){return t.replace(/-([a-z])/g,function(t){return t[1].toUpperCase()})},t.handleEvents=function(t,e,i,s,o){"object"!=typeof this.event_handlers&&(this.event_handlers={}),this.event_handlers[s]||(this.event_handlers[s]=t[s].bind(t));var n=void 0===o||o?"addEventListener":"removeEventListener";i.forEach(function(t){e[n](t,this.event_handlers[s],!1)}.bind(this))},t.dispatchEvent=function(t,e,i,s,o){i+=e?"."+e:"",e=s?[s].concat(o):[o],t.emitEvent(i,e)},t.throttle=function(i,s){var o=null;return function(){var t=arguments,e=Date.now();(!o||s<=e-o)&&(o=e,i.apply(this,t))}},t.modulo=function(t,e){return(t+e%t)%t},t.classReg=function(t){return new RegExp("(^|\\s+)"+t+"(\\s+|$)")},t.hasClass=function(t,e){return!!t.className.match(this.classReg(e))},t.addClass=function(t,e){this.hasClass(t,e)||(t.className+=(t.className?" ":"")+e)},t.removeClass=function(t,e){this.hasClass(t,e)&&(t.className=t.className.replace(this.classReg(e)," ").replace(/\s+$/,""))},t.translate=function(t,e,i,s){s=s?" scale("+s+","+s+")":"",t.style[this.browser.trans]=this.browser.gpu?"translate3d("+(e||0)+"px, "+(i||0)+"px, 0)"+s:"translate("+(e||0)+"px, "+(i||0)+"px)"+s},t.browser={trans:t.prop("transform"),gpu:!!t.prop("perspective")},t}),function(t,e){"function"==typeof define&&define.amd?define("themeone-event/event",e):"object"==typeof module&&module.exports?module.exports=e():t.ThemeoneEvent=e()}("undefined"!=typeof window?window:this,function(){var t=function(){},e=t.prototype;return e.on=function(t,e){if(!t||!e)return null;var i=this._events=this._events||{};return-1===(i=i[t]=i[t]||[]).indexOf(e)&&i.push(e),this},e.off=function(t,e){var i=this._events&&this._events[t];if(!i||!i.length)return null;var s=i.indexOf(e);return-1!==s&&i.splice(s,1),this},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(!i||!i.length)return null;var s=0,o=i[s];e=e||[];for(var n=this._onceEvents&&this._onceEvents[t];o;){var r=n&&n[o];r&&(this.off(t,o),delete n[o]),o.apply(this,e),o=i[s+=r?0:1]}return this},t}),function(t,e){"function"==typeof define&&define.amd?define("themeone-animate/animate",["themeone-utils/utils","themeone-event/event"],e):"object"==typeof module&&module.exports?module.exports=e(require("themeone-utils"),require("themeone-event")):t.ThemeoneAnimate=e(t.ThemeoneUtils,t.ThemeoneEvent)}(this,function(o,t){var e=function(t,e,i,s){this.element=t,this.defaults=e,this.forces={friction:i||.28,attraction:s||.028},this.resetAnimate()},i=e.prototype=Object.create(t.prototype);return i.updateDrag=function(t){this.move=!0,this.drag=t},i.releaseDrag=function(){this.move=!1},i.animateTo=function(t){this.attraction=t},i.startAnimate=function(){this.move=!0,this.settle=!1,this.restingFrames=0,this.RAF||this.animate()},i.stopAnimate=function(){this.move=!1,this.restingFrames=0,this.RAF&&(cancelAnimationFrame(this.RAF),this.RAF=!1),this.start=o.cloneObject(this.position),this.velocity={x:0,y:0,s:0}},i.resetAnimate=function(){this.stopAnimate(),this.settle=!0,this.drag=o.cloneObject(this.defaults),this.start=o.cloneObject(this.defaults),this.resting=o.cloneObject(this.defaults),this.position=o.cloneObject(this.defaults),this.attraction=o.cloneObject(this.defaults)},i.animate=function(){var e=function(){if(void 0!==this.position){var t=o.cloneObject(this.position);this.applyDragForce(),this.applyAttractionForce(),o.dispatchEvent(this,"toanimate","render",this),this.integratePhysics(),this.getRestingPosition(),this.render(100),this.RAF=requestAnimationFrame(e),this.checkSettle(t)}}.bind(this);this.RAF=requestAnimationFrame(e)},i.integratePhysics=function(){for(var t in this.position)void 0!==this.position[t]&&(this.position[t]+=this.velocity[t],this.position[t]="s"===t?Math.max(.1,this.position[t]):this.position[t],this.velocity[t]*=this.getFrictionFactor())},i.applyDragForce=function(){if(this.move)for(var t in this.drag)void 0!==this.drag[t]&&this.applyForce(t,this.drag[t]-this.position[t]-this.velocity[t])},i.applyAttractionForce=function(){if(!this.move)for(var t in this.attraction)void 0!==this.attraction[t]&&this.applyForce(t,(this.attraction[t]-this.position[t])*this.forces.attraction)},i.getRestingPosition=function(){for(var t in this.position)void 0!==this.position[t]&&(this.resting[t]=this.position[t]+this.velocity[t]/(1-this.getFrictionFactor()))},i.applyForce=function(t,e){this.velocity[t]+=e},i.getFrictionFactor=function(){return 1-this.forces.friction},i.roundValues=function(t,e){for(var i in t)void 0!==t[i]&&(e="s"===i?100*e:e,t[i]=Math.round(t[i]*e)/e)},i.checkSettle=function(t){if(!this.move){var e,i=0;for(e in this.position)if(void 0!==this.position[e]){var s="s"===e?1e4:100;Math.round(this.position[e]*s)===Math.round(t[e]*s)&&(++i===Object.keys(this.position).length&&this.restingFrames++)}}2<this.restingFrames&&(this.stopAnimate(),this.render(1<this.position.s?10:1),this.settle=!0,JSON.stringify(this.start)!==JSON.stringify(this.position)&&o.dispatchEvent(this,"toanimate","settle",this))},i.render=function(t){this.roundValues(this.position,t),o.translate(this.element,this.position.x,this.position.y,this.position.s)},e}),function(t,e){"function"==typeof define&&define.amd?define(["themeone-utils/utils","themeone-event/event","themeone-animate/animate"],e):"object"==typeof exports&&module.exports?module.exports=e(require("themeone-utils"),require("themeone-event"),require("themeone-animate")):t.ModuloBox=e(t.ThemeoneUtils,t.ThemeoneEvent,t.ThemeoneAnimate)}(this,function(m,t,n){var e=0,o={},s="mobx"+("1.4.5"+Math.random()).replace(/\D/g,""),r={uid:0},i={mediaSelector:".mobx",threshold:5,attraction:{slider:.055,slide:.018,thumbs:.016},friction:{slider:.62,slide:.18,thumbs:.22},rightToLeft:!1,loop:3,preload:1,unload:!1,timeToIdle:4e3,history:!1,mouseWheel:!0,contextMenu:!0,scrollBar:!0,fadeIfSettle:!1,controls:["close"],prevNext:!0,prevNextTouch:!1,counterMessage:"[index] / [total]",caption:!0,autoCaption:!1,captionSmallDevice:!0,thumbnails:!0,thumbnailsNav:"basic",thumbnailSizes:{1920:{width:110,height:80,gutter:10},1280:{width:90,height:65,gutter:10},680:{width:70,height:50,gutter:8},480:{width:60,height:44,gutter:5}},spacing:.1,smartResize:!0,overflow:!1,loadError:"Sorry, an error occured while loading the content...",noContent:"Sorry, no content was found!",prevNextKey:!0,scrollToNav:!1,scrollSensitivity:15,zoomTo:"auto",minZoom:1.2,maxZoom:4,doubleTapToZoom:!0,scrollToZoom:!1,pinchToZoom:!0,escapeToClose:!0,scrollToClose:!1,pinchToClose:!0,dragToClose:!0,tapToClose:!0,shareButtons:"facebook googleplus twitter pinterest linkedin reddit".split(" "),shareText:"Share on",sharedUrl:"deeplink",slideShowInterval:4e3,slideShowAutoPlay:!1,slideShowAutoStop:!1,countTimer:!0,countTimerBg:"rgba(255,255,255,0.25)",countTimerColor:"rgba(255,255,255,0.75)",mediaelement:!1,videoRatio:16/9,videoMaxWidth:1180,videoAutoPlay:!1,videoThumbnail:!1},a=function(t){this.options=m.extend(t,i),this.setVar()};return(t=a.prototype=Object.create(t.prototype)).init=function(){if(this.GUID)return o[this.GUID];this.GUID=++e,(o[this.GUID]=this).createDOM(),this.setAnimation(),this.getGalleries(),this.openFromQuery()},t.setVar=function(){var t=window,e=document,i=navigator;this.pre="mobx",this.gesture={},this.buttons={},this.slider={},this.slides={},this.cells={},this.states={},this.pointers=[],this.expando=s,this.cache=r,this.dragEvents=this.detectPointerEvents(),this.browser={touchDevice:"ontouchstart"in t||0<i.maxTouchPoints||0<i.msMaxTouchPoints,pushState:"history"in t&&"pushState"in history,fullScreen:this.detectFullScreen(),mouseWheel:"onwheel"in e.createElement("div")?"wheel":void 0!==e.onmousewheel?"mousewheel":"DOMMouseScroll"},this.iframeVideo=this.iframeVideo(),this.socialMedia=this.socialMedia()},t.detectPointerEvents=function(){var t=navigator;return t.pointerEnabled?{start:["pointerdown"],move:["pointermove"],end:["pointerup","pointercancel"]}:t.msPointerEnabled?{start:["MSPointerDown"],move:["MSPointerMove"],end:["MSPointerUp","MSPointerCancel"]}:{start:["mousedown","touchstart"],move:["mousemove","touchmove"],end:["mouseup","mouseleave","touchend","touchcancel"]}},t.detectFullScreen=function(){for(var t=["fullscreenEnabled","webkitFullscreenEnabled","mozFullScreenEnabled","msFullscreenEnabled"],e=0,i=t.length;e<i;e++)if(document[t[e]])return{element:["fullscreenElement","webkitFullscreenElement","mozFullScreenElement","msFullscreenElement"][e],request:["requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen"][e],change:["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"][e],exit:["exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen"][e]};return-1<(e=(t=this.options.controls).indexOf("fullScreen"))&&t.splice(e,1),null},t.iframeVideo=function(){return{youtube:{reg:/(?:www\.)?youtu\.?be(?:\.com)?\/?.*?(?:watch|embed)?(?:.*v=|v\/|watch%3Fv%3D|\/)([\w\-_]+)&?/i,url:"https://www.youtube.com/embed/[ID]?enablejsapi=1&rel=0&autoplay=1",share:"https://www.youtube.com/watch?v=[ID]",poster:"https://img.youtube.com/vi/[ID]/maxresdefault.jpg",thumb:"https://img.youtube.com/vi/[ID]/default.jpg",play:{event:"command",func:"playVideo"},pause:{event:"command",func:"pauseVideo"}},vimeo:{reg:/(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/(?:[^\/]*)\/videos\/|album\/(?:\d+)\/video\/|video\/)?(\d+)(?:[a-zA-Z0-9_\-]+)?/i,url:"https://player.vimeo.com/video/[ID]?autoplay=1&api=1",share:"https://vimeo.com/[ID]",poster:"https://vimeo.com/api/v2/video/[ID].json",play:{event:"command",method:"play"},pause:{event:"command",method:"pause"}},dailymotion:{reg:/(?:www\.)?(?:dailymotion\.com(?:\/embed)(?:\/video|\/hub)|dai\.ly)\/([0-9a-z]+)(?:[\-_0-9a-zA-Z]+#video=(?:[a-zA-Z0-9_\-]+))?/i,url:"https://dailymotion.com/embed/video/[ID]?autoplay=1&api=postMessage",share:"https://www.dailymotion.com/video/[ID]",poster:"https://www.dailymotion.com/thumbnail/video/[ID]",thumb:"https://www.dailymotion.com/thumbnail/video/[ID]",play:"play",pause:"pause"},wistia:{reg:/(?:www\.)?(?:wistia\.(?:com|net)|wi\.st)\/(?:(?:m|medias|projects)|embed\/(?:iframe|playlists))\/([a-zA-Z0-9_\-]+)/i,url:"https://fast.wistia.net/embed/iframe/[ID]?version=3&enablejsapi=1&html5=1&autoplay=1",share:"https://fast.wistia.net/embed/iframe/[ID]",poster:"https://fast.wistia.com/oembed?url=https://home.wistia.com/medias/[ID].json",play:{event:"cmd",method:"play"},pause:{event:"cmd",method:"pause"}}}},t.socialMedia=function(){return{facebook:"https://www.facebook.com/sharer/sharer.php?u=[url]",googleplus:"https://plus.google.com/share?url=[url]",twitter:"https://twitter.com/intent/tweet?text=[text]&url=[url]",pinterest:"https://www.pinterest.com/pin/create/button/?url=[url]&media=[image]&description=[text]",linkedin:"https://www.linkedin.com/shareArticle?url=[url]&mini=true&title=[text]",reddit:"https://www.reddit.com/submit?url=[url]&title=[text]",stumbleupon:"https://www.stumbleupon.com/badge?url=[url]&title=[text]",tumblr:"https://www.tumblr.com/share?v=3&u=[url]&t=[text]",blogger:"https://www.blogger.com/blog_this.pyra?t&u=[url]&n=[text]",buffer:"https://bufferapp.com/add?url=[url]title=[text]",digg:"https://digg.com/submit?url=[url]&title=[text]",evernote:"https://www.evernote.com/clip.action?url=[url]&title=[text]"}},t.createDOM=function(){this.DOM={};for(var t="holder overlay slider item item-inner ui top-bar bottom-bar share-tooltip counter caption caption-inner thumbs-holder thumbs-inner".split(" "),e=0;e<t.length;e++)this.DOM[m.camelize(t[e])]=m.createEl("div",this.pre+"-"+t[e]);this.appendDOM(this.DOM)},t.appendDOM=function(t){var e=this.options;t.holder.appendChild(t.overlay),t.holder.appendChild(t.slider),t.holder.appendChild(t.ui);for(var i=0;i<5;i++){var s=t.item.cloneNode(!0);s.appendChild(t.itemInner.cloneNode(!0)),t.slider.appendChild(s),this.slides[i]=s}this.slides.length=t.slider.children.length,this.createUI(t,e),t.holder.setAttribute("tabindex",-1),t.holder.setAttribute("aria-hidden",!0),this.DOM.comment=document.createComment(" ModuloBox (v1.4.5) by Themeone "),document.body.appendChild(this.DOM.comment),m.dispatchEvent(this,"modulobox","beforeAppendDOM",t),document.body.appendChild(t.holder),t.topBar.height=t.topBar.clientHeight},t.createUI=function(t,e){var i=e.controls.indexOf("share");if(-1<i){for(var s=e.shareButtons,o=s.length;o--;)this.socialMedia.hasOwnProperty(s[o])||s.splice(o,1);s.length?(t.ui.appendChild(t.shareTooltip),e.shareText&&(t.shareTooltip.appendChild(m.createEl("span")).textContent=e.shareText),this.createButtons(s,t.shareTooltip,"shareOn")):e.controls.splice(i,1)}(e.controls.length||e.counterMessage)&&(i=e.controls.indexOf("play"),t.ui.appendChild(t.topBar),e.counterMessage&&t.topBar.appendChild(t.counter),e.slideShowInterval<1&&-1<i&&e.controls.splice(i,1),e.countTimer&&-1<i&&((i=this.DOM.timer=m.createEl("canvas",this.pre+"-timer")).setAttribute("width",48),i.setAttribute("height",48),t.topBar.appendChild(i)),e.controls.length&&(i=e.controls.slice(),this.createButtons(i.reverse(),t.topBar))),(e.caption||e.thumbnails)&&(t.ui.appendChild(t.bottomBar),e.caption&&t.bottomBar.appendChild(t.caption).appendChild(t.captionInner),e.thumbnails&&t.bottomBar.appendChild(t.thumbsHolder).appendChild(t.thumbsInner)),e.prevNext&&this.createButtons(["prev","next"],t.ui)},t.createButtons=function(t,e,i){for(var s=t.length,o=0;o<s;o++){var n=t[o];this.buttons[n]=m.createEl("BUTTON",this.pre+"-"+n.toLowerCase()),e.appendChild(this.buttons[n]),(n&&"function"==typeof this[n]||i)&&(this.buttons[n].event=i||n,this.buttons[n].action=n,"shareOn"===i&&this.buttons[n].setAttribute("title",n.charAt(0).toUpperCase()+n.slice(1)))}},t.getGalleries=function(){this.galleries={};var e=this.options.mediaSelector,t="";if(!e)return!1;try{t=document.querySelectorAll(e)}catch(t){m.error('Your current mediaSelector is not a valid selector: "'+e+'"')}e=0;for(var i=t.length;e<i;e++){var s=t[e],o={};if(o.src="A"===s.tagName?s.getAttribute("href"):null,o.src="IMG"===s.tagName?s.currentSrc||s.src:o.src,o.src=s.getAttribute("data-src")||o.src,o.src&&(this.getMediaAtts(s,o),this.setMediaType(o),o.type)){this.getMediaThumb(s,o),this.getVideoThumb(o),this.getMediaCaption(s,o),this.setMediaCaption(o);var n=this.setGalleryName(s);this.setGalleryFeatures(n,o),o.index=n.length,n.push(o),this.setMediaEvent(s,n.name,o.index)}}m.dispatchEvent(this,"modulobox","updateGalleries",this.galleries)},t.addMedia=function(t,e){if(!e||"object"!=typeof e)return m.error("No media was found to addMedia() in a gallery"),!1;t=""===t?1:t;var i=this.galleries[t];(i=i||(this.galleries[t]=[])).name=t;for(var s=e.length,o=0;o<s;o++){var n=m.cloneObject(e[o]);n.src&&(this.setMediaType(n),this.getVideoThumb(n),this.setMediaCaption(n),this.setGalleryFeatures(i,n),n.index=i.length,i.push(n))}},t.setMediaType=function(t){if(!(-1<["image","video","iframe","HTML"].indexOf(t.type))){t.type=null;var e=t.src?t.src:null,i=(e.split(/[?#]/)[0]||e).substr(2+(~-e.lastIndexOf(".")>>>0));if(/(jpg|jpeg|png|bmp|gif|tif|tiff|jfi|jfif|exif|svg)/i.test(i)||-1<["external.xx.fbcdn","drscdn.500px.org"].indexOf(e))t.type="image",t.src=this.getSrc(e);else if(/(mp4|webm|ogv)/i.test(i))t.type="video",t.format="html5";else{var s,o=this.iframeVideo;for(s in o)if(o.hasOwnProperty(s)&&(i=e.match(o[s].reg))&&i[1]){e=o[s],t.type="video",t.format=s,t.share=e.share.replace("[ID]",i[1]),t.src=e.url.replace("[ID]",i[1]),t.pause=e.pause,t.play=e.play,this.options.videoThumbnail&&(t.poster=!t.poster&&e.poster?e.poster.replace("[ID]",i[1]):t.poster,t.thumb=!t.thumb&&e.poster?e.poster.replace("[ID]",i[1]):t.thumb);break}}}},t.getSrc=function(t){var e=(t||"").split(/,/),i=e.length,s=0;if(i<=1)return t;for(var o=0;o<i;o++){var n=e[o].replace(/\s+/g," ").trim().split(/ /),r=parseFloat(n[1])||0;("w"===(n[1]?n[1].slice(-1):null)&&screen.width>=r&&s<r||!r||0===o)&&(s=r,t=n[0])}return t},t.getMediaAtts=function(t,e){var i=this.options.autoCaption,s=this.getAttr(t),o=t.firstElementChild;o="IMG"!==t.tagName&&o&&"IMG"===o.tagName?o:t,e.type=e.type?e.type:s.type||t.getAttribute("data-type"),e.title=s.title||t.getAttribute("data-title")||(i?o.title:null),e.desc=s.desc||t.getAttribute("data-desc")||(i?o.alt:null),e.thumb=s.thumb||t.getAttribute("data-thumb"),e.poster=this.getSrc(s.poster||t.getAttribute("data-poster")),e.width=s.width||t.getAttribute("data-width"),e.height=s.height||t.getAttribute("data-height"),e.title===e.desc&&(e.desc=null)},t.getMediaThumb=function(t,e){var i=t.getElementsByTagName("img");!e.thumb&&i[0]&&(e.thumb=i[0].src)},t.getVideoThumb=function(e){if(this.options.videoThumbnail&&"video"===e.type&&"html5"!==e.format){var t=e.poster&&-1<e.poster.indexOf(".json"),i=e.thumb&&-1<e.thumb.indexOf(".json");if(t||i){t=t?e.poster:e.thumb;var s=new XMLHttpRequest;s.onload=function(t){t=t.target.responseText,(t=(t=JSON.parse(t)).hasOwnProperty(0)?t[0]:t)&&(e.poster=t.thumbnail_large||t.thumbnail_url,e.dom&&(e.dom.style.backgroundImage='url("'+e.poster+'")'),i&&(t=t.thumbnail_small||t.thumbnail_url,"object"==typeof e.thumb?e.thumb.style.backgroundImage='url("'+t+'")':e.thumb=t))}.bind(this),s.open("GET",encodeURI(t),!0),setTimeout(function(){s.send()},0)}}},t.getMediaCaption=function(t,e){var i=t.nextElementSibling;i&&"FIGCAPTION"===i.tagName&&(i=i.innerHTML,e.title?e.desc||(e.desc=i):e.title=i)},t.setMediaCaption=function(t){t.title=t.title?'<div class="'+this.pre+'-title">'+t.title.trim()+"</div>":"",t.desc=t.desc?'<div class="'+this.pre+'-desc">'+t.desc.trim()+"</div>":"",t.caption=t.title+t.desc},t.getGalleryName=function(t){for(var e=0;t&&e<2;){if((t=t.parentNode)&&"FIGURE"===t.tagName&&t.parentNode)return t.parentNode.getAttribute("id");e++}},t.setGalleryName=function(t){var e=this.getAttr(t).rel||t.getAttribute("data-rel");return e=(e=e||this.getGalleryName(t))?e:Object.keys(this.galleries).length+1,(t=(t=this.galleries[e])?t:this.galleries[e]=[]).name=e,t},t.setGalleryFeatures=function(t,e){t.zoom||"image"!==e.type||(t.zoom=!0),t.download||"image"!==e.type&&"html5"!==e.format||(t.download=!0)},t.setMediaEvent=function(t,e,i){t.mobxListener&&t.removeEventListener("click",t.mobxListener,!1),t.mobxListener=this.open.bind(this,e,i),t.addEventListener("click",t.mobxListener,!1)},t.open=function(t,e,i){return i&&(i.preventDefault(),i.stopPropagation()),!!this.GUID&&(this.galleries.hasOwnProperty(t)?this.galleries[t].length?this.galleries[t][e]?(m.dispatchEvent(this,"modulobox","beforeOpen",t,e),this.slides.index=e,this.gallery=this.galleries[t],this.gallery.name=t,this.gallery.index=e,this.gallery.loaded=!1,this.removeContent(),this.wrapAround(),this.hideScrollBar(),this.setSlider(),this.setThumbs(),this.setCaption(),this.setMedia(this.options.preload),this.updateMediaInfo(),this.replaceState(),this.setControls(),this.bindEvents(!0),this.show(),this.options.videoAutoPlay&&this.appendVideo(),this.options.slideShowAutoPlay&&-1<this.options.controls.indexOf("play")&&(!this.options.videoAutoPlay||"video"!==this.galleries[t][e].type)&&this.startSlideShow(),this.states.zoom=!1,void(this.states.open=!0)):(m.error("Sorry, no media was found for the current media index: "+e),!1):(m.error("Sorry, no media was found for the current gallery."),!1):(m.error('This gallery name:"'+t+'", does not exist!'),!1))},t.openFromQuery=function(){var t=this.getQueryString(window.location.search);t.hasOwnProperty("guid")&&t.hasOwnProperty("mid")&&!1===this.open(decodeURIComponent(t.guid),decodeURIComponent(t.mid)-1)&&this.replaceState(!0)},t.show=function(){var t=this.DOM.holder,e=this.options.rightToLeft?"add":"remove";t.setAttribute("aria-hidden",!1),m.removeClass(t,this.pre+"-idle"),m.removeClass(t,this.pre+"-panzoom"),m.removeClass(t,this.pre+"-will-close"),m[e+"Class"](t,this.pre+"-rtl"),m.addClass(t,this.pre+"-open")},t.close=function(t){t&&t.preventDefault(),t=this.DOM.holder;var e=this.gallery;m.dispatchEvent(this,"modulobox","beforeClose",e?e.name:"undefined",e?e.index:"undefined"),this.states.fullScreen&&(this.exitFullScreen(),m.removeClass(t,this.pre+"-fullscreen")),this.share(),this.stopSlideShow(),this.pauseVideo(),this.bindEvents(!1),this.replaceState(!0),this.hideScrollBar(),t.setAttribute("aria-hidden",!0),m.removeClass(t,this.pre+"-open"),this.states.open=!1},t.setControls=function(){var t=this.gallery,e=this.options,i=this.buttons;this.DOM.counter&&(this.DOM.counter.style.display=1<t.initialLength?"":"none"),-1<e.controls.indexOf("play")&&(i.play.style.display=1<t.initialLength?"":"none"),-1<e.controls.indexOf("zoom")&&(i.zoom.style.display=t.zoom?"":"none"),-1<e.controls.indexOf("download")&&(i.download.style.display=t.download?"":"none"),this.setPrevNextButtons()},t.setPrevNextButtons=function(){if(this.options.prevNext){var t=this.slider.width<680&&this.browser.touchDevice&&!this.options.prevNextTouch;this.buttons.prev.style.display=this.buttons.next.style.display=1<this.gallery.length&&!t?"":"none"}},t.setCaption=function(){this.states.caption=!(!this.options.captionSmallDevice&&(this.slider.width<=480||this.slider.height<=480)),this.DOM.caption.style.display=this.states.caption?"":"none"},t.hideScrollBar=function(){if(!this.options.scrollBar){var t=this.states.open;document.body.style.overflow=document.documentElement.style.overflow="undefined"!==t&&t?"":"hidden"}},t.bindEvents=function(t){var e,i,s=window,o=document,n=this.options,r=this.DOM.holder,a=this.buttons;for(i in a)a.hasOwnProperty(i)&&m.handleEvents(this,"share"!==i?a[i]:s,["click","touchend"],a[i].event,t);m.handleEvents(this,r,this.dragEvents.start,"touchStart",t),m.handleEvents(this,s,["keydown"],"keyDown",t),m.handleEvents(this,s,["resize","orientationchange"],"resize",t),m.handleEvents(this,r,["transitionend","webkitTransitionEnd","oTransitionEnd","otransitionend","MSTransitionEnd"],"opened"),m.handleEvents(this,r,["touchend"],"disableZoom",t),this.browser.fullScreen&&m.handleEvents(this,o,[this.browser.fullScreen.change],"toggleFullScreen",t),n.history&&m.handleEvents(this,s,["mouseout"],"mouseOut",t),0<n.timeToIdle&&m.handleEvents(this,r,["mousemove"],"mouseMove",t),n.contextMenu||m.handleEvents(this,r,["contextmenu"],"contextMenu",t),n.mouseWheel||this.disableScroll(t),n.scrollToZoom?e="scrollToZoom":n.scrollToNav?e="scrollToNav":n.scrollToClose&&(e="scrollToClose"),e&&m.handleEvents(this,r,[this.browser.mouseWheel],e,t)},t.opened=function(t){if("visibility"===t.propertyName&&t.target===this.DOM.holder){t=this.gallery.name;var e=this.gallery.index;this.states.open?m.dispatchEvent(this,"modulobox","afterOpen",t,e):(this.removeContent(),m.dispatchEvent(this,"modulobox","afterClose",t,e))}},t.mouseOut=function(t){(t=(t=t||window.event).relatedTarget||t.toElement)&&"HTML"!==t.nodeName||this.replaceState()},t.mouseMove=function(){var t=this.DOM.holder,e=this.pre+"-idle";clearTimeout(this.states.idle),this.states.idle=setTimeout(function(){m.hasClass(t,this.pre+"-open-tooltip")||m.addClass(t,e)}.bind(this),this.options.timeToIdle),m.removeClass(t,e)},t.contextMenu=function(t){var e=t.target,i=e.tagName;e=e.className,("IMG"===i||"VIDEO"===i||-1<e.indexOf(this.pre+"-video")||-1<e.indexOf(this.pre+"-thumb-bg")||e===this.pre+"-thumb")&&t.preventDefault()},t.disableScroll=function(t){var e=document,i=window;i.onwheel=i.ontouchmove=i.onmousewheel=e.onmousewheel=e.onmousewheel=t?function(t){if(this.isEl(t)&&(t=t||i.event).preventDefault)return t.preventDefault(),t.returnValue=!1}.bind(this):null},t.scrollToZoom=function(t){if(this.isEl(t)){var e=this.normalizeWheel(t);if(e&&e.deltaY){var i=this.getCell();i=i.attraction.s||i.position.s,i=Math.min(this.options.maxZoom,Math.max(1,i-Math.abs(e.deltaY)/e.deltaY)),this.stopSlideShow(),this.zoomTo(t.clientX,t.clientY,Math.round(10*i)/10)}}},t.scrollToNav=function(t){this.isEl(t)&&(t=this.normalizeWheel(t))&&t.delta&&this[t.delta*this.isRTL()<0?"prev":"next"]()},t.scrollToClose=function(t){this.isEl(t)&&(t.preventDefault(),this.close())},t.disableZoom=function(t){for(var e=t.target;e;){if(-1<["VIDEO","INPUT","A"].indexOf(e.tagName))return;e=e.parentElement}t.preventDefault()},t.resize=function(t){this.DOM.topBar.height=this.DOM.topBar.clientHeight,this.share(),this.setSlider(),this.setThumbsPosition(),this.setCaption(),this.resizeMedia(),this.updateMediaInfo(),this.setPrevNextButtons(),this.states.zoom=!1,m.removeClass(this.DOM.holder,this.pre+"-panzoom"),m.dispatchEvent(this,"modulobox","resize",t)},t.resizeMedia=function(){for(var t=this.slides,e=0;e<t.length&&this.gallery;e++){var i=this.gallery[t[e].media];i&&(i.dom&&i.dom.loaded||i.dom&&-1<["video","iframe","HTML"].indexOf(i.type))&&this.setMediaSize(i,t[e])}},t.isEl=function(t){return-1<(t="string"==typeof(t=t.target.className)?t:t.baseVal).indexOf(this.pre)},t.isZoomable=function(){var t=this.getMedia(),e=!1;return"image"===t.type&&t.dom&&t.dom.size&&1<t.dom.size.scale&&(e=!0),this.DOM.holder.setAttribute("data-zoom",e),e},t.isDownloadable=function(){var t=this.getMedia(),e=!0;return"image"!==t.type&&"html5"!==t.format&&(e=!1),this.DOM.holder.setAttribute("data-download",e),e},t.isRTL=function(){return this.options.rightToLeft?-1:1},t.addAttr=function(t,e){if(void 0===t[this.expando]){var i=this.cache.uid++;t[this.expando]=i,this.cache[i]={}}else i=t[this.expando];for(var s in e)e.hasOwnProperty(s)&&(this.cache[i][s]=e[s])},t.getAttr=function(t){return this.cache[t[this.expando]]||{}},t.getThumbHeight=function(){var t=this.thumbs;return 0<t.height&&0<t.width?t.height+2*Math.min(10,t.gutter):0},t.getMedia=function(){var t=this.gallery;return t?t[t.index]:null},t.getCell=function(){var t=this.slides;return t=m.modulo(t.length,t.index),this.cells[t]},t.removeContent=function(){for(var t=0;t<this.slides.length;t++){var e=this.slides[t];this.unloadMedia(e),this.removeMedia(e),e.index=e.media=null}this.removeMedia(this.DOM.thumbsHolder)},t.getQueryString=function(t){var e={};return t.substr(1).split("&").forEach(function(t){t=t.split("="),e[decodeURIComponent(t[0])]=1<t.length?decodeURIComponent(t[1]):""}),e},t.setQueryString=function(t){var e=window.location.search,i=this.getQueryString(e);for(var s in e=decodeURI(e),t)if(t.hasOwnProperty(s)){var o=encodeURIComponent(t[s]);if(i.hasOwnProperty(s)){var n=i[s];o?e=e.replace(s+"="+n,s+"="+o):e=(e=e.replace("&"+s+"="+n,"")).replace(s+"="+n,"")}else e=o?e+(e?"&":"?")+s+"="+o:e.replace(s+"=","")}return t=[location.protocol,"//",location.host,location.pathname].join(""),e=e.substr(1)?e:e.substr(1),encodeURI(t+e)},t.replaceState=function(t){if((this.options.history||t)&&this.browser.pushState&&!this.states.push){var e=window.history.state;if(t={guid:t?"":this.gallery.name,mid:t?"":m.modulo(this.gallery.initialLength,this.gallery.index)+1},!e||e.mid!==t.mid){e=this.setQueryString(t);try{window.history.replaceState(t,"",e)}catch(t){this.options.history=!1,m.error("SecurityError: A history state object with origin 'null' cannot be created. Please run the script on a server.")}}}this.states.push=!1},t.normalizeWheel=function(t){var e,i,s=t||window.event,o=null;return t.preventDefault(),"detail"in s&&(i=-1*s.detail),"wheelDelta"in s&&(i=-1*s.wheelDelta),"wheelDeltaY"in s&&(i=-1*s.wheelDeltaY),"wheelDeltaX"in s&&(e=-1*s.wheelDeltaX),"deltaY"in s&&(i=s.deltaY),"deltaX"in s&&(e=-1*s.deltaX),1===s.deltaMode?(e*=40,i*=40):2===s.deltaMode&&(e*=100,i*=100),t=Math.abs(e)>Math.abs(i)?e:i,t=Math.min(100,Math.max(-100,t)),Math.abs(t)<this.options.scrollSensitivity?this.states.prevDelta=t:(s=+new Date,(Math.abs(t)>Math.abs(this.states.prevDelta)||60<s-this.states.prevScroll)&&(o={deltaX:e,deltaY:i,delta:t}),this.states.prevDelta=t,this.states.prevScroll=s),o},t.share=function(t){if(!t||"VIDEO"!==t.target.tagName){var e=this.DOM.holder,i=this.pre+"-open-tooltip",s=t?t.target.className:null,o=m.hasClass(e,i)?"remove":"add";("remove"!==o||s===this.pre+"-share"&&t)&&s!==this.pre+"-share"||("add"===o&&this.setShareTooltip(),m[o+"Class"](e,i))}},t.shareOn=function(t){var e=t.target.action,i=this.gallery,s=this.getMedia();if(t="image"===s.type?s.src:s.poster,e=this.socialMedia[e]){"page"===this.options.sharedUrl?i=[location.protocol,"//",location.host,location.pathname].join(""):"deeplink"===this.options.sharedUrl||-1<["iframe","HTML"].indexOf(s.type)?i=this.setQueryString({guid:i.name,mid:i.index+1}):(i=s.src.replace(/\s/g,"").split(",")[0],"video"===s.type&&"html5"!==s.format&&(i=s.share));var o=m.createEl("a");o.href=t,t=o.href,o.href=i,i=o.href,(o=m.createEl("div")).innerHTML=s.caption,s=(o.textContent||o.innerText).replace(/\s+/g," ").trim()||"",(e=e.replace("[url]",encodeURIComponent(i)).replace("[image]",encodeURIComponent(t)).replace("[text]",encodeURIComponent(s||document.title)))&&window.open(e,this.pre+"_share","status=0,resizable=1,location=1,toolbar=0,width=626,height=436,top="+Math.round(window.screenY+(window.outerHeight-436)/2)+",left="+Math.round(window.screenX+(window.outerWidth-626)/2))}else m.error("This social share media does not exist");return!1},t.setShareTooltip=function(){if(-1<this.options.controls.indexOf("share")){var t="right",e=this.DOM.shareTooltip,i=e.clientWidth,s=this.buttons.share.getBoundingClientRect();(i=s.left-i+s.width/2+20)<0&&(t="left",i=s.left+s.width/2-20),e.setAttribute("data-position",t),e.style.top=this.DOM.topBar.height+6+"px",e.style.left=i+"px"}},t.download=function(){if(!this.isDownloadable())return!1;var t=this.getMedia().src.replace(/\s/g,"").split(",")[0],e=document.createElement("a"),i=t.split("/");e.href=t,e.download=i.pop().split("?")[0],e.setAttribute("target","_blank"),document.body.appendChild(e),e.click(),document.body.removeChild(e)},t.fullScreen=function(){document[this.browser.fullScreen.element]?this.exitFullScreen():this.requestFullScreen()},t.toggleFullScreen=function(){var t=this.DOM.holder,e=document[this.browser.fullScreen.element];e?e===t&&(this.setShareTooltip(),this.states.fullScreen=!0,m.addClass(t,this.pre+"-fullscreen")):(this.share(),this.states.fullScreen=!1,m.removeClass(t,this.pre+"-fullscreen")),this.videoFullScreen()},t.requestFullScreen=function(){var t=this.browser.fullScreen.request;document.documentElement[t]&&this.DOM.holder[t]()},t.exitFullScreen=function(){var t=this.browser.fullScreen.exit;document[t]&&document[t]()},t.play=function(){this.states.play?this.stopSlideShow():this.startSlideShow()},t.startSlideShow=function(){var i=0,s=this.gallery,o=this.options,n=this.states.loop,r=o.slideShowAutoStop,a=Math.max(120,o.slideShowInterval),h=o.countTimer,l=h&&this.DOM.timer?this.DOM.timer.getContext("2d"):null,d=function(t){if(t=t||+new Date,i=i||t,n&&!r||s.index!==s.initialLength-1){if(h&&l){var e=Math.PI/180*Math.min(1,(t-i+a)/a-1)*360;l.clearRect(0,0,48,48),this.timerProgress(l,o.countTimerBg,100),this.timerProgress(l,o.countTimerColor,e)}i+a<=t&&(i=t,this.slideTo(this.slides.index+1,!0)),this.timer=requestAnimationFrame(d)}else this.stopSlideShow()}.bind(this);m.addClass(this.DOM.holder,this.pre+"-autoplay"),this.states.play=!0,this.timer=requestAnimationFrame(d)},t.stopSlideShow=function(){cancelAnimationFrame(this.timer),m.removeClass(this.DOM.holder,this.pre+"-autoplay"),this.states.play=!1},t.timerProgress=function(t,e,i){var s=1.5*Math.PI;t.strokeStyle=e,t.lineWidth=5,t.beginPath(),t.arc(24,24,18,s,s+i,!1),t.stroke()},t.appendVideo=function(){var t=this.getMedia();if("video"===t.type){if(m.addClass(t.dom,this.pre+"-loading"),m.removeClass(t.dom,this.pre+"-playing"),!t.video){if("html5"===t.format){t.video=m.createEl("video"),t.video.setAttribute("controls",""),t.video.setAttribute("autoplay","");for(var e=t.src.replace(/\s/g,"").split(","),i=0;i<e.length;i++){var s=document.createDocumentFragment(),o=m.createEl("source"),n=/^.+\.([^.]+)$/.exec(e[i]);n&&-1<["mp4","webm","ogv"].indexOf(n[1])&&(o.src=e[i],o.setAttribute("type","video/"+("ogv"===n[1]?"ogg":n[1])),s.appendChild(o)),t.video.appendChild(s)}}else t.format&&(t.video=m.createEl("iframe"),t.video.src=t.src,t.video.setAttribute("frameborder",0),t.video.setAttribute("allowfullscreen",""));t.video.setAttribute("width","100%"),t.video.setAttribute("height","100%")}t.dom.firstChild||(t.dom.appendChild(t.video),"html5"!==t.format&&(t.video.loaded=!1)),this.playVideo(t)}},t.onVideoLoaded=function(t){t.video.loaded=!0,m.removeClass(t.dom,this.pre+"-loading"),m.addClass(t.dom,this.pre+"-playing"),this.cloneVideo(t)},t.cloneVideo=function(t){if(this.states.loop&&"html5"===t.format)for(var e=this.gallery,i=e.length,s=e.initialLength,o=m.modulo(s,t.index),n=0;n<i;n++)m.modulo(s,e[n].index)===o&&e[n].index!==t.index&&(e[n].video=t.video)},t.videoFullScreen=function(){var t=this.getMedia(),e=this.states.fullScreen;"video"===t.type&&"html5"!==t.format&&t.video&&t.video[e?"removeAttribute":"setAttribute"]("allowfullscreen","")},t.playVideo=function(e){if(e.video.loaded)if(e.video.getClientRects(),m.removeClass(e.dom,this.pre+"-loading"),m.addClass(e.dom,this.pre+"-playing"),"html5"!==e.format){if(e.play){var t="object"==typeof e.play?JSON.stringify(e.play):String(e.play);e.video.contentWindow.postMessage(t,"*")}}else e.video.error||("function"==typeof MediaElementPlayer&&this.options.mediaelement?((t="VIDEO"===e.video.tagName?e.video:e.video.getElementsByTagName("video")[0]).player&&t.player.setControlsSize(),t.play()):e.video.play());else{var i=this;"function"!=typeof MediaElementPlayer||e.play||!this.options.mediaelement||e.video.player?e.video.onload||(e.video.onload=e.video.onerror=e.video.onloadedmetadata=function(){e.dom.firstChild&&(i.onVideoLoaded(e),i.videoFullScreen())},e.video.src=e.src.replace(/\s/g,"").split(",")[0]):new MediaElementPlayer(e.video,{features:"playpause stop current progress duration volume fullscreen".split(" "),videoVolume:"horizontal",startVolume:.8,classPrefix:"mejs-",keyActions:[],enableKeyboard:!1,iPadUseNativeControls:!0,iPhoneUseNativeControls:!0,AndroidUseNativeControls:!0,success:function(t){t.addEventListener("loadeddata",function(){if(e.video=e.dom.lastChild,e.video){var t=e.video.previousSibling;t&&t.parentNode&&t.parentNode.removeChild(t),i.onVideoLoaded(e)}},e,!1)},error:function(){i.onVideoLoaded(e)}})}},t.pauseVideo=function(){var t=this.getMedia();if(t&&"video"===t.type&&t.video)if(m.removeClass(t.dom,this.pre+"-playing"),t.video.loaded)if("html5"===t.format)"function"==typeof MediaElementPlayer&&this.options.mediaelement?("VIDEO"===t.video.tagName?t.video:t.video.getElementsByTagName("video")[0]).pause():t.video.pause();else if(t.pause&&"dailymotion"!==t.format){var e="object"==typeof t.pause?JSON.stringify(t.pause):String(t.pause);t.video.contentWindow.postMessage(e,"*")}else t.dom.innerHTML="",t.video=null;else t.dom.innerHTML="",m.removeClass(t.dom,this.pre+"-loading")},t.insertMedia=function(t,e){var i=this.gallery[t];i&&(void 0===i.index&&(i.index=this.gallery.indexOf(i)),this.buildMedia(i),this.appendMedia(i,e),this.loadMedia(i,e))},t.buildMedia=function(t){if(void 0===t.dom){switch(t.type){case"image":t.dom=m.createEl("img",this.pre+"-img"),t.dom.src=t.src;break;case"video":t.dom=m.createEl("div",this.pre+"-video"),t.poster?t.dom.style.backgroundImage='url("'+t.poster+'")':t.dom.loaded=!0;break;case"iframe":t.dom=m.createEl("iframe",this.pre+"-iframe"),t.dom.setAttribute("allowfullscreen",""),t.dom.setAttribute("frameborder",0),t.dom.src=t.src;break;case"HTML":var e=document.querySelector(t.src);t.dom=m.createEl("div",this.pre+"-html"),t.dom.appendChild(m.createEl("div",this.pre+"-html-inner")),t.dom.firstChild.innerHTML=e?e.innerHTML:null,t.src=e||"",t.dom.loaded=!0}t.type&&t.src||(t.dom=m.createEl("div",this.pre+"-error"),t.dom.textContent=this.options.noContent,t.dom.loaded=!0,t.dom.error=!0,m.dispatchEvent(this,"modulobox","noContent",this.gallery.name,parseInt(t.index,10)))}},t.appendMedia=function(t,e){var i=this.slides[e],s=i.firstChild;if(s.childElementCount){var o=s.lastChild,n=s.firstChild;n.style.visibility="",t.dom!==o&&s[1===s.childElementCount?"appendChild":"replaceChild"](t.dom,o)}else o=document.createDocumentFragment(),n=m.createEl("div",this.pre+"-loader"),o.appendChild(n),o.appendChild(t.dom),s.appendChild(o);i.media=t.index},t.loadMedia=function(e,i){if(e.dom.loaded)this.showMedia(e,i);else{var s=this,t="iframe"===e.type?e.dom:e.dom.img=new Image,o=function(){e.dom.error||m.dispatchEvent(s,"modulobox","loadComplete",s.gallery.name,parseInt(e.index,10)),e.dom.loaded="iframe"!==e.type,s.showMedia(e,i)};t.onload=o,t.onerror=function(t){"video"!==e.type&&(e.dom=m.createEl("p",s.pre+"-error"),e.dom.textContent=s.options.loadError,e.dom.error=!0,s.appendMedia(e,i)),m.dispatchEvent(s,"modulobox","loadError",s.gallery.name,parseInt(e.index,10)),o()},t.src="video"===e.type?e.poster:e.src}},t.unloadMedia=function(t){this.gallery&&(t=this.gallery[t.media])&&t.dom&&(!this.options.unload||"image"!==t.type||t.dom.loaded||t.dom.complete||t.dom.naturalWidth?"video"===t.type&&"html5"!==t.format&&t.dom.firstChild&&(t.video=null,t.dom.removeChild(t.dom.firstChild)):(t.dom.onload=null,t.dom.onerror=null,t.dom.src="",t.dom.img&&(t.dom.img.onload=null,t.dom.img.onerror=null,t.dom.img.src="",delete t.dom.img),delete t.dom))},t.removeMedia=function(t){if(t=t.firstChild)for(;t.firstChild;)t.removeChild(t.firstChild)},t.showMedia=function(t,e){var i=this.slider;if(!this.options.fadeIfSettle||i.settle||t.dom.revealed){i=this.slides[e];var s=this.gallery,o=i.firstChild.firstChild,n=this.options.preload;this.setMediaSize(t,i),t.index===s.index&&this.isZoomable(),m.addClass(t.dom,this.pre+"-media-loaded"),t.dom.revealed=!0,i.media===t.index&&(o.style.visibility="hidden",s.loaded+=1,s.loaded===n&&n<4&&this.setMedia(n+2)),"iframe"===t.type&&(t.dom.loaded=!1)}},t.setMediaSize=function(t,e){var i=t.dom,s=this.slider,o=i.viewport,n=this.getThumbHeight();i.error||(o&&o.width===s.width&&o.height===s.height-n||(this.getCaptionHeight(t,e),this.getMediaSize(t,e),this.fitMediaSize(t,e),this.setMediaOffset(t,e)),(s=i.style).width=i.size.width+"px",s.height=i.size.height+"px",s.left=i.offset.left+"px",s.top=i.offset.top+"px")},t.getCaptionHeight=function(t,e){var i=this.DOM.captionInner,s=this.DOM.topBar.height,o=i.innerHTML,n=this.getThumbHeight();this.options.caption&&this.states.caption&&t.caption?(i.innerHTML=t.caption,i.height=Math.max(s,parseInt(i.clientHeight,10))||s,i.innerHTML=o):i.height=n?0:s,e.width=this.slider.width,e.height=this.slider.height-s-i.height-n},t.getMediaSize=function(t,e){var i=t.dom.size={};switch(t.type){case"image":i.width=t.dom.naturalWidth,i.height=t.dom.naturalHeight;break;case"video":i.width=this.options.videoMaxWidth,i.height=i.width/this.options.videoRatio;break;case"iframe":i.width=t.width?t.width:680<e.width?.8*e.width:e.width,i.height=t.height?t.height:e.height;break;case"HTML":i.width=t.width?t.width:e.width,i.height=t.height?t.height:e.height}},t.fitMediaSize=function(t,e){var i,s,o=this.slider,n=this.options,r=n.zoomTo,a=t.dom.size,h=a.width/a.height,l=this.getThumbHeight(),d=o.width<=480||o.height<=680,u=["video","iframe","HTML"].indexOf(t.type)<0,p=[e.height];(n.smartResize&&d||n.overflow)&&u&&p.unshift(o.height-l),p.forEach(function(t){(!s||s<o.height-l)&&(i=(i=Math.min(a.width,h*t))>e.width?e.width:Math.round(i),s=(s=Math.ceil(1/h*i))%t<2?t:s)}),d=Number((a.width/i).toFixed(3)),t.dom.size={width:i,height:s,scale:d>=n.minZoom?Math.min(n.maxZoom,"auto"===r?d:r):1}},t.setMediaOffset=function(t,e){var i=t.dom.size,s=this.slider,o=this.DOM.topBar.height,n=this.getThumbHeight(),r=0;i.height<=e.height&&(r=o+.5*(e.height-i.height)),t.dom.offset={top:r<0?0:Math.round(r),left:Math.round(.5*(e.width-i.width))},t.dom.viewport={width:s.width,height:s.height-n}},t.mediaViewport=function(t){var e=this.getMedia();if(!e.dom||!e.dom.size)return{top:0,bottom:0,left:0,right:0};var i=e.dom.size,s=e.dom.offset,o=this.slider.height;e=this.slider.width;var n=.5*(o-i.height),r=2*s.top-n;r=(n=.5*(n-r))*t-2*n-r,s=i.width/2*(t-1)-s.left;var a=i.height*t<=o?n*t:-i.height/2*(t-1)+o-i.height+r;return o=i.height*t<=o?n*t:i.height/2*(t-1)+r,{top:t<=1?0:Math.round(a),bottom:t<=1?0:Math.round(o),left:i.width*t<e?0:Math.round(s),right:i.width*t<e?0:Math.round(-s)}},t.setMedia=function(t){var e,i=this.gallery,s=this.slides,o=this.states.loop,n=this.isRTL(),r=Math.round(-n*this.slider.position.x/s.width),a=i.initialLength-1,h=0;if(n=[],!t&&!i.loaded){for(e=t=0;e<s.length;e++)s[e].firstChild.childElementCount&&t++;t+=2,i.loaded=this.options.preload}switch(t){case 0:case 1:n=[0];break;case 2:case 3:n=[-1,0,1];break;default:t=5,n=[-2,-1,0,1,2]}for(o||(e=r+n[t-1],t=r+n[0],h=t<0?-t:0,h=a<e?a-e:h),n=n.map(function(t){return m.modulo(i.length,t+h+r)}),e=0;e<s.length;e++)a=s[e],t=m.modulo(i.length,a.index),!o&&a.index>t||!(-1<n.indexOf(t))||a.media===t||(this.unloadMedia(a),this.insertMedia(t,e))},t.updateMediaInfo=function(){var t=this.gallery;t.index=m.modulo(t.length,this.slides.index),this.isZoomable(),this.isDownloadable(),this.updateCounter(),this.updateCaption(),this.updateThumbs(),m.dispatchEvent(this,"modulobox","updateMedia",this.getMedia())},t.setThumbs=function(){var t=this.thumbs,e=this.gallery.initialLength,i=this.DOM.thumbsHolder;if(!this.options.thumbnails||e<2)this.DOM.caption.style.bottom=0,i.style.visibility="hidden",i.style.height=0,t.height=t.gutter=0;else{var s=this.options.thumbnailSizes,o=Math.max(window.innerWidth,Math.max(screen.width,screen.height));i=0;var n=Object.keys(s).sort(function(t,e){return t-e});for(t=0;t<n.length;t++){var r=n[t],a=Math.ceil((t===n.length-1?o:Math.min(o,r))/(s[r].width+s[r].gutter)*2);if(isFinite(a)&&i<a&&(i=a),o<=r)break}for(s=document.createDocumentFragment(),e=50<e?Math.min(i,e):e,t=0;t<e;t++)i=m.createEl("div",this.pre+"-thumb"),s.appendChild(i);this.DOM.thumbsInner.appendChild(s),this.setThumbsPosition()}},t.thumbClick=function(t){t=t.target,m.hasClass(t,this.pre+"-thumb")||(t=t.parentNode),0<=parseInt(t.index,10)&&this.slideTo(t.index)},t.loadThumb=function(t,e){var i=this.gallery[e];if(!i.thumb||"object"!=typeof i.thumb){var s=i.thumb;i.thumb=m.createEl("div",this.pre+"-thumb-bg"),i.thumb.style.backgroundImage=s&&s.indexOf(".json")<0?"url("+s+")":null,"video"===i.type&&(m.addClass(i.thumb,this.pre+"-thumb-video"),m.addClass(i.thumb,this.pre+"-thumb-loaded"))}if(t[t.firstChild?"replaceChild":"appendChild"](i.thumb,t.firstChild),t.media=e,s){var o=new Image;o.onload=function(){m.addClass(i.thumb,this.pre+"-thumb-loaded")}.bind(this),o.src=s}},t.updateThumbs=function(){var t=this.gallery;if(this.options.thumbnails&&!(t.initialLength<2)){t=this.thumbs;var e=this.getThumbPosition(t);t.stopAnimate(),e===t.position.x?this.shiftThumbs(t):Math.abs(e-t.position.x)>50*t.size?(this.DOM.thumbsHolder.style.visibility="hidden",t.position.x=e,m.translate(this.DOM.thumbsInner,e,0),this.renderThumbs(t),this.DOM.thumbsHolder.style.visibility=""):(t.startAnimate(),t.releaseDrag(),t.animateTo({x:e}))}},t.updateCaption=function(){if(this.options.caption){var t=this.getMedia();t=t.caption?t.caption:"";var e=this.DOM.captionInner;e.innerHTML!==t&&(e.innerHTML=t)}},t.updateCounter=function(){if(this.options.counterMessage){var t=this.gallery,e=t.initialLength;t=m.modulo(e,t.index),e=this.options.counterMessage.replace("[index]",t+1).replace("[total]",e),(t=this.DOM.counter).textContent!==e&&(t.textContent=e)}},t.wrapAround=function(){var t=this.options.loop,e=this.gallery,i=e.length;if(e.initialLength||(e.initialLength=i),this.states.loop=!!(t&&t<=i),this.states.loop&&i<this.slides.length){t=Math.ceil(this.slides.length/i)*i-i;for(var s=0;s<t;s++){var o=i+s;e[o]=m.cloneObject(e[m.modulo(i,s)]),e[o].index=o}}},t.setSlider=function(){var t=this.slider,e=this.slides;this.setSizes(t,e),this.setSliderPosition(t,e),this.setSlidesPositions(e),this.DOM.overlay.style.opacity=1},t.setSizes=function(t,e){t.width=document.body.clientWidth,t.height=window.innerHeight,e.width=t.width+Math.round(t.width*this.options.spacing)},t.setSlidesPositions=function(t){for(var e=0;e<t.length;e++)t[e].position=null,this.setCellPosition(e);this.shiftSlides()},t.setThumbsPosition=function(){if(this.options.thumbnails&&!(this.gallery.initialLength<2)){for(var t,e=this.thumbs,i=this.slider,s=this.DOM.thumbsHolder,o=this.DOM.thumbsInner,n=this.options.thumbnailSizes,r=this.options.rightToLeft,a=Object.keys(n).sort(function(t,e){return e-t}),h=Math.max.apply(null,a),l=window.innerWidth,d=0;d<a.length;d++)l<=(t=Number(a[d]))&&(h=t);e.width=Number(n[h].width),e.gutter=Number(n[h].gutter),e.height=Number(n[h].height),e.size=e.width+e.gutter,e.length=this.gallery.initialLength,n=e.length*e.size,e.bound={left:0,right:n>i.width?i.width-n:0},r&&(e.bound.right=n>i.width?i.width-e.size:n-e.size,e.bound.left=n-e.size),"centered"===this.options.thumbnailsNav&&(e.bound={left:n>i.width?Math.floor(.5*i.width-.5*e.size):Math.floor(.5*n-.5*e.size),right:n>i.width?Math.ceil(.5*i.width-n+.5*e.size):-Math.ceil(.5*n-.5*e.size)},r&&(e.bound.right=e.bound.left,e.bound.left=e.bound.left+n-e.size)),e.resetAnimate(),a=this.getThumbPosition(e),e.position.x=a,m.translate(o,a,0),a=this.getThumbHeight(),s.style.visibility=a?"":"hidden",s.style.height=a?a+"px":"",o.style.height=a?e.height+Math.min(10,e.gutter)+"px":"",o.style.width=e.length*e.size+"px",o.style.right=n>i.width&&r?"auto":""}},t.getThumbPosition=function(t){var e=this.slider,i=this.gallery,s=this.options.thumbnailsNav,o=this.isRTL(),n=o<0?"right":"left";return i=m.modulo(i.initialLength,i.index),e=.5*e.width-.5*t.size,i=t.bound[n]-i*t.size*o,i=t.bound[n]?i+(o<0&&"centered"!==s?-e:0):i+e,Math.max(t.bound.right,Math.min(t.bound.left,i))},t.setCellPosition=function(t){this.cells[t].resetAnimate(),m.translate(this.slides[t].children[0],0,0,1)},t.setSliderPosition=function(t,e){var i=this.options.rightToLeft,s=-e.index*e.width;s=i?-s:s,t.resetAnimate(),t.position.x=t.attraction.x=s,t.bound={left:0,right:-(this.gallery.length-1)*e.width},i&&(t.bound.left=-t.bound.right,t.bound.right=0),m.translate(this.DOM.slider,s,0)},t.setAnimation=function(){var t=this.DOM.slider,e=this.options.friction,i=this.options.attraction;this.slider=new n(t,{x:0,y:0},Math.min(Math.max(e.slider,0),1),Math.min(Math.max(i.slider,0),1)),this.slider.on("settle.toanimate",this.settleSider.bind(this)),this.slider.on("render.toanimate",this.renderSlider.bind(this));for(var s=(t=t.children).length,o=0;o<s;o++)this.cells[o]=new n(t[o].children[0],{x:0,y:0,s:1},Math.min(Math.max(e.slide,0),1),Math.min(Math.max(i.slide,0),1)),this.cells[o].on("settle.toanimate",this.settleCell.bind(this)),this.cells[o].on("render.toanimate",this.renderCell.bind(this));this.thumbs=new n(this.DOM.thumbsInner,{x:0},Math.min(Math.max(e.thumbs,0),1),Math.min(Math.max(i.thumbs,0),1)),this.thumbs.on("settle.toanimate",this.settleThumbs.bind(this)),this.thumbs.on("render.toanimate",this.renderThumbs.bind(this))},t.settleSider=function(t){if(m.dispatchEvent(this,"modulobox","sliderSettled",t.position),this.states.open&&(this.setMedia(),this.replaceState()),this.options.fadeIfSettle)for(var e=this.slides,i=0;i<e.length;i++)(t=this.gallery[e[i].media]).dom.loaded&&this.showMedia(t,i)},t.settleCell=function(t){var e=this.gesture;e.closeBy&&m.dispatchEvent(this,"modulobox","panYSettled",null,t.position),(e.closeBy&&!1===e.canClose||!e.closeBy)&&m.dispatchEvent(this,"modulobox","panZoomSettled",null,t.position)},t.settleThumbs=function(t){m.dispatchEvent(this,"modulobox","thumbsSettled",null,t.position)},t.renderSlider=function(t){this.shiftSlides();var e=this.isRTL(),i=this.gallery.initialLength;t=m.modulo(i,-e*t.position.x/this.slides.width),m.dispatchEvent(this,"modulobox","sliderProgress",null,Math.min(1,Math.max(0,(i-.5<t?0:t)/(i-1))))},t.renderCell=function(t){if(this.willClose(t),"panY"===this.gesture.type||this.gesture.closeBy||"dragSlider"===this.gesture.type&&0!==t.position.y){var e=1-Math.abs(t.position.y)/(.5*this.slider.height);m.dispatchEvent(this,"modulobox","panYProgress",null,e)}"panY"!==this.gesture.type&&1!==t.position.s&&(e=t.position.s,m.dispatchEvent(this,"modulobox","panZoomProgress",null,e))},t.renderThumbs=function(t){this.shiftThumbs(t),m.dispatchEvent(this,"modulobox","thumbsProgress",null,t.bound.left!==t.bound.right?(t.bound.left-t.position.x)/(t.bound.left-t.bound.right):0)},t.touchStart=function(t){var e=t.target,i=e.tagName,s=e.className;3!==t.which&&e!==this.buttons.play&&this.stopSlideShow(),3===t.which||!this.isEl(t)||-1<["BUTTON","VIDEO","INPUT","A"].indexOf(i)||("IMG"===i&&1<this.gallery.length&&m.addClass(this.DOM.holder,this.pre+"-dragging"),t.preventDefault(),m.hasClass(this.DOM.holder,this.pre+"-open-tooltip")||(this.pointers.length||(this.gesture.canClose=void 0,m.handleEvents(this,window,this.dragEvents.move,"touchMove"),m.handleEvents(this,window,this.dragEvents.end,"touchEnd")),this.addPointer(t),s.indexOf("-thumb")<0?(this.slider.stopAnimate(),t=this.getCell(),(1!=Math.round(100*t.position.s)/100||2===this.pointers.length||this.gesture.closeBy)&&t.stopAnimate()):this.thumbs.stopAnimate(),this.gestures("start")))},t.touchMove=function(t){this.updatePointer(t);var e=this.gesture,i=this.pointers.length,s=this.isSliderSettle();this.switchPointers(),this.gestures("move"),e.type?(this[e.type](t),m.dispatchEvent(this,"modulobox",e.type+"Move",t,e),e.move=!0):(2===i&&s||Math.abs(e.dx)>this.options.threshold||Math.abs(e.dy)>this.options.threshold)&&(e.sx+=e.dx,e.sy+=e.dy,e.canZoom=this.isZoomable(),e.closeBy=!1,e.type=!(Math.abs(e.dx)<Math.abs(e.dy)/2)&&"dragSlider",e.type=this.options.dragToClose&&!e.type&&s?"panY":e.type,e.type=(this.options.pinchToZoom||this.states.zoom)&&e.canZoom&&s&&(2===i||this.states.zoom)?"panZoom":e.type,e.type=this.options.pinchToClose&&e.scale<1&&s&&2===i?"panZoom":e.type,e.type=-1<t.target.className.indexOf("-thumb")?"dragThumbs":e.type,"dragSlider"===e.type&&this.setMedia(),-1<["dragSlider","dragThumbs"].indexOf(e.type)&&((i=this.getCell()).startAnimate(),i.releaseDrag(),i.animateTo({x:0,y:0,s:1})),"dragSlider"!==e.type&&(i=this.slider,s=this.slides,-this.isRTL()*i.position.x!=s.index*s.width&&(i.startAnimate(),i.releaseDrag())),e.type&&(this.pauseVideo(),m.dispatchEvent(this,"modulobox",e.type+"Start",t,e),(1<this.gallery.length||"dragSlider"!==e.type)&&m.addClass(this.DOM.holder,this.pre+"-dragging")))},t.touchEnd=function(t){if(this.deletePointer(t),!this.pointers.length){if(m.removeClass(this.DOM.holder,this.pre+"-dragging"),m.handleEvents(this,window,this.dragEvents.move,"touchMove",!1),m.handleEvents(this,window,this.dragEvents.end,"touchEnd",!1),this.isSliderSettle()){var e=t.target.className;if(m.hasClass(t.target,this.pre+"-video"))this.appendVideo();else if(this.options.tapToClose&&!this.states.zoom&&(e===this.pre+"-item-inner"||e===this.pre+"-top-bar")&&Math.abs(this.gesture.dx)<this.options.threshold)return void this.close();"IMG"===t.target.tagName&&this.doubleTap(t)}this.options.thumbnails&&!this.gesture.move&&this.thumbClick(t),e=this.gesture.type+"End",this.gesture.type&&"function"==typeof this[e]&&(this[e](t),m.dispatchEvent(this,"modulobox",e,t,this.gesture)),this.gesture.type=this.gesture.move=!1,this.states.open&&((t=this.getCell()).settle||(t.startAnimate(),t.releaseDrag()),(t=this.slider).settle||(t.startAnimate(),t.releaseDrag()))}},t.switchPointers=function(){if("panZoom"===this.gesture.type&&1===this.pointers.length&&0!==this.gesture.distance){var t=this.getCell();t.stopAnimate(),t.startAnimate(),this.gesture.move=!1,this.gestures("start"),this.gestures("move")}},t.doubleTap=function(t){t.preventDefault();var e=(t=this.mapPointer(t))[0].clientX,i=t[0].clientY;void 0!==this.tap&&+new Date-this.tap.delay<350&&Math.abs(this.tap.deltaX-e)<30&&Math.abs(this.tap.deltaY-i)<30?(this.states.tapIdle&&clearTimeout(this.states.tapIdle),this.options.doubleTapToZoom&&this.zoomTo(e,i),this.tap=void 0):(this.browser.touchDevice&&this.options.timeToIdle&&!this.states.idle&&(this.states.tapIdle=setTimeout(function(){var t=m.hasClass(this.DOM.holder,this.pre+"-idle")?"remove":"add";m[t+"Class"](this.DOM.holder,this.pre+"-idle")}.bind(this),350)),this.tap={delay:+new Date,deltaX:t[0].clientX,deltaY:t[0].clientY})},t.isSliderSettle=function(){if(this.gesture.type)return!1;var t=this.isRTL(),e=this.slides,i=e.width;return Math.abs(t*this.slider.position.x+e.index*i)/i*100<=3},t.mapPointer=function(t){return t.touches?t.changedTouches:[t]},t.addPointer=function(t){t=this.mapPointer(t);for(var e=0;e<t.length;e++)if(this.pointers.length<2&&-1===["dragSlider","panY","dragThumbs"].indexOf(this.gesture.type)){var i=t[e],s=void 0!==i.pointerId?i.pointerId:i.identifier;this.getPointer(s)||(this.pointers[this.pointers.length]={id:s,x:Math.round(i.clientX),y:Math.round(i.clientY)})}},t.updatePointer=function(t){t=this.mapPointer(t);for(var e=0;e<t.length;e++){var i=t[e],s=this.getPointer(void 0!==i.pointerId?i.pointerId:i.identifier);s&&(s.x=Math.round(i.clientX),s.y=Math.round(i.clientY))}},t.deletePointer=function(t){t=this.mapPointer(t);for(var e=0;e<t.length;e++){var i=t[e];i=void 0!==i.pointerId?i.pointerId:i.identifier;for(var s=0;s<this.pointers.length;s++)this.pointers[s].id===i&&this.pointers.splice(s,1)}},t.getPointer=function(t){for(var e in this.pointers)if(this.pointers[e].id===t)return this.pointers[e];return null},t.gestures=function(t){var e=this.gesture,i=this.pointers;if(i.length){if(e.direction=e.x?i[0].x>e.x?1:-1:0,e.x=i[0].x,e.y=i[0].y,2===i.length){var s=i[1].x;i=i[1].y;var o=this.getDistance([e.x,e.y],[s,i]);e.x-=(e.x-s)/2,e.y-=(e.y-i)/2}"start"===t?(e.dx=0,e.dy=0,e.sx=e.x,e.sy=e.y,e.distance=o||0):(e.dx=e.x-e.sx,e.dy=e.y-e.sy,e.scale=o&&e.distance?o/e.distance:1)}},t.getDistance=function(t,e){var i=e[0]-t[0],s=e[1]-t[1];return Math.sqrt(i*i+s*s)},t.panY=function(){var t=this.getCell();t.startAnimate(),t.updateDrag({x:t.position.x,y:t.start.y+this.gesture.dy,s:t.position.s})},t.panYEnd=function(){var t=this.getCell(),e=this.slider.height,i=t.resting.y;1-Math.abs(i)/(.5*e)<.8&&(e=Math.abs(i)<.5*e?Math.abs(i)/i*e*.5:i,this.close(),t.animateTo({x:0,y:e,s:e?t.resting.s:1}),t.startAnimate(),t.releaseDrag())},t.panZoom=function(){var t=this.getCell(),e=this.gesture,i=this.mediaViewport(t.position.s),s=Math.min(1.5*this.options.maxZoom,Math.max(this.options.pinchToClose&&e.canClose?.1:.6,t.start.s*e.scale)),o=t.start.x+e.dx,n=t.start.y+e.dy,r=e.sx-.5*this.slider.width,a=e.sy-.5*this.slider.height;e.canZoom&&(this.options.pinchToZoom||this.states.zoom)||(s=Math.min(1,s)),!this.options.pinchToZoom&&this.states.zoom&&(s=t.position.s),e.move||1!==this.pointers.length||(t.start.x+=o>i.left?o-i.left:o<i.right?o-i.right:0,t.start.y+=n>i.bottom?n-i.bottom:n<i.top?n-i.top:0),o=e.dx+r+s/t.start.s*(t.start.x-r),n=e.dy+a+s/t.start.s*(t.start.y-a),1===this.pointers.length&&(o=o>i.left?.5*(o+i.left):o<i.right?.5*(o+i.right):o,n=n>i.bottom?.5*(n+i.bottom):n<i.top?.5*(n+i.top):n),t.startAnimate(),t.updateDrag({x:o,y:n,s:s}),this.updateZoom(s)},t.panZoomEnd=function(){var t=this.getCell(),e=this.gesture,i=t.resting.s>this.options.maxZoom?this.options.maxZoom:t.resting.s<1?1:t.resting.s,s=this.mediaViewport(i);if(Math.round(10*t.resting.s)/10>this.options.maxZoom){var o=e.distance?e.sx-.5*this.slider.width:0,n=e.distance?e.sy-.5*this.slider.height:0;o=e.dx+o+i/t.start.s*(t.start.x-o),n=e.dy+n+i/t.start.s*(t.start.y-n),o=o>s.left?s.left:o<s.right?s.right:o,n=n>s.bottom?s.bottom:n<s.top?s.top:n}else o=t.resting.x>s.left?s.left:t.resting.x<s.right?s.right:void 0,n=t.resting.y>s.bottom?s.bottom:t.resting.y<s.top?s.top:void 0;this.options.pinchToClose&&t.resting.s<.8&&e.canClose&&(i=t.resting.s<.3?t.resting.s:.15,o=t.resting.x,n=t.resting.y,this.close()),t.animateTo({x:o,y:n,s:i!==t.resting.s?i:void 0}),t.startAnimate(),t.releaseDrag(),this.updateZoom(t.resting.s)},t.dragThumbs=function(){var t=this.thumbs,e=t.bound,i=t.start.x+this.gesture.dx;this.gesture.move||(t.start.x+=i>e.left?i-e.left:i<e.right?i-e.right:0,i=t.start.x+this.gesture.dx),i=i>e.left?.5*(i+e.left):i<e.right?.5*(i+e.right):i,t.startAnimate(),t.attraction.x=void 0,t.updateDrag({x:i})},t.dragThumbsEnd=function(){var t=this.thumbs,e=t.bound,i=t.resting.x;(i=i>e.left?e.left:i<e.right?e.right:i)!==t.resting.x&&t.animateTo({x:i}),t.startAnimate(),t.releaseDrag()},t.dragSlider=function(){if(1!==this.gallery.length){var t=this.slider,e=t.start.x+this.gesture.dx;if(!this.states.loop){var i=t.bound;this.gesture.move||(t.start.x+=e>i.left?e-i.left:e<i.right?e-i.right:0,e=t.start.x+this.gesture.dx),e=e>i.left?.5*(e+i.left):e<i.right?.5*(e+i.right):e}t.startAnimate(),t.updateDrag({x:e})}},t.dragSliderEnd=function(){if(1!==this.gallery.length){var t=this.slider,e=this.slides,i=e.index,s=this.isRTL();this.getRestingIndex(t.position.x,t.resting.x),i!==e.index&&this.updateMediaInfo(),this.slider.animateTo({x:-s*e.index*e.width,y:void 0,s:void 0}),t.startAnimate(),t.releaseDrag()}},t.getRestingIndex=function(t,e){var i=this.gesture.direction,s=this.gallery,o=this.slides,n=this.gesture.dx,r=this.isRTL(),a=Math.round(-r*t/o.width),h=Math.abs(e-t);Math.abs(n)<.5*o.width&&h&&(0<n&&0<i?a-=1*r:n<0&&i<0&&(a+=1*r)),i=Math.max(-1,Math.min(1,a-o.index)),!this.states.loop&&(s.index+i<0||s.index+i>s.length-1)||(o.index+=i)},t.shiftSlides=function(){var t=this.slides,e=this.gallery,i=this.states.loop,s=this.isRTL(),o=s*Math.round(-this.slider.position.x/t.width)-2,n=o+5;for(!i&&n>e.initialLength-1&&(n=(o=e.initialLength-5)+5),!i&&o<0&&(o=0,n=5),e=o;e<n;e++)i=s*e*t.width,((o=t[o=m.modulo(t.length,e)]).index!==e||o.position!==i)&&(o.index=e,o.position=i,o.style.left=i+"px");this.states.open&&this.setMedia(3)},t.shiftThumbs=function(t){var e=this.DOM.thumbsInner.children,i=this.slider,s=this.gallery,o=this.isRTL(),n=e.length,r=m.modulo(s.initialLength,s.index),a=Math.max(0,Math.round((-o*t.position.x+o*t.size*n*.25)/t.size)-Math.floor(n/2)),h=a+n,l=.5*i.width,d=t.position.x+l;for(i=t.position.x-i.width-l,h>s.initialLength&&(a=(h=s.initialLength)-n),h===s.initialLength-1&&a-h<n&&(a=s.initialLength-n),s=a;s<h;s++){a=e[m.modulo(n,s)],l=o*s*t.size+.5*t.gutter;var u=this.pre+"-active-thumb",p=m.hasClass(a,u);a.index===s&&a.position===l||(a.index=s,a.position=l,a.style.left=l+"px"),this.setThumbSize(a,t),-a.position<=d&&-a.position>=i&&a.media!==s&&this.loadThumb(a,s),p&&r!==s?m.removeClass(a,u):p||r!==s||m.addClass(a,u)}},t.setThumbSize=function(t,e){t.width===e.width&&t.height===e.height&&t.gutter===e.gutter||(t.width=e.width,t.height=e.height,t.gutter=e.gutter,t.style.width=e.width+"px",t.style.height=e.height+"px")},t.willClose=function(t){var e=this.DOM.overlay.style.opacity,i=this.gesture.canClose,s=this.gesture.type,o=this.gesture.closeBy,n="panY"===s||"panY"===o;1.1<t.position.s&&void 0===i?this.gesture.canClose=!1:t.position.s<1&&void 0===i&&(this.gesture.canClose=!0),this.options.pinchToClose&&("panZoom"===s||"panZoom"===o)&&this.gesture.canClose?(e=t.position.s,this.gesture.closeBy="panZoom"):n?(e=1-Math.abs(t.position.y)/(.5*this.slider.height),this.gesture.closeBy="panY"):e&&e<1&&(e=1,this.gesture.closeBy=!1),e=e?Math.max(0,Math.min(1,e)):1,m[(e<=.8||!e?"add":"remove")+"Class"](this.DOM.holder,this.pre+"-will-close"),this.DOM.overlay.style.opacity=e},t.prev=m.throttle(function(){this.gesture.move||this.slideTo(this.slides.index-1*this.isRTL())},120),t.next=m.throttle(function(){this.gesture.move||this.slideTo(this.slides.index+1*this.isRTL())},120),t.slideTo=function(t,e){var i=this.slides,s=this.gallery,o=this.DOM.slider,n=this.isRTL(),r=s.initialLength,a=m.modulo(r,t);s=a-(s=m.modulo(r,s.index));var h=r-Math.abs(s);!this.states.loop&&(t<0||t>this.gallery.initialLength-1)||(this.states.loop&&h<3&&2*h<r&&(s=s<0?h:-h),a===t&&(t=i.index+s),(s=t-i.index)&&(this.states.zoom&&this.zoom(),this.pauseVideo(),this.share(),e||this.stopSlideShow(),i.index=t,r=this.slider,2<Math.abs(s)&&(m.addClass(o,this.pre+"-hide"),this.setSliderPosition(r,i),this.setSlidesPositions(i),r.position.x=r.attraction.x=r.position.x+n*i.width*Math.min(2,Math.abs(s))*Math.abs(s)/s,m.translate(o,r.position.x,0),o.getClientRects()),this.updateMediaInfo(),m.removeClass(o,this.pre+"-hide"),r.startAnimate(),r.releaseDrag(),r.animateTo({x:-n*t*i.width,y:0,s:void 0})))},t.keyDown=function(t){var e=t.keyCode,i=this.options;if(i.prevNextKey&&(37===e?this.prev(t):39===e&&this.next(t)),27===e&&i.escapeToClose&&this.close(),!i.mouseWheel&&-1<[32,33,34,35,36,38,40].indexOf(e))return t.preventDefault(),!1},t.zoom=function(){this.zoomTo()},t.zoomTo=function(t,e,i){if(!(!this.isSliderSettle()||!this.isZoomable()&&1<i)){this.gesture.closeBy=!1;var s=this.getMedia();i=i||(this.states.zoom?1:s.dom.size.scale),s=this.getCell();var o=this.mediaViewport(i);t=t?t-.5*this.slider.width:0,e=e?e-.5*this.slider.height:0,t=1<i?Math.ceil(t+i/s.position.s*(s.position.x-t)):0,e=1<i?Math.ceil(e+i/s.position.s*(s.position.y-e)):0,s.startAnimate(),s.releaseDrag(),s.animateTo({x:t>o.left?o.left:t<o.right?o.right:t,y:e>o.bottom?o.bottom:e<o.top?o.top:e,s:i}),this.updateZoom(i)}},t.updateZoom=function(t){this.states.zoom=1<t,m[this.states.zoom?"addClass":"removeClass"](this.DOM.holder,this.pre+"-panzoom")},t.destroy=function(){if(this.GUID){this.states.open&&this.close();var t=this.options.mediaSelector,e="";try{e=document.querySelectorAll(t)}catch(t){}t=0;for(var i=e.length;t<i;t++){var s=e[t];s.mobxListener&&s.removeEventListener("click",s.mobxListener,!1)}for(this.bindEvents(!1),this.slider.resetAnimate(),t=0;t<this.slides.length;t++)this.cells[t].resetAnimate();this.thumbs&&this.thumbs.resetAnimate(),this.DOM.holder.parentNode.removeChild(this.DOM.holder),this.DOM.comment.parentNode.removeChild(this.DOM.comment),delete o[this.GUID],delete this.GUID}},"undefined"!=typeof jQuery&&(jQuery.ModuloBox=function(t){return new a(t)}),a});
!function($){"use strict";var Typed=function(el,options){this.el=$(el);this.options=$.extend({},$.fn.typed.defaults,options);this.isInput=this.el.is('input');this.attr=this.options.attr;this.showCursor=this.isInput?false:this.options.showCursor;this.elContent=this.attr?this.el.attr(this.attr):this.el.text()
this.contentType=this.options.contentType;this.typeSpeed=this.options.typeSpeed;this.startDelay=this.options.startDelay;this.backSpeed=this.options.backSpeed;this.backDelay=this.options.backDelay;this.stringsElement=this.options.stringsElement;this.strings=this.options.strings;this.strPos=0;this.arrayPos=0;this.stopNum=0;this.loop=this.options.loop;this.loopCount=this.options.loopCount;this.curLoop=0;this.stop=false;this.cursorChar=this.options.cursorChar;this.shuffle=this.options.shuffle;this.sequence=[];this.build();};Typed.prototype={constructor:Typed,init:function(){var self=this;self.timeout=setTimeout(function(){for(var i=0;i<self.strings.length;++i)self.sequence[i]=i;if(self.shuffle)self.sequence=self.shuffleArray(self.sequence);self.typewrite(self.strings[self.sequence[self.arrayPos]],self.strPos);},self.startDelay);},build:function(){var self=this;if(this.showCursor===true){this.cursor=$("<span class=\"typed-cursor\">"+this.cursorChar+"</span>");this.el.after(this.cursor);}
if(this.stringsElement){self.strings=[];this.stringsElement.hide();var strings=this.stringsElement.find('p');$.each(strings,function(key,value){self.strings.push($(value).html());});}
this.init();},typewrite:function(curString,curStrPos){if(this.stop===true){return;}
var humanize=Math.round(Math.random()*(100-30))+this.typeSpeed;var self=this;self.timeout=setTimeout(function(){var charPause=0;var substr=curString.substr(curStrPos);if(substr.charAt(0)==='^'){var skip=1;if(/^\^\d+/.test(substr)){substr=/\d+/.exec(substr)[0];skip+=substr.length;charPause=parseInt(substr);}
curString=curString.substring(0,curStrPos)+curString.substring(curStrPos+skip);}
if(self.contentType==='html'){var curChar=curString.substr(curStrPos).charAt(0)
if(curChar==='<'||curChar==='&'){var tag='';var endTag='';if(curChar==='<'){endTag='>'}else{endTag=';'}
while(curString.substr(curStrPos).charAt(0)!==endTag){tag+=curString.substr(curStrPos).charAt(0);curStrPos++;}
curStrPos++;tag+=endTag;}}
self.timeout=setTimeout(function(){if(curStrPos===curString.length){self.options.onStringTyped(self.arrayPos);if(self.arrayPos===self.strings.length-1){self.options.callback();self.curLoop++;if(self.loop===false||self.curLoop===self.loopCount)
return;}
self.timeout=setTimeout(function(){self.backspace(curString,curStrPos);},self.backDelay);}else{if(curStrPos===0)
self.options.preStringTyped(self.arrayPos);var nextString=curString.substr(0,curStrPos+1);if(self.attr){self.el.attr(self.attr,nextString);}else{if(self.isInput){self.el.val(nextString);}else if(self.contentType==='html'){self.el.html(nextString);}else{self.el.text(nextString);}}
curStrPos++;self.typewrite(curString,curStrPos);}},charPause);},humanize);},backspace:function(curString,curStrPos){if(this.stop===true){return;}
var humanize=Math.round(Math.random()*(100-30))+this.backSpeed;var self=this;self.timeout=setTimeout(function(){if(self.contentType==='html'){if(curString.substr(curStrPos).charAt(0)==='>'){var tag='';while(curString.substr(curStrPos).charAt(0)!=='<'){tag-=curString.substr(curStrPos).charAt(0);curStrPos--;}
curStrPos--;tag+='<';}}
var nextString=curString.substr(0,curStrPos);if(self.attr){self.el.attr(self.attr,nextString);}else{if(self.isInput){self.el.val(nextString);}else if(self.contentType==='html'){self.el.html(nextString);}else{self.el.text(nextString);}}
if(curStrPos>self.stopNum){curStrPos--;self.backspace(curString,curStrPos);}
else if(curStrPos<=self.stopNum){self.arrayPos++;if(self.arrayPos===self.strings.length){self.arrayPos=0;if(self.shuffle)self.sequence=self.shuffleArray(self.sequence);self.init();}else
self.typewrite(self.strings[self.sequence[self.arrayPos]],curStrPos);}},humanize);},shuffleArray:function(array){var tmp,current,top=array.length;if(top)while(--top){current=Math.floor(Math.random()*(top+1));tmp=array[current];array[current]=array[top];array[top]=tmp;}
return array;},reset:function(){var self=this;clearInterval(self.timeout);var id=this.el.attr('id');this.el.after('<span id="'+id+'"/>')
this.el.remove();if(typeof this.cursor!=='undefined'){this.cursor.remove();}
self.options.resetCallback();}};$.fn.typed=function(option){return this.each(function(){var $this=$(this),data=$this.data('typed'),options=typeof option=='object'&&option;if(!data)$this.data('typed',(data=new Typed(this,options)));if(typeof option=='string')data[option]();});};$.fn.typed.defaults={strings:["These are the default values...","You know what you should do?","Use your own!","Have a great day!"],stringsElement:null,typeSpeed:0,startDelay:0,backSpeed:0,shuffle:false,backDelay:500,loop:false,loopCount:false,showCursor:true,cursorChar:"|",attr:null,contentType:'html',callback:function(){},preStringTyped:function(){},onStringTyped:function(){},resetCallback:function(){}};}(window.jQuery);
(function($){$(document).ready(function(){$('.typed-me').each(function(){var options={},strings=[];for(var key in this.dataset){if(key.substr(0,6)=="string"){var v=this.dataset[key].replace(/&quot;/g,'"');v=v.replace(/"/g,'&quot;');v=v.replace('&amp;','&');v=v.replace('&','&amp;');strings.push(v);}else{options[key]=parseInt(this.dataset[key]);}}
options['strings']=strings;options['contentType']='html';$(this).typed(options);});});})(jQuery);
wp.i18n.setLocaleData({'text direction\u0004ltr':['ltr']});
(()=>{"use strict";var t={d:(e,i)=>{for(var s in i)t.o(i,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:i[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function i(t){if(this.formData={},this.tree={},!(t instanceof FormData))return this;this.formData=t;const e=()=>{const t=new Map;return t.largestIndex=0,t.set=function(e,i){""===e?e=t.largestIndex++:/^[0-9]+$/.test(e)&&(e=parseInt(e),t.largestIndex<=e&&(t.largestIndex=e+1)),Map.prototype.set.call(t,e,i)},t};this.tree=e();const i=/^(?<name>[a-z][-a-z0-9_:]*)(?<array>(?:\[(?:[a-z][-a-z0-9_:]*|[0-9]*)\])*)/i;for(const[t,s]of this.formData){const o=t.match(i);if(o)if(""===o.groups.array)this.tree.set(o.groups.name,s);else{const t=[...o.groups.array.matchAll(/\[([a-z][-a-z0-9_:]*|[0-9]*)\]/gi)].map((([t,e])=>e));t.unshift(o.groups.name);const i=t.pop();t.reduce(((t,i)=>{if(/^[0-9]+$/.test(i)&&(i=parseInt(i)),t.get(i)instanceof Map)return t.get(i);const s=e();return t.set(i,s),s}),this.tree).set(i,s)}}}t.r(e),t.d(e,{all:()=>D,any:()=>M,date:()=>m,dayofweek:()=>u,email:()=>r,enum:()=>h,file:()=>d,maxdate:()=>z,maxfilesize:()=>j,maxitems:()=>v,maxlength:()=>x,maxnumber:()=>y,mindate:()=>A,minfilesize:()=>$,minitems:()=>w,minlength:()=>g,minnumber:()=>b,number:()=>c,required:()=>n,requiredfile:()=>a,stepnumber:()=>I,tel:()=>l,time:()=>f,url:()=>p}),i.prototype.entries=function(){return this.tree.entries()},i.prototype.get=function(t){return this.tree.get(t)},i.prototype.getAll=function(t){if(!this.has(t))return[];const e=t=>{const i=[];if(t instanceof Map)for(const[s,o]of t)i.push(...e(o));else""!==t&&i.push(t);return i};return e(this.get(t))},i.prototype.has=function(t){return this.tree.has(t)},i.prototype.keys=function(){return this.tree.keys()},i.prototype.values=function(){return this.tree.values()};const s=i;function o({rule:t,field:e,error:i,...s}){this.rule=t,this.field=e,this.error=i,this.properties=s}const n=function(t){if(0===t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)).length)throw new o(this)},a=function(t){if(0===t.getAll(this.field).length)throw new o(this)},r=function(t){if(!t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)).every((t=>{if(t.length<6)return!1;if(-1===t.indexOf("@",1))return!1;if(t.indexOf("@")!==t.lastIndexOf("@"))return!1;const[e,i]=t.split("@",2);if(!/^[a-zA-Z0-9!#$%&\'*+\/=?^_`{|}~\.-]+$/.test(e))return!1;if(/\.{2,}/.test(i))return!1;if(/(?:^[ \t\n\r\0\x0B.]|[ \t\n\r\0\x0B.]$)/.test(i))return!1;const s=i.split(".");if(s.length<2)return!1;for(const t of s){if(/(?:^[ \t\n\r\0\x0B-]|[ \t\n\r\0\x0B-]$)/.test(t))return!1;if(!/^[a-z0-9-]+$/i.test(t))return!1}return!0})))throw new o(this)},p=function(t){const e=t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t));if(!e.every((t=>{try{return(t=>-1!==["http","https","ftp","ftps","mailto","news","irc","irc6","ircs","gopher","nntp","feed","telnet","mms","rtsp","sms","svn","tel","fax","xmpp","webcal","urn"].indexOf(t))(new URL(t).protocol.replace(/:$/,""))}catch{return!1}})))throw new o(this)},l=function(t){if(!t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)).every((t=>(((t=(t=t.replace(/[#*].*$/,"")).replaceAll(/[()/.*#\s-]+/g,"")).startsWith("+")||t.startsWith("00"))&&(t=`+${t.replace(/^[+0]+/,"")}`),!!/^[+]?[0-9]+$/.test(t)&&5<t.length&&t.length<16))))throw new o(this)},c=function(t){if(!t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)).every((t=>!!/^[-]?[0-9]+(?:[eE][+-]?[0-9]+)?$/.test(t)||!!/^[-]?(?:[0-9]+)?[.][0-9]+(?:[eE][+-]?[0-9]+)?$/.test(t))))throw new o(this)},m=function(t){if(!t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)).every((t=>{if(!/^[0-9]{4,}-[0-9]{2}-[0-9]{2}$/.test(t))return!1;const e=new Date(t);return!Number.isNaN(e.valueOf())})))throw new o(this)},f=function(t){if(!t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)).every((t=>{const e=t.match(/^([0-9]{2})\:([0-9]{2})(?:\:([0-9]{2}))?$/);if(!e)return!1;const i=parseInt(e[1]),s=parseInt(e[2]),o=e[3]?parseInt(e[3]):0;return 0<=i&&i<=23&&0<=s&&s<=59&&0<=o&&o<=59})))throw new o(this)},d=function(t){if(!t.getAll(this.field).every((t=>t instanceof File&&this.accept?.some((e=>/^\.[a-z0-9]+$/i.test(e)?t.name.toLowerCase().endsWith(e.toLowerCase()):(t=>{const e=[],i=t.match(/^(?<toplevel>[a-z]+)\/(?<sub>[*]|[a-z0-9.+-]+)$/i);if(i){const t=i.groups.toplevel.toLowerCase(),s=i.groups.sub.toLowerCase();for(const[o,n]of(()=>{const t=new Map;return t.set("jpg|jpeg|jpe","image/jpeg"),t.set("gif","image/gif"),t.set("png","image/png"),t.set("bmp","image/bmp"),t.set("tiff|tif","image/tiff"),t.set("webp","image/webp"),t.set("ico","image/x-icon"),t.set("heic","image/heic"),t.set("asf|asx","video/x-ms-asf"),t.set("wmv","video/x-ms-wmv"),t.set("wmx","video/x-ms-wmx"),t.set("wm","video/x-ms-wm"),t.set("avi","video/avi"),t.set("divx","video/divx"),t.set("flv","video/x-flv"),t.set("mov|qt","video/quicktime"),t.set("mpeg|mpg|mpe","video/mpeg"),t.set("mp4|m4v","video/mp4"),t.set("ogv","video/ogg"),t.set("webm","video/webm"),t.set("mkv","video/x-matroska"),t.set("3gp|3gpp","video/3gpp"),t.set("3g2|3gp2","video/3gpp2"),t.set("txt|asc|c|cc|h|srt","text/plain"),t.set("csv","text/csv"),t.set("tsv","text/tab-separated-values"),t.set("ics","text/calendar"),t.set("rtx","text/richtext"),t.set("css","text/css"),t.set("htm|html","text/html"),t.set("vtt","text/vtt"),t.set("dfxp","application/ttaf+xml"),t.set("mp3|m4a|m4b","audio/mpeg"),t.set("aac","audio/aac"),t.set("ra|ram","audio/x-realaudio"),t.set("wav","audio/wav"),t.set("ogg|oga","audio/ogg"),t.set("flac","audio/flac"),t.set("mid|midi","audio/midi"),t.set("wma","audio/x-ms-wma"),t.set("wax","audio/x-ms-wax"),t.set("mka","audio/x-matroska"),t.set("rtf","application/rtf"),t.set("js","application/javascript"),t.set("pdf","application/pdf"),t.set("swf","application/x-shockwave-flash"),t.set("class","application/java"),t.set("tar","application/x-tar"),t.set("zip","application/zip"),t.set("gz|gzip","application/x-gzip"),t.set("rar","application/rar"),t.set("7z","application/x-7z-compressed"),t.set("exe","application/x-msdownload"),t.set("psd","application/octet-stream"),t.set("xcf","application/octet-stream"),t.set("doc","application/msword"),t.set("pot|pps|ppt","application/vnd.ms-powerpoint"),t.set("wri","application/vnd.ms-write"),t.set("xla|xls|xlt|xlw","application/vnd.ms-excel"),t.set("mdb","application/vnd.ms-access"),t.set("mpp","application/vnd.ms-project"),t.set("docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"),t.set("docm","application/vnd.ms-word.document.macroEnabled.12"),t.set("dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"),t.set("dotm","application/vnd.ms-word.template.macroEnabled.12"),t.set("xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),t.set("xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"),t.set("xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"),t.set("xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"),t.set("xltm","application/vnd.ms-excel.template.macroEnabled.12"),t.set("xlam","application/vnd.ms-excel.addin.macroEnabled.12"),t.set("pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"),t.set("pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"),t.set("ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"),t.set("ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"),t.set("potx","application/vnd.openxmlformats-officedocument.presentationml.template"),t.set("potm","application/vnd.ms-powerpoint.template.macroEnabled.12"),t.set("ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"),t.set("sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"),t.set("sldm","application/vnd.ms-powerpoint.slide.macroEnabled.12"),t.set("onetoc|onetoc2|onetmp|onepkg","application/onenote"),t.set("oxps","application/oxps"),t.set("xps","application/vnd.ms-xpsdocument"),t.set("odt","application/vnd.oasis.opendocument.text"),t.set("odp","application/vnd.oasis.opendocument.presentation"),t.set("ods","application/vnd.oasis.opendocument.spreadsheet"),t.set("odg","application/vnd.oasis.opendocument.graphics"),t.set("odc","application/vnd.oasis.opendocument.chart"),t.set("odb","application/vnd.oasis.opendocument.database"),t.set("odf","application/vnd.oasis.opendocument.formula"),t.set("wp|wpd","application/wordperfect"),t.set("key","application/vnd.apple.keynote"),t.set("numbers","application/vnd.apple.numbers"),t.set("pages","application/vnd.apple.pages"),t})())("*"===s&&n.startsWith(t+"/")||n===i[0])&&e.push(...o.split("|"))}return e})(e).some((e=>(e="."+e.trim(),t.name.toLowerCase().endsWith(e.toLowerCase())))))))))throw new o(this)},h=function(t){if(!t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)).every((t=>this.accept?.some((e=>t===String(e))))))throw new o(this)},u=function(t){if(!t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)).every((t=>{const e=0===(i=new Date(t).getDay())?7:i;var i;return this.accept?.some((t=>e===parseInt(t)))})))throw new o(this)},w=function(t){if(t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)).length<parseInt(this.threshold))throw new o(this)},v=function(t){const e=t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t));if(parseInt(this.threshold)<e.length)throw new o(this)},g=function(t){const e=t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t));let i=0;if(e.forEach((t=>{"string"==typeof t&&(i+=t.length)})),0!==i&&i<parseInt(this.threshold))throw new o(this)},x=function(t){const e=t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t));let i=0;if(e.forEach((t=>{"string"==typeof t&&(i+=t.length)})),parseInt(this.threshold)<i)throw new o(this)},b=function(t){if(!t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)).every((t=>!(parseFloat(t)<parseFloat(this.threshold)))))throw new o(this)},y=function(t){if(!t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)).every((t=>!(parseFloat(this.threshold)<parseFloat(t)))))throw new o(this)},A=function(t){if(!t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)).every((t=>!(/^[0-9]{4,}-[0-9]{2}-[0-9]{2}$/.test(t)&&/^[0-9]{4,}-[0-9]{2}-[0-9]{2}$/.test(this.threshold)&&t<this.threshold))))throw new o(this)},z=function(t){if(!t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)).every((t=>!(/^[0-9]{4,}-[0-9]{2}-[0-9]{2}$/.test(t)&&/^[0-9]{4,}-[0-9]{2}-[0-9]{2}$/.test(this.threshold)&&this.threshold<t))))throw new o(this)},$=function(t){const e=t.getAll(this.field);let i=0;if(e.forEach((t=>{t instanceof File&&(i+=t.size)})),i<parseInt(this.threshold))throw new o(this)},j=function(t){const e=t.getAll(this.field);let i=0;if(e.forEach((t=>{t instanceof File&&(i+=t.size)})),parseInt(this.threshold)<i)throw new o(this)},I=function(t){const e=t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)),i=parseFloat(this.base),s=parseFloat(this.interval);if(!(0<s))return!0;if(!e.every((t=>{const e=(parseFloat(t)-i)%s;return"0.000000"===Math.abs(e).toFixed(6)||"0.000000"===Math.abs(e-s).toFixed(6)})))throw new o(this)},O=({ruleObj:t,options:i})=>{const{rule:s,...o}=t;return"function"==typeof e[s]&&("function"!=typeof e[s].matches||e[s].matches(o,i))},E=({ruleObj:t,formDataTree:i,options:s})=>{const{rule:o}=t;e[o].call(t,i,s)},k=[],F=t=>[...k].reduce(((t,e)=>i=>e(i,t)),t),D=function(t,e={}){const i=(this.rules??[]).filter((t=>O({ruleObj:t,options:e}))),s=F(E);if(!i.every((i=>{try{s({ruleObj:i,formDataTree:t,options:e})}catch(t){if(!(t instanceof o))throw t;if(void 0!==t.error)throw t;return!1}return!0})))throw new o(this)},M=function(t,e={}){const i=(this.rules??[]).filter((t=>O({ruleObj:t,options:e}))),s=F(E);if(!i.some((i=>{try{s({ruleObj:i,formDataTree:t,options:e})}catch(t){if(!(t instanceof o))throw t;return!1}return!0})))throw new o(this)};var L;window.swv={validators:e,validate:(t,e,i={})=>{const n=(t.rules??[]).filter((t=>O({ruleObj:t,options:i})));if(!n.length)return new Map;const a=F(E),r=new s(e),p=n.reduce(((t,e)=>{try{a({ruleObj:e,formDataTree:r,options:i})}catch(e){if(!(e instanceof o))throw e;if(void 0!==e.field&&!t.has(e.field)&&void 0!==e.error)return t.set(e.field,e)}return t}),new Map);for(const t of r.keys())p.has(t)||p.set(t,{validInputs:r.getAll(t)});return p},use:t=>{k.push(t)},...null!==(L=window.swv)&&void 0!==L?L:{}}})();
var wpcf7={"api":{"root":"https:\/\/www.villadekhaosan.com\/wp-json\/","namespace":"contact-form-7\/v1"}};
(()=>{"use strict";const e=window.wp.i18n,t=e=>Math.abs(parseInt(e,10)),a=(e,t,a)=>{const n=new CustomEvent(`wpcf7${t}`,{bubbles:!0,detail:a});"string"==typeof e&&(e=document.querySelector(e)),e.dispatchEvent(n)},n=(e,t)=>{const n=new Map([["init","init"],["validation_failed","invalid"],["acceptance_missing","unaccepted"],["spam","spam"],["aborted","aborted"],["mail_sent","sent"],["mail_failed","failed"],["submitting","submitting"],["resetting","resetting"],["validating","validating"],["payment_required","payment-required"]]);n.has(t)&&(t=n.get(t)),Array.from(n.values()).includes(t)||(t=`custom-${t=(t=t.replace(/[^0-9a-z]+/i," ").trim()).replace(/\s+/,"-")}`);const r=e.getAttribute("data-status");if(e.wpcf7.status=t,e.setAttribute("data-status",t),e.classList.add(t),r&&r!==t){e.classList.remove(r);const t={contactFormId:e.wpcf7.id,pluginVersion:e.wpcf7.pluginVersion,contactFormLocale:e.wpcf7.locale,unitTag:e.wpcf7.unitTag,containerPostId:e.wpcf7.containerPost,status:e.wpcf7.status,prevStatus:r};a(e,"statuschanged",t)}return t},r=e=>{const{root:t,namespace:a="contact-form-7/v1"}=wpcf7.api;return c.reduceRight(((e,t)=>a=>t(a,e)),(e=>{let n,r,{url:c,path:o,endpoint:s,headers:i,body:l,data:p,...d}=e;"string"==typeof s&&(n=a.replace(/^\/|\/$/g,""),r=s.replace(/^\//,""),o=r?n+"/"+r:n),"string"==typeof o&&(-1!==t.indexOf("?")&&(o=o.replace("?","&")),o=o.replace(/^\//,""),c=t+o),i={Accept:"application/json, */*;q=0.1",...i},delete i["X-WP-Nonce"],p&&(l=JSON.stringify(p),i["Content-Type"]="application/json");const f={code:"fetch_error",message:"You are probably offline."},u={code:"invalid_json",message:"The response is not a valid JSON response."};return window.fetch(c||o||window.location.href,{...d,headers:i,body:l}).then((e=>Promise.resolve(e).then((e=>{if(e.status>=200&&e.status<300)return e;throw e})).then((e=>{if(204===e.status)return null;if(e&&e.json)return e.json().catch((()=>{throw u}));throw u}))),(()=>{throw f}))}))(e)},c=[];function o(e,t={}){const{target:a,scope:r=e,...c}=t;if(void 0===e.wpcf7?.schema)return;const o={...e.wpcf7.schema};if(void 0!==a){if(!e.contains(a))return;if(!a.closest(".wpcf7-form-control-wrap[data-name]"))return;if(a.closest(".novalidate"))return}const p=r.querySelectorAll(".wpcf7-form-control-wrap"),d=Array.from(p).reduce(((e,t)=>(t.closest(".novalidate")||t.querySelectorAll(":where(input, textarea, select):enabled").forEach((t=>{if(t.name)switch(t.type){case"button":case"image":case"reset":case"submit":break;case"checkbox":case"radio":t.checked&&e.append(t.name,t.value);break;case"select-multiple":for(const a of t.selectedOptions)e.append(t.name,a.value);break;case"file":for(const a of t.files)e.append(t.name,a);break;default:e.append(t.name,t.value)}})),e)),new FormData),f=e.getAttribute("data-status");Promise.resolve(n(e,"validating")).then((n=>{if(void 0!==swv){const n=swv.validate(o,d,t);for(const t of p){if(void 0===t.dataset.name)continue;const c=t.dataset.name;if(n.has(c)){const{error:t,validInputs:a}=n.get(c);i(e,c),void 0!==t&&s(e,c,t,{scope:r}),l(e,c,null!=a?a:[])}if(t.contains(a))break}}})).finally((()=>{n(e,f)}))}r.use=e=>{c.unshift(e)};const s=(e,t,a,n)=>{const{scope:r=e,...c}=null!=n?n:{},o=`${e.wpcf7?.unitTag}-ve-${t}`.replaceAll(/[^0-9a-z_-]+/gi,""),s=e.querySelector(`.wpcf7-form-control-wrap[data-name="${t}"] .wpcf7-form-control`);(()=>{const t=document.createElement("li");t.setAttribute("id",o),s&&s.id?t.insertAdjacentHTML("beforeend",`<a href="#${s.id}">${a}</a>`):t.insertAdjacentText("beforeend",a),e.wpcf7.parent.querySelector(".screen-reader-response ul").appendChild(t)})(),r.querySelectorAll(`.wpcf7-form-control-wrap[data-name="${t}"]`).forEach((e=>{const t=document.createElement("span");t.classList.add("wpcf7-not-valid-tip"),t.setAttribute("aria-hidden","true"),t.insertAdjacentText("beforeend",a),e.appendChild(t),e.querySelectorAll("[aria-invalid]").forEach((e=>{e.setAttribute("aria-invalid","true")})),e.querySelectorAll(".wpcf7-form-control").forEach((e=>{e.classList.add("wpcf7-not-valid"),e.setAttribute("aria-describedby",o),"function"==typeof e.setCustomValidity&&e.setCustomValidity(a),e.closest(".use-floating-validation-tip")&&(e.addEventListener("focus",(e=>{t.setAttribute("style","display: none")})),t.addEventListener("click",(e=>{t.setAttribute("style","display: none")})))}))}))},i=(e,t)=>{const a=`${e.wpcf7?.unitTag}-ve-${t}`.replaceAll(/[^0-9a-z_-]+/gi,"");e.wpcf7.parent.querySelector(`.screen-reader-response ul li#${a}`)?.remove(),e.querySelectorAll(`.wpcf7-form-control-wrap[data-name="${t}"]`).forEach((e=>{e.querySelector(".wpcf7-not-valid-tip")?.remove(),e.querySelectorAll("[aria-invalid]").forEach((e=>{e.setAttribute("aria-invalid","false")})),e.querySelectorAll(".wpcf7-form-control").forEach((e=>{e.removeAttribute("aria-describedby"),e.classList.remove("wpcf7-not-valid"),"function"==typeof e.setCustomValidity&&e.setCustomValidity("")}))}))},l=(e,t,a)=>{e.querySelectorAll(`[data-reflection-of="${t}"]`).forEach((e=>{if("output"===e.tagName.toLowerCase()){const t=e;0===a.length&&a.push(t.dataset.default),a.slice(0,1).forEach((e=>{e instanceof File&&(e=e.name),t.textContent=e}))}else e.querySelectorAll("output").forEach((e=>{e.hasAttribute("data-default")?0===a.length?e.removeAttribute("hidden"):e.setAttribute("hidden","hidden"):e.remove()})),a.forEach((a=>{a instanceof File&&(a=a.name);const n=document.createElement("output");n.setAttribute("name",t),n.textContent=a,e.appendChild(n)}))}))};function p(e,t={}){if(wpcf7.blocked)return d(e),void n(e,"submitting");const c=new FormData(e);t.submitter&&t.submitter.name&&c.append(t.submitter.name,t.submitter.value);const o={contactFormId:e.wpcf7.id,pluginVersion:e.wpcf7.pluginVersion,contactFormLocale:e.wpcf7.locale,unitTag:e.wpcf7.unitTag,containerPostId:e.wpcf7.containerPost,status:e.wpcf7.status,inputs:Array.from(c,(e=>{const t=e[0],a=e[1];return!t.match(/^_/)&&{name:t,value:a}})).filter((e=>!1!==e)),formData:c};r({endpoint:`contact-forms/${e.wpcf7.id}/feedback`,method:"POST",body:c,wpcf7:{endpoint:"feedback",form:e,detail:o}}).then((t=>{const r=n(e,t.status);return o.status=t.status,o.apiResponse=t,["invalid","unaccepted","spam","aborted"].includes(r)?a(e,r,o):["sent","failed"].includes(r)&&a(e,`mail${r}`,o),a(e,"submit",o),t})).then((t=>{t.posted_data_hash&&(e.querySelector('input[name="_wpcf7_posted_data_hash"]').value=t.posted_data_hash),"mail_sent"===t.status&&(e.reset(),e.wpcf7.resetOnMailSent=!0),t.invalid_fields&&t.invalid_fields.forEach((t=>{s(e,t.field,t.message)})),e.wpcf7.parent.querySelector('.screen-reader-response [role="status"]').insertAdjacentText("beforeend",t.message),e.querySelectorAll(".wpcf7-response-output").forEach((e=>{e.innerText=t.message}))})).catch((e=>console.error(e)))}r.use(((e,t)=>{if(e.wpcf7&&"feedback"===e.wpcf7.endpoint){const{form:t,detail:r}=e.wpcf7;d(t),a(t,"beforesubmit",r),n(t,"submitting")}return t(e)}));const d=e=>{e.querySelectorAll(".wpcf7-form-control-wrap").forEach((t=>{t.dataset.name&&i(e,t.dataset.name)})),e.wpcf7.parent.querySelector('.screen-reader-response [role="status"]').innerText="",e.querySelectorAll(".wpcf7-response-output").forEach((e=>{e.innerText=""}))};function f(e){const t=new FormData(e),c={contactFormId:e.wpcf7.id,pluginVersion:e.wpcf7.pluginVersion,contactFormLocale:e.wpcf7.locale,unitTag:e.wpcf7.unitTag,containerPostId:e.wpcf7.containerPost,status:e.wpcf7.status,inputs:Array.from(t,(e=>{const t=e[0],a=e[1];return!t.match(/^_/)&&{name:t,value:a}})).filter((e=>!1!==e)),formData:t};r({endpoint:`contact-forms/${e.wpcf7.id}/refill`,method:"GET",wpcf7:{endpoint:"refill",form:e,detail:c}}).then((t=>{e.wpcf7.resetOnMailSent?(delete e.wpcf7.resetOnMailSent,n(e,"mail_sent")):n(e,"init"),c.apiResponse=t,a(e,"reset",c)})).catch((e=>console.error(e)))}r.use(((e,t)=>{if(e.wpcf7&&"refill"===e.wpcf7.endpoint){const{form:t,detail:a}=e.wpcf7;d(t),n(t,"resetting")}return t(e)}));const u=(e,t)=>{for(const a in t){const n=t[a];e.querySelectorAll(`input[name="${a}"]`).forEach((e=>{e.value=""})),e.querySelectorAll(`img.wpcf7-captcha-${a.replaceAll(":","")}`).forEach((e=>{e.setAttribute("src",n)}));const r=/([0-9]+)\.(png|gif|jpeg)$/.exec(n);r&&e.querySelectorAll(`input[name="_wpcf7_captcha_challenge_${a}"]`).forEach((e=>{e.value=r[1]}))}},m=(e,t)=>{for(const a in t){const n=t[a][0],r=t[a][1];e.querySelectorAll(`.wpcf7-form-control-wrap[data-name="${a}"]`).forEach((e=>{e.querySelector(`input[name="${a}"]`).value="",e.querySelector(".wpcf7-quiz-label").textContent=n,e.querySelector(`input[name="_wpcf7_quiz_answer_${a}"]`).value=r}))}};function w(e){const a=new FormData(e);e.wpcf7={id:t(a.get("_wpcf7")),status:e.getAttribute("data-status"),pluginVersion:a.get("_wpcf7_version"),locale:a.get("_wpcf7_locale"),unitTag:a.get("_wpcf7_unit_tag"),containerPost:t(a.get("_wpcf7_container_post")),parent:e.closest(".wpcf7"),get schema(){return wpcf7.schemas.get(this.id)}},wpcf7.schemas.set(e.wpcf7.id,void 0),e.querySelectorAll(".has-spinner").forEach((e=>{e.insertAdjacentHTML("afterend",'<span class="wpcf7-spinner"></span>')})),(e=>{e.querySelectorAll(".wpcf7-exclusive-checkbox").forEach((t=>{t.addEventListener("change",(t=>{const a=t.target.getAttribute("name");e.querySelectorAll(`input[type="checkbox"][name="${a}"]`).forEach((e=>{e!==t.target&&(e.checked=!1)}))}))}))})(e),(e=>{e.querySelectorAll(".has-free-text").forEach((t=>{const a=t.querySelector("input.wpcf7-free-text"),n=t.querySelector('input[type="checkbox"], input[type="radio"]');a.disabled=!n.checked,e.addEventListener("change",(e=>{a.disabled=!n.checked,e.target===n&&n.checked&&a.focus()}))}))})(e),(e=>{e.querySelectorAll(".wpcf7-validates-as-url").forEach((e=>{e.addEventListener("change",(t=>{let a=e.value.trim();a&&!a.match(/^[a-z][a-z0-9.+-]*:/i)&&-1!==a.indexOf(".")&&(a=a.replace(/^\/+/,""),a="http://"+a),e.value=a}))}))})(e),(e=>{if(!e.querySelector(".wpcf7-acceptance")||e.classList.contains("wpcf7-acceptance-as-validation"))return;const t=()=>{let t=!0;e.querySelectorAll(".wpcf7-acceptance").forEach((e=>{if(!t||e.classList.contains("optional"))return;const a=e.querySelector('input[type="checkbox"]');(e.classList.contains("invert")&&a.checked||!e.classList.contains("invert")&&!a.checked)&&(t=!1)})),e.querySelectorAll(".wpcf7-submit").forEach((e=>{e.disabled=!t}))};t(),e.addEventListener("change",(e=>{t()})),e.addEventListener("wpcf7reset",(e=>{t()}))})(e),(e=>{const a=(e,a)=>{const n=t(e.getAttribute("data-starting-value")),r=t(e.getAttribute("data-maximum-value")),c=t(e.getAttribute("data-minimum-value")),o=e.classList.contains("down")?n-a.value.trim().length:a.value.trim().length;e.setAttribute("data-current-value",o),e.innerText=o,r&&r<a.value.length?e.classList.add("too-long"):e.classList.remove("too-long"),c&&a.value.length<c?e.classList.add("too-short"):e.classList.remove("too-short")},n=t=>{t={init:!1,...t},e.querySelectorAll(".wpcf7-character-count").forEach((n=>{const r=n.getAttribute("data-target-name"),c=e.querySelector(`[name="${r}"]`);c&&(c.value=c.defaultValue,a(n,c),t.init&&c.addEventListener("keyup",(e=>{a(n,c)})))}))};n({init:!0}),e.addEventListener("wpcf7reset",(e=>{n()}))})(e),window.addEventListener("load",(t=>{wpcf7.cached&&e.reset()})),e.addEventListener("reset",(t=>{wpcf7.reset(e)})),e.addEventListener("submit",(t=>{wpcf7.submit(e,{submitter:t.submitter}),t.preventDefault()})),e.addEventListener("wpcf7submit",(t=>{t.detail.apiResponse.captcha&&u(e,t.detail.apiResponse.captcha),t.detail.apiResponse.quiz&&m(e,t.detail.apiResponse.quiz)})),e.addEventListener("wpcf7reset",(t=>{t.detail.apiResponse.captcha&&u(e,t.detail.apiResponse.captcha),t.detail.apiResponse.quiz&&m(e,t.detail.apiResponse.quiz)})),e.addEventListener("change",(t=>{t.target.closest(".wpcf7-form-control")&&wpcf7.validate(e,{target:t.target})})),e.addEventListener("wpcf7statuschanged",(t=>{const a=t.detail.status;e.querySelectorAll(".active-on-any").forEach((e=>{e.removeAttribute("inert"),e.classList.remove("active-on-any")})),e.querySelectorAll(`.inert-on-${a}`).forEach((e=>{e.setAttribute("inert","inert"),e.classList.add("active-on-any")}))}))}document.addEventListener("DOMContentLoaded",(t=>{var a;if("undefined"!=typeof wpcf7)if(void 0!==wpcf7.api)if("function"==typeof window.fetch)if("function"==typeof window.FormData)if("function"==typeof NodeList.prototype.forEach)if("function"==typeof String.prototype.replaceAll){wpcf7={init:w,submit:p,reset:f,validate:o,schemas:new Map,...null!==(a=wpcf7)&&void 0!==a?a:{}},document.querySelectorAll("form .wpcf7[data-wpcf7-id]").forEach((t=>{const a=document.createElement("p");a.setAttribute("class","wpcf7-form-in-wrong-place");const n=document.createElement("strong");n.append((0,e.__)("Error:","contact-form-7"));const r=(0,e.__)("This contact form is placed in the wrong place.","contact-form-7");a.append(n," ",r),t.replaceWith(a)})),document.querySelectorAll(".wpcf7 > form").forEach((e=>{wpcf7.init(e),e.closest(".wpcf7").classList.replace("no-js","js")}));for(const e of wpcf7.schemas.keys())r({endpoint:`contact-forms/${e}/feedback/schema`,method:"GET"}).then((t=>{wpcf7.schemas.set(e,t)}))}else console.error("Your browser does not support String.replaceAll().");else console.error("Your browser does not support NodeList.forEach().");else console.error("Your browser does not support window.FormData().");else console.error("Your browser does not support window.fetch().");else console.error("wpcf7.api is not defined.");else console.error("wpcf7 is not defined.")}))})();
/*! jQuery UI - v1.13.3 - 2024-04-26
* https://jqueryui.com
* Includes: widget.js, position.js, data.js, disable-selection.js, effect.js, effects/effect-blind.js, effects/effect-bounce.js, effects/effect-clip.js, effects/effect-drop.js, effects/effect-explode.js, effects/effect-fade.js, effects/effect-fold.js, effects/effect-highlight.js, effects/effect-puff.js, effects/effect-pulsate.js, effects/effect-scale.js, effects/effect-shake.js, effects/effect-size.js, effects/effect-slide.js, effects/effect-transfer.js, focusable.js, form-reset-mixin.js, jquery-patch.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/accordion.js, widgets/autocomplete.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/datepicker.js, widgets/dialog.js, widgets/draggable.js, widgets/droppable.js, widgets/menu.js, widgets/mouse.js, widgets/progressbar.js, widgets/resizable.js, widgets/selectable.js, widgets/selectmenu.js, widgets/slider.js, widgets/sortable.js, widgets/spinner.js, widgets/tabs.js, widgets/tooltip.js
* Copyright jQuery Foundation and other contributors; Licensed MIT */
!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(x){"use strict";var t,e,i,n,W,C,o,s,r,l,a,h,u;function E(t,e,i){return[parseFloat(t[0])*(a.test(t[0])?e/100:1),parseFloat(t[1])*(a.test(t[1])?i/100:1)]}function L(t,e){return parseInt(x.css(t,e),10)||0}function N(t){return null!=t&&t===t.window}x.ui=x.ui||{},x.ui.version="1.13.3",
x.extend(x.expr.pseudos,{data:x.expr.createPseudo?x.expr.createPseudo(function(e){return function(t){return!!x.data(t,e)}}):function(t,e,i){return!!x.data(t,i[3])}}),
x.fn.extend({disableSelection:(t="onselectstart"in document.createElement("div")?"selectstart":"mousedown",function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}),enableSelection:function(){return this.off(".ui-disableSelection")}}),
x.ui.focusable=function(t,e){var i,n,o,s=t.nodeName.toLowerCase();return"area"===s?(o=(i=t.parentNode).name,!(!t.href||!o||"map"!==i.nodeName.toLowerCase())&&0<(i=x("img[usemap='#"+o+"']")).length&&i.is(":visible")):(/^(input|select|textarea|button|object)$/.test(s)?(n=!t.disabled)&&(o=x(t).closest("fieldset")[0])&&(n=!o.disabled):n="a"===s&&t.href||e,n&&x(t).is(":visible")&&function(t){var e=t.css("visibility");for(;"inherit"===e;)t=t.parent(),e=t.css("visibility");return"visible"===e}(x(t)))},x.extend(x.expr.pseudos,{focusable:function(t){return x.ui.focusable(t,null!=x.attr(t,"tabindex"))}}),x.fn._form=function(){return"string"==typeof this[0].form?this.closest("form"):x(this[0].form)},
x.ui.formResetMixin={_formResetHandler:function(){var e=x(this);setTimeout(function(){var t=e.data("ui-form-reset-instances");x.each(t,function(){this.refresh()})})},_bindFormResetHandler:function(){var t;this.form=this.element._form(),this.form.length&&((t=this.form.data("ui-form-reset-instances")||[]).length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t))},_unbindFormResetHandler:function(){var t;this.form.length&&((t=this.form.data("ui-form-reset-instances")).splice(x.inArray(this,t),1),t.length?this.form.data("ui-form-reset-instances",t):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset"))}},x.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),
x.expr.pseudos||(x.expr.pseudos=x.expr[":"]),x.uniqueSort||(x.uniqueSort=x.unique),x.escapeSelector||(e=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,i=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},x.escapeSelector=function(t){return(t+"").replace(e,i)}),x.fn.even&&x.fn.odd||x.fn.extend({even:function(){return this.filter(function(t){return t%2==0})},odd:function(){return this.filter(function(t){return t%2==1})}}),
x.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},
x.fn.labels=function(){var t,e,i;return this.length?this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(e=this.eq(0).parents("label"),(t=this.attr("id"))&&(i=(i=this.eq(0).parents().last()).add((i.length?i:this).siblings()),t="label[for='"+x.escapeSelector(t)+"']",e=e.add(i.find(t).addBack(t))),this.pushStack(e)):this.pushStack([])},x.ui.plugin={add:function(t,e,i){var n,o=x.ui[t].prototype;for(n in i)o.plugins[n]=o.plugins[n]||[],o.plugins[n].push([e,i[n]])},call:function(t,e,i,n){var o,s=t.plugins[e];if(s&&(n||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(o=0;o<s.length;o++)t.options[s[o][0]]&&s[o][1].apply(t.element,i)}},
W=Math.max,C=Math.abs,o=/left|center|right/,s=/top|center|bottom/,r=/[\+\-]\d+(\.[\d]+)?%?/,l=/^\w+/,a=/%$/,h=x.fn.position,x.position={scrollbarWidth:function(){var t,e,i;return void 0!==n?n:(i=(e=x("<div style='display:block;position:absolute;width:200px;height:200px;overflow:hidden;'><div style='height:300px;width:auto;'></div></div>")).children()[0],x("body").append(e),t=i.offsetWidth,e.css("overflow","scroll"),t===(i=i.offsetWidth)&&(i=e[0].clientWidth),e.remove(),n=t-i)},getScrollInfo:function(t){var e=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),e="scroll"===e||"auto"===e&&t.width<t.element[0].scrollWidth;return{width:"scroll"===i||"auto"===i&&t.height<t.element[0].scrollHeight?x.position.scrollbarWidth():0,height:e?x.position.scrollbarWidth():0}},getWithinInfo:function(t){var e=x(t||window),i=N(e[0]),n=!!e[0]&&9===e[0].nodeType;return{element:e,isWindow:i,isDocument:n,offset:!i&&!n?x(t).offset():{left:0,top:0},scrollLeft:e.scrollLeft(),scrollTop:e.scrollTop(),width:e.outerWidth(),height:e.outerHeight()}}},x.fn.position=function(f){var c,d,p,g,m,v,y,w,b,_,t,e;return f&&f.of?(v="string"==typeof(f=x.extend({},f)).of?x(document).find(f.of):x(f.of),y=x.position.getWithinInfo(f.within),w=x.position.getScrollInfo(y),b=(f.collision||"flip").split(" "),_={},e=9===(e=(t=v)[0]).nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:N(e)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:e.preventDefault?{width:0,height:0,offset:{top:e.pageY,left:e.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()},v[0].preventDefault&&(f.at="left top"),d=e.width,p=e.height,m=x.extend({},g=e.offset),x.each(["my","at"],function(){var t,e,i=(f[this]||"").split(" ");(i=1===i.length?o.test(i[0])?i.concat(["center"]):s.test(i[0])?["center"].concat(i):["center","center"]:i)[0]=o.test(i[0])?i[0]:"center",i[1]=s.test(i[1])?i[1]:"center",t=r.exec(i[0]),e=r.exec(i[1]),_[this]=[t?t[0]:0,e?e[0]:0],f[this]=[l.exec(i[0])[0],l.exec(i[1])[0]]}),1===b.length&&(b[1]=b[0]),"right"===f.at[0]?m.left+=d:"center"===f.at[0]&&(m.left+=d/2),"bottom"===f.at[1]?m.top+=p:"center"===f.at[1]&&(m.top+=p/2),c=E(_.at,d,p),m.left+=c[0],m.top+=c[1],this.each(function(){var i,t,r=x(this),l=r.outerWidth(),a=r.outerHeight(),e=L(this,"marginLeft"),n=L(this,"marginTop"),o=l+e+L(this,"marginRight")+w.width,s=a+n+L(this,"marginBottom")+w.height,h=x.extend({},m),u=E(_.my,r.outerWidth(),r.outerHeight());"right"===f.my[0]?h.left-=l:"center"===f.my[0]&&(h.left-=l/2),"bottom"===f.my[1]?h.top-=a:"center"===f.my[1]&&(h.top-=a/2),h.left+=u[0],h.top+=u[1],i={marginLeft:e,marginTop:n},x.each(["left","top"],function(t,e){x.ui.position[b[t]]&&x.ui.position[b[t]][e](h,{targetWidth:d,targetHeight:p,elemWidth:l,elemHeight:a,collisionPosition:i,collisionWidth:o,collisionHeight:s,offset:[c[0]+u[0],c[1]+u[1]],my:f.my,at:f.at,within:y,elem:r})}),f.using&&(t=function(t){var e=g.left-h.left,i=e+d-l,n=g.top-h.top,o=n+p-a,s={target:{element:v,left:g.left,top:g.top,width:d,height:p},element:{element:r,left:h.left,top:h.top,width:l,height:a},horizontal:i<0?"left":0<e?"right":"center",vertical:o<0?"top":0<n?"bottom":"middle"};d<l&&C(e+i)<d&&(s.horizontal="center"),p<a&&C(n+o)<p&&(s.vertical="middle"),W(C(e),C(i))>W(C(n),C(o))?s.important="horizontal":s.important="vertical",f.using.call(this,t,s)}),r.offset(x.extend(h,{using:t}))})):h.apply(this,arguments)},x.ui.position={fit:{left:function(t,e){var i,n=e.within,o=n.isWindow?n.scrollLeft:n.offset.left,n=n.width,s=t.left-e.collisionPosition.marginLeft,r=o-s,l=s+e.collisionWidth-n-o;e.collisionWidth>n?0<r&&l<=0?(i=t.left+r+e.collisionWidth-n-o,t.left+=r-i):t.left=!(0<l&&r<=0)&&l<r?o+n-e.collisionWidth:o:0<r?t.left+=r:0<l?t.left-=l:t.left=W(t.left-s,t.left)},top:function(t,e){var i,n=e.within,n=n.isWindow?n.scrollTop:n.offset.top,o=e.within.height,s=t.top-e.collisionPosition.marginTop,r=n-s,l=s+e.collisionHeight-o-n;e.collisionHeight>o?0<r&&l<=0?(i=t.top+r+e.collisionHeight-o-n,t.top+=r-i):t.top=!(0<l&&r<=0)&&l<r?n+o-e.collisionHeight:n:0<r?t.top+=r:0<l?t.top-=l:t.top=W(t.top-s,t.top)}},flip:{left:function(t,e){var i=e.within,n=i.offset.left+i.scrollLeft,o=i.width,i=i.isWindow?i.scrollLeft:i.offset.left,s=t.left-e.collisionPosition.marginLeft,r=s-i,s=s+e.collisionWidth-o-i,l="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,a="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,h=-2*e.offset[0];r<0?((o=t.left+l+a+h+e.collisionWidth-o-n)<0||o<C(r))&&(t.left+=l+a+h):0<s&&(0<(n=t.left-e.collisionPosition.marginLeft+l+a+h-i)||C(n)<s)&&(t.left+=l+a+h)},top:function(t,e){var i=e.within,n=i.offset.top+i.scrollTop,o=i.height,i=i.isWindow?i.scrollTop:i.offset.top,s=t.top-e.collisionPosition.marginTop,r=s-i,s=s+e.collisionHeight-o-i,l="top"===e.my[1]?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,a="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,h=-2*e.offset[1];r<0?((o=t.top+l+a+h+e.collisionHeight-o-n)<0||o<C(r))&&(t.top+=l+a+h):0<s&&(0<(n=t.top-e.collisionPosition.marginTop+l+a+h-i)||C(n)<s)&&(t.top+=l+a+h)}},flipfit:{left:function(){x.ui.position.flip.left.apply(this,arguments),x.ui.position.fit.left.apply(this,arguments)},top:function(){x.ui.position.flip.top.apply(this,arguments),x.ui.position.fit.top.apply(this,arguments)}}},x.ui.safeActiveElement=function(e){var i;try{i=e.activeElement}catch(t){i=e.body}return i=(i=i||e.body).nodeName?i:e.body},x.ui.safeBlur=function(t){t&&"body"!==t.nodeName.toLowerCase()&&x(t).trigger("blur")},
x.fn.scrollParent=function(t){var e=this.css("position"),i="absolute"===e,n=t?/(auto|scroll|hidden)/:/(auto|scroll)/,t=this.parents().filter(function(){var t=x(this);return(!i||"static"!==t.css("position"))&&n.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==e&&t.length?t:x(this[0].ownerDocument||document)},
x.extend(x.expr.pseudos,{tabbable:function(t){var e=x.attr(t,"tabindex"),i=null!=e;return(!i||0<=e)&&x.ui.focusable(t,i)}}),
x.fn.extend({uniqueId:(u=0,function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++u)})}),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&x(this).removeAttr("id")})}});
var f,c=0,d=Array.prototype.hasOwnProperty,p=Array.prototype.slice;x.cleanData=(f=x.cleanData,function(t){for(var e,i,n=0;null!=(i=t[n]);n++)(e=x._data(i,"events"))&&e.remove&&x(i).triggerHandler("remove");f(t)}),x.widget=function(t,i,e){var n,o,s,r={},l=t.split(".")[0],a=l+"-"+(t=t.split(".")[1]);return e||(e=i,i=x.Widget),Array.isArray(e)&&(e=x.extend.apply(null,[{}].concat(e))),x.expr.pseudos[a.toLowerCase()]=function(t){return!!x.data(t,a)},x[l]=x[l]||{},n=x[l][t],o=x[l][t]=function(t,e){if(!this||!this._createWidget)return new o(t,e);arguments.length&&this._createWidget(t,e)},x.extend(o,n,{version:e.version,_proto:x.extend({},e),_childConstructors:[]}),(s=new i).options=x.widget.extend({},s.options),x.each(e,function(e,n){function o(){return i.prototype[e].apply(this,arguments)}function s(t){return i.prototype[e].apply(this,t)}r[e]="function"!=typeof n?n:function(){var t,e=this._super,i=this._superApply;return this._super=o,this._superApply=s,t=n.apply(this,arguments),this._super=e,this._superApply=i,t}}),o.prototype=x.widget.extend(s,{widgetEventPrefix:n&&s.widgetEventPrefix||t},r,{constructor:o,namespace:l,widgetName:t,widgetFullName:a}),n?(x.each(n._childConstructors,function(t,e){var i=e.prototype;x.widget(i.namespace+"."+i.widgetName,o,e._proto)}),delete n._childConstructors):i._childConstructors.push(o),x.widget.bridge(t,o),o},x.widget.extend=function(t){for(var e,i,n=p.call(arguments,1),o=0,s=n.length;o<s;o++)for(e in n[o])i=n[o][e],d.call(n[o],e)&&void 0!==i&&(x.isPlainObject(i)?t[e]=x.isPlainObject(t[e])?x.widget.extend({},t[e],i):x.widget.extend({},i):t[e]=i);return t},x.widget.bridge=function(s,e){var r=e.prototype.widgetFullName||s;x.fn[s]=function(i){var t="string"==typeof i,n=p.call(arguments,1),o=this;return t?this.length||"instance"!==i?this.each(function(){var t,e=x.data(this,r);return"instance"===i?(o=e,!1):e?"function"!=typeof e[i]||"_"===i.charAt(0)?x.error("no such method '"+i+"' for "+s+" widget instance"):(t=e[i].apply(e,n))!==e&&void 0!==t?(o=t&&t.jquery?o.pushStack(t.get()):t,!1):void 0:x.error("cannot call methods on "+s+" prior to initialization; attempted to call method '"+i+"'")}):o=void 0:(n.length&&(i=x.widget.extend.apply(null,[i].concat(n))),this.each(function(){var t=x.data(this,r);t?(t.option(i||{}),t._init&&t._init()):x.data(this,r,new e(i,this))})),o}},x.Widget=function(){},x.Widget._childConstructors=[],x.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,e){e=x(e||this.defaultElement||this)[0],this.element=x(e),this.uuid=c++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=x(),this.hoverable=x(),this.focusable=x(),this.classesElementLookup={},e!==this&&(x.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=x(e.style?e.ownerDocument:e.document||e),this.window=x(this.document[0].defaultView||this.document[0].parentWindow)),this.options=x.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:x.noop,_create:x.noop,_init:x.noop,destroy:function(){var i=this;this._destroy(),x.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:x.noop,widget:function(){return this.element},option:function(t,e){var i,n,o,s=t;if(0===arguments.length)return x.widget.extend({},this.options);if("string"==typeof t)if(s={},t=(i=t.split(".")).shift(),i.length){for(n=s[t]=x.widget.extend({},this.options[t]),o=0;o<i.length-1;o++)n[i[o]]=n[i[o]]||{},n=n[i[o]];if(t=i.pop(),1===arguments.length)return void 0===n[t]?null:n[t];n[t]=e}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];s[t]=e}return this._setOptions(s),this},_setOptions:function(t){for(var e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(t){var e,i,n;for(e in t)n=this.classesElementLookup[e],t[e]!==this.options.classes[e]&&n&&n.length&&(i=x(n.get()),this._removeClass(n,e),i.addClass(this._classes({element:i,keys:e,classes:t,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(o){var s=[],r=this;function t(t,e){for(var i,n=0;n<t.length;n++)i=r.classesElementLookup[t[n]]||x(),i=o.add?(function(){var i=[];o.element.each(function(t,e){x.map(r.classesElementLookup,function(t){return t}).some(function(t){return t.is(e)})||i.push(e)}),r._on(x(i),{remove:"_untrackClassesElement"})}(),x(x.uniqueSort(i.get().concat(o.element.get())))):x(i.not(o.element).get()),r.classesElementLookup[t[n]]=i,s.push(t[n]),e&&o.classes[t[n]]&&s.push(o.classes[t[n]])}return(o=x.extend({element:this.element,classes:this.options.classes||{}},o)).keys&&t(o.keys.match(/\S+/g)||[],!0),o.extra&&t(o.extra.match(/\S+/g)||[]),s.join(" ")},_untrackClassesElement:function(i){var n=this;x.each(n.classesElementLookup,function(t,e){-1!==x.inArray(i.target,e)&&(n.classesElementLookup[t]=x(e.not(i.target).get()))}),this._off(x(i.target))},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,n){var o="string"==typeof t||null===t,e={extra:o?e:i,keys:o?t:e,element:o?this.element:t,add:n="boolean"==typeof n?n:i};return e.element.toggleClass(this._classes(e),n),this},_on:function(o,s,t){var r,l=this;"boolean"!=typeof o&&(t=s,s=o,o=!1),t?(s=r=x(s),this.bindings=this.bindings.add(s)):(t=s,s=this.element,r=this.widget()),x.each(t,function(t,e){function i(){if(o||!0!==l.options.disabled&&!x(this).hasClass("ui-state-disabled"))return("string"==typeof e?l[e]:e).apply(l,arguments)}"string"!=typeof e&&(i.guid=e.guid=e.guid||i.guid||x.guid++);var t=t.match(/^([\w:-]*)\s*(.*)$/),n=t[1]+l.eventNamespace,t=t[2];t?r.on(n,t,i):s.on(n,i)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.off(e),this.bindings=x(this.bindings.not(t).get()),this.focusable=x(this.focusable.not(t).get()),this.hoverable=x(this.hoverable.not(t).get())},_delay:function(t,e){var i=this;return setTimeout(function(){return("string"==typeof t?i[t]:t).apply(i,arguments)},e||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){this._addClass(x(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(x(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){this._addClass(x(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(x(t.currentTarget),null,"ui-state-focus")}})},_trigger:function(t,e,i){var n,o,s=this.options[t];if(i=i||{},(e=x.Event(e)).type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),e.target=this.element[0],o=e.originalEvent)for(n in o)n in e||(e[n]=o[n]);return this.element.trigger(e,i),!("function"==typeof s&&!1===s.apply(this.element[0],[e].concat(i))||e.isDefaultPrevented())}},x.each({show:"fadeIn",hide:"fadeOut"},function(s,r){x.Widget.prototype["_"+s]=function(e,t,i){var n,o=(t="string"==typeof t?{effect:t}:t)?!0!==t&&"number"!=typeof t&&t.effect||r:s;"number"==typeof(t=t||{})?t={duration:t}:!0===t&&(t={}),n=!x.isEmptyObject(t),t.complete=i,t.delay&&e.delay(t.delay),n&&x.effects&&x.effects.effect[o]?e[s](t):o!==s&&e[o]?e[o](t.duration,t.easing,i):e.queue(function(t){x(this)[s](),i&&i.call(e[0]),t()})}})});
!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery","./jquery-var-for-color","./vendor/jquery-color/jquery.color","./version"],t):t(jQuery)}(function(u){"use strict";var s,o,r,a,c,e,n,i,f,l,d="ui-effects-",h="ui-effects-style",p="ui-effects-animated";function m(t){var e,n,i=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,o={};if(i&&i.length&&i[0]&&i[i[0]])for(n=i.length;n--;)"string"==typeof i[e=i[n]]&&(o[e.replace(/-([\da-z])/gi,function(t,e){return e.toUpperCase()})]=i[e]);else for(e in i)"string"==typeof i[e]&&(o[e]=i[e]);return o}function g(t,e,n,i){return t={effect:t=u.isPlainObject(t)?(e=t).effect:t},"function"==typeof(e=null==e?{}:e)&&(i=e,n=null,e={}),"number"!=typeof e&&!u.fx.speeds[e]||(i=n,n=e,e={}),"function"==typeof n&&(i=n,n=null),e&&u.extend(t,e),n=n||e.duration,t.duration=u.fx.off?0:"number"==typeof n?n:n in u.fx.speeds?u.fx.speeds[n]:u.fx.speeds._default,t.complete=i||e.complete,t}function v(t){return!t||"number"==typeof t||u.fx.speeds[t]||"string"==typeof t&&!u.effects.effect[t]||"function"==typeof t||"object"==typeof t&&!t.effect}function y(t,e){var n=e.outerWidth(),e=e.outerHeight(),t=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/.exec(t)||["",0,n,e,0];return{top:parseFloat(t[1])||0,right:"auto"===t[2]?n:parseFloat(t[2]),bottom:"auto"===t[3]?e:parseFloat(t[3]),left:parseFloat(t[4])||0}}return u.effects={effect:{}},a=["add","remove","toggle"],c={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1},u.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,e){u.fx.step[e]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(jQuery.style(t.elem,e,t.end),t.setAttr=!0)}}),u.fn.addBack||(u.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),u.effects.animateClass=function(o,t,e,n){var s=u.speed(t,e,n);return this.queue(function(){var n=u(this),t=n.attr("class")||"",e=(e=s.children?n.find("*").addBack():n).map(function(){return{el:u(this),start:m(this)}}),i=function(){u.each(a,function(t,e){o[e]&&n[e+"Class"](o[e])})};i(),e=e.map(function(){return this.end=m(this.el[0]),this.diff=function(t,e){var n,i,o={};for(n in e)i=e[n],t[n]===i||c[n]||!u.fx.step[n]&&isNaN(parseFloat(i))||(o[n]=i);return o}(this.start,this.end),this}),n.attr("class",t),e=e.map(function(){var t=this,e=u.Deferred(),n=u.extend({},s,{queue:!1,complete:function(){e.resolve(t)}});return this.el.animate(this.diff,n),e.promise()}),u.when.apply(u,e.get()).done(function(){i(),u.each(arguments,function(){var e=this.el;u.each(this.diff,function(t){e.css(t,"")})}),s.complete.call(n[0])})})},u.fn.extend({addClass:(r=u.fn.addClass,function(t,e,n,i){return e?u.effects.animateClass.call(this,{add:t},e,n,i):r.apply(this,arguments)}),removeClass:(o=u.fn.removeClass,function(t,e,n,i){return 1<arguments.length?u.effects.animateClass.call(this,{remove:t},e,n,i):o.apply(this,arguments)}),toggleClass:(s=u.fn.toggleClass,function(t,e,n,i,o){return"boolean"==typeof e||void 0===e?n?u.effects.animateClass.call(this,e?{add:t}:{remove:t},n,i,o):s.apply(this,arguments):u.effects.animateClass.call(this,{toggle:t},e,n,i)}),switchClass:function(t,e,n,i,o){return u.effects.animateClass.call(this,{add:e,remove:t},n,i,o)}}),u.expr&&u.expr.pseudos&&u.expr.pseudos.animated&&(u.expr.pseudos.animated=(e=u.expr.pseudos.animated,function(t){return!!u(t).data(p)||e(t)})),!1!==u.uiBackCompat&&u.extend(u.effects,{save:function(t,e){for(var n=0,i=e.length;n<i;n++)null!==e[n]&&t.data(d+e[n],t[0].style[e[n]])},restore:function(t,e){for(var n,i=0,o=e.length;i<o;i++)null!==e[i]&&(n=t.data(d+e[i]),t.css(e[i],n))},setMode:function(t,e){return e="toggle"===e?t.is(":hidden")?"show":"hide":e},createWrapper:function(n){if(n.parent().is(".ui-effects-wrapper"))return n.parent();var i={width:n.outerWidth(!0),height:n.outerHeight(!0),float:n.css("float")},t=u("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e={width:n.width(),height:n.height()},o=document.activeElement;try{o.id}catch(t){o=document.body}return n.wrap(t),n[0]!==o&&!u.contains(n[0],o)||u(o).trigger("focus"),t=n.parent(),"static"===n.css("position")?(t.css({position:"relative"}),n.css({position:"relative"})):(u.extend(i,{position:n.css("position"),zIndex:n.css("z-index")}),u.each(["top","left","bottom","right"],function(t,e){i[e]=n.css(e),isNaN(parseInt(i[e],10))&&(i[e]="auto")}),n.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),n.css(e),t.css(i).show()},removeWrapper:function(t){var e=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),t[0]!==e&&!u.contains(t[0],e)||u(e).trigger("focus")),t}}),u.extend(u.effects,{version:"1.13.3",define:function(t,e,n){return n||(n=e,e="effect"),u.effects.effect[t]=n,u.effects.effect[t].mode=e,n},scaledDimensions:function(t,e,n){var i;return 0===e?{height:0,width:0,outerHeight:0,outerWidth:0}:(i="horizontal"!==n?(e||100)/100:1,n="vertical"!==n?(e||100)/100:1,{height:t.height()*n,width:t.width()*i,outerHeight:t.outerHeight()*n,outerWidth:t.outerWidth()*i})},clipToBox:function(t){return{width:t.clip.right-t.clip.left,height:t.clip.bottom-t.clip.top,left:t.clip.left,top:t.clip.top}},unshift:function(t,e,n){var i=t.queue();1<e&&i.splice.apply(i,[1,0].concat(i.splice(e,n))),t.dequeue()},saveStyle:function(t){t.data(h,t[0].style.cssText)},restoreStyle:function(t){t[0].style.cssText=t.data(h)||"",t.removeData(h)},mode:function(t,e){t=t.is(":hidden");return"toggle"===e&&(e=t?"show":"hide"),e=(t?"hide"===e:"show"===e)?"none":e},getBaseline:function(t,e){var n,i;switch(t[0]){case"top":n=0;break;case"middle":n=.5;break;case"bottom":n=1;break;default:n=t[0]/e.height}switch(t[1]){case"left":i=0;break;case"center":i=.5;break;case"right":i=1;break;default:i=t[1]/e.width}return{x:i,y:n}},createPlaceholder:function(t){var e,n=t.css("position"),i=t.position();return t.css({marginTop:t.css("marginTop"),marginBottom:t.css("marginBottom"),marginLeft:t.css("marginLeft"),marginRight:t.css("marginRight")}).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()),/^(static|relative)/.test(n)&&(n="absolute",e=u("<"+t[0].nodeName+">").insertAfter(t).css({display:/^(inline|ruby)/.test(t.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:t.css("marginTop"),marginBottom:t.css("marginBottom"),marginLeft:t.css("marginLeft"),marginRight:t.css("marginRight"),float:t.css("float")}).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).addClass("ui-effects-placeholder"),t.data(d+"placeholder",e)),t.css({position:n,left:i.left,top:i.top}),e},removePlaceholder:function(t){var e=d+"placeholder",n=t.data(e);n&&(n.remove(),t.removeData(e))},cleanUp:function(t){u.effects.restoreStyle(t),u.effects.removePlaceholder(t)},setTransition:function(i,t,o,s){return s=s||{},u.each(t,function(t,e){var n=i.cssUnit(e);0<n[0]&&(s[e]=n[0]*o+n[1])}),s}}),u.fn.extend({effect:function(){function t(t){var e=u(this),n=u.effects.mode(e,a)||s;e.data(p,!0),c.push(n),s&&("show"===n||n===s&&"hide"===n)&&e.show(),s&&"none"===n||u.effects.saveStyle(e),"function"==typeof t&&t()}var i=g.apply(this,arguments),o=u.effects.effect[i.effect],s=o.mode,e=i.queue,n=e||"fx",r=i.complete,a=i.mode,c=[];return u.fx.off||!o?a?this[a](i.duration,r):this.each(function(){r&&r.call(this)}):!1===e?this.each(t).each(f):this.queue(n,t).queue(n,f);function f(t){var e=u(this);function n(){"function"==typeof r&&r.call(e[0]),"function"==typeof t&&t()}i.mode=c.shift(),!1===u.uiBackCompat||s?"none"===i.mode?(e[a](),n()):o.call(e[0],i,function(){e.removeData(p),u.effects.cleanUp(e),"hide"===i.mode&&e.hide(),n()}):(e.is(":hidden")?"hide"===a:"show"===a)?(e[a](),n()):o.call(e[0],i,n)}},show:(f=u.fn.show,function(t){return v(t)?f.apply(this,arguments):((t=g.apply(this,arguments)).mode="show",this.effect.call(this,t))}),hide:(i=u.fn.hide,function(t){return v(t)?i.apply(this,arguments):((t=g.apply(this,arguments)).mode="hide",this.effect.call(this,t))}),toggle:(n=u.fn.toggle,function(t){return v(t)||"boolean"==typeof t?n.apply(this,arguments):((t=g.apply(this,arguments)).mode="toggle",this.effect.call(this,t))}),cssUnit:function(t){var n=this.css(t),i=[];return u.each(["em","px","%","pt"],function(t,e){0<n.indexOf(e)&&(i=[parseFloat(n),e])}),i},cssClip:function(t){return t?this.css("clip","rect("+t.top+"px "+t.right+"px "+t.bottom+"px "+t.left+"px)"):y(this.css("clip"),this)},transfer:function(t,e){var n=u(this),i=u(t.to),o="fixed"===i.css("position"),s=u("body"),r=o?s.scrollTop():0,s=o?s.scrollLeft():0,a=i.offset(),a={top:a.top-r,left:a.left-s,height:i.innerHeight(),width:i.innerWidth()},i=n.offset(),c=u("<div class='ui-effects-transfer'></div>");c.appendTo("body").addClass(t.className).css({top:i.top-r,left:i.left-s,height:n.innerHeight(),width:n.innerWidth(),position:o?"fixed":"absolute"}).animate(a,t.duration,t.easing,function(){c.remove(),"function"==typeof e&&e()})}}),u.fx.step.clip=function(t){t.clipInit||(t.start=u(t.elem).cssClip(),"string"==typeof t.end&&(t.end=y(t.end,t.elem)),t.clipInit=!0),u(t.elem).cssClip({top:t.pos*(t.end.top-t.start.top)+t.start.top,right:t.pos*(t.end.right-t.start.right)+t.start.right,bottom:t.pos*(t.end.bottom-t.start.bottom)+t.start.bottom,left:t.pos*(t.end.left-t.start.left)+t.start.left})},l={},u.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,t){l[t]=function(t){return Math.pow(t,e+2)}}),u.extend(l,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)}}),u.each(l,function(t,e){u.easing["easeIn"+t]=e,u.easing["easeOut"+t]=function(t){return 1-e(1-t)},u.easing["easeInOut"+t]=function(t){return t<.5?e(2*t)/2:1-e(-2*t+2)/2}}),u.effects});
(function(){var t=[].indexOf||function(t){for(var e=0,n=this.length;e<n;e++){if(e in this&&this[e]===t)return e}return-1},e=[].slice;(function(t,e){if(typeof define==="function"&&define.amd){return define("waypoints",["jquery"],function(n){return e(n,t)})}else{return e(t.jQuery,t)}})(this,function(n,r){var i,o,l,s,f,u,a,c,h,d,p,y,v,w,g,m;i=n(r);c=t.call(r,"ontouchstart")>=0;s={horizontal:{},vertical:{}};f=1;a={};u="waypoints-context-id";p="resize.waypoints";y="scroll.waypoints";v=1;w="waypoints-waypoint-ids";g="waypoint";m="waypoints";o=function(){function t(t){var e=this;this.$element=t;this.element=t[0];this.didResize=false;this.didScroll=false;this.id="context"+f++;this.oldScroll={x:t.scrollLeft(),y:t.scrollTop()};this.waypoints={horizontal:{},vertical:{}};t.data(u,this.id);a[this.id]=this;t.bind(y,function(){var t;if(!(e.didScroll||c)){e.didScroll=true;t=function(){e.doScroll();return e.didScroll=false};return r.setTimeout(t,n[m].settings.scrollThrottle)}});t.bind(p,function(){var t;if(!e.didResize){e.didResize=true;t=function(){n[m]("refresh");return e.didResize=false};return r.setTimeout(t,n[m].settings.resizeThrottle)}})}t.prototype.doScroll=function(){var t,e=this;t={horizontal:{newScroll:this.$element.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.$element.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};if(c&&(!t.vertical.oldScroll||!t.vertical.newScroll)){n[m]("refresh")}n.each(t,function(t,r){var i,o,l;l=[];o=r.newScroll>r.oldScroll;i=o?r.forward:r.backward;n.each(e.waypoints[t],function(t,e){var n,i;if(r.oldScroll<(n=e.offset)&&n<=r.newScroll){return l.push(e)}else if(r.newScroll<(i=e.offset)&&i<=r.oldScroll){return l.push(e)}});l.sort(function(t,e){return t.offset-e.offset});if(!o){l.reverse()}return n.each(l,function(t,e){if(e.options.continuous||t===l.length-1){return e.trigger([i])}})});return this.oldScroll={x:t.horizontal.newScroll,y:t.vertical.newScroll}};t.prototype.refresh=function(){var t,e,r,i=this;r=n.isWindow(this.element);e=this.$element.offset();this.doScroll();t={horizontal:{contextOffset:r?0:e.left,contextScroll:r?0:this.oldScroll.x,contextDimension:this.$element.width(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:r?0:e.top,contextScroll:r?0:this.oldScroll.y,contextDimension:r?n[m]("viewportHeight"):this.$element.height(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};return n.each(t,function(t,e){return n.each(i.waypoints[t],function(t,r){var i,o,l,s,f;i=r.options.offset;l=r.offset;o=n.isWindow(r.element)?0:r.$element.offset()[e.offsetProp];if(n.isFunction(i)){i=i.apply(r.element)}else if(typeof i==="string"){i=parseFloat(i);if(r.options.offset.indexOf("%")>-1){i=Math.ceil(e.contextDimension*i/100)}}r.offset=o-e.contextOffset+e.contextScroll-i;if(r.options.onlyOnScroll&&l!=null||!r.enabled){return}if(l!==null&&l<(s=e.oldScroll)&&s<=r.offset){return r.trigger([e.backward])}else if(l!==null&&l>(f=e.oldScroll)&&f>=r.offset){return r.trigger([e.forward])}else if(l===null&&e.oldScroll>=r.offset){return r.trigger([e.forward])}})})};t.prototype.checkEmpty=function(){if(n.isEmptyObject(this.waypoints.horizontal)&&n.isEmptyObject(this.waypoints.vertical)){this.$element.unbind([p,y].join(" "));return delete a[this.id]}};return t}();l=function(){function t(t,e,r){var i,o;r=n.extend({},n.fn[g].defaults,r);if(r.offset==="bottom-in-view"){r.offset=function(){var t;t=n[m]("viewportHeight");if(!n.isWindow(e.element)){t=e.$element.height()}return t-n(this).outerHeight()}}this.$element=t;this.element=t[0];this.axis=r.horizontal?"horizontal":"vertical";this.callback=r.handler;this.context=e;this.enabled=r.enabled;this.id="waypoints"+v++;this.offset=null;this.options=r;e.waypoints[this.axis][this.id]=this;s[this.axis][this.id]=this;i=(o=t.data(w))!=null?o:[];i.push(this.id);t.data(w,i)}t.prototype.trigger=function(t){if(!this.enabled){return}if(this.callback!=null){this.callback.apply(this.element,t)}if(this.options.triggerOnce){return this.destroy()}};t.prototype.disable=function(){return this.enabled=false};t.prototype.enable=function(){this.context.refresh();return this.enabled=true};t.prototype.destroy=function(){delete s[this.axis][this.id];delete this.context.waypoints[this.axis][this.id];return this.context.checkEmpty()};t.getWaypointsByElement=function(t){var e,r;r=n(t).data(w);if(!r){return[]}e=n.extend({},s.horizontal,s.vertical);return n.map(r,function(t){return e[t]})};return t}();d={init:function(t,e){var r;if(e==null){e={}}if((r=e.handler)==null){e.handler=t}this.each(function(){var t,r,i,s;t=n(this);i=(s=e.context)!=null?s:n.fn[g].defaults.context;if(!n.isWindow(i)){i=t.closest(i)}i=n(i);r=a[i.data(u)];if(!r){r=new o(i)}return new l(t,r,e)});n[m]("refresh");return this},disable:function(){return d._invoke(this,"disable")},enable:function(){return d._invoke(this,"enable")},destroy:function(){return d._invoke(this,"destroy")},prev:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(e>0){return t.push(n[e-1])}})},next:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(e<n.length-1){return t.push(n[e+1])}})},_traverse:function(t,e,i){var o,l;if(t==null){t="vertical"}if(e==null){e=r}l=h.aggregate(e);o=[];this.each(function(){var e;e=n.inArray(this,l[t]);return i(o,e,l[t])});return this.pushStack(o)},_invoke:function(t,e){t.each(function(){var t;t=l.getWaypointsByElement(this);return n.each(t,function(t,n){n[e]();return true})});return this}};n.fn[g]=function(){var t,r;r=arguments[0],t=2<=arguments.length?e.call(arguments,1):[];if(d[r]){return d[r].apply(this,t)}else if(n.isFunction(r)){return d.init.apply(this,arguments)}else if(n.isPlainObject(r)){return d.init.apply(this,[null,r])}else if(!r){return n.error("jQuery Waypoints needs a callback function or handler option.")}else{return n.error("The "+r+" method does not exist in jQuery Waypoints.")}};n.fn[g].defaults={context:r,continuous:true,enabled:true,horizontal:false,offset:0,triggerOnce:false};h={refresh:function(){return n.each(a,function(t,e){return e.refresh()})},viewportHeight:function(){var t;return(t=r.innerHeight)!=null?t:i.height()},aggregate:function(t){var e,r,i;e=s;if(t){e=(i=a[n(t).data(u)])!=null?i.waypoints:void 0}if(!e){return[]}r={horizontal:[],vertical:[]};n.each(r,function(t,i){n.each(e[t],function(t,e){return i.push(e)});i.sort(function(t,e){return t.offset-e.offset});r[t]=n.map(i,function(t){return t.element});return r[t]=n.unique(r[t])});return r},above:function(t){if(t==null){t=r}return h._filter(t,"vertical",function(t,e){return e.offset<=t.oldScroll.y})},below:function(t){if(t==null){t=r}return h._filter(t,"vertical",function(t,e){return e.offset>t.oldScroll.y})},left:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset<=t.oldScroll.x})},right:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset>t.oldScroll.x})},enable:function(){return h._invoke("enable")},disable:function(){return h._invoke("disable")},destroy:function(){return h._invoke("destroy")},extendFn:function(t,e){return d[t]=e},_invoke:function(t){var e;e=n.extend({},s.vertical,s.horizontal);return n.each(e,function(e,n){n[t]();return true})},_filter:function(t,e,r){var i,o;i=a[n(t).data(u)];if(!i){return[]}o=[];n.each(i.waypoints[e],function(t,e){if(r(i,e)){return o.push(e)}});o.sort(function(t,e){return t.offset-e.offset});return n.map(o,function(t){return t.element})}};n[m]=function(){var t,n;n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[];if(h[n]){return h[n].apply(null,t)}else{return h.aggregate.call(null,n)}};n[m].settings={resizeThrottle:100,scrollThrottle:30};return i.load(function(){return n[m]("refresh")})})}).call(this);
(function(factory){if(typeof define==='function'&&define.amd){define(['jquery'],factory);}else if(typeof module==='object'&&module.exports){module.exports=function(root,jQuery){if(jQuery===undefined){if(typeof window!=='undefined'){jQuery=require('jquery');}else{jQuery=require('jquery')(root);}}
factory(jQuery);return jQuery;};}else{factory(jQuery);}}(function($){$.fn.tilt=function(options){const requestTick=function(){if(this.ticking)return;requestAnimationFrame(updateTransforms.bind(this));this.ticking=true;};const bindEvents=function(){const _this=this;$(this).on('mousemove',mouseMove);$(this).on('mouseenter',mouseEnter);if(this.settings.reset)$(this).on('mouseleave',mouseLeave);if(this.settings.glare)$(window).on('resize',updateGlareSize.bind(_this));};const setTransition=function(){if(this.timeout!==undefined)clearTimeout(this.timeout);$(this).css({'transition':`${this.settings.speed}ms ${this.settings.easing}`});if(this.settings.glare)this.glareElement.css({'transition':`opacity ${this.settings.speed}ms ${this.settings.easing}`});this.timeout=setTimeout(()=>{$(this).css({'transition':''});if(this.settings.glare)this.glareElement.css({'transition':''});},this.settings.speed);};const mouseEnter=function(event){this.ticking=false;$(this).css({'will-change':'transform'});setTransition.call(this);$(this).trigger("tilt.mouseEnter");};const getMousePositions=function(event){if(typeof(event)==="undefined"){event={pageX:$(this).offset().left+$(this).outerWidth()/2,pageY:$(this).offset().top+$(this).outerHeight()/2};}
return{x:event.pageX,y:event.pageY};};const mouseMove=function(event){this.mousePositions=getMousePositions(event);requestTick.call(this);};const mouseLeave=function(){setTransition.call(this);this.reset=true;requestTick.call(this);$(this).trigger("tilt.mouseLeave");};const getValues=function(){const width=$(this).outerWidth();const height=$(this).outerHeight();const left=$(this).offset().left;const top=$(this).offset().top;const percentageX=(this.mousePositions.x-left)/width;const percentageY=(this.mousePositions.y-top)/height;const tiltX=((this.settings.maxTilt/2)-((percentageX)*this.settings.maxTilt)).toFixed(2);const tiltY=(((percentageY)*this.settings.maxTilt)-(this.settings.maxTilt/2)).toFixed(2);const angle=Math.atan2(this.mousePositions.x-(left+width/2),-(this.mousePositions.y-(top+height/2)))*(180/Math.PI);return{tiltX,tiltY,'percentageX':percentageX*100,'percentageY':percentageY*100,angle};};const updateTransforms=function(){this.transforms=getValues.call(this);if(this.reset){this.reset=false;$(this).css('transform',`perspective(${this.settings.perspective}px) rotateX(0deg) rotateY(0deg)`);if(this.settings.glare){this.glareElement.css('transform',`rotate(180deg) translate(-50%, -50%)`);this.glareElement.css('opacity',`0`);}
return;}else{$(this).css('transform',`perspective(${this.settings.perspective}px) rotateX(${this.settings.disableAxis==='x' ? 0:this.transforms.tiltY}deg) rotateY(${this.settings.disableAxis==='y' ? 0:this.transforms.tiltX}deg) scale3d(${this.settings.scale},${this.settings.scale},${this.settings.scale})`);if(this.settings.glare){this.glareElement.css('transform',`rotate(${this.transforms.angle}deg) translate(-50%, -50%)`);this.glareElement.css('opacity',`${this.transforms.percentageY * this.settings.maxGlare / 100}`);}}
$(this).trigger("change",[this.transforms]);this.ticking=false;};const prepareGlare=function(){const glarePrerender=this.settings.glarePrerender;if(!glarePrerender)
$(this).append('<div class="js-tilt-glare"><div class="js-tilt-glare-inner"></div></div>');this.glareElementWrapper=$(this).find(".js-tilt-glare");this.glareElement=$(this).find(".js-tilt-glare-inner");if(glarePrerender)return;const stretch={'position':'absolute','top':'0','left':'0','width':'100%','height':'100%',};this.glareElementWrapper.css(stretch).css({'overflow':'hidden','pointer-events':'none',});this.glareElement.css({'position':'absolute','top':'50%','left':'50%','background-image':`linear-gradient(0deg, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%)`,'width':`${$(this).outerWidth()*2}`,'height':`${$(this).outerWidth()*2}`,'transform':'rotate(180deg) translate(-50%, -50%)','transform-origin':'0% 0%','opacity':'0',});};const updateGlareSize=function(){this.glareElement.css({'width':`${$(this).outerWidth()*2}`,'height':`${$(this).outerWidth()*2}`,});};$.fn.tilt.destroy=function(){$(this).each(function(){$(this).find('.js-tilt-glare').remove();$(this).css({'will-change':'','transform':''});$(this).off('mousemove mouseenter mouseleave');});};$.fn.tilt.getValues=function(){const results=[];$(this).each(function(){this.mousePositions=getMousePositions.call(this);results.push(getValues.call(this));});return results;};$.fn.tilt.reset=function(){$(this).each(function(){this.mousePositions=getMousePositions.call(this);this.settings=$(this).data('settings');mouseLeave.call(this);setTimeout(()=>{this.reset=false;},this.settings.transition);});};return this.each(function(){this.settings=$.extend({maxTilt:$(this).is('[data-tilt-max]')?$(this).data('tilt-max'):20,perspective:$(this).is('[data-tilt-perspective]')?$(this).data('tilt-perspective'):300,easing:$(this).is('[data-tilt-easing]')?$(this).data('tilt-easing'):'cubic-bezier(.03,.98,.52,.99)',scale:$(this).is('[data-tilt-scale]')?$(this).data('tilt-scale'):'1',speed:$(this).is('[data-tilt-speed]')?$(this).data('tilt-speed'):'400',transition:$(this).is('[data-tilt-transition]')?$(this).data('tilt-transition'):true,disableAxis:$(this).is('[data-tilt-disable-axis]')?$(this).data('tilt-disable-axis'):null,axis:$(this).is('[data-tilt-axis]')?$(this).data('tilt-axis'):null,reset:$(this).is('[data-tilt-reset]')?$(this).data('tilt-reset'):true,glare:$(this).is('[data-tilt-glare]')?$(this).data('tilt-glare'):false,maxGlare:$(this).is('[data-tilt-maxglare]')?$(this).data('tilt-maxglare'):1,},options);if(this.settings.axis!==null){console.warn('Tilt.js: the axis setting has been renamed to disableAxis. See https://github.com/gijsroge/tilt.js/pull/26 for more information');this.settings.disableAxis=this.settings.axis;}
this.init=()=>{$(this).data('settings',this.settings);if(this.settings.glare)prepareGlare.call(this);bindEvents.call(this);};this.init();});};$('[data-tilt]').tilt();return true;}));
!function(a,b,c,d){function e(b,c){this.element=b,this.options=a.extend({},g,c),this._defaults=g,this._name=f,this.init()}var f="stellar",g={scrollProperty:"scroll",positionProperty:"position",horizontalScrolling:!0,verticalScrolling:!0,horizontalOffset:0,verticalOffset:0,responsive:!1,parallaxBackgrounds:!0,parallaxElements:!0,hideDistantElements:!0,hideElement:function(a){a.hide()},showElement:function(a){a.show()}},h={scroll:{getLeft:function(a){return a.scrollLeft()},setLeft:function(a,b){a.scrollLeft(b)},getTop:function(a){return a.scrollTop()},setTop:function(a,b){a.scrollTop(b)}},position:{getLeft:function(a){return-1*parseInt(a.css("left"),10)},getTop:function(a){return-1*parseInt(a.css("top"),10)}},margin:{getLeft:function(a){return-1*parseInt(a.css("margin-left"),10)},getTop:function(a){return-1*parseInt(a.css("margin-top"),10)}},transform:{getLeft:function(a){var b=getComputedStyle(a[0])[k];return"none"!==b?-1*parseInt(b.match(/(-?[0-9]+)/g)[4],10):0},getTop:function(a){var b=getComputedStyle(a[0])[k];return"none"!==b?-1*parseInt(b.match(/(-?[0-9]+)/g)[5],10):0}}},i={position:{setLeft:function(a,b){a.css("left",b)},setTop:function(a,b){a.css("top",b)}},transform:{setPosition:function(a,b,c,d,e){a[0].style[k]="translate3d("+(b-c)+"px, "+(d-e)+"px, 0)"}}},j=function(){var b,c=/^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/,d=a("script")[0].style,e="";for(b in d)if(c.test(b)){e=b.match(c)[0];break}return"WebkitOpacity"in d&&(e="Webkit"),"KhtmlOpacity"in d&&(e="Khtml"),function(a){return e+(e.length>0?a.charAt(0).toUpperCase()+a.slice(1):a)}}(),k=j("transform"),l=a("<div />",{style:"background:#fff"}).css("background-position-x")!==d,m=l?function(a,b,c){a.css({"background-position-x":b,"background-position-y":c})}:function(a,b,c){a.css("background-position",b+" "+c)},n=l?function(a){return[a.css("background-position-x"),a.css("background-position-y")]}:function(a){return a.css("background-position").split(" ")},o=b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame||b.oRequestAnimationFrame||b.msRequestAnimationFrame||function(a){setTimeout(a,1e3/60)};e.prototype={init:function(){this.options.name=f+"_"+Math.floor(1e9*Math.random()),this._defineElements(),this._defineGetters(),this._defineSetters(),this._handleWindowLoadAndResize(),this._detectViewport(),this.refresh({firstLoad:!0}),"scroll"===this.options.scrollProperty?this._handleScrollEvent():this._startAnimationLoop()},_defineElements:function(){this.element===c.body&&(this.element=b),this.$scrollElement=a(this.element),this.$element=this.element===b?a("body"):this.$scrollElement,this.$viewportElement=this.options.viewportElement!==d?a(this.options.viewportElement):this.$scrollElement[0]===b||"scroll"===this.options.scrollProperty?this.$scrollElement:this.$scrollElement.parent()},_defineGetters:function(){var a=this,b=h[a.options.scrollProperty];this._getScrollLeft=function(){return b.getLeft(a.$scrollElement)},this._getScrollTop=function(){return b.getTop(a.$scrollElement)}},_defineSetters:function(){var b=this,c=h[b.options.scrollProperty],d=i[b.options.positionProperty],e=c.setLeft,f=c.setTop;this._setScrollLeft="function"==typeof e?function(a){e(b.$scrollElement,a)}:a.noop,this._setScrollTop="function"==typeof f?function(a){f(b.$scrollElement,a)}:a.noop,this._setPosition=d.setPosition||function(a,c,e,f,g){b.options.horizontalScrolling&&d.setLeft(a,c,e),b.options.verticalScrolling&&d.setTop(a,f,g)}},_handleWindowLoadAndResize:function(){var c=this,d=a(b);c.options.responsive&&d.bind("load."+this.name,function(){c.refresh()}),d.bind("resize."+this.name,function(){c._detectViewport(),c.options.responsive&&c.refresh()})},refresh:function(c){var d=this,e=d._getScrollLeft(),f=d._getScrollTop();c&&c.firstLoad||this._reset(),this._setScrollLeft(0),this._setScrollTop(0),this._setOffsets(),this._findParticles(),this._findBackgrounds(),c&&c.firstLoad&&/WebKit/.test(navigator.userAgent)&&a(b).load(function(){var a=d._getScrollLeft(),b=d._getScrollTop();d._setScrollLeft(a+1),d._setScrollTop(b+1),d._setScrollLeft(a),d._setScrollTop(b)}),this._setScrollLeft(e),this._setScrollTop(f)},_detectViewport:function(){var a=this.$viewportElement.offset(),b=null!==a&&a!==d;this.viewportWidth=this.$viewportElement.width(),this.viewportHeight=this.$viewportElement.height(),this.viewportOffsetTop=b?a.top:0,this.viewportOffsetLeft=b?a.left:0},_findParticles:function(){{var b=this;this._getScrollLeft(),this._getScrollTop()}if(this.particles!==d)for(var c=this.particles.length-1;c>=0;c--)this.particles[c].$element.data("stellar-elementIsActive",d);this.particles=[],this.options.parallaxElements&&this.$element.find("[data-stellar-ratio]").each(function(){var c,e,f,g,h,i,j,k,l,m=a(this),n=0,o=0,p=0,q=0;if(m.data("stellar-elementIsActive")){if(m.data("stellar-elementIsActive")!==this)return}else m.data("stellar-elementIsActive",this);b.options.showElement(m),m.data("stellar-startingLeft")?(m.css("left",m.data("stellar-startingLeft")),m.css("top",m.data("stellar-startingTop"))):(m.data("stellar-startingLeft",m.css("left")),m.data("stellar-startingTop",m.css("top"))),f=m.position().left,g=m.position().top,h="auto"===m.css("margin-left")?0:parseInt(m.css("margin-left"),10),i="auto"===m.css("margin-top")?0:parseInt(m.css("margin-top"),10),k=m.offset().left-h,l=m.offset().top-i,m.parents().each(function(){var b=a(this);return b.data("stellar-offset-parent")===!0?(n=p,o=q,j=b,!1):(p+=b.position().left,void(q+=b.position().top))}),c=m.data("stellar-horizontal-offset")!==d?m.data("stellar-horizontal-offset"):j!==d&&j.data("stellar-horizontal-offset")!==d?j.data("stellar-horizontal-offset"):b.horizontalOffset,e=m.data("stellar-vertical-offset")!==d?m.data("stellar-vertical-offset"):j!==d&&j.data("stellar-vertical-offset")!==d?j.data("stellar-vertical-offset"):b.verticalOffset,b.particles.push({$element:m,$offsetParent:j,isFixed:"fixed"===m.css("position"),horizontalOffset:c,verticalOffset:e,startingPositionLeft:f,startingPositionTop:g,startingOffsetLeft:k,startingOffsetTop:l,parentOffsetLeft:n,parentOffsetTop:o,stellarRatio:m.data("stellar-ratio")!==d?m.data("stellar-ratio"):1,width:m.outerWidth(!0),height:m.outerHeight(!0),isHidden:!1})})},_findBackgrounds:function(){var b,c=this,e=this._getScrollLeft(),f=this._getScrollTop();this.backgrounds=[],this.options.parallaxBackgrounds&&(b=this.$element.find("[data-stellar-background-ratio]"),this.$element.data("stellar-background-ratio")&&(b=b.add(this.$element)),b.each(function(){var b,g,h,i,j,k,l,o=a(this),p=n(o),q=0,r=0,s=0,t=0;if(o.data("stellar-backgroundIsActive")){if(o.data("stellar-backgroundIsActive")!==this)return}else o.data("stellar-backgroundIsActive",this);o.data("stellar-backgroundStartingLeft")?m(o,o.data("stellar-backgroundStartingLeft"),o.data("stellar-backgroundStartingTop")):(o.data("stellar-backgroundStartingLeft",p[0]),o.data("stellar-backgroundStartingTop",p[1])),h="auto"===o.css("margin-left")?0:parseInt(o.css("margin-left"),10),i="auto"===o.css("margin-top")?0:parseInt(o.css("margin-top"),10),j=o.offset().left-h-e,k=o.offset().top-i-f,o.parents().each(function(){var b=a(this);return b.data("stellar-offset-parent")===!0?(q=s,r=t,l=b,!1):(s+=b.position().left,void(t+=b.position().top))}),b=o.data("stellar-horizontal-offset")!==d?o.data("stellar-horizontal-offset"):l!==d&&l.data("stellar-horizontal-offset")!==d?l.data("stellar-horizontal-offset"):c.horizontalOffset,g=o.data("stellar-vertical-offset")!==d?o.data("stellar-vertical-offset"):l!==d&&l.data("stellar-vertical-offset")!==d?l.data("stellar-vertical-offset"):c.verticalOffset,c.backgrounds.push({$element:o,$offsetParent:l,isFixed:"fixed"===o.css("background-attachment"),horizontalOffset:b,verticalOffset:g,startingValueLeft:p[0],startingValueTop:p[1],startingBackgroundPositionLeft:isNaN(parseInt(p[0],10))?0:parseInt(p[0],10),startingBackgroundPositionTop:isNaN(parseInt(p[1],10))?0:parseInt(p[1],10),startingPositionLeft:o.position().left,startingPositionTop:o.position().top,startingOffsetLeft:j,startingOffsetTop:k,parentOffsetLeft:q,parentOffsetTop:r,stellarRatio:o.data("stellar-background-ratio")===d?1:o.data("stellar-background-ratio")})}))},_reset:function(){var a,b,c,d,e;for(e=this.particles.length-1;e>=0;e--)a=this.particles[e],b=a.$element.data("stellar-startingLeft"),c=a.$element.data("stellar-startingTop"),this._setPosition(a.$element,b,b,c,c),this.options.showElement(a.$element),a.$element.data("stellar-startingLeft",null).data("stellar-elementIsActive",null).data("stellar-backgroundIsActive",null);for(e=this.backgrounds.length-1;e>=0;e--)d=this.backgrounds[e],d.$element.data("stellar-backgroundStartingLeft",null).data("stellar-backgroundStartingTop",null),m(d.$element,d.startingValueLeft,d.startingValueTop)},destroy:function(){this._reset(),this.$scrollElement.unbind("resize."+this.name).unbind("scroll."+this.name),this._animationLoop=a.noop,a(b).unbind("load."+this.name).unbind("resize."+this.name)},_setOffsets:function(){var c=this,d=a(b);d.unbind("resize.horizontal-"+this.name).unbind("resize.vertical-"+this.name),"function"==typeof this.options.horizontalOffset?(this.horizontalOffset=this.options.horizontalOffset(),d.bind("resize.horizontal-"+this.name,function(){c.horizontalOffset=c.options.horizontalOffset()})):this.horizontalOffset=this.options.horizontalOffset,"function"==typeof this.options.verticalOffset?(this.verticalOffset=this.options.verticalOffset(),d.bind("resize.vertical-"+this.name,function(){c.verticalOffset=c.options.verticalOffset()})):this.verticalOffset=this.options.verticalOffset},_repositionElements:function(){var a,b,c,d,e,f,g,h,i,j,k=this._getScrollLeft(),l=this._getScrollTop(),n=!0,o=!0;if(this.currentScrollLeft!==k||this.currentScrollTop!==l||this.currentWidth!==this.viewportWidth||this.currentHeight!==this.viewportHeight){for(this.currentScrollLeft=k,this.currentScrollTop=l,this.currentWidth=this.viewportWidth,this.currentHeight=this.viewportHeight,j=this.particles.length-1;j>=0;j--)a=this.particles[j],b=a.isFixed?1:0,this.options.horizontalScrolling?(f=(k+a.horizontalOffset+this.viewportOffsetLeft+a.startingPositionLeft-a.startingOffsetLeft+a.parentOffsetLeft)*-(a.stellarRatio+b-1)+a.startingPositionLeft,h=f-a.startingPositionLeft+a.startingOffsetLeft):(f=a.startingPositionLeft,h=a.startingOffsetLeft),this.options.verticalScrolling?(g=(l+a.verticalOffset+this.viewportOffsetTop+a.startingPositionTop-a.startingOffsetTop+a.parentOffsetTop)*-(a.stellarRatio+b-1)+a.startingPositionTop,i=g-a.startingPositionTop+a.startingOffsetTop):(g=a.startingPositionTop,i=a.startingOffsetTop),this.options.hideDistantElements&&(o=!this.options.horizontalScrolling||h+a.width>(a.isFixed?0:k)&&h<(a.isFixed?0:k)+this.viewportWidth+this.viewportOffsetLeft,n=!this.options.verticalScrolling||i+a.height>(a.isFixed?0:l)&&i<(a.isFixed?0:l)+this.viewportHeight+this.viewportOffsetTop),o&&n?(a.isHidden&&(this.options.showElement(a.$element),a.isHidden=!1),this._setPosition(a.$element,f,a.startingPositionLeft,g,a.startingPositionTop)):a.isHidden||(this.options.hideElement(a.$element),a.isHidden=!0);for(j=this.backgrounds.length-1;j>=0;j--)c=this.backgrounds[j],b=c.isFixed?0:1,d=this.options.horizontalScrolling?(k+c.horizontalOffset-this.viewportOffsetLeft-c.startingOffsetLeft+c.parentOffsetLeft-c.startingBackgroundPositionLeft)*(b-c.stellarRatio)+"px":c.startingValueLeft,e=this.options.verticalScrolling?(l+c.verticalOffset-this.viewportOffsetTop-c.startingOffsetTop+c.parentOffsetTop-c.startingBackgroundPositionTop)*(b-c.stellarRatio)+"px":c.startingValueTop,m(c.$element,d,e)}},_handleScrollEvent:function(){var a=this,b=!1,c=function(){a._repositionElements(),b=!1},d=function(){b||(o(c),b=!0)};this.$scrollElement.bind("scroll."+this.name,d),d()},_startAnimationLoop:function(){var a=this;this._animationLoop=function(){o(a._animationLoop),a._repositionElements()},this._animationLoop()}},a.fn[f]=function(b){var c=arguments;return b===d||"object"==typeof b?this.each(function(){a.data(this,"plugin_"+f)||a.data(this,"plugin_"+f,new e(this,b))}):"string"==typeof b&&"_"!==b[0]&&"init"!==b?this.each(function(){var d=a.data(this,"plugin_"+f);d instanceof e&&"function"==typeof d[b]&&d[b].apply(d,Array.prototype.slice.call(c,1)),"destroy"===b&&a.data(this,"plugin_"+f,null)}):void 0},a[f]=function(){var c=a(b);return c.stellar.apply(c,Array.prototype.slice.call(arguments,0))},a[f].scrollProperty=h,a[f].positionProperty=i,b.Stellar=e}(jQuery,this,document);
jQuery(document).ready(function(){"use strict";jQuery.fn.center=function(){this.css("left",(jQuery(window).width()/2)-(this.outerWidth()/2));return this;}
jQuery.fn.setNav=function(){var calScreenWidth=jQuery(window).width();var menuLayout=jQuery('#pp_menu_layout').val();if(calScreenWidth>=960){jQuery('#menu_wrapper .nav li.menu-item').hover(function(){jQuery(this).children('ul:first').addClass('visible');jQuery(this).children('ul:first').addClass('hover');},function(){jQuery(this).children('ul:first').removeClass('visible');jQuery(this).children('ul:first').removeClass('hover');});jQuery('#menu_wrapper .nav li.menu-item').children('ul:first.hover').hover(function(){jQuery(this).stop().addClass('visible');},function(){jQuery(this).stop().removeClass('visible');});}
jQuery('body').on('click','.mobile_main_nav > li a',function(event){var jQuerysublist=jQuery(this).parent('li').find('ul.sub-menu:first');var menuContainerClass=jQuery(this).parent('li').parent('#mobile_main_menu.mobile_main_nav').parent('div');var documentScroll=jQuery(document).scrollTop();var linkURL=jQuery(this).attr('href');var sectionID=this.hash;if(sectionID!=''){event.preventDefault();var topBarHeight=jQuery('.top_bar').height();jQuery('#close_mobile_menu').trigger('click');if(sectionID=='top'){jQuery('body,html').animate({scrollTop:0},1200);}else{if(documentScroll!=0){var scrollToPos=parseInt(jQuery(sectionID).offset().top-topBarHeight-32);}else{var scrollToPos=parseInt(jQuery(sectionID).offset().top-topBarHeight+82);}
jQuery('body,html').animate({scrollTop:scrollToPos},1200);}
jQuery('#menu_wrapper div .nav li').removeClass('current-menu-item');jQuery(this).parent('li').addClass('current-menu-item');if(jQuery(window).width()<960){jQuery('body').removeClass('js_nav');}}
if(jQuerysublist.length>0){event.preventDefault();}
var menuLevel='top_level';var parentMenu='';var menuClickedId=jQuery(this).attr('id');if(jQuery(this).parent('li').parent('ul').attr('id')=='mobile_main_menu'){menuLevel='parent_level';}else{parentMenu=jQuery(this).parent('li').attr('id');}
if(jQuerysublist.length>0){jQuery('#mobile_main_menu.mobile_main_nav').addClass('mainnav_out');jQuery('.mobile_menu_wrapper div #sub_menu').removeClass('subnav_in');jQuery('.mobile_menu_wrapper div #sub_menu').addClass('mainnav_out');if(jQuery('#pp_menu_layout').val()=='hammenufull'){jQuery('.mobile_menu_wrapper .logo_container').fadeOut('slow');jQuery('.mobile_menu_wrapper .social_wrapper').fadeOut('slow');}
setTimeout(function(){jQuery('#mobile_main_menu.mobile_main_nav').css('display','none');jQuery('.mobile_menu_wrapper div #sub_menu').remove();var subMenuHTML='<li><a href="#" id="menu_back" class="'+menuLevel+'" data-parent="'+parentMenu+'">'+jQuery('#pp_back').val()+'</a></li>';subMenuHTML+=jQuerysublist.html();menuContainerClass.append('<ul id="sub_menu" class="nav '+menuLevel+'"></ul>');menuContainerClass.find('#sub_menu').html(subMenuHTML);menuContainerClass.find('#sub_menu').addClass('subnav_in');},200);}});jQuery('body').on('click','#menu_back.parent_level',function(){jQuery('.mobile_menu_wrapper div #sub_menu').removeClass('subnav_in');jQuery('.mobile_menu_wrapper div #sub_menu').addClass('subnav_out');jQuery('#mobile_main_menu.mobile_main_nav').removeClass('mainnav_out');if(jQuery('#pp_menu_layout').val()=='hammenufull'){jQuery('.mobile_menu_wrapper .logo_container').fadeIn('slow');jQuery('.mobile_menu_wrapper .social_wrapper').fadeIn('slow');}
setTimeout(function(){jQuery('.mobile_menu_wrapper div #sub_menu').remove();jQuery('#mobile_main_menu.mobile_main_nav').css('display','block');jQuery('#mobile_main_menu.mobile_main_nav').addClass('mainnav_in');},200);});jQuery('body').on('click','#menu_back.top_level',function(){event.preventDefault();jQuery('.mobile_menu_wrapper div #sub_menu').addClass('subnav_out');var parentMenuId=jQuery(this).data('parent');setTimeout(function(){jQuery('.mobile_menu_wrapper div #sub_menu').remove();var menuLevel='top_level';var parentMenu='';if(jQuery('#mobile_main_menu.mobile_main_nav li#'+parentMenuId).parent('ul.sub-menu:first').parent('li').parent('ul#main_menu').length==1){menuLevel='parent_level';}else{parentMenu=jQuery('#mobile_main_menu.mobile_main_nav li#'+parentMenuId).parent('ul.sub-menu:first').parent('li').attr('id');}
var subMenuHTML='<li><a href="#" id="menu_back" class="'+menuLevel+'" data-parent="'+parentMenu+'">'+jQuery('#pp_back').val()+'</a></li>';subMenuHTML+=jQuery('#mobile_main_menu.mobile_main_nav li#'+parentMenuId).parent('ul.sub-menu:first').html();jQuery('.mobile_menu_wrapper div').append('<ul id="sub_menu" class="nav '+menuLevel+'"></ul>');jQuery('.mobile_menu_wrapper div #sub_menu').html(subMenuHTML);jQuery('.mobile_menu_wrapper div #sub_menu').addClass('mainnav_in');},200);});}});function adjustIframes(){jQuery('iframe').each(function(){var
$this=jQuery(this),proportion=$this.data('proportion'),w=$this.attr('width'),actual_w=$this.width();if(!proportion){proportion=$this.attr('height')/w;$this.data('proportion',proportion);}
if(actual_w!=w){$this.css('height',Math.round(actual_w*proportion)+'px !important');}});}
function is_touch_device(){return'ontouchstart'in window||'onmsgesturechange'in window;}
function triggerClick(element){if(document.createEvent){var evt=document.createEvent("MouseEvents");evt.initMouseEvent("click",true,true,window,0,0,0,0,0,false,false,false,false,0,null);element.dispatchEvent(evt);}else{element.click();}};
jQuery(document).ready(function(){"use strict";jQuery(document).setNav();var moduloThumbnail=false;if(jQuery('#tg_lightbox_thumbnails').val()=='thumbnail'){moduloThumbnail=true;}
var lightboxTimer=jQuery('#tg_lightbox_timer').val();var mobx='';mobx=new ModuloBox({mediaSelector:'.tg_gallery_lightbox, .woocommerce-product-gallery__image a',scrollToZoom:true,controls:['zoom','play','fullScreen','share','close'],shareButtons:['facebook','googleplus','twitter','pinterest','linkedin'],slideShowInterval:parseInt(lightboxTimer),countTimer:true,thumbnails:moduloThumbnail,videoAutoPlay:true,thumbnailSizes:{1920:{width:110,height:80,gutter:10},1280:{width:90,height:65,gutter:10},680:{width:70,height:50,gutter:8},480:{width:60,height:44,gutter:5}}});mobx.init();jQuery(window).resize(function(){jQuery(document).setNav();if(jQuery(this).width()<768){jQuery("#page_content_wrapper .sidebar_wrapper").trigger("sticky_kit:detach");}else{if(jQuery('#tg_header_content').val()=='menu'){jQuery('#wrapper').css('paddingTop',parseInt(jQuery('.header_style_wrapper').height())+'px');}else{jQuery('#wrapper').css('paddingTop',parseInt(jQuery('#elementor_header').height())+'px');}
jQuery('#menu_wrapper div .nav > li > a').attr('style','');jQuery('#menu_wrapper div .nav > li > a').attr('style','');}
if(jQuery('.page_slider.menu_transparent').find('.rev_slider_wrapper').length>0){var sliderHeight=jQuery('.page_slider.menu_transparent').find('.rev_slider_wrapper').height();var topBarHeight=jQuery('.top_bar').height();if(jQuery('.above_top_bar').length>0){topBarHeight+=jQuery('.above_top_bar').height();}
if(jQuery('.page_slider.menu_transparent').find('.rev_slider_wrapper.fullscreen-container').length>0){var topBarHeight=55;}
jQuery('.ppb_wrapper').css('marginTop',sliderHeight-topBarHeight+'px');jQuery('#page_content_wrapper').css('marginTop',sliderHeight-topBarHeight+'px');}});jQuery('#menu_expand_wrapper a').on('click',function(){jQuery('#menu_wrapper').fadeIn();jQuery('#custom_logo').animate({'left':'15px','opacity':1},400);jQuery('#menu_close').animate({'left':'-10px','opacity':1},400);jQuery(this).animate({'left':'-60px','opacity':0},400);jQuery('#menu_border_wrapper select').animate({'left':'0','opacity':1},400).fadeIn();});jQuery('#menu_close').on('click',function(){jQuery('#custom_logo').animate({'left':'-200px','opacity':0},400);jQuery(this).stop().animate({'left':'-200px','opacity':0},400);jQuery('#menu_expand_wrapper a').animate({'left':'20px','opacity':1},400);jQuery('#menu_border_wrapper select').animate({'left':'-200px','opacity':0},400).fadeOut();jQuery('#menu_wrapper').fadeOut();});jQuery(window).scroll(function(){var calScreenWidth=jQuery(window).width();if(jQuery(this).scrollTop()>200){jQuery('#toTop').css({opacity:1,"visibility":"visible"}).animate({"visibility":"visible"},{duration:1000,easing:"easeOutExpo"});}else if(jQuery(this).scrollTop()==0){jQuery('#toTop').css({opacity:0,"visibility":"hidden"}).animate({"visibility":"hidden"},{duration:1500,easing:"easeOutExpo"});}});jQuery('#toTop, .hr_totop').on('click',function(){jQuery('body,html,#page_content_wrapper.split').animate({scrollTop:0},800);});var isDisableDragging=jQuery('#pp_enable_dragging').val();if(isDisableDragging!=''){jQuery("img").mousedown(function(){return false;});}
if(jQuery('#pp_topbar').val()==0){var topBarHeight=jQuery('.header_style_wrapper').height();}else{var topBarHeight=parseInt(jQuery('.header_style_wrapper').height()-jQuery('.header_style_wrapper .above_top_bar').height());}
var logoHeight=jQuery('#custom_logo img').height();var logoTransHeight=jQuery('#custom_logo_transparent img').height();var logoMargin=parseInt(jQuery('#custom_logo').css('marginTop'));var logoTransMargin=parseInt(jQuery('#custom_logo_transparent').css('marginTop'));var menuPaddingTop=parseInt(jQuery('#menu_wrapper div .nav li > a').css('paddingTop'));var menuPaddingBottom=parseInt(jQuery('#menu_wrapper div .nav li > a').css('paddingBottom'));var SearchPaddingTop=parseInt(jQuery('.top_bar #searchform button').css('paddingTop'));var menuLayout=jQuery('#pp_menu_layout').val();if(menuLayout!='leftmenu'||jQuery(window).width()<=768){if(jQuery('#tg_header_content').val()=='menu'){jQuery('#wrapper').css('paddingTop',parseInt(jQuery('.header_style_wrapper').height())+'px');}else{jQuery('#wrapper').css('paddingTop',parseInt(jQuery('#elementor_header').height())+'px');setTimeout(function(){jQuery('#wrapper').css('paddingTop',parseInt(jQuery('#elementor_header').height())+'px');},200);setTimeout(function(){jQuery('#wrapper').css('paddingTop',parseInt(jQuery('#elementor_header').height())+'px');},1000);}}
if(menuLayout!='leftmenu'||jQuery(window).width()<=960){jQuery('#page_content_wrapper.split, .page_content_wrapper.split').css('top',parseInt(topBarHeight+jQuery('.header_style_wrapper .above_top_bar').height())+'px');jQuery('#page_content_wrapper.split, .page_content_wrapper.split').css('paddingBottom',parseInt(topBarHeight+jQuery('.header_style_wrapper .above_top_bar').height())+'px');jQuery(window).scroll(function(){if(jQuery('#pp_fixed_menu').val()==1&&jQuery('html').data('style')!='fullscreen'&&jQuery('html').data('style')!='fullscreen_white'){if(jQuery(this).scrollTop()>=200){jQuery('.extend_top_contact_info').hide();jQuery('.header_style_wrapper').addClass('scroll');jQuery('.top_bar').addClass('scroll');if(jQuery('.top_bar').hasClass('hasbg')){jQuery('.top_bar').removeClass('hasbg');jQuery('.top_bar').data('hasbg',1);jQuery('#custom_logo').removeClass('hidden');jQuery('#custom_logo_transparent').addClass('hidden');}}
else if(jQuery(this).scrollTop()<200){jQuery('.extend_top_contact_info').show();jQuery('#custom_logo img').removeClass('zoom');jQuery('#custom_logo img').css('maxHeight','');jQuery('#custom_logo_transparent img').removeClass('zoom');jQuery('#custom_logo').css('marginTop',parseInt(logoMargin)+'px');jQuery('#custom_logo_transparent').css('marginTop',parseInt(logoTransMargin)+'px');jQuery('#menu_wrapper div .nav > li > a').css('paddingTop',menuPaddingTop+'px');jQuery('#menu_wrapper div .nav > li > a').css('paddingBottom',menuPaddingBottom+'px');if(jQuery('.top_bar').data('hasbg')==1){jQuery('.top_bar').addClass('hasbg');jQuery('#custom_logo').addClass('hidden');jQuery('#custom_logo_transparent').removeClass('hidden');}
jQuery('.header_style_wrapper').removeClass('scroll');jQuery('.top_bar').removeClass('scroll');}}else{if(jQuery(this).scrollTop()>=200){jQuery('.header_style_wrapper').addClass('nofixed');}else{jQuery('.header_style_wrapper').removeClass('nofixed');}}});if(jQuery('#tg_smart_fixed_menu').val()==1&&jQuery('html').data('style')!='fullscreen'&&jQuery('html').data('style')!='fullscreen_white'){if(!is_touch_device()){var lastScrollTop=0;jQuery(window).scroll(function(event){var st=jQuery(this).scrollTop();if(st>lastScrollTop&&st>0){jQuery('.top_bar').removeClass('scroll_up');jQuery('.header_style_wrapper').removeClass('scroll_up');jQuery('.header_style_wrapper').addClass('scroll_down');}else{jQuery('.top_bar').addClass('scroll_up');jQuery('.header_style_wrapper').addClass('scroll_up');jQuery('.header_style_wrapper').removeClass('scroll_down');}
lastScrollTop=st;jQuery('.header_style_wrapper').attr('data-st',st);jQuery('.header_style_wrapper').attr('data-lastscrolltop',lastScrollTop);});}else{var lastY;jQuery(document).bind('touchmove',function(e){var currentY=e.originalEvent.touches[0].clientY;if(currentY>200){jQuery('.top_bar').addClass('scroll_up');jQuery('.header_style_wrapper').addClass('scroll_up');jQuery('.header_style_wrapper').removeClass('scroll_down');}else{jQuery('.top_bar').removeClass('scroll_up');jQuery('.header_style_wrapper').removeClass('scroll_up');jQuery('.header_style_wrapper').addClass('scroll_down');}
jQuery('.header_style_wrapper').attr('data-pos',currentY);});}}}
jQuery(window).scroll(function(){if(jQuery('#pp_fixed_menu').val()==1){if(jQuery(this).scrollTop()>=100){jQuery('#elementor_header').removeClass('visible');jQuery('#elementor_sticky_header').addClass('visible');}
else if(jQuery(this).scrollTop()<100){jQuery('#elementor_header').addClass('visible');jQuery('#elementor_sticky_header').removeClass('visible');}}});jQuery(document).mouseenter(function(){jQuery('body').addClass('hover');});jQuery(document).mouseleave(function(){jQuery('body').removeClass('hover');});jQuery('#post_more_close').on('click',function(){jQuery('#post_more_wrapper').animate({right:'-380px'},300);return false;});jQuery('#mobile_nav_icon, #elementor_mobile_nav, .elementor_mobile_nav').on('click',function(){jQuery('body').addClass('js_nav');jQuery('body').addClass('modalview');jQuery('#close_mobile_menu').addClass('open');if(is_touch_device()){jQuery('body.js_nav').css('overflow','auto');}});jQuery('#close_mobile_menu').on('click',function(){jQuery('body').removeClass('js_nav');setTimeout(function(){jQuery('body').removeClass('modalview');},400);jQuery(this).removeClass('open');});jQuery('.mobile_menu_close a, #mobile_menu_close').on('click',function(){jQuery('body').removeClass('js_nav');setTimeout(function(){jQuery('body').removeClass('modalview');},400);jQuery('#close_mobile_menu').removeClass('open');});jQuery('.post_share').on('click',function(){var targetShareID=jQuery(this).attr('data-share');var targetParentID=jQuery(this).attr('data-parent');jQuery(this).toggleClass('visible');jQuery('#'+targetShareID).toggleClass('slideUp');jQuery('#'+targetParentID).toggleClass('sharing');return false;});if(jQuery('.page_slider.menu_transparent').find('.rev_slider_wrapper').length>0){var sliderHeight=jQuery('.page_slider.menu_transparent').find('.rev_slider_wrapper').height();var topBarHeight=jQuery('.top_bar').height();if(jQuery('.above_top_bar').length>0){topBarHeight+=jQuery('.above_top_bar').height();}
if(jQuery('.page_slider.menu_transparent').find('.rev_slider_wrapper.fullscreen-container').length>0){var topBarHeight=55;}
jQuery('.ppb_wrapper').css('marginTop',sliderHeight-topBarHeight+'px');jQuery('#page_content_wrapper').css('marginTop',sliderHeight-topBarHeight+'px');}
jQuery('#demo_apply').on('click',function(){jQuery('#ajax_loading').addClass('visible');jQuery('body').addClass('loading');jQuery("form#form_option").submit();});jQuery('#option_wrapper').mouseenter(function(){jQuery('body').addClass('overflow_hidden');});jQuery('#option_wrapper').mouseleave(function(){jQuery('body').removeClass('overflow_hidden');});var calScreenHeight=jQuery(window).height()-108;var miniRightPos=800;jQuery('#overlay_background').on('click',function(){if(!jQuery('body').hasClass('js_nav')){jQuery('#overlay_background').removeClass('visible');jQuery('#overlay_background').removeClass('share_open');jQuery('#fullscreen_share_wrapper').css('visibility','hidden');}});var menuLayout=jQuery('#pp_menu_layout').val();jQuery('.rev_slider_wrapper.fullscreen-container').each(function(){jQuery(this).append('<div class="icon-scroll"></div>');});if(jQuery('.one.fullwidth.slideronly').length>0){jQuery('body').addClass('overflow_hidden');}
jQuery('#post_share_text').on('click',function(){jQuery('body').addClass('overflow_hidden');jQuery('body').addClass('blur');jQuery('#side_menu_wrapper').addClass('visible');jQuery('#side_menu_wrapper').addClass('share_open');jQuery('#fullscreen_share_wrapper').css('visibility','visible');});jQuery('#close_share').on('click',function(){jQuery('body').removeClass('overflow_hidden');jQuery('body').removeClass('blur');jQuery('#side_menu_wrapper').removeClass('visible');jQuery('#side_menu_wrapper').removeClass('share_open');jQuery('#fullscreen_share_wrapper').css('visibility','hidden');});jQuery('iframe[src*="youtube.com"]').each(function(){jQuery(this).wrap('<div class="video-container"></div>');});jQuery('iframe[src*="vimeo.com"]').each(function(){jQuery(this).wrap('<div class="video-container"></div>');});jQuery('.blog-tilt').tilt({perspective:5000});jQuery(".input_wrapper input").focusout(function(){if(jQuery(this).val()!=""){$(this).addClass("has-content");}else{jQuery(this).removeClass("has-content");}});jQuery(window).scroll(function(){var oVal;oVal=jQuery(window).scrollTop()/300;if(oVal>1){oVal=1;}
oVal=parseFloat(1-oVal);jQuery('#page_caption.hasbg .page_title_wrapper .page_title_inner').css('opacity',oVal);var posVal=-(jQuery(window).scrollTop()*0.005);jQuery('#page_caption.hasbg .page_title_wrapper .page_title_inner').css({'transform':'translate(0px,'+posVal+'px)'});});jQuery('#page_title_nav li a').on('click',function(event){var documentScroll=jQuery(document).scrollTop();var linkURL=jQuery(this).attr('href');var sectionID=jQuery(this).attr('href').substr(1);if(linkURL.slice(0,1)=='#'&&sectionID!=''){var topBarHeight=0;if(jQuery('.top_bar').length>0){var topBarHeight=parseInt(jQuery('.top_bar').height());}
else if(jQuery('#elementor_sticky_header').length>0){var topBarHeight=parseInt(jQuery('#elementor_sticky_header').height());}
var scrollToPos=parseInt(jQuery('#'+sectionID).offset().top-topBarHeight);jQuery('body,html').animate({scrollTop:scrollToPos},1200);}else{return true;}});jQuery('#singleroom_book').on('click',function(event){var formID=jQuery(this).attr('data-formid');jQuery('#singleroom_book_form'+formID).toggleClass('visible');});jQuery('.mphb-gateways-list li input[type=radio]').change(function(){jQuery('.mphb-gateways-list li').removeClass('active');jQuery(this).parent('.mphb-gateway').addClass('active');});jQuery('.mphb-gateways-list li').each(function(){var radioInput=jQuery(this).find('input[type=radio]:first-child');if(radioInput.is(':checked')){radioInput.parent('.mphb-gateway').addClass('active');}});jQuery('.mphb-gateways-list li').on('click',function(event){jQuery('.mphb-gateways-list li').removeClass('active');jQuery(this).addClass('active');var radioID=jQuery(this).find('input[type=radio]').attr('id');jQuery("#"+radioID).prop("checked",true);});if(!is_touch_device()){jQuery('.stellar').each(function(){jQuery(this).attr('data-stellar-ratio','1.15');});jQuery(window).stellar({positionProperty:'transform',responsive:true,parallaxBackgrounds:false,horizontalScrolling:false,hideDistantElements:false,});}
setTimeout(function(){jQuery('#elementor_header').addClass('visible');},200);jQuery('.smoove').each(function(){var minWidth=1;if(typeof jQuery(this).attr('data-minwidth')!='undefined'){minWidth=jQuery(this).attr('data-minwidth');}
var offset='20%';if(typeof jQuery(this).attr('data-offset')!='undefined'){offset=jQuery(this).attr('data-offset');}
jQuery(this).smoove({min_width:parseInt(minWidth),offset:offset});});});jQuery(window).on('resize load',adjustIframes);
(function(){var b,f;b=this.jQuery||window.jQuery;f=b(window);b.fn.stick_in_parent=function(d){var A,w,J,n,B,K,p,q,k,E,t;null==d&&(d={});t=d.sticky_class;B=d.inner_scrolling;E=d.recalc_every;k=d.parent;q=d.offset_top;p=d.spacer;w=d.bottoming;null==q&&(q=0);null==k&&(k=void 0);null==B&&(B=!0);null==t&&(t="is_stuck");A=b(document);null==w&&(w=!0);J=function(a,d,n,C,F,u,r,G){var v,H,m,D,I,c,g,x,y,z,h,l;if(!a.data("sticky_kit")){a.data("sticky_kit",!0);I=A.height();g=a.parent();null!=k&&(g=g.closest(k));
if(!g.length)throw"failed to find stick parent";v=m=!1;(h=null!=p?p&&a.closest(p):b("<div />"))&&h.css("position",a.css("position"));x=function(){var c,f,e;if(!G&&(I=A.height(),c=parseInt(g.css("border-top-width"),10),f=parseInt(g.css("padding-top"),10),d=parseInt(g.css("padding-bottom"),10),n=g.offset().top+c+f,C=g.height(),m&&(v=m=!1,null==p&&(a.insertAfter(h),h.detach()),a.css({position:"",top:"",width:"",bottom:""}).removeClass(t),e=!0),F=a.offset().top-(parseInt(a.css("margin-top"),10)||0)-q,
u=a.outerHeight(!0),r=a.css("float"),h&&h.css({width:a.outerWidth(!0),height:u,display:a.css("display"),"vertical-align":a.css("vertical-align"),"float":r}),e))return l()};x();if(u!==C)return D=void 0,c=q,z=E,l=function(){var b,l,e,k;if(!G&&(e=!1,null!=z&&(--z,0>=z&&(z=E,x(),e=!0)),e||A.height()===I||x(),e=f.scrollTop(),null!=D&&(l=e-D),D=e,m?(w&&(k=e+u+c>C+n,v&&!k&&(v=!1,a.css({position:"fixed",bottom:"",top:c}).trigger("sticky_kit:unbottom"))),e<F&&(m=!1,c=q,null==p&&("left"!==r&&"right"!==r||a.insertAfter(h),
h.detach()),b={position:"",width:"",top:""},a.css(b).removeClass(t).trigger("sticky_kit:unstick")),B&&(b=f.height(),u+q>b&&!v&&(c-=l,c=Math.max(b-u,c),c=Math.min(q,c),m&&a.css({top:c+"px"})))):e>F&&(m=!0,b={position:"fixed",top:c},b.width="border-box"===a.css("box-sizing")?a.outerWidth()+"px":a.width()+"px",a.css(b).addClass(t),null==p&&(a.after(h),"left"!==r&&"right"!==r||h.append(a)),a.trigger("sticky_kit:stick")),m&&w&&(null==k&&(k=e+u+c>C+n),!v&&k)))return v=!0,"static"===g.css("position")&&g.css({position:"relative"}),
a.css({position:"absolute",bottom:d,top:"auto"}).trigger("sticky_kit:bottom")},y=function(){x();return l()},H=function(){G=!0;f.off("touchmove",l);f.off("scroll",l);f.off("resize",y);b(document.body).off("sticky_kit:recalc",y);a.off("sticky_kit:detach",H);a.removeData("sticky_kit");a.css({position:"",bottom:"",top:"",width:""});g.position("position","");if(m)return null==p&&("left"!==r&&"right"!==r||a.insertAfter(h),h.remove()),a.removeClass(t)},f.on("touchmove",l),f.on("scroll",l),f.on("resize",
y),b(document.body).on("sticky_kit:recalc",y),a.on("sticky_kit:detach",H),setTimeout(l,0)}};n=0;for(K=this.length;n<K;n++)d=this[n],J(b(d));return this}}).call(this);
jQuery(function($){jQuery("#page_content_wrapper .sidebar_wrapper").stick_in_parent({offset_top:100,recalc_every:1});if(jQuery(window).width()<768||is_touch_device()){jQuery("#page_content_wrapper .sidebar_wrapper").trigger("sticky_kit:detach");}});
!function(exports,global){var origDefine=global.define,get=function(e){var o,l=e.split("."),n=global;for(o=0;o<l.length&&n;o++)n=n[l[o]];return n},modules=global.define&&global.define.modules||global._define&&global._define.modules||{},ourDefine=global.define=function(e,o,l){var n;"function"==typeof o&&(l=o,o=[]);var r,t=[];for(r=0;r<o.length;r++)t.push(exports[o[r]]?get(exports[o[r]]):modules[o[r]]||get(o[r]));if(!o.length&&l.length){n={exports:{}};var i=function(e){return exports[e]?get(exports[e]):modules[e]};t.push(i,n.exports,n)}else t[0]||"exports"!==o[0]?t[0]||"module"!==o[0]||(t[0]={id:e}):(n={exports:{}},t[0]=n.exports,"module"===o[1]&&(t[1]=n));global.define=origDefine;var a=l?l.apply(null,t):void 0;global.define=ourDefine,modules[e]=n&&n.exports?n.exports:a};global.define.orig=origDefine,global.define.modules=modules,global.define.amd=!0,ourDefine("@loader",[],function(){var noop=function(){};return{get:function(){return{prepareGlobal:noop,retrieveGlobal:noop}},global:global,__exec:function(__load){eval("(function(){ "+__load.source+" \n }).call(global);")}}})}({},window);
define("can/util/can",[],function(){var e="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:global,n={};("undefined"==typeof GLOBALCAN||GLOBALCAN!==!1)&&(e.can=n),n.global=e,n.k=function(){},n.isDeferred=n.isPromise=function(e){return e&&"function"==typeof e.then&&"function"==typeof e.pipe},n.isMapLike=function(e){return n.Map&&(e instanceof n.Map||e&&e.___get)};var t=0;n.cid=function(e,n){return e._cid||(t++,e._cid=(n||"")+t),e._cid},n.VERSION="@EDGE",n.simpleExtend=function(e,n){for(var t in n)e[t]=n[t];return e},n.last=function(e){return e&&e[e.length-1]},n.isDOM=function(e){return(e.ownerDocument||e)===n.global.document},n.childNodes=function(e){var n=e.childNodes;if("length"in n)return n;for(var t=e.firstChild,o=[];t;)o.push(t),t=t.nextSibling;return o};var o=Function.prototype.bind;o?n.proxy=function(e,n){return o.call(e,n)}:n.proxy=function(e,n){return function(){return e.apply(n,arguments)}},n.frag=function(e,t){var o,r=t||n.document||n.global.document;return e&&"string"!=typeof e?11===e.nodeType?e:"number"==typeof e.nodeType?(o=r.createDocumentFragment(),o.appendChild(e),o):"number"==typeof e.length?(o=r.createDocumentFragment(),n.each(e,function(e){o.appendChild(n.frag(e))}),n.childNodes(o).length||o.appendChild(r.createTextNode("")),o):(o=n.buildFragment(""+e,r),n.childNodes(o).length||o.appendChild(r.createTextNode("")),o):(o=n.buildFragment(null==e?"":""+e,r),o.childNodes.length||o.appendChild(r.createTextNode("")),o)},n.scope=n.viewModel=function(e,t,o){e=n.$(e);var r=n.data(e,"scope")||n.data(e,"viewModel");switch(r||(r=new n.Map,n.data(e,"scope",r),n.data(e,"viewModel",r)),arguments.length){case 0:case 1:return r;case 2:return r.attr(t);default:return r.attr(t,o),e}};var r=function(e){var n=String(e).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return n?{href:n[0]||"",protocol:n[1]||"",authority:n[2]||"",host:n[3]||"",hostname:n[4]||"",port:n[5]||"",pathname:n[6]||"",search:n[7]||"",hash:n[8]||""}:null};return n.joinURIs=function(e,n){function t(e){var n=[];return e.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(e){"/.."===e?n.pop():n.push(e)}),n.join("").replace(/^\//,"/"===e.charAt(0)?"/":"")}return n=r(n||""),e=r(e||""),n&&e?(n.protocol||e.protocol)+(n.protocol||n.authority?n.authority:e.authority)+t(n.protocol||n.authority||"/"===n.pathname.charAt(0)?n.pathname:n.pathname?(e.authority&&!e.pathname?"/":"")+e.pathname.slice(0,e.pathname.lastIndexOf("/")+1)+n.pathname:e.pathname)+(n.protocol||n.authority||n.pathname?n.search:n.search||e.search)+n.hash:null},n["import"]=function(e,t){var o=new n.Deferred;return"object"==typeof window.System&&n.isFunction(window.System["import"])?window.System["import"](e,{name:t}).then(n.proxy(o.resolve,o),n.proxy(o.reject,o)):window.define&&window.define.amd?window.require([e],function(e){o.resolve(e)}):window.steal?steal.steal(e,function(e){o.resolve(e)}):window.require?o.resolve(window.require(e)):o.resolve(),o.promise()},n.__observe=function(){},n.isNode="object"==typeof process&&"[object process]"==={}.toString.call(process),n.isBrowserWindow="undefined"!=typeof window&&"undefined"!=typeof document&&"undefined"==typeof SimpleDOM,n.isWebWorker="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,n});
define("can/util/attr/attr",["can/util/can"],function(t){var e=t.global.setImmediate||function(t){return setTimeout(t,0)},r={input:!0,textarea:!0,select:!0},n=function(e,n){return n in e||t.document&&r[e.nodeName.toLowerCase()]},a={MutationObserver:t.global.MutationObserver||t.global.WebKitMutationObserver||t.global.MozMutationObserver,map:{"class":function(t,e){return e=e||"","http://www.w3.org/2000/svg"===t.namespaceURI?t.setAttribute("class",e):t.className=e,e},value:"value",innertext:"innerText",innerhtml:"innerHTML",textcontent:"textContent","for":"htmlFor",checked:!0,disabled:!0,readonly:function(t,e){return t.readOnly=!0,e},required:!0,src:function(t,e){return null==e||""===e?(t.removeAttribute("src"),null):(t.setAttribute("src",e),e)},style:function(){var e=t.global.document&&document.createElement("div");return e&&e.style&&"cssText"in e.style?function(t,e){return t.style.cssText=e||""}:function(t,e){return t.setAttribute("style",e)}}()},defaultValue:["input","textarea"],setAttrOrProp:function(t,e,r){e=e.toLowerCase();var n=a.map[e];n!==!0||r?this.set(t,e,r):this.remove(t,e)},setSelectValue:function(t,e){if(null!=e)for(var r=t.getElementsByTagName("option"),n=0;n<r.length;n++)if(e==r[n].value)return void(r[n].selected=!0);t.selectedIndex=-1},set:function(e,r,u){var o=t.isDOM(e)&&a.MutationObserver;r=r.toLowerCase();var i;o||(i=a.get(e,r));var s,l=a.map[r];"function"==typeof l?s=l(e,u):l===!0&&n(e,r)?(s=e[r]=!0,"checked"===r&&"radio"===e.type&&t.inArray((e.nodeName+"").toLowerCase(),a.defaultValue)>=0&&(e.defaultChecked=!0)):"string"==typeof l&&n(e,l)?(s=u,(e[l]!==u||"OPTION"===e.nodeName.toUpperCase())&&(e[l]=u),"value"===l&&t.inArray((e.nodeName+"").toLowerCase(),a.defaultValue)>=0&&(e.defaultValue=u)):a.setAttribute(e,r,u),o||s===i||a.trigger(e,r,i)},setAttribute:function(){var e=t.global.document;if(e&&document.createAttribute)try{e.createAttribute("{}")}catch(r){var n={},a=document.createElement("div");return function(t,e,r){var u,o,i=e.charAt(0);"{"!==i&&"("!==i&&"*"!==i||!t.setAttributeNode?t.setAttribute(e,r):(u=n[e],u||(a.innerHTML="<div "+e+'=""></div>',u=n[e]=a.childNodes[0].attributes[0]),o=u.cloneNode(),o.value=r,t.setAttributeNode(o))}}return function(t,e,r){t.setAttribute(e,r)}}(),trigger:function(r,n,a){return t.data(t.$(r),"canHasAttributesBindings")?(n=n.toLowerCase(),e(function(){t.trigger(r,{type:"attributes",attributeName:n,target:r,oldValue:a,bubbles:!1},[])})):void 0},get:function(t,e){e=e.toLowerCase();var r=a.map[e];return"string"==typeof r&&n(t,r)?t[r]:r===!0&&n(t,e)?t[e]:t.getAttribute(e)},remove:function(t,e){e=e.toLowerCase();var r;a.MutationObserver||(r=a.get(t,e));var u=a.map[e];"function"==typeof u&&u(t,void 0),u===!0&&n(t,e)?t[e]=!1:"string"==typeof u&&n(t,u)?t[u]="":t.removeAttribute(e),a.MutationObserver||null==r||a.trigger(t,e,r)},has:function(){var e=t.global.document&&document.createElement("div");return e&&e.hasAttribute?function(t,e){return t.hasAttribute(e)}:function(t,e){return null!==t.getAttribute(e)}}()};return a});
define("can/event/event",["can/util/can"],function(t){return t.addEvent=function(t,n){var e=this.__bindEvents||(this.__bindEvents={}),i=e[t]||(e[t]=[]);return i.push({handler:n,name:t}),this},t.listenTo=function(n,e,i){var r=this.__listenToEvents;r||(r=this.__listenToEvents={});var s=t.cid(n),o=r[s];o||(o=r[s]={obj:n,events:{}});var a=o.events[e];a||(a=o.events[e]=[]),a.push(i),t.bind.call(n,e,i)},t.stopListening=function(n,e,i){var r=this.__listenToEvents,s=r,o=0;if(!r)return this;if(n){var a=t.cid(n);if((s={})[a]=r[a],!r[a])return this}for(var v in s){var l,h=s[v];n=r[v].obj,e?(l={})[e]=h.events[e]:l=h.events;for(var u in l){var d=l[u]||[];for(o=0;o<d.length;)i&&i===d[o]||!i?(t.unbind.call(n,u,d[o]),d.splice(o,1)):o++;d.length||delete h.events[u]}t.isEmptyObject(h.events)&&delete r[v]}return this},t.removeEvent=function(t,n,e){if(!this.__bindEvents)return this;for(var i,r=this.__bindEvents[t]||[],s=0,o="function"==typeof n;s<r.length;)i=r[s],(e?e(i,t,n):o&&i.handler===n||!o&&(i.cid===n||!n))?r.splice(s,1):s++;return this},t.dispatch=function(t,n){var e=this.__bindEvents;if(e){var i;"string"==typeof t?(i=t,t={type:t}):i=t.type;var r=e[i];if(r){r=r.slice(0);var s=[t];n&&s.push.apply(s,n);for(var o=0,a=r.length;a>o;o++)r[o].handler.apply(this,s);return t}}},t.one=function(n,e){var i=function(){return t.unbind.call(this,n,i),e.apply(this,arguments)};return t.bind.call(this,n,i),this},t.event={on:function(){return 0===arguments.length&&t.Control&&this instanceof t.Control?t.Control.prototype.on.call(this):t.addEvent.apply(this,arguments)},off:function(){return 0===arguments.length&&t.Control&&this instanceof t.Control?t.Control.prototype.off.call(this):t.removeEvent.apply(this,arguments)},bind:t.addEvent,unbind:t.removeEvent,delegate:function(n,e,i){return t.addEvent.call(this,e,i)},undelegate:function(n,e,i){return t.removeEvent.call(this,e,i)},trigger:t.dispatch,one:t.one,addEvent:t.addEvent,removeEvent:t.removeEvent,listenTo:t.listenTo,stopListening:t.stopListening,dispatch:t.dispatch},t.event});
define("can/util/fragment",["can/util/can"],function(e){var t=/^\s*<(\w+)[^>]*>/,i={}.toString,l=function(l,n,r){void 0===n&&(n=t.test(l)&&RegExp.$1),l&&"[object Function]"===i.call(l.replace)&&(l=l.replace(/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,"<$1></$2>"));var d=r.createElement("div"),a=r.createElement("div");"tbody"===n||"tfoot"===n||"thead"===n||"colgroup"===n?(a.innerHTML="<table>"+l+"</table>",d=3===a.firstChild.nodeType?a.lastChild:a.firstChild):"col"===n?(a.innerHTML="<table><colgroup>"+l+"</colgroup></table>",d=3===a.firstChild.nodeType?a.lastChild:a.firstChild.firstChild):"tr"===n?(a.innerHTML="<table><tbody>"+l+"</tbody></table>",d=3===a.firstChild.nodeType?a.lastChild:a.firstChild.firstChild):"td"===n||"th"===n?(a.innerHTML="<table><tbody><tr>"+l+"</tr></tbody></table>",d=3===a.firstChild.nodeType?a.lastChild:a.firstChild.firstChild.firstChild):"option"===n?(a.innerHTML="<select>"+l+"</select>",d=3===a.firstChild.nodeType?a.lastChild:a.firstChild):d.innerHTML=""+l;var o={},h=e.childNodes(d);o.length=h.length;for(var c=0;c<h.length;c++)o[c]=h[c];return[].slice.call(o)};return e.buildFragment=function(e,t){if(e&&11===e.nodeType)return e;t?t.length&&(t=t[0]):t=document;for(var i=l(e,void 0,t),n=(t||document).createDocumentFragment(),r=0,d=i.length;d>r;r++)n.appendChild(i[r]);return n},function(){var t="<-\n>",i=e.buildFragment(t,document);if(t!==i.firstChild.nodeValue){var l=e.buildFragment;e.buildFragment=function(e,t){var i=l(e,t);return 1===i.childNodes.length&&3===i.childNodes[0].nodeType&&(i.childNodes[0].nodeValue=e),i}}}(),e});
define("can/util/array/isArrayLike",["can/util/can"],function(n){n.isArrayLike=function(n){var e=n&&"boolean"!=typeof n&&"number"!=typeof n&&"length"in n&&n.length;return"function"!=typeof arr&&(0===e||"number"==typeof e&&e>0&&e-1 in n)}});
define("can/util/array/each",["can/util/can","can/util/array/isArrayLike"],function(a){return a.each=function(e,t,r){var i,n,l,c=0;if(e)if(a.isArrayLike(e))if(a.List&&e instanceof a.List)for(n=e.attr("length");n>c&&(l=e.attr(c),t.call(r||l,l,c,e)!==!1);c++);else for(n=e.length;n>c&&(l=e[c],t.call(r||l,l,c,e)!==!1);c++);else if("object"==typeof e)if(a.Map&&e instanceof a.Map||e===a.route){var f=a.Map.keys(e);for(c=0,n=f.length;n>c&&(i=f[c],l=e.attr(i),t.call(r||l,l,i,e)!==!1);c++);}else for(i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&t.call(r||e[i],e[i],i,e)===!1)break;return e},a});
define("can/util/inserted/inserted",["can/util/can"],function(e){e.inserted=function(n,r){if(n.length){n=e.makeArray(n);for(var i,t,a=r||n[0].ownerDocument||n[0],d=!1,o=e.$(a.contains?a:a.body),s=0;void 0!==(t=n[s]);s++){if(!d){if(!t.getElementsByTagName)continue;if(!e.has(o,t).length)return;d=!0}if(d&&t.getElementsByTagName){i=e.makeArray(t.getElementsByTagName("*")),e.trigger(t,"inserted",[],!1);for(var f,c=0;void 0!==(f=i[c]);c++)e.trigger(f,"inserted",[],!1)}}}},e.appendChild=function(n,r,i){var t;t=11===r.nodeType?e.makeArray(e.childNodes(r)):[r],n.appendChild(r),e.inserted(t,i)},e.insertBefore=function(n,r,i,t){var a;a=11===r.nodeType?e.makeArray(e.childNodes(r)):[r],n.insertBefore(r,i),e.inserted(a,t)}});
define("can/util/jquery/jquery",["jquery/dist/jquery","can/util/can","can/util/attr/attr","can/event/event","can/util/fragment","can/util/array/each","can/util/inserted/inserted"],function(t,e,n,r){var i=function(t){return t.nodeName&&(1===t.nodeType||9===t.nodeType)||t==window||t.addEventListener};t=t||window.jQuery,t.extend(e,t,{trigger:function(n,r,a,s){i(n)?t.event.trigger(r,a,n,!s):n.trigger?n.trigger(r,a):("string"==typeof r&&(r={type:r}),r.target=r.target||n,a&&(a.length&&"string"==typeof a?a=[a]:a.length||(a=[a])),a||(a=[]),e.dispatch.call(n,r,a))},event:e.event,addEvent:e.addEvent,removeEvent:e.removeEvent,buildFragment:e.buildFragment,$:t,each:e.each,bind:function(n,r){return this.bind&&this.bind!==e.bind?this.bind(n,r):i(this)?t.event.add(this,n,r):e.addEvent.call(this,n,r),this},unbind:function(n,r){return this.unbind&&this.unbind!==e.unbind?this.unbind(n,r):i(this)?t.event.remove(this,n,r):e.removeEvent.call(this,n,r),this},delegate:function(n,r,a){return this.delegate?this.delegate(n,r,a):i(this)?t(this).delegate(n,r,a):e.bind.call(this,r,a),this},undelegate:function(n,r,a){return this.undelegate?this.undelegate(n,r,a):i(this)?t(this).undelegate(n,r,a):e.unbind.call(this,r,a),this},proxy:e.proxy,attr:n}),e.on=e.bind,e.off=e.unbind,t.each(["append","filter","addClass","remove","data","get","has"],function(t,n){e[n]=function(t){return t[n].apply(t,e.makeArray(arguments).slice(1))}});var a=t.cleanData;t.cleanData=function(n){t.each(n,function(t,n){n&&e.trigger(n,"removed",[],!1)}),a(n)};var s,u=t.fn.domManip;t.fn.domManip=function(t,e,n){for(var r=1;r<arguments.length;r++)if("function"==typeof arguments[r]){s=r;break}return u.apply(this,arguments)},t(document.createElement("div")).append(document.createElement("div"));var d=function(t){var n=t.childNodes;if("length"in n)return e.makeArray(n);for(var r=t.firstChild,i=[];r;)i.push(r),r=r.nextSibling;return i};void 0===s?(t.fn.domManip=u,e.each(["after","prepend","before","append","replaceWith"],function(n){var r=t.fn[n];t.fn[n]=function(){var t=[],n=e.makeArray(arguments);null!=n[0]&&("string"==typeof n[0]&&(n[0]=e.buildFragment(n[0])),t=11===n[0].nodeType?d(n[0]):e.isArrayLike(n[0])?e.makeArray(n[0]):[n[0]]);var i=r.apply(this,n);return e.inserted(t),i}})):t.fn.domManip=2===s?function(t,n,r){return u.call(this,t,n,function(t){var n;11===t.nodeType&&(n=e.makeArray(e.childNodes(t)));var i=r.apply(this,arguments);return e.inserted(n?n:[t]),i})}:function(t,n){return u.call(this,t,function(t){var r;11===t.nodeType&&(r=e.makeArray(e.childNodes(t)));var i=n.apply(this,arguments);return e.inserted(r?r:[t]),i})};var l=t.attr;t.attr=function(t,n){if(e.isDOM(t)&&e.attr.MutationObserver)return l.apply(this,arguments);var r,i;arguments.length>=3&&(r=l.call(this,t,n));var a=l.apply(this,arguments);return arguments.length>=3&&(i=l.call(this,t,n)),i!==r&&e.attr.trigger(t,n,r),a};var o=t.removeAttr;return t.removeAttr=function(t,n){if(e.isDOM(t)&&e.attr.MutationObserver)return o.apply(this,arguments);var r=l.call(this,t,n),i=o.apply(this,arguments);return null!=r&&e.attr.trigger(t,n,r),i},t.event.special.attributes={setup:function(){if(e.isDOM(this)&&e.attr.MutationObserver){var t=this,n=new e.attr.MutationObserver(function(n){n.forEach(function(n){var r=e.simpleExtend({},n);e.trigger(t,r,[])})});n.observe(this,{attributes:!0,attributeOldValue:!0}),e.data(e.$(this),"canAttributesObserver",n)}else e.data(e.$(this),"canHasAttributesBindings",!0)},teardown:function(){e.isDOM(this)&&e.attr.MutationObserver?(e.data(e.$(this),"canAttributesObserver").disconnect(),t.removeData(this,"canAttributesObserver")):t.removeData(this,"canHasAttributesBindings")}},t.event.special.inserted={},t.event.special.removed={},e});
define("can/util/util",["can/util/jquery/jquery"],function(u){return u});
define("can/util/string/string",["can/util/util"],function(e){var r=/_|-/,n=/\=\=/,t=/([A-Z]+)([A-Z][a-z])/g,a=/([a-z\d])([A-Z])/g,u=/([a-z\d])([A-Z])/g,i=/\{([^\}]+)\}/g,c=/"/g,o=/'/g,l=/-+(.)?/g,p=/[a-z][A-Z]/g,f=function(e,r,n){var t=e[r];return void 0===t&&n===!0&&(t=e[r]={}),t},g=function(e){return/^f|^o/.test(typeof e)},d=function(e){var r=null===e||void 0===e||isNaN(e)&&""+e=="NaN";return""+(r?"":e)};return e.extend(e,{esc:function(e){return d(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(c,"&#34;").replace(o,"&#39;")},getObject:function(r,n,t){var a,u,i,c,o=r?r.split("."):[],l=o.length,p=0;if(n=e.isArray(n)?n:[n||window],c=n.length,!l)return n[0];for(p;c>p;p++){for(a=n[p],i=void 0,u=0;l>u&&g(a);u++)i=a,a=f(i,o[u]);if(void 0!==i&&void 0!==a)break}if(t===!1&&void 0!==a&&delete i[o[u-1]],t===!0&&void 0===a)for(a=n[0],u=0;l>u&&g(a);u++)a=f(a,o[u],!0);return a},capitalize:function(e,r){return e.charAt(0).toUpperCase()+e.slice(1)},camelize:function(e){return d(e).replace(l,function(e,r){return r?r.toUpperCase():""})},hyphenate:function(e){return d(e).replace(p,function(e,r){return e.charAt(0)+"-"+e.charAt(1).toLowerCase()})},underscore:function(e){return e.replace(n,"/").replace(t,"$1_$2").replace(a,"$1_$2").replace(u,"_").toLowerCase()},sub:function(r,n,t){var a=[];return r=r||"",a.push(r.replace(i,function(r,u){var i=e.getObject(u,n,t===!0?!1:void 0);return void 0===i||null===i?(a=null,""):g(i)&&a?(a.push(i),""):""+i})),null===a?a:a.length<=1?a[0]:a},replacer:i,undHash:r}),e});
define("can/construct/construct",["can/util/string/string"],function(t){var n,e=0;try{Object.getOwnPropertyDescriptor({}),n=!0}catch(r){n=!1}var o=function(t,n){var e=Object.getOwnPropertyDescriptor(t,n);return e&&(e.get||e.set)?e:null},s=function(n,e,r){r=r||n;var s;for(var i in n)(s=o(n,i))?this._defineProperty(r,e,i,s):t.Construct._overwrite(r,e,i,n[i])},i=function(n,e,r){r=r||n;for(var o in n)t.Construct._overwrite(r,e,o,n[o])};return t.Construct=function(){return arguments.length?t.Construct.extend.apply(t.Construct,arguments):void 0},t.extend(t.Construct,{constructorExtends:!0,newInstance:function(){var t,n=this.instance();return n.setup&&(n.__inSetup=!0,t=n.setup.apply(n,arguments),delete n.__inSetup),n.init&&n.init.apply(n,t||arguments),n},_inherit:n?s:i,_defineProperty:function(t,n,e,r){Object.defineProperty(t,e,r)},_overwrite:function(t,n,e,r){t[e]=r},setup:function(n,e){this.defaults=t.extend(!0,{},n.defaults,this.defaults)},instance:function(){e=1;var t=new this;return e=0,t},extend:function(n,r,o){function s(){return e?void 0:this.constructor!==a&&arguments.length&&a.constructorExtends?a.extend.apply(a,arguments):a.newInstance.apply(a,arguments)}var i=n,u=r,c=o;"string"!=typeof i&&(c=u,u=i,i=null),c||(c=u,u=null),c=c||{};var a,p,f,l,h,d,y,m,g,v=this,_=this.prototype;g=this.instance(),t.Construct._inherit(c,_,g),i?(p=i.split("."),y=p.pop()):u&&u.shortName?y=u.shortName:this.shortName&&(y=this.shortName),"undefined"==typeof constructorName&&(a=function(){return s.apply(this,arguments)});for(d in v)v.hasOwnProperty(d)&&(a[d]=v[d]);t.Construct._inherit(u,v,a),i&&(f=t.getObject(p.join("."),window,!0),m=f,l=t.underscore(i.replace(/\./g,"_")),h=t.underscore(y),f[y]=a),t.extend(a,{constructor:a,prototype:g,namespace:m,_shortName:h,fullName:i,_fullName:l}),void 0!==y&&(a.shortName=y),a.prototype.constructor=a;var w=[v].concat(t.makeArray(arguments)),C=a.setup.apply(a,w);return a.init&&a.init.apply(a,C||w),a}}),t.Construct.prototype.setup=function(){},t.Construct.prototype.init=function(){},t.Construct});
define("can/control/control",["can/util/util","can/construct/construct"],function(t){var n,e=function(n,e,o){return t.bind.call(n,e,o),function(){t.unbind.call(n,e,o)}},o=t.isFunction,s=t.extend,r=t.each,i=[].slice,u=/\{([^\}]+)\}/g,c=t.getObject("$.event.special",[t])||{},l=function(n,e,o,s){return t.delegate.call(n,e,o,s),function(){t.undelegate.call(n,e,o,s)}},a=function(n,o,s,r){return r?l(n,t.trim(r),o,s):e(n,o,s)},h=t.Control=t.Construct({setup:function(){if(t.Construct.setup.apply(this,arguments),t.Control){var n,e=this;e.actions={};for(n in e.prototype)e._isAction(n)&&(e.actions[n]=e._action(n))}},_shifter:function(n,e){var s="string"==typeof e?n[e]:e;return o(s)||(s=n[s]),function(){return n.called=e,s.apply(n,[this.nodeName?t.$(this):this].concat(i.call(arguments,0)))}},_isAction:function(t){var n=this.prototype[t],e=typeof n;return"constructor"!==t&&("function"===e||"string"===e&&o(this.prototype[n]))&&!!(c[t]||f[t]||/[^\w]/.test(t))},_action:function(e,o){if(u.lastIndex=0,o||!u.test(e)){var s=o?t.sub(e,this._lookup(o)):e;if(!s)return null;var r=t.isArray(s),i=r?s[1]:s,c=i.split(/\s+/g),l=c.pop();return{processor:f[l]||n,parts:[i,c.join(" "),l],delegate:r?s[0]:void 0}}},_lookup:function(t){return[t,window]},processors:{},defaults:{}},{setup:function(n,e){var o,r=this.constructor,i=r.pluginName||r._fullName;return this.element=t.$(n),i&&"can_control"!==i&&this.element.addClass(i),o=t.data(this.element,"controls"),o||(o=[],t.data(this.element,"controls",o)),o.push(this),this.options=s({},r.defaults,e),this.on(),[this.element,this.options]},on:function(n,e,o,s){if(!n){this.off();var r,i,u=this.constructor,c=this._bindings,l=u.actions,h=this.element,f=t.Control._shifter(this,"destroy");for(r in l)l.hasOwnProperty(r)&&(i=l[r]||u._action(r,this.options,this),i&&(c.control[r]=i.processor(i.delegate||h,i.parts[2],i.parts[1],r,this)));return t.bind.call(h,"removed",f),c.user.push(function(n){t.unbind.call(n,"removed",f)}),c.user.length}return"string"==typeof n&&(s=o,o=e,e=n,n=this.element),void 0===s&&(s=o,o=e,e=null),"string"==typeof s&&(s=t.Control._shifter(this,s)),this._bindings.user.push(a(n,o,s,e)),this._bindings.user.length},off:function(){var t=this.element[0],n=this._bindings;n&&(r(n.user||[],function(n){n(t)}),r(n.control||{},function(n){n(t)})),this._bindings={user:[],control:{}}},destroy:function(){if(null!==this.element){var n,e=this.constructor,o=e.pluginName||e._fullName;this.off(),o&&"can_control"!==o&&this.element.removeClass(o),n=t.data(this.element,"controls"),n.splice(t.inArray(this,n),1),t.trigger(this,"destroyed"),this.element=null}}}),f=t.Control.processors;return n=function(n,e,o,s,r){return a(n,e,t.Control._shifter(r,s),o)},r(["change","click","contextmenu","dblclick","keydown","keyup","keypress","mousedown","mousemove","mouseout","mouseover","mouseup","reset","resize","scroll","select","submit","focusin","focusout","mouseenter","mouseleave","touchstart","touchmove","touchcancel","touchend","touchleave","inserted","removed","dragstart","dragenter","dragover","dragleave","drag","drop","dragend"],function(t){f[t]=n}),h});
define("can/construct/super/super",["can/util/util","can/construct/construct"],function(t,n){var r=t.isFunction,e=/xyz/.test(function(){return this.xyz})?/\b_super\b/:/.*/,u=["get","set"],c=function(t,n,r){return function(){var e,u=this._super;return this._super=t[n],e=r.apply(this,arguments),this._super=u,e}};return t.Construct._defineProperty=function(n,e,s,i){var o=Object.getOwnPropertyDescriptor(e,s);o&&t.each(u,function(t){r(o[t])&&r(i[t])?i[t]=c(o,t,i[t]):r(i[t])||(i[t]=o[t])}),Object.defineProperty(n,s,i)},t.Construct._overwrite=function(t,n,u,s){t[u]=r(s)&&r(n[u])&&e.test(s)?c(n,u,s):s},t});
define("can/construct/proxy/proxy",["can/util/util","can/construct/construct"],function(r,t){var n=(r.isFunction,r.isArray),o=r.makeArray,c=function(r){var t,c=o(arguments);return r=c.shift(),n(r)||(r=[r]),t=this,function(){for(var u,a,e=c.concat(o(arguments)),s=r.length,i=0;s>i;i++)a=r[i],a&&(u="string"==typeof a,e=(u?t[a]:a).apply(t,e||[]),s-1>i&&(e=!n(e)||e._use_call?[e]:e));return e}};r.Construct.proxy=r.Construct.prototype.proxy=c;for(var u=[r.Map,r.Control,r.Model],a=0;a<u.length;a++)u[a]&&(u[a].proxy=c);return r});
!function(){window._define=window.define,window.define=window.define.orig}();
(function(){var j=false;window.JQClass=function(){};JQClass.classes={};JQClass.extend=function extender(f){var g=this.prototype;j=true;var h=new this();j=false;for(var i in f){h[i]=typeof f[i]=='function'&&typeof g[i]=='function'?(function(d,e){return function(){var b=this._super;this._super=function(a){return g[d].apply(this,a||[])};var c=e.apply(this,arguments);this._super=b;return c}})(i,f[i]):f[i]}function JQClass(){if(!j&&this._init){this._init.apply(this,arguments)}}JQClass.prototype=h;JQClass.prototype.constructor=JQClass;JQClass.extend=extender;return JQClass}})();(function($){JQClass.classes.JQPlugin=JQClass.extend({name:'plugin',defaultOptions:{},regionalOptions:{},_getters:[],_getMarker:function(){return'is-'+this.name},_init:function(){$.extend(this.defaultOptions,(this.regionalOptions&&this.regionalOptions[''])||{});var c=camelCase(this.name);$[c]=this;$.fn[c]=function(a){var b=Array.prototype.slice.call(arguments,1);if($[c]._isNotChained(a,b)){return $[c][a].apply($[c],[this[0]].concat(b))}return this.each(function(){if(typeof a==='string'){if(a[0]==='_'||!$[c][a]){throw'Unknown method: '+a;}$[c][a].apply($[c],[this].concat(b))}else{$[c]._attach(this,a)}})}},setDefaults:function(a){$.extend(this.defaultOptions,a||{})},_isNotChained:function(a,b){if(a==='option'&&(b.length===0||(b.length===1&&typeof b[0]==='string'))){return true}return $.inArray(a,this._getters)>-1},_attach:function(a,b){a=$(a);if(a.hasClass(this._getMarker())){return}a.addClass(this._getMarker());b=$.extend({},this.defaultOptions,this._getMetadata(a),b||{});var c=$.extend({name:this.name,elem:a,options:b},this._instSettings(a,b));a.data(this.name,c);this._postAttach(a,c);this.option(a,b)},_instSettings:function(a,b){return{}},_postAttach:function(a,b){},_getMetadata:function(d){try{var f=d.data(this.name.toLowerCase())||'';f=f.replace(/'/g,'"');f=f.replace(/([a-zA-Z0-9]+):/g,function(a,b,i){var c=f.substring(0,i).match(/"/g);return(!c||c.length%2===0?'"'+b+'":':b+':')});f=$.parseJSON('{'+f+'}');for(var g in f){var h=f[g];if(typeof h==='string'&&h.match(/^new Date\((.*)\)$/)){f[g]=eval(h)}}return f}catch(e){return{}}},_getInst:function(a){return $(a).data(this.name)||{}},option:function(a,b,c){a=$(a);var d=a.data(this.name);if(!b||(typeof b==='string'&&c==null)){var e=(d||{}).options;return(e&&b?e[b]:e)}if(!a.hasClass(this._getMarker())){return}var e=b||{};if(typeof b==='string'){e={};e[b]=c}this._optionsChanged(a,d,e);$.extend(d.options,e)},_optionsChanged:function(a,b,c){},destroy:function(a){a=$(a);if(!a.hasClass(this._getMarker())){return}this._preDestroy(a,this._getInst(a));a.removeData(this.name).removeClass(this._getMarker())},_preDestroy:function(a,b){}});function camelCase(c){return c.replace(/-([a-z])/g,function(a,b){return b.toUpperCase()})}$.JQPlugin={createPlugin:function(a,b){if(typeof a==='object'){b=a;a='JQPlugin'}a=camelCase(a);var c=camelCase(b.name);JQClass.classes[c]=JQClass.classes[a].extend(b);new JQClass.classes[c]()}}})(jQuery);
(function($){var E='datepick';$.JQPlugin.createPlugin({name:E,defaultRenderer:{picker:'<div class="datepick">'+'<div class="datepick-nav">{link:prev}{link:today}{link:next}</div>{months}'+'{popup:start}<div class="datepick-ctrl">{link:clear}{link:close}</div>{popup:end}'+'<div class="datepick-clear-fix"></div></div>',monthRow:'<div class="datepick-month-row">{months}</div>',month:'<div class="datepick-month"><div class="datepick-month-header">{monthHeader}</div>'+'<table><thead>{weekHeader}</thead><tbody>{weeks}</tbody></table></div>',weekHeader:'<tr>{days}</tr>',dayHeader:'<th>{day}</th>',week:'<tr>{days}</tr>',day:'<td>{day}</td>',monthSelector:'.datepick-month',daySelector:'td',rtlClass:'datepick-rtl',multiClass:'datepick-multi',defaultClass:'',selectedClass:'datepick-selected',highlightedClass:'datepick-highlight',todayClass:'datepick-today',otherMonthClass:'datepick-other-month',weekendClass:'datepick-weekend',commandClass:'datepick-cmd',commandButtonClass:'',commandLinkClass:'',disabledClass:'datepick-disabled'},commands:{prev:{text:'prevText',status:'prevStatus',keystroke:{keyCode:33},enabled:function(a){var b=a.curMinDate();return(!b||F.add(F.day(F._applyMonthsOffset(F.add(F.newDate(a.drawDate),1-a.options.monthsToStep,'m'),a),1),-1,'d').getTime()>=b.getTime())},date:function(a){return F.day(F._applyMonthsOffset(F.add(F.newDate(a.drawDate),-a.options.monthsToStep,'m'),a),1)},action:function(a){F.changeMonth(this,-a.options.monthsToStep)}},prevJump:{text:'prevJumpText',status:'prevJumpStatus',keystroke:{keyCode:33,ctrlKey:true},enabled:function(a){var b=a.curMinDate();return(!b||F.add(F.day(F._applyMonthsOffset(F.add(F.newDate(a.drawDate),1-a.options.monthsToJump,'m'),a),1),-1,'d').getTime()>=b.getTime())},date:function(a){return F.day(F._applyMonthsOffset(F.add(F.newDate(a.drawDate),-a.options.monthsToJump,'m'),a),1)},action:function(a){F.changeMonth(this,-a.options.monthsToJump)}},next:{text:'nextText',status:'nextStatus',keystroke:{keyCode:34},enabled:function(a){var b=a.get('maxDate');return(!b||F.day(F._applyMonthsOffset(F.add(F.newDate(a.drawDate),a.options.monthsToStep,'m'),a),1).getTime()<=b.getTime())},date:function(a){return F.day(F._applyMonthsOffset(F.add(F.newDate(a.drawDate),a.options.monthsToStep,'m'),a),1)},action:function(a){F.changeMonth(this,a.options.monthsToStep)}},nextJump:{text:'nextJumpText',status:'nextJumpStatus',keystroke:{keyCode:34,ctrlKey:true},enabled:function(a){var b=a.get('maxDate');return(!b||F.day(F._applyMonthsOffset(F.add(F.newDate(a.drawDate),a.options.monthsToJump,'m'),a),1).getTime()<=b.getTime())},date:function(a){return F.day(F._applyMonthsOffset(F.add(F.newDate(a.drawDate),a.options.monthsToJump,'m'),a),1)},action:function(a){F.changeMonth(this,a.options.monthsToJump)}},current:{text:'currentText',status:'currentStatus',keystroke:{keyCode:36,ctrlKey:true},enabled:function(a){var b=a.curMinDate();var c=a.get('maxDate');var d=a.selectedDates[0]||F.today();return(!b||d.getTime()>=b.getTime())&&(!c||d.getTime()<=c.getTime())},date:function(a){return a.selectedDates[0]||F.today()},action:function(a){var b=a.selectedDates[0]||F.today();F.showMonth(this,b.getFullYear(),b.getMonth()+1)}},today:{text:'todayText',status:'todayStatus',keystroke:{keyCode:36,ctrlKey:true},enabled:function(a){var b=a.curMinDate();var c=a.get('maxDate');return(!b||F.today().getTime()>=b.getTime())&&(!c||F.today().getTime()<=c.getTime())},date:function(a){return F.today()},action:function(a){F.showMonth(this)}},clear:{text:'clearText',status:'clearStatus',keystroke:{keyCode:35,ctrlKey:true},enabled:function(a){return true},date:function(a){return null},action:function(a){F.clear(this)}},close:{text:'closeText',status:'closeStatus',keystroke:{keyCode:27},enabled:function(a){return true},date:function(a){return null},action:function(a){F.hide(this)}},prevWeek:{text:'prevWeekText',status:'prevWeekStatus',keystroke:{keyCode:38,ctrlKey:true},enabled:function(a){var b=a.curMinDate();return(!b||F.add(F.newDate(a.drawDate),-7,'d').getTime()>=b.getTime())},date:function(a){return F.add(F.newDate(a.drawDate),-7,'d')},action:function(a){F.changeDay(this,-7)}},prevDay:{text:'prevDayText',status:'prevDayStatus',keystroke:{keyCode:37,ctrlKey:true},enabled:function(a){var b=a.curMinDate();return(!b||F.add(F.newDate(a.drawDate),-1,'d').getTime()>=b.getTime())},date:function(a){return F.add(F.newDate(a.drawDate),-1,'d')},action:function(a){F.changeDay(this,-1)}},nextDay:{text:'nextDayText',status:'nextDayStatus',keystroke:{keyCode:39,ctrlKey:true},enabled:function(a){var b=a.get('maxDate');return(!b||F.add(F.newDate(a.drawDate),1,'d').getTime()<=b.getTime())},date:function(a){return F.add(F.newDate(a.drawDate),1,'d')},action:function(a){F.changeDay(this,1)}},nextWeek:{text:'nextWeekText',status:'nextWeekStatus',keystroke:{keyCode:40,ctrlKey:true},enabled:function(a){var b=a.get('maxDate');return(!b||F.add(F.newDate(a.drawDate),7,'d').getTime()<=b.getTime())},date:function(a){return F.add(F.newDate(a.drawDate),7,'d')},action:function(a){F.changeDay(this,7)}}},defaultOptions:{pickerClass:'',showOnFocus:true,showTrigger:null,showAnim:'show',showOptions:{},showSpeed:'normal',popupContainer:null,alignment:'bottom',fixedWeeks:false,firstDay:0,calculateWeek:null,monthsToShow:1,monthsOffset:0,monthsToStep:1,monthsToJump:12,useMouseWheel:true,changeMonth:true,yearRange:'c-10:c+10',shortYearCutoff:'+10',showOtherMonths:false,selectOtherMonths:false,defaultDate:null,selectDefaultDate:false,minDate:null,maxDate:null,dateFormat:'mm/dd/yyyy',autoSize:false,rangeSelect:false,rangeSeparator:' - ',multiSelect:0,multiSeparator:',',onDate:null,onShow:null,onChangeMonthYear:null,onSelect:null,onClose:null,altField:null,altFormat:null,constrainInput:true,commandsAsDateFormat:false,commands:{}},regionalOptions:{'':{monthNames:['January','February','March','April','May','June','July','August','September','October','November','December'],monthNamesShort:['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],dayNames:['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],dayNamesShort:['Sun','Mon','Tue','Wed','Thu','Fri','Sat'],dayNamesMin:['Su','Mo','Tu','We','Th','Fr','Sa'],dateFormat:'mm/dd/yyyy',firstDay:0,renderer:{},prevText:'&lt;Prev',prevStatus:'Show the previous month',prevJumpText:'&lt;&lt;',prevJumpStatus:'Show the previous year',nextText:'Next&gt;',nextStatus:'Show the next month',nextJumpText:'&gt;&gt;',nextJumpStatus:'Show the next year',currentText:'Current',currentStatus:'Show the current month',todayText:'Today',todayStatus:'Show today\'s month',clearText:'Clear',clearStatus:'Clear all the dates',closeText:'Close',closeStatus:'Close the datepicker',yearStatus:'Change the year',earlierText:'&#160;&#160;▲',laterText:'&#160;&#160;▼',monthStatus:'Change the month',weekText:'Wk',weekStatus:'Week of the year',dayStatus:'Select DD, M d, yyyy',defaultStatus:'Select a date',isRTL:false}},_getters:['getDate','isDisabled','isSelectable','retrieveDate'],_disabled:[],_popupClass:E+'-popup',_triggerClass:E+'-trigger',_disableClass:E+'-disable',_monthYearClass:E+'-month-year',_curMonthClass:E+'-month-',_anyYearClass:E+'-any-year',_curDoWClass:E+'-dow-',_ticksTo1970:(((1970-1)*365+Math.floor(1970/4)-Math.floor(1970/100)+Math.floor(1970/400))*24*60*60*10000000),_msPerDay:24*60*60*1000,ATOM:'yyyy-mm-dd',COOKIE:'D, dd M yyyy',FULL:'DD, MM d, yyyy',ISO_8601:'yyyy-mm-dd',JULIAN:'J',RFC_822:'D, d M yy',RFC_850:'DD, dd-M-yy',RFC_1036:'D, d M yy',RFC_1123:'D, d M yyyy',RFC_2822:'D, d M yyyy',RSS:'D, d M yy',TICKS:'!',TIMESTAMP:'@',W3C:'yyyy-mm-dd',formatDate:function(f,g,h){if(typeof f!=='string'){h=g;g=f;f=''}if(!g){return''}f=f||this.defaultOptions.dateFormat;h=h||{};var i=h.dayNamesShort||this.defaultOptions.dayNamesShort;var j=h.dayNames||this.defaultOptions.dayNames;var k=h.monthNamesShort||this.defaultOptions.monthNamesShort;var l=h.monthNames||this.defaultOptions.monthNames;var m=h.calculateWeek||this.defaultOptions.calculateWeek;var n=function(a,b){var c=1;while(s+c<f.length&&f.charAt(s+c)===a){c++}s+=c-1;return Math.floor(c/(b||1))>1};var o=function(a,b,c,d){var e=''+b;if(n(a,d)){while(e.length<c){e='0'+e}}return e};var p=function(a,b,c,d){return(n(a)?d[b]:c[b])};var q='';var r=false;for(var s=0;s<f.length;s++){if(r){if(f.charAt(s)==="'"&&!n("'")){r=false}else{q+=f.charAt(s)}}else{switch(f.charAt(s)){case'd':q+=o('d',g.getDate(),2);break;case'D':q+=p('D',g.getDay(),i,j);break;case'o':q+=o('o',this.dayOfYear(g),3);break;case'w':q+=o('w',m(g),2);break;case'm':q+=o('m',g.getMonth()+1,2);break;case'M':q+=p('M',g.getMonth(),k,l);break;case'y':q+=(n('y',2)?g.getFullYear():(g.getFullYear()%100<10?'0':'')+g.getFullYear()%100);break;case'@':q+=Math.floor(g.getTime()/1000);break;case'!':q+=g.getTime()*10000+this._ticksTo1970;break;case"'":if(n("'")){q+="'"}else{r=true}break;default:q+=f.charAt(s)}}}return q},parseDate:function(g,h,j){if(h==null){throw'Invalid arguments';}h=(typeof h==='object'?h.toString():h+'');if(h===''){return null}g=g||this.defaultOptions.dateFormat;j=j||{};var k=j.shortYearCutoff||this.defaultOptions.shortYearCutoff;k=(typeof k!=='string'?k:this.today().getFullYear()%100+parseInt(k,10));var l=j.dayNamesShort||this.defaultOptions.dayNamesShort;var m=j.dayNames||this.defaultOptions.dayNames;var n=j.monthNamesShort||this.defaultOptions.monthNamesShort;var o=j.monthNames||this.defaultOptions.monthNames;var p=-1;var q=-1;var r=-1;var s=-1;var t=false;var u=false;var v=function(a,b){var c=1;while(A+c<g.length&&g.charAt(A+c)===a){c++}A+=c-1;return Math.floor(c/(b||1))>1};var w=function(a,b){var c=v(a,b);var d=[2,3,c?4:2,11,20]['oy@!'.indexOf(a)+1];var e=new RegExp('^-?\\d{1,'+d+'}');var f=h.substring(z).match(e);if(!f){throw'Missing number at position {0}'.replace(/\{0\}/,z);}z+=f[0].length;return parseInt(f[0],10);};var x=function(a,b,c,d){var e=(v(a,d)?c:b);for(var i=0;i<e.length;i++){if(h.substr(z,e[i].length).toLowerCase()===e[i].toLowerCase()){z+=e[i].length;return i+1;}}throw'Unknown name at position {0}'.replace(/\{0\}/,z);};var y=function(){if(h.charAt(z)!==g.charAt(A)){throw'Unexpected literal at position {0}'.replace(/\{0\}/,z);}z++;};var z=0;for(var A=0;A<g.length;A++){if(u){if(g.charAt(A)==="'"&&!v("'")){u=false;}else{y();}}else{switch(g.charAt(A)){case'd':r=w('d');break;case'D':x('D',l,m);break;case'o':s=w('o');break;case'w':w('w');break;case'm':q=w('m');break;case'M':q=x('M',n,o);break;case'y':var B=A;t=!v('y',2);A=B;p=w('y',2);break;case'@':var C=this._normaliseDate(new Date(w('@')*1000));p=C.getFullYear();q=C.getMonth()+1;r=C.getDate();break;case'!':var C=this._normaliseDate(new Date((w('!')-this._ticksTo1970)/10000));p=C.getFullYear();q=C.getMonth()+1;r=C.getDate();break;case'*':z=h.length;break;case"'":if(v("'")){y();}else{u=true;}break;default:y();}}}if(z<h.length){throw'Additional text found at end';}if(p===-1){p=this.today().getFullYear();}else if(p<100&&t){p+=(k===-1?1900:this.today().getFullYear()-this.today().getFullYear()%100-(p<=k?0:100));}if(s>-1){q=1;r=s;for(var D=this.daysInMonth(p,q);r>D;D=this.daysInMonth(p,q)){q++;r-=D;}}var C=this.newDate(p,q,r);if(C.getFullYear()!==p||C.getMonth()+1!==q||C.getDate()!==r){throw'Invalid date';}return C;},determineDate:function(f,g,h,i,j){if(h&&typeof h!=='object'){j=i;i=h;h=null;}if(typeof i!=='string'){j=i;i='';}var k=function(a){try{return F.parseDate(i,a,j);}catch(e){}a=a.toLowerCase();var b=(a.match(/^c/)&&h?F.newDate(h):null)||F.today();var c=/([+-]?[0-9]+)\s*(d|w|m|y)?/g;var d=null;while(d=c.exec(a)){b=F.add(b,parseInt(d[1],10),d[2]||'d');}return b;};g=(g?F.newDate(g):null);f=(f==null?g:(typeof f==='string'?k(f):(typeof f==='number'?(isNaN(f)||f===Infinity||f===-Infinity?g:F.add(F.today(),f,'d')):F.newDate(f))));return f;},daysInMonth:function(a,b){b=(a.getFullYear?a.getMonth()+1:b);a=(a.getFullYear?a.getFullYear():a);return this.newDate(a,b+1,0).getDate();},dayOfYear:function(a,b,c){var d=(a.getFullYear?a:F.newDate(a,b,c));var e=F.newDate(d.getFullYear(),1,1);return Math.floor((d.getTime()-e.getTime())/F._msPerDay)+1;},iso8601Week:function(a,b,c){var d=(a.getFullYear?new Date(a.getTime()):F.newDate(a,b,c));d.setDate(d.getDate()+4-(d.getDay()||7));var e=d.getTime();d.setMonth(0,1);return Math.floor(Math.round((e-d)/F._msPerDay)/7)+1;},today:function(){return this._normaliseDate(new Date());},newDate:function(a,b,c){return(!a?null:(a.getFullYear?this._normaliseDate(new Date(a.getTime())):new Date(a,b-1,c,12)));},_normaliseDate:function(a){if(a){a.setHours(12,0,0,0);}return a;},year:function(a,b){a.setFullYear(b);return this._normaliseDate(a);},month:function(a,b){a.setMonth(b-1);return this._normaliseDate(a);},day:function(a,b){a.setDate(b);return this._normaliseDate(a);},add:function(a,b,c){if(c==='d'||c==='w'){this._normaliseDate(a);a.setDate(a.getDate()+b*(c==='w'?7:1));}else{var d=a.getFullYear()+(c==='y'?b:0);var e=a.getMonth()+(c==='m'?b:0);a.setTime(F.newDate(d,e+1,Math.min(a.getDate(),this.daysInMonth(d,e+1))).getTime());}return a;},_applyMonthsOffset:function(a,b){var c=b.options.monthsOffset;if($.isFunction(c)){c=c.apply(b.elem[0],[a]);}return F.add(a,-c,'m');},_init:function(){this.defaultOptions.commands=this.commands;this.defaultOptions.calculateWeek=this.iso8601Week;this.regionalOptions[''].renderer=this.defaultRenderer;this._super();},_instSettings:function(b,c){return{selectedDates:[],drawDate:null,pickingRange:false,inline:($.inArray(b[0].nodeName.toLowerCase(),['div','span'])>-1),get:function(a){if($.inArray(a,['defaultDate','minDate','maxDate'])>-1){return F.determineDate(this.options[a],null,this.selectedDates[0],this.options.dateFormat,this.getConfig());}return this.options[a];},curMinDate:function(){return(this.pickingRange?this.selectedDates[0]:this.get('minDate'));},getConfig:function(){return{dayNamesShort:this.options.dayNamesShort,dayNames:this.options.dayNames,monthNamesShort:this.options.monthNamesShort,monthNames:this.options.monthNames,calculateWeek:this.options.calculateWeek,shortYearCutoff:this.options.shortYearCutoff};}};},_postAttach:function(a,b){if(b.inline){b.drawDate=F._checkMinMax(F.newDate(b.selectedDates[0]||b.get('defaultDate')||F.today()),b);b.prevDate=F.newDate(b.drawDate);this._update(a[0]);if($.fn.mousewheel){a.mousewheel(this._doMouseWheel);}}else{this._attachments(a,b);a.on('keydown.'+b.name,this._keyDown).on('keypress.'+b.name,this._keyPress).on('keyup.'+b.name,this._keyUp);if(a.attr('disabled')){this.disable(a[0]);}}},_optionsChanged:function(b,c,d){if(d.calendar&&d.calendar!==c.options.calendar){var e=function(a){return(typeof c.options[a]==='object'?null:c.options[a]);};d=$.extend({defaultDate:e('defaultDate'),minDate:e('minDate'),maxDate:e('maxDate')},d);c.selectedDates=[];c.drawDate=null;}var f=c.selectedDates;$.extend(c.options,d);this.setDate(b[0],f,null,false,true);c.pickingRange=false;c.drawDate=F.newDate(this._checkMinMax((c.options.defaultDate?c.get('defaultDate'):c.drawDate)||c.get('defaultDate')||F.today(),c));if(!c.inline){this._attachments(b,c);}if(c.inline||c.div){this._update(b[0]);}},_attachments:function(a,b){a.off('focus.'+b.name);if(b.options.showOnFocus){a.on('focus.'+b.name,this.show);}if(b.trigger){b.trigger.remove();}var c=b.options.showTrigger;b.trigger=(!c?$([]):$(c).clone().removeAttr('id').addClass(this._triggerClass)[b.options.isRTL?'insertBefore':'insertAfter'](a).click(function(){if(!F.isDisabled(a[0])){F[F.curInst===b?'hide':'show'](a[0]);}}));this._autoSize(a,b);var d=this._extractDates(b,a.val());if(d){this.setDate(a[0],d,null,true);}var e=b.get('defaultDate');if(b.options.selectDefaultDate&&e&&b.selectedDates.length===0){this.setDate(a[0],F.newDate(e||F.today()));}},_autoSize:function(d,e){if(e.options.autoSize&&!e.inline){var f=F.newDate(2009,10,20);var g=e.options.dateFormat;if(g.match(/[DM]/)){var h=function(a){var b=0;var c=0;for(var i=0;i<a.length;i++){if(a[i].length>b){b=a[i].length;c=i;}}return c;};f.setMonth(h(e.options[g.match(/MM/)?'monthNames':'monthNamesShort']));f.setDate(h(e.options[g.match(/DD/)?'dayNames':'dayNamesShort'])+20-f.getDay());}e.elem.attr('size',F.formatDate(g,f,e.getConfig()).length);}},_preDestroy:function(a,b){if(b.trigger){b.trigger.remove();}a.empty().off('.'+b.name);if(b.inline&&$.fn.mousewheel){a.unmousewheel();}if(!b.inline&&b.options.autoSize){a.removeAttr('size');}},multipleEvents:function(b){var c=arguments;return function(a){for(var i=0;i<c.length;i++){c[i].apply(this,arguments);}};},enable:function(b){b=$(b);if(!b.hasClass(this._getMarker())){return;}var c=this._getInst(b);if(c.inline){b.children('.'+this._disableClass).remove().end().find('button,select').prop('disabled',false).end().find('a').attr('href','javascript:void(0)');}else{b.prop('disabled',false);c.trigger.filter('button.'+this._triggerClass).prop('disabled',false).end().filter('img.'+this._triggerClass).css({opacity:'1.0',cursor:''});}this._disabled=$.map(this._disabled,function(a){return(a===b[0]?null:a);});},disable:function(b){b=$(b);if(!b.hasClass(this._getMarker())){return;}var c=this._getInst(b);if(c.inline){var d=b.children(':last');var e=d.offset();var f={left:0,top:0};d.parents().each(function(){if($(this).css('position')==='relative'){f=$(this).offset();return false;}});var g=b.css('zIndex');g=(g==='auto'?0:parseInt(g,10))+1;b.prepend('<div class="'+this._disableClass+'" style="'+'width: '+d.outerWidth()+'px; height: '+d.outerHeight()+'px; left: '+(e.left-f.left)+'px; top: '+(e.top-f.top)+'px; z-index: '+g+'"></div>').find('button,select').prop('disabled',true).end().find('a').removeAttr('href');}else{b.prop('disabled',true);c.trigger.filter('button.'+this._triggerClass).prop('disabled',true).end().filter('img.'+this._triggerClass).css({opacity:'0.5',cursor:'default'});}this._disabled=$.map(this._disabled,function(a){return(a===b[0]?null:a);});this._disabled.push(b[0]);},isDisabled:function(a){return(a&&$.inArray(a,this._disabled)>-1);},show:function(a){a=$(a.target||a);var b=F._getInst(a);if(F.curInst===b){return;}if(F.curInst){F.hide(F.curInst,true);}if(!$.isEmptyObject(b)){b.lastVal=null;b.selectedDates=F._extractDates(b,a.val());b.pickingRange=false;b.drawDate=F._checkMinMax(F.newDate(b.selectedDates[0]||b.get('defaultDate')||F.today()),b);b.prevDate=F.newDate(b.drawDate);F.curInst=b;F._update(a[0],true);var c=F._checkOffset(b);b.div.css({left:c.left,top:c.top});var d=b.options.showAnim;var e=b.options.showSpeed;e=(e==='normal'&&$.ui&&parseInt($.ui.version.substring(2))>=8?'_default':e);if($.effects&&($.effects[d]||($.effects.effect&&$.effects.effect[d]))){var f=b.div.data();for(var g in f){if(g.match(/^ec\.storage\./)){f[g]=b._mainDiv.css(g.replace(/ec\.storage\./,''));}}b.div.data(f).show(d,b.options.showOptions,e);}else{b.div[d||'show'](d?e:0);}}},_extractDates:function(a,b){if(b===a.lastVal){return;}a.lastVal=b;b=b.split(a.options.multiSelect?a.options.multiSeparator:(a.options.rangeSelect?a.options.rangeSeparator:'\x00'));var c=[];for(var i=0;i<b.length;i++){try{var d=F.parseDate(a.options.dateFormat,b[i],a.getConfig());if(d){var f=false;for(var j=0;j<c.length;j++){if(c[j].getTime()===d.getTime()){f=true;break;}}if(!f){c.push(d);}}}catch(e){}}c.splice(a.options.multiSelect||(a.options.rangeSelect?2:1),c.length);if(a.options.rangeSelect&&c.length===1){c[1]=c[0];}return c;},_update:function(a,b){a=$(a.target||a);var c=F._getInst(a);if(!$.isEmptyObject(c)){if(c.inline||F.curInst===c){if($.isFunction(c.options.onChangeMonthYear)&&(!c.prevDate||c.prevDate.getFullYear()!==c.drawDate.getFullYear()||c.prevDate.getMonth()!==c.drawDate.getMonth())){c.options.onChangeMonthYear.apply(a[0],[c.drawDate.getFullYear(),c.drawDate.getMonth()+1]);}}if(c.inline){var d=$('a, :input',a).index($(':focus',a));a.html(this._generateContent(a[0],c));var e=a.find('a, :input');e.eq(Math.max(Math.min(d,e.length-1),0)).focus();}else if(F.curInst===c){if(!c.div){c.div=$('<div></div>').addClass(this._popupClass).css({display:(b?'none':'static'),position:'absolute',left:a.offset().left,top:a.offset().top+a.outerHeight()}).appendTo($(c.options.popupContainer||'body'));if($.fn.mousewheel){c.div.mousewheel(this._doMouseWheel);}}c.div.html(this._generateContent(a[0],c));a.focus();}}},_updateInput:function(a,b){var c=this._getInst(a);if(!$.isEmptyObject(c)){var d='';var e='';var f=(c.options.multiSelect?c.options.multiSeparator:c.options.rangeSeparator);var g=c.options.altFormat||c.options.dateFormat;for(var i=0;i<c.selectedDates.length;i++){d+=(b?'':(i>0?f:'')+F.formatDate(c.options.dateFormat,c.selectedDates[i],c.getConfig()));e+=(i>0?f:'')+F.formatDate(g,c.selectedDates[i],c.getConfig());}if(!c.inline&&!b){$(a).val(d);}$(c.options.altField).val(e);if($.isFunction(c.options.onSelect)&&!b&&!c.inSelect){c.inSelect=true;c.options.onSelect.apply(a,[c.selectedDates]);c.inSelect=false;}}},_getBorders:function(b){var c=function(a){return{thin:1,medium:3,thick:5}[a]||a;};return[parseFloat(c(b.css('border-left-width'))),parseFloat(c(b.css('border-top-width')))];},_checkOffset:function(a){var b=(a.elem.is(':hidden')&&a.trigger?a.trigger:a.elem);var c=b.offset();var d=$(window).width();var e=$(window).height();if(d===0){return c;}var f=false;$(a.elem).parents().each(function(){f|=$(this).css('position')==='fixed';return!f;});var g=document.documentElement.scrollLeft||document.body.scrollLeft;var h=document.documentElement.scrollTop||document.body.scrollTop;var i=c.top-(f?h:0)-a.div.outerHeight();var j=c.top-(f?h:0)+b.outerHeight();var k=c.left-(f?g:0);var l=c.left-(f?g:0)+b.outerWidth()-a.div.outerWidth();var m=(c.left-g+a.div.outerWidth())>d;var n=(c.top-h+a.elem.outerHeight()+a.div.outerHeight())>e;a.div.css('position',f?'fixed':'absolute');var o=a.options.alignment;if(o==='topLeft'){c={left:k,top:i};}else if(o==='topRight'){c={left:l,top:i};}else if(o==='bottomLeft'){c={left:k,top:j};}else if(o==='bottomRight'){c={left:l,top:j};}else if(o==='top'){c={left:(a.options.isRTL||m?l:k),top:i};}else{c={left:(a.options.isRTL||m?l:k),top:(n?i:j)};}c.left=Math.max((f?0:g),c.left);c.top=Math.max((f?0:h),c.top);return c;},_checkExternalClick:function(a){if(!F.curInst){return;}var b=$(a.target);if(b.closest('.'+F._popupClass+',.'+F._triggerClass).length===0&&!b.hasClass(F._getMarker())){F.hide(F.curInst);}},hide:function(a,b){if(!a){return;}var c=this._getInst(a);if($.isEmptyObject(c)){c=a;}if(c&&c===F.curInst){var d=(b?'':c.options.showAnim);var e=c.options.showSpeed;e=(e==='normal'&&$.ui&&parseInt($.ui.version.substring(2))>=8?'_default':e);var f=function(){if(!c.div){return;}c.div.remove();c.div=null;F.curInst=null;if($.isFunction(c.options.onClose)){c.options.onClose.apply(a,[c.selectedDates]);}};c.div.stop();if($.effects&&($.effects[d]||($.effects.effect&&$.effects.effect[d]))){c.div.hide(d,c.options.showOptions,e,f);}else{var g=(d==='slideDown'?'slideUp':(d==='fadeIn'?'fadeOut':'hide'));c.div[g]((d?e:''),f);}if(!d){f();}}},_keyDown:function(a){var b=(a.data&&a.data.elem)||a.target;var c=F._getInst(b);var d=false;if(c.inline||c.div){if(a.keyCode===9){F.hide(b);}else if(a.keyCode===13){F.selectDate(b,$('a.'+c.options.renderer.highlightedClass,c.div)[0]);d=true;}else{var e=c.options.commands;for(var f in e){var g=e[f];if(g.keystroke.keyCode===a.keyCode&&!!g.keystroke.ctrlKey===!!(a.ctrlKey||a.metaKey)&&!!g.keystroke.altKey===a.altKey&&!!g.keystroke.shiftKey===a.shiftKey){F.performAction(b,f);d=true;break;}}}}else{var g=c.options.commands.current;if(g.keystroke.keyCode===a.keyCode&&!!g.keystroke.ctrlKey===!!(a.ctrlKey||a.metaKey)&&!!g.keystroke.altKey===a.altKey&&!!g.keystroke.shiftKey===a.shiftKey){F.show(b);d=true;}}c.ctrlKey=((a.keyCode<48&&a.keyCode!==32)||a.ctrlKey||a.metaKey);if(d){a.preventDefault();a.stopPropagation();}return!d;},_keyPress:function(a){var b=F._getInst((a.data&&a.data.elem)||a.target);if(!$.isEmptyObject(b)&&b.options.constrainInput){var c=String.fromCharCode(a.keyCode||a.charCode);var d=F._allowedChars(b);return(a.metaKey||b.ctrlKey||c<' '||!d||d.indexOf(c)>-1);}return true;},_allowedChars:function(a){var b=(a.options.multiSelect?a.options.multiSeparator:(a.options.rangeSelect?a.options.rangeSeparator:''));var c=false;var d=false;var e=a.options.dateFormat;for(var i=0;i<e.length;i++){var f=e.charAt(i);if(c){if(f==="'"&&e.charAt(i+1)!=="'"){c=false;}else{b+=f;}}else{switch(f){case'd':case'm':case'o':case'w':b+=(d?'':'0123456789');d=true;break;case'y':case'@':case'!':b+=(d?'':'0123456789')+'-';d=true;break;case'J':b+=(d?'':'0123456789')+'-.';d=true;break;case'D':case'M':case'Y':return null;case"'":if(e.charAt(i+1)==="'"){b+="'";}else{c=true;}break;default:b+=f;}}}return b;},_keyUp:function(a){var b=(a.data&&a.data.elem)||a.target;var c=F._getInst(b);if(!$.isEmptyObject(c)&&!c.ctrlKey&&c.lastVal!==c.elem.val()){try{var d=F._extractDates(c,c.elem.val());if(d.length>0){F.setDate(b,d,null,true);}}catch(a){}}return true;},_doMouseWheel:function(a,b){var c=(F.curInst&&F.curInst.elem[0])||$(a.target).closest('.'+F._getMarker())[0];if(F.isDisabled(c)){return;}var d=F._getInst(c);if(d.options.useMouseWheel){b=(b<0?-1:+1);F.changeMonth(c,-d.options[a.ctrlKey?'monthsToJump':'monthsToStep']*b);}a.preventDefault();},clear:function(a){var b=this._getInst(a);if(!$.isEmptyObject(b)){b.selectedDates=[];this.hide(a);var c=b.get('defaultDate');if(b.options.selectDefaultDate&&c){this.setDate(a,F.newDate(c||F.today()));}else{this._updateInput(a);}}},getDate:function(a){var b=this._getInst(a);return(!$.isEmptyObject(b)?b.selectedDates:[]);},setDate:function(a,b,c,d,e){var f=this._getInst(a);if(!$.isEmptyObject(f)){if(!$.isArray(b)){b=[b];if(c){b.push(c);}}var g=f.get('minDate');var h=f.get('maxDate');var k=f.selectedDates[0];f.selectedDates=[];for(var i=0;i<b.length;i++){var l=F.determineDate(b[i],null,k,f.options.dateFormat,f.getConfig());if(l){if((!g||l.getTime()>=g.getTime())&&(!h||l.getTime()<=h.getTime())){var m=false;for(var j=0;j<f.selectedDates.length;j++){if(f.selectedDates[j].getTime()===l.getTime()){m=true;break;}}if(!m){f.selectedDates.push(l);}}}}f.selectedDates.splice(f.options.multiSelect||(f.options.rangeSelect?2:1),f.selectedDates.length);if(f.options.rangeSelect){switch(f.selectedDates.length){case 1:f.selectedDates[1]=f.selectedDates[0];break;case 2:f.selectedDates[1]=(f.selectedDates[0].getTime()>f.selectedDates[1].getTime()?f.selectedDates[0]:f.selectedDates[1]);break;}f.pickingRange=false;}f.prevDate=(f.drawDate?F.newDate(f.drawDate):null);f.drawDate=this._checkMinMax(F.newDate(f.selectedDates[0]||f.get('defaultDate')||F.today()),f);if(!e){this._update(a);this._updateInput(a,d);}}},isSelectable:function(a,b){var c=this._getInst(a);if($.isEmptyObject(c)){return false;}b=F.determineDate(b,c.selectedDates[0]||this.today(),null,c.options.dateFormat,c.getConfig());return this._isSelectable(a,b,c.options.onDate,c.get('minDate'),c.get('maxDate'));},_isSelectable:function(a,b,c,d,e){var f=(typeof c==='boolean'?{selectable:c}:(!$.isFunction(c)?{}:c.apply(a,[b,true])));return(f.selectable!==false)&&(!d||b.getTime()>=d.getTime())&&(!e||b.getTime()<=e.getTime());},performAction:function(a,b){var c=this._getInst(a);if(!$.isEmptyObject(c)&&!this.isDisabled(a)){var d=c.options.commands;if(d[b]&&d[b].enabled.apply(a,[c])){d[b].action.apply(a,[c]);}}},showMonth:function(a,b,c,d){var e=this._getInst(a);if(!$.isEmptyObject(e)&&(d!=null||(e.drawDate.getFullYear()!==b||e.drawDate.getMonth()+1!==c))){e.prevDate=F.newDate(e.drawDate);var f=this._checkMinMax((b!=null?F.newDate(b,c,1):F.today()),e);e.drawDate=F.newDate(f.getFullYear(),f.getMonth()+1,(d!=null?d:Math.min(e.drawDate.getDate(),F.daysInMonth(f.getFullYear(),f.getMonth()+1))));this._update(a);}},changeMonth:function(a,b){var c=this._getInst(a);if(!$.isEmptyObject(c)){var d=F.add(F.newDate(c.drawDate),b,'m');this.showMonth(a,d.getFullYear(),d.getMonth()+1);}},changeDay:function(a,b){var c=this._getInst(a);if(!$.isEmptyObject(c)){var d=F.add(F.newDate(c.drawDate),b,'d');this.showMonth(a,d.getFullYear(),d.getMonth()+1,d.getDate());}},_checkMinMax:function(a,b){var c=b.get('minDate');var d=b.get('maxDate');a=(c&&a.getTime()<c.getTime()?F.newDate(c):a);a=(d&&a.getTime()>d.getTime()?F.newDate(d):a);return a;},retrieveDate:function(a,b){var c=this._getInst(a);return($.isEmptyObject(c)?null:this._normaliseDate(new Date(parseInt(b.className.replace(/^.*dp(-?\d+).*$/,'$1'),10))));},selectDate:function(a,b){var c=this._getInst(a);if(!$.isEmptyObject(c)&&!this.isDisabled(a)){var d=this.retrieveDate(a,b);if(c.options.multiSelect){var e=false;for(var i=0;i<c.selectedDates.length;i++){if(d.getTime()===c.selectedDates[i].getTime()){c.selectedDates.splice(i,1);e=true;break;}}if(!e&&c.selectedDates.length<c.options.multiSelect){c.selectedDates.push(d);}}else if(c.options.rangeSelect){if(c.pickingRange){c.selectedDates[1]=d;}else{c.selectedDates=[d,d];}c.pickingRange=!c.pickingRange;}else{c.selectedDates=[d];}c.prevDate=c.drawDate=F.newDate(d);this._updateInput(a);if(c.inline||c.pickingRange||c.selectedDates.length<(c.options.multiSelect||(c.options.rangeSelect?2:1))){this._update(a);}else{this.hide(a);}}},_generateContent:function(h,i){var j=i.options.monthsToShow;j=($.isArray(j)?j:[1,j]);i.drawDate=this._checkMinMax(i.drawDate||i.get('defaultDate')||F.today(),i);var k=F._applyMonthsOffset(F.newDate(i.drawDate),i);var l='';for(var m=0;m<j[0];m++){var n='';for(var o=0;o<j[1];o++){n+=this._generateMonth(h,i,k.getFullYear(),k.getMonth()+1,i.options.renderer,(m===0&&o===0));F.add(k,1,'m');}l+=this._prepare(i.options.renderer.monthRow,i).replace(/\{months\}/,n);}var p=this._prepare(i.options.renderer.picker,i).replace(/\{months\}/,l).replace(/\{weekHeader\}/g,this._generateDayHeaders(i,i.options.renderer));var q=function(a,b,c,d,e){if(p.indexOf('{'+a+':'+d+'}')===-1){return;}var f=i.options.commands[d];var g=(i.options.commandsAsDateFormat?f.date.apply(h,[i]):null);p=p.replace(new RegExp('\\{'+a+':'+d+'\\}','g'),'<'+b+(f.status?' title="'+i.options[f.status]+'"':'')+' class="'+i.options.renderer.commandClass+' '+i.options.renderer.commandClass+'-'+d+' '+e+(f.enabled(i)?'':' '+i.options.renderer.disabledClass)+'">'+(g?F.formatDate(i.options[f.text],g,i.getConfig()):i.options[f.text])+'</'+c+'>');};for(var r in i.options.commands){q('button','button type="button"','button',r,i.options.renderer.commandButtonClass);q('link','a href="javascript:void(0)"','a',r,i.options.renderer.commandLinkClass);}p=$(p);if(j[1]>1){var s=0;$(i.options.renderer.monthSelector,p).each(function(){var a=++s%j[1];$(this).addClass(a===1?'first':(a===0?'last':''));});}var t=this;function removeHighlight(){(i.inline?$(this).closest('.'+t._getMarker()):i.div).find(i.options.renderer.daySelector+' a').removeClass(i.options.renderer.highlightedClass);}p.find(i.options.renderer.daySelector+' a').hover(function(){removeHighlight.apply(this);$(this).addClass(i.options.renderer.highlightedClass);},removeHighlight).click(function(){t.selectDate(h,this);}).end().find('select.'+this._monthYearClass+':not(.'+this._anyYearClass+')').change(function(){var a=$(this).val().split('/');t.showMonth(h,parseInt(a[1],10),parseInt(a[0],10));}).end().find('select.'+this._anyYearClass).click(function(){$(this).css('visibility','hidden').next('input').css({left:this.offsetLeft,top:this.offsetTop,width:this.offsetWidth,height:this.offsetHeight}).show().focus();}).end().find('input.'+t._monthYearClass).change(function(){try{var a=parseInt($(this).val(),10);a=(isNaN(a)?i.drawDate.getFullYear():a);t.showMonth(h,a,i.drawDate.getMonth()+1,i.drawDate.getDate());}catch(e){alert(e);}}).keydown(function(a){if(a.keyCode===13){$(a.elem).change();}else if(a.keyCode===27){$(a.elem).hide().prev('select').css('visibility','visible');i.elem.focus();}});var u={elem:i.elem[0]};p.keydown(u,this._keyDown).keypress(u,this._keyPress).keyup(u,this._keyUp);p.find('.'+i.options.renderer.commandClass).click(function(){if(!$(this).hasClass(i.options.renderer.disabledClass)){var a=this.className.replace(new RegExp('^.*'+i.options.renderer.commandClass+'-([^ ]+).*$'),'$1');F.performAction(h,a);}});if(i.options.isRTL){p.addClass(i.options.renderer.rtlClass);}if(j[0]*j[1]>1){p.addClass(i.options.renderer.multiClass);}if(i.options.pickerClass){p.addClass(i.options.pickerClass);}$('body').append(p);var v=0;p.find(i.options.renderer.monthSelector).each(function(){v+=$(this).outerWidth();});p.width(v/j[0]+1);if($.isFunction(i.options.onShow)){i.options.onShow.apply(h,[p,i]);}return p;},_generateMonth:function(a,b,c,d,e,f){var g=F.daysInMonth(c,d);var h=b.options.monthsToShow;h=($.isArray(h)?h:[1,h]);var j=b.options.fixedWeeks||(h[0]*h[1]>1);var k=b.options.firstDay;var l=(F.newDate(c,d,1).getDay()-k+7)%7;var m=(j?6:Math.ceil((l+g)/7));var n=b.options.selectOtherMonths&&b.options.showOtherMonths;var o=(b.pickingRange?b.selectedDates[0]:b.get('minDate'));var p=b.get('maxDate');var q=e.week.indexOf('{weekOfYear}')>-1;var r=F.today();var s=F.newDate(c,d,1);F.add(s,-l-(j&&(s.getDay()===k)?7:0),'d');var t=s.getTime();var u='';for(var v=0;v<m;v++){var w=(!q?'':'<span class="dp'+t+'">'+($.isFunction(b.options.calculateWeek)?b.options.calculateWeek(s):0)+'</span>');var x='';for(var y=0;y<7;y++){var z=false;if(b.options.rangeSelect&&b.selectedDates.length>0){z=(s.getTime()>=b.selectedDates[0]&&s.getTime()<=b.selectedDates[1]);}else{for(var i=0;i<b.selectedDates.length;i++){if(b.selectedDates[i].getTime()===s.getTime()){z=true;break;}}}var A=(!$.isFunction(b.options.onDate)?{}:b.options.onDate.apply(a,[s,s.getMonth()+1===d]));var B=(n||s.getMonth()+1===d)&&this._isSelectable(a,s,A.selectable,o,p);x+=this._prepare(e.day,b).replace(/\{day\}/g,(B?'<a href="javascript:void(0)"':'<span')+' class="dp'+t+' '+(A.dateClass||'')+(z&&(n||s.getMonth()+1===d)?' '+e.selectedClass:'')+(B?' '+e.defaultClass:'')+((s.getDay()||7)<6?'':' '+e.weekendClass)+(s.getMonth()+1===d?'':' '+e.otherMonthClass)+(s.getTime()===r.getTime()&&(s.getMonth()+1)===d?' '+e.todayClass:'')+(s.getTime()===b.drawDate.getTime()&&(s.getMonth()+1)===d?' '+e.highlightedClass:'')+'"'+(A.title||(b.options.dayStatus&&B)?' title="'+(A.title||F.formatDate(b.options.dayStatus,s,b.getConfig()))+'"':'')+'>'+(b.options.showOtherMonths||(s.getMonth()+1)===d?A.content||s.getDate():'&#160;')+(B?'</a>':'</span>'));F.add(s,1,'d');t=s.getTime();}u+=this._prepare(e.week,b).replace(/\{days\}/g,x).replace(/\{weekOfYear\}/g,w);}var C=this._prepare(e.month,b).match(/\{monthHeader(:[^\}]+)?\}/);C=(C[0].length<=13?'MM yyyy':C[0].substring(13,C[0].length-1));C=(f?this._generateMonthSelection(b,c,d,o,p,C,e):F.formatDate(C,F.newDate(c,d,1),b.getConfig()));var D=this._prepare(e.weekHeader,b).replace(/\{days\}/g,this._generateDayHeaders(b,e));return this._prepare(e.month,b).replace(/\{monthHeader(:[^\}]+)?\}/g,C).replace(/\{weekHeader\}/g,D).replace(/\{weeks\}/g,u);},_generateDayHeaders:function(a,b){var c='';for(var d=0;d<7;d++){var e=(d+a.options.firstDay)%7;c+=this._prepare(b.dayHeader,a).replace(/\{day\}/g,'<span class="'+this._curDoWClass+e+'" title="'+a.options.dayNames[e]+'">'+a.options.dayNamesMin[e]+'</span>');}return c;},_generateMonthSelection:function(b,c,d,e,f,g){if(!b.options.changeMonth){return F.formatDate(g,F.newDate(c,d,1),b.getConfig());}var h=b.options['monthNames'+(g.match(/mm/i)?'':'Short')];var i=g.replace(/m+/i,'\\x2E').replace(/y+/i,'\\x2F');var j='<select class="'+this._monthYearClass+'" title="'+b.options.monthStatus+'">';for(var m=1;m<=12;m++){if((!e||F.newDate(c,m,F.daysInMonth(c,m)).getTime()>=e.getTime())&&(!f||F.newDate(c,m,1).getTime()<=f.getTime())){j+='<option value="'+m+'/'+c+'"'+(d===m?' selected="selected"':'')+'>'+h[m-1]+'</option>';}}j+='</select>';i=i.replace(/\\x2E/,j);var k=b.options.yearRange;if(k==='any'){j='<select class="'+this._monthYearClass+' '+this._anyYearClass+'" title="'+b.options.yearStatus+'">'+'<option>'+c+'</option></select>'+'<input class="'+this._monthYearClass+' '+this._curMonthClass+d+'" value="'+c+'">';}else{k=k.split(':');var l=F.today().getFullYear();var n=(k[0].match('c[+-].*')?c+parseInt(k[0].substring(1),10):((k[0].match('[+-].*')?l:0)+parseInt(k[0],10)));var o=(k[1].match('c[+-].*')?c+parseInt(k[1].substring(1),10):((k[1].match('[+-].*')?l:0)+parseInt(k[1],10)));j='<select class="'+this._monthYearClass+'" title="'+b.options.yearStatus+'">';n=F.add(F.newDate(n+1,1,1),-1,'d');o=F.newDate(o,1,1);var p=function(y,a){if(y!==0){j+='<option value="'+d+'/'+y+'"'+(c===y?' selected="selected"':'')+'>'+(a||y)+'</option>';}};if(n.getTime()<o.getTime()){n=(e&&e.getTime()>n.getTime()?e:n).getFullYear();o=(f&&f.getTime()<o.getTime()?f:o).getFullYear();var q=Math.floor((o-n)/2);if(!e||e.getFullYear()<n){p(n-q,b.options.earlierText);}for(var y=n;y<=o;y++){p(y);}if(!f||f.getFullYear()>o){p(o+q,b.options.laterText);}}else{n=(f&&f.getTime()<n.getTime()?f:n).getFullYear();o=(e&&e.getTime()>o.getTime()?e:o).getFullYear();var q=Math.floor((n-o)/2);if(!f||f.getFullYear()>n){p(n+q,b.options.earlierText);}for(var y=n;y>=o;y--){p(y);}if(!e||e.getFullYear()<o){p(o-q,b.options.laterText);}}j+='</select>';}i=i.replace(/\\x2F/,j);return i;},_prepare:function(e,f){var g=function(a,b){while(true){var c=e.indexOf('{'+a+':start}');if(c===-1){return;}var d=e.substring(c).indexOf('{'+a+':end}');if(d>-1){e=e.substring(0,c)+(b?e.substr(c+a.length+8,d-a.length-8):'')+e.substring(c+d+a.length+6);}}};g('inline',f.inline);g('popup',!f.inline);var h=/\{l10n:([^\}]+)\}/;var i=null;while(i=h.exec(e)){e=e.replace(i[0],f.options[i[1]]);}return e;}});var F=$.datepick;$(function(){$(document).on('mousedown.'+E,F._checkExternalClick).on('resize.'+E,function(){F.hide(F.curInst)})})})(jQuery);
!function(t){t(function(){MPHB.DateRules=can.Construct.extend({},{dates:{},init:function(t){this.dates=t},canCheckIn:function(t){var e=this.formatDate(t);return!this.dates.hasOwnProperty(e)||!this.dates[e].not_check_in&&!this.dates[e].not_stay_in},canCheckOut:function(t){var e=this.formatDate(t);return!this.dates.hasOwnProperty(e)||!this.dates[e].not_check_out},canStayIn:function(t){var e=this.formatDate(t);return!this.dates.hasOwnProperty(e)||!this.dates[e].not_stay_in},getNearestNotStayInDate:function(e,a){var i=MPHB.Utils.cloneDate(a),n=t.datepick.formatDate("yyyy-mm-dd",e),s=t.datepick.formatDate("yyyy-mm-dd",a);return t.each(this.dates,function(e,a){return!(e>s)&&(n>e||(a.not_stay_in?(i=t.datepick.parseDate("yyyy-mm-dd",e),!1):void 0))}),i},formatDate:function(e){return t.datepick.formatDate("yyyy-mm-dd",e)}}),can.Control("MPHB.Datepicker",{},{form:null,hiddenElement:null,roomTypeId:null,init:function(t,e){this.form=e.form,this.roomTypeId=e.hasOwnProperty("roomTypeId")?e.roomTypeId:0,this.setupHiddenElement(),this.initDatepick()},setupHiddenElement:function(){var e=this.element.attr("id")+"-hidden";if(this.hiddenElement=t("#"+e),this.hiddenElement.val()){var a=t.datepick.parseDate(MPHB._data.settings.dateTransferFormat,this.hiddenElement.val()),i=t.datepick.formatDate(MPHB._data.settings.dateFormat,a);this.element.val(i)}else;},initDatepick:function(){var e={dateFormat:MPHB._data.settings.dateFormat,altFormat:MPHB._data.settings.dateTransferFormat,altField:this.hiddenElement,minDate:MPHB.HotelDataManager.myThis.today,monthsToShow:MPHB._data.settings.numberOfMonthDatepicker,firstDay:MPHB._data.settings.firstDay,pickerClass:MPHB._data.settings.datepickerClass},a=t.extend(e,this.getDatepickSettings());this.element.datepick(a)},getDatepickSettings:function(){return{}},getDate:function(){var e=this.element.val(),a=null;try{a=t.datepick.parseDate(MPHB._data.settings.dateFormat,e)}catch(t){a=null}return a},getFormattedDate:function(e){void 0===e&&(e=MPHB._data.settings.dateFormat);var a=this.getDate();return a?t.datepick.formatDate(e,a):""},setDate:function(t){this.element.datepick("setDate",t)},getOption:function(t){return this.element.datepick("option",t)},setOption:function(t,e){this.element.datepick("option",t,e)},getMinDate:function(){var t=this.getOption("minDate");return null!==t&&""!==t?MPHB.Utils.cloneDate(t):null},getMaxDate:function(){var t=this.getOption("maxDate");return null!==t&&""!==t?MPHB.Utils.cloneDate(t):null},clear:function(){this.element.datepick("clear")},formatDate:function(e,a){return a=void 0!==a?a:"yyyy-mm-dd",t.datepick.formatDate(a,e)},refresh:function(){t.datepick._update(this.element[0],!0),t.datepick._updateInput(this.element[0],!1)}}),MPHB.FlexsliderGallery=can.Control.extend({},{sliderEl:null,navSliderEl:null,groupId:null,init:function(e,a){this.sliderEl=e,this.groupId=e.data("group");var i=t('.mphb-gallery-thumbnail-slider[data-group="'+this.groupId+'"]');i.length&&(this.navSliderEl=i);var n=this;t(window).on("load",function(){n.initSliders()})},initSliders:function(){var t=this.sliderEl.data("flexslider-atts");if(this.navSliderEl){var e=this.navSliderEl.data("flexslider-atts");e.asNavFor='.mphb-flexslider-gallery-wrapper[data-group="'+this.groupId+'"]',e.itemWidth=this.navSliderEl.find("ul > li img").width(),t.sync='.mphb-gallery-thumbnail-slider[data-group="'+this.groupId+'"]',this.navSliderEl.addClass("flexslider mphb-flexslider mphb-gallery-thumbnails-slider").flexslider(e)}this.sliderEl.addClass("flexslider mphb-flexslider mphb-gallery-slider").flexslider(t)}}),MPHB.format_price=function(e,a){a=a||{};var i=MPHB._data.settings.currency;a=t.extend({trim_zeros:!1},i,a),e=MPHB.number_format(e,a.decimals,a.decimal_separator,a.thousand_separator);var n=a.price_format.replace("%s",e);if(a.trim_zeros){var s=new RegExp("\\"+a.decimal_separator+"0+$|(\\"+a.decimal_separator+"\\d*[1-9])0+$");n=n.replace(s,"$1")}return'<span class="mphb-price">'+n+"</span>"},MPHB.number_format=function(t,e,a,i){var n,s,o,r,l,c="";return e=e||0,a=a||".",i=i||",",t<0&&(c="-",t*=-1),n=parseInt(t=(+t||0).toFixed(e))+"",(s=n.length)>3?s%=3:s=0,l=s?n.substr(0,s)+i:"",o=n.substr(s).replace(/(\d{3})(?=\d)/g,"$1"+i),r=e?a+Math.abs(t-n).toFixed(e).replace(/-/,0).slice(2):"",c+l+o+r},can.Construct("MPHB.Season",{},{startDate:null,endDate:null,allowedDays:[],init:function(e){var a=MPHB._data.settings.dateTransferFormat;this.startDate=t.datepick.parseDate(a,e.start_date),this.endDate=t.datepick.parseDate(a,e.end_date),this.allowedDays=e.allowed_days},isContainDate:function(t){return t>=this.startDate&&t<=this.endDate&&MPHB.Utils.inArray(t.getDay(),this.allowedDays)}}),MPHB.ReservationRulesChecker=can.Construct.extend({myThis:null},{rules:{checkInDays:{},checkOutDays:{},minStay:{},maxStay:{}},init:function(e){this.rules.checkInDays=t.map(e.check_in_days,function(t){return new MPHB.Rules.CheckInDayRule(t)}),this.rules.checkOutDays=t.map(e.check_out_days,function(t){return new MPHB.Rules.CheckOutDayRule(t)}),this.rules.minStay=t.map(e.min_stay_length,function(t){return new MPHB.Rules.MinDaysRule(t)}),this.rules.maxStay=t.map(e.max_stay_length,function(t){return new MPHB.Rules.MaxDaysRule(t)})},getActualRule:function(e,a,i){var n=null;return t.each(this.rules[e],function(t,e){if(e.isActualRule(a,i))return n=e,!1}),n},getActualCombinedRule:function(e,a){var i=[],n=[];return t.each(this.rules[e],function(t,e){var s=MPHB.Utils.arrayDiff(e.roomTypeIds,i);if(s.length&&e.isActualForDate(a))return n.push(e),i=i.concat(s),!e.isAllRoomTypeRule()&&(!!MPHB.Utils.arrayDiff(MPHB._data.allRoomTypeIds,i).length&&void 0)}),this.combineRules(e,n)},combineRules:function(e,a){var i;switch(e){case"checkInDays":var n=[];t.each(a,function(t,e){n=n.concat(e.days)}),n=MPHB.Utils.arrayUnique(n),i=new MPHB.Rules.CheckInDayRule({season_ids:[0],room_type_ids:[0],check_in_days:n});break;case"checkOutDays":var n=[];t.each(a,function(t,e){n=n.concat(e.days)}),n=MPHB.Utils.arrayUnique(n),i=new MPHB.Rules.CheckOutDayRule({season_ids:[0],room_type_ids:[0],check_out_days:n});break;case"minStay":var s=MPHB.Utils.arrayMin(t.map(a,function(t){return t.min}));i=new MPHB.Rules.MinDaysRule({season_ids:[0],room_type_ids:[0],min_stay_length:s});break;case"maxStay":var s=MPHB.Utils.arrayMax(t.map(a,function(t){return t.max}));i=new MPHB.Rules.MaxDaysRule({season_ids:[0],room_type_ids:[0],max_stay_length:s})}return i},isCheckInSatisfy:function(t,e){return e?this.getActualRule("checkInDays",t,e).verify(t):this.getActualCombinedRule("checkInDays",t).verify(t)},isCheckOutSatisfy:function(t,e,a){return a?this.getActualRule("checkOutDays",t,a).verify(t,e):this.getActualCombinedRule("checkOutDays",t).verify(t,e)},getMinStay:function(t,e){return e?this.getActualRule("minStay",t,e).min:this.getActualCombinedRule("minStay",t).min},getMaxStay:function(t,e){return e?this.getActualRule("maxStay",t,e).max:this.getActualCombinedRule("maxStay",t).max},getMinCheckOutDate:function(e,a){var i=this.getMinStay(e,a);return t.datepick.add(MPHB.Utils.cloneDate(e),i,"d")},getMaxCheckOutDate:function(e,a){var i=this.getMaxStay(e,a);return t.datepick.add(MPHB.Utils.cloneDate(e),i,"d")}}),MPHB.Rules={},MPHB.Rules.BasicRule=can.Construct.extend({},{seasonIds:[],roomTypeIds:[],init:function(t){this.seasonIds=t.season_ids,this.roomTypeIds=t.room_type_ids},isActualRule:function(t,e){return this.isActualForRoomType(e)&&this.isActualForDate(t)},isActualForRoomType:function(t){return MPHB.Utils.inArray(t,this.roomTypeIds)||MPHB.Utils.inArray(0,this.roomTypeIds)},isActualForDate:function(e){if(this.isAllSeasonRule())return!0;var a=!1;return t.each(this.seasonIds,function(t,i){if(MPHB.HotelDataManager.myThis.seasons[i]&&MPHB.HotelDataManager.myThis.seasons[i].isContainDate(e))return a=!0,!1}),a},verify:function(t,e){return!0},isAllSeasonRule:function(){return MPHB.Utils.inArray(0,this.seasonIds)},isAllRoomTypeRule:function(){return MPHB.Utils.inArray(0,this.roomTypeIds)},isGlobalRule:function(){return this.isAllSeasonRule()&&this.isAllRoomTypeRule()}}),MPHB.Rules.BasicRule("MPHB.Rules.CheckInDayRule",{},{days:[],init:function(t){this._super(t),this.days=t.check_in_days},verify:function(t,e){return MPHB.Utils.inArray(t.getDay(),this.days)}}),MPHB.Rules.BasicRule("MPHB.Rules.CheckOutDayRule",{},{days:[],init:function(t){this._super(t),this.days=t.check_out_days},verify:function(t,e){return MPHB.Utils.inArray(e.getDay(),this.days)}}),MPHB.Rules.BasicRule("MPHB.Rules.MinDaysRule",{},{min:null,init:function(t){this._super(t),this.min=t.min_stay_length},verify:function(e,a){var i=t.datepick.add(MPHB.Utils.cloneDate(e),this.min,"d");return MPHB.Utils.formatDateToCompare(a)>=MPHB.Utils.formatDateToCompare(i)}}),MPHB.Rules.BasicRule("MPHB.Rules.MaxDaysRule",{},{max:null,init:function(t){this._super(t),this.max=0!=t.max_stay_length?t.max_stay_length:3652},verify:function(e,a){var i=t.datepick.add(MPHB.Utils.cloneDate(e),this.max,"d");return MPHB.Utils.formatDateToCompare(a)<=MPHB.Utils.formatDateToCompare(i)}}),can.Construct("MPHB.HotelDataManager",{myThis:null,ROOM_STATUS_AVAILABLE:"available",ROOM_STATUS_NOT_AVAILABLE:"not-available",ROOM_STATUS_BOOKED:"booked",ROOM_STATUS_PAST:"past"},{today:null,roomTypesData:{},translationIds:{},dateRules:null,typeRules:{},seasons:{},init:function(e){MPHB.HotelDataManager.myThis=this,this.setToday(t.datepick.parseDate(MPHB._data.settings.dateTransferFormat,e.today)),this.initSeasons(e.seasons),this.initRoomTypesData(e.roomTypesData,e.rules),this.initRules(e.rules)},initRoomTypesData:function(e,a){var i=this;t.each(e,function(e,n){e=parseInt(e);var s=parseInt(n.originalId);s!=e&&(i.translationIds.hasOwnProperty(s)||(i.translationIds[s]=[]),i.translationIds[s].push(e));var o=new MPHB.RoomTypeData(e,n);t.each(a.dates,function(t,e){e.not_stay_in&&o.blockAllRoomsOnDate(t)}),a.blockedTypes.hasOwnProperty(s)&&t.each(a.blockedTypes[s],function(t,e){e.not_stay_in&&o.blockAllRoomsOnDate(t)}),i.roomTypesData[e]=o})},initRules:function(e){this.dateRules=new MPHB.DateRules(e.dates);var a=this;t.each(e.blockedTypes,function(e,i){a.typeRules[e]=new MPHB.DateRules(i),a.translationIds.hasOwnProperty(e)&&t.each(a.translationIds[e],function(t,e){a.typeRules[e]=new MPHB.DateRules(i)})}),this.reservationRules=new MPHB.ReservationRulesChecker(e.reservationRules)},initSeasons:function(e){t.each(e,this.proxy(function(t,e){this.seasons[t]=new MPHB.Season(e)}))},setToday:function(t){this.today=t},getRoomTypeData:function(t){return!!this.roomTypesData.hasOwnProperty(t)&&this.roomTypesData[t]},fillDateCellData:function(t,e,a,i){i||(i=e);var n=[],s=[],o=t.roomTypeId;return this.notStayIn(e,o)&&(n.push(MPHB._data.translations.notStayIn),s.push("mphb-not-stay-in-date")),"checkIn"==a&&this.notCheckIn(e,o,i)&&(n.push(MPHB._data.translations.notCheckIn),s.push("mphb-not-check-in-date")),"checkOut"==a&&this.notCheckOut(e,o,i)&&(n.push(MPHB._data.translations.notCheckOut),s.push("mphb-not-check-out-date")),n.length&&(t.title+=" "+MPHB._data.translations.rules+" "+n.join(", ")),s.length&&(t.dateClass+=(t.dateClass.length?" ":"")+s.join(" ")),t},notStayIn:function(t,e){var a=this.dateRules.canStayIn(t);return this.typeRules[e]&&(a=a&&this.typeRules[e].canStayIn(t)),!a},notCheckIn:function(t,e,a){a||(a=t);var i=this.dateRules.canCheckIn(t);return i=i&&this.reservationRules.isCheckInSatisfy(t,e),this.typeRules[e]&&(i=i&&this.typeRules[e].canCheckIn(t)),!i},notCheckOut:function(t,e,a){var i=this.dateRules.canCheckOut(t);return i=i&&this.reservationRules.isCheckOutSatisfy(a,t,e),this.typeRules[e]&&(i=i&&this.typeRules[e].canCheckOut(t)),!i}}),MPHB.TermsSwitcher=can.Construct.extend({},{init:function(t,e){var a=t.children(".mphb-terms-and-conditions");t.find(".mphb-terms-and-conditions-link").on("click",function(t){t.preventDefault(),a.toggleClass("mphb-active")})}}),MPHB.Utils=can.Construct.extend({formatDateToCompare:function(e){return t.datepick.formatDate("yyyymmdd",e)},cloneDate:function(t){return new Date(t.getTime())},arrayUnique:function(t){return t.filter(function(t,e,a){return a.indexOf(t)===e})},arrayMin:function(t){return Math.min.apply(null,t)},arrayMax:function(t){return Math.max.apply(null,t)},arrayDiff:function(t,e){return t.filter(function(t){return e.indexOf(t)<0})},inArray:function(t,e){return-1!==e.indexOf(t)}},{}),MPHB.Gateway=can.Construct.extend({},{amount:0,paymentDescription:"",init:function(t){this.billingSection=t.billingSection,this.initSettings(t.settings)},initSettings:function(t){this.amount=t.amount,this.paymentDescription=t.paymentDescription},canSubmit:function(){return!0},updateData:function(t){this.amount=t.amount,this.paymentDescription=t.paymentDescription},afterSelection:function(t){},cancelSelection:function(){}}),MPHB.BeanstreamGateway=MPHB.Gateway.extend({},{scriptUrl:"",isCanSubmit:!1,loadHandler:null,validityHandler:null,tokenRequestHandler:null,tokenUpdatedHandler:null,initSettings:function(t){this._super(t),this.scriptUrl=t.scriptUrl||"https://payform.beanstream.com/v1.1.0/payfields/beanstream_payfields.js",this.validityHandler=this.validityChanged.bind(this),this.tokenRequestHandler=this.tokenRequested.bind(this),this.tokenUpdatedHandler=this.tokenUpdated.bind(this)},canSubmit:function(){return this.isCanSubmit},afterSelection:function(e){if(this._super(e),e.length>0){var a=document.createElement("script");a.id="payfields-script",a.src=this.scriptUrl,a.dataset.submitform="true",a.dataset.async="true",null!=this.loadHandler&&t(document).off("beanstream_payfields_loaded",this.loadHandler),this.loadHandler=function(a){t("[data-beanstream-id]").appendTo(e)},t(document).on("beanstream_payfields_loaded",this.loadHandler),e.append(a),e.removeClass("mphb-billing-fields-hidden")}t(document).on("beanstream_payfields_inputValidityChanged",this.validityHandler).on("beanstream_payfields_tokenRequested",this.tokenRequestHandler).on("beanstream_payfields_tokenUpdated",this.tokenUpdatedHandler)},cancelSelection:function(){t(document).off("beanstream_payfields_inputValidityChanged",this.validityHandler).off("beanstream_payfields_tokenRequested",this.tokenRequestHandler).off("beanstream_payfields_tokenUpdated",this.tokenUpdatedHandler)},validityChanged:function(t){(t.eventDetail||t.originalEvent.eventDetail).isValid||(this.isCanSubmit=!1)},tokenRequested:function(t){this.billingSection.showPreloader()},tokenUpdated:function(t){var e=t.eventDetail||t.originalEvent.eventDetail;e.success?this.isCanSubmit=!0:(this.isCanSubmit=!1,this.billingSection.showError(MPHB._data.translations.tokenizationFailure.replace("(%s)",e.message))),this.billingSection.hidePreloader()}}),MPHB.StripeGateway=MPHB.Gateway.extend({},{publicKey:"",imageUrl:"",locale:"",allowRememberMe:!1,needBillingAddress:!1,useBitcoin:!1,panelLabel:"",handler:null,init:function(t){this._super(t),this.initHandler()},initSettings:function(t){this._super(t),this.publicKey=t.publicKey,this.imageUrl=t.checkoutImageUrl,this.allowRememberMe=t.allowRememberMe,this.needBillingAddress=t.needBillingAddress,this.useBitcoin=t.useBitcoin,this.locale=t.locale},initHandler:function(){var t=this,e={key:this.publicKey,image:this.imageUrl,locale:this.locale,name:MPHB._data.settings.siteName,bitcoin:this.useBitcoin,currency:MPHB._data.settings.currency.code.toLowerCase(),billingAddress:this.needBillingAddress,allowRememberMe:this.allowRememberMe};t.panelLabel&&(e.panelLabel=t.panelLabel),this.handler=StripeCheckout.configure(e),window.addEventListener("popstate",function(){t.handler.close()})},openModal:function(){var t=this;this.handler.open({amount:t.amount,description:t.paymentDescription,token:function(e,a){t.storeToken(e),t.needBillingAddress&&t.storeBillingData(a),t.storeEmail(e.email),t.billingSection.parentForm.element.submit(),t.billingSection.showPreloader()}})},canSubmit:function(){if(this.isTokenStored())return!0;try{this.openModal()}catch(t){console.log("error:",t)}return!1},storeToken:function(t){this.billingSection.billingFieldsWrapperEl.find('[name="mphb_stripe_token"]').val(t.id)},isTokenStored:function(){var t=this.billingSection.billingFieldsWrapperEl.find('[name="mphb_stripe_token"]');return t.length&&""!==t.val()},storeEmail:function(t){this.billingSection.billingFieldsWrapperEl.find('[name="mphb_stripe_email"]').val(t)},storeBillingData:function(e){var a=this,i=["billing_address_city","billing_address_country","billing_address_country_code","billing_address_line1","billing_address_line2","billing_address_state","billing_address_zip","billing_name"];t.each(i,function(t,i){if(e.hasOwnProperty(i)){var n=a.billingSection.billingFieldsWrapperEl.find('[name="mphb_stripe_'+i+'"]');n.length&&n.val(e[i])}})}}),MPHB.BillingSection=can.Control.extend({},{updateBillingFieldsTimeout:null,parentForm:null,billingFieldsWrapperEl:null,gateways:{},lastGatewayId:null,init:function(t,e){this.parentForm=e.form,this.billingFieldsWrapperEl=this.element.find(".mphb-billing-fields"),this.initGateways(e.gateways)},initGateways:function(e){var a=this;t.each(e,function(t,e){var i=null;switch(t){case"stripe":i=new MPHB.StripeGateway({billingSection:a,settings:MPHB._data.gateways[t]});break;case"braintree":i=new MPHB.BraintreeGateway({billingSection:a,settings:MPHB._data.gateways[t]});break;case"beanstream":i=new MPHB.BeanstreamGateway({billingSection:a,settings:MPHB._data.gateways[t]});break;default:i=new MPHB.Gateway({billingSection:a,settings:MPHB._data.gateways[t]})}void 0!==i&&(a.gateways[t]=i)}),this.notifySelectedGateway()},'[name="mphb_gateway_id"] change':function(e,a){var i=this,n=e.val();this.showPreloader(),this.billingFieldsWrapperEl.empty().addClass("mphb-billing-fields-hidden"),clearTimeout(this.updateBillingFieldsTimeout),this.updateBillingFieldsTimeout=setTimeout(function(){var e=i.parentForm.parseFormToJSON();t.ajax({url:MPHB._data.ajaxUrl,type:"GET",dataType:"json",data:{action:"mphb_get_billing_fields",mphb_nonce:MPHB._data.nonces.mphb_get_billing_fields,mphb_gateway_id:n,formValues:e},success:function(t){t.hasOwnProperty("success")?t.success?(i.lastGatewayId&&i.gateways[i.lastGatewayId].cancelSelection(),i.billingFieldsWrapperEl.html(t.data.fields),t.data.hasVisibleFields?i.billingFieldsWrapperEl.removeClass("mphb-billing-fields-hidden"):i.billingFieldsWrapperEl.addClass("mphb-billing-fields-hidden"),i.notifySelectedGateway(n)):i.showError(t.data.message):i.showError(MPHB._data.translations.errorHasOccured)},error:function(t){i.showError(MPHB._data.translations.errorHasOccured)},complete:function(t){i.hidePreloader()}})},500)},hideErrors:function(){this.parentForm.hideErrors()},showError:function(t){this.parentForm.showError(t)},showPreloader:function(){this.parentForm.showPreloader()},hidePreloader:function(){this.parentForm.hidePreloader()},canSubmit:function(){var t=this.getSelectedGateway();return!this.gateways.hasOwnProperty(t)||this.gateways[t].canSubmit()},getSelectedGateway:function(){var t=this.element.find('[name="mphb_gateway_id"]');return(1===t.length?t:t.filter(":checked")).val()},notifySelectedGateway:function(t){t=t||this.getSelectedGateway(),t&&this.gateways[t].afterSelection(this.billingFieldsWrapperEl),this.lastGatewayId=t},updateGatewaysData:function(e){var a=this;t.each(e,function(t,e){a.gateways.hasOwnProperty(t)&&a.gateways[t].updateData(e)})}}),MPHB.BraintreeGateway=MPHB.Gateway.extend({},{clientToken:"",checkout:null,initSettings:function(t){this._super(t),this.clientToken=t.clientToken},canSubmit:function(){return this.isNonceStored()},storeNonce:function(t){this.billingSection.billingFieldsWrapperEl.find('[name="mphb_braintree_payment_nonce"]').val(t)},isNonceStored:function(){var t=this.billingSection.billingFieldsWrapperEl.find('[name="mphb_braintree_payment_nonce"]');return t.length&&""!=t.val()},afterSelection:function(t){if(this._super(t),void 0!=braintree){var e="mphb-braintree-container-"+this.clientToken.substr(0,8);t.append('<div id="'+e+'"></div>');var a=this;braintree.setup(this.clientToken,"dropin",{container:e,onReady:function(t){a.checkout=t},onPaymentMethodReceived:function(t){a.storeNonce(t.nonce),a.billingSection.parentForm.element.submit(),a.billingSection.showPreloader()}}),t.removeClass("mphb-billing-fields-hidden")}},cancelSelection:function(){if(this._super(),null!=this.checkout){var t=this;this.checkout.teardown(function(){t.checkout=null})}}}),MPHB.CouponSection=can.Control.extend({},{applyCouponTimeout:null,parentForm:null,appliedCouponEl:null,couponEl:null,messageHolderEl:null,init:function(t,e){this.parentForm=e.form,this.couponEl=t.find('[name="mphb_coupon_code"]'),this.appliedCouponEl=t.find('[name="mphb_applied_coupon_code"]'),this.messageHolderEl=t.find(".mphb-coupon-message")},".mphb-apply-coupon-code-button click":function(e,a){a.preventDefault(),a.stopPropagation(),this.clearMessage();var i=this.couponEl.val();if(!i.length)return void this.showMessage(MPHB._data.translations.emptyCouponCode);this.appliedCouponEl.val("");var n=this;this.showPreloader(),clearTimeout(this.applyCouponTimeout),this.applyCouponTimeout=setTimeout(function(){var e=n.parentForm.parseFormToJSON();t.ajax({url:MPHB._data.ajaxUrl,type:"POST",dataType:"json",data:{action:"mphb_apply_coupon",mphb_nonce:MPHB._data.nonces.mphb_apply_coupon,mphb_coupon_code:i,formValues:e},success:function(t){t.hasOwnProperty("success")?t.success?(n.parentForm.setCheckoutData(t.data),n.couponEl.val(""),n.appliedCouponEl.val(t.data.coupon.applied_code),n.showMessage(t.data.coupon.message)):n.showMessage(t.data.message):n.showMessage(MPHB._data.translations.errorHasOccured)},error:function(t){n.showMessage(MPHB._data.translations.errorHasOccured)},complete:function(t){n.hidePreloader()}})},500)},removeCoupon:function(){this.appliedCouponEl.val(""),this.clearMessage()},showPreloader:function(){this.parentForm.showPreloader()},hidePreloader:function(){this.parentForm.hidePreloader()},clearMessage:function(){this.messageHolderEl.html("").addClass("mphb-hide")},showMessage:function(t){this.messageHolderEl.html(t).removeClass("mphb-hide")}}),MPHB.CheckoutForm=can.Control.extend({myThis:null},{priceBreakdownTableEl:null,bookBtnEl:null,errorsWrapperEl:null,preloaderEl:null,billingSection:null,couponSection:null,waitResponse:!1,updateInfoTimeout:null,updateRatesTimeout:null,freeBooking:!1,init:function(t,e){MPHB.CheckoutForm.myThis=this,this.bookBtnEl=this.element.find("input[type=submit]"),this.errorsWrapperEl=this.element.find(".mphb-errors-wrapper"),this.preloaderEl=this.element.find(".mphb-preloader"),this.priceBreakdownTableEl=this.element.find("table.mphb-price-breakdown"),MPHB._data.settings.useBilling&&(this.billingSection=new MPHB.BillingSection(this.element.find("#mphb-billing-details"),{form:this,gateways:MPHB._data.gateways})),MPHB._data.settings.useCoupons&&(this.couponSection=new MPHB.CouponSection(this.element.find("#mphb-coupon-details"),{form:this}))},setTotal:function(t){var e=this.element.find(".mphb-total-price-field");e.length&&e.html(t)},setDeposit:function(t){var e=this.element.find(".mphb-deposit-amount-field");e.length&&e.html(t)},setupPriceBreakdown:function(t){this.priceBreakdownTableEl.replaceWith(t),this.priceBreakdownTableEl=this.element.find("table.mphb-price-breakdown")},updateCheckoutInfo:function(){var e=this;e.hideErrors(),e.showPreloader(),clearTimeout(this.updateInfoTimeout),this.updateInfoTimeout=setTimeout(function(){var a=e.parseFormToJSON();t.ajax({url:MPHB._data.ajaxUrl,type:"GET",dataType:"json",data:{action:"mphb_update_checkout_info",mphb_nonce:MPHB._data.nonces.mphb_update_checkout_info,formValues:a},success:function(t){t.hasOwnProperty("success")?t.success?e.setCheckoutData(t.data):e.showError(t.data.message):e.showError(MPHB._data.translations.errorHasOccured)},error:function(t){e.showError(MPHB._data.translations.errorHasOccured)},complete:function(t){e.hidePreloader()}})},500)},setCheckoutData:function(t){this.setTotal(t.total),this.setupPriceBreakdown(t.priceBreakdown),MPHB._data.settings.useBilling&&(this.setDeposit(t.deposit),this.billingSection.updateGatewaysData(t.gateways),t.isFree?this.setFreeMode():this.unsetFreeMode())},setFreeMode:function(){this.freeBooking=!0,this.billingSection.element.addClass("mphb-hide"),this.element.append(t("<input />",{type:"hidden",name:"mphb_gateway_id",value:"manual",id:"mphb-manual-payment-input"}))},unsetFreeMode:function(){this.freeBooking=!1,this.billingSection.element.removeClass("mphb-hide"),this.element.find("#mphb-manual-payment-input").remove()},updateRatePrices:function(e){if(e&&e.length){var a=parseInt(e.attr("data-index")),i=e.find(".mphb_sc_checkout-rate"),n=t.map(i,function(t){return parseInt(t.value)});if(!(n.length<=1)){var s=this.parseFormToJSON(),o=s.mphb_room_details[a],r=o.adults||"",l=o.children||"";clearTimeout(this.updateRatesTimeout),this.updateRatesTimeout=setTimeout(function(){t.ajax({url:MPHB._data.ajaxUrl,type:"GET",dataType:"json",data:{action:"mphb_update_rate_prices",mphb_nonce:MPHB._data.nonces.mphb_update_rate_prices,rates:n,adults:r,children:l,check_in_date:s.mphb_check_in_date,check_out_date:s.mphb_check_out_date},success:function(e){if(e.hasOwnProperty("success")){var a=e.data;t.each(i,function(e,i){var n=i.value;if(void 0!=a[n]){var s=t(i).parent().children("strong");s.children(".mphb-price").remove(),s.append(a[n])}})}}})},500)}}},".mphb_checkout-guests-chooser change":function(t,e){this.updateRatePrices(t.closest(".mphb-room-details")),this.updateCheckoutInfo()},".mphb_checkout-rate change":function(t,e){this.updateCheckoutInfo()},".mphb_checkout-service, .mphb_checkout-service-adults change":function(t,e){this.updateCheckoutInfo()},".mphb-price-breakdown-expand click":function(e,a){a.preventDefault(),t(e).blur();var i=t(e).parents("tr.mphb-price-breakdown-group");i.find(".mphb-price-breakdown-rate").toggleClass("mphb-hide"),i.nextUntil("tr.mphb-price-breakdown-group").toggleClass("mphb-hide")},hideErrors:function(){this.errorsWrapperEl.empty().addClass("mphb-hide")},showError:function(t){this.errorsWrapperEl.html(t).removeClass("mphb-hide")},showPreloader:function(){this.waitResponse=!0,this.bookBtnEl.attr("disabled","disabled"),this.preloaderEl.removeClass("mphb-hide")},hidePreloader:function(){this.waitResponse=!1,this.bookBtnEl.removeAttr("disabled"),this.preloaderEl.addClass("mphb-hide")},parseFormToJSON:function(){return this.element.serializeJSON()},submit:function(t,e){return!this.waitResponse&&(!(MPHB._data.settings.useBilling&&!this.freeBooking&&!this.billingSection.canSubmit())&&void 0)},"#mphb-price-details .mphb-remove-coupon click":function(t,e){e.preventDefault(),e.stopPropagation(),MPHB._data.settings.useCoupons&&(this.couponSection.removeCoupon(),this.updateCheckoutInfo())}}),MPHB.DirectBooking=can.Control.extend({},{reservationForm:null,elementsToHide:null,quantitySection:null,wrapperWithSelect:null,wrapperWithoutSelect:null,quantitySelect:null,availableLabel:null,typeId:0,init:function(t,e){this.reservationForm=e.reservationForm,this.elementsToHide=t.find(".mphb-reserve-room-section, .mphb-rooms-quantity-wrapper"),this.quantitySection=t.find(".mphb-reserve-room-section"),this.wrapperWithSelect=this.quantitySection.find(".mphb-rooms-quantity-wrapper").first(),this.wrapperWithoutSelect=this.quantitySection.find(".mphb-rooms-quantity-wrapper").last(),this.quantitySelect=this.quantitySection.find(".mphb-rooms-quantity"),this.availableLabel=this.quantitySection.find(".mphb-available-rooms-count"),this.typeId=t.find('input[name="mphb_room_type_id"]').val(),this.typeId=parseInt(this.typeId)},hideQuantitySection:function(){this.elementsToHide.addClass("mphb-hide")},showQuantitySection:function(){this.quantitySection.removeClass("mphb-hide")},resetQuantityOptions:function(t){this.quantitySelect.empty();for(var e=1;e<=t;e++){var a='<option value="'+e+'">'+e+"</option>";this.quantitySelect.append(a)}this.quantitySelect.val(1),this.availableLabel.text(t),t>1?this.wrapperWithSelect.removeClass("mphb-hide"):this.wrapperWithoutSelect.removeClass("mphb-hide")},showError:function(t){this.hideQuantitySection(),this.reservationForm.showError(t)},"input.mphb-datepick change":function(t,e){this.hideQuantitySection()},".mphb-reserve-btn click":function(e,a){a.preventDefault(),a.stopPropagation(),this.reservationForm.clearErrors(),this.reservationForm.setFormWaitingMode();var i=this.reservationForm.checkInDatepicker.getDate(),n=this.reservationForm.checkOutDatepicker.getDate();if(!i||!n)return i?this.showError(MPHB._data.translations.checkOutNotValid):this.showError(MPHB._data.translations.checkInNotValid),void this.reservationForm.setFormNormalMode();var s=this;t.ajax({url:MPHB._data.ajaxUrl,type:"GET",dataType:"json",data:{action:"mphb_get_free_accommodations_amount",mphb_nonce:MPHB._data.nonces.mphb_get_free_accommodations_amount,typeId:this.typeId,checkInDate:t.datepick.formatDate(MPHB._data.settings.dateTransferFormat,i),checkOutDate:t.datepick.formatDate(MPHB._data.settings.dateTransferFormat,n)},success:function(t){t.success?(s.resetQuantityOptions(t.data.freeCount),s.showQuantitySection()):s.showError(t.data.message)},error:function(t){s.showError(MPHB._data.translations.errorHasOccured)},complete:function(t){s.reservationForm.setFormNormalMode()}})}}),MPHB.ReservationForm=can.Control.extend({MODE_SUBMIT:"submit",MODE_NORMAL:"normal",MODE_WAITING:"waiting"},{formEl:null,checkInDatepicker:null,checkOutDatepicker:null,reserveBtn:null,reserveBtnPreloader:null,errorsWrapper:null,isDirectBooking:!1,directBooking:null,mode:null,roomTypeId:null,searchRoomTypeId:null,roomTypeData:null,setup:function(t,e){this._super(t,e),this.mode=MPHB.ReservationForm.MODE_NORMAL},init:function(e,a){this.formEl=e,this.roomTypeId=parseInt(this.formEl.attr("id").replace(/^booking-form-/,"")),this.isDirectBooking="1"==MPHB._data.settings.isDirectBooking,this.roomTypeData=MPHB.HotelDataManager.myThis.getRoomTypeData(this.roomTypeId),this.originalRoomTypeId=this.roomTypeData.originalId,this.searchRoomTypeId=this.isDirectBooking?this.originalRoomTypeId:0,this.errorsWrapper=this.formEl.find(".mphb-errors-wrapper"),this.initCheckInDatepicker(),this.initCheckOutDatepicker(),this.initReserveBtn(),this.isDirectBooking&&(this.directBooking=new MPHB.DirectBooking(e,{reservationForm:this})),t(window).on("mphb-update-date-room-type-"+this.roomTypeId,this.proxy(function(){this.refreshDatepickers()})),this.checkInDatepicker.getDate()&&this.updateCheckOutLimitations()},proceedToCheckout:function(){this.mode=MPHB.ReservationForm.MODE_SUBMIT,this.unlock(),this.formEl.submit()},showError:function(e){this.clearErrors();var a=t("<p>",{class:"mphb-error",html:e});this.errorsWrapper.append(a).removeClass("mphb-hide")},clearErrors:function(){this.errorsWrapper.empty().addClass("mphb-hide")},lock:function(){this.element.find("[name]").attr("disabled","disabled"),this.reserveBtn.attr("disabled","disabled").addClass("mphb-disabled"),this.reserveBtnPreloader.removeClass("mphb-hide")},unlock:function(){this.element.find("[name]").removeAttr("disabled"),this.reserveBtn.removeAttr("disabled").removeClass("mphb-disabled"),this.reserveBtnPreloader.addClass("mphb-hide")},setFormWaitingMode:function(){this.mode=MPHB.ReservationForm.MODE_WAITING,this.lock()},setFormNormalMode:function(){this.mode=MPHB.ReservationForm.MODE_NORMAL,this.unlock()},initCheckInDatepicker:function(){var t=this.formEl.find('input[type="text"][id^=mphb_check_in_date]');this.checkInDatepicker=new MPHB.RoomTypeCheckInDatepicker(t,{form:this,roomTypeId:this.searchRoomTypeId})},initCheckOutDatepicker:function(){var t=this.formEl.find('input[type="text"][id^=mphb_check_out_date]');this.checkOutDatepicker=new MPHB.RoomTypeCheckOutDatepicker(t,{form:this,roomTypeId:this.searchRoomTypeId})},initReserveBtn:function(){this.reserveBtn=this.formEl.find(".mphb-reserve-btn"),this.reserveBtnPreloader=this.formEl.find(".mphb-preloader"),this.setFormNormalMode()},updateCheckOutLimitations:function(t){void 0===t&&(t=!0);var e=this.retrieveCheckOutLimitations(this.checkInDatepicker.getDate(),this.checkOutDatepicker.getDate())
;this.checkOutDatepicker.setOption("minDate",e.minDate),this.checkOutDatepicker.setOption("maxDate",e.maxDate),this.checkOutDatepicker.setDate(t?e.date:null)},retrieveCheckOutLimitations:function(t,e){var a=MPHB.HotelDataManager.myThis.today,i=null,n=null;return null!==t&&(a=MPHB.HotelDataManager.myThis.reservationRules.getMinCheckOutDate(t,this.searchRoomTypeId),i=MPHB.HotelDataManager.myThis.reservationRules.getMaxCheckOutDate(t,this.searchRoomTypeId),this.isDirectBooking&&(i=this.roomTypeData.getNearestLockedCheckOutDate(t,i),i=this.roomTypeData.getNearestHaveNotPriceDate(t,i)),i=MPHB.HotelDataManager.myThis.dateRules.getNearestNotStayInDate(t,i),n=this.isCheckOutDateNotValid(t,e,a,i)?this.retrieveRecommendedCheckOutDate(t,a,i):e),{minDate:a,maxDate:i,date:n}},retrieveRecommendedCheckOutDate:function(e,a,i){for(var n=null,s=MPHB.Utils.cloneDate(a);MPHB.Utils.formatDateToCompare(s)<=MPHB.Utils.formatDateToCompare(i);){var o=t.datepick.add(MPHB.Utils.cloneDate(s),-1,"d");if(!this.isCheckOutDateNotValid(e,s,a,i)&&(!this.isDirectBooking||this.roomTypeData.hasPriceForDate(o))){n=s;break}s=t.datepick.add(s,1,"d")}return n},isCheckOutDateNotValid:function(t,e,a,i){return null===e||MPHB.Utils.formatDateToCompare(e)<MPHB.Utils.formatDateToCompare(a)||MPHB.Utils.formatDateToCompare(e)>MPHB.Utils.formatDateToCompare(i)||!MPHB.HotelDataManager.myThis.reservationRules.isCheckOutSatisfy(t,e,this.searchRoomTypeId)||!MPHB.HotelDataManager.myThis.dateRules.canCheckOut(e)},clearDatepickers:function(){this.checkInDatepicker.clear(),this.checkOutDatepicker.clear()},refreshDatepickers:function(){this.checkInDatepicker.refresh(),this.checkOutDatepicker.refresh()},onDatepickChange:function(){null!=this.directBooking&&this.directBooking.hideQuantitySection()}}),MPHB.RoomTypeCalendar=can.Control.extend({},{roomTypeData:null,roomTypeId:null,init:function(e,a){this.roomTypeId=parseInt(e.attr("id").replace(/^mphb-calendar-/,"")),this.roomTypeData=MPHB.HotelDataManager.myThis.getRoomTypeData(this.roomTypeId);var i=MPHB._data.settings.numberOfMonthCalendar,n=e.attr("data-monthstoshow");if(n){var s=n.split(",");i=1==s.length?parseInt(n):s}e.hide().datepick({onDate:this.proxy(function(t,e){var a={selectable:!1,dateClass:"mphb-date-cell",title:"",roomTypeId:this.roomTypeId};return e?a=this.roomTypeData.fillDateData(a,t):a.dateClass+=" mphb-extra-date",a}),minDate:MPHB.HotelDataManager.myThis.today,monthsToShow:i,firstDay:MPHB._data.settings.firstDay,pickerClass:MPHB._data.settings.datepickerClass}).show(),t(window).on("mphb-update-room-type-data-"+this.roomTypeId,this.proxy(function(t){this.refresh()}))},refresh:function(){this.element.hide(),t.datepick._update(this.element[0],!0),this.element.show()}}),MPHB.Datepicker("MPHB.RoomTypeCheckInDatepicker",{},{isDirectBooking:!1,init:function(t,e){this._super(t,e),this.isDirectBooking="1"==MPHB._data.settings.isDirectBooking},getDatepickSettings:function(){return{onDate:this.proxy(function(t,e){var a={dateClass:"mphb-date-cell",selectable:!1,title:"",roomTypeId:this.roomTypeId};if(e){var i=MPHB.HotelDataManager.myThis.reservationRules.isCheckInSatisfy(t,this.roomTypeId)&&MPHB.HotelDataManager.myThis.dateRules.canCheckIn(t);this.isDirectBooking?(a=this.form.roomTypeData.fillDateData(a,t,"checkIn"),i=i&&this.form.roomTypeData.canCheckIn(t)):(this.form.roomTypeData.isEarlierThanToday(t)&&(a.dateClass+=" mphb-past-date",a.title+=" "+MPHB._data.translations.past),a=MPHB.HotelDataManager.myThis.fillDateCellData(a,t,"checkIn")),i&&(a.selectable=!0)}else a.dateClass+=" mphb-extra-date";return a.selectable&&(a.dateClass+=" mphb-date-selectable"),a}),onSelect:this.proxy(function(t){this.form.updateCheckOutLimitations(),this.form.onDatepickChange()}),pickerClass:"mphb-datepick-popup mphb-check-in-datepick "+MPHB._data.settings.datepickerClass}},setDate:function(t){return null==t?this._super(t):MPHB.HotelDataManager.myThis.reservationRules.isCheckInSatisfy(t,this.roomTypeId)&&MPHB.HotelDataManager.myThis.dateRules.canCheckIn(t)?this._super(t):this._super(null)}}),MPHB.RoomTypeCheckOutDatepicker=MPHB.Datepicker.extend({},{getDatepickSettings:function(){return{onDate:this.proxy(function(t,e){var a={dateClass:"mphb-date-cell",selectable:!1,title:"",roomTypeId:this.roomTypeId};if(e){var i=this.form.checkInDatepicker.getDate(),n=null!==this.getMinDate()&&MPHB.Utils.formatDateToCompare(t)<MPHB.Utils.formatDateToCompare(this.getMinDate()),s=null!==this.getMaxDate()&&MPHB.Utils.formatDateToCompare(t)>MPHB.Utils.formatDateToCompare(this.getMaxDate());if(null!==i&&MPHB.Utils.formatDateToCompare(t)===MPHB.Utils.formatDateToCompare(i)&&(a.dateClass+=" mphb-check-in-date",a.title+=MPHB._data.translations.checkInDate),n){var o=!!i&&MPHB.HotelDataManager.myThis.reservationRules.getMinCheckOutDate(i,this.roomTypeId);MPHB.Utils.formatDateToCompare(t)<MPHB.Utils.formatDateToCompare(i)?a.dateClass+=" mphb-earlier-min-date mphb-earlier-check-in-date":o&&MPHB.Utils.formatDateToCompare(t)<MPHB.Utils.formatDateToCompare(o)&&(a.dateClass+=" mphb-earlier-min-date",a.title+=(a.title.length?" ":"")+MPHB._data.translations.lessThanMinDaysStay)}if(s){var r=!!i&&MPHB.HotelDataManager.myThis.reservationRules.getMaxCheckOutDate(i,this.roomTypeId);!r||MPHB.Utils.formatDateToCompare(t)<MPHB.Utils.formatDateToCompare(r)?a.title+=(a.title.length?" ":"")+MPHB._data.translations.laterThanMaxDate:a.title+=(a.title.length?" ":"")+MPHB._data.translations.moreThanMaxDaysStay,a.dateClass+=" mphb-later-max-date"}this.isDirectBooking?a=this.form.roomTypeData.fillDateData(a,t,"checkOut",i):(this.form.roomTypeData.isEarlierThanToday(t)&&(a.dateClass+=" mphb-past-date",a.title+=" "+MPHB._data.translations.past),a=MPHB.HotelDataManager.myThis.fillDateCellData(a,t,"checkOut",i));!n&&!s&&MPHB.HotelDataManager.myThis.reservationRules.isCheckOutSatisfy(i,t,this.roomTypeId)&&MPHB.HotelDataManager.myThis.dateRules.canCheckOut(t)&&(a.selectable=!0)}else a.dateClass+=" mphb-extra-date";return a.selectable?a.dateClass+=" mphb-selectable-date":a.dateClass+=" mphb-unselectable-date",a}),onSelect:this.proxy(function(t){this.form.onDatepickChange()}),pickerClass:"mphb-datepick-popup mphb-check-out-datepick "+MPHB._data.settings.datepickerClass}},setDate:function(t){if(null==t)return this._super(t);var e=this.form.checkInDatepicker.getDate();return MPHB.HotelDataManager.myThis.reservationRules.isCheckOutSatisfy(e,t,this.roomTypeId)&&MPHB.HotelDataManager.myThis.dateRules.canCheckOut(t)?this._super(t):this._super(null)}}),MPHB.RoomTypeData=can.Construct.extend({},{id:null,originalId:null,bookedDates:{},checkInDates:{},checkOutDates:{},blockedDates:{},havePriceDates:{},activeRoomsCount:0,init:function(t,e){this.id=t,this.originalId=e.originalId,this.setRoomsCount(e.activeRoomsCount),this.setDates(e.dates)},update:function(e){e.hasOwnProperty("activeRoomsCount")&&this.setRoomsCount(e.activeRoomsCount),e.hasOwnProperty("dates")&&this.setDates(e.dates),t(window).trigger("mphb-update-room-type-data-"+this.id)},setRoomsCount:function(t){this.activeRoomsCount=t},setDates:function(t){this.bookedDates=t.hasOwnProperty("booked")?t.booked:{},this.checkInDates=t.hasOwnProperty("checkIns")?t.checkIns:{},this.checkOutDates=t.hasOwnProperty("checkOuts")?t.checkOuts:{},this.blockedDates=t.hasOwnProperty("blocked")?t.blocked:{},this.havePriceDates=t.hasOwnProperty("havePrice")?t.havePrice:{}},blockAllRoomsOnDate:function(t){this.blockedDates[t]=this.activeRoomsCount},getNearestLockedCheckOutDate:function(e,a){var i=a,n=this.activeRoomsCount,s=t.datepick.formatDate("yyyy-mm-dd",e),o=t.datepick.formatDate("yyyy-mm-dd",a);return t.each(this.getLockedCheckoutDates(),function(e,a){return!(o<e)&&(s>e||(a>=n?(i=t.datepick.parseDate("yyyy-mm-dd",e),!1):void 0))}),i},getLockedCheckoutDates:function(){var e=t.extend({},this.bookedDates);return t.each(this.blockedDates,function(t,a){e.hasOwnProperty(t)?e[t]+=a:e[t]=a}),e},getNearestHaveNotPriceDate:function(e,a){for(var i=MPHB.Utils.cloneDate(a),n=MPHB.Utils.cloneDate(e);MPHB.Utils.formatDateToCompare(n)<=MPHB.Utils.formatDateToCompare(a);){if(!this.hasPriceForDate(n)){i=n;break}n=t.datepick.add(n,1,"d")}return i},getHavePriceDates:function(){var e={};return t.extend(e,this.havePriceDates)},getDateStatus:function(t){var e=MPHB.HotelDataManager.ROOM_STATUS_AVAILABLE;return this.isEarlierThanToday(t)?e=MPHB.HotelDataManager.ROOM_STATUS_PAST:this.isDateBooked(t)?e=MPHB.HotelDataManager.ROOM_STATUS_BOOKED:this.hasPriceForDate(t)?this.getAvailableRoomsCount(t)||(e=MPHB.HotelDataManager.ROOM_STATUS_NOT_AVAILABLE):e=MPHB.HotelDataManager.ROOM_STATUS_NOT_AVAILABLE,e},canCheckIn:function(t){return this.getDateStatus(t)==MPHB.HotelDataManager.ROOM_STATUS_AVAILABLE},isDateBooked:function(e){var a=t.datepick.formatDate("yyyy-mm-dd",e);return this.bookedDates.hasOwnProperty(a)&&this.bookedDates[a]>=this.activeRoomsCount},isDateBookingCheckIn:function(e){var a=t.datepick.formatDate("yyyy-mm-dd",e);return this.checkInDates.hasOwnProperty(a)},isDateBookingCheckOut:function(e){var a=t.datepick.formatDate("yyyy-mm-dd",e);if(!this.checkOutDates.hasOwnProperty(a))return!1;if(this.bookedDates.hasOwnProperty(a)){return this.checkOutDates[a]+this.bookedDates[a]>=this.activeRoomsCount}return this.checkOutDates[a]>=this.activeRoomsCount},hasPriceForDate:function(e){var a=t.datepick.formatDate("yyyy-mm-dd",e);return MPHB.Utils.inArray(a,this.havePriceDates)},getAvailableRoomsCount:function(e){var a=t.datepick.formatDate("yyyy-mm-dd",e),i=this.activeRoomsCount;return this.bookedDates.hasOwnProperty(a)&&(i-=this.bookedDates[a]),this.blockedDates.hasOwnProperty(a)&&(i-=this.blockedDates[a]),i<0&&(i=0),i},fillDateData:function(t,e,a,i){i||(i=e);var n=this.getDateStatus(e),s=[],o=[];switch(n){case MPHB.HotelDataManager.ROOM_STATUS_PAST:o.push("mphb-past-date"),s.push(MPHB._data.translations.past);break;case MPHB.HotelDataManager.ROOM_STATUS_AVAILABLE:o.push("mphb-available-date"),s.push(MPHB._data.translations.available+"("+this.getAvailableRoomsCount(e)+")"),this.isDateBookingCheckOut(e)&&o.push("mphb-date-check-out");break;case MPHB.HotelDataManager.ROOM_STATUS_NOT_AVAILABLE:o.push("mphb-not-available-date"),s.push(MPHB._data.translations.notAvailable);break;case MPHB.HotelDataManager.ROOM_STATUS_BOOKED:o.push("mphb-booked-date"),s.push(MPHB._data.translations.booked),this.isDateBookingCheckIn(e)&&o.push("mphb-date-check-in"),this.isDateBookingCheckOut(e)&&o.push("mphb-date-check-out")}return t.dateClass+=(t.dateClass.length?" ":"")+o.join(" "),t.title+=(t.title.length?", ":"")+s.join(", "),t=MPHB.HotelDataManager.myThis.fillDateCellData(t,e,a,i)},appendRulesToTitle:function(t,e){var a=[];return MPHB.HotelDataManager.myThis.dateRules.canStayIn(t)||a.push(MPHB._data.translations.notStayIn),MPHB.HotelDataManager.myThis.dateRules.canCheckIn(t)||a.push(MPHB._data.translations.notCheckIn),MPHB.HotelDataManager.myThis.dateRules.canCheckOut(t)||a.push(MPHB._data.translations.notCheckOut),a.length&&(e+=" "+MPHB._data.translations.rules+" "+a.join(", ")),e},isEarlierThanToday:function(t){return MPHB.Utils.formatDateToCompare(t)<MPHB.Utils.formatDateToCompare(MPHB.HotelDataManager.myThis.today)}}),MPHB.SearchCheckInDatepicker=MPHB.Datepicker.extend({},{getDatepickSettings:function(){return{onSelect:this.proxy(function(t){this.form.updateCheckOutLimitations()}),onDate:this.proxy(function(t,e){var a={dateClass:"mphb-date-cell",selectable:!1,title:""};if(e){MPHB.HotelDataManager.myThis.reservationRules.isCheckInSatisfy(t,this.roomTypeId)&&MPHB.HotelDataManager.myThis.dateRules.canCheckIn(t)&&(a.selectable=!0),a=MPHB.HotelDataManager.myThis.fillDateCellData(a,t,"checkIn")}else a.dateClass+=" mphb-extra-date";return a.selectable?a.dateClass+=" mphb-selectable-date":a.dateClass+=" mphb-unselectable-date",a}),pickerClass:"mphb-datepick-popup mphb-check-in-datepick "+MPHB._data.settings.datepickerClass}}}),MPHB.SearchCheckOutDatepicker=MPHB.Datepicker.extend({},{getDatepickSettings:function(){return{onDate:this.proxy(function(t,e){var a={dateClass:"mphb-date-cell",selectable:!1,title:""};if(e){var i=this.form.checkInDatepicker.getDate(),n=null!==this.getMinDate()&&MPHB.Utils.formatDateToCompare(t)<MPHB.Utils.formatDateToCompare(this.getMinDate()),s=null!==this.getMaxDate()&&MPHB.Utils.formatDateToCompare(t)>MPHB.Utils.formatDateToCompare(this.getMaxDate());if(null!==i&&MPHB.Utils.formatDateToCompare(t)===MPHB.Utils.formatDateToCompare(i)&&(a.dateClass+=" mphb-check-in-date",a.title+=MPHB._data.translations.checkInDate),n&&(MPHB.Utils.formatDateToCompare(t)<MPHB.Utils.formatDateToCompare(i)?a.dateClass+=" mphb-earlier-min-date mphb-earlier-check-in-date":(a.dateClass+=" mphb-earlier-min-date",a.title+=(a.title.length?" ":"")+MPHB._data.translations.lessThanMinDaysStay)),s){var o=!!i&&MPHB.HotelDataManager.myThis.reservationRules.getMaxCheckOutDate(i,this.roomTypeId);!o||MPHB.Utils.formatDateToCompare(t)<MPHB.Utils.formatDateToCompare(o)?a.title+=(a.title.length?" ":"")+MPHB._data.translations.laterThanMaxDate:a.title+=(a.title.length?" ":"")+MPHB._data.translations.moreThanMaxDaysStay,a.dateClass+=" mphb-later-max-date"}a=MPHB.HotelDataManager.myThis.fillDateCellData(a,t,"checkOut",i);!n&&!s&&MPHB.HotelDataManager.myThis.reservationRules.isCheckOutSatisfy(i,t,this.roomTypeId)&&MPHB.HotelDataManager.myThis.dateRules.canCheckOut(t)&&(a.selectable=!0)}else a.dateClass+=" mphb-extra-date";return a.selectable?a.dateClass+=" mphb-selectable-date":a.dateClass+=" mphb-unselectable-date",a}),pickerClass:"mphb-datepick-popup mphb-check-out-datepick "+MPHB._data.settings.datepickerClass}}}),MPHB.SearchForm=can.Control.extend({},{checkInDatepickerEl:null,checkOutDatepickerEl:null,checkInDatepicker:null,checkOutDatepicker:null,init:function(t,e){this.checkInDatepickerEl=this.element.find('.mphb-datepick[id^="mphb_check_in_date"]'),this.checkOutDatepickerEl=this.element.find('.mphb-datepick[id^="mphb_check_out_date"]'),this.checkInDatepicker=new MPHB.SearchCheckInDatepicker(this.checkInDatepickerEl,{form:this}),this.checkOutDatepicker=new MPHB.SearchCheckOutDatepicker(this.checkOutDatepickerEl,{form:this}),this.checkInDatepicker.getDate()&&this.updateCheckOutLimitations()},updateCheckOutLimitations:function(t){void 0===t&&(t=!0);var e=this.retrieveCheckOutLimitations(this.checkInDatepicker.getDate(),this.checkOutDatepicker.getDate());this.checkOutDatepicker.setOption("minDate",e.minDate),this.checkOutDatepicker.setOption("maxDate",e.maxDate),this.checkOutDatepicker.setDate(t?e.date:null)},retrieveCheckOutLimitations:function(t,e){var a=MPHB.HotelDataManager.myThis.today,i=null,n=null;if(null!==t){var a=MPHB.HotelDataManager.myThis.reservationRules.getMinCheckOutDate(t),i=MPHB.HotelDataManager.myThis.reservationRules.getMaxCheckOutDate(t);i=MPHB.HotelDataManager.myThis.dateRules.getNearestNotStayInDate(t,i),n=this.isCheckOutDateNotValid(t,e,a,i)?this.retrieveRecommendedCheckOutDate(t,a,i):e}return{minDate:a,maxDate:i,date:n}},retrieveRecommendedCheckOutDate:function(e,a,i){for(var n=null,s=MPHB.Utils.cloneDate(a);MPHB.Utils.formatDateToCompare(s)<=MPHB.Utils.formatDateToCompare(i);){if(!this.isCheckOutDateNotValid(e,s,a,i)){n=s;break}s=t.datepick.add(s,1,"d")}return n},isCheckOutDateNotValid:function(t,e,a,i){return null===e||MPHB.Utils.formatDateToCompare(e)<MPHB.Utils.formatDateToCompare(a)||MPHB.Utils.formatDateToCompare(e)>MPHB.Utils.formatDateToCompare(i)||!MPHB.HotelDataManager.myThis.reservationRules.isCheckOutSatisfy(t,e)||!MPHB.HotelDataManager.myThis.dateRules.canCheckOut(e)}}),MPHB.RoomBookSection=can.Control.extend({},{roomTypeId:null,roomTitle:"",roomPrice:0,quantitySelect:null,bookButton:null,confirmButton:null,removeButton:null,messageHolder:null,messageWrapper:null,form:null,init:function(t,e){this.reservationCart=e.reservationCart,this.roomTypeId=parseInt(t.attr("data-room-type-id")),this.roomTitle=t.attr("data-room-type-title"),this.roomPrice=parseFloat(t.attr("data-room-price")),this.confirmButton=t.find(".mphb-confirm-reservation"),this.quantitySelect=t.find(".mphb-rooms-quantity"),this.messageWrapper=t.find(".mphb-rooms-reservation-message-wrapper"),this.messageHolder=t.find(".mphb-rooms-reservation-message")},getRoomTypeId:function(){return this.roomTypeId},getPrice:function(){return this.roomPrice},".mphb-book-button click":function(t,e){e.preventDefault(),e.stopPropagation();var a=parseInt(this.quantitySelect.val());this.reservationCart.addToCart(this.roomTypeId,a);var i=1==a?MPHB._data.translations.roomsAddedToReservation_singular:MPHB._data.translations.roomsAddedToReservation_plural,n=i.replace("%1$d",a).replace("%2$s",this.roomTitle);this.messageHolder.html(n),this.element.addClass("mphb-rooms-added")},".mphb-remove-from-reservation click":function(t,e){e.preventDefault(),e.stopPropagation(),this.reservationCart.removeFromCart(this.roomTypeId),this.messageHolder.empty(),this.element.removeClass("mphb-rooms-added")},".mphb-confirm-reservation click":function(t,e){e.preventDefault(),e.stopPropagation(),this.reservationCart.confirmReservation()}}),MPHB.ReservationCart=can.Control.extend({},{cartForm:null,cartDetails:null,roomBookSections:{},cartContents:{},init:function(t,e){this.cartForm=t.find("#mphb-reservation-cart"),this.cartDetails=t.find(".mphb-reservation-details"),this.initRoomBookSections(t.find(".mphb-reserve-room-section"))},initRoomBookSections:function(e){var a,i=this;t.each(e,function(e,n){a=new MPHB.RoomBookSection(t(n),{reservationCart:i}),i.roomBookSections[a.getRoomTypeId()]=a})},addToCart:function(t,e){this.cartContents[t]=e,this.updateCartView(),this.updateCartInputs()},removeFromCart:function(t){delete this.cartContents[t],this.updateCartView(),this.updateCartInputs()},calcRoomsInCart:function(){var e=0;return t.each(this.cartContents,function(t,a){e+=a}),e},calcTotalPrice:function(){var e=0,a=0,i=this;return t.each(this.cartContents,function(t,n){a=i.roomBookSections[t].getPrice(),e+=a*n}),e},updateCartView:function(){if(t.isEmptyObject(this.cartContents))this.cartForm.addClass("mphb-empty-cart");else{var e=this.calcRoomsInCart(),a=1==e?MPHB._data.translations.countRoomsSelected_singular:MPHB._data.translations.countRoomsSelected_plural,i=a.replace("%s",e);this.cartDetails.find(".mphb-cart-message").html(i);var n=this.calcTotalPrice(),s=MPHB.format_price(n,{trim_zeros:!0});this.cartDetails.find(".mphb-cart-total-price>.mphb-cart-total-price-value").html(s),this.cartForm.removeClass("mphb-empty-cart")}},updateCartInputs:function(){this.cartForm.find('[name^="mphb_rooms_details"]').remove();var e=this;t.each(this.cartContents,function(a,i){var n=t("<input />",{name:"mphb_rooms_details["+a+"]",type:"hidden",value:i});e.cartForm.prepend(n)})},confirmReservation:function(){this.cartForm.submit()}}),new MPHB.HotelDataManager(MPHB._data),MPHB._data.page.isCheckoutPage?new MPHB.CheckoutForm(t(".mphb_sc_checkout-form")):MPHB._data.page.isCreateBookingPage&&new MPHB.CheckoutForm(t(".mphb_cb_checkout_form")),MPHB._data.page.isSearchResultsPage&&new MPHB.ReservationCart(t(".mphb_sc_search_results-wrapper"));var e=t(".mphb-calendar.mphb-datepick");t.each(e,function(e,a){new MPHB.RoomTypeCalendar(t(a))});var a=t(".mphb-booking-form");t.each(a,function(e,a){new MPHB.ReservationForm(t(a))});var i=t("form.mphb_sc_search-form, form.mphb_widget_search-form, form.mphb_cb_search_form");t.each(i,function(e,a){new MPHB.SearchForm(t(a))});var n=t(".mphb-flexslider-gallery-wrapper");t.each(n,function(t,e){new MPHB.FlexsliderGallery(e)});var s=t(".mphb-checkout-terms-wrapper");s.length>0&&new MPHB.TermsSwitcher(s),void 0==t.ui&&(t.ui={}),void 0==t.ui.version&&(t.ui.version="1.5-")})}(jQuery);
!function(t,e){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("jquery")):t.jQueryBridget=e(t,t.jQuery)}(window,function(t,e){"use strict";function i(i,o,a){function l(t,e,n){var s,o="$()."+i+'("'+e+'")';return t.each(function(t,l){var h=a.data(l,i);if(!h)return void r(i+" not initialized. Cannot call methods, i.e. "+o);var c=h[e];if(!c||"_"==e.charAt(0))return void r(o+" is not a valid method");var d=c.apply(h,n);s=void 0===s?d:s}),void 0!==s?s:t}function h(t,e){t.each(function(t,n){var s=a.data(n,i);s?(s.option(e),s._init()):(s=new o(n,e),a.data(n,i,s))})}a=a||e||t.jQuery,a&&(o.prototype.option||(o.prototype.option=function(t){a.isPlainObject(t)&&(this.options=a.extend(!0,this.options,t))}),a.fn[i]=function(t){if("string"==typeof t){var e=s.call(arguments,1);return l(this,t,e)}return h(this,t),this},n(a))}function n(t){!t||t&&t.bridget||(t.bridget=i)}var s=Array.prototype.slice,o=t.console,r="undefined"==typeof o?function(){}:function(t){o.error(t)};return n(e||t.jQuery),i}),function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return n.indexOf(e)==-1&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},n=i[t]=i[t]||{};return n[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=i.indexOf(e);return n!=-1&&i.splice(n,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){i=i.slice(0),e=e||[];for(var n=this._onceEvents&&this._onceEvents[t],s=0;s<i.length;s++){var o=i[s],r=n&&n[o];r&&(this.off(t,o),delete n[o]),o.apply(this,e)}return this}},e.allOff=function(){delete this._events,delete this._onceEvents},t}),function(t,e){"function"==typeof define&&define.amd?define("get-size/get-size",e):"object"==typeof module&&module.exports?module.exports=e():t.getSize=e()}(window,function(){"use strict";function t(t){var e=parseFloat(t),i=t.indexOf("%")==-1&&!isNaN(e);return i&&e}function e(){}function i(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0;e<h;e++){var i=l[e];t[i]=0}return t}function n(t){var e=getComputedStyle(t);return e||a("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),e}function s(){if(!c){c=!0;var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style.boxSizing="border-box";var i=document.body||document.documentElement;i.appendChild(e);var s=n(e);r=200==Math.round(t(s.width)),o.isBoxSizeOuter=r,i.removeChild(e)}}function o(e){if(s(),"string"==typeof e&&(e=document.querySelector(e)),e&&"object"==typeof e&&e.nodeType){var o=n(e);if("none"==o.display)return i();var a={};a.width=e.offsetWidth,a.height=e.offsetHeight;for(var c=a.isBorderBox="border-box"==o.boxSizing,d=0;d<h;d++){var u=l[d],f=o[u],p=parseFloat(f);a[u]=isNaN(p)?0:p}var g=a.paddingLeft+a.paddingRight,v=a.paddingTop+a.paddingBottom,m=a.marginLeft+a.marginRight,y=a.marginTop+a.marginBottom,b=a.borderLeftWidth+a.borderRightWidth,E=a.borderTopWidth+a.borderBottomWidth,S=c&&r,C=t(o.width);C!==!1&&(a.width=C+(S?0:g+b));var x=t(o.height);return x!==!1&&(a.height=x+(S?0:v+E)),a.innerWidth=a.width-(g+b),a.innerHeight=a.height-(v+E),a.outerWidth=a.width+m,a.outerHeight=a.height+y,a}}var r,a="undefined"==typeof console?e:function(t){console.error(t)},l=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],h=l.length,c=!1;return o}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("desandro-matches-selector/matches-selector",e):"object"==typeof module&&module.exports?module.exports=e():t.matchesSelector=e()}(window,function(){"use strict";var t=function(){var t=window.Element.prototype;if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],i=0;i<e.length;i++){var n=e[i],s=n+"MatchesSelector";if(t[s])return s}}();return function(e,i){return e[t](i)}}),function(t,e){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["desandro-matches-selector/matches-selector"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("desandro-matches-selector")):t.fizzyUIUtils=e(t,t.matchesSelector)}(window,function(t,e){var i={};i.extend=function(t,e){for(var i in e)t[i]=e[i];return t},i.modulo=function(t,e){return(t%e+e)%e};var n=Array.prototype.slice;i.makeArray=function(t){if(Array.isArray(t))return t;if(null===t||void 0===t)return[];var e="object"==typeof t&&"number"==typeof t.length;return e?n.call(t):[t]},i.removeFrom=function(t,e){var i=t.indexOf(e);i!=-1&&t.splice(i,1)},i.getParent=function(t,i){for(;t.parentNode&&t!=document.body;)if(t=t.parentNode,e(t,i))return t},i.getQueryElement=function(t){return"string"==typeof t?document.querySelector(t):t},i.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},i.filterFindElements=function(t,n){t=i.makeArray(t);var s=[];return t.forEach(function(t){if(t instanceof HTMLElement){if(!n)return void s.push(t);e(t,n)&&s.push(t);for(var i=t.querySelectorAll(n),o=0;o<i.length;o++)s.push(i[o])}}),s},i.debounceMethod=function(t,e,i){i=i||100;var n=t.prototype[e],s=e+"Timeout";t.prototype[e]=function(){var t=this[s];clearTimeout(t);var e=arguments,o=this;this[s]=setTimeout(function(){n.apply(o,e),delete o[s]},i)}},i.docReady=function(t){var e=document.readyState;"complete"==e||"interactive"==e?setTimeout(t):document.addEventListener("DOMContentLoaded",t)},i.toDashed=function(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()};var s=t.console;return i.htmlInit=function(e,n){i.docReady(function(){var o=i.toDashed(n),r="data-"+o,a=document.querySelectorAll("["+r+"]"),l=document.querySelectorAll(".js-"+o),h=i.makeArray(a).concat(i.makeArray(l)),c=r+"-options",d=t.jQuery;h.forEach(function(t){var i,o=t.getAttribute(r)||t.getAttribute(c);try{i=o&&JSON.parse(o)}catch(a){return void(s&&s.error("Error parsing "+r+" on "+t.className+": "+a))}var l=new e(t,i);d&&d.data(t,n,l)})})},i}),function(t,e){"function"==typeof define&&define.amd?define("flickity/js/cell",["get-size/get-size"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("get-size")):(t.Flickity=t.Flickity||{},t.Flickity.Cell=e(t,t.getSize))}(window,function(t,e){function i(t,e){this.element=t,this.parent=e,this.create()}var n=i.prototype;return n.create=function(){this.element.style.position="absolute",this.element.setAttribute("aria-selected","false"),this.x=0,this.shift=0},n.destroy=function(){this.element.style.position="";var t=this.parent.originSide;this.element.removeAttribute("aria-selected"),this.element.style[t]=""},n.getSize=function(){this.size=e(this.element)},n.setPosition=function(t){this.x=t,this.updateTarget(),this.renderPosition(t)},n.updateTarget=n.setDefaultTarget=function(){var t="left"==this.parent.originSide?"marginLeft":"marginRight";this.target=this.x+this.size[t]+this.size.width*this.parent.cellAlign},n.renderPosition=function(t){var e=this.parent.originSide;this.element.style[e]=this.parent.getPositionValue(t)},n.wrapShift=function(t){this.shift=t,this.renderPosition(this.x+this.parent.slideableWidth*t)},n.remove=function(){this.element.parentNode.removeChild(this.element)},i}),function(t,e){"function"==typeof define&&define.amd?define("flickity/js/slide",e):"object"==typeof module&&module.exports?module.exports=e():(t.Flickity=t.Flickity||{},t.Flickity.Slide=e())}(window,function(){"use strict";function t(t){this.parent=t,this.isOriginLeft="left"==t.originSide,this.cells=[],this.outerWidth=0,this.height=0}var e=t.prototype;return e.addCell=function(t){if(this.cells.push(t),this.outerWidth+=t.size.outerWidth,this.height=Math.max(t.size.outerHeight,this.height),1==this.cells.length){this.x=t.x;var e=this.isOriginLeft?"marginLeft":"marginRight";this.firstMargin=t.size[e]}},e.updateTarget=function(){var t=this.isOriginLeft?"marginRight":"marginLeft",e=this.getLastCell(),i=e?e.size[t]:0,n=this.outerWidth-(this.firstMargin+i);this.target=this.x+this.firstMargin+n*this.parent.cellAlign},e.getLastCell=function(){return this.cells[this.cells.length-1]},e.select=function(){this.changeSelected(!0)},e.unselect=function(){this.changeSelected(!1)},e.changeSelected=function(t){var e=t?"add":"remove";this.cells.forEach(function(i){i.element.classList[e]("is-selected"),i.element.setAttribute("aria-selected",t.toString())})},e.getCellElements=function(){return this.cells.map(function(t){return t.element})},t}),function(t,e){"function"==typeof define&&define.amd?define("flickity/js/animate",["fizzy-ui-utils/utils"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("fizzy-ui-utils")):(t.Flickity=t.Flickity||{},t.Flickity.animatePrototype=e(t,t.fizzyUIUtils))}(window,function(t,e){var i={};return i.startAnimation=function(){this.isAnimating||(this.isAnimating=!0,this.restingFrames=0,this.animate())},i.animate=function(){this.applyDragForce(),this.applySelectedAttraction();var t=this.x;if(this.integratePhysics(),this.positionSlider(),this.settle(t),this.isAnimating){var e=this;requestAnimationFrame(function(){e.animate()})}},i.positionSlider=function(){var t=this.x;this.options.wrapAround&&this.cells.length>1&&(t=e.modulo(t,this.slideableWidth),t-=this.slideableWidth,this.shiftWrapCells(t)),t+=this.cursorPosition,t=this.options.rightToLeft?-t:t;var i=this.getPositionValue(t);this.slider.style.transform=this.isAnimating?"translate3d("+i+",0,0)":"translateX("+i+")";var n=this.slides[0];if(n){var s=-this.x-n.target,o=s/this.slidesWidth;this.dispatchEvent("scroll",null,[o,s])}},i.positionSliderAtSelected=function(){this.cells.length&&(this.x=-this.selectedSlide.target,this.velocity=0,this.positionSlider())},i.getPositionValue=function(t){return this.options.percentPosition?.01*Math.round(t/this.size.innerWidth*1e4)+"%":Math.round(t)+"px"},i.settle=function(t){this.isPointerDown||Math.round(100*this.x)!=Math.round(100*t)||this.restingFrames++,this.restingFrames>2&&(this.isAnimating=!1,delete this.isFreeScrolling,this.positionSlider(),this.dispatchEvent("settle",null,[this.selectedIndex]))},i.shiftWrapCells=function(t){var e=this.cursorPosition+t;this._shiftCells(this.beforeShiftCells,e,-1);var i=this.size.innerWidth-(t+this.slideableWidth+this.cursorPosition);this._shiftCells(this.afterShiftCells,i,1)},i._shiftCells=function(t,e,i){for(var n=0;n<t.length;n++){var s=t[n],o=e>0?i:0;s.wrapShift(o),e-=s.size.outerWidth}},i._unshiftCells=function(t){if(t&&t.length)for(var e=0;e<t.length;e++)t[e].wrapShift(0)},i.integratePhysics=function(){this.x+=this.velocity,this.velocity*=this.getFrictionFactor()},i.applyForce=function(t){this.velocity+=t},i.getFrictionFactor=function(){return 1-this.options[this.isFreeScrolling?"freeScrollFriction":"friction"]},i.getRestingPosition=function(){return this.x+this.velocity/(1-this.getFrictionFactor())},i.applyDragForce=function(){if(this.isDraggable&&this.isPointerDown){var t=this.dragX-this.x,e=t-this.velocity;this.applyForce(e)}},i.applySelectedAttraction=function(){var t=this.isDraggable&&this.isPointerDown;if(!t&&!this.isFreeScrolling&&this.slides.length){var e=this.selectedSlide.target*-1-this.x,i=e*this.options.selectedAttraction;this.applyForce(i)}},i}),function(t,e){if("function"==typeof define&&define.amd)define("flickity/js/flickity",["ev-emitter/ev-emitter","get-size/get-size","fizzy-ui-utils/utils","./cell","./slide","./animate"],function(i,n,s,o,r,a){return e(t,i,n,s,o,r,a)});else if("object"==typeof module&&module.exports)module.exports=e(t,require("ev-emitter"),require("get-size"),require("fizzy-ui-utils"),require("./cell"),require("./slide"),require("./animate"));else{var i=t.Flickity;t.Flickity=e(t,t.EvEmitter,t.getSize,t.fizzyUIUtils,i.Cell,i.Slide,i.animatePrototype)}}(window,function(t,e,i,n,s,o,r){function a(t,e){for(t=n.makeArray(t);t.length;)e.appendChild(t.shift())}function l(t,e){var i=n.getQueryElement(t);if(!i)return void(d&&d.error("Bad element for Flickity: "+(i||t)));if(this.element=i,this.element.flickityGUID){var s=f[this.element.flickityGUID];return s.option(e),s}h&&(this.$element=h(this.element)),this.options=n.extend({},this.constructor.defaults),this.option(e),this._create()}var h=t.jQuery,c=t.getComputedStyle,d=t.console,u=0,f={};l.defaults={accessibility:!0,cellAlign:"center",freeScrollFriction:.075,friction:.28,namespaceJQueryEvents:!0,percentPosition:!0,resize:!0,selectedAttraction:.025,setGallerySize:!0},l.createMethods=[];var p=l.prototype;n.extend(p,e.prototype),p._create=function(){var e=this.guid=++u;this.element.flickityGUID=e,f[e]=this,this.selectedIndex=0,this.restingFrames=0,this.x=0,this.velocity=0,this.originSide=this.options.rightToLeft?"right":"left",this.viewport=document.createElement("div"),this.viewport.className="flickity-viewport",this._createSlider(),(this.options.resize||this.options.watchCSS)&&t.addEventListener("resize",this);for(var i in this.options.on){var n=this.options.on[i];this.on(i,n)}l.createMethods.forEach(function(t){this[t]()},this),this.options.watchCSS?this.watchCSS():this.activate()},p.option=function(t){n.extend(this.options,t)},p.activate=function(){if(!this.isActive){this.isActive=!0,this.element.classList.add("flickity-enabled"),this.options.rightToLeft&&this.element.classList.add("flickity-rtl"),this.getSize();var t=this._filterFindCellElements(this.element.children);a(t,this.slider),this.viewport.appendChild(this.slider),this.element.appendChild(this.viewport),this.reloadCells(),this.options.accessibility&&(this.element.tabIndex=0,this.element.addEventListener("keydown",this)),this.emitEvent("activate");var e,i=this.options.initialIndex;e=this.isInitActivated?this.selectedIndex:void 0!==i&&this.cells[i]?i:0,this.select(e,!1,!0),this.isInitActivated=!0,this.dispatchEvent("ready")}},p._createSlider=function(){var t=document.createElement("div");t.className="flickity-slider",t.style[this.originSide]=0,this.slider=t},p._filterFindCellElements=function(t){return n.filterFindElements(t,this.options.cellSelector)},p.reloadCells=function(){this.cells=this._makeCells(this.slider.children),this.positionCells(),this._getWrapShiftCells(),this.setGallerySize()},p._makeCells=function(t){var e=this._filterFindCellElements(t),i=e.map(function(t){return new s(t,this)},this);return i},p.getLastCell=function(){return this.cells[this.cells.length-1]},p.getLastSlide=function(){return this.slides[this.slides.length-1]},p.positionCells=function(){this._sizeCells(this.cells),this._positionCells(0)},p._positionCells=function(t){t=t||0,this.maxCellHeight=t?this.maxCellHeight||0:0;var e=0;if(t>0){var i=this.cells[t-1];e=i.x+i.size.outerWidth}for(var n=this.cells.length,s=t;s<n;s++){var o=this.cells[s];o.setPosition(e),e+=o.size.outerWidth,this.maxCellHeight=Math.max(o.size.outerHeight,this.maxCellHeight)}this.slideableWidth=e,this.updateSlides(),this._containSlides(),this.slidesWidth=n?this.getLastSlide().target-this.slides[0].target:0},p._sizeCells=function(t){t.forEach(function(t){t.getSize()})},p.updateSlides=function(){if(this.slides=[],this.cells.length){var t=new o(this);this.slides.push(t);var e="left"==this.originSide,i=e?"marginRight":"marginLeft",n=this._getCanCellFit();this.cells.forEach(function(e,s){if(!t.cells.length)return void t.addCell(e);var r=t.outerWidth-t.firstMargin+(e.size.outerWidth-e.size[i]);n.call(this,s,r)?t.addCell(e):(t.updateTarget(),t=new o(this),this.slides.push(t),t.addCell(e))},this),t.updateTarget(),this.updateSelectedSlide()}},p._getCanCellFit=function(){var t=this.options.groupCells;if(!t)return function(){return!1};if("number"==typeof t){var e=parseInt(t,10);return function(t){return t%e!==0}}var i="string"==typeof t&&t.match(/^(\d+)%$/),n=i?parseInt(i[1],10)/100:1;return function(t,e){return e<=(this.size.innerWidth+1)*n}},p._init=p.reposition=function(){this.positionCells(),this.positionSliderAtSelected()},p.getSize=function(){this.size=i(this.element),this.setCellAlign(),this.cursorPosition=this.size.innerWidth*this.cellAlign};var g={center:{left:.5,right:.5},left:{left:0,right:1},right:{right:0,left:1}};return p.setCellAlign=function(){var t=g[this.options.cellAlign];this.cellAlign=t?t[this.originSide]:this.options.cellAlign},p.setGallerySize=function(){if(this.options.setGallerySize){var t=this.options.adaptiveHeight&&this.selectedSlide?this.selectedSlide.height:this.maxCellHeight;this.viewport.style.height=t+"px"}},p._getWrapShiftCells=function(){if(this.options.wrapAround){this._unshiftCells(this.beforeShiftCells),this._unshiftCells(this.afterShiftCells);var t=this.cursorPosition,e=this.cells.length-1;this.beforeShiftCells=this._getGapCells(t,e,-1),t=this.size.innerWidth-this.cursorPosition,this.afterShiftCells=this._getGapCells(t,0,1)}},p._getGapCells=function(t,e,i){for(var n=[];t>0;){var s=this.cells[e];if(!s)break;n.push(s),e+=i,t-=s.size.outerWidth}return n},p._containSlides=function(){if(this.options.contain&&!this.options.wrapAround&&this.cells.length){var t=this.options.rightToLeft,e=t?"marginRight":"marginLeft",i=t?"marginLeft":"marginRight",n=this.slideableWidth-this.getLastCell().size[i],s=n<this.size.innerWidth,o=this.cursorPosition+this.cells[0].size[e],r=n-this.size.innerWidth*(1-this.cellAlign);this.slides.forEach(function(t){s?t.target=n*this.cellAlign:(t.target=Math.max(t.target,o),t.target=Math.min(t.target,r))},this)}},p.dispatchEvent=function(t,e,i){var n=e?[e].concat(i):i;if(this.emitEvent(t,n),h&&this.$element){t+=this.options.namespaceJQueryEvents?".flickity":"";var s=t;if(e){var o=h.Event(e);o.type=t,s=o}this.$element.trigger(s,i)}},p.select=function(t,e,i){if(this.isActive&&(t=parseInt(t,10),this._wrapSelect(t),(this.options.wrapAround||e)&&(t=n.modulo(t,this.slides.length)),this.slides[t])){var s=this.selectedIndex;this.selectedIndex=t,this.updateSelectedSlide(),i?this.positionSliderAtSelected():this.startAnimation(),this.options.adaptiveHeight&&this.setGallerySize(),this.dispatchEvent("select",null,[t]),t!=s&&this.dispatchEvent("change",null,[t]),this.dispatchEvent("cellSelect")}},p._wrapSelect=function(t){var e=this.slides.length,i=this.options.wrapAround&&e>1;if(!i)return t;var s=n.modulo(t,e),o=Math.abs(s-this.selectedIndex),r=Math.abs(s+e-this.selectedIndex),a=Math.abs(s-e-this.selectedIndex);!this.isDragSelect&&r<o?t+=e:!this.isDragSelect&&a<o&&(t-=e),t<0?this.x-=this.slideableWidth:t>=e&&(this.x+=this.slideableWidth)},p.previous=function(t,e){this.select(this.selectedIndex-1,t,e)},p.next=function(t,e){this.select(this.selectedIndex+1,t,e)},p.updateSelectedSlide=function(){var t=this.slides[this.selectedIndex];t&&(this.unselectSelectedSlide(),this.selectedSlide=t,t.select(),this.selectedCells=t.cells,this.selectedElements=t.getCellElements(),this.selectedCell=t.cells[0],this.selectedElement=this.selectedElements[0])},p.unselectSelectedSlide=function(){this.selectedSlide&&this.selectedSlide.unselect()},p.selectCell=function(t,e,i){var n=this.queryCell(t);if(n){var s=this.getCellSlideIndex(n);this.select(s,e,i)}},p.getCellSlideIndex=function(t){for(var e=0;e<this.slides.length;e++){var i=this.slides[e],n=i.cells.indexOf(t);if(n!=-1)return e}},p.getCell=function(t){for(var e=0;e<this.cells.length;e++){var i=this.cells[e];if(i.element==t)return i}},p.getCells=function(t){t=n.makeArray(t);var e=[];return t.forEach(function(t){var i=this.getCell(t);i&&e.push(i)},this),e},p.getCellElements=function(){return this.cells.map(function(t){return t.element})},p.getParentCell=function(t){var e=this.getCell(t);return e?e:(t=n.getParent(t,".flickity-slider > *"),this.getCell(t))},p.getAdjacentCellElements=function(t,e){if(!t)return this.selectedSlide.getCellElements();e=void 0===e?this.selectedIndex:e;var i=this.slides.length;if(1+2*t>=i)return this.getCellElements();for(var s=[],o=e-t;o<=e+t;o++){var r=this.options.wrapAround?n.modulo(o,i):o,a=this.slides[r];a&&(s=s.concat(a.getCellElements()))}return s},p.queryCell=function(t){return"number"==typeof t?this.cells[t]:("string"==typeof t&&(t=this.element.querySelector(t)),this.getCell(t))},p.uiChange=function(){this.emitEvent("uiChange")},p.childUIPointerDown=function(t){this.emitEvent("childUIPointerDown",[t])},p.onresize=function(){this.watchCSS(),this.resize()},n.debounceMethod(l,"onresize",150),p.resize=function(){if(this.isActive){this.getSize(),this.options.wrapAround&&(this.x=n.modulo(this.x,this.slideableWidth)),this.positionCells(),this._getWrapShiftCells(),this.setGallerySize(),this.emitEvent("resize");var t=this.selectedElements&&this.selectedElements[0];this.selectCell(t,!1,!0)}},p.watchCSS=function(){var t=this.options.watchCSS;if(t){var e=c(this.element,":after").content;e.indexOf("flickity")!=-1?this.activate():this.deactivate()}},p.onkeydown=function(t){var e=document.activeElement&&document.activeElement!=this.element;if(this.options.accessibility&&!e){var i=l.keyboardHandlers[t.keyCode];i&&i.call(this)}},l.keyboardHandlers={37:function(){var t=this.options.rightToLeft?"next":"previous";this.uiChange(),this[t]()},39:function(){var t=this.options.rightToLeft?"previous":"next";this.uiChange(),this[t]()}},p.focus=function(){var e=t.pageYOffset;this.element.focus({preventScroll:!0}),t.pageYOffset!=e&&t.scrollTo(t.pageXOffset,e)},p.deactivate=function(){this.isActive&&(this.element.classList.remove("flickity-enabled"),this.element.classList.remove("flickity-rtl"),this.unselectSelectedSlide(),this.cells.forEach(function(t){t.destroy()}),this.element.removeChild(this.viewport),a(this.slider.children,this.element),this.options.accessibility&&(this.element.removeAttribute("tabIndex"),this.element.removeEventListener("keydown",this)),this.isActive=!1,this.emitEvent("deactivate"))},p.destroy=function(){this.deactivate(),t.removeEventListener("resize",this),this.emitEvent("destroy"),h&&this.$element&&h.removeData(this.element,"flickity"),delete this.element.flickityGUID,delete f[this.guid]},n.extend(p,r),l.data=function(t){t=n.getQueryElement(t);var e=t&&t.flickityGUID;return e&&f[e]},n.htmlInit(l,"flickity"),h&&h.bridget&&h.bridget("flickity",l),l.setJQuery=function(t){h=t},l.Cell=s,l}),function(t,e){"function"==typeof define&&define.amd?define("unipointer/unipointer",["ev-emitter/ev-emitter"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter")):t.Unipointer=e(t,t.EvEmitter)}(window,function(t,e){function i(){}function n(){}var s=n.prototype=Object.create(e.prototype);s.bindStartEvent=function(t){this._bindStartEvent(t,!0)},s.unbindStartEvent=function(t){this._bindStartEvent(t,!1)},s._bindStartEvent=function(e,i){i=void 0===i||i;var n=i?"addEventListener":"removeEventListener",s="mousedown";t.PointerEvent?s="pointerdown":"ontouchstart"in t&&(s="touchstart"),e[n](s,this)},s.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},s.getTouch=function(t){for(var e=0;e<t.length;e++){var i=t[e];if(i.identifier==this.pointerIdentifier)return i}},s.onmousedown=function(t){var e=t.button;e&&0!==e&&1!==e||this._pointerDown(t,t)},s.ontouchstart=function(t){this._pointerDown(t,t.changedTouches[0])},s.onpointerdown=function(t){this._pointerDown(t,t)},s._pointerDown=function(t,e){t.button||this.isPointerDown||(this.isPointerDown=!0,this.pointerIdentifier=void 0!==e.pointerId?e.pointerId:e.identifier,this.pointerDown(t,e))},s.pointerDown=function(t,e){this._bindPostStartEvents(t),this.emitEvent("pointerDown",[t,e])};var o={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]};return s._bindPostStartEvents=function(e){if(e){var i=o[e.type];i.forEach(function(e){t.addEventListener(e,this)},this),this._boundPointerEvents=i}},s._unbindPostStartEvents=function(){this._boundPointerEvents&&(this._boundPointerEvents.forEach(function(e){t.removeEventListener(e,this)},this),delete this._boundPointerEvents)},s.onmousemove=function(t){this._pointerMove(t,t)},s.onpointermove=function(t){t.pointerId==this.pointerIdentifier&&this._pointerMove(t,t)},s.ontouchmove=function(t){var e=this.getTouch(t.changedTouches);e&&this._pointerMove(t,e)},s._pointerMove=function(t,e){this.pointerMove(t,e)},s.pointerMove=function(t,e){this.emitEvent("pointerMove",[t,e])},s.onmouseup=function(t){this._pointerUp(t,t)},s.onpointerup=function(t){t.pointerId==this.pointerIdentifier&&this._pointerUp(t,t)},s.ontouchend=function(t){var e=this.getTouch(t.changedTouches);e&&this._pointerUp(t,e)},s._pointerUp=function(t,e){this._pointerDone(),this.pointerUp(t,e)},s.pointerUp=function(t,e){this.emitEvent("pointerUp",[t,e])},s._pointerDone=function(){this._pointerReset(),this._unbindPostStartEvents(),this.pointerDone()},s._pointerReset=function(){this.isPointerDown=!1,delete this.pointerIdentifier},s.pointerDone=i,s.onpointercancel=function(t){t.pointerId==this.pointerIdentifier&&this._pointerCancel(t,t)},s.ontouchcancel=function(t){var e=this.getTouch(t.changedTouches);e&&this._pointerCancel(t,e)},s._pointerCancel=function(t,e){this._pointerDone(),this.pointerCancel(t,e)},s.pointerCancel=function(t,e){this.emitEvent("pointerCancel",[t,e])},n.getPointerPoint=function(t){return{x:t.pageX,y:t.pageY}},n}),function(t,e){"function"==typeof define&&define.amd?define("unidragger/unidragger",["unipointer/unipointer"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("unipointer")):t.Unidragger=e(t,t.Unipointer)}(window,function(t,e){function i(){}var n=i.prototype=Object.create(e.prototype);n.bindHandles=function(){this._bindHandles(!0)},n.unbindHandles=function(){this._bindHandles(!1)},n._bindHandles=function(e){e=void 0===e||e;for(var i=e?"addEventListener":"removeEventListener",n=e?this._touchActionValue:"",s=0;s<this.handles.length;s++){var o=this.handles[s];this._bindStartEvent(o,e),o[i]("click",this),t.PointerEvent&&(o.style.touchAction=n)}},n._touchActionValue="none",n.pointerDown=function(t,e){var i=this.okayPointerDown(t);i&&(this.pointerDownPointer=e,t.preventDefault(),this.pointerDownBlur(),this._bindPostStartEvents(t),this.emitEvent("pointerDown",[t,e]))};var s={TEXTAREA:!0,INPUT:!0,SELECT:!0,OPTION:!0},o={radio:!0,checkbox:!0,button:!0,submit:!0,image:!0,file:!0};return n.okayPointerDown=function(t){var e=s[t.target.nodeName],i=o[t.target.type],n=!e||i;return n||this._pointerReset(),n},n.pointerDownBlur=function(){var t=document.activeElement,e=t&&t.blur&&t!=document.body;e&&t.blur()},n.pointerMove=function(t,e){var i=this._dragPointerMove(t,e);this.emitEvent("pointerMove",[t,e,i]),this._dragMove(t,e,i)},n._dragPointerMove=function(t,e){var i={x:e.pageX-this.pointerDownPointer.pageX,y:e.pageY-this.pointerDownPointer.pageY};return!this.isDragging&&this.hasDragStarted(i)&&this._dragStart(t,e),i},n.hasDragStarted=function(t){return Math.abs(t.x)>3||Math.abs(t.y)>3},n.pointerUp=function(t,e){this.emitEvent("pointerUp",[t,e]),this._dragPointerUp(t,e)},n._dragPointerUp=function(t,e){this.isDragging?this._dragEnd(t,e):this._staticClick(t,e)},n._dragStart=function(t,e){this.isDragging=!0,this.isPreventingClicks=!0,this.dragStart(t,e)},n.dragStart=function(t,e){this.emitEvent("dragStart",[t,e])},n._dragMove=function(t,e,i){this.isDragging&&this.dragMove(t,e,i)},n.dragMove=function(t,e,i){t.preventDefault(),this.emitEvent("dragMove",[t,e,i])},n._dragEnd=function(t,e){this.isDragging=!1,setTimeout(function(){delete this.isPreventingClicks}.bind(this)),this.dragEnd(t,e)},n.dragEnd=function(t,e){this.emitEvent("dragEnd",[t,e])},n.onclick=function(t){this.isPreventingClicks&&t.preventDefault()},n._staticClick=function(t,e){this.isIgnoringMouseUp&&"mouseup"==t.type||(this.staticClick(t,e),"mouseup"!=t.type&&(this.isIgnoringMouseUp=!0,setTimeout(function(){delete this.isIgnoringMouseUp}.bind(this),400)))},n.staticClick=function(t,e){this.emitEvent("staticClick",[t,e])},i.getPointerPoint=e.getPointerPoint,i}),function(t,e){"function"==typeof define&&define.amd?define("flickity/js/drag",["./flickity","unidragger/unidragger","fizzy-ui-utils/utils"],function(i,n,s){return e(t,i,n,s)}):"object"==typeof module&&module.exports?module.exports=e(t,require("./flickity"),require("unidragger"),require("fizzy-ui-utils")):t.Flickity=e(t,t.Flickity,t.Unidragger,t.fizzyUIUtils)}(window,function(t,e,i,n){function s(){return{x:t.pageXOffset,y:t.pageYOffset}}n.extend(e.defaults,{draggable:">1",dragThreshold:3}),e.createMethods.push("_createDrag");var o=e.prototype;n.extend(o,i.prototype),o._touchActionValue="pan-y";var r="createTouch"in document,a=!1;o._createDrag=function(){this.on("activate",this.onActivateDrag),this.on("uiChange",this._uiChangeDrag),this.on("childUIPointerDown",this._childUIPointerDownDrag),this.on("deactivate",this.onDeactivateDrag),this.on("cellChange",this.updateDraggable),r&&!a&&(t.addEventListener("touchmove",function(){}),a=!0)},o.onActivateDrag=function(){this.handles=[this.viewport],this.bindHandles(),this.updateDraggable()},o.onDeactivateDrag=function(){this.unbindHandles(),this.element.classList.remove("is-draggable")},o.updateDraggable=function(){">1"==this.options.draggable?this.isDraggable=this.slides.length>1:this.isDraggable=this.options.draggable,this.isDraggable?this.element.classList.add("is-draggable"):this.element.classList.remove("is-draggable")},o.bindDrag=function(){this.options.draggable=!0,this.updateDraggable()},o.unbindDrag=function(){this.options.draggable=!1,this.updateDraggable()},o._uiChangeDrag=function(){delete this.isFreeScrolling},o._childUIPointerDownDrag=function(t){t.preventDefault(),this.pointerDownFocus(t)},o.pointerDown=function(e,i){if(!this.isDraggable)return void this._pointerDownDefault(e,i);var n=this.okayPointerDown(e);n&&(this._pointerDownPreventDefault(e),this.pointerDownFocus(e),document.activeElement!=this.element&&this.pointerDownBlur(),this.dragX=this.x,this.viewport.classList.add("is-pointer-down"),this.pointerDownScroll=s(),t.addEventListener("scroll",this),this._pointerDownDefault(e,i))},o._pointerDownDefault=function(t,e){this.pointerDownPointer=e,this._bindPostStartEvents(t),this.dispatchEvent("pointerDown",t,[e])};var l={INPUT:!0,TEXTAREA:!0,SELECT:!0};return o.pointerDownFocus=function(t){var e=l[t.target.nodeName];e||this.focus()},o._pointerDownPreventDefault=function(t){var e="touchstart"==t.type,i="touch"==t.pointerType,n=l[t.target.nodeName];e||i||n||t.preventDefault()},o.hasDragStarted=function(t){return Math.abs(t.x)>this.options.dragThreshold},o.pointerUp=function(t,e){delete this.isTouchScrolling,this.viewport.classList.remove("is-pointer-down"),this.dispatchEvent("pointerUp",t,[e]),this._dragPointerUp(t,e)},o.pointerDone=function(){t.removeEventListener("scroll",this),delete this.pointerDownScroll},o.dragStart=function(e,i){this.isDraggable&&(this.dragStartPosition=this.x,this.startAnimation(),t.removeEventListener("scroll",this),this.dispatchEvent("dragStart",e,[i]))},o.pointerMove=function(t,e){var i=this._dragPointerMove(t,e);this.dispatchEvent("pointerMove",t,[e,i]),this._dragMove(t,e,i)},o.dragMove=function(t,e,i){if(this.isDraggable){t.preventDefault(),this.previousDragX=this.dragX;var n=this.options.rightToLeft?-1:1;this.options.wrapAround&&(i.x=i.x%this.slideableWidth);var s=this.dragStartPosition+i.x*n;if(!this.options.wrapAround&&this.slides.length){var o=Math.max(-this.slides[0].target,this.dragStartPosition);s=s>o?.5*(s+o):s;var r=Math.min(-this.getLastSlide().target,this.dragStartPosition);s=s<r?.5*(s+r):s}this.dragX=s,this.dragMoveTime=new Date,this.dispatchEvent("dragMove",t,[e,i])}},o.dragEnd=function(t,e){if(this.isDraggable){this.options.freeScroll&&(this.isFreeScrolling=!0);var i=this.dragEndRestingSelect();if(this.options.freeScroll&&!this.options.wrapAround){var n=this.getRestingPosition();this.isFreeScrolling=-n>this.slides[0].target&&-n<this.getLastSlide().target}else this.options.freeScroll||i!=this.selectedIndex||(i+=this.dragEndBoostSelect());delete this.previousDragX,this.isDragSelect=this.options.wrapAround,this.select(i),delete this.isDragSelect,this.dispatchEvent("dragEnd",t,[e])}},o.dragEndRestingSelect=function(){var t=this.getRestingPosition(),e=Math.abs(this.getSlideDistance(-t,this.selectedIndex)),i=this._getClosestResting(t,e,1),n=this._getClosestResting(t,e,-1),s=i.distance<n.distance?i.index:n.index;return s},o._getClosestResting=function(t,e,i){for(var n=this.selectedIndex,s=1/0,o=this.options.contain&&!this.options.wrapAround?function(t,e){return t<=e}:function(t,e){return t<e};o(e,s)&&(n+=i,s=e,e=this.getSlideDistance(-t,n),null!==e);)e=Math.abs(e);return{distance:s,index:n-i}},o.getSlideDistance=function(t,e){var i=this.slides.length,s=this.options.wrapAround&&i>1,o=s?n.modulo(e,i):e,r=this.slides[o];if(!r)return null;var a=s?this.slideableWidth*Math.floor(e/i):0;return t-(r.target+a)},o.dragEndBoostSelect=function(){if(void 0===this.previousDragX||!this.dragMoveTime||new Date-this.dragMoveTime>100)return 0;var t=this.getSlideDistance(-this.dragX,this.selectedIndex),e=this.previousDragX-this.dragX;return t>0&&e>0?1:t<0&&e<0?-1:0},o.staticClick=function(t,e){var i=this.getParentCell(t.target),n=i&&i.element,s=i&&this.cells.indexOf(i);this.dispatchEvent("staticClick",t,[e,n,s])},o.onscroll=function(){var t=s(),e=this.pointerDownScroll.x-t.x,i=this.pointerDownScroll.y-t.y;(Math.abs(e)>3||Math.abs(i)>3)&&this._pointerDone()},e}),function(t,e){"function"==typeof define&&define.amd?define("tap-listener/tap-listener",["unipointer/unipointer"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("unipointer")):t.TapListener=e(t,t.Unipointer)}(window,function(t,e){function i(t){this.bindTap(t)}var n=i.prototype=Object.create(e.prototype);return n.bindTap=function(t){t&&(this.unbindTap(),this.tapElement=t,this._bindStartEvent(t,!0))},n.unbindTap=function(){this.tapElement&&(this._bindStartEvent(this.tapElement,!0),delete this.tapElement)},n.pointerUp=function(i,n){if(!this.isIgnoringMouseUp||"mouseup"!=i.type){var s=e.getPointerPoint(n),o=this.tapElement.getBoundingClientRect(),r=t.pageXOffset,a=t.pageYOffset,l=s.x>=o.left+r&&s.x<=o.right+r&&s.y>=o.top+a&&s.y<=o.bottom+a;if(l&&this.emitEvent("tap",[i,n]),"mouseup"!=i.type){this.isIgnoringMouseUp=!0;var h=this;setTimeout(function(){delete h.isIgnoringMouseUp},400)}}},n.destroy=function(){this.pointerDone(),this.unbindTap()},i}),function(t,e){"function"==typeof define&&define.amd?define("flickity/js/prev-next-button",["./flickity","tap-listener/tap-listener","fizzy-ui-utils/utils"],function(i,n,s){return e(t,i,n,s)}):"object"==typeof module&&module.exports?module.exports=e(t,require("./flickity"),require("tap-listener"),require("fizzy-ui-utils")):e(t,t.Flickity,t.TapListener,t.fizzyUIUtils)}(window,function(t,e,i,n){"use strict";function s(t,e){this.direction=t,this.parent=e,this._create()}function o(t){return"string"==typeof t?t:"M "+t.x0+",50 L "+t.x1+","+(t.y1+50)+" L "+t.x2+","+(t.y2+50)+" L "+t.x3+",50  L "+t.x2+","+(50-t.y2)+" L "+t.x1+","+(50-t.y1)+" Z"}var r="http://www.w3.org/2000/svg";s.prototype=Object.create(i.prototype),s.prototype._create=function(){this.isEnabled=!0,this.isPrevious=this.direction==-1;var t=this.parent.options.rightToLeft?1:-1;this.isLeft=this.direction==t;var e=this.element=document.createElement("button");e.className="flickity-button flickity-prev-next-button",e.className+=this.isPrevious?" previous":" next",e.setAttribute("type","button"),this.disable(),e.setAttribute("aria-label",this.isPrevious?"Previous":"Next");var i=this.createSVG();e.appendChild(i),this.on("tap",this.onTap),this.parent.on("select",this.update.bind(this)),this.on("pointerDown",this.parent.childUIPointerDown.bind(this.parent))},s.prototype.activate=function(){this.bindTap(this.element),this.element.addEventListener("click",this),this.parent.element.appendChild(this.element)},s.prototype.deactivate=function(){this.parent.element.removeChild(this.element),i.prototype.destroy.call(this),this.element.removeEventListener("click",this)},s.prototype.createSVG=function(){var t=document.createElementNS(r,"svg");t.setAttribute("class","flickity-button-icon"),t.setAttribute("viewBox","0 0 100 100");var e=document.createElementNS(r,"path"),i=o(this.parent.options.arrowShape);return e.setAttribute("d",i),e.setAttribute("class","arrow"),this.isLeft||e.setAttribute("transform","translate(100, 100) rotate(180) "),t.appendChild(e),t},s.prototype.onTap=function(){if(this.isEnabled){this.parent.uiChange();var t=this.isPrevious?"previous":"next";this.parent[t]()}},s.prototype.handleEvent=n.handleEvent,s.prototype.onclick=function(t){var e=document.activeElement;e&&e==this.element&&this.onTap(t,t)},s.prototype.enable=function(){this.isEnabled||(this.element.disabled=!1,this.isEnabled=!0)},s.prototype.disable=function(){this.isEnabled&&(this.element.disabled=!0,this.isEnabled=!1)},s.prototype.update=function(){var t=this.parent.slides;if(this.parent.options.wrapAround&&t.length>1)return void this.enable();var e=t.length?t.length-1:0,i=this.isPrevious?0:e,n=this.parent.selectedIndex==i?"disable":"enable";this[n]()},s.prototype.destroy=function(){this.deactivate()},n.extend(e.defaults,{prevNextButtons:!0,arrowShape:{x0:10,x1:60,y1:50,x2:70,y2:40,x3:30}}),e.createMethods.push("_createPrevNextButtons");var a=e.prototype;return a._createPrevNextButtons=function(){this.options.prevNextButtons&&(this.prevButton=new s((-1),this),this.nextButton=new s(1,this),this.on("activate",this.activatePrevNextButtons))},a.activatePrevNextButtons=function(){this.prevButton.activate(),this.nextButton.activate(),this.on("deactivate",this.deactivatePrevNextButtons)},a.deactivatePrevNextButtons=function(){this.prevButton.deactivate(),this.nextButton.deactivate(),this.off("deactivate",this.deactivatePrevNextButtons)},e.PrevNextButton=s,e}),function(t,e){"function"==typeof define&&define.amd?define("flickity/js/page-dots",["./flickity","tap-listener/tap-listener","fizzy-ui-utils/utils"],function(i,n,s){return e(t,i,n,s)}):"object"==typeof module&&module.exports?module.exports=e(t,require("./flickity"),require("tap-listener"),require("fizzy-ui-utils")):e(t,t.Flickity,t.TapListener,t.fizzyUIUtils)}(window,function(t,e,i,n){function s(t){this.parent=t,this._create()}s.prototype=new i,s.prototype._create=function(){this.holder=document.createElement("ol"),this.holder.className="flickity-page-dots",this.dots=[],this.on("tap",this.onTap),this.on("pointerDown",this.parent.childUIPointerDown.bind(this.parent))},s.prototype.activate=function(){this.setDots(),this.bindTap(this.holder),this.parent.element.appendChild(this.holder)},s.prototype.deactivate=function(){this.parent.element.removeChild(this.holder),i.prototype.destroy.call(this)},s.prototype.setDots=function(){var t=this.parent.slides.length-this.dots.length;t>0?this.addDots(t):t<0&&this.removeDots(-t)},s.prototype.addDots=function(t){for(var e=document.createDocumentFragment(),i=[],n=this.dots.length,s=n+t,o=n;o<s;o++){var r=document.createElement("li");r.className="dot",r.setAttribute("aria-label","Page dot "+(o+1)),e.appendChild(r),i.push(r)}this.holder.appendChild(e),this.dots=this.dots.concat(i)},s.prototype.removeDots=function(t){var e=this.dots.splice(this.dots.length-t,t);e.forEach(function(t){this.holder.removeChild(t)},this)},s.prototype.updateSelected=function(){this.selectedDot&&(this.selectedDot.className="dot",this.selectedDot.removeAttribute("aria-current")),this.dots.length&&(this.selectedDot=this.dots[this.parent.selectedIndex],this.selectedDot.className="dot is-selected",this.selectedDot.setAttribute("aria-current","step"))},s.prototype.onTap=function(t){var e=t.target;if("LI"==e.nodeName){this.parent.uiChange();var i=this.dots.indexOf(e);this.parent.select(i)}},s.prototype.destroy=function(){this.deactivate()},e.PageDots=s,n.extend(e.defaults,{pageDots:!0}),e.createMethods.push("_createPageDots");var o=e.prototype;return o._createPageDots=function(){this.options.pageDots&&(this.pageDots=new s(this),this.on("activate",this.activatePageDots),this.on("select",this.updateSelectedPageDots),this.on("cellChange",this.updatePageDots),this.on("resize",this.updatePageDots),this.on("deactivate",this.deactivatePageDots))},o.activatePageDots=function(){this.pageDots.activate()},o.updateSelectedPageDots=function(){this.pageDots.updateSelected()},o.updatePageDots=function(){this.pageDots.setDots()},o.deactivatePageDots=function(){this.pageDots.deactivate()},e.PageDots=s,e}),function(t,e){"function"==typeof define&&define.amd?define("flickity/js/player",["ev-emitter/ev-emitter","fizzy-ui-utils/utils","./flickity"],function(t,i,n){return e(t,i,n)}):"object"==typeof module&&module.exports?module.exports=e(require("ev-emitter"),require("fizzy-ui-utils"),require("./flickity")):e(t.EvEmitter,t.fizzyUIUtils,t.Flickity)}(window,function(t,e,i){function n(t){this.parent=t,this.state="stopped",this.onVisibilityChange=this.visibilityChange.bind(this),this.onVisibilityPlay=this.visibilityPlay.bind(this)}n.prototype=Object.create(t.prototype),n.prototype.play=function(){if("playing"!=this.state){var t=document.hidden;if(t)return void document.addEventListener("visibilitychange",this.onVisibilityPlay);this.state="playing",document.addEventListener("visibilitychange",this.onVisibilityChange),this.tick()}},n.prototype.tick=function(){if("playing"==this.state){var t=this.parent.options.autoPlay;t="number"==typeof t?t:3e3;var e=this;this.clear(),this.timeout=setTimeout(function(){e.parent.next(!0),e.tick()},t)}},n.prototype.stop=function(){this.state="stopped",this.clear(),document.removeEventListener("visibilitychange",this.onVisibilityChange)},n.prototype.clear=function(){clearTimeout(this.timeout)},n.prototype.pause=function(){"playing"==this.state&&(this.state="paused",this.clear())},n.prototype.unpause=function(){"paused"==this.state&&this.play()},n.prototype.visibilityChange=function(){var t=document.hidden;this[t?"pause":"unpause"]()},n.prototype.visibilityPlay=function(){this.play(),document.removeEventListener("visibilitychange",this.onVisibilityPlay)},e.extend(i.defaults,{pauseAutoPlayOnHover:!0}),i.createMethods.push("_createPlayer");var s=i.prototype;return s._createPlayer=function(){this.player=new n(this),this.on("activate",this.activatePlayer),this.on("uiChange",this.stopPlayer),this.on("pointerDown",this.stopPlayer),this.on("deactivate",this.deactivatePlayer)},s.activatePlayer=function(){this.options.autoPlay&&(this.player.play(),this.element.addEventListener("mouseenter",this))},s.playPlayer=function(){this.player.play()},s.stopPlayer=function(){this.player.stop()},s.pausePlayer=function(){this.player.pause()},s.unpausePlayer=function(){this.player.unpause()},s.deactivatePlayer=function(){this.player.stop(),this.element.removeEventListener("mouseenter",this)},s.onmouseenter=function(){this.options.pauseAutoPlayOnHover&&(this.player.pause(),this.element.addEventListener("mouseleave",this))},s.onmouseleave=function(){this.player.unpause(),this.element.removeEventListener("mouseleave",this)},i.Player=n,i}),function(t,e){"function"==typeof define&&define.amd?define("flickity/js/add-remove-cell",["./flickity","fizzy-ui-utils/utils"],function(i,n){return e(t,i,n)}):"object"==typeof module&&module.exports?module.exports=e(t,require("./flickity"),require("fizzy-ui-utils")):e(t,t.Flickity,t.fizzyUIUtils)}(window,function(t,e,i){function n(t){var e=document.createDocumentFragment();return t.forEach(function(t){e.appendChild(t.element)}),e}var s=e.prototype;return s.insert=function(t,e){var i=this._makeCells(t);if(i&&i.length){var s=this.cells.length;e=void 0===e?s:e;var o=n(i),r=e==s;if(r)this.slider.appendChild(o);else{var a=this.cells[e].element;this.slider.insertBefore(o,a)}if(0===e)this.cells=i.concat(this.cells);else if(r)this.cells=this.cells.concat(i);else{var l=this.cells.splice(e,s-e);this.cells=this.cells.concat(i).concat(l)}this._sizeCells(i),this.cellChange(e,!0)}},s.append=function(t){this.insert(t,this.cells.length)},s.prepend=function(t){this.insert(t,0)},s.remove=function(t){var e=this.getCells(t);if(e&&e.length){var n=this.cells.length-1;e.forEach(function(t){t.remove();var e=this.cells.indexOf(t);n=Math.min(e,n),i.removeFrom(this.cells,t)},this),this.cellChange(n,!0)}},s.cellSizeChange=function(t){var e=this.getCell(t);if(e){e.getSize();var i=this.cells.indexOf(e);this.cellChange(i)}},s.cellChange=function(t,e){var i=this.selectedElement;this._positionCells(t),this._getWrapShiftCells(),this.setGallerySize();var n=this.getCell(i);n&&(this.selectedIndex=this.getCellSlideIndex(n)),this.selectedIndex=Math.min(this.slides.length-1,this.selectedIndex),this.emitEvent("cellChange",[t]),this.select(this.selectedIndex),e&&this.positionSliderAtSelected()},e}),function(t,e){"function"==typeof define&&define.amd?define("flickity/js/lazyload",["./flickity","fizzy-ui-utils/utils"],function(i,n){return e(t,i,n)}):"object"==typeof module&&module.exports?module.exports=e(t,require("./flickity"),require("fizzy-ui-utils")):e(t,t.Flickity,t.fizzyUIUtils)}(window,function(t,e,i){"use strict";function n(t){if("IMG"==t.nodeName){var e=t.getAttribute("data-flickity-lazyload"),n=t.getAttribute("data-flickity-lazyload-src"),s=t.getAttribute("data-flickity-lazyload-srcset");if(e||n||s)return[t]}var o="img[data-flickity-lazyload], img[data-flickity-lazyload-src], img[data-flickity-lazyload-srcset]",r=t.querySelectorAll(o);return i.makeArray(r)}function s(t,e){this.img=t,this.flickity=e,this.load()}e.createMethods.push("_createLazyload");var o=e.prototype;return o._createLazyload=function(){this.on("select",this.lazyLoad)},o.lazyLoad=function(){var t=this.options.lazyLoad;if(t){var e="number"==typeof t?t:0,i=this.getAdjacentCellElements(e),o=[];i.forEach(function(t){var e=n(t);o=o.concat(e)}),o.forEach(function(t){new s(t,this)},this)}},s.prototype.handleEvent=i.handleEvent,s.prototype.load=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this);var t=this.img.getAttribute("data-flickity-lazyload")||this.img.getAttribute("data-flickity-lazyload-src"),e=this.img.getAttribute("data-flickity-lazyload-srcset");this.img.src=t,e&&this.img.setAttribute("srcset",e),this.img.removeAttribute("data-flickity-lazyload"),this.img.removeAttribute("data-flickity-lazyload-src"),this.img.removeAttribute("data-flickity-lazyload-srcset")},s.prototype.onload=function(t){this.complete(t,"flickity-lazyloaded")},s.prototype.onerror=function(t){this.complete(t,"flickity-lazyerror")},s.prototype.complete=function(t,e){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this);var i=this.flickity.getParentCell(this.img),n=i&&i.element;this.flickity.cellSizeChange(n),this.img.classList.add(e),this.flickity.dispatchEvent("lazyLoad",t,n)},e.LazyLoader=s,e}),function(t,e){"function"==typeof define&&define.amd?define("flickity/js/index",["./flickity","./drag","./prev-next-button","./page-dots","./player","./add-remove-cell","./lazyload"],e):"object"==typeof module&&module.exports&&(module.exports=e(require("./flickity"),require("./drag"),require("./prev-next-button"),require("./page-dots"),require("./player"),require("./add-remove-cell"),require("./lazyload")))}(window,function(t){return t}),function(t,e){"function"==typeof define&&define.amd?define("flickity-as-nav-for/as-nav-for",["flickity/js/index","fizzy-ui-utils/utils"],e):"object"==typeof module&&module.exports?module.exports=e(require("flickity"),require("fizzy-ui-utils")):t.Flickity=e(t.Flickity,t.fizzyUIUtils)}(window,function(t,e){function i(t,e,i){return(e-t)*i+t}t.createMethods.push("_createAsNavFor");var n=t.prototype;return n._createAsNavFor=function(){this.on("activate",this.activateAsNavFor),this.on("deactivate",this.deactivateAsNavFor),this.on("destroy",this.destroyAsNavFor);var t=this.options.asNavFor;if(t){var e=this;setTimeout(function(){e.setNavCompanion(t)})}},n.setNavCompanion=function(i){i=e.getQueryElement(i);var n=t.data(i);if(n&&n!=this){this.navCompanion=n;var s=this;this.onNavCompanionSelect=function(){s.navCompanionSelect()},n.on("select",this.onNavCompanionSelect),this.on("staticClick",this.onNavStaticClick),this.navCompanionSelect(!0)}},n.navCompanionSelect=function(t){if(this.navCompanion){var e=this.navCompanion.selectedCells[0],n=this.navCompanion.cells.indexOf(e),s=n+this.navCompanion.selectedCells.length-1,o=Math.floor(i(n,s,this.navCompanion.cellAlign));if(this.selectCell(o,!1,t),this.removeNavSelectedElements(),!(o>=this.cells.length)){var r=this.cells.slice(n,s+1);this.navSelectedElements=r.map(function(t){return t.element}),this.changeNavSelectedClass("add")}}},n.changeNavSelectedClass=function(t){this.navSelectedElements.forEach(function(e){e.classList[t]("is-nav-selected")})},n.activateAsNavFor=function(){this.navCompanionSelect(!0)},n.removeNavSelectedElements=function(){this.navSelectedElements&&(this.changeNavSelectedClass("remove"),delete this.navSelectedElements)},n.onNavStaticClick=function(t,e,i,n){"number"==typeof n&&this.navCompanion.selectCell(n)},n.deactivateAsNavFor=function(){this.removeNavSelectedElements()},n.destroyAsNavFor=function(){this.navCompanion&&(this.navCompanion.off("select",this.onNavCompanionSelect),this.off("staticClick",this.onNavStaticClick),delete this.navCompanion)},t}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("imagesloaded/imagesloaded",["ev-emitter/ev-emitter"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter")):t.imagesLoaded=e(t,t.EvEmitter)}("undefined"!=typeof window?window:this,function(t,e){function i(t,e){for(var i in e)t[i]=e[i];return t}function n(t){if(Array.isArray(t))return t;var e="object"==typeof t&&"number"==typeof t.length;return e?h.call(t):[t]}function s(t,e,o){if(!(this instanceof s))return new s(t,e,o);var r=t;return"string"==typeof t&&(r=document.querySelectorAll(t)),r?(this.elements=n(r),this.options=i({},this.options),"function"==typeof e?o=e:i(this.options,e),o&&this.on("always",o),this.getImages(),a&&(this.jqDeferred=new a.Deferred),void setTimeout(this.check.bind(this))):void l.error("Bad element for imagesLoaded "+(r||t))}function o(t){this.img=t}function r(t,e){this.url=t,this.element=e,this.img=new Image}var a=t.jQuery,l=t.console,h=Array.prototype.slice;s.prototype=Object.create(e.prototype),s.prototype.options={},s.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)},s.prototype.addElementImages=function(t){"IMG"==t.nodeName&&this.addImage(t),this.options.background===!0&&this.addElementBackgroundImages(t);var e=t.nodeType;if(e&&c[e]){for(var i=t.querySelectorAll("img"),n=0;n<i.length;n++){var s=i[n];this.addImage(s)}if("string"==typeof this.options.background){var o=t.querySelectorAll(this.options.background);for(n=0;n<o.length;n++){var r=o[n];this.addElementBackgroundImages(r)}}}};var c={1:!0,9:!0,11:!0};return s.prototype.addElementBackgroundImages=function(t){var e=getComputedStyle(t);if(e)for(var i=/url\((['"])?(.*?)\1\)/gi,n=i.exec(e.backgroundImage);null!==n;){var s=n&&n[2];s&&this.addBackground(s,t),n=i.exec(e.backgroundImage)}},s.prototype.addImage=function(t){var e=new o(t);this.images.push(e)},s.prototype.addBackground=function(t,e){var i=new r(t,e);this.images.push(i)},s.prototype.check=function(){function t(t,i,n){setTimeout(function(){e.progress(t,i,n)})}var e=this;return this.progressedCount=0,this.hasAnyBroken=!1,this.images.length?void this.images.forEach(function(e){e.once("progress",t),e.check()}):void this.complete()},s.prototype.progress=function(t,e,i){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!t.isLoaded,this.emitEvent("progress",[this,t,e]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,t),this.progressedCount==this.images.length&&this.complete(),this.options.debug&&l&&l.log("progress: "+i,t,e)},s.prototype.complete=function(){var t=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(t,[this]),this.emitEvent("always",[this]),this.jqDeferred){var e=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[e](this)}},o.prototype=Object.create(e.prototype),o.prototype.check=function(){var t=this.getIsImageComplete();return t?void this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),void(this.proxyImage.src=this.img.src))},o.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},o.prototype.confirm=function(t,e){this.isLoaded=t,this.emitEvent("progress",[this,this.img,e])},o.prototype.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},o.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},o.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},o.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},r.prototype=Object.create(o.prototype),r.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url;var t=this.getIsImageComplete();t&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},r.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},r.prototype.confirm=function(t,e){this.isLoaded=t,this.emitEvent("progress",[this,this.element,e])},s.makeJQueryPlugin=function(e){e=e||t.jQuery,e&&(a=e,a.fn.imagesLoaded=function(t,e){var i=new s(this,t,e);return i.jqDeferred.promise(a(this))})},s.makeJQueryPlugin(),s}),function(t,e){"function"==typeof define&&define.amd?define(["flickity/js/index","imagesloaded/imagesloaded"],function(i,n){return e(t,i,n)}):"object"==typeof module&&module.exports?module.exports=e(t,require("flickity"),require("imagesloaded")):t.Flickity=e(t,t.Flickity,t.imagesLoaded)}(window,function(t,e,i){"use strict";e.createMethods.push("_createImagesLoaded");var n=e.prototype;return n._createImagesLoaded=function(){this.on("activate",this.imagesLoaded)},n.imagesLoaded=function(){function t(t,i){var n=e.getParentCell(i.img);e.cellSizeChange(n&&n.element),e.options.freeScroll||e.positionSliderAtSelected()}if(this.options.imagesLoaded){var e=this;i(this.slider).on("progress",t)}},e});
jQuery(function($){jQuery(".tg_horizontal_gallery_wrapper").each(function(){var $carousel=jQuery(this);var timer=false;var loop=false;var navigation=true;var pagination=false;$carousel.flickity({percentPosition:false,imagesLoaded:true,selectedAttraction:0.01,friction:0.2,lazyLoad:5,pauseAutoPlayOnHover:true,autoPlay:timer,contain:true,prevNextButtons:navigation,pageDots:pagination});});});