PageSourceSearch

https://www.hotelsljubljana.com/frontend/static/core/build/795.30c741c02de91ea04a18.js

js hotelsljubljana.com collected 2026-10-10 01:26:48 UTC 5,227 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunklib=self.webpackChunklib||[]).push([[795],{40795(t,e,s){s.d(e,{A:()=>o,CalendarGuests:()=>h});var i=s(74692);class r{constructor(){this.guestsWasChanged=!1,this.context=null}init(t){this.context=t,this.initGuests()}initGuests(){if(this.guestsToggler=i(".js-guests-toggler",this.context),this.submitBtn=i(".js-avail-info-submit-btn",this.context),this.guestsDropdown=i(".js-guests-dropdown",this.context),this.guestsInput=i(this.context).find('.js-avail-info[data-avail="guests"]'),this.guestsCount=i(".js-guests-count",this.context),this.guestCountText=i(".js-guests-count-text",this.context),this.guestsText=i(".js-avail-guest",this.context),this.childrenWrapper=i(".js-children-wrapper",this.context),this.dateFromField=i(".js-date-from-field",this.context),this.dateToField=i(".js-date-to-field",this.context),this.adultsSelect=i(".js-adults-select",this.context),this.childrenSelect=i(".js-children-select",this.context),this.childError=i(".js-error-child",this.context),this.childrenError=i(".js-error-children",this.context),this.error=i(".js-error",this.context),this.isChildrenValid=!0,this.childrenTitle=this.createChildrenTitle(),this.cancelBtn=i(".js-cancel-button",this.context),this.okBtn=i(".js-ok-button",this.context),this.takeAndWriteTextIntoField(),0!==parseInt(travel.opts.av_params.children)){var t=1;this.childrenTitle.show(),this.createAndAppend(travel.opts.av_params.children),this.childrenWrapper.find("select").each((e,s)=>{this.selectedOption(i(s),t),t++})}i("body").on("mouseup",t=>{this.guestsDropdown.is(t.target)||0!==this.guestsDropdown.has(t.target).length||this.guestsInput.is(t.target)||0!==this.guestsInput.has(t.target).length||this.submitBtn.is(t.target)||0!==this.submitBtn.has(t.target).length||this.guestDropdownHideValidate()}),this.okBtn.on("click",()=>{this.guestDropdownHideValidate()}),this.cancelBtn.on("click",()=>{this.isChildrenValid?(this.guestsDropdown.removeClass("is-show"),this.guestsToggler.removeClass("is-show")):(this.childrenWrapper.html(null),this.toZeroFields(),this.childrenError.hide(),this.childError.hide(),this.guestsWasChanged=!1),this.takeAndWriteTextIntoField()}),this.guestsToggler.on("click",()=>{this.guestsDropdown.hasClass("is-show")?this.guestDropdownHideValidate():(this.guestsDropdown.addClass("is-show"),this.guestsToggler.addClass("is-show")),(this.dateFromField.hasClass("is-active")||this.dateToField.hasClass("is-active"))&&(this.dateFromField.removeClass("is-active"),this.dateToField.removeClass("is-active"))}),this.childrenSelect.on("change",t=>{var e=this.childrenWrapper.find(".js-children-age-select"),s=parseInt(i(t.target).val());if(this.error.hide(),e.removeClass("is-error"),0===s)return this.childrenTitle.hide(),e.remove(),!1;if(this.childrenTitle.show(),s>e.length)for(var r=1;r<=s;r++)r>e.length&&this.childrenWrapper.append(this.createAndAppendOption(this.createChildAgeSelect(r)));else e.each((t,e)=>{t+1>s&&i(e).remove()});this.takeAndWriteTextIntoField(),this.guestsWasChanged=!0}),i("body").on("change",".js-children-age-select",()=>{var t=this.childrenWrapper.find("select"),e=this.validationChildrenAge(t);e.ifError?(this.showValidationError(e.errorCount),this.isChildrenValid=!1):(this.error.hide(),this.isChildrenValid=!0)}),this.adultsSelect.on("change",()=>{this.takeAndWriteTextIntoField(),this.guestsWasChanged=!0})}openGuests(){this.guestsDropdown.addClass("is-show"),this.guestsToggler.addClass("is-show")}guestDropdownHideValidate(){var t=this.childrenWrapper.find("select"),e=this.validationChildrenAge(t);e.ifError?(this.isChildrenValid=!1,this.showValidationError(e.errorCount)):(this.error.hide(),this.takeAndWriteTextIntoField(),this.guestsDropdown.removeClass("is-show"),this.guestsToggler.removeClass("is-show"))}takeAndWriteTextIntoField(){var t=+this.adultsSelect.val()+ +this.childrenSelect.val(),e=travel.opts.messages.f_avail_guests||{};this.guestCountText.text(e[t]),this.guestsCount.html(t)}createChildrenTitle(){var t=i(document.createElement("div"));return t.addClass("dropdown__title dropdown__title--full-width"),t.html(travel.opts.av_params.childrenTitle),t.hide(),this.childrenWrapper.append(t),{show:()=>t.show(),hide:()=>t.hide()}}createChildAgeSelect(t){return i('<select class="dropdown__select dropdown__select--flex js-children-age-select" name="childAge'.concat(t,'"></select>'))}createAndAppend(t){for(var e=1;e<=t;e++){var s=i('<select class="dropdown__select dropdown__select--flex js-children-age-select" name="childAge'+e+'"></select>');this.childrenWrapper.append(this.createAndAppendOption(s))}}createAndAppendOption(t){t.append('<option value="">-</option>'),t.append('<option value="0"><1</option>');for(var e=1;e<=16;e++){var s=i('<option value="'+e+'">'+e+"</option>");t.append(s)}return t}showValidationError(t){1===t?(this.childrenError.hide(),this.childError.show()):(this.childrenError.show(),this.childError.hide())}toZeroFields(){this.childrenSelect.val(0)}selectedOption(t,e){t.val(travel.opts.av_params["childAge"+e])}validationChildrenAge(t){var e=!1,s=0;return t.each((t,r)=>{i(r).hasClass("is-error")&&i(r).removeClass("is-error"),i(r).val()||(i(r).addClass("is-error"),s++,e=!0)}),{ifError:e,errorCount:s}}}var h=new r;const o=r}}]);

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.