PageSourceSearch

https://cdn.visitsights.com/static/js/search_and_buttons.bundle.min.js?t=1732735540

js visitsights.com collected 2026-10-08 07:14:24 UTC 13,601 bytes, 1 lines download raw bytes

1var Autocomplete=function(){"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=function(e,t){return e.matches?e.matches(t):e.msMatchesSelector?e.msMatchesSelector(t):e.webkitMatchesSelector?e.webkitMatchesSelector(t):null},o=function(e,t){return e.closest?e.closest(t):function(e,t){for(var n=e;n&&1===n.nodeType;){if(i(n,t))return n;n=n.parentNode}return null}(e,t)},s=function(e){return Boolean(e&&"function"==typeof e.then)},l=function t(){var i=this,l=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},u=l.search,r=l.autoSelect,a=void 0!==r&&r,c=l.setValue,d=void 0===c?function(){}:c,h=l.setAttribute,p=void 0===h?function(){}:h,f=l.onUpdate,g=void 0===f?function(){}:f,v=l.onSubmit,y=void 0===v?function(){}:v,b=l.onShow,m=void 0===b?function(){}:b,w=l.autocorrect,L=void 0!==w&&w,S=l.onHide,E=void 0===S?function(){}:S,I=l.onLoading,k=void 0===I?function(){}:I,A=l.onLoaded,R=void 0===A?function(){}:A;e(this,t),n(this,"value",""),n(this,"searchCounter",0),n(this,"results",[]),n(this,"selectedIndex",-1),n(this,"destroy",(function(){i.search=null,i.setValue=null,i.setAttribute=null,i.onUpdate=null,i.onSubmit=null,i.autocorrect=null,i.onShow=null,i.onHide=null,i.onLoading=null,i.onLoaded=null})),n(this,"handleInput",(function(e){var t=e.target.value;i.updateResults(t),i.value=t})),n(this,"handleKeyDown",(function(e){var t=e.key;switch(t){case"Up":case"Down":case"ArrowUp":case"ArrowDown":var n="ArrowUp"===t||"Up"===t?i.selectedIndex-1:i.selectedIndex+1;e.preventDefault(),i.handleArrows(n);break;case"Tab":i.selectResult();break;case"Enter":var o=i.results[i.selectedIndex];i.selectResult(),i.onSubmit(o);break;case"Esc":case"Escape":i.hideResults(),i.setValue();break;default:return}})),n(this,"handleFocus",(function(e){var t=e.target.value;i.updateResults(t),i.value=t})),n(this,"handleBlur",(function(){i.hideResults()})),n(this,"handleResultMouseDown",(function(e){e.preventDefault()})),n(this,"handleResultClick",(function(e){var t=e.target,n=o(t,"[data-result-index]");if(n){i.selectedIndex=parseInt(n.dataset.resultIndex,10);var s=i.results[i.selectedIndex];i.selectResult(),i.onSubmit(s)}})),n(this,"handleArrows",(function(e){var t=i.results.length;i.selectedIndex=(e%t+t)%t,i.onUpdate(i.results,i.selectedIndex)})),n(this,"selectResult",(function(){var e=i.results[i.selectedIndex];e&&i.setValue(e),i.hideResults()})),n(this,"updateResults",(function(e){var t=++i.searchCounter;i.onLoading(),i.search(e).then((function(e){t===i.searchCounter&&(i.results=e,i.onLoaded(),0!==i.results.length?(i.selectedIndex=i.autoSelect?0:-1,i.onUpdate(i.results,i.selectedIndex),i.showResults()):i.hideResults())}))})),n(this,"showResults",(function(){i.setAttribute("aria-expanded",!0),i.onShow()})),n(this,"hideResults",(function(){i.selectedIndex=-1,i.results=[],i.setAttribute("aria-expanded",!1),i.setAttribute("aria-activedescendant",""),i.onUpdate(i.results,i.selectedIndex),i.onHide()})),n(this,"checkSelectedResultVisible",(function(e){var t=e.querySelector('[data-result-index="'.concat(i.selectedIndex,'"]'));if(t){var n=e.getBoundingClientRect(),o=t.getBoundingClientRect();o.top<n.top?e.scrollTop-=n.top-o.top:o.bottom>n.bottom&&(e.scrollTop+=o.bottom-n.bottom)}})),this.search=s(u)?u:function(e){return Promise.resolve(u(e))},this.autoSelect=a,this.setValue=d,this.setAttribute=p,this.onUpdate=g,this.onSubmit=y,this.autocorrect=L,this.onShow=m,this.onHide=E,this.onLoading=k,this.onLoaded=R},u=0,r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"".concat(e).concat(++u)},a=function(e,t){var n=e.getBoundingClientRect(),i=t.getBoundingClientRect();return n.bottom+i.height>window.innerHeight&&window.innerHeight-n.bottom<n.top&&window.pageYOffset+n.top-i.height>0?"above":"below"},c=function(e,t,n){var i;return function(){var o=this,s=arguments,l=function(){i=null,n||e.apply(o,s)},u=n&&!i;clearTimeout(i),i=setTimeout(l,t),u&&e.apply(o,s)}},d=function(){function n(t,i,o){e(this,n),this.id="".concat(o,"-result-").concat(t),this.class="".concat(o,"-result"),this["data-result-index"]=t,this.role="option",t===i&&(this["aria-selected"]="true")}var i,o,s;return i=n,(o=[{key:"toString",value:function(){var e=this;return Object.keys(this).reduce((function(t,n){return"".concat(t," ").concat(n,'="').concat(e[n],'"')}),"")}}])&&t(i.prototype,o),s&&t(i,s),n}();return function t(i){var o=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},u=s.search,h=s.onSubmit,p=void 0===h?function(){}
1:h,f=s.onUpdate,g=void 0===f?function(){}:f,v=s.baseClass,y=void 0===v?"autocomplete":v,b=s.autocorrect,m=void 0!==b&&b,w=s.autoSelect,L=s.getResultValue,S=void 0===L?function(e){return e}:L,E=s.renderResult,I=s.debounceTime,k=void 0===I?0:I;e(this,t),n(this,"expanded",!1),n(this,"loading",!1),n(this,"position",{}),n(this,"resetPosition",!0),n(this,"initialize",(function(){o.root.style.position="relative",o.input.setAttribute("role","combobox"),o.input.setAttribute("autocomplete","off"),o.input.setAttribute("autocapitalize","off"),o.autocorrect&&o.input.setAttribute("autocorrect","on"),o.input.setAttribute("spellcheck","false"),o.input.setAttribute("aria-autocomplete","list"),o.input.setAttribute("aria-haspopup","listbox"),o.input.setAttribute("aria-expanded","false"),o.resultList.setAttribute("role","listbox"),o.resultList.style.position="absolute",o.resultList.style.zIndex="1",o.resultList.style.width="100%",o.resultList.style.boxSizing="border-box",o.resultList.id||(o.resultList.id=r("".concat(o.baseClass,"-result-list-"))),o.input.setAttribute("aria-owns",o.resultList.id),document.body.addEventListener("click",o.handleDocumentClick),o.input.addEventListener("input",o.core.handleInput),o.input.addEventListener("keydown",o.core.handleKeyDown),o.input.addEventListener("focus",o.core.handleFocus),o.input.addEventListener("blur",o.core.handleBlur),o.resultList.addEventListener("mousedown",o.core.handleResultMouseDown),o.resultList.addEventListener("click",o.core.handleResultClick),o.updateStyle()})),n(this,"destroy",(function(){document.body.removeEventListener("click",o.handleDocumentClick),o.input.removeEventListener("input",o.core.handleInput),o.input.removeEventListener("keydown",o.core.handleKeyDown),o.input.removeEventListener("focus",o.core.handleFocus),o.input.removeEventListener("blur",o.core.handleBlur),o.resultList.removeEventListener("mousedown",o.core.handleResultMouseDown),o.resultList.removeEventListener("click",o.core.handleResultClick),o.root=null,o.input=null,o.resultList=null,o.getResultValue=null,o.onUpdate=null,o.renderResult=null,o.core.destroy(),o.core=null})),n(this,"setAttribute",(function(e,t){o.input.setAttribute(e,t)})),n(this,"setValue",(function(e){o.input.value=e?o.getResultValue(e):""})),n(this,"renderResult",(function(e,t){return"<li ".concat(t,">").concat(o.getResultValue(e),"</li>")})),n(this,"handleUpdate",(function(e,t){o.resultList.innerHTML="",e.forEach((function(e,n){var i=new d(n,t,o.baseClass),s=o.renderResult(e,i);"string"==typeof s?o.resultList.insertAdjacentHTML("beforeend",s):o.resultList.insertAdjacentElement("beforeend",s)})),o.input.setAttribute("aria-activedescendant",t>-1?"".concat(o.baseClass,"-result-").concat(t):""),o.resetPosition&&(o.resetPosition=!1,o.position=a(o.input,o.resultList),o.updateStyle()),o.core.checkSelectedResultVisible(o.resultList),o.onUpdate(e,t)})),n(this,"handleShow",(function(){o.expanded=!0,o.updateStyle()})),n(this,"handleHide",(function(){o.expanded=!1,o.resetPosition=!0,o.updateStyle()})),n(this,"handleLoading",(function(){o.loading=!0,o.updateStyle()})),n(this,"handleLoaded",(function(){o.loading=!1,o.updateStyle()})),n(this,"handleDocumentClick",(function(e){o.root.contains(e.target)||o.core.hideResults()})),n(this,"updateStyle",(function(){o.root.dataset.expanded=o.expanded,o.root.dataset.loading=o.loading,o.root.dataset.position=o.position,o.resultList.style.visibility=o.expanded?"visible":"hidden",o.resultList.style.pointerEvents=o.expanded?"auto":"none","below"===o.position?(o.resultList.style.bottom=null,o.resultList.style.top="100%"):(o.resultList.style.top=null,o.resultList.style.bottom="100%")})),this.root="string"==typeof i?document.querySelector(i):i,this.input=this.root.querySelector("input"),this.resultList=this.root.querySelector("ul"),this.baseClass=y,this.autocorrect=m,this.getResultValue=S,this.onUpdate=g,"function"==typeof E&&(this.renderResult=E);var A=new l({search:u,autoSelect:w,setValue:this.setValue,setAttribute:this.setAttribute,onUpdate:this.handleUpdate,autocorrect:this.autocorrect,onSubmit:p,onShow:this.handleShow,onHide:this.handleHide,onLoading:this.handleLoading,onLoaded:this.handleLoaded});k>0&&(A.handleInput=c(A.handleInput,k)),this.core=A,this.initialize()}}();"use strict";function getWebHost(){if(window.location.href.includes("visitsights.com")){return"https://visitsights.com"}else if(window.location.href.includes("visitsights.de")){return"https://visitsights.de"}else{return"http://localhost:8000"}}function getAPIHost(){if(window.location.href.includes("visitsights.com")){return"https://api.visitsights.com"}else if(window.location.href.includes("visitsights.de")){return"https://api.visitsights.de"}else{return"http://localhost:5000"}}function highlight(e,t){let n=e.toLowerCase().indexOf(t.toLowerCase());if(n>=0){return`${e.substring(0,n)}<b>${e.substring(n,n+t.length)}</b>${e.substring(n+t.length)}`}return e}let keyword="";let groupSightseeingToursDisplayed=false;let groupActivitiesDisplayed=false;let groupIndividualSightsDisplayed=false;const elements=document.querySelectorAll(".autocomplete");
1elements.forEach((e=>{new Autocomplete(e,{search:e=>{const t=`${getAPIHost()}/get_country_city?keyword=${encodeURI(e)}`;keyword=e;return new Promise((n=>{if(e.length<3){return n([])}fetch(t).then((e=>e.json())).then((e=>{n(e)}))}))},getResultValue:e=>`${e.city}, ${e.country}`,renderResult:(e,t)=>{let n="";if((e.type==="Sightseeing Tours"||e.type==="Sightseeing-Touren")&&!groupSightseeingToursDisplayed){n=`<li class="autocomplete-group">${e.type}</li>`;groupSightseeingToursDisplayed=true}else if((e.type==="Activities"||e.type==="Aktivitäten")&&!groupActivitiesDisplayed){n=`<li class="autocomplete-group">${e.type}</li>`;groupActivitiesDisplayed=true}else if((e.type==="Individual Sights"||e.type==="Einzelne Sehenswürdigkeiten")&&!groupIndividualSightsDisplayed){n=`<li class="autocomplete-group">${e.type}</li>`;groupIndividualSightsDisplayed=true}return`\n                ${n}\n                <li ${t}>\n                    ${highlight(e.city,keyword)}, ${highlight(e.country,keyword)}\n                </li>\n            `},onUpdate:()=>{groupSightseeingToursDisplayed=false;groupActivitiesDisplayed=false;groupIndividualSightsDisplayed=false},onSubmit:t=>{if(t){let e="";if(t.type==="Individual Sights"||t.type==="Einzelne Sehenswürdigkeiten"){e=i18n.sightsUrl}else if(t.type==="Activities"||t.type==="Aktivitäten"){e=i18n.activitiesUrl}else{e=i18n.toursUrl}let n=`${getWebHost()}${e}/${t.country}/${t.city}`;window.open(n,"_self")}else{let t=e.children[0].id;let n=e.children[0].value;search(t,n)}},debounceTime:200})}));function search(e,t){let n=/[a-zA-Z]/;if(n.test(t)){let e=`${getWebHost()}${i18n.searchUrl}/${t}`;window.open(e,"_self")}else{document.getElementById(e).classList.add("autocomplete-input-invalid");document.getElementById(`${e}-tooltip`).style.setProperty("display","block")}}function checkInputValidity(e,t){let n=/[a-zA-Z]/;if(n.test(t)){document.getElementById(e).classList.remove("autocomplete-input-invalid");document.getElementById(`${e}-tooltip`).style.setProperty("display","none")}else{document.getElementById(e).classList.add("autocomplete-input-invalid");document.getElementById(`${e}-tooltip`).style.setProperty("display","block")}}["header","header2","index","search"].forEach((e=>{let t=document.getElementById(`search-button-${e}`);if(t){t.addEventListener("click",(()=>{let t=`autocomplete-input-${e}`;let n=document.getElementById(t).value;search(t,n)}))}}));["header","header2","index","search"].forEach((e=>{let t=`autocomplete-input-${e}`;let n=document.getElementById(t);if(n){n.addEventListener("input",(()=>{checkInputValidity(t,n.value)}))}}));"use strict";let buttons=document.getElementById("btns-bottom-right");let buttonTop=document.getElementById("btn-scroll-to-top");let buttonNPS=document.getElementById("btn-nps");let buttonShare=document.getElementById("btn-share");let buttonContent=document.getElementById("btn-scroll-to-content");let shariff=document.getElementById("shariff");if(buttons!==null){window.onscroll=()=>{if(document.body.scrollTop>400||document.documentElement.scrollTop>400){buttons.style.display="block"}else{buttons.style.display="none"}};buttonTop.addEventListener("click",(()=>{document.body.scrollTop=0;document.documentElement.scrollTop=0}));buttonNPS.addEventListener("click",(()=>{let e=document.getElementById("nps").offsetTop-120;window.scrollTo({top:e,behavior:"smooth"})}));buttonShare.addEventListener("click",(()=>{let e=document.getElementById("shariff").offsetTop-120;window.scrollTo({top:e,behavior:"smooth"})}))}if(buttonContent!=null){buttonContent.addEventListener("click",(()=>{let e=document.getElementById("content").offsetTop-100;window.scrollTo({top:e,behavior:"smooth"})}))}

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.