1"use strict";(self.webpackChunklib=self.webpackChunklib||[]).push([[7195],{37195(e,t,a){a.d(t,{NotAvail:()=>n});var r=a(4241),i=a(95423),o=a(74692);function s(e,t,a,r,i,o,s){try{var l=e[o](s),n=l.value}catch(e){return void a(e)}l.done?t(n):Promise.resolve(n).then(r,i)}function l(e){return function(){var t=this,a=arguments;return new Promise(function(r,i){var o=e.apply(t,a);function l(e){s(o,r,i,l,n,"next",e)}function n(e){s(o,r,i,l,n,"throw",e)}l(void 0)})}}var n=new class{constructor(){this.currentLang=null}init(){this.scrollToList(),this.initChart(),this.formatDate(),this.initCheckAvailForms()}scrollToList(){var e=o(".js-btn-other-hotels");e.length>0&&e.on("click",()=>{o("html, body").animate({scrollTop:o(".js-notavail-title").offset().top},300)})}formatDate(){var e=this;return l(function*(){var t=travel.opts.av_params.from,r=travel.opts.av_params.to,i=o(".js-not-available-from"),s=o(".js-not-available-to");null==travel.opts.lang?e.currentLang="en":e.currentLang=travel.opts.lang,yield a.e(3339).then(a.bind(a,63339)).then(t=>{var{dateFormat:a}=t;e.dateFormatLang=a()}),null==e.dateFormatLang[e.currentLang]&&(e.currentLang="en"),e.printDate(i,t),e.printDate(s,r)})()}printDate(e,t){var a=(0,i.Z)(t),r=a.getDay(),o=this.dateFormatLang[this.currentLang].dayNamesShort[r],s=a.getDate(),l=a.getMonth(),n="<span>"+o+"</span> <span>"+s+"</span> <span>"+this.dateFormatLang[this.currentLang].monthNamesShort[l]+"</span> <span>"+a.getFullYear()+"</span>";e.html(n)}randomInteger(e,t,a){var r=e+("0."+(a=+a))*(t+1-e);return Math.floor(r)}initChart(){var e=travel.opts.sid+travel.opts.obj_id+travel.opts.day+Math.floor(travel.opts.theme/100);e=e.split("").reverse().join("");var t=o(".js-chart");t.length>0&&t.each((t,a)=>{var r=o(a).find(".js-circle-border"),i=r.data("color1"),s=r.data("color2"),l=this.randomInteger(68,89,e),n=0;n=o(a).hasClass("js-chart-full")?360:3.6*l,r.css({"background-color":s}),setTimeout(()=>{this.loopIt(0,n,l,r,i,s)},1),o(".js-percentage").text(l.toFixed(0)+"%")})}loopIt(e,t,a,r,i,o){(e+=1)<0&&(e=0),e>t&&(e=t),a=e/3.6,e<=180?r.css("background-image","linear-gradient("+(90+e)+"deg, transparent 50%,"+i+" 50%),linear-gradient(90deg, "+i+" 50%, transparent 50%)"):r.css("background-image","linear-gradient("+(e-90)+"deg, transparent 50%,"+o+" 50%),linear-gradient(90deg, "+i+" 50%, transparent 50%)"),setTimeout(()=>{this.loopIt(e,t,a,r,i,o)},1)}initCheckAvailForms(){var e=this;return l(function*(){e.checkAvailPopup=o(".js-check-avail-popup");var t=o(".js-not-avail-form"),r=o(".js-other-days"),i=o(".js-check-avail-close"),s=o(".js-form-title-hotel"),n=o(".js-form-title-destination"),c=o(".js-form-title"),h=o(".js-other-hotels"),d=o(".js-check-avail-hotel-horizontal");yield a.e(795).then(a.bind(a,40795)).then(t=>{var{CalendarGuests:a}=t;e.calendarGuests=a}),e.submitFormCheckAvHotel(d),r.on("click",l(function*(){c.hide(),s.show(),e.checkAvailPopup.find(t).addClass("js-check-avail-hotel-is-open"),e.openPopup();var a=e.checkAvailPopup.find(".js-check-avail-hotel-is-open");e.submitFormCheckAvHotel(a)})),h.on("click",()=>{c.hide(),n.show(),e.openPopup()}),i.on("click",()=>{e.closePopup(t)}),e.checkAvailPopup.on("mouseup",a=>{var r=o(".js-check-avail-popup-content");r.is(a.target)||0!==r.has(a.target).length||e.closePopup(t)})})()}submitFormCheckAvHotel(e){e.on("submit",e=>{e.preventDefault();var t=o(e.currentTarget);if(this.dateValidation(t),this.dateValidation(t))return!1;var a=o(".js-guests-dropdown",t),r=o(".js-children-wrapper",t).find("select"),i=this.calendarGuests.validationChildrenAge(r),s=o(".js-error-child",t),l=o(".js-error-children",t);if(i.ifError)return a.hasClass("is-show")||a.addClass("is-show"),1===i.errorCount?(l.hide(),s.show()):(l.show(),s.hide()),!1;this.checkAvail(t)})}dateValidation(e){var t=e.find(".js-date-from-input"),a=e.find(".js-date-to-input"),r=new Date(o(t).val()).getTime();return 30<=(new Date(o(a).val()).getTime()-r)/24/60/60/1e3}openPopup(){o("body").addClass("is-open-popup"),this.checkAvailPopup.removeClass("hidden")}closePopup(e){e.removeClass("js-check-avail-hotel-is-open"),this.checkAvailPopup.addClass("hidden"),o("body").removeClass("is-open-popup")}checkAvail(e){var t=o(".js-first-hotel-id")[0].value,a=travel.opts.lang_id;this.checkAvailHotelReq(e,t,a)}checkAvailHotelReq(e,t,a,i){var s="/check/?"+e.serialize();void 0===i&&(i=0),999==i&&(i=0),0==i&&o.ajax({type:"GET",url:"/check_avail.php",data:{page:"check",ui:travel.options.uuid},dataType:"xml",success:e=>{},error:(e,t,a)=>
1{r.A.error("AvailErrorCheck (xml)",e,t,a)}}),o.ajax({type:"GET",url:s,data:{page:"search",hotel_id:t,lang:a,t:2,r:Math.random(),cnt:i,ui:travel.options.uuid},dataType:"json",success:r=>{var i=r.jid;""!=i?this.checkAvailHotelGet(e,i):r.bad_id?alert("Can't process request"):r.bot||r.error?this.checkAvailHotelRes(e,i):setTimeout(()=>{this.checkAvailHotelReq(e,t,a)},3e3)},error:(o,s,l)=>{r.A.error("AvailError (json)",o,s,l),setTimeout(()=>{this.checkAvailHotelReq(e,t,a,i+1)},3e3)}})}checkAvailHotelGet(e,t){o.ajax({type:"GET",url:"/check/",data:{page:"search",jid:t,t:2,r:Math.random(),ui:travel.options.uuid},dataType:"json",success:r=>{r.done?(Promise.all([a.e(3248),a.e(5610)]).then(a.t.bind(a,45420,23)).then(()=>{o("#splash").dialog().dialog("close")}),o("#jid").val(r.jid),this.checkAvailHotelRes(e,t)):r.bad_id?alert("Can't process request"):r.bot||r.error?(o("#bot").val(r.bot||""),this.checkAvailHotelRes(e,t)):(this.checkAvailPopup.hide(),Promise.all([a.e(3248),a.e(5610)]).then(a.t.bind(a,45420,23)).then(()=>{o("#splash").dialog().dialog("open")}),setTimeout(()=>{this.checkAvailHotelGet(e,t)},1e3))},error:(a,i,o)=>{r.A.error("AvailError (avhotel)",a,i,o),setTimeout(()=>{this.checkAvailHotelGet(e,t)},3e3)}})}checkAvailHotelRes(e,t){var a="/check/?"+o("#form_result").serialize()+"&t=2&r="+Math.random()+"&ui="+travel.options.uuid;o.ajax({url:a,type:"GET",dataType:"html"}).done(t=>{if(-1!=t.search("\x3c!--unavailable--\x3e")){var a="/search/?"+e.serialize()+"&desid="+o(".js-desid")[0].innerHTML+"&cityID="+o(".js-desid")[0].innerHTML+"&fhid="+o(".js-fhid")[0].innerHTML;window.location.href=a}else{var r=o(".js-first-hotel-url")[0].innerHTML+"?"+e.serialize()+"&lang="+o("#lang")[0].value+"#rooms";window.location.href=r}}).fail(()=>{setTimeout(()=>{this.checkAvailHotelRes(e,t)},3e3)})}}},95423(e,t,a){a.d(t,{Z:()=>i});var r=a(23293),i=e=>{var t=String(e).replace(/[Ù -Ù©Û°-Û¹]/g,e=>String(15&e.charCodeAt(0))),[a,i,o]=t.split("-").map(Number),s=new Date(a,i-1,o);return isNaN(s)&&(0,r.l)('Critical: parseLocalDate cannot parse date "'.concat(e,'"')),s}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.