{"version":3,"names":[],"mappings":"","sources":["scripts.bundle.js"],"sourcesContent":["var Helpers = (function () {\n function throttle(fn, threshhold, scope) {\n threshhold || (threshhold = 250);\n var last, deferTimer;\n return function () {\n var context = scope || this;\n var now = +new Date(),\n args = arguments;\n if (last && now < last + threshhold) {\n // hold on to it\n clearTimeout(deferTimer);\n deferTimer = setTimeout(function () {\n last = now;\n fn.apply(context, args);\n }, threshhold);\n } else {\n last = now;\n fn.apply(context, args);\n }\n };\n }\n\n function isIE() {\n var ua = window.navigator.userAgent; //Check the userAgent property of the window.navigator object\n var msie = ua.indexOf(\"MSIE \"); // IE 10 or older\n var trident = ua.indexOf(\"Trident/\"); //IE 11\n\n return msie > 0 || trident > 0;\n }\n\n function fixObjectFit() {\n if (\"objectFit\" in document.documentElement.style === false) {\n $(\"img[data-object-fit]\").each(function () {\n var imgUri = $(this)\n .attr(\"src\")\n .replace(/\\(/g, \"%28\")\n .replace(/\\)/g, \"%29\");\n $(this)\n .css({\n backgroundImage: \"url(\" + imgUri + \")\",\n backgroundPosition: \"center\",\n backgroundSize: $(this).attr(\"data-object-fit\"),\n })\n .attr(\n \"src\",\n \"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='\" +\n $(this).width() +\n \"' height='\" +\n $(this).height() +\n \"'%3E%3C/svg%3E\"\n )\n .removeAttr(\"data-object-fit\");\n });\n }\n }\n\n function onElementHeightChange(elm, callback) {\n var lastHeight = elm.clientHeight,\n newHeight;\n (function run() {\n newHeight = elm.clientHeight;\n if (lastHeight != newHeight) callback();\n lastHeight = newHeight;\n\n if (elm.onElementHeightChangeTimer)\n clearTimeout(elm.onElementHeightChangeTimer);\n\n elm.onElementHeightChangeTimer = setTimeout(run, 200);\n })();\n }\n\n function generateRandomInteger(min, max) {\n return Math.floor(min + Math.random() * (max + 1 - min));\n }\n\n function getUrlParameter(sParam) {\n var sPageURL = window.location.search.substring(1),\n sURLVariables = sPageURL.split(\"&\"),\n sParameterName,\n i;\n\n for (i = 0; i < sURLVariables.length; i++) {\n sParameterName = sURLVariables[i].split(\"=\");\n\n if (sParameterName[0] === sParam) {\n return sParameterName[1] === undefined\n ? true\n : decodeURIComponent(sParameterName[1]);\n }\n }\n }\n\n function setUrlParameter(query) {\n if (history.pushState) {\n var newurl =\n window.location.protocol +\n \"//\" +\n window.location.host +\n window.location.pathname +\n \"?\" +\n query;\n window.history.pushState({ path: newurl }, \"\", newurl);\n }\n }\n\n return {\n throttle: function (fn, threshhold, scope) {\n return throttle(fn, threshhold, scope);\n },\n isIE: function () {\n return isIE();\n },\n fixObjectFit: function () {\n return fixObjectFit();\n },\n onElementHeightChange: function (elm, callback) {\n return onElementHeightChange(elm, callback);\n },\n generateRandomInteger(min, max) {\n return generateRandomInteger(min, max);\n },\n getUrlParameter(sParam) {\n return getUrlParameter(sParam);\n },\n setUrlParameter(query) {\n return setUrlParameter(query);\n },\n };\n})();\n\n(function ($) {\n \"use strict\";\n\n var $html = $(\"html\"),\n isTouch = $html.hasClass(\"touchevents\"),\n $body = $(\"body\");\n var windowWidth = Math.max($(window).width(), window.innerWidth);\n var locoScroll;\n var resizeEnd;\n\n /*flatpickr*/\n if (typeof flatpickr !== \"undefined\") {\n flatpickr.localize(flatpickr.l10ns[window.locale ? window.locale : \"tr\"]);\n }\n\n /*cookie-policy-toast*/\n if ($(\".cookie-policy-toast\").length > 0) {\n $(\".cookie-policy-toast\").toast(\"show\");\n }\n\n /*Title animate*/\n if ($(\".unfold-animate\").length > 0) {\n $(\".unfold-animate\").each(function () {\n var thisText = $(this).html();\n\n var thisHtml =\n '' +\n thisText\n .split(/ (?=[^>]*(?:<|$))/)\n .join(' ') +\n \"\";\n $(this).html(thisHtml);\n var delay = -1,\n prev_offset = 0;\n $(this)\n .find(\".mask\")\n .each(function () {\n var offset = $(this).position().top;\n if (prev_offset != offset) {\n prev_offset = offset;\n delay++;\n }\n $(this).addClass(\"delay\" + delay);\n });\n\n $(this)\n .find(\"span\")\n .each(function () {\n if ($(this).find(\"br\").length > 0) {\n $(this).after(\"
\").find(\"br\").remove();\n }\n });\n });\n }\n\n /*Page transitions*/\n if ($body.hasClass(\"location-animate\")) {\n setTimeout(function () {\n $(\".location-animate\").addClass(\"page-visible\");\n if (!$html.hasClass(\"preload-page\")) {\n $html.addClass(\"page-load\");\n }\n }, 500);\n }\n\n var pageTransitions = true;\n $body.on(\n \"click\",\n 'a[href^=\"mailto\"], a[href^=\"tel\"], a[href^=\"viber\"], .js-open-gallery',\n function () {\n pageTransitions = false;\n clearTimeout(resizeEnd);\n resizeEnd = setTimeout(function () {\n pageTransitions = true;\n }, 50);\n }\n );\n $body.on(\"click\", \"a\", function (e) {\n if (\n $(this).closest(\"#bx-panel\").length ||\n $(this).closest(\".bx-component-opener\").length\n ) {\n return;\n }\n if (\n pageTransitions &&\n $(this).attr(\"target\") != \"_blank\" &&\n !$(this).hasClass(\"prevent-transitions\") &&\n !$(this).hasClass(\"disabled\") &&\n !$(this).hasClass(\"js-load-more\")\n ) {\n e.preventDefault();\n var newLocation = $(this).attr(\"href\");\n $(\".location-animate\").removeClass(\"page-visible\");\n\n setTimeout(function () {\n window.location = newLocation;\n }, 200);\n }\n });\n\n /*Header*/\n var scrollDefaultPosition = 0;\n function stickyHeader(wST) {\n if (wST > scrollDefaultPosition) {\n $html.addClass(\"sticky-header short-header-view\");\n }\n\n if (scrollDefaultPosition > wST) {\n $html.removeClass(\"short-header-view\");\n }\n\n if (wST <= 1) {\n if ($html.hasClass(\"sticky-header\")) {\n $html.removeClass(\"sticky-header\");\n }\n }\n\n scrollDefaultPosition = wST;\n }\n stickyHeader(0);\n\n /* header base nav first and last item padding fix */\n if (\n $(\".tp-header .nav.nav-first-level > .nav-item:not(.d-lg-none)\").length > 0\n ) {\n $(\".tp-header .nav.nav-first-level > .nav-item:not(.d-lg-none)\")\n .first()\n .find(\".nav-link\")\n .addClass(\"pl-lg-0\");\n $(\".tp-header .nav.nav-first-level > .nav-item:not(.d-lg-none)\")\n .last()\n .find(\".nav-link\")\n .addClass(\"pr-lg-0\");\n }\n\n /*mobile header search*/\n var $mobileSearchWrapper = $(\".mobile-search-wrapper\"),\n $mobileSearchInput = $(\".mobile-search-input\"),\n $mobileSearchButton = $(\".mobile-search-button\");\n\n function submitMobileSearch() {\n var url = $mobileSearchWrapper.data(\"path\");\n if (url && $mobileSearchInput.val().length > 0) {\n location.href = url + $mobileSearchInput.val();\n }\n }\n\n $mobileSearchInput.keypress(function (e) {\n if (e.which == 13) {\n submitMobileSearch();\n return false;\n }\n });\n $mobileSearchButton.on(\"click\", function (e) {\n submitMobileSearch();\n return false;\n });\n\n /*header search*/\n var $searchWrapper = $(\".search-wrapper\"),\n $searchInput = $(\".search-input\"),\n $searchButton = $(\".search-button\");\n\n function submitSearch() {\n var url = $searchWrapper.data(\"path\");\n if (url && $searchInput.val().length > 0) {\n location.href = url + $searchInput.val();\n }\n }\n\n $searchInput.keypress(function (e) {\n if (e.which == 13) {\n submitSearch();\n return false;\n }\n });\n $(document).on(\"click\", function (e) {\n if ($(e.target).is($searchButton) && $searchWrapper.hasClass(\"focused\")) {\n submitSearch();\n return false;\n }\n if ($.contains($searchWrapper[0], e.target)) {\n $searchWrapper.addClass(\"focused\");\n $searchInput.focus();\n } else {\n $searchWrapper.removeClass(\"focused\");\n $searchInput.val(\"\");\n }\n });\n\n /*sticky table header*/\n var $stickyTable = $(\".table-sticky-header\");\n var $stickyTableHead = $(\".table-sticky-header thead\");\n var $globalHeader = $(\".tp-header\");\n\n function stickyTableHeader(wST) {\n if ($stickyTable.length > 0 && $stickyTableHead.length > 0) {\n var topOffset = $globalHeader.height();\n var bottomOffset = 250;\n\n if (windowWidth > 991 && $html.hasClass(\"short-header-view\")) {\n topOffset = topOffset - 55;\n }\n\n if (\n $stickyTable.offset().top < topOffset &&\n $stickyTable.height() + $stickyTable.offset().top > bottomOffset\n ) {\n $stickyTableHead.addClass(\"sticky\");\n $stickyTableHead[0].style.transform =\n \"translateY(\" + (topOffset - $stickyTable.offset().top) + \"px)\";\n } else {\n $stickyTableHead.removeClass(\"sticky\");\n }\n }\n }\n\n /*Nav*/\n $(\".js-open-nav\").click(function () {\n if (!$html.hasClass(\"opened-nav\")) {\n $html.addClass(\"opened-nav\");\n\n $(\"#nav > ul > li\").each(function () {\n if (\n $(this).hasClass(\"active\") &&\n $(this).find(\".dropdown\").length > 0\n ) {\n $(this).addClass(\"opened-dropdown\").find(\".dropdown\").show();\n }\n });\n\n /*Old ios version bug fix*/\n /*if ($html.hasClass(\"ios\") && $html.hasClass(\"touchevents\")) {\n $(\"html, body\").animate(\n {\n scrollTop: scrolledY + 1,\n },\n 50\n );\n }*/\n } else {\n $html.removeClass(\"opened-nav\");\n setTimeout(function () {\n $(\"#nav li\").removeClass(\"opened-dropdown\").find(\".dropdown\").hide();\n }, 300);\n }\n });\n\n /*Quick menu*/\n var $quickMenu = undefined;\n\n function quickMenuFix() {\n if (windowWidth > 991) {\n var width = 0;\n $quickMenu.find(\"a\").each(function () {\n if (width < $(this).outerWidth()) {\n width = $(this).outerWidth();\n }\n });\n $quickMenu.find(\"a\").width(width);\n } else {\n $quickMenu.find(\"a\").css(\"width\", \"auto\");\n }\n }\n function quickMenuInit() {\n if ($quickMenu == undefined) {\n $quickMenu = $(\".quick-menu\");\n var $preview = $quickMenu.find(\".quick-menu-preview\");\n var $dropdown = $quickMenu.find(\".qucik-menu-dropdown\");\n var $firstChild = $dropdown.find(\"a\").eq(0);\n var href = $firstChild.attr(\"href\");\n var target = $firstChild.attr(\"target\");\n if (href) {\n $preview.attr(\"href\", href);\n }\n if (target) {\n $preview.attr(\"target\", target);\n }\n $preview.html($firstChild.html());\n $firstChild.remove();\n\n //quickMenuFix();\n }\n }\n\n if ($(\".quick-menu\").length > 0) {\n quickMenuInit();\n }\n\n /*Index slider*/\n var indexSlider = undefined;\n function indexSliderInit() {\n if (indexSlider == undefined) {\n indexSlider = new Swiper(\".index-slider .swiper-container\", {\n slidesPerView: 1,\n loop: true,\n autoplay: {\n delay: 10000,\n },\n navigation: {\n nextEl: \".swiper-button-next\",\n prevEl: \".swiper-button-prev\",\n },\n /*on: {\n init: function () {\n console.log(\"swiper initialized\");\n var currentVideo = $(\n \"[data-swiper-slide-index=\" + this.realIndex + \"]\"\n ).find(\"video\");\n currentVideo.trigger(\"play\");\n },\n },*/\n });\n\n /*var sliderVideos = $(\".swiper-slide video\");\n\n indexSlider.on(\"slideChange\", function () {\n console.log(\"slide changed\");\n \n sliderVideos.each(function (index) {\n this.currentTime = 0;\n });\n \n var prevVideo = $(\n \"[data-swiper-slide-index=\" + this.previousIndex + \"]\"\n ).find(\"video\");\n var currentVideo = $(\n \"[data-swiper-slide-index=\" + this.realIndex + \"]\"\n ).find(\"video\");\n prevVideo.trigger(\"stop\");\n currentVideo.trigger(\"play\");\n });*/\n\n /*var v = document.getElementsByTagName(\"video\")[0];\n\n indexSlider.on(\"slideChange\", function () {\n console.log(\"a\");\n $(\"video\").trigger(\"stop\");\n });\n\n v.addEventListener(\n \"canplay\",\n function () {\n console.log(\"canplay\");\n $(\"video\").trigger(\"play\");\n indexSlider.autoplay.stop();\n },\n true\n );\n\n v.addEventListener(\n \"ended\",\n function () {\n console.log(\"ended\");\n indexSlider.autoplay.start();\n },\n true\n );*/\n }\n }\n\n if ($(\".index-slider\").length > 0) {\n indexSliderInit();\n }\n\n /*regular slider*/\n function sliderInit() {\n $(\".tp-slider .swiper-container\").each(function (index) {\n var slider = new Swiper($(this)[0], {\n spaceBetween: 30,\n slidesPerView: \"auto\",\n speed: 400,\n loop: false,\n centeredSlides: false,\n grabCursor: true,\n pagination: {\n el: $(this).parents(\".tp-slider\").find(\".swiper-pagination\"),\n clickable: true,\n },\n navigation: {\n prevEl: $(this).parents(\".tp-slider\").find(\".swiper-btn-prev\"),\n nextEl: $(this).parents(\".tp-slider\").find(\".swiper-btn-next\"),\n },\n on: {\n transitionStart: function () {\n if (!slider.isEnd) {\n slider.$el.removeClass(\"reached-end\");\n }\n },\n transitionEnd: function () {\n if (slider.isEnd) {\n slider.$el.addClass(\"reached-end\");\n }\n },\n reachBeginning: function () {\n if ($html.hasClass(\"no-touchevents\")) {\n $body.removeClass(\"pointer\");\n }\n },\n reachEnd: function () {\n if ($html.hasClass(\"no-touchevents\")) {\n $body.removeClass(\"pointer\");\n }\n },\n },\n breakpoints: {\n 576: {\n spaceBetween: 65,\n },\n },\n });\n });\n }\n\n if ($(\".tp-slider\").length > 0) {\n sliderInit();\n }\n\n /*cc slider*/\n function ccSliderInit() {\n $(\".tp-cc-slider .swiper-container\").each(function (index) {\n var ccSlider = new Swiper($(this)[0], {\n effect: \"fade\",\n loop: true,\n autoplay: {\n delay: 5000,\n },\n pagination: {\n el: $(this).parents(\".tp-cc-slider\").find(\".swiper-pagination\"),\n clickable: true,\n },\n });\n });\n }\n\n if ($(\".tp-cc-slider\").length > 0) {\n ccSliderInit();\n }\n\n /*inputmask*/\n if ($(\"[data-mask]\").length > 0) {\n $(\"[data-mask]\").each(function () {\n var $this = $(this);\n if ($this.data(\"mask\").length > 0) {\n $this.inputmask({\n mask: $this.data(\"mask\"),\n });\n }\n });\n }\n\n /*select2*/\n if ($(\".tp-select__select2\").length > 0) {\n $(\".tp-select__select2\").each(function () {\n var options = {\n theme: \"flat\",\n language: \"tr\",\n dropdownParent: $(\"[data-scroll-container]\"),\n };\n if ($(this).data(\"no-search\")) {\n options.minimumResultsForSearch = Infinity;\n }\n $(this).select2(options);\n\n /*document.addEventListener(\n \"scroll\",\n function (event) {\n console.log(event.target.id);\n if ($(event.target).hasClass(\"select2-results__options\")) {\n console.log(\"scrolling\");\n if (locoScroll) {\n locoScroll.stop();\n }\n }\n },\n true\n );*/\n\n $(this).on(\"select2:open\", function (e) {\n var $this = $(this);\n $(\".select2-container--open\")\n .on(\"mouseenter\", function () {\n if (locoScroll) {\n locoScroll.stop();\n }\n })\n .on(\"mouseleave\", function () {\n if (locoScroll) {\n locoScroll.start();\n }\n });\n\n $body.on(\"touchstart\", function (e) {\n var $target = $(e.target);\n if (!$target.closest(\".select2-container--open\").length > 0) {\n $this.select2(\"close\");\n if (locoScroll) {\n locoScroll.start();\n }\n } else {\n if (locoScroll) {\n locoScroll.stop();\n }\n }\n });\n });\n\n $(this).on(\"select2:close\", function (e) {\n if (locoScroll) {\n locoScroll.start();\n }\n });\n });\n }\n\n /*select2 populator*/\n\n function initSelectPopulator() {\n var $populator = $(\"[data-select2-populate]\");\n var target = $populator.data(\"select2-populate\");\n var $target = $(\".tp-select__select2[name='\" + target + \"']\");\n var $parent = $target.parents(\".tp-select\");\n var targetOriginalText = $target.text();\n var $loader = $(\n '
'\n );\n\n function resultSuccess(data) {\n if (data) {\n $(data).each(function (i, item) {\n var newOption = new Option(item.text, item.id, false, false);\n $target.append(newOption);\n });\n }\n $target.trigger(\"change\");\n $target.prop(\"disabled\", false);\n $loader.remove();\n }\n\n function resultError(err) {\n //console.log(err);\n $target.prop(\"disabled\", false);\n $loader.remove();\n }\n\n function clearItems() {\n $target.html(\"\");\n var newOption = new Option(targetOriginalText, \"\", false, false);\n $target.append(newOption);\n $target.trigger(\"change\");\n }\n\n $populator.on(\"change\", function () {\n clearItems();\n var formData = {};\n formData.city = $(this).val();\n if (formData.city) {\n $target.prop(\"disabled\", true);\n $parent.prepend($loader);\n window.submitDistrictForm(formData, resultSuccess, resultError);\n }\n });\n }\n\n if ($(\"[data-select2-populate]\").length > 0) {\n initSelectPopulator();\n }\n\n /*index prices*/\n window.setIndexPrices = function (district) {\n var $priceList = $(\"#indexPriceList\");\n var $priceListInfo = $(\"#indexPriceListInfo\");\n var $loader = $(\n '
'\n );\n var $city = $(\"#indexPricesCity\");\n var formData = {};\n formData.city = $city.val();\n formData.district = district;\n\n function resultSuccess(data) {\n if (data) {\n var unit = \"TL/LT\";\n if (data.unit) {\n unit = data.unit;\n }\n\n if (data.info) {\n $priceListInfo.html(data.info);\n }\n\n if (data.fields && data.rows) {\n var priceListHtml = \"\";\n $(data.fields).each(function (i, field) {\n priceListHtml +=\n '
\\\n ' +\n field +\n '\\\n 0.00\\\n ' +\n unit +\n \"\\\n
\";\n });\n $priceList.html(priceListHtml);\n if ($(\".animated-counter\").length > 0) {\n animatedCounter();\n }\n }\n } else {\n $priceList.html(\"\");\n $priceListInfo.html(\"\");\n }\n }\n\n function resultError(err) {\n //console.log(err);\n $priceList.html(\"\");\n $priceListInfo.html(\"\");\n }\n\n $priceList.prepend($loader);\n\n window.submitFuelPriceForm(\n formData,\n \"indexPriceList\",\n resultSuccess,\n resultError\n );\n };\n\n /*index stations button*/\n window.setStationsButton = function (city) {\n var $btn = $(\"#indexStationsBtn\");\n if ($btn.length > 0) {\n var path = $btn.data(\"path\");\n $btn.attr(\"href\", path + city);\n }\n };\n\n /*select2 trigger*/\n\n function initSelectTrigger() {\n var $triggers = $(\"[data-select2-trigger]\");\n\n $triggers.each(function () {\n var $trigger = $(this);\n var target = $trigger.data(\"select2-trigger\");\n\n $trigger.on(\"change\", function () {\n var val = $(this).val();\n if (val) {\n window[target](val);\n }\n });\n });\n }\n\n if ($(\"[data-select2-trigger]\").length > 0) {\n initSelectTrigger();\n }\n\n /*Animated counter*/\n function animatedCounter() {\n $(\".animated-counter\").each(function () {\n var $this = $(this),\n countTo = $this.attr(\"data-final-count\");\n if (\n !$this.hasClass(\"finished\") &&\n $this.parents(\"[data-scroll]\").hasClass(\"is-inview\")\n ) {\n $({ countNum: $this.text() }).animate(\n { countNum: countTo },\n {\n duration: 1000,\n easing: \"swing\",\n step: function () {\n $this.text((parseFloat(this.countNum) + 0.01).toFixed(2));\n },\n complete: function () {\n $this.text(this.countNum);\n },\n }\n );\n $this.addClass(\"finished\");\n }\n });\n }\n if ($(\".animated-counter\").length > 0) {\n animatedCounter();\n }\n\n /*flip*/\n function flip() {\n $(\".stations-card\").mouseup(function (e) {\n if (e.which != 1) return false;\n var $target = $(e.target);\n if (\n !$target.closest(\".tp-select\").length &&\n !$target.closest(\".btn\").length\n ) {\n $(this).toggleClass(\"flip\");\n }\n });\n }\n if ($(\".stations-card\").length > 0) {\n flip();\n }\n\n /*contacts map*/\n /*called from async google map script !! dont remove window !!*/\n var map;\n var markers = [];\n\n window.initMap = function initMap() {\n if ($(\"#map\").length < 1) {\n return;\n }\n\n var defaultLatLng = {\n lat: 39.0101123,\n lng: 30.6897679,\n };\n\n var defaultZoom = 6;\n\n map = new google.maps.Map($(\"#map\")[0], {\n center: defaultLatLng,\n zoom: defaultZoom,\n scrollwheel: false,\n });\n\n function addMarker(location) {\n var marker = new google.maps.Marker({\n position: location,\n map: map,\n });\n markers.push(marker);\n }\n\n // Sets the map on all markers in the array.\n function setMapOnAll(map) {\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(map);\n }\n }\n\n // Removes the markers from the map, but keeps them in the array.\n function clearMarkers() {\n setMapOnAll(null);\n }\n\n // Shows any markers currently in the array.\n function showMarkers() {\n setMapOnAll(map);\n }\n\n // Deletes all markers in the array by removing references to them.\n function deleteMarkers() {\n clearMarkers();\n markers = [];\n }\n\n function setMap(activeElem) {\n deleteMarkers();\n\n var selectedLatLng = defaultLatLng;\n var selectedZoom = defaultZoom;\n\n if (activeElem.data(\"zoom\")) {\n selectedZoom = activeElem.data(\"zoom\");\n }\n\n if (activeElem.data(\"lat\") && activeElem.data(\"lng\")) {\n selectedLatLng = {\n lat: activeElem.data(\"lat\"),\n lng: activeElem.data(\"lng\"),\n };\n\n addMarker(selectedLatLng);\n }\n\n map.setCenter(selectedLatLng);\n map.setZoom(selectedZoom);\n }\n\n if ($(\".tp-contact .tp-select__select2\").length > 0) {\n var $prevSelection;\n\n $(\".tp-contact .tp-select__select2\").on(\"select2:select\", function (e) {\n if ($prevSelection) {\n $prevSelection.removeClass(\"active\");\n }\n var $optionSelected = $(e.params.data.element, this);\n setMap($optionSelected);\n $optionSelected.tab(\"show\");\n $prevSelection = $optionSelected;\n });\n\n setMap($(\".tp-contact .tp-select__select2 option:first-child\"));\n }\n };\n\n /*forms*/\n function initForms() {\n function validate($form) {\n var hasError = false;\n\n function getErrorMsg($elem) {\n return $elem[0].validationMessage;\n }\n\n $form\n .find(\n \".form-control:not(.no-validate):not(.custom-validate):invalid, .custom-file-input:not(.no-validate):not(.custom-validate):invalid\"\n )\n .each(function (index) {\n $(this)\n .parent()\n .find(\".invalid-feedback\")\n .text(getErrorMsg($(this)));\n if (index === 0) {\n var $target = $(this).closest(\".form-group\");\n if (locoScroll) {\n var offset =\n ($target.height() +\n parseInt($target.css(\"marginTop\").replace(\"px\", \"\")) +\n parseInt($target.css(\"marginBottom\").replace(\"px\", \"\"))) *\n -1;\n locoScroll.scrollTo($target[0], offset);\n } else {\n $(\"html, body\").animate(\n {\n scrollTop: $target.offset().top,\n },\n 500\n );\n }\n }\n hasError = true;\n });\n\n return hasError;\n }\n\n $(\".form.needs-validation\").each(function () {\n var $form = $(this),\n $wrapper = $form.parents(\".form-wrapper\"),\n formId = $form.attr(\"id\"),\n $btnSubmit = $form.find(\".btn-submit-form\"),\n $formResultSuccess = $wrapper.find(\".form-result.text-success\"),\n $formResultError = $wrapper.find(\".form-result.text-danger\"),\n $captcha = $form.find(\".captcha\"),\n $captchaCanvas = $form.find(\".captcha-canvas\"),\n $captchaRefresh = $form.find(\".captcha-refresh\"),\n btnSubmitOriginalHtml = $btnSubmit.html(),\n $loader = $(\n '
'\n );\n\n //file\n var $fileUpload = $form.find(\"input[type='file']\");\n var labelOriginalText = \"\";\n if ($fileUpload.length > 0) {\n var $label = $fileUpload.siblings(\".custom-file-label\");\n labelOriginalText = $label.text();\n var max = $fileUpload.data(\"max\");\n var error = \"File size exceeds \" + max + \" MB.\";\n if ($fileUpload.data(\"error\")) {\n error = $fileUpload.data(\"error\");\n }\n\n var max = 2;\n var ext = \"*\";\n var maxError = \"The file size can not exceed \" + max + \"MB.\";\n var extError =\n \"Please select correct file format. (\" + ext.replace(\"|\", \", \") + \")\";\n\n var dataRules =\n $fileUpload.data(\"rules\") &&\n Object.keys($fileUpload.data(\"rules\")).length > 0\n ? $fileUpload.data(\"rules\")\n : {};\n var rules = Object.assign(\n {},\n {\n max: max,\n ext: ext,\n maxError: maxError,\n extError: extError,\n },\n dataRules\n );\n\n function checkFileInput() {\n var fileName = $fileUpload.val().split(\"\\\\\").pop();\n\n if (fileName) {\n $label.addClass(\"selected\");\n $label.html(fileName);\n } else {\n $label.removeClass(\"selected\");\n $label.html(labelOriginalText);\n }\n\n var errorMsg = \"\";\n if ($fileUpload[0].files[0]) {\n var size = $fileUpload[0].files[0].size;\n var maxSize = 1024 * 1024 * rules.max;\n\n if (size > maxSize) {\n errorMsg = rules.maxError;\n }\n\n if (rules.ext !== \"*\") {\n var regex = new RegExp(\"(.*?).(\" + rules.ext + \")$\");\n if (!regex.test(fileName)) {\n errorMsg = rules.extError;\n }\n }\n }\n\n $fileUpload[0].setCustomValidity(errorMsg);\n\n $fileUpload\n .parent()\n .find(\".invalid-feedback\")\n .text($fileUpload[0].validationMessage);\n }\n $fileUpload.on(\"change\", checkFileInput);\n }\n\n var canvasStyle = {\n width: parseInt($captchaCanvas.attr(\"width\")),\n height: parseInt($captchaCanvas.attr(\"height\")),\n textBaseline: \"middle\",\n font: \"20px Arial\",\n textAlign: \"left\",\n fillStyle: \"#e30613\",\n };\n var captchaVal;\n\n function generateCaptcha() {\n captchaVal = Helpers.generateRandomInteger(1000, 9999);\n captchaVal = captchaVal.toString();\n\n var ctx = $captchaCanvas[0].getContext(\"2d\");\n ctx.textBaseline = canvasStyle.textBaseline;\n ctx.font = canvasStyle.font;\n ctx.textAlign = canvasStyle.textAlign;\n ctx.fillStyle = canvasStyle.fillStyle;\n\n ctx.clearRect(0, 0, canvasStyle.width, canvasStyle.height);\n\n for (var i = 0; i < captchaVal.length; i++) {\n var rot = (Math.PI / 180) * Helpers.generateRandomInteger(-20, 20);\n var posY =\n Math.round(canvasStyle.height * 0.5) +\n Helpers.generateRandomInteger(-5, 5);\n var posX = i * 22 + 10;\n\n var size = ctx.measureText(captchaVal[i]);\n ctx.save();\n var tx = posX + size.width / 2;\n var ty = posY;\n ctx.translate(tx, ty);\n ctx.rotate(rot);\n ctx.translate(-tx, -ty);\n ctx.fillText(captchaVal[i], posX, posY);\n ctx.restore();\n }\n\n ctx.resetTransform();\n\n var x, y;\n for (y = 0; y < canvasStyle.height; y++) {\n for (x = 0; x < canvasStyle.width; x++) {\n var number = Math.floor(Math.random() * 200);\n\n ctx.fillStyle =\n \"rgba(\" + number + \",\" + number + \",\" + number + \",\" + 0.4 + \")\";\n ctx.fillRect(x, y, 1, 1);\n }\n }\n }\n\n function checkCaptcha() {\n var $this = $captcha;\n var value = $this.val();\n var error = \"Captcha code does not match.\";\n if ($this.data(\"error\")) {\n error = $this.data(\"error\");\n }\n if (value.length > 0 && value !== captchaVal) {\n $this[0].setCustomValidity(error);\n } else {\n $this[0].setCustomValidity(\"\");\n }\n $this\n .parent()\n .find(\".invalid-feedback\")\n .text($this[0].validationMessage);\n }\n\n $captcha.on(\"input\", checkCaptcha);\n\n generateCaptcha();\n\n $captchaRefresh.on(\"click\", function (e) {\n e.preventDefault();\n generateCaptcha();\n checkCaptcha();\n });\n\n function resultCallback(isSuccess) {\n $btnSubmit.html(btnSubmitOriginalHtml).addClass(\"d-none\");\n\n if (isSuccess) {\n $form.find(\".form-control\").val(\"\");\n if ($fileUpload.length > 0) {\n $fileUpload.val(\"\");\n var $label = $fileUpload.siblings(\".custom-file-label\");\n $label.html(labelOriginalText);\n }\n $formResultSuccess.removeClass(\"d-none\");\n } else {\n $formResultError.removeClass(\"d-none\");\n }\n\n setTimeout(function () {\n generateCaptcha();\n $loader.remove();\n $formResultSuccess.addClass(\"d-none\");\n $formResultError.addClass(\"d-none\");\n $btnSubmit.removeClass(\"d-none\");\n }, 3000);\n }\n\n $btnSubmit.on(\"click\", function (e) {\n e.preventDefault();\n\n $form.removeClass(\"was-validated\");\n\n if (validate($form)) {\n $form.addClass(\"was-validated\");\n } else {\n var serializedArray = $form\n .find(\".form-control:not(.no-serialize)\")\n .serializeArray();\n\n var formData;\n if ($fileUpload.length > 0 && $fileUpload[0].files[0]) {\n formData = new FormData();\n formData.append(\"file\", $fileUpload[0].files[0]);\n $(serializedArray).each(function (index, obj) {\n formData.append(obj.name, obj.value);\n });\n } else {\n formData = {};\n $(serializedArray).each(function (index, obj) {\n formData[obj.name] = obj.value;\n });\n }\n\n $btnSubmit.find(\"i\").attr(\"class\", \"las la-spinner la-spin ml-2\");\n $wrapper.append($loader);\n\n window.submitForm(formData, formId, resultCallback);\n }\n });\n });\n }\n\n if ($(\".form.needs-validation\").length > 0) {\n initForms();\n }\n\n /*prices view*/\n function initFuelPricesView() {\n var $view = $(\".tp-prices\"),\n viewId = $view.attr(\"id\"),\n $form = $view.find(\".form\"),\n $listingType = $view.find(\"[name='listingType']\"),\n $datePickerCol = $view.find(\"#datePickerCol\"),\n $fuelChoose = $view.find(\"#fuelChoose\"), \n $btnSubmit = $view.find(\".btn-submit-form\"),\n $error = $view.find(\"#form-error\"),\n $city = $view.find(\"[name='city']\"),\n $district = $view.find(\"[name='district']\"), \n $pricesTable = $view.find(\"#pricesTable\"),\n $exportButtons = $($pricesTable.data(\"buttons\")),\n tableExportOptions = {\n exportButtons: false,\n filename: $pricesTable.data(\"filename\"),\n },\n $dataInfo = $pricesTable.find(\"#dataInfo\"),\n $dataFields = $pricesTable.find(\"#dataFields\"),\n $dataRows = $pricesTable.find(\"#dataRows\"),\n btnSubmitOriginalHtml = $btnSubmit.html(),\n lastCalledFormData = null;\n\n var fpOptions = { mode: \"range\", maxDate: \"today\", dateFormat: \"d.m.Y\" };\n var datePickerInput = document.querySelector(\"#datePicker\");\n var fp = flatpickr(datePickerInput, fpOptions);\n\n $exportButtons.find(\".export-btn\").on(\"click\", function (e) {\n e.preventDefault();\n var $this = $(this);\n var type = $this.data(\"type\");\n var tableInstance = $pricesTable.tableExport(tableExportOptions);\n var exportData = tableInstance.getExportData()[\"pricesTable\"][type];\n tableInstance.export2file(\n exportData.data,\n exportData.mimeType,\n exportData.filename,\n exportData.fileExtension\n );\n });\n\n function createTable(data) {\n if (data.info) {\n $dataInfo.html(data.info);\n }\n\n if (data.fields) {\n var fieldsHtml = \"\";\n $(data.fields).each(function (i, field) {\n fieldsHtml += \"\" + field + \"\";\n });\n $dataFields.html(fieldsHtml);\n }\n\n if (data.rows) {\n var rowsHtml = \"\";\n $(data.rows).each(function (i, row) {\n rowsHtml += \"\";\n\n $(row).each(function (i, item) {\n rowsHtml += \"\" + item + \"\";\n });\n\n rowsHtml += \"\";\n });\n $dataRows.html(rowsHtml);\n $exportButtons.removeClass(\"d-none\");\n }\n if (locoScroll) {\n locoScroll.update();\n }\n }\n\n function resultSuccess(data) {\n $btnSubmit.html(btnSubmitOriginalHtml);\n if (data) {\n createTable(data);\n Helpers.setUrlParameter($.param(lastCalledFormData));\n }\n lastCalledFormData = null;\n }\n\n function resultError(err) {\n $btnSubmit.html(btnSubmitOriginalHtml);\n if (locoScroll) {\n locoScroll.update();\n }\n lastCalledFormData = null;\n }\n\n function resetForm() {\n fp.clear();\n $city.val(null).trigger(\"change\");\n $district.val(null).trigger(\"change\");\n $error.addClass(\"d-none\");\n }\n\n function formOnChange() {\n $error.addClass(\"d-none\");\n }\n\n $city.on(\"change\", formOnChange);\n\n $district.on(\"change\", formOnChange);\n\n fp.config.onChange.push(formOnChange);\n\n function toggleDatePicker() {\n if (listingType === \"0\") {\n $datePickerCol.hide();\n $fuelChoose.hide();\n } else {\n $datePickerCol.show();\n $fuelChoose.show();\n }\n }\n\n var listingType = $listingType.val();\n toggleDatePicker();\n\n $listingType.on(\"change\", function () {\n listingType = $(this).val();\n toggleDatePicker();\n\n $dataInfo.html(\"\");\n $dataFields.html(\"\");\n $dataRows.html(\"\");\n\n $exportButtons.addClass(\"d-none\");\n\n resetForm();\n\n if (locoScroll) {\n locoScroll.update();\n }\n });\n\n /*setTimeout(function () {\n window.submitFuelPriceForm({}, resultSuccess, resultError);\n }, 500);*/\n\n $btnSubmit.on(\"click\", function (e) {\n e.preventDefault();\n\n var formData = {};\n var dateStrings = [\"startDate\", \"endDate\"];\n formData.type = listingType;\n formData.city = $city.val();\n if ($district.length > 0) {\n formData.district = $district.val();\n }\n if($choose.length > 0) {\n formdata.choose = $choose.val();\n }\n if (listingType !== \"0\") {\n $(fp.selectedDates).each(function (i, item) {\n formData[dateStrings[i]] = fp.formatDate(item, \"Y-m-d\");\n });\n }\n\n var isValid = true;\n if (!formData.city || ($district.length > 0 && !formData.district)) {\n isValid = false;\n }\n\n if (\n listingType !== \"0\" &&\n (!formData[dateStrings[0]] || !formData[dateStrings[1]])\n ) {\n isValid = false;\n }\n\n if (!isValid) {\n $error.removeClass(\"d-none\");\n } else {\n $error.addClass(\"d-none\");\n\n $dataInfo.html(\"\");\n $dataFields.html(\"\");\n $dataRows.html(\"\");\n\n $exportButtons.addClass(\"d-none\");\n\n $btnSubmit.find(\"i\").attr(\"class\", \"las la-spinner la-spin ml-2\");\n\n lastCalledFormData = formData;\n window.submitFuelPriceForm(\n formData,\n viewId,\n resultSuccess,\n resultError\n );\n }\n });\n }\n\n if ($(\".tp-prices\").length > 0) {\n initFuelPricesView();\n }\n\n /*prices view*/\n /*function initLpgPricesView() {\n var $view = $(\"#lpgPricesView\"),\n $pricesTable = $view.find(\"#pricesTable\"),\n $exportButtons = $($pricesTable.data(\"buttons\")),\n tableExportOptions = {\n exportButtons: false,\n filename: $pricesTable.data(\"filename\"),\n };\n\n $exportButtons.find(\".export-btn\").on(\"click\", function (e) {\n e.preventDefault();\n var $this = $(this);\n var type = $this.data(\"type\");\n var tableInstance = $pricesTable.tableExport(tableExportOptions);\n var exportData = tableInstance.getExportData()[\"pricesTable\"][type];\n tableInstance.export2file(\n exportData.data,\n exportData.mimeType,\n exportData.filename,\n exportData.fileExtension\n );\n });\n }\n\n if ($(\"#lpgPricesView\").length > 0) {\n initLpgPricesView();\n }*/\n\n /*stations view*/\n function initStationsView() {\n var $view = $(\"#stationsView\"),\n $map = $view.find(\"#svgMap\"),\n $citySelect = $view.find(\"[name='city']\"),\n $resultView = $view.find(\".result\"),\n $resultLoader = $view.find(\".result-loader\"),\n $resultError = $view.find(\".result-error\"),\n $resultError = $view.find(\".result-error\"),\n $resultRefreshBtn = $view.find(\".result-refresh\"),\n $mapPaths = $map.find(\"path\"),\n $mapTooltip = $view.find(\"#svgTooltip\"),\n $mapTooltipCopy = null,\n initialCity = $view.data(\"initial-city\"),\n formOnProgress = false,\n lastFormData = null;\n\n function focusToResult() {\n var $target = $resultView;\n if (locoScroll) {\n var offset = $(\".tp-header\").height() * -1;\n locoScroll.scrollTo($target[0], offset);\n } else {\n $(\"html, body\").animate(\n {\n scrollTop: $target.offset().top,\n },\n 500\n );\n }\n }\n\n var itemTemp =\n '
\\\n
\\\n
\\\n
\\\n
\\\n \\\n {{lisenceNo}} - {{type}}\\\n \\\n

{{title}}

\\\n

{{address}}

\\\n \\\n Haritada Göster\\\n \\\n
\\\n
\\\n
\\\n
\\\n
';\n\n function createTable(data) {\n var resultHtml = \"\";\n $(data).each(function (i, item) {\n var itemHtml = itemTemp\n .replace(\"{{lisenceNo}}\", item.lisenceNo)\n .replace(\"{{type}}\", item.type)\n .replace(\"{{title}}\", item.title)\n .replace(\"{{address}}\", item.address)\n .replace(\"{{mapUrl}}\", item.mapUrl);\n var $item = $(itemHtml);\n if (!item.mapUrl) {\n $item.find(\"a\").remove();\n }\n resultHtml += $item[0].outerHTML;\n });\n\n $resultView.html(resultHtml);\n\n initGridsAndLists();\n }\n\n function resultSuccess(data) {\n if (data) {\n createTable(data);\n }\n $resultLoader.addClass(\"d-none\");\n formOnProgress = false;\n\n if (locoScroll) {\n locoScroll.update();\n }\n }\n\n function resultError(err) {\n $resultLoader.addClass(\"d-none\");\n $resultError.removeClass(\"d-none\");\n formOnProgress = false;\n\n if (locoScroll) {\n locoScroll.update();\n }\n }\n\n function submitForm(id) {\n var formData = { id: id };\n lastFormData = formData;\n $resultView.html(\"\");\n $resultError.addClass(\"d-none\");\n $resultLoader.removeClass(\"d-none\");\n focusToResult();\n window.submitStationsForm(formData, resultSuccess, resultError);\n }\n\n $resultRefreshBtn.on(\"click\", function (e) {\n e.preventDefault();\n if (lastFormData) {\n submitForm(lastFormData.id);\n }\n });\n\n function moveTooltip($element, x, y) {\n var relativeXPosition = x - $map.offset().left;\n var relativeYPosition = y - $map.offset().top;\n $element.css({\n top: relativeYPosition - 50 + \"px\",\n left: relativeXPosition + \"px\",\n });\n }\n\n $(window).on(\n \"resize orientationchange\",\n Helpers.throttle(function (event) {\n if ($mapTooltipCopy) {\n var $target = $map.find(\"path.active\");\n moveTooltip(\n $mapTooltipCopy,\n $target.parent().offset().left +\n $target.parent()[0].getBoundingClientRect().width * 0.5,\n $target.parent().offset().top +\n $target.parent()[0].getBoundingClientRect().height * 0.5\n );\n }\n }, 300)\n );\n\n $citySelect.on(\"change\", function () {\n selectCity($citySelect.val(), true, false);\n });\n\n function selectCity(id, setPosition, isInitial) {\n var founded = false;\n\n $mapPaths.each(function () {\n if (\n $(this).parent().data(\"plakakodu\").toString() === id.toString() &&\n !founded &&\n !formOnProgress\n ) {\n $mapPaths.removeClass(\"active\");\n\n if ($mapTooltipCopy) {\n $mapTooltipCopy.remove();\n }\n\n $(this).parent().find(\"path\").addClass(\"active\");\n var name = $(this).parent().data(\"iladi\");\n $mapTooltip.html(\"
\" + name + \"
\");\n founded = true;\n\n if (setPosition) {\n moveTooltip(\n $mapTooltip,\n $(this).parent().offset().left +\n $(this).parent()[0].getBoundingClientRect().width * 0.5,\n $(this).parent().offset().top +\n $(this).parent()[0].getBoundingClientRect().height * 0.5\n );\n }\n\n $mapTooltipCopy = $mapTooltip.clone();\n $mapTooltipCopy.removeAttr(\"id\");\n $mapTooltip.after($mapTooltipCopy);\n $mapTooltip.html(\"\");\n\n if (!isInitial) {\n Helpers.setUrlParameter(\"city=\" + id);\n formOnProgress = true;\n submitForm(id);\n }\n }\n });\n }\n\n var urlCity = Helpers.getUrlParameter(\"city\");\n if (urlCity) {\n selectCity(urlCity, true, true);\n $citySelect.val(urlCity).trigger(\"change.select2\");\n } else if (initialCity) {\n selectCity(initialCity, true, true);\n $citySelect.val(initialCity).trigger(\"change.select2\");\n Helpers.setUrlParameter(\"city=\" + initialCity);\n }\n\n $map.on(\"mouseover\", function (e) {\n if ($(e.target).prop(\"tagName\") === \"path\") {\n if ($(e.target).hasClass(\"active\")) {\n return;\n }\n var name = $(e.target).parent().data(\"iladi\");\n $(e.target).parent().find(\"path\").addClass(\"hover\");\n $mapTooltip.html(\"
\" + name + \"
\");\n }\n });\n\n $map.on(\"mouseout\", function () {\n $mapTooltip.html(\"\");\n $mapPaths.removeClass(\"hover\");\n });\n\n $map.on(\"mousemove\", function (e) {\n moveTooltip($mapTooltip, e.pageX, e.pageY);\n });\n\n $map.on(\"click\", function (e) {\n if ($(e.target).prop(\"tagName\") === \"path\") {\n if ($(e.target).hasClass(\"active\")) {\n return;\n }\n var id = $(e.target).parent().data(\"plakakodu\").toString();\n\n selectCity(id, false, false);\n $citySelect.val(id).trigger(\"change.select2\");\n }\n });\n }\n\n if ($(\"#stationsView\").length > 0) {\n initStationsView();\n }\n\n /*Equal height - no need anymore*/\n /*if ($('.tp-slider [data-match-height=\"title\"]').length > 0) {\n $('.tp-slider [data-match-height=\"title\"]').matchHeight();\n }\n if ($('.tp-slider [data-match-height=\"desc\"]').length > 0) {\n $('.tp-slider [data-match-height=\"desc\"]').matchHeight();\n }\n if ($('.tp-cc-slider [data-match-height=\"title\"]').length > 0) {\n $('.tp-cc-slider [data-match-height=\"title\"]').matchHeight();\n }\n if ($('.tp-cc-slider [data-match-height=\"desc\"]').length > 0) {\n $('.tp-cc-slider [data-match-height=\"desc\"]').matchHeight();\n }\n if ($('.tp-cc-slider [data-match-height=\"content\"]').length > 0) {\n $('.tp-cc-slider [data-match-height=\"content\"]').matchHeight();\n }*/\n\n /*Accordion*/\n function initAccordion() {\n $(\".accordion\").each(function () {\n var $this = $(this),\n $collapse = $this.find(\".collapse\");\n\n $collapse.first().prev().addClass(\"active\");\n\n $collapse.on(\"show.bs.collapse\", function () {\n $(this).prev().addClass(\"active\");\n });\n\n $collapse.on(\"hide.bs.collapse\", function () {\n $(this).prev().removeClass(\"active\");\n });\n\n $collapse.on(\"shown.bs.collapse\", function () {\n if (locoScroll) {\n //locoScroll.update();\n var offset = $(\".tp-header\").height() * -1;\n locoScroll.scrollTo($(this).parent()[0], offset);\n }\n });\n\n $collapse.on(\"hidden.bs.collapse\", function () {\n if (locoScroll) {\n locoScroll.update();\n }\n });\n });\n }\n\n if ($(\".accordion\").length > 0) {\n initAccordion();\n }\n\n /*GridAndLists*/\n function initGridsAndLists() {\n $(\".tp-grid-and-list\").each(function () {\n var $gridOrList = $(this),\n $items = $gridOrList.find(\".item\"),\n $bg = $gridOrList.find(\".item-bg\"),\n isGrid = $gridOrList.hasClass(\"grid\"),\n bgSpace = { top: isGrid ? 100 : 0, left: 0, right: 0, bottom: 0 };\n\n $items.on(\"mouseover\", function () {\n var $item = $(this);\n\n bgSpace.bottom =\n parseInt($item.css(\"marginBottom\").replace(\"px\", \"\")) * -1;\n\n var $parent = $item.parent();\n var pos = $parent.position();\n var x =\n pos.left +\n parseInt($parent.css(\"paddingLeft\").replace(\"px\", \"\")) +\n bgSpace.left;\n var y =\n pos.top +\n parseInt($parent.css(\"paddingTop\").replace(\"px\", \"\")) +\n bgSpace.top;\n var width = $parent.width() - (bgSpace.left + bgSpace.right);\n var height = $parent.height() + (bgSpace.top * -1 + bgSpace.bottom);\n\n $item.addClass(\"active\");\n $bg.addClass(\"active\");\n\n $bg[0].style.width = width + \"px\";\n $bg[0].style.height = height + \"px\";\n $bg[0].style.transform =\n \"translateX(\" + x + \"px ) translateY(\" + y + \"px)\";\n });\n\n $items.on(\"mouseleave\", function () {\n $items.removeClass(\"active\");\n $bg.removeClass(\"active\");\n });\n });\n }\n\n if ($(\".tp-grid-and-list\").length > 0) {\n initGridsAndLists();\n }\n\n window.onunload = function () {};\n window.onpageshow = function () {};\n window.addEventListener(\"beforeunload\", function () {});\n\n /*Window load*/\n $(window).on(\"load\", function () {\n $.ready.then(function () {\n if ($html.hasClass(\"preload-page\")) {\n setTimeout(function () {\n $html.addClass(\"page-load\");\n }, 5000);\n }\n\n /*Update scroll*/\n locoScroll = new LocomotiveScroll({\n el: document.querySelector(\"[data-scroll-container]\"),\n smooth: true,\n getDirection: true,\n });\n\n locoScroll.on(\"scroll\", function (e) {\n stickyHeader(e.scroll.y);\n\n stickyTableHeader();\n\n if ($(\".animated-counter\").length > 0) {\n animatedCounter();\n }\n\n if (\n $(\".tp-select__select2\").length > 0 &&\n $(\".select2-dropdown\").length > 0\n ) {\n $(\".tp-select__select2\").each(function () {\n $(this).select2(\"close\");\n });\n }\n });\n });\n });\n\n /*resize*/\n $(window).on(\n \"resize orientationchange\",\n Helpers.throttle(function (event) {\n windowWidth = Math.max($(window).width(), window.innerWidth);\n }, 300)\n );\n})(jQuery);\n"],"file":"scripts.bundle.js"}