1 2(function($,root,undefined){"use strict";window.Prj0217CompanyContactForm=function(){let component=this;component._bindDateChangingWatcher(component);component._handleNumberOfGuests(component);component._fillEndingDate()} 3$.extend(window.Prj0217CompanyContactForm.prototype,{_bindDateChangingWatcher(component){const $inputDateFrom=$('#date-from');$inputDateFrom.on('change',()=>{component._fillEndingDate()});$(window).on('load',()=>{let $inputAdults=$('#number-of-adults');let $inputChildren=$('#number-of-children');let countAdults=$inputAdults.val()||0;let countChildren=$inputChildren.val()||0;component._handleTotalPrice(component,countAdults,countChildren)})},_fillEndingDate(){const $inputDateTo=$('#date-until');const $inputDateFrom=$('#date-from');const mandatoryDateRange=$inputDateFrom.data('mandatory-day-range');const chosenDate=new Date($inputDateFrom.val());const calculatedFinishDate=new Date(chosenDate.setDate(chosenDate.getDate()+mandatoryDateRange));const day=("0"+calculatedFinishDate.getUTCDate()).slice(-2);const month=("0"+(calculatedFinishDate.getUTCMonth()+1)).slice(-2);const year=calculatedFinishDate.getUTCFullYear();$inputDateTo.val(year+"-"+month+"-"+day)},_handleNumberOfGuests(component){let $inputAdults=$('#number-of-adults');let $inputChildren=$('#number-of-children');let $toggleNumberOfGuests=$('#guests-count-toggle');let $buttonConfirmGuests=$('#number-of-guests-confirm-button');let $popupNumberOfGuests=$('#numberOfGuests');$inputAdults.add($inputChildren).on('change',()=>{let countAdults=$inputAdults.val()||0;let countChildren=$inputChildren.val()||0;$toggleNumberOfGuests.html("dospÄlých: "+countAdults+', dÄtÃ: '+countChildren+'<i class="fas fa-chevron-down"></i>');component._generateInputsStateBenefit(component,countAdults);component._handleTotalPrice(component,countAdults,countChildren)}) 4$buttonConfirmGuests.on('click',()=>{$popupNumberOfGuests.collapse('hide')})},_generateInputsStateBenefit(component,numAdults){let $stateBenefitForm=$('#stateBenefitForm');let numOfBenefitHolders=$('.js-prj0217-benefit-holder-form-row').length;if(numOfBenefitHolders<numAdults){for(let i=numOfBenefitHolders;i<numAdults;i++){component._addInputBenefitHolder(i+1,$stateBenefitForm)}}else if(numOfBenefitHolders>numAdults){for(let i=numOfBenefitHolders;i>numAdults;i--){component._removeInputBenefitHolder(i,$stateBenefitForm)}}},_addInputBenefitHolder(id,$stateBenefitForm){let $formItem=$(` 5 <div class="row js-prj0217-benefit-holder-form-row"> 6 <div class="col-sm-6"> 7 <div class="form-outline form-group"> 8 <input type="text" id="state-benefit-holder-name-`+id+`" class="form-control"/> 9 <label class="form-label" for="state-benefit-holder-name-`+id+`">Host Ä. `+id+`</label> 10 </div> 11 </div> 12 <div class="col-sm-6"> 13 <div class="form-outline form-group"> 14 <input type="text" id="state-benefit-holder-voucher-`+id+`" class="form-control"/> 15 <label class="form-label" for="state-benefit-holder-voucher-`+id+`">ÄÃslo poukazu</label> 16 </div> 17 </div> 18 </div>`);$stateBenefitForm.append($formItem)},_removeInputBenefitHolder(id,$stateBenefitForm){let $rowToRemove=$stateBenefitForm.find('#state-benefit-holder-name-'+id).closest('.js-prj0217-benefit-holder-form-row') 19$rowToRemove.remove()},_handleTotalPrice(id,numAdults,numChildren){let $calcInstruction=$('.html-prj0217-calculation-instruction');let $calcProcess=$('.html-prj0217-calculation-process');let $calcResult=$('.html-prj0217-calculation-result');let $priceToSend=$('#package_price');let currency=$('#priceCurrency').val();let single=parseInt($('#priceSingle').val());let double=parseInt($('#priceDouble').val());let priceTotal;let title;if(numAdults%2!=0){priceTotal=((numAdults-1)*double)+single}else{priceTotal=numAdults*double} 20switch(numAdults){case 1:title='osoba';break;case 2:case 3:case 4:title='osoby';break;default:title='osob';break} 21let $priceRow=$calcProcess.find('.priceRow');$priceRow.find('.customers').text(numAdults);$priceRow.find('.title').text(title);$priceRow.find('.price').text((Math.round((priceTotal/numAdults)*100)/100).toString().replace(/\B(?=(\d{3})+(?!\d))/g,' ').replace('.',','));$priceRow.find('.currency').text(currency);let $priceRowSum=$calcProcess.find('.priceRowSum');$priceRowSum.find('.price').text(priceTotal.toString().replace(/\B(?=(\d{3})+(?!\d))/g,' '));$priceRowSum.find('.currency').text(currency);let $priceTotal=$calcResult.find('.priceTotal');$priceTotal.find('.price').text(priceTotal.toString().replace(/\B(?=(\d{3})+(?!\d))/g,' '));$priceTotal.find('.currency').text(currency);$priceToSend.val(priceTotal);if(numChildren>0){$calcInstruction.filter('.calculation-custom').removeClass('d-none');$calcInstruction.filter('.calculation-incomplete').addClass('d-none');$calcInstruction.filter('.calculation-discount').addClass('d-none');$calcProcess.addClass('d-none');$calcResult.addClass('d-none')}else if(numAdults>0){$calcInstruction.filter('.calculation-custom').addClass('d-none');$calcInstruction.filter('.calculation-incomplete').addClass('d-none');$calcInstruction.filter('.calculation-discount').removeClass('d-none');$calcProcess.removeClass('d-none');$calcResult.removeClass('d-none')}else{$calcInstruction.filter('.calculation-custom').addClass('d-none');$calcInstruction.filter('.calculation-incomplete').removeClass('d-none');$calcInstruction.filter('.calculation-discount').addClass('d-none');$calcProcess.addClass('d-none');$calcResult.addClass('d-none')}}}) 22$(function(){new window.Prj0217CompanyContactForm()})})(jQuery,this); 23 24
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.