window.eviivo=window.eviivo?window.eviivo:{};window.eviivo.webcore=window.eviivo.webcore?window.eviivo.webcore:{};window.eviivo.webcore.formatting=window.eviivo.webcore.formatting?window.eviivo.webcore.formatting:{};window.eviivo.webcore.formatting.datetime=function(){function u(n,i){return t(n,i,"long")}function f(n,i){return t(n,i,"short")}function e(t,i){return n(t,i,"long")}function o(t,i){return n(t,i,"medium")}function s(t,i){return n(t,i,"short")}function h(i,r){return n(i,r,"long")+" "+t(i,r,"short")}function c(i,r){return n(i,r,"long")+" "+t(i,r,"long")}function l(i,r){return t(i,r,"short")+" "+n(i,r,"long")}function a(i,r){return n(i,r,"medium")+" "+t(i,r,"short")}function v(i,r){return t(i,r,"short")+" "+n(i,r,"medium")}function y(i,r){return n(i,r,"short")+" "+t(i,r,"short")}function p(i,r){return t(i,r,"short")+" "+n(i,r,"short")}function w(t){return n(t,"iso8601","short")}function b(i){return n(i,"iso8601","short")+"T"+t(i,"iso8601","short")}function k(t){return n(t,"iso8601","long")}function d(i){return n(i,"iso8601","long")+"T"+t(i,"iso8601","long")}function g(n){return t(n,"iso8601","short")}function nt(n){return it(n.toLowerCase())}function tt(n,t){return rt(n.toLowerCase(),t)}function it(n){var t=window.eviivo.webcore.formatting.regionals[n];return t==null&&(t=window.eviivo.webcore.formatting.regionals["default"]),t.firstDayCalendarOffset}function rt(n,t){var i=window.eviivo.webcore.formatting.regionals[n];return i==null&&(i=window.eviivo.webcore.formatting.regionals["default"]),t==="long"?i.jQDateFormat.long:t==="short"?i.jQDateFormat.short:i.jQDateFormat.medium}function n(n,t,u){var e;if(n==null)return null;if(t==null||t=="")throw r+": please specify the 'culture' code parameter";if(t=t.toLowerCase(),n instanceof Date){e=window.eviivo.webcore.formatting.regionals[t];e==null&&(e=window.eviivo.webcore.formatting.regionals["default"]);var f=e.dateFormat[u].slice(0),s=n.getDate(),h=n.getDay(),c=new RegExp("([\\w\\d ]+[ \\.\\-/,])(d{1})([ \\.\\-/,]+)([\\w\\d \\.\\-/,]+)"),l=new RegExp("[^yYdDmM \\.\\-/,](d{1})([ \\.\\-/,]+)([yYdDmM \\.\\-/,]+)");c.test(f)?f=f.replace(c,"$1"+s+"$3$4"):l.test(f)&&(f=f.replace(l,s+"$2$3"));e.dayNames!=null&&(f=f.replace("dddd",e.dayNames.long[h]),f=f.replace("ddd",e.dayNames.medium[h]),f=f.replace("DD",e.dayNames.short[h]));f=f.replace("dd",i(s));var o=n.getMonth(),a=new RegExp("([\\w\\d ]+[ \\.\\-/,])(M{1})([ \\.\\-/,]+)([\\w\\d \\.\\-/,]+)"),v=new RegExp("[^yYdDmM \\.\\-/,](M{1})([ \\.\\-/,]+)([yYdDmM \\.\\-/,]+)");return a.test(f)?f=f.replace(a,"$1"+o+"$3$4"):v.test(f)&&(f=f.replace(v,o+"$2$3")),e.monthNames!=null&&(f=f.replace("MMMM",e.monthNames.long[o]),f=f.replace("MMM",e.monthNames.medium[o])),f=f.replace("MM",i(o+1)),f=f.replace("yyyy",n.getFullYear()),f.replace("yy",n.getFullYear().toString().substring(2))}return n.toLocaleString()}function t(n,t,u){var s,f,o,e,h;if(n==null)return null;if(t==null||t=="")throw r+": please specify the 'culture' code parameter";return t=t.toLowerCase(),n instanceof Date?(s=window.eviivo.webcore.formatting.regionals[t],s==null&&(s=window.eviivo.webcore.formatting.regionals["default"]),f=s.clockFormat[u].slice(0),o=s.clockFormat.mode,o==null&&(o=24),f.indexOf("tt")<0&&f.indexOf("t")>-1&&(f=f.replace("t",o==24?"hh:mm":"h:mm tt")),f.indexOf("tt")<0&&f.indexOf("T")>-1&&(f=f.replace("T",o==24?"hh:mm:ss":"h:mm:ss tt")),e=n.getHours(),o==12&&(h=e>=12?"PM":"AM",f=f.replace("tt",h),e=e%12,e=e?e:12),f=f.replace("hh:",i(e)+":"),f=f.replace("h:",e+":"),f=f.replace(":mm",":"+i(n.getMinutes())),f.replace(":ss",":"+i(n.getSeconds()))):n.toLocaleString()}function i(n){return n<10?"0"+n:n}var r="eviivo.webcore.formatting.datetime";return{evDisplayLongTime:u,evDisplayShortTime:f,evDisplayLongDate:e,evDisplayMediumDate:o,evDisplayShortDate:s,evDisplayLongDateTime:h,evDisplayExtraLongDateTime:c,evDisplayMediumDateTime:a,evDisplayShortDateTime:y,evDisplayLongTimeDate:l,evDisplayMediumTimeDate:v,evDisplayShortTimeDate:p,evStandard24HourTime:g,evStandardIso8601Date:w,evStandardIso8601DateTimeUtc:b,evStandardIso8601DateExtended:k,evStandardIso8601DateTimeUtcExtended:d,evStandardFirstDayCalendarOffset:nt,evGetDateDisplayFormat:tt}}();Date.prototype.evGetDateDisplayFormat=function(n,t){return eviivo.webcore.formatting.datetime.evGetDateDisplayFormat(n,t)};Date.prototype.evStandardFirstDayCalendarOffset=function(n){return eviivo.webcore.formatting.datetime.evStandardFirstDayCalendarOffset(n)};Date.prototype.evDisplayLongTime=function(n){return eviivo.webcore.formatting.datetime.evDisplayLongTime(this,n)};Date.prototype.evDisplayShortTime=function(n){return eviivo.webcore.formatting.datetime.evDisplayShortTime(this,n)};Date.prototype.evDisplayLongDate=function(n){return eviivo.webcore.formatting.datetime.evDisplayLongDate(this,n)};Date.prototype.evDisplayMediumDate=function(n){return eviivo.webcore.formatting.datetime.evDisplayMediumDate(this,n)};Date.prototype.evDisplayShortDate=function(n){return eviivo.webcore.formatting.datetime.evDisplayShortDate(this,n)};Date.prototype.evDisplayLongDateTime=function(n){return eviivo.webcore.formatting.datetime.evDisplayLongDateTime(this,n)};Date.prototype.evDisplayExtraLongDateTime=function(n){return eviivo.webcore.formatting.datetime.evDisplayExtraLongDateTime(this,n)};Date.prototype.evDisplayMediumDateTime=function(n){return eviivo.webcore.formatting.datetime.evDisplayMediumDateTime(this,n)};Date.prototype.evDisplayShortDateTime=function(n){return eviivo.webcore.formatting.datetime.evDisplayShortDateTime(this,n)};Date.prototype.evDisplayLongTimeDate=function(n){return eviivo.webcore.formatting.datetime.evDisplayLongTimeDate(this,n)};Date.prototype.evDisplayMediumTimeDate=function(n){return eviivo.webcore.formatting.datetime.evDisplayMediumTimeDate(this,n)};Date.prototype.evDisplayShortTimeDate=function(n){return eviivo.webcore.formatting.datetime.evDisplayShortTimeDate(this,n)};Date.prototype.evStandardIso8601Date=function(){return eviivo.webcore.formatting.datetime.evStandardIso8601Date(this)};Date.prototype.evStandardIso8601DateTimeUtc=function(){return eviivo.webcore.formatting.datetime.evStandardIso8601DateTimeUtc(this)};Date.prototype.evStandardIso8601DateExtended=function(){return eviivo.webcore.formatting.datetime.evStandardIso8601DateExtended(this)};Date.prototype.evStandardIso8601DateTimeUtcExtended=function(){return eviivo.webcore.formatting.datetime.evStandardIso8601DateTimeUtcExtended(this)};Date.prototype.evStandard24HourTime=function(){return eviivo.webcore.formatting.datetime.evStandard24HourTime(this)};window.eviivo=window.eviivo?window.eviivo:{};window.eviivo.webcore.formatting=window.eviivo.webcore.formatting?window.eviivo.webcore.formatting:{};window.eviivo.webcore.formatting.regionals=window.eviivo.webcore.formatting.regionals?window.eviivo.webcore.formatting.regionals:{};window.eviivo.webcore.formatting.regionals.iso8601={monthNames:null,dayNames:null,dateFormat:{long:"yyyy-MM-dd",medium:null,short:"yyyyMMdd"},jQDateFormat:{long:"yy-mm-dd",medium:null,short:"yymmdd"},clockFormat:{mode:24,long:"hh:mm:ss",short:"hhmmss"},firstDayCalendarOffset:1};window.eviivo.webcore.formatting.regionals["default"]={monthNames:{long:["January","February","March","April","May","June","July","August","September","October","November","December"],medium:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],short:null},dayNames:{long:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],medium:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],short:["Su","Mo","Tu","We","Th","Fr","Sa"]},dateFormat:{long:"ddd dd MMM yyyy",medium:"dd MMM yyyy",short:"dd-MM-yy"},jQDateFormat:{long:"D dd M yy",medium:"d M yy",short:"dd-M-y"},clockFormat:{mode:24,long:"T",short:"t"},firstDayCalendarOffset:1};window.eviivo.webcore.formatting.regionals["en-gb"]={monthNames:{long:["January","February","March","April","May","June","July","August","September","October","November","December"],medium:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],short:null},dayNames:{long:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],medium:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],short:["Su","Mo","Tu","We","Th","Fr","Sa"]},dateFormat:{long:"ddd dd MMM yyyy",medium:"dd MMM yyyy",short:"dd-MM-yy"},jQDateFormat:{long:"D dd M yy",medium:"d M yy",short:"dd-M-y"},clockFormat:{mode:24,long:"T",short:"t"},firstDayCalendarOffset:1};window.eviivo.webcore.formatting.regionals["en-us"]={monthNames:{long:["January","February","March","April","May","June","July","August","September","October","November","December"],medium:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],short:null},dayNames:{long:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],medium:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],short:["Su","Mo","Tu","We","Th","Fr","Sa"]},dateFormat:{long:"ddd MMM d, yyyy",medium:"MMM d, yyyy",short:"M/d/yy"},jQDateFormat:{long:"D M d, yy",medium:"M d, yy",short:"m/d/y"},clockFormat:{mode:12,long:"T",short:"t"},firstDayCalendarOffset:0};window.eviivo.webcore.formatting.regionals["fr-fr"]={monthNames:{long:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],medium:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],short:null},dayNames:{long:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],medium:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],short:["di","lu","ma","me","je","ve","sa"]},dateFormat:{long:"ddd dd MMM yyyy",medium:"dd MMM yyyy",short:"dd-MM-yy"},jQDateFormat:{long:"D dd M yy",medium:"d M yy",short:"dd-M-y"},clockFormat:{mode:24,long:"T",short:"t"},firstDayCalendarOffset:1};window.eviivo.webcore.formatting.regionals["it-it"]={monthNames:{long:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],medium:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],short:null},dayNames:{long:["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"],medium:["dom","lun","mar","mer","gio","ven","sab"],short:["do","lu","ma","me","gi","ve","sa"]},dateFormat:{long:"ddd dd MMM yyyy",medium:"dd MMM yyyy",short:"dd-MM-yy"},jQDateFormat:{long:"D dd M yy",medium:"d M yy",short:"dd-M-y"},clockFormat:{mode:24,long:"T",short:"t"},firstDayCalendarOffset:1};window.eviivo.webcore.formatting.regionals["de-de"]={monthNames:{long:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],medium:["Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],short:null},dayNames:{long:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],medium:["So","Mo","Di","Mi","Do","Fr","Sa"],short:["So","Mo","Di","Mi","Do","Fr","Sa"]},dateFormat:{long:"ddd dd MMM yyyy",medium:"dd MMM yyyy",short:"dd-MM-yy"},jQDateFormat:{long:"D dd M yy",medium:"d M yy",short:"dd-M-y"},clockFormat:{mode:24,long:"T",short:"t"},firstDayCalendarOffset:1};window.eviivo.webcore.formatting.regionals["pt-pt"]={monthNames:{long:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],medium:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],short:null},dayNames:{long:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"],medium:["dom","seg","ter","qua","qui","sex","sáb"],short:["D","S","T","Q","Q","S","S"]},dateFormat:{long:"ddd dd MMM yyyy",medium:"dd MMM yyyy",short:"dd-MM-yy"},jQDateFormat:{long:"D dd M yy",medium:"d M yy",short:"dd-M-y"},clockFormat:{mode:24,long:"T",short:"t"},firstDayCalendarOffset:1};window.eviivo.webcore.formatting.regionals["pt-br"]={monthNames:{long:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],medium:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],short:null},dayNames:{long:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"],medium:["dom","seg","ter","qua","qui","sex","sáb"],short:["D","S","T","Q","Q","S","S"]},dateFormat:{long:"ddd dd MMM yyyy",medium:"dd MMM yyyy",short:"dd-MM-yy"},jQDateFormat:{long:"D dd M yy",medium:"d M yy",short:"dd-M-y"},clockFormat:{mode:24,long:"T",short:"t"},firstDayCalendarOffset:1};window.eviivo.webcore.formatting.regionals["es-es"]={monthNames:{long:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],medium:["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sep.","oct.","nov.","dic."],short:null},dayNames:{long:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],medium:["do.","lu.","ma.","mi.","ju.","vi.","sá."],short:["D","S","T","Q","Q","S","S"]},dateFormat:{long:"ddd dd MMM yyyy",medium:"dd MMM yyyy",short:"dd-MM-yy"},jQDateFormat:{long:"D dd M yy",medium:"d M yy",short:"dd-M-y"},clockFormat:{mode:24,long:"T",short:"t"},firstDayCalendarOffset:1};window.eviivo=window.eviivo||{};window.eviivo.customDropdown=function(n,t){function u(t,i){if(t===undefined||t===null)throw"You must pass an "+i;if(t instanceof HTMLElement)return n(t);if(t instanceof window.jQuery)if(t.length===0)throw i+" is a jQuery object, but contains no element";else if(t.length>1)throw i+" contains more than one element - you must only provide one";else return n(t.get(0));else throw i+" is neither an HTML Element, nor a jQuery object";}function f(t,r,u){var f,e,o;if(u=u||{},f={},u.show)if(e=typeof u.show,e==="string")if(i.hasOwnProperty(u.show))f.show=i[u.show].bind(r.get(0));else if(u.show==="fast")f.show=function(t){n(this).show("fast",t)}.bind(r.get(0));else if(u.show==="slow")f.show=function(t){n(this).show("slow",t)}.bind(r.get(0));else throw"options.show, when specified as a string, must be one of the recognised predefined effects";else if(e==="number")o=u.show,f.show=function(t){n(this).show(o,t)}.bind(r.get(0));else if(e==="function")if(u.show.length===1)f.show=u.show.bind(r.get(0));else throw"options.show, when specified as a function, must accept a single parameter, the completion function";else throw"options.show does not have a recognised value";else f.show=function(t){n(this).show("fast",t)}.bind(r.get(0));if(u.hide)if(e=typeof u.hide,e==="string")if(i.hasOwnProperty(u.hide))f.hide=i[u.hide].bind(r.get(0));else if(u.hide==="fast")f.hide=function(t){n(this).hide("fast",t)}.bind(r.get(0));else if(u.hide==="slow")f.hide=function(t){n(this).hide("slow",t)}.bind(r.get(0));else throw"options.hide, when specified as a string, must be one of the recognised predefined effects";else if(e==="number")o=u.hide,f.hide=function(t){n(this).hide(o,t)}.bind(r.get(0));else if(e==="function")if(u.hide.length===1)f.hide=u.hide.bind(r.get(0));else throw"options.hide, when specified as a function, must accept a single parameter, the completion function";else throw"options.hide does not have a recognised value";else f.hide=function(t){n(this).hide(0,t)}.bind(r.get(0));return Object.freeze(f)}var i=Object.freeze({fadeIn:function(t){n(this).fadeIn({complete:t})},fadeOut:function(t){n(this).fadeOut({complete:t})},slideUp:function(t){n(this).slideUp({complete:t})},slideDown:function(t){n(this).slideDown({complete:t})}}),r=n(document);return function(i,e,o){function a(){h()||(e.trigger("customDropdown.beforeShow"),o.show(function(){n(this).trigger("customDropdown.show")}))}function l(){h()&&(e.trigger("customDropdown.beforeHide"),o.hide(function(){c.removeClass("show");n(this).trigger("customDropdown.hide")}))}function v(){h()?l():a()}function y(){h()&&c.addClass("show")}function p(){h()&&c.removeClass("show")}function w(){h()&&c.toggleClass("show")}function h(){return s.assertNotDestroyed(),e.is(":visible")}var c,s;return i=u(i,"$activationElement"),e=u(e,"$dropdownElement"),c=n('
<\/div>').appendTo(e),o=f(i,e,o),s=function(){function i(){if(s===null)throw"This dropdown has been destroyed";}function r(){var n=t;t=null;n.forEach(function(n){n.$el.off(n.name,n.callback)})}function u(r,u,f){if(i(),!(r instanceof n))throw"$element must be a jQuery object";if(u===undefined||u===null||u===""||/^\W+$/.test(u))throw"eventName must be a valid event";if(typeof f!="function")throw"callback must be a function";t.push({$el:r,name:u,callback:f});r.on(u,f)}var t=[];return Object.freeze({assertNotDestroyed:i,destroy:r,attachEvent:u})}(),s.attachEvent(i,"click",v),s.attachEvent(r,"keydown",t.onKey(n.ui.keyCode.ESCAPE,l)),s.attachEvent(r,"click",t.outsideOf(i,e,l)),Object.freeze({show:a,hide:l,toggle:v,loading:Object.freeze({show:y,hide:p,toggle:w}),get isVisible(){return h()},destroy:s.destroy,get $dropdownElement(){return assertNotDestroyed(),n(e.get(0))},get $activationElement(){return assertNotDestroyed(),n(i.get(0))}})}}(window.jQuery,window.eviivo.utils.eventHelpers);window.eviivo=window.eviivo||{};window.eviivo.jQuery=window.eviivo.jQuery||{};window.eviivo.jQuery.textFade=function(n){n.fn.textFade=function(t,i){if(typeof t!="string")throw"newText must be a string";i=i||{};var r=function(){if(i.duration===undefined)return 100;var n=typeof i.duration;if(n==="string"){if(i.duration!=="fast"&&i.duration!=="slow")throw"Invalid value for options.duration";return i.duration}if(n==="number"){if(i.duration<0)throw"Invalid value for options.duration";return i.duration}throw"Invalid value for options.duration";}(),u=function(){if(i.beforeShow===undefined)return function(){};if(typeof i.beforeShow!="function")throw"options.beforeShow must be a function";return i.beforeShow}(),f=function(){if(i.complete===undefined)return function(){};if(typeof i.complete!="function")throw"options.complete must be a function";return i.complete}();this.each(function(){var i=n(this);i.animate({opacity:0},{duration:r,complete:function(){i.text(t);u.call(i.get(0));i.animate({opacity:1},{duration:r,complete:f})}})})}}(window.jQuery);window.eviivo=window.eviivo?window.eviivo:{};window.eviivo.availabilityCalendar=window.eviivo.availabilityCalendar||{};window.eviivo.availabilityCalendar.utils=function(){function n(n){var t=i.exec(n);return t?new Date(parseInt(t[1]),parseInt(t[2])-1,parseInt(t[3])):undefined}function t(n){var t=n.getMonth()+1,i=o[t],r=n.getDate(),u=o[r];return n.getFullYear()+"-"+i+"-"+u}function s(n){return g.test(n)}function tt(n){return nt.test(n)}function it(n){if(!n||!Array.isArray(n))return!1;for(var t=0;tn?n:t}}function gt(n){return function(t){return tt))return!1;return r===t}function ti(n,t,i){if(!(n instanceof jQuery))throw"$elems must be a jQuery object";if(typeof t!="number")throw"count is not a number";if(typeof i!="function"&&i.length!==1)throw"predicate must be a function accepting one argument";var r=0;return n.each(function(n,u){if(i(u)&&(r++,r>t))return!1}),r===t}function ii(n,t){var u,i,r;if(!Array.isArray(n))throw"arr is not an array";if(n.length===0)throw"arr has no items";for(u=t||function(n,t){return n>t?n:t},i=n[0],r=1;rt){for(r=new Array(n-t+1),i=0;n-i>=t;i++)r[i]=n-i;return r}return[n]}function si(n){var i,t;if(!Array.isArray(n))throw"arr must be an array";for(i=new Array(n.length),t=0;t0;if(n.nodeType===1)return $(t).is(n)&&!$.contains(n,t);throw"elem must be a jQuery object or a DOM element";}function vi(n,t){if(typeof n!="number"&&(!Array.isArray(n)||r(n,function(n){return typeof n=="number"})))throw"keys must be a single number or an array of numbers";return function(i){Array.isArray(n)&&a(n,function(n){return n===i.which})?t.apply(this,arguments):typeof n=="number"&&n===i.which&&t.apply(this,arguments)}}function yi(){var i=arguments[arguments.length-1],t,n;if(typeof i!="function")throw"Last argument must be the event handler function to call";for(t=new Array(arguments.length-1),n=0;n<\/span>");return $.map(n.split(t),function(n){return i.text(n.trim()).html()}).join("
")}function d(n){return function(t){if(!Array.isArray(t))return!1;for(var i=0;i0&&(h.pce=a.val());c=$("#peid");c.length>0&&c.val()!=null&&c.val()!==""&&(h.peid=c.val());var w=$.extend({},h,e(f.occupancy),o(f.roomFilter)),v=t.getAllKeys(u),y={};for(l in v)Object.hasOwnProperty(v,l)&&!n.isOneOf(l,i,r,"startdate","enddate","noofrooms","nights","roomcount","pce","peid")&&(y[l]=v[l]);return p=Object.freeze($.extend({},y,w)),t.toString(p,!0)}function e(n){for(var i={},t=0;to&&(o=r);u.trigger()}function l(){return Object.getOwnPropertyNames(e)}function a(t){if(!n.dateRegex.test(t))throw"Invalid date provided";if(to)throw"Date is beyond loaded data";var i=e[t];return i?Object.getOwnPropertyNames(i):[]}function v(t,i){var r,u;if(!n.dateRegex.test(t))throw"Invalid date provided";if(!n.isValidRoomTypeId(i))throw"Invalid room type provided";if(to)throw"Date is beyond loaded data";return(r=e[t],!r)?[]:(u=r[i],u?Object.getOwnPropertyNames(u):[])}function y(i,r,u){var f,h,c;if(!n.dateRegex.test(i))throw"Invalid date provided";if(!n.isValidRoomTypeId(r))throw"Invalid room type provided";if(!n.isValidRatePlanId(u))throw"Invalid rate plan provided";if(io)throw"Date is beyond loaded data";return(f=e[i],!f)?t:(h=f[r],!h)?t:(c=h[u],c||t)}function p(t){if(!n.dateRegex.test(t))throw"Invalid date provided";s=t;for(var i in e)io&&delete e[i];u.trigger()}var e={},o=n.toDateString(new Date(Number.MIN_VALUE)),s=n.toDateString(new Date(Number.MAX_VALUE));return i&&r&&f&&h(r,f,i),Object.freeze({insertAvailabilityData:h,get furthestDateLoaded(){return o},get earliestDateLoaded(){return s},getDates:l,getRoomTypes:a,getRatePlans:v,getAvailabilityInfo:y,forceEarliestDate:p,forceFurthestDate:w})}(i.initialData,i.initialEarliestDate,i.initialFurthestDate),r=r||{},e=function(i,r){function e(t){var u,r,i;if(!t||typeof t!="object")throw"Occupancy data must be an object";u=["RoomName","MaxTotalOccupancy","MaxAdultOccupancy","MaxChildOccupancy"];for(r in t){if(!n.isValidRoomTypeId(r))throw"`"+r+"` is not a valid room type id";if(i=t[r],!i||typeof i!="object")throw"Data for room type `"+r+"` of the occupancy data is not an object";if(Object.getOwnPropertyNames(i).length>u.length)throw"Data for room type `"+r+"` has too many properties";if(n.isUndefNullOrWhitespace(i.RoomName))throw"Data for room type `"+r+"` has an empty or missing room name";if(i.MaxTotalOccupancy&&typeof i.MaxTotalOccupancy!="number")throw"Data for room type `"+r+"` does not specify a number for MaxTotalOccupancy";if(i.MaxAdultOccupancy&&typeof i.MaxAdultOccupancy!="number")throw"Data for room type `"+r+"` does not specify a number for MaxAdultOccupancy";if(i.MaxChildOccupancy&&typeof i.MaxChildOccupancy!="number")throw"Data for room type `"+r+"` does not specify a number for MaxChildOccupancy";}}function o(n){var r={},i,t;for(i in n)t=n[i],r[i]=Object.freeze({RoomName:t.RoomName,MaxTotalOccupancy:t.MaxTotalOccupancy||0,MaxAdultOccupancy:t.MaxAdultOccupancy||0,MaxChildOccupancy:t.MaxChildOccupancy||0});return Object.freeze(r)}function s(i){if(!n.isValidRoomTypeId(i))throw"Invalid room type id";var r=u[i];return r?r:t}function f(){return n.map(Object.getOwnPropertyNames(u),function(n){return parseInt(n)})}function h(){for(var t=f(),i={},n=0;nt.maxInventory)return!1;for(var i=0;ii.availability.furthestDateLoaded)throw"Date provided is beyond the loaded data";var f={},e="firstDay";return n.forEachDayBetween(t,r,function(n){var t=s(n,u,e);f[n]=t;e=t}),f}function s(t,r,f){if(f==="unknown")return"unknown";r=r||i.availability.getRoomTypes(t);var o=n.mapMany(r,function(n){return i.availability.getRatePlans(t,n).map(function(i){return c(t,n,i)})}),e=u(o,["unknown","available","cannotArrive","cannotArrive/minLos","forcedDeparture","closed"]);return n.isOneOf(e,"forcedDeparture","cannotArrive","cannotArrive/minLos")&&n.isOneOf(f,"forcedDeparture","closed","afterClosed")?"afterClosed":e==="forcedDeparture"&&f==="firstDay"?"closed":e}function h(t,r,u){for(var e,f=n.addDays(t,1);f1){for(e=1;ei.availability.furthestDateLoaded)return"unknown";if(o=i.availability.getAvailabilityInfo(n.addDays(t,e),r,u),!o.CanContinueStay)return"cannotArrive/minLos"}return"available"}return!f.CanDepart||f.CanArrive||f.CanContinueStay?f.CanDepart||f.CanArrive||f.CanContinueStay?"cannotArrive":"closed":"forcedDeparture"}function f(t,i,r){var f=e(t,i,r);return n.mapValues(f,function(t){return u(n.map(t,"departureStatus"),["available","cannotDepart/ctd","forcedDeparture/maxLos","cannotDepart/minLos","forcedDeparture","afterClosed","closed"])})}function e(t,r,u){if(r<=t)throw"calculateUpTo must be after arrivalDate";if(t>i.availability.furthestDateLoaded||r>i.availability.furthestDateLoaded)throw"arrivalDate or calculateUpTo are beyond the loaded data";if(u&&!n.isValidRoomTypeIdArray(u))throw"roomTypes must be an array of room type ids";var f={};return n.forEachDayBetween(n.addDays(t,1),r,function(n){f[n]=[]}),u=u||i.availability.getRoomTypes(t),u.forEach(function(n){i.availability.getRatePlans(t,n).forEach(function(i){var u=l(t,n,i,r);for(var e in u)f[e].push({roomType:n,ratePlan:i,departureStatus:u[e]})})}),f}function l(t,r,u,f){var e=i.availability.getAvailabilityInfo(t,r,u),c=e.MaxLengthOfStay,l=e.MinLengthOfStay,o={},s=1,h=!1;return n.forEachDayBetween(n.addDays(t,1),f,function(t){var e=i.availability.getAvailabilityInfo(t,r,u),f=a(e,s,h,l,c);n.isOneOf(f,"afterClosed","closed","forcedDeparture","forcedDeparture/maxLos")&&(h=!0);o[t]=f;s++}),o}function a(n,t,i,r,u){return i||t>u?"afterClosed":n.CanDepart||n.CanContinueStay?n.CanDepart&&!n.CanContinueStay?"forcedDeparture":t===u&&n.CanDepart?"forcedDeparture/maxLos":n.CanDepart?ti.availability.furthestDateLoaded)throw"Date provided is beyond the loaded data";if(u=0,r=r||i.availability.getRoomTypes(t),r.forEach(function(n){i.availability.getRatePlans(t,n).forEach(function(r){var f=i.availability.getAvailabilityInfo(t,n,r).MinLengthOfStay;f>u&&(u=f)})}),u===0)return 0;var e=n.addDays(t,u),s=f(t,e,r),o=1;return n.forEachDayBetween(n.addDays(t,1),e,function(n){if(s[n]!=="cannotDepart/minLos")return!1;o++}),o}function y(t){if(!n.isValidOccupanciesArray(t))throw"Invalid occupancies list";return n.where(i.occupancy.getRoomTypeIds(),function(r){var u=i.occupancy.getOccupancyInfo(r);return n.any(t,function(n){return n.children<=u.MaxChildOccupancy&&n.adults<=u.MaxAdultOccupancy&&n.children+n.adults<=u.MaxTotalOccupancy})})}function p(t){if(!n.isValidOccupancyValue(t))throw"Invalid occupancy";return n.any(i.occupancy.getRoomTypeIds(),function(n){var r=i.occupancy.getOccupancyInfo(n);return t.children<=r.MaxChildOccupancy&&t.adults<=r.MaxAdultOccupancy&&t.children+t.adults<=r.MaxTotalOccupancy})}function w(){var t=n.map(i.occupancy.getRoomTypeIds(),i.occupancy.getOccupancyInfo);return Object.freeze({adults:n.max(n.map(t,function(n){return n.MaxAdultOccupancy})),children:n.max(n.map(t,function(n){return n.MaxChildOccupancy})),total:n.max(n.map(t,function(n){return n.MaxTotalOccupancy}))})}function b(t,r){if(t===undefined)return!0;var u=n.map(t,i.occupancy.getOccupancyInfo);return n.all(r,function(t){return n.any(u,function(n){return t.adults<=n.MaxAdultOccupancy&&t.children<=n.MaxChildOccupancy&&t.adults+t.children<=n.MaxTotalOccupancy})})}if(!i||typeof i!="object")throw"Invalid availabilityData provided";var r=null;return Object.freeze({getArrivalStates:o,getDepartureStatesByDateAndRatePlan:e,getDepartureStates:f,getMinLengthOfStay:v,get furthestDateLoaded(){return i.availability.furthestDateLoaded},get earliestDateLoaded(){return i.availability.earliestDateLoaded},get hasInitialAvailabilityData(){return i.hasInitialAvailabilityData},getCompatibleRoomTypesForOccupancies:y,hasCompatibleRoomTypesForOccupancy:p,isRoomSelectionAbleToSatisfyOccupancies:b,get maximumInventory(){return i.occupancy.maxInventory},get roomTypes(){return i.occupancy.getRoomTypes()},get roomTypeIds(){return i.occupancy.getRoomTypeIds()},get maximumOccupancy(){return w()},attachListener:i.attachListener,get validator(){return r===null&&(r=t(this)),r}})}}(window.eviivo.availabilityCalendar.utils,window.eviivo.availabilityCalendar.stateValidation);window.eviivo=window.eviivo||{};window.eviivo.availabilityCalendar=window.eviivo.availabilityCalendar||{};window.eviivo.availabilityCalendar.logicCache=function(){var n=eviivo.availabilityCalendar.utils;return function(t,i){function r(r,u){var f=n.addDays(r,i),e;return f=n.clampAbove(t.furthestDateLoaded)(f),e=t.getArrivalStates(r,f,u),Object.freeze({get arrival(){return e},get dateCalculatedTo(){return f},tryEnsureWindow:function(n){n<=f||f").addClass("arrow").addClass(i.vertical).prependTo(this)}},show:!1,hide:!1,tooltipClass:o.join(" "),open:function(t,i){var r=n(i.tooltip),u=n(this),f=r.offset(),e=u.offset();u.append(r);r.css("left",f.left-e.left+"px").css("top",f.top-e.top+"px")}})}}function o(){s()}function s(){n("table.ui-datepicker-calendar td.tooltip-forceShow",u).each(function(t,i){var r=n(i);f(r);r.tooltip("open");var e=r.data("ui-tooltip").tooltips,o=Object.getOwnPropertyNames(e)[0],u=n("#"+o).clone(!1,!1);r.tooltip("destroy");u.attr("id",null);r.append(u)})}function e(i,r,u,e){var s,h;if(!(i instanceof n))throw"$cell must be a jQuery object";if(i.length===0)throw"$cell does not represent any elements";if(i.length>1)throw"$cell must only represent one element";if(!i.is("td")||i.parents("table.ui-datepicker-calendar").length===0)throw"$cell is not a cell in the datepicker calendar";if(t.isUndefNullOrWhitespace(r))throw"text must be defined";if(u=function(){if(u===undefined||u===null)return[];if(typeof u=="string")return t.cssClassStringToArray(u);if(Array.isArray(u)){if(!t.isArrayOf("string"))throw"cssClasses, if an array, must only contain strings";return t.mapMany(u,t.cssClassStringToArray)}throw"cssClasses must be a string or an array of strings";}(),e!==undefined&&(typeof e!="number"||e<=0))throw"duration must be a positive integer";e=e||6e3;i.data("tooltip-flash",!0);f(i,r);i.tooltip("open");var c=i.data("ui-tooltip").tooltips,l=Object.getOwnPropertyNames(c)[0],o=n("#"+l).clone(!1,!1);i.tooltip("destroy");o.attr("id",null).appendTo(i).css("display","none");s={"background-color":o.css("background-color"),color:o.css("color")};o.addClass(u.join(" "));h={"background-color":o.css("background-color"),color:o.css("color")};o.removeClass(u.join(" ")).css("display","");o.css(h).delay(e/6).animate(s,{duration:e*2.5/6,easing:"swing",complete:function(){o.animate({opacity:0},{duration:e*2.5/6,easing:"swing",complete:function(){o.remove();i.data("tooltip-flash",!1)}})}})}if(i)u.on("click","table.ui-datepicker-calendar td.not-clickable",undefined,function(t){var i=n(t.currentTarget);e(i,i.attr("title"),"tooltip-error",2500)});else{u.on("mouseover","table.ui-datepicker-calendar td",undefined,function(t){var i=n(t.target).parents("td");i.hasClass("tooltip-forceShow")||i.data("tooltip-flash")===!0||(f(i),i.tooltip("open"))});u.on("mouseover","table.ui-datepicker-calendar td div.ui-tooltip",undefined,function(t){var i=n(t.target),r;if(i.hasClass("arrow"))return t.stopPropagation(),!1;r=i.parents("td");r.hasClass("tooltip-forceShow")||r.data("tooltip-flash")===!0||i.parents("td").tooltip("close")});u.on("click","table.ui-datepicker-calendar td.not-clickable",undefined,function(t){var f=n(t.currentTarget),i=n("div.ui-tooltip",f),r,u;i.finish();r=i.css("background-color");i.addClass("tooltip-error");u=i.css("background-color");i.removeClass("tooltip-error");i.css("background-color",u).animate({"background-color":r},{duration:2500,easing:"swing",complete:function(){i.css("background-color","")}})})}return Object.freeze({updateUi:o,flashTooltip:e})}}(window.jQuery,window.eviivo.availabilityCalendar.utils,window.eviivo.utils.isMobile);window.eviivo=window.eviivo?window.eviivo:{};window.eviivo.availabilityCalendar=window.eviivo.availabilityCalendar||{};window.eviivo.availabilityCalendar.ui=window.eviivo.availabilityCalendar.ui||{};window.eviivo.availabilityCalendar.ui.calendar=function(n,t,i,r,u,f){var e=/^date-([0-9]{4}-[01][0-9]-[0123][0-9])$/;return function(o,s,h,c){function a(n){var i,u;if(!t.setEqual(c.stateNames,Object.getOwnPropertyNames(n)))throw"Tooltip resources state level does not match states in state machine";i={};for(u in n)i[u]=r(n[u]);return Object.freeze(i)}var l=a(o.resources.tooltips);return function(r,a){function et(){r.parents("div.mod-search-inline").prepend('
<\/div>')}function ot(){n("#ac_mask").remove()}function st(n,i,r){var l=t.toDateString(new Date(i,n-1,1)),c=t.endOfMonth(l)>t.toDateString(v.start.date)?1:lt.today()&&f>t.toDateString(v.start.date)?(u=t.clampAbove(t.today())(u),e="do the call"):(e="do not call (ajaxEndDate > utils.today())",u=null,f=null)):c==0&&(e="do not call (direction == 0)",p(l));u!=null&&rt(u,f,r,c)}}function rt(n,t,i,r){et();h.loadAvailabilityDataBetweenDates(n,t,function(){ut(n,t,r);ft();ot();typeof i=="function"&&i()})}function ht(n,i){var r=t.startOfMonth(n),u=t.endOfMonth(t.addMonths(r,o.monthsToShow));p(n);rt(r,u,i,0)}function p(n){var i=t.startOfMonth(n);v.start.date=t.parseDate(i);v.start.month=v.start.date.getMonth();v.start.year=v.start.date.getFullYear();v.end.date=t.parseDate(t.endOfMonth(t.addMonths(i,o.monthsToShow-1)));v.end.month=v.end.date.getMonth();v.end.year=v.end.date.getFullYear();v.datesAreSet=!0}function ut(n,i,r){var u=t.startOfMonth(n);r<=0&&(y.start.date=t.parseDate(u),y.start.month=v.start.date.getMonth(),y.start.year=v.start.date.getFullYear());r>=0&&(y.end.date=t.parseDate(t.endOfMonth(i)),y.end.month=v.end.date.getMonth(),y.end.year=v.end.date.getFullYear());y.datesAreSet=!0}function ct(){var n=t.toDateString(v.start.date);n=t.addMonths(n,1);p(n)}function lt(){var n=t.toDateString(v.start.date);n=t.addMonths(n,-1);p(n)}function ft(){y.datesAreSet==!1&&ut(s.earliestDateLoaded,s.furthestDateLoaded,0);d=!0;w++;r.datepicker("option",{maxDate:t.parseDate(vt())});r.datepicker("setDate",null);at();w--;r.datepicker("refresh")}function at(){var n=r.data("datepicker");n.drawMonth=v.start.month;n.drawYear=v.start.year;n.selectedDay=1;n.selectedMonth=v.start.month;n.selectedYear=v.start.year}function vt(){return s.furthestDateLoaded===h.furthestDateAvailableFromServer?t.addDays(t.endOfMonth(s.furthestDateLoaded),1):s.furthestDateLoaded===t.endOfMonth(s.furthestDateLoaded)?t.addDays(s.furthestDateLoaded,1):s.furthestDateLoaded}function yt(n,i){if(typeof i!="object")throw"Invalid state returned from dateState";var f=function(){if(!t.isOneOf(i.clickable,!0,!1,undefined,null))throw"dateState.clickable has an unrecognized value";return!!i.clickable}(),u=Object.freeze(function(){if(typeof i.classes=="string")return t.cssClassStringToArray(i.classes);if(t.isArrayOf("string")(i.classes))return t.mapMany(i.classes,t.cssClassStringToArray);throw"dateState.classes has an unrecognized value";}()),r=Object.freeze(function(){var r,n;if(i.tooltipFormat&&typeof i.tooltipFormat!="object")throw"dateState.tooltipFormat must be an object to be passed to utils.format";if(!t.isOneOf(i.forceShowOverride,!0,!1,undefined,null))throw"dateState.forceShowOverride has an unrecognized value";return r=t.prefixAll(".",u).join(""),l[c.stateName][r]||console.log("Missing tooltip for "+r),n=t.deepClone(l[c.stateName][r]),n.text=n.text&&i.tooltipFormat?t.format(n.text,i.tooltipFormat):n.text,n.forceShow=t.isOneOf(i.forceShowOverride,!0,!1)?i.forceShowOverride:n.forceShow,n}()),e=Object.freeze(function(u){return u.push("tooltip-pos-"+r.pos),u.push("date-"+t.toDateString(n)),r.forceShow&&u.push("tooltip-forceShow"),i.clickable||u.push("not-clickable"),u}(t.deepClone(u)));return Object.freeze({clickable:f,tooltip:r,classes:e})}function pt(n){if(n===undefined)return[];if(typeof n!="object")throw"result of onDateSelect must be undefined or an object";return Object.freeze(function(){function i(n){if(n===undefined||n===null||typeof n!="object")throw"flashTooltip element must be an object";var i=function(){if(t.isUndefNullOrWhitespace(n.text))throw"flashTooltip[].text must be a non-empty string";return n.text}(),r=Object.freeze(function(){if(n.classes===undefined||n.classes===null)return[];if(typeof n.classes=="string")return t.cssClassStringToArray(n.classes);if(Array.isArray(n.classes))return t.mapMany(n.classes,t.cssClassStringToArray);throw"flashTooltip[].classes must be a string or array";}()),u=function(){if(!t.dateRegex.test(n.date))throw"flashTooltip[].date must be a valid date string";return n.date}();return Object.freeze({action:"flashTooltip",text:i,classes:r,date:u})}return n.flashTooltip===undefined?[]:Array.isArray(n.flashTooltip)?t.map(n.flashTooltip,i):[i(n.flashTooltip)]}())}function wt(t){t.action==="flashTooltip"&&g.flashTooltip(n("td.date-"+t.date,r),t.text,t.classes)}function bt(){var i,e,f,u;w===0&&d&&(g.updateUi(),n("td a.ui-state-highlight").removeClass("ui-state-highlight"),n("td a.ui-state-active").removeClass("ui-state-active"),i=kt(),e=t.toDateString(r.datepicker("option","maxDate")),i.lastDate>e&&(i.lastDate>h.furthestDateAvailableFromServer?(f=t.splitIntoHtmlLines(t.format(o.resources.limitOfData,{PhoneNumber:o.property.Number}),"|"),u=n('

<\/p><\/div><\/div>'),u.find("div.calendar-overlay-text").find("p").html(f),i.$tableElem.after(u),u.append(i.$tableElem)):i.lastDate>s.furthestDateLoaded&&(f=t.splitIntoHtmlLines(t.format(o.resources.dataLoading,{})),u=n('

<\/p><\/div><\/div>'),u.find("div.calendar-overlay-text").find("p").html(f),i.$tableElem.after(u),u.append(i.$tableElem))),b.length>0&&(b.forEach(wt),b=[]))}function kt(){var i;return a.monthsToShow===1?(i=t.toDateString(v.end.date),{month:v.end.month+1,year:v.end.year,lastDate:t.endOfMonth(i),$tableElem:n("table.ui-datepicker-calendar",r)}):(i=t.toDateString(v.end.date),{month:v.end.month+1,year:v.end.year,lastDate:t.endOfMonth(i),$tableElem:n(".ui-datepicker-group-last table.ui-datepicker-calendar",r)})}function dt(i){if(!(i instanceof n))throw"$cell must be a jQuery object";if(i.length!==1)throw"$cell must refer to one element";var r=t.cssClassStringToArray(i.prop("class")),u=t.single(r,function(n){return e.test(n)});return e.exec(u)[1]}function gt(){r.datepicker("destroy");r.empty().removeClass("calendar-displayed");k&&k.destroy()}var w=0,d=!1,b=[],ni={month:a.month,year:a.year},v={datesAreSet:!1,start:{date:null,month:null,year:null},end:{date:null,month:null,year:null}},y={datesAreSet:!1,start:{date:null,month:null,year:null},end:{date:null,month:null,year:null}},g=i(r),nt="en-gb",tt,it,k;o.resources.selectedCultureLanguageCode!=null&&(nt=o.resources.selectedCultureLanguageCode);tt=new Date;it=tt.evStandardFirstDayCalendarOffset(nt);r.datepicker({numberOfMonths:a.monthsToShow,showButtonPanel:!1,showOtherMonths:!1,minDate:new Date,dateFormat:o.resources.dateDisplayFormat,altFormat:o.resources.dateDisplayFormat,firstDay:it,onChangeMonthYear:function(n,t){st(t,n)},afterShow:bt,beforeShowDay:function(n){var r=t.toDateString(n),u=c.dateState(r),i=yt(n,u);return v.datesAreSet==!1&&i.classes!=null&&i.classes.indexOf("arr-past")<0&&p(r),[i.clickable,i.classes.join(" "),i.tooltip.text]},onSelect:function(n,i){var r=new Date(i.selectedYear,i.selectedMonth,i.selectedDay),u=t.toDateString(r),f=c.onDateSelect(u),e=pt(f);Array.prototype.push.apply(b,e)}});k=f?u.attach(r[0]):null;r.on("mouseover","table.ui-datepicker-calendar td",undefined,function(i){var u=n(i.target).parents("td"),f;u.hasClass("not-clickable")||(u.hasClass("dep-available")||u.hasClass("dep-forcedDeparture"))&&(f=dt(u),t.forEachDayBetween(t.addDays(c.selectedArrivalDate,1),f,function(t){var i=t===f?"hover-checkout":"hover-interim";n("td.date-"+t,r).addClass(i)}))}).on("mouseout","table.ui-datepicker-calendar td",undefined,function(){n("td",r).removeClass("hover-interim hover-checkout")});return Object.freeze({updateUi:ft,refreshData:ht,get drawState(){return{month:v.start.month,year:v.start.year,monthsToShow:r.datepicker("option","monthsToShow")}},destroy:gt})}}}(jQuery,window.eviivo.availabilityCalendar.utils,window.eviivo.availabilityCalendar.ui.calendarTooltips,window.eviivo.availabilityCalendar.ui.tooltipResourceParser,window.FastClick,window.eviivo.utils.isMobile);window.eviivo=window.eviivo?window.eviivo:{};window.eviivo.availabilityCalendar=window.eviivo.availabilityCalendar||{};window.eviivo.availabilityCalendar.ui=window.eviivo.availabilityCalendar.ui||{};window.eviivo.availabilityCalendar.ui.responsiveCalendar=function(n,t,i){function r(i){var e,o,r,u,f,s,h;if(i.is(function(t,i){return n(i).data("months-to-show")===undefined}))throw"One or more calendar container elems does not have a data-months-to-show attribute";if(e=t.$hasCount(i,1,function(t){var i=n(t);return i.data("min-width")===undefined||i.data("min-width")===0}),!e)throw"There is either no, or more than one, calendar container elem that has either not specified min-width or has a min-width of 0. There must be one and only one.";if(o=t.$hasCount(i,1,function(t){var i=n(t);return i.data("max-width")===undefined}),!o)throw"There is either no, or more than one, calendar container elem that has not specified max-width. There must be one and only one.";if(r=[],i.each(function(i,u){for(var h,s=n(u),e=parseInt(s.data("min-width")||0),o=parseInt(s.data("max-width")||t.MAX_SAFE_INTEGER),f=0;f=r[f].min&&e<=r[f].max)throw"Element `"+t.$elemSummary(s)+"`'s min-width conflicts with element `"+t.$elemSummary(r[f].$elem)+"`'s range";else if(o>=r[f].min&&o<=r[f].max)throw"Element `"+t.$elemSummary(s)+"`'s max-width conflicts with element `"+t.$elemSummary(r[f].$elem)+"`'s range";h=function(){if(e!==0&&o!==t.MAX_SAFE_INTEGER)return"(min-width: "+e+"px) and (max-width: "+o+"px)";if(e!==0)return"(min-width: "+e+"px)";if(o!==t.MAX_SAFE_INTEGER)return"(max-width: "+o+"px)";throw"Algorithm error";}();r.push(Object.freeze({min:e,max:o,monthsToShow:s.data("months-to-show"),$elem:s,get isCurrentlyApplicable(){return Modernizr.mq(h)}}))}),r.sort(function(n,t){return n.min-t.min}),r[0].min!==0)throw"Algorithm error: First range does not have a min-width of 0";if(r[r.length-1].max!==t.MAX_SAFE_INTEGER)throw"Algorithm error: Last range does not have a max-width of MAX_SAFE_INTEGER";for(u=1;ur.dateCalculatedTo)return{classes:"arr-unknown",clickable:!1};if(u)return{classes:n.prefixAll("arr-",u.split("/")),clickable:u==="available"};throw"UNKNOWN DATE STATE";}},onDateSelect:function(n,t){n.transitionState("departure",t,n.selectedOccupancies,n.selectedRoomTypes)},allowShowPrices:!1,allowClearDates:!1,transitionFunc:function(n,t){this.state.selectedArrivalDate=null;this.state.selectedDepartureDate=null;this.state.selectedOccupancies=n;this.state.selectedRoomTypes=t}})}}(window.eviivo.availabilityCalendar.utils);window.eviivo=window.eviivo?window.eviivo:{};window.eviivo.availabilityCalendar=window.eviivo.availabilityCalendar||{};window.eviivo.availabilityCalendar.ui=window.eviivo.availabilityCalendar.ui||{};window.eviivo.availabilityCalendar.ui.states=window.eviivo.availabilityCalendar.ui.states||{};window.eviivo.availabilityCalendar.ui.states.departure=function(n){function i(t,i){return n.prefixAll(t+"-",i.split("/"))}function t(t,i,r){for(var u=n.addDays(i,1);t[u]!==undefined;u=n.addDays(u,1))if(r(t[u]))return u;throw new"No date with condition";}return function(r,u){return Object.freeze({dateState:function(r,u){var f=u.arrivalDepartureCache(n.today(),r.selectedArrivalDate,r.selectedRoomTypes),o=t(f.departure,r.selectedArrivalDate,function(t){return n.isOneOf(t,"available","forcedDeparture/maxLos","forcedDeparture")}),e=n.nightsBetween(r.selectedArrivalDate,o);return function(r,u){var o,h,s;if(f.tryEnsureWindow(u),o=f.departure[u],uf.dateCalculatedTo)return{classes:["dep-unknown"],clickable:!1};if(u1};if(o==="cannotDepart/minLos")return h=t(f.departure,u,function(n){return n!=="cannotDepart/minLos"}),{classes:["dep-cannotDepart","dep-minLos"],clickable:n.isOneOf(f.departure[h],"available","forcedDeparture/maxLos","forcedDeparture"),tooltipFormat:{MinLengthOfStay:f.minLengthOfStay}};if(o==="afterClosed")return s=f.arrival[u],{classes:["dep-afterClosed"].concat(n.prefixAll("arr-",s.split("/"))),clickable:s==="available"};if(o)return{classes:n.prefixAll("dep-",o.split("/")),clickable:n.isOneOf(o,"available","forcedDeparture/maxLos","forcedDeparture")};throw"UNKNOWN DATE STATE";}},onDateSelect:function(t,i){var e,f,o;if(i<=t.selectedArrivalDate){t.transitionState("departure",i,t.selectedOccupancies,t.selectedRoomTypes);return}if(e=u.getMinLengthOfStay(t.selectedArrivalDate,t.selectedRoomTypes),f=n.addDays(t.selectedArrivalDate,e),i<=f)return(t.transitionState("selected",t.selectedArrivalDate,f,t.selectedOccupancies,t.selectedRoomTypes),iu.dateCalculatedTo)return{classes:["selected-unknown"],clickable:!1,tooltipFormat:e};if(r1?"selected-checkInDate":["selected-checkInDate","selected-lastNight"],clickable:!0,tooltipFormat:e};if(i.selectedArrivalDatei.selectedDepartureDate&&o!=="afterClosed")return{classes:["selected-afterCheckOutDate"].concat(t("dep",o)),clickable:n.isOneOf(o,"available","forcedDeparture/maxLos","forcedDeparture"),tooltipFormat:e};if(r>i.selectedDepartureDate&&o==="afterClosed")return{classes:["selected-afterCheckOutDate","dep-afterClosed"].concat(t("arr",s)),clickable:s==="available",tooltipFormat:e};throw"INVALID DATE STATE";}},onDateSelect:function(t,i){var u,f,e;i<=t.selectedArrivalDate?t.transitionState("departure",i,t.selectedOccupancies,t.selectedRoomTypes):is.length)for(i=s.length;ir;i--)s.pop();else{var u=n(t.target),o=u.data("room"),h=u.hasClass("cp-select-roomAdults")?"adults":"children";s[o-1][h]=parseInt(u.val())}l()}function tt(t){var i,r;(t.stopPropagation(),i=n(t.target),i.hasClass("disabled"))||(r=i.data("room")-1,s.splice(r,1),l())}function it(){var i=s,n=f.getCompatibleRoomTypesForOccupancies(i),e,h;s=null;u.selectedDepartureDate!==null&&f.validator.validateCheckOutDate(n,u.selectedArrivalDate,u.selectedDepartureDate)?u.transitionState("selected",u.selectedArrivalDate,u.selectedDepartureDate,i,n):u.selectedArrivalDate!==null&&f.validator.validateCheckInDate(n,u.selectedArrivalDate)?(e=u.selectedDepartureDate!==null,u.transitionState("departure",u.selectedArrivalDate,i,n),e&&r.trigger("calendar:error:checkOutDateReset")):(h=u.selectedArrivalDate!==null,u.transitionState("arrival",i,n),o!=null&&typeof o.calendarRefreshData=="function"&&o.calendarRefreshData(t.addDays(t.today(),-1)),h&&r.trigger("calendar:error:datesReset"))}function l(){var n=s||u.selectedOccupancies,i=!f.hasCompatibleRoomTypesForOccupancy({adults:0,children:1});h.toggleClass("no-children",i);h.toggleClass("single-inventory",f.maximumInventory<=1);r.toggleClass("error",t.any(n,t.not(f.hasCompatibleRoomTypesForOccupancy)));rt(n);ut(n);ft(n,i);et(n)}function rt(n){var i=t.range(1,f.maximumInventory),r=t.map(i,function(n){var i="";return i=n>1?e.roomCountOptionPlural:e.roomCountOption,'

").addClass("arrow").addClass(i.vertical).prependTo(this)}},show:!1,hide:!1,open:function(t,i){var r=n(i.tooltip),u=n(this),f=r.offset(),e=u.offset();u.append(r);r.css("left",f.left-e.left+"px").css("top",f.top-e.top+"px")}});i.tooltip("open");var s=i.data("ui-tooltip").tooltips,h=Object.getOwnPropertyNames(s)[0],e=n("#"+h).clone(!1,!1).attr("id",c+f).addClass("tooltip-error").css("z-index",t.MAX_SAFE_INTEGER).appendTo(i);i.tooltip("destroy");e.delay(u/5).removeClass("tooltip-error",{duration:u*2/5,easing:"swing",complete:function(){e.animate({opacity:0},{duration:u*2/5,easing:"swing",complete:function(){e.remove()}})}})}function a(i){var u,f;if(i instanceof Date)u=i;else if(typeof i=="string"&&t.dateRegex.test(i))u=t.parseDate(i);else throw"Unknown date format";return f=r.resources.dateDisplayFormat,n.datepicker.formatDate(f,u)}function k(){h.prop("disabled",!f.allowShowPrices).toggleClass("disabled",!f.allowShowPrices);b.prop("disabled",!f.allowClearDates).toggleClass("disabled",!f.allowClearDates);p.text(f.selectedArrivalDate?a(f.selectedArrivalDate):"");w.text(f.selectedDepartureDate?a(f.selectedDepartureDate):"");f.selectedArrivalDate&&f.selectedDepartureDate?l.text(t.nightsBetween(f.selectedArrivalDate,f.selectedDepartureDate)):l.text("")}function d(){u.trigger("calendar:submit")}var v=n("span.startDateTooltip",u).on("click",function(){f.allowShowPrices||e(v,r.resources.selectDatesError,1500,"dates")}),y=n("span.endDateTooltip",u).on("click",function(){f.allowShowPrices||e(y,r.resources.selectDatesError,1500,"dates")}),o=n("#checkin-text",u).on("click",function(){f.allowShowPrices||e(o,r.resources.selectDatesError,1500,"dates")}),p=n("span.date-format",o),s=n("#checkout-text",u).on("click",function(){f.allowShowPrices||e(s,r.resources.selectDatesError,1500,"dates")}),w=n("span.date-format",s),b=n("#clear-dates",u).on("click",function(){u.trigger("calendar:reset")}),g=n(".cp-button-price-wrapper button.cp-button-text",u).on("click",function(){u.addClass("searchExpanded");u.trigger("calendar:refreshData")}),l=n("#numberOfNights span",u),h=n("button.cp-button-price",u).on("click",function(){f.transitionState("searchDone",f.selectedArrivalDate,f.selectedDepartureDate,f.selectedOccupancies,f.selectedRoomTypes);u.trigger("calendar:submit");var t=n("
<\/span><\/div>"),i=n(".results-item-group").append(t)}),c;h.next(".button-overlay").on("click",function(){e(h,r.resources.selectDatesError,1500,"button-overlay")});u.on("calendar:error:checkOutDateReset",function(){e(s,r.resources.checkOutIncompatible,3e3,"dates")}).on("calendar:error:datesReset",function(){e(o,r.resources.checkInIncompatible,3e3,"dates")});return c="chrome-tooltip-"+i()+"-",Object.freeze({updateUi:k,triggerSearch:d})}}(jQuery,window.eviivo.availabilityCalendar.utils,eviivo.utils.uuid);window.eviivo=window.eviivo?window.eviivo:{};window.eviivo.availabilityCalendar=window.eviivo.availabilityCalendar?window.eviivo.availabilityCalendar:{};window.eviivo.availabilityCalendar.ui=window.eviivo.availabilityCalendar.ui?window.eviivo.availabilityCalendar.ui:{};window.eviivo.availabilityCalendar.ui.main=function(n,t,i,r,u,f,e,o){n(function(){n.datepicker._updateDatepicker_original=n.datepicker._updateDatepicker;n.datepicker._updateDatepicker=function(t){n.datepicker._updateDatepicker_original(t);var i=this._get(t,"afterShow");i&&i.apply(t.input?t.input[0]:null)}});var s=Object.freeze({roomsLimit:3,eviivoSearchBoxId:"#eviivo-availability-search",cultureLanguageCode:"en-GB",baseSearchUrl:"",preloadMonths:6});return function(h,c,l){function nt(){var n=eviivo.util.debounce({func:p,unique:"updateUi"})}function p(){y.removeClass("pre-ui-init");y.removeClass(a.stateNames.join(" ")).addClass(a.stateName);b.updateUi();g.updateUi();d.updateUi();w.updateUi()}function tt(){b.triggerSearch()}function it(){var t={startDate:a.selectedArrivalDate,endDate:a.selectedDepartureDate,occupancy:a.selectedOccupancies,roomFilter:a.selectedRoomTypes},i=o.generateNewUrlFromCriteria(window.location.search,t,n("#ref").val());window.location.assign(v.baseSearchUrl+i)}function k(n){if(typeof n!="function")throw"func must be a function";var i=t.parseDate(t.addDays(t.today(),1)),r=i.getTime()+500-(new Date).getTime();window.setTimeout(function(){n();k(n)},r)}function rt(n){var u=function(){if(h.validator.validateOccupancies(n.occupancy))return n.occupancy;var t=h.validator.cleanOccupancies(n.occupancy);return h.validator.validateOccupancies(t)?cleanOccupancies:Object.freeze([Object.freeze({adults:1,children:0})])}(),f=function(){if(h.validator.validateRoomTypes(u,n.roomFilter))return n.roomFilter;var t=h.validator.cleanRoomTypes(u,n.roomFilter);return h.validator.validateRoomTypes(u,t)?t:undefined}(),r=n.startDate&&n.startDate>=t.today()?n.startDate:null,e=n.endDate&&r!==null&&n.endDate>r?n.endDate:null;try{if(r===null&&e===null)return i(v,h,"arrival",u,f);if(r!==null&&e===null)return i(v,h,"departure",r,u,f);if(r===null)throw"Logic broken - check out date cannot be not null with a null check in date";else return i(v,h,"searchDone",r,e,u,f)}catch(o){window.Sentry.captureException(o);throw"Availability calendar broken - Details:"+o;}}var v=t.immutableDeepClone(n.extend({},s,l)),a=rt(o.extractCriteriaFromUrl(window.location.search)),y=n(v.eviivoSearchBoxId),w=e(n(".calendar-display",y),v,a,h,c),d=r(n("div.column-occupancy",y),a,h,v.resources.occupancySelector,{calendarRefreshData:w.refreshData}),b=u(v,y,a),g=f(n("div.column-roomFilter",y),a,h,v.resources.roomFilter);k(p);window.addEventListener("resize",nt);h.attachListener(a.forceRefresh);h.attachListener(p);a.attachListener(p);y.on("calendar:submit",it);y.on("calendar:reset",function(){a.transitionState("arrival",a.selectedOccupancies,a.selectedRoomTypes);w.refreshData(t.addDays(t.today(),-1))});y.on("calendar:refreshData",function(){w.refreshData(null)});return Object.freeze({updateUi:p,triggerSearch:tt})}}(jQuery,window.eviivo.availabilityCalendar.utils,eviivo.availabilityCalendar.ui.stateMachine,eviivo.availabilityCalendar.ui.occupancySelector,eviivo.availabilityCalendar.ui.chrome,eviivo.availabilityCalendar.ui.roomFilter,eviivo.availabilityCalendar.ui.responsiveCalendar,eviivo.availabilityCalendar.ui.urlHandler)