1/******/ (() => { // webpackBootstrap 2/******/ "use strict"; 3/******/ var __webpack_modules__ = ({ 4 5/***/ 2: 6/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 7 8__webpack_require__.r(__webpack_exports__); 9/* harmony export */ __webpack_require__.d(__webpack_exports__, { 10/* harmony export */ csGetCookie: () => (/* binding */ csGetCookie), 11/* harmony export */ csSetCookie: () => (/* binding */ csSetCookie), 12/* harmony export */ csco: () => (/* binding */ csco), 13/* harmony export */ isInViewport: () => (/* binding */ isInViewport), 14/* harmony export */ slideDown: () => (/* binding */ slideDown), 15/* harmony export */ slideToggle: () => (/* binding */ slideToggle), 16/* harmony export */ slideUp: () => (/* binding */ slideUp) 17/* harmony export */ }); 18// Create csco object. 19var csco = { 20 addAction: function addAction(x, y, z) { 21 return; 22 } 23}; 24if ('undefined' !== typeof wp && 'undefined' !== typeof wp.hooks) { 25 csco.addAction = wp.hooks.addAction; 26} 27 28/** 29 * isInViewport 30 */ 31 32function isInViewport(element) { 33 var rect = element.getBoundingClientRect(); 34 var windowHeight = window.innerHeight || document.documentElement.clientHeight; 35 var windowWidth = window.innerWidth || document.documentElement.clientWidth; 36 return rect.top <= windowHeight && rect.top + rect.height >= 0 && rect.left <= windowWidth && rect.left + rect.width >= 0; 37} 38 39/** 40 * slideDown \ slideUp \ slideToggle 41 */ 42 43function slideDown(element) { 44 var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 350; 45 element.style.display = 'block'; 46 element.style.overflow = 'hidden'; 47 var height = element.scrollHeight; 48 element.style.height = 0; 49 setTimeout(function () { 50 element.style.transition = "height ".concat(duration, "ms"); 51 element.style.height = height + 'px'; 52 element.addEventListener('transitionend', function te() { 53 element.removeEventListener('transitionend', te); 54 element.style.removeProperty('height'); 55 element.style.removeProperty('transition'); 56 element.style.removeProperty('overflow'); 57 }); 58 }, 0); 59} 60function slideUp(element) { 61 var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 350; 62 element.style.height = element.offsetHeight + 'px'; 63 element.style.overflow = 'hidden'; 64 setTimeout(function () { 65 element.style.transition = "height ".concat(duration, "ms"); 66 element.style.height = '0'; 67 element.addEventListener('transitionend', function te() { 68 element.removeEventListener('transitionend', te); 69 if (element.style.height === '0px') { 70 element.style.display = 'none'; 71 } 72 element.style.removeProperty('height'); 73 element.style.removeProperty('transition'); 74 element.style.removeProperty('overflow'); 75 }); 76 }, 0); 77} 78function slideToggle(element) { 79 var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 350; 80 if (window.getComputedStyle(element).display === 'none') { 81 return slideDown(element, duration); 82 } else { 83 return slideUp(element, duration); 84 } 85} 86 87/** 88 * Cookies 89 */ 90function csGetCookie(name) { 91 var matches = document.cookie.match(new RegExp("(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)")); 92 return matches ? decodeURIComponent(matches[1]) : undefined; 93} 94function csSetCookie(name, value) { 95 var props = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; 96 props = { 97 path: '/' 98 }; 99 if (props.expires instanceof Date) { 100 props.expires = props.expires.toUTCString(); 101 } 102 var updatedCookie = encodeURIComponent(name) + "=" + encodeURIComponent(value); 103 for (var optionKey in props) { 104 updatedCookie += "; " + optionKey; 105 var optionValue = props[optionKey]; 106 if (optionValue !== true) { 107 updatedCookie += "=" + optionValue; 108 } 109 } 110 document.cookie = updatedCookie; 111} 112 113 114/***/ }) 115 116/******/ }); 117/************************************************************************/ 118/******/ // The module cache 119/******/ var __webpack_module_cache__ = {}; 120/******/ 121/******/ // The require function 122/******/ function __webpack_require__(moduleId) { 123/******/ // Check if module is in cache 124/******/ var cachedModule = __webpack_module_cache__[moduleId]; 125/******/ if (cachedModule !== undefined) { 126/******/ return cachedModule.exports; 127/******/ } 128/******/ // Create a new module (and put it into the cache) 129/******/ var module = __webpack_module_cache__[moduleId] = { 130/******/ // no module.id needed 131/******/ // no module.loaded needed 132/******/ exports: {} 133/******/ }; 134/******/ 135/******/ // Execute the module function 136/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 137/******/ 138/******/ // Return the exports of the module 139/******/ return module.exports; 140/******/ } 141/******/ 142/************************************************************************/ 143/******/ /* webpack/runtime/define property getters */ 144/******/ (() => { 145/******/ // define getter functions for harmony exports 146/******/ __webpack_require__.d = (exports, definition) => { 147/******/ for(var key in definition) { 148/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 149/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 150/******/ } 151/******/ } 152/******/ }; 153/******/ })(); 154/******/ 155/******/ /* webpack/runtime/hasOwnProperty shorthand */ 156/******/ (() => { 157/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) 158/******/ })(); 159/******/ 160/******/ /* webpack/runtime/make namespace object */ 161/******/ (() => { 162/******/ // define __esModule on exports 163/******/ __webpack_require__.r = (exports) => { 164/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 165/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 166/******/ } 167/******/ Object.defineProperty(exports, '__esModule', { value: true }); 168/******/ }; 169/******/ })(); 170/******/ 171/************************************************************************/ 172var __webpack_exports__ = {}; 173// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules. 174(() => { 175var __webpack_exports__ = {}; 176__webpack_require__.r(__webpack_exports__); 177/** ---------------------------------------------------------------------------- 178 * Comments Toggle */ 179 180(function () {
181 var commentsElement = document.querySelector('.cs-entry__comments'); 182 var headToggles = document.querySelectorAll('.cs-entry__header .cs-meta-comments'); 183 184 // Handle toggling comments visibility 185 document.addEventListener('click', function (e) { 186 if (e.target && e.target.classList.contains('cs-entry__comments-view-toggle')) { 187 e.preventDefault(); 188 var commentsWrap = e.target.closest('.cs-entry__wrap'); 189 var _commentsElement = commentsWrap.querySelector('.cs-entry__comments'); 190 _commentsElement.classList.toggle('cs-entry__comments-visible'); 191 } 192 }); 193 headToggles.forEach(function (headToggle) { 194 headToggle.addEventListener('click', function (e) { 195 e.preventDefault(); 196 commentsElement.classList.add('cs-entry__comments-visible'); 197 commentsElement.scrollIntoView({ 198 behavior: 'smooth' 199 }); 200 }); 201 }); 202 var scrollToHash = function scrollToHash() { 203 if (window.location.hash && window.location.hash !== "#") { 204 var target = document.querySelector(window.location.hash); 205 if (target && target === commentsElement) { 206 commentsElement.classList.add('cs-entry__comments-visible'); 207 } 208 } 209 }; 210 window.addEventListener('load', scrollToHash); 211 document.addEventListener('DOMContentLoaded', function () { 212 document.addEventListener('click', function (event) { 213 // Check if the clicked element is a reply link 214 var replyLink = event.target.closest('.comment-reply-link'); 215 if (replyLink) { 216 event.preventDefault(); 217 var commentsWrap = replyLink.closest('.cs-entry__wrap'); 218 var _commentsElement2 = commentsWrap.querySelector('.cs-entry__comments'); 219 220 // Ensure comments form visibility toggle is handled 221 if (_commentsElement2 && _commentsElement2.classList.contains('cs-entry__comments-form-visible')) { 222 _commentsElement2.classList.remove('cs-entry__comments-form-visible'); 223 } 224 var cancelLink = commentsWrap.querySelector('#cancel-comment-reply-link'); 225 var targetSpan = commentsWrap.querySelector('.form-submit .cs-cancel-reply-button'); 226 var commentBody = commentsWrap.querySelector('.comment-body'); 227 228 // Move the cancel link into the form's cancel button container 229 if (cancelLink && targetSpan) { 230 targetSpan.appendChild(cancelLink); 231 cancelLink.style.display = 'inline'; 232 } 233 234 // Show the reply form inside the current comment 235 if (commentBody) { 236 setTimeout(function () { 237 var commentRespond = commentBody.querySelector('.comment-respond'); 238 if (commentRespond) { 239 commentRespond.style.display = 'block'; 240 } 241 }, 50); 242 } 243 } 244 }); 245 }); 246})(); 247})(); 248 249// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules. 250(() => { 251var __webpack_exports__ = {}; 252__webpack_require__.r(__webpack_exports__); 253/* harmony import */ var _utility_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); 254/** ---------------------------------------------------------------------------- 255 * Footer Nav Menu */ 256 257 258(function () { 259 HTMLElement.prototype.responsiveNav = function () { 260 this.classList.remove('menu-item-expanded'); 261 var previousElement = this.previousElementSibling; 262 if (previousElement && previousElement.classList.contains('submenu-visible')) { 263 previousElement.classList.remove('submenu-visible'); 264 (0,_utility_js__WEBPACK_IMPORTED_MODULE_0__.slideUp)(previousElement); 265 this.parentElement.classList.remove('menu-item-expanded'); 266 } else { 267 var parentOfParent = this.parentElement.parentElement; 268 parentOfParent.querySelectorAll('.menu-item .sub-menu').forEach(function (subMenu) { 269 subMenu.classList.remove('submenu-visible'); 270 (0,_utility_js__WEBPACK_IMPORTED_MODULE_0__.slideUp)(subMenu); 271 }); 272 parentOfParent.querySelectorAll('.menu-item-expanded').forEach(function (item) { 273 item.classList.remove('menu-item-expanded'); 274 }); 275 if (previousElement) { 276 previousElement.classList.toggle('submenu-visible'); 277 (0,_utility_js__WEBPACK_IMPORTED_MODULE_0__.slideToggle)(previousElement); 278 } 279 this.parentElement.classList.toggle('menu-item-expanded'); 280 } 281 }; 282 document.addEventListener('DOMContentLoaded', function () { 283 var menuItems = document.querySelectorAll('.cs-footer__nav .menu-item-has-children');
284 menuItems.forEach(function (menuItem) { 285 var span = document.createElement('span'); 286 menuItem.appendChild(span); 287 span.addEventListener('click', function (e) { 288 e.preventDefault(); 289 this.responsiveNav(); 290 }); 291 }); 292 }); 293})(); 294})(); 295 296// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules. 297(() => { 298var __webpack_exports__ = {}; 299__webpack_require__.r(__webpack_exports__); 300/** ---------------------------------------------------------------------------- 301 * Header Scroll Scheme */ 302 303document.addEventListener('DOMContentLoaded', function () { 304 var transitionTimer; 305 document.addEventListener('nav-stick', function (event) { 306 if (document.body.classList.contains('cs-display-header-overlay')) { 307 var headerSmart = document.querySelector('.cs-navbar-smart-enabled .cs-header, .cs-navbar-sticky-enabled .cs-header'); 308 var headerAlt = headerSmart.querySelector('.cs-container'); 309 headerAlt.classList.add("cs-header-elements-no-transition"); 310 clearTimeout(transitionTimer); 311 transitionTimer = setTimeout(function () { 312 headerAlt.classList.remove("cs-header-elements-no-transition"); 313 }, 300); 314 } 315 }); 316 document.addEventListener('nav-unstick', function (event) { 317 if (document.body.classList.contains('cs-display-header-overlay')) { 318 var headerSmart = document.querySelector('.cs-navbar-smart-enabled .cs-header, .cs-navbar-sticky-enabled .cs-header'); 319 var headerAlt = headerSmart.querySelector('.cs-container'); 320 headerAlt.classList.add("cs-header-elements-no-transition"); 321 clearTimeout(transitionTimer); 322 transitionTimer = setTimeout(function () { 323 headerAlt.classList.remove("cs-header-elements-no-transition"); 324 }, 300); 325 } 326 }); 327}); 328})(); 329 330// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules. 331(() => { 332var __webpack_exports__ = {}; 333__webpack_require__.r(__webpack_exports__); 334/** ---------------------------------------------------------------------------- 335 * Header Smart Streatch */ 336 337document.addEventListener('DOMContentLoaded', function () { 338 document.addEventListener('header-smart-stretch-scroll-sticky-scroll-init', function (event) { 339 var headerParams = event.detail; 340 window.addEventListener('scroll', function () { 341 var scrolled = window.scrollY; 342 var headerSmart = document.querySelector('.cs-navbar-smart-enabled .cs-header, .cs-navbar-sticky-enabled .cs-header'); 343 headerParams.headerSmartPosition = headerSmart ? headerSmart.offsetTop : 0; 344 if (scrolled > headerParams.smartStart + headerParams.scrollPoint + 10 && scrolled > headerParams.scrollPrev) { 345 if (scrolled > headerParams.smartStart + headerParams.headerLargeHeight + 200) { 346 document.dispatchEvent(new CustomEvent('sticky-nav-hide', { 347 detail: headerParams 348 })); 349 } 350 } else { 351 if (headerParams.scrollUpAmount >= headerParams.scrollPoint || scrolled === 0) { 352 document.dispatchEvent(new CustomEvent('sticky-nav-visible', { 353 detail: headerParams 354 })); 355 } 356 } 357 if (scrolled > headerParams.smartStart + headerParams.headerLargeHeight) { 358 document.dispatchEvent(new CustomEvent('nav-stick', { 359 detail: headerParams 360 })); 361 } else if (headerParams.headerSmartPosition <= headerParams.smartStart) { 362 document.dispatchEvent(new CustomEvent('nav-unstick', { 363 detail: headerParams 364 })); 365 } 366 if (scrolled < headerParams.scrollPrev) { 367 headerParams.scrollUpAmount += headerParams.scrollPrev - scrolled; 368 } else { 369 headerParams.scrollUpAmount = 0; 370 } 371 var wpAdminBar = document.querySelector('#wpadminbar'); 372 if (wpAdminBar && window.innerWidth <= 600 && scrolled >= headerParams.wpAdminBarHeight) { 373 document.dispatchEvent(new CustomEvent('adminbar-mobile-scrolled', { 374 detail: headerParams 375 })); 376 } else { 377 document.dispatchEvent(new CustomEvent('adminbar-mobile-no-scrolled', { 378 detail: headerParams 379 })); 380 } 381 headerParams.scrollPrev = scrolled; 382 }); 383 }); 384}); 385})(); 386 387// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules. 388(() => { 389var __webpack_exports__ = {}; 390__webpack_require__.r(__webpack_exports__); 391/* harmony import */ var _utility_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); 392/** ---------------------------------------------------------------------------- 393 * Hero */ 394 395 396(function () { 397 var section = 'cs-hero-type-2'; 398 var sliders = document.querySelectorAll(".".concat(section, "__slider")); 399 if (sliders.length === 0) { 400 return; 401 } 402 var executed = false;
403 var isMouseOnControl = false; // Track if the mouse is on the controls (next/prev/pagination) 404 var isMouseOnSlider = false; // Track if the mouse is on the slider 405 var isSliderVisible = true; // Track if the slider is fully visible on the screen 406 407 var initHero = function initHero() { 408 if (!executed && (0,_utility_js__WEBPACK_IMPORTED_MODULE_0__.isInViewport)(sliders[0])) { 409 executed = true; 410 var head = document.getElementsByTagName('head')[0]; 411 var script = document.createElement('script'); 412 script.type = 'text/javascript'; 413 script.src = 'https://cdn.jsdelivr.net/npm/swiper@10/swiper-bundle.min.js'; 414 script.onload = function () { 415 function setParallaxAttributes(element, duration) { 416 element.setAttribute('data-swiper-parallax-x', '-400'); 417 element.setAttribute('data-swiper-parallax-duration', duration); 418 } 419 sliders.forEach(function (slider) { 420 // Section data 421 var autoplayValue = slider.getAttribute('data-cs-autoplay'); 422 var autoplayDelayValue = slider.getAttribute('data-cs-autoplay-delay'); 423 var parallaxValue = slider.getAttribute('data-cs-parallax'); 424 var gapValue = slider.getAttribute('data-cs-gap'); 425 var postContentContainer = '.cs-entry__content'; 426 // Data manipulation 427 var autoplayDelay = !isNaN(parseInt(autoplayDelayValue)) ? parseInt(autoplayDelayValue) : 5000; 428 var autoplay = autoplayValue ? { 429 delay: autoplayDelay, 430 disableOnInteraction: false, 431 pauseOnMouseEnter: true 432 } : false; 433 var parallax = !!parallaxValue ? true : false; 434 var gap = !isNaN(parseInt(gapValue)) ? parseInt(gapValue) : 0; 435 var postContents = slider.querySelectorAll(postContentContainer); 436 if (parallax) { 437 if (postContents.length > 0) { 438 postContents.forEach(function (postContent) { 439 setParallaxAttributes(postContent, '800'); 440 }); 441 } 442 } 443 // Swiper settings 444 var wrapperClass = "".concat(section, "__wrapper"); 445 var slideClass = "".concat(section, "__item"); 446 var prevEl = slider.querySelector(".".concat(section, "__button-prev")); 447 var nextEl = slider.querySelector(".".concat(section, "__button-next")); 448 var paginationContainer = slider.querySelector(".".concat(section, "__pagination")); 449 var bulletClass = "".concat(section, "__pagination-bullet"); 450 var bulletClassActive = "".concat(section, "__pagination-bullet-active"); 451 var swiper = new Swiper(slider, { 452 scrollbar: false, 453 wrapperClass: wrapperClass, 454 slideClass: slideClass, 455 direction: 'horizontal', 456 loop: true, 457 speed: 800, 458 parallax: parallax, 459 autoplay: autoplay, 460 slidesPerView: 1, 461 spaceBetween: gap, 462 a11y: { 463 slideRole: 'article', 464 slideLabelMessage: 'Slide {{index}} of {{slidesLength}}' 465 }, 466 pagination: { 467 el: paginationContainer, 468 clickable: true, 469 bulletElement: 'span', 470 bulletClass: bulletClass, 471 bulletActiveClass: bulletClassActive 472 }, 473 navigation: { 474 nextEl: nextEl, 475 prevEl: prevEl 476 }, 477 on: { 478 init: function init() { 479 var _this = this; 480 setTimeout(function () { 481 var initialSlide = _this.slides[_this.activeIndex]; 482 if (initialSlide) { 483 var initialContent = initialSlide.querySelector(postContentContainer); 484 if (initialContent) { 485 initialContent.style.transform = 'none'; 486 } 487 } 488 }, 100); 489 }, 490 slideChange: function slideChange() { 491 var currentSlide = this.slides[this.activeIndex];
492 postContents.forEach(function (postContent) { 493 if (postContent === currentSlide.querySelector(postContentContainer)) { 494 postContent.style.transform = 'none'; 495 } 496 }); 497 } 498 } 499 }); 500 if (autoplayValue) { 501 var controls = [nextEl, prevEl, paginationContainer]; 502 controls.forEach(function (control) { 503 if (control) { 504 control.addEventListener('mouseenter', function () { 505 swiper.autoplay.stop(); 506 swiper.el.classList.add('swiper-paused'); 507 isMouseOnControl = true; // Track if mouse is on a control 508 509 // Pause button animation 510 if (nextEl) { 511 nextEl.style.animationPlayState = "paused"; 512 } 513 if (prevEl) { 514 prevEl.style.animationPlayState = "paused"; 515 } 516 }); 517 control.addEventListener('mouseleave', function () { 518 isMouseOnControl = false; // Mouse is no longer on a control 519 520 // Resume autoplay and remove 'swiper-paused' class if mouse is not on the slider 521 if (!isMouseOnSlider && isSliderVisible) { 522 swiper.autoplay.start(); 523 swiper.el.classList.remove('swiper-paused'); 524 } 525 526 // Resume button animation 527 if (nextEl) { 528 nextEl.style.animationPlayState = "running"; 529 } 530 if (prevEl) { 531 prevEl.style.animationPlayState = "running"; 532 } 533 }); 534 control.addEventListener('click', function () { 535 swiper.autoplay.stop(); 536 swiper.el.classList.add('swiper-paused'); 537 538 // Pause button animation on click 539 if (nextEl) { 540 nextEl.style.animationPlayState = "paused"; 541 } 542 if (prevEl) { 543 prevEl.style.animationPlayState = "paused"; 544 } 545 }); 546 } 547 }); 548 slider.addEventListener('mouseenter', function () { 549 isMouseOnSlider = true; 550 swiper.autoplay.stop(); 551 swiper.el.classList.add('swiper-paused'); 552 }); 553 slider.addEventListener('mouseleave', function () { 554 isMouseOnSlider = false;
555 if (!isMouseOnControl && isSliderVisible) { 556 swiper.autoplay.start(); 557 swiper.el.classList.remove('swiper-paused'); 558 } 559 }); 560 var observer = new IntersectionObserver(function (entries) { 561 entries.forEach(function (entry) { 562 if (entry.isIntersecting) { 563 isSliderVisible = true; 564 if (!isMouseOnControl && !isMouseOnSlider) { 565 swiper.autoplay.start(); 566 swiper.el.classList.remove('swiper-paused'); 567 } 568 } else { 569 isSliderVisible = false; 570 swiper.autoplay.stop(); 571 swiper.el.classList.add('swiper-paused'); 572 } 573 }); 574 }, { 575 threshold: 0.50 576 }); 577 observer.observe(slider); 578 } 579 }); 580 }; 581 head.appendChild(script); 582 } 583 }; 584 document.addEventListener('DOMContentLoaded', function () { 585 initHero(); 586 }); 587 window.addEventListener('resize', function () { 588 initHero(); 589 }); 590 window.addEventListener('scroll', function () { 591 initHero(); 592 }); 593})(); 594})(); 595 596// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules. 597(() => { 598var __webpack_exports__ = {}; 599__webpack_require__.r(__webpack_exports__); 600/* harmony import */ var _utility_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); 601/** ---------------------------------------------------------------------------- 602 * Latest Posts Widget */ 603 604 605(function () { 606 var section = 'cs-latest-posts-slider'; 607 var initLatestPosts = function initLatestPosts() { 608 var sliders = document.querySelectorAll(".".concat(section, " .is-style-cs-tile-layout")); 609 if (sliders.length === 0) { 610 return; 611 } 612 var loadSwiperScript = new Promise(function (resolve, reject) { 613 if (window.Swiper) { 614 resolve(); 615 return; 616 } 617 var head = document.getElementsByTagName('head')[0]; 618 var script = document.createElement('script'); 619 script.type = 'text/javascript'; 620 script.src = 'https://cdn.jsdelivr.net/npm/swiper@10/swiper-bundle.min.js'; 621 script.onload = resolve; 622 script.onerror = reject; 623 head.appendChild(script); 624 }); 625 loadSwiperScript.then(function () { 626 sliders.forEach(function (slider) { 627 if (slider.dataset.swiperInitialized === "true") { 628 return; 629 } 630 slider.dataset.swiperInitialized = "true"; 631 632 // Swiper settings. 633 var wrapperClass = "".concat(section, "__wrapper"); 634 var slideClass = "".concat(section, "__item"); 635 var prevEl = slider.querySelector(".".concat(section, "__button-prev")); 636 var nextEl = slider.querySelector(".".concat(section, "__button-next")); 637 var paginationContainer = slider.nextElementSibling; 638 var bulletClass = "".concat(section, "__pagination-bullet"); 639 var bulletClassActive = "".concat(section, "__pagination-bullet-active"); 640 new Swiper(slider, { 641 scrollbar: false, 642 wrapperClass: wrapperClass, 643 slideClass: slideClass, 644 direction: 'horizontal', 645 loop: true, 646 speed: 800, 647 parallax: false, 648 autoplay: false, 649 slidesPerView: 1, 650 a11y: { 651 slideRole: 'article', 652 slideLabelMessage: 'Slide {{index}} of {{slidesLength}}' 653 }, 654 pagination: { 655 el: paginationContainer, 656 clickable: true, 657 bulletElement: 'span', 658 bulletClass: bulletClass, 659 bulletActiveClass: bulletClassActive 660 }, 661 navigation: { 662 nextEl: nextEl, 663 prevEl: prevEl 664 } 665 }); 666 }); 667 })["catch"](function (error) { 668 console.error("Failed to load Swiper script:", error); 669 }); 670 }; 671 document.addEventListener('DOMContentLoaded', function () { 672 initLatestPosts(); 673 }); 674 window.addEventListener('resize', function () { 675 initLatestPosts(); 676 }); 677 window.addEventListener('scroll', function () { 678 initLatestPosts(); 679 }); 680 document.body.addEventListener('post-load', function () { 681 initLatestPosts(); 682 }); 683})(); 684})(); 685 686// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules. 687(() => { 688var __webpack_exports__ = {}; 689__webpack_require__.r(__webpack_exports__); 690/** 691 * AJAX Load More. 692 * 693 * Contains functions for AJAX Load More. 694 */ 695 696if (typeof window.load_more_query === 'undefined') { 697 window.load_more_query = []; 698} 699 700// Get next posts 701function csco_ajax_get_posts(object) { 702 var container = object.closest('.cs-posts-area'); 703 var settings = JSON.parse(object.dataset.settings); 704 var page = parseInt(object.dataset.page); 705 object.dataset.loading = true; 706 707 // Set button text to Load More. 708 object.textContent = settings.translation.loading; 709 var data = { 710 action: 'csco_ajax_load_more', 711 page: page, 712 posts_per_page: settings.posts_per_page, 713 query_data: settings.query_data, 714 attributes: settings.attributes, 715 options: settings.options, 716 _ajax_nonce: settings.nonce 717 }; 718 719 // Request Url. 720 var csco_pagination_url = settings.type === 'ajax_restapi' ? settings.rest_url : settings.url; 721 function encodeFormData(data) { 722 return Object.keys(data).map(function (key) { 723 return encodeURIComponent(key) + '=' + encodeURIComponent(data[key]); 724 }).join('&'); 725 } 726 fetch(csco_pagination_url, { 727 method: 'POST', 728 body: encodeFormData(data), 729 headers: { 730 'Content-Type': 'application/x-www-form-urlencoded' 731 } 732 }).then(function (response) { 733 return response.json(); 734 }).then(function (res) { 735 if (res.success) { 736 var dataContent = document.createElement('div'); 737 dataContent.innerHTML = res.data.content; 738 if (dataContent.children.length) { 739 // WP Post Load trigger. This might need more logic for your specific use-case. 740 document.body.dispatchEvent(new Event('post-load')); 741 742 // Reinit Facebook widgets. 743 if (document.querySelector('#fb-root') && typeof FB !== 'undefined') { 744 FB.XFBML.parse(); 745 } 746 747 // Set button text to Load More. 748 object.textContent = settings.translation.load_more; 749 750 // Increment a page. 751 page += 1; 752 object.dataset.page = page.toString(); 753 754 // Reset the loading state. 755 object.dataset.loading = "false"; 756 757 // Append new content to the container 758 var mainContainer = container.querySelector('.cs-posts-area__main'); 759 while (dataContent.firstChild) { 760 mainContainer.appendChild(dataContent.firstChild); 761 } 762 } 763 764 // Remove Button on Posts End. 765 if (res.data.posts_end) { 766 // Remove Load More button. 767 object.parentNode.removeChild(object); 768 } 769 } 770 })["catch"](function (error) { 771 console.error('Error fetching posts:', error); 772 }); 773} 774function csco_load_more_init(infinite) { 775 var areas = document.querySelectorAll('.cs-posts-area'); 776 areas.forEach(function (area) { 777 if (area.dataset.init) { 778 return; 779 } 780 var csco_ajax_settings; 781 var archive_data = area.dataset.postsArea; 782 if (archive_data) { 783 csco_ajax_settings = JSON.parse(window.atob(archive_data)); 784 } else if (typeof csco_ajax_pagination !== 'undefined' && typeof archive_data === 'undefined') { 785 csco_ajax_settings = csco_ajax_pagination; 786 } 787 if (csco_ajax_settings) { 788 if (!infinite && csco_ajax_settings.infinite_load) { 789 return; 790 } 791 var pagination = document.createElement('div'); 792 pagination.className = 'cs-posts-area__pagination'; 793 var btn = document.createElement('button'); 794 btn.className = 'cs-load-more'; 795 btn.textContent = csco_ajax_settings.translation.load_more; 796 pagination.appendChild(btn); 797 area.appendChild(pagination); 798 btn.dataset.settings = JSON.stringify(csco_ajax_settings); 799 btn.dataset.page = '2'; 800 btn.dataset.loading = "false"; 801 btn.dataset.scrollHandling = JSON.stringify({ 802 allow: JSON.parse(csco_ajax_settings.infinite_load), 803 delay: 400 804 }); 805 } 806 area.dataset.init = true; 807 }); 808} 809csco_load_more_init(true); 810 811// Elementor Init 812window.addEventListener('elementor/frontend/init', function () { 813 csco_load_more_init(true); 814}); 815 816// On Scroll Event. 817window.addEventListener('scroll', function () { 818 var buttons = document.querySelectorAll('.cs-posts-area .cs-load-more'); 819 buttons.forEach(function (btn) { 820 var loading = btn.dataset.loading === "true"; 821 var scrollHandling = JSON.parse(btn.dataset.scrollHandling || '{}'); 822 if (loading || !scrollHandling.allow) { 823 return; 824 } 825 scrollHandling.allow = false;
826 btn.dataset.scrollHandling = JSON.stringify(scrollHandling); 827 setTimeout(function () { 828 scrollHandling.allow = true; 829 btn.dataset.scrollHandling = JSON.stringify(scrollHandling); 830 }, scrollHandling.delay); 831 var offset = btn.getBoundingClientRect().top - window.innerHeight; 832 if (offset < 4000) { 833 csco_ajax_get_posts(btn); 834 } 835 }); 836}); 837 838// On Click Event. 839document.body.addEventListener('click', function (event) { 840 if (event.target.classList.contains('cs-load-more')) { 841 var loading = event.target.dataset.loading === "true"; 842 if (!loading) { 843 csco_ajax_get_posts(event.target); 844 } 845 } 846}); 847})(); 848 849// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules. 850(() => { 851var __webpack_exports__ = {}; 852__webpack_require__.r(__webpack_exports__); 853function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } 854// Check if Load Nextpost is defined by the wp_localize_script 855if (typeof csco_ajax_nextpost !== 'undefined') { 856 var objNextparent = document.querySelector('.cs-site-primary > .cs-site-content'); 857 var objNextsect = '.cs-nextpost-section'; 858 var objNextpost = null; 859 var currentNTitle = document.title; 860 var currentNLink = window.location.href; 861 var loadingNextpost = false; 862 var scrollNextpost = { 863 allow: true, 864 reallow: function reallow() { 865 scrollNextpost.allow = true; 866 }, 867 delay: 400 //(milliseconds) adjust to the highest acceptable value 868 }; 869 870 // Init. 871 if (csco_ajax_nextpost.next_post) { 872 objNextparent.insertAdjacentHTML('afterend', '<div class="cs-nextpost-inner"></div>'); 873 objNextpost = document.querySelector('.cs-nextpost-inner'); 874 } 875 876 // Remove previous & next post elements from the Floating Header. 877 var floatingHeader = document.querySelector('.cs-floating-header__content'); 878 if (floatingHeader) { 879 var nextElement = floatingHeader.querySelector('.cs-floating-header__next'); 880 if (nextElement) { 881 nextElement.remove(); 882 } 883 var prevElement = floatingHeader.querySelector('.cs-floating-header__prev'); 884 if (prevElement) { 885 prevElement.remove(); 886 } 887 var currentElement = floatingHeader.querySelector('.cs-floating-header__current'); 888 if (currentElement) { 889 currentElement.classList.add('fullwidth'); 890 } 891 } 892} 893 894/** 895 * Update Floating Header 896 */ 897function updateFloatingHeader(title) { 898 var floatingHeader = document.querySelector('.cs-floating-header__content'); 899 if (floatingHeader && title) { 900 var currentPostTitle = floatingHeader.querySelector('.cs-floating-header__current span'); 901 if (currentPostTitle) { 902 currentPostTitle.textContent = title || ''; // Fallback to empty string if title is missing 903 } 904 } 905} 906 907/** 908 * Get next post 909 */ 910function csco_ajax_get_nextpost() { 911 loadingNextpost = true; 912 913 // Set class loading. 914 var data = { 915 action: 'csco_ajax_load_nextpost', 916 not_in: csco_ajax_nextpost.not_in, 917 current_user: csco_ajax_nextpost.current_user, 918 nonce: csco_ajax_nextpost.nonce, 919 next_post: csco_ajax_nextpost.next_post 920 }; 921 922 // Request Url. 923 var csco_ajax_nextpost_url; 924 if ('ajax_restapi' === csco_ajax_nextpost.type) { 925 csco_ajax_nextpost_url = csco_ajax_nextpost.rest_url; 926 } else { 927 csco_ajax_nextpost_url = csco_ajax_nextpost.url; 928 } 929 function encodeFormData(data) { 930 return Object.keys(data).map(function (key) { 931 return encodeURIComponent(key) + '=' + encodeURIComponent(data[key]); 932 }).join('&'); 933 } 934 935 // Send Request. 936 fetch(csco_ajax_nextpost_url, { 937 method: 'POST', 938 body: encodeFormData(data), 939 headers: { 940 'Content-Type': 'application/x-www-form-urlencoded' 941 } 942 }).then(function (response) { 943 return response.json(); 944 }).then(function (res) { 945 csco_ajax_nextpost.next_post = false; 946 if (res.success) { 947 // Get the posts. 948 var tempDiv = document.createElement('div'); 949 tempDiv.innerHTML = res.data.content; 950 var newPosts = Array.from(tempDiv.children); 951 952 // Check if there're any posts. 953 if (newPosts.length) { 954 // Set the loading state. 955 loadingNextpost = false;
956 957 // Set not_in. 958 csco_ajax_nextpost.not_in = res.data.not_in; 959 960 // Set next data. 961 csco_ajax_nextpost.next_post = res.data.next_post; 962 963 // Remove loader. 964 var loadingElement = objNextpost.nextElementSibling; 965 if (loadingElement && loadingElement.classList.contains('cs-nextpost-loading')) { 966 loadingElement.remove(); 967 } 968 969 // Append new post. 970 newPosts.forEach(function (post) { 971 return objNextpost.appendChild(post.cloneNode(true)); 972 }); 973 974 // Update Floating Header with the new title. 975 if (objNextpost.children.length === newPosts.length) { 976 updateFloatingHeader(res.data.title || ''); 977 } 978 if (document.getElementById('fb-root') && (typeof FB === "undefined" ? "undefined" : _typeof(FB)) === 'object') { 979 FB.XFBML.parse(); 980 } 981 document.body.dispatchEvent(new Event('post-load')); 982 } 983 } else { 984 // console.log(res); 985 } 986 })["catch"](function (error) { 987 // console.log(error); 988 }); 989} 990 991/** 992 * Check if Load Nextpost is defined by the wp_localize_script 993 */ 994if (typeof csco_ajax_nextpost !== 'undefined') { 995 // On Scroll Event. 996 window.addEventListener('scroll', function () { 997 var scrollTop = window.scrollY || window.pageYOffset; 998 999 // Init nextpost. 1000 if (csco_ajax_nextpost.next_post) { 1001 if (objNextpost && !loadingNextpost && scrollNextpost.allow) { 1002 scrollNextpost.allow = false; 1003 setTimeout(scrollNextpost.reallow, scrollNextpost.delay); 1004 // Calc current offset. 1005 var offset = objNextpost.offsetTop + objNextpost.offsetHeight - scrollTop; 1006 // Load nextpost. 1007 if (4000 > offset) { 1008 objNextpost.insertAdjacentHTML('afterend', '<div class="cs-nextpost-loading"></div>'); 1009 csco_ajax_get_nextpost(); 1010 } 1011 } 1012 } 1013 1014 // Reset browser data link. 1015 var objFirst = document.querySelector(objNextsect + ':first-child'); 1016 if (objFirst) { 1017 var firstTop = objFirst.offsetTop; 1018 // If there has been a change. 1019 if (scrollTop < firstTop && window.location.href !== currentNLink) { 1020 document.title = currentNTitle; 1021 history.pushState(null, currentNTitle, currentNLink); 1022 updateFloatingHeader(currentNTitle); // Update header when scrolling back to the top 1023 } 1024 } 1025 1026 // Set browser data link. 1027 document.querySelectorAll(objNextsect).forEach(function (elem) { 1028 var elemTop = elem.offsetTop; 1029 var elemHeight = elem.offsetHeight; 1030 if (scrollTop > elemTop && scrollTop < elemTop + elemHeight) { 1031 // If there has been a change. 1032 if (window.location.href !== elem.dataset.url) { 1033 // New title. 1034 document.title = elem.dataset.title; 1035 // New link. 1036 history.pushState(null, elem.dataset.title, elem.dataset.url); 1037 1038 // Update Floating Header with the new title. 1039 updateFloatingHeader(elem.dataset.title); 1040 1041 // Google Analytics. 1042 if (typeof gtag === 'function' && _typeof(window.gaData) === 'object') { 1043 var trackingId = Object.keys(window.gaData)[0]; 1044 if (trackingId) { 1045 gtag('config', trackingId, { 1046 'page_title': elem.dataset.title, 1047 'page_location': elem.dataset.url 1048 }); 1049 gtag('event', 'page_view', { 1050 'send_to': trackingId 1051 }); 1052 } 1053 } 1054 } 1055 } 1056 }); 1057 }); 1058} 1059})(); 1060 1061// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules. 1062(() => { 1063var __webpack_exports__ = {}; 1064__webpack_require__.r(__webpack_exports__); 1065/** ---------------------------------------------------------------------------- 1066 * Metabar */ 1067 1068(function () { 1069 var ticking = false; 1070 var update = function update() { 1071 document.querySelectorAll('.cs-site-content .cs-content-area').forEach(function (mainContent) { 1072 var content = mainContent.querySelector('.entry-content'); 1073 if (!content) { 1074 return; 1075 } 1076 var sidebar = mainContent.querySelector('.post-sidebar-inner'); 1077 if (!sidebar) { 1078 return; 1079 } 1080 var offsetTop = 20; 1081 var offsetBottom = -20; 1082 var elements = ['.alignfull', '.alignwide']; 1083 var layouts = Array.from(content.querySelectorAll(elements.join(','))); 1084 if (!sidebar || layouts.length === 0) { 1085 return; 1086 } 1087 var disabled = false;
1088 var sidebarTop = sidebar.getBoundingClientRect().top + window.scrollY; 1089 var sidebarHeight = sidebar.offsetHeight; 1090 layouts.forEach(function (layout) { 1091 if (getComputedStyle(layout).transform === 'none') { 1092 return; 1093 } 1094 var layoutTop = layout.getBoundingClientRect().top + window.scrollY; 1095 var layoutHeight = layout.offsetHeight; 1096 var pointTop = layoutTop - offsetTop; 1097 var pointBottom = layoutTop + layoutHeight + offsetBottom; 1098 if (sidebarTop + sidebarHeight >= pointTop && sidebarTop <= pointBottom) { 1099 disabled = true; 1100 } 1101 }); 1102 sidebar.style.opacity = disabled ? '0' : '1'; 1103 }); 1104 ticking = false; 1105 }; 1106 var requestTick = function requestTick() { 1107 if (!ticking) { 1108 window.requestAnimationFrame(update); 1109 ticking = true; 1110 } 1111 }; 1112 var onProcess = function onProcess() { 1113 requestTick(); 1114 }; 1115 window.addEventListener('scroll', onProcess); 1116 window.addEventListener('resize', onProcess); 1117 window.addEventListener('load', onProcess); 1118})(); 1119})(); 1120 1121// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules. 1122(() => { 1123var __webpack_exports__ = {}; 1124__webpack_require__.r(__webpack_exports__); 1125function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } 1126function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 1127function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } 1128function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } 1129function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } 1130function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } 1131/** ---------------------------------------------------------------------------- 1132 * Navigation */ 1133var CscoNavigation = /*#__PURE__*/function () { 1134 function CscoNavigation() { 1135 _classCallCheck(this, CscoNavigation); 1136 this.headerParams = { 1137 headerLargeHeight: parseInt(getComputedStyle(document.documentElement).getPropertyValue('--cs-header-initial-height')), 1138 headerCompactHeight: parseInt(getComputedStyle(document.documentElement).getPropertyValue('--cs-header-height')), 1139 headerSmart: document.querySelector('.cs-navbar-smart-enabled .cs-header, .cs-navbar-sticky-enabled .cs-header'), 1140 wpAdminBar: document.querySelector('#wpadminbar'), 1141 headerBefore: document.querySelector('.cs-header-before'), 1142 headerStretch: document.querySelector('.cs-navbar-smart-enabled .cs-header-stretch'), 1143 wpAdminBarHeight: null, 1144 smartStart: null, 1145 scrollPoint: 200, 1146 scrollPrev: 200, 1147 scrollUpAmount: 0, 1148 headerSmartPosition: 0 1149 }; 1150 this.initialize(); 1151 } 1152 _createClass(CscoNavigation, [{ 1153 key: "initialize", 1154 value: function initialize() { 1155 if (document.body.classList.contains('wp-admin')) { 1156 return; 1157 } 1158 this.bindEvents(); 1159 } 1160 }, { 1161 key: "bindEvents", 1162 value: function bindEvents() { 1163 var _this = this; 1164 document.addEventListener('DOMContentLoaded', function () { 1165 _this.smartLevels(); 1166 _this.adaptTablet(); 1167 _this.stickyScroll(); 1168 _this.headerClassesChange(); 1169 }); 1170 window.addEventListener('resize', function () { 1171 _this.smartLevels(); 1172 _this.adaptTablet(); 1173 _this.stickyScroll(); 1174 }); 1175 } 1176 }, { 1177 key: "smartLevels", 1178 value: function smartLevels() { 1179 var windowWidth = window.innerWidth; 1180 1181 // Reset Calc. 1182 document.querySelectorAll('.cs-header__nav-inner li').forEach(function (el) { 1183 el.classList.remove('cs-sm__level', 'cs-sm-position-left', 'cs-sm-position-right'); 1184 }); 1185 document.querySelectorAll('.cs-header__nav-inner li .sub-menu').forEach(function (el) { 1186 el.classList.remove('cs-mm__position-init'); 1187 }); 1188 1189 // Set Settings. 1190 document.querySelectorAll('.cs-header__nav-inner > li.menu-item:not(.cs-mm)').forEach(function (parent) { 1191 var position = 'cs-sm-position-right'; //default 1192 var objPrevWidth = 0; 1193 parent.querySelectorAll('.sub-menu').forEach(function (el) { 1194 // Reset child levels. 1195 if (el.parentElement.nextElementSibling) { 1196 el.parentElement.nextElementSibling.classList.add('cs-sm__level'); 1197 } 1198 if (el.parentElement.classList.contains('cs-sm__level')) { 1199 el.parentElement.classList.remove('cs-mm-level'); 1200 position = 'cs-sm-position-right'; //reset 1201 objPrevWidth = 0; 1202 } 1203 1204 // Find out position items. 1205 var offset = el.getBoundingClientRect().left; 1206 if (position === 'cs-sm-position-right' && el.offsetWidth + offset > windowWidth) { 1207 position = 'cs-sm-position-left'; 1208 } 1209 if (position === 'cs-sm-position-left' && offset - (el.offsetWidth + objPrevWidth) < 0) { 1210 position = 'cs-sm-position-right'; 1211 } 1212 objPrevWidth = el.offsetWidth; 1213 el.classList.add('cs-sm-position-init'); 1214 el.parentElement.classList.add(position); 1215 }); 1216 }); 1217 } 1218 }, { 1219 key: "adaptTablet", 1220 value: function adaptTablet() { 1221 // Click outside. 1222 document.addEventListener('touchstart', function (e) { 1223 if (!e.target.closest('.cs-header__nav-inner')) { 1224 document.querySelectorAll('.cs-header__nav-inner .menu-item-has-children').forEach(function (el) { 1225 el.classList.remove('submenu-visible'); 1226 }); 1227 } else { 1228 var parentMenuItem = e.target.closest('.menu-item'); 1229 if (parentMenuItem) { 1230 if (parentMenuItem.previousElementSibling) { 1231 parentMenuItem.previousElementSibling.querySelectorAll('.menu-item').forEach(function (el) { 1232 el.classList.remove('submenu-visible'); 1233 }); 1234 } 1235 if (parentMenuItem.nextElementSibling) { 1236 parentMenuItem.nextElementSibling.classList.remove('submenu-visible'); 1237 } 1238 } 1239 } 1240 }); 1241 document.querySelectorAll('.cs-header__nav-inner .menu-item-has-children').forEach(function (el) { 1242 // Reset class. 1243 el.classList.remove('submenu-visible'); 1244 1245 // Remove expanded if exists. 1246 var expandedElem = el.querySelector('a > .expanded'); 1247 if (expandedElem) { 1248 expandedElem.remove(); 1249 } 1250 1251 // Add a caret. 1252 if ('ontouchstart' in document.documentElement) { 1253 var aTag = el.querySelector('a'); 1254 if (aTag) { 1255 var span = document.createElement('span'); 1256 span.className = 'expanded'; 1257 aTag.appendChild(span); 1258 } 1259 } 1260 1261 // Check touch device. 1262 if ('ontouchstart' in document.documentElement) { 1263 el.classList.add('touch-device'); 1264 } 1265 var expandedElement = el.querySelector('a .expanded'); 1266 if (expandedElement) { 1267 expandedElement.addEventListener('touchstart', function (e) { 1268 e.preventDefault(); 1269 el.classList.toggle('submenu-visible'); 1270 }, { 1271 passive: true 1272 }); 1273 } 1274 var anchor = el.querySelector('a'); 1275 if (anchor && anchor.getAttribute('href') === '#') { 1276 anchor.addEventListener('touchstart', function (e) { 1277 e.preventDefault(); 1278 if (!e.target.classList.contains('expanded')) { 1279 el.classList.toggle('submenu-visible'); 1280 } 1281 }, { 1282 passive: true 1283 }); 1284 } 1285 }); 1286 } 1287 }, { 1288 key: "stickyScroll", 1289 value: function stickyScroll() { 1290 var _this2 = this; 1291 this.headerParams = { 1292 headerLargeHeight: parseInt(getComputedStyle(document.documentElement).getPropertyValue('--cs-header-initial-height')), 1293 headerCompactHeight: parseInt(getComputedStyle(document.documentElement).getPropertyValue('--cs-header-height')), 1294 headerSmart: document.querySelector('.cs-navbar-smart-enabled .cs-header, .cs-navbar-sticky-enabled .cs-header'), 1295 wpAdminBar: document.querySelector('#wpadminbar'), 1296 headerBefore: document.querySelector('.cs-header-before'), 1297 headerStretch: document.querySelector('.cs-navbar-smart-enabled .cs-header-stretch'), 1298 wpAdminBarHeight: null, 1299 smartStart: null, 1300 scrollPoint: 200, 1301 scrollPrev: 200, 1302 scrollUpAmount: 0, 1303 headerSmartPosition: 0 1304 }; 1305 this.headerParams.wpAdminBarHeight = this.headerParams.wpAdminBar ? this.headerParams.wpAdminBar.offsetHeight : 0; 1306 if (this.headerParams.headerBefore) { 1307 this.headerParams.smartStart = this.headerParams.headerBefore.offsetTop; 1308 } else { 1309 this.headerParams.smartStart = this.headerParams.wpAdminBarHeight + (this.headerParams.headerSmart ? this.headerParams.headerSmart.offsetTop : 0); 1310 } 1311 window.addEventListener('scroll', function () { 1312 var scrolled = window.scrollY; 1313 _this2.headerParams.headerSmartPosition = _this2.headerParams.headerSmart ? _this2.headerParams.headerSmart.offsetTop : 0; 1314 if (scrolled > _this2.headerParams.smartStart + _this2.headerParams.scrollPoint + 10 && scrolled > _this2.headerParams.scrollPrev) { 1315 if (scrolled > _this2.headerParams.smartStart + _this2.headerParams.headerCompactHeight + 200) { 1316 document.dispatchEvent(new Event('sticky-nav-hide')); 1317 } 1318 } else { 1319 if (_this2.headerParams.scrollUpAmount >= _this2.headerParams.scrollPoint || scrolled === 0) { 1320 document.dispatchEvent(new Event('sticky-nav-visible')); 1321 } 1322 } 1323 if (_this2.headerParams.headerSmart) { 1324 if (scrolled > _this2.headerParams.smartStart + _this2.headerParams.headerCompactHeight) { 1325 document.dispatchEvent(new Event('nav-stick', { 1326 detail: _this2.headerParams 1327 })); 1328 } else if (_this2.headerParams.headerSmartPosition <= _this2.headerParams.smartStart) { 1329 document.dispatchEvent(new Event('nav-unstick', { 1330 detail: _this2.headerParams 1331 })); 1332 } 1333 } 1334 if (scrolled < _this2.headerParams.scrollPrev) { 1335 _this2.headerParams.scrollUpAmount += _this2.headerParams.scrollPrev - scrolled; 1336 } else { 1337 _this2.headerParams.scrollUpAmount = 0; 1338 } 1339 if (_this2.headerParams.wpAdminBar && window.innerWidth <= 600 && scrolled >= _this2.headerParams.wpAdminBarHeight) { 1340 document.dispatchEvent(new Event('adminbar-mobile-scrolled')); 1341 } else { 1342 document.dispatchEvent(new Event('adminbar-mobile-no-scrolled')); 1343 } 1344 _this2.headerParams.scrollPrev = scrolled; 1345 }); 1346 } 1347 }, { 1348 key: "headerClassesChange", 1349 value: function headerClassesChange() { 1350 var _this3 = this; 1351 document.addEventListener("sticky-nav-visible", function (event) { 1352 _this3.headerParams.headerSmart.classList.add('cs-header-smart-visible'); 1353 }); 1354 document.addEventListener("sticky-nav-hide", function (event) { 1355 _this3.headerParams.headerSmart.classList.remove('cs-header-smart-visible'); 1356 }); 1357 document.addEventListener("nav-stick", function (event) { 1358 _this3.headerParams.headerSmart.classList.add('cs-scroll-sticky'); 1359 }); 1360 document.addEventListener("nav-unstick", function (event) { 1361 _this3.headerParams.headerSmart.classList.remove('cs-scroll-sticky', 'cs-header-smart-visible'); 1362 }); 1363 document.addEventListener("adminbar-mobile-scrolled", function (event) { 1364 document.body.classList.add('cs-adminbar-mobile-scrolled'); 1365 }); 1366 document.addEventListener("adminbar-mobile-no-scrolled", function (event) { 1367 document.body.classList.remove('cs-adminbar-mobile-scrolled'); 1368 }); 1369 } 1370 }]); 1371 return CscoNavigation; 1372}();
1373new CscoNavigation(); 1374})(); 1375 1376// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules. 1377(() => { 1378var __webpack_exports__ = {}; 1379__webpack_require__.r(__webpack_exports__); 1380/** ---------------------------------------------------------------------------- 1381 * Offcanvas */ 1382 1383(function () { 1384 var toggles = document.querySelectorAll('.cs-header__offcanvas-toggle, .cs-site-overlay, .cs-offcanvas__toggle'); 1385 toggles.forEach(function (toggle) { 1386 toggle.addEventListener('click', function (e) { 1387 e.preventDefault(); 1388 var body = document.body; 1389 if (!body.classList.contains('cs-offcanvas-active')) { 1390 body.classList.add('cs-offcanvas-transition'); 1391 } else { 1392 setTimeout(function () { 1393 body.classList.remove('cs-offcanvas-transition'); 1394 }, 400); 1395 } 1396 body.classList.toggle('cs-offcanvas-active'); 1397 }); 1398 }); 1399})(); 1400})(); 1401 1402// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules. 1403(() => { 1404var __webpack_exports__ = {}; 1405__webpack_require__.r(__webpack_exports__); 1406/** ---------------------------------------------------------------------------- 1407 * Reading Time Progress */ 1408 1409(function () { 1410 var initReadingTimeProgress = function initReadingTimeProgress(postElement) { 1411 var section = 'cs-post-reading-time'; 1412 var readingTimeProgress = postElement.querySelector(".".concat(section)); 1413 var content = postElement.querySelector('.entry-content'); 1414 if (readingTimeProgress && content) { 1415 var progressPath = readingTimeProgress.querySelector(".".concat(section, "__progress path")); 1416 var pathLength = progressPath.getTotalLength(); 1417 progressPath.style.transition = progressPath.style.WebkitTransition = 'none'; 1418 progressPath.style.strokeDasharray = "".concat(pathLength, " ").concat(pathLength); 1419 progressPath.style.strokeDashoffset = pathLength; 1420 progressPath.getBoundingClientRect(); 1421 progressPath.style.transition = progressPath.style.WebkitTransition = 'stroke-dashoffset 10ms linear'; 1422 var updateProgress = function updateProgress() { 1423 var scroll = window.scrollY || window.scrollTop || document.documentElement.scrollTop; 1424 var contentHeight = content.offsetHeight; 1425 var contentOffsetTop = content.getBoundingClientRect().top + window.scrollY; 1426 var windowHeight = window.innerHeight; 1427 1428 // Calculate the total scrollable height for the content of the post 1429 var scrollableHeight = contentHeight - windowHeight; 1430 1431 // Check if the post is currently being viewed 1432 if (scrollableHeight > 0) { 1433 // Determine how much we've scrolled within the bounds of this post 1434 var relativeScroll = Math.max(0, Math.min(scroll - contentOffsetTop, scrollableHeight)); 1435 1436 // Calculate the progress 1437 var progress = pathLength - relativeScroll * pathLength / scrollableHeight; 1438 1439 // Update the strokeDashoffset 1440 progressPath.style.strokeDashoffset = Math.max(progress, 0); 1441 } else { 1442 // Reset progress if the content is not scrollable 1443 progressPath.style.strokeDashoffset = pathLength; 1444 } 1445 }; 1446 1447 // Immediately call updateProgress to handle visible content 1448 updateProgress(); 1449 window.addEventListener('scroll', updateProgress); 1450 window.addEventListener('resize', updateProgress); 1451 } 1452 }; 1453 document.addEventListener('DOMContentLoaded', function () { 1454 var firstPost = document.querySelector('.cs-content-area'); // Change the selector based on your post structure 1455 if (firstPost) { 1456 initReadingTimeProgress(firstPost); 1457 } 1458 }); 1459 var observePosts = function observePosts() { 1460 var posts = document.querySelectorAll('.cs-nextpost-section'); 1461 var observer = new IntersectionObserver(function (entries, observer) { 1462 entries.forEach(function (entry) { 1463 if (entry.isIntersecting) { 1464 initReadingTimeProgress(entry.target); 1465 observer.unobserve(entry.target); 1466 } 1467 }); 1468 }, { 1469 root: null, 1470 threshold: 0.1 1471 });
1472 posts.forEach(function (post) { 1473 observer.observe(post); 1474 }); 1475 }; 1476 document.addEventListener('DOMContentLoaded', observePosts); 1477 document.body.addEventListener('post-load', function (e) { 1478 observePosts(); 1479 }); 1480})(); 1481})(); 1482 1483// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules. 1484(() => { 1485var __webpack_exports__ = {}; 1486__webpack_require__.r(__webpack_exports__); 1487/** ---------------------------------------------------------------------------- 1488 * Responsive Embeds */ 1489 1490(function () { 1491 /** 1492 * Add max-width & max-height to <iframe> elements, depending on their width & height props. 1493 */ 1494 function initResponsiveEmbeds() { 1495 var proportion, parentWidth; 1496 var iframes = document.querySelectorAll('.entry-content iframe'); 1497 1498 // Loop through iframe elements. 1499 iframes.forEach(function (iframe) { 1500 // Don't handle if the parent automatically resizes itself. 1501 if (iframe.closest('div[data-video-start], div[data-video-end]')) { 1502 return; 1503 } 1504 // Only continue if the iframe has a width & height defined. 1505 if (iframe.width && iframe.height) { 1506 // Calculate the proportion/ratio based on the width & height. 1507 proportion = parseFloat(iframe.width) / parseFloat(iframe.height); 1508 // Get the parent element's width. 1509 parentWidth = parseFloat(window.getComputedStyle(iframe.parentElement).width); 1510 // Set the max-width & height. 1511 iframe.style.maxWidth = '100%'; 1512 iframe.style.maxHeight = Math.round(parentWidth / proportion) + 'px'; 1513 } 1514 }); 1515 } 1516 1517 // Document ready. 1518 document.addEventListener('DOMContentLoaded', function () { 1519 initResponsiveEmbeds(); 1520 }); 1521 1522 // Post load. This assumes you have an event "post-load" being dispatched on the body element. 1523 document.body.addEventListener('post-load', function () { 1524 initResponsiveEmbeds(); 1525 }); 1526 1527 // Window resize. 1528 window.addEventListener('resize', function () { 1529 initResponsiveEmbeds(); 1530 }); 1531 1532 // Run on initial load. 1533 initResponsiveEmbeds(); 1534})(); 1535})(); 1536 1537// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules. 1538(() => { 1539var __webpack_exports__ = {}; 1540__webpack_require__.r(__webpack_exports__); 1541/* harmony import */ var _utility_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); 1542/** ---------------------------------------------------------------------------- 1543 * Color Scheme Toogle */ 1544 1545 1546var cscoDarkMode = { 1547 init: function init() { 1548 var _this = this; 1549 this.initMode(); 1550 window.matchMedia('(prefers-color-scheme: dark)').addListener(function (e) { 1551 _this.initMode(); 1552 }); 1553 document.querySelectorAll('.cs-site-scheme-toggle').forEach(function (toggle) { 1554 toggle.onclick = function () { 1555 var siteScheme = document.body.getAttribute('data-scheme'); 1556 if ('dark' === siteScheme) { 1557 _this.changeScheme('light', true); 1558 } else if ('light' === siteScheme) { 1559 _this.changeScheme('dark', true); 1560 } else if ('auto' === siteScheme) { 1561 var systemDark = window.matchMedia('(prefers-color-scheme: dark)').matches; 1562 if (systemDark) { 1563 _this.changeScheme('light', true); 1564 } else { 1565 _this.changeScheme('dark', true); 1566 } 1567 } 1568 }; 1569 }); 1570 }, 1571 detectColorScheme: function detectColorScheme(color) { 1572 var level = 190; 1573 var alpha = 1; 1574 var rgba = [255, 255, 255]; 1575 var color_rgba = false; 1576 color = color.trim(); 1577 1578 // Excludes. 1579 if (['#0e131a'].includes(color)) { 1580 return 'dark'; 1581 } 1582 if ('#' === color[0]) { 1583 color = color.replace('#', '').trim(); 1584 if (3 === color.length) { 1585 color = color[0] + color[0] + color[1] + color[1] + color[2] + color[2]; 1586 } 1587 rgba[0] = parseInt(color.substr(0, 2), 16); 1588 rgba[1] = parseInt(color.substr(2, 2), 16); 1589 rgba[2] = parseInt(color.substr(4, 2), 16); 1590 } else if (color_rgba = color.replace(/\s/g, '').match(/^rgba?\((\d+),(\d+),(\d+),?([^,\s)]+)?/i)) { 1591 rgba[0] = parseInt(color_rgba[1]); 1592 rgba[1] = parseInt(color_rgba[2]); 1593 rgba[2] = parseInt(color_rgba[3]); 1594 if (color_rgba[4] !== undefined) { 1595 alpha = parseFloat(color_rgba[4]); 1596 } 1597 }
1598 rgba.forEach(function myFunction(channel, key, stack) { 1599 stack[key] = String(channel + Math.ceil((255 - channel) * (1 - alpha))).padStart(2, '0'); 1600 }); 1601 var scheme = 'light'; 1602 var brightness = (rgba[0] * 299 + rgba[1] * 587 + rgba[2] * 114) / 1000; 1603 if (rgba[0] === rgba[1] && rgba[1] === rgba[2]) { 1604 if (brightness < level) { 1605 scheme = 'dark'; 1606 } 1607 } else { 1608 if (brightness < level) { 1609 scheme = 'inverse'; 1610 } 1611 } 1612 return scheme; 1613 }, 1614 setIndividualScheme: function setIndividualScheme() { 1615 var list = { 1616 '.cs-header': '--cs-header-background', 1617 '.cs-header__nav-inner .sub-menu': '--cs-header-submenu-background' 1618 }; 1619 function createClosure(key) { 1620 return function (element) { 1621 var color = getComputedStyle(element).getPropertyValue(list[key]); 1622 var scheme = cscoDarkMode.detectColorScheme(color); 1623 element.setAttribute('data-scheme', scheme); 1624 }; 1625 } 1626 for (var key in list) { 1627 if (list.hasOwnProperty(key)) { 1628 var elements = document.querySelectorAll(key); 1629 if (elements.length <= 0) { 1630 continue; 1631 } 1632 elements.forEach(createClosure(key)); 1633 } 1634 } 1635 }, 1636 initMode: function initMode() { 1637 var siteScheme = false; 1638 switch (csLocalize.siteSchemeMode) { 1639 case 'dark': 1640 siteScheme = 'dark'; 1641 break; 1642 case 'light': 1643 siteScheme = 'light'; 1644 break; 1645 case 'system': 1646 siteScheme = 'auto'; 1647 break; 1648 } 1649 if (csLocalize.siteSchemeToogle) { 1650 if ('light' === (0,_utility_js__WEBPACK_IMPORTED_MODULE_0__.csGetCookie)('_color_schema')) { 1651 siteScheme = 'light'; 1652 } 1653 if ('dark' === (0,_utility_js__WEBPACK_IMPORTED_MODULE_0__.csGetCookie)('_color_schema')) { 1654 siteScheme = 'dark'; 1655 } 1656 } 1657 this.setIndividualScheme(); 1658 if (siteScheme && siteScheme !== document.body.getAttribute('data-scheme')) { 1659 this.changeScheme(siteScheme, false); 1660 } 1661 }, 1662 changeScheme: function changeScheme(siteScheme, cookie) { 1663 document.body.classList.add('cs-scheme-toggled'); 1664 document.body.setAttribute('data-scheme', siteScheme); 1665 this.setIndividualScheme(); 1666 if (cookie) { 1667 (0,_utility_js__WEBPACK_IMPORTED_MODULE_0__.csSetCookie)('_color_schema', siteScheme, { 1668 expires: 2592000 1669 }); 1670 } 1671 setTimeout(function () { 1672 document.body.classList.remove('cs-scheme-toggled'); 1673 }, 100); 1674 } 1675}; 1676cscoDarkMode.init(); 1677})(); 1678 1679// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules. 1680(() => { 1681var __webpack_exports__ = {}; 1682__webpack_require__.r(__webpack_exports__); 1683/** ---------------------------------------------------------------------------- 1684 * Scroll to top */ 1685 1686(function () { 1687 var section = 'cs-scroll-top'; 1688 var scrollToTopButton = document.querySelector(".".concat(section)); 1689 if (scrollToTopButton) { 1690 var activeClass = 'is-active'; 1691 var offset = 200; 1692 var scrollToTop = function scrollToTop() { 1693 window.scrollTo({ 1694 top: 0, 1695 behavior: 'smooth' 1696 }); 1697 }; 1698 var progressPath = scrollToTopButton.querySelector(".".concat(section, "-progress path")); 1699 var pathLength = progressPath.getTotalLength(); 1700 progressPath.style.transition = progressPath.style.WebkitTransition = 'none'; 1701 progressPath.style.strokeDasharray = "".concat(pathLength, " ").concat(pathLength); 1702 progressPath.style.strokeDashoffset = pathLength; 1703 progressPath.getBoundingClientRect(); 1704 progressPath.style.transition = progressPath.style.WebkitTransition = 'stroke-dashoffset 10ms linear'; 1705 var updateProgress = function updateProgress() { 1706 var scroll = window.scrollY || window.scrollTop || document.documentElement.scrollTop; 1707 var docHeight = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.offsetHeight, document.body.clientHeight, document.documentElement.clientHeight); 1708 var windowHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0
1708); 1709 var height = docHeight - windowHeight; 1710 var progress = pathLength - scroll * pathLength / height; 1711 progressPath.style.strokeDashoffset = progress; 1712 }; 1713 updateProgress(); 1714 if (scrollToTopButton) { 1715 scrollToTopButton.addEventListener('click', scrollToTop); 1716 } 1717 window.addEventListener('scroll', function () { 1718 updateProgress(); 1719 var scrollPos = window.scrollY || window.scrollTop || document.getElementsByTagName('html')[0].scrollTop; 1720 if (scrollPos > offset) { 1721 scrollToTopButton.classList.add(activeClass); 1722 } else { 1723 scrollToTopButton.classList.remove(activeClass); 1724 } 1725 }); 1726 } 1727})(); 1728})(); 1729 1730// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules. 1731(() => { 1732var __webpack_exports__ = {}; 1733__webpack_require__.r(__webpack_exports__); 1734/** ---------------------------------------------------------------------------- 1735 * Search Dropdown */ 1736 1737(function () { 1738 var toggles = document.querySelectorAll('.cs-header__search-toggle, .cs-search-overlay, .cs-search__close'); 1739 toggles.forEach(function (toggle) { 1740 toggle.addEventListener('click', function (e) { 1741 e.preventDefault(); 1742 var body = document.body; 1743 var headerElement = document.querySelector('.cs-header'); 1744 if (!body.classList.contains('cs-search-active')) { 1745 body.classList.add('cs-search-transition'); 1746 } else { 1747 setTimeout(function () { 1748 body.classList.remove('cs-search-transition'); 1749 }, 400); 1750 } 1751 body.classList.toggle('cs-search-active'); 1752 headerElement.classList.toggle('cs-search-visible'); 1753 }); 1754 }); 1755})(); 1756})(); 1757 1758// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules. 1759(() => { 1760var __webpack_exports__ = {}; 1761__webpack_require__.r(__webpack_exports__); 1762/* harmony import */ var _utility_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); 1763/** ---------------------------------------------------------------------------- 1764 * Metabar Share copy link */ 1765 1766 1767(function () { 1768 function copyToClipboard(str) { 1769 var area = document.createElement('textarea'); 1770 document.body.appendChild(area); 1771 area.value = str; 1772 area.select(); 1773 document.execCommand('copy'); 1774 document.body.removeChild(area); 1775 } 1776 function showTooltip(button, message) { 1777 var tooltip = document.createElement('div'); 1778 tooltip.className = 'cs-share__copy-link-tooltip'; 1779 tooltip.textContent = message; 1780 button.appendChild(tooltip); 1781 setTimeout(function () { 1782 tooltip.classList.add('hide'); 1783 }, 1500); 1784 setTimeout(function () { 1785 button.removeChild(tooltip); 1786 }, 2000); 1787 } 1788 var copyButtons = document.querySelectorAll('.cs-share__copy-link'); 1789 copyButtons.forEach(function (button) { 1790 button.addEventListener('click', function (event) { 1791 event.preventDefault(); 1792 var pageURL = this.getAttribute('href'); 1793 copyToClipboard(pageURL); 1794 showTooltip(this, 'URL copied'); 1795 }); 1796 }); 1797})(); 1798})(); 1799 1800// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules. 1801(() => { 1802var __webpack_exports__ = {}; 1803__webpack_require__.r(__webpack_exports__); 1804/** ---------------------------------------------------------------------------- 1805 * Sticky Sidebar */ 1806 1807(function () { 1808 var stickyElementsSmart = [], 1809 stickyElements = []; 1810 stickyElementsSmart.push('.cs-navbar-smart-enabled.cs-stick-to-top .cs-single-product .entry-summary', '.cs-sticky-sidebar-enabled.cs-navbar-smart-enabled.cs-stick-to-top .cs-sidebar__inner', '.cs-sticky-sidebar-enabled.cs-navbar-smart-enabled.cs-stick-last .cs-sidebar__inner .widget:last-child'); 1811 stickyElements.push('.cs-navbar-sticky-enabled.cs-stick-to-top .cs-single-product .entry-summary', '.cs-sticky-sidebar-enabled.cs-navbar-sticky-enabled.cs-stick-to-top .cs-sidebar__inner', '.cs-sticky-sidebar-enabled.cs-navbar-sticky-enabled.cs-stick-last .cs-sidebar__inner .widget:last-child'); 1812 document.addEventListener("DOMContentLoaded", function () { 1813 var headerStick = document.querySelector('.cs-header'), 1814 wpAdminBar = document.querySelector('#wpadminbar'), 1815 headerStickHeight = headerStick ? headerStick.offsetHeight : 0, 1816 wpAdminBarHeight = wpAdminBar ? wpAdminBar.offsetHeight : 0, 1817 headerStretch = document.querySelector('.cs-header-stretch'), 1818 headerStretchHeight = headerStretch ? headerStretch.offsetHeight : 0, 1819 allHeight = headerStickHeight + wpAdminBarHeight + 20, 1820 windowWidth = window.innerWidth; 1821 if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) { 1822 stickyElementsSmart.push('.cs-sticky-sidebar-enabled.cs-stick-to-bottom .cs-sidebar__inner'); 1823 stickyElements.push('.cs-sticky-sidebar-enabled.cs-stick-to-bottom .cs-sidebar__inner'); 1824 } 1825 stickyElementsSmart = stickyElementsSmart.join(','); 1826 stickyElements = stickyElements.join(','); 1827 document.addEventListener('sticky-nav-visible', function () { 1828 headerStickHeight = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--cs-header-height'));
1829 allHeight = (headerStretchHeight || 0) + (wpAdminBarHeight || 0) + 20; 1830 document.querySelectorAll(stickyElementsSmart).forEach(function (el) { 1831 el.style.top = allHeight + 'px'; 1832 }); 1833 }); 1834 document.addEventListener('sticky-nav-hide', function () { 1835 headerStickHeight = 0; 1836 allHeight = (headerStickHeight || 0) + (wpAdminBarHeight || 0) + 20; 1837 document.querySelectorAll(stickyElementsSmart).forEach(function (el) { 1838 el.style.top = allHeight + 'px'; 1839 }); 1840 }); 1841 document.addEventListener('stretch-nav-to-small', function () { 1842 headerStretchHeight = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--cs-header-height')); 1843 allHeight = (headerStretchHeight || 0) + (wpAdminBarHeight || 0) + 20; 1844 if (headerStretch && headerStretch.classList.contains("cs-scroll-sticky") && !headerStretch.classList.contains("cs-scroll-active")) { 1845 document.querySelectorAll(stickyElementsSmart).forEach(function (el) { 1846 el.style.top = allHeight + 'px'; 1847 }); 1848 } 1849 }); 1850 document.addEventListener('stretch-nav-to-big', function () { 1851 headerStretchHeight = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--cs-header-initial-height')); 1852 }); 1853 if (document.body.classList.contains('cs-navbar-smart-enabled') && windowWidth >= 1020) { 1854 allHeight = (headerStretchHeight || 0) + (wpAdminBarHeight || 0) + 20; 1855 document.querySelectorAll(stickyElementsSmart).forEach(function (el) { 1856 el.style.top = allHeight + 'px'; 1857 }); 1858 } else if (document.body.classList.contains('cs-navbar-sticky-enabled') && windowWidth >= 1020) { 1859 allHeight = (headerStretchHeight || 0) + (wpAdminBarHeight || 0) + 20; 1860 document.querySelectorAll(stickyElements).forEach(function (el) { 1861 el.style.top = allHeight + 'px'; 1862 }); 1863 } 1864 window.addEventListener('resize', function () { 1865 var windowWidthResize = window.innerWidth; 1866 if (windowWidthResize < 1020) { 1867 document.querySelectorAll(stickyElements).forEach(function (el) { 1868 el.removeAttribute('style'); 1869 }); 1870 document.querySelectorAll(stickyElementsSmart).forEach(function (el) { 1871 el.removeAttribute('style'); 1872 }); 1873 } 1874 }); 1875 }); 1876})(); 1877})(); 1878 1879// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules. 1880(() => { 1881__webpack_require__.r(__webpack_exports__); 1882/* harmony import */ var _utility_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); 1883/** ---------------------------------------------------------------------------- 1884 * Widget Nav Menu */ 1885 1886 1887(function () { 1888 HTMLElement.prototype.responsiveNav = function () { 1889 this.classList.remove('menu-item-expanded'); 1890 var previousElement = this.previousElementSibling; 1891 if (previousElement && previousElement.classList.contains('submenu-visible')) { 1892 previousElement.classList.remove('submenu-visible'); 1893 (0,_utility_js__WEBPACK_IMPORTED_MODULE_0__.slideUp)(previousElement); 1894 this.parentElement.classList.remove('menu-item-expanded'); 1895 } else { 1896 var parentOfParent = this.parentElement.parentElement; 1897 parentOfParent.querySelectorAll('.menu-item .sub-menu').forEach(function (subMenu) { 1898 subMenu.classList.remove('submenu-visible'); 1899 (0,_utility_js__WEBPACK_IMPORTED_MODULE_0__.slideUp)(subMenu); 1900 }); 1901 parentOfParent.querySelectorAll('.menu-item-expanded').forEach(function (item) { 1902 item.classList.remove('menu-item-expanded'); 1903 }); 1904 if (previousElement) { 1905 previousElement.classList.toggle('submenu-visible'); 1906 (0,_utility_js__WEBPACK_IMPORTED_MODULE_0__.slideToggle)(previousElement); 1907 } 1908 this.parentElement.classList.toggle('menu-item-expanded'); 1909 } 1910 }; 1911 document.addEventListener('DOMContentLoaded', function () { 1912 var menuItems = document.querySelectorAll('.widget_nav_menu .menu-item-has-children'); 1913 menuItems.forEach(function (menuItem) { 1914 var span = document.createElement('span'); 1915 menuItem.appendChild(span); 1916 span.addEventListener('click', function (e) { 1917 e.preventDefault(); 1918 this.responsiveNav(); 1919 }); 1920 var anchor = menuItem.children[0]; 1921 if (anchor && anchor.tagName === 'A' && anchor.getAttribute('href') === '#') { 1922 anchor.addEventListener('click', function (e) { 1923 e.preventDefault(); 1924 this.nextElementSibling.nextElementSibling.responsiveNav(); 1925 }); 1926 } 1927 }); 1928 }); 1929})(); 1930})(); 1931 1932/******/ })() 1933;
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.