(function ($) {
  "use strict";

  /* =====================================================================
   * ANIMATION PRESETS
   * ===================================================================== */
  var PRESETS = {
    fadeIn:       { opacity: 0 },
    fadeInUp:     { opacity: 0, y: 60 },
    fadeInDown:   { opacity: 0, y: -60 },
    fadeInLeft:   { opacity: 0, x: -60 },
    fadeInRight:  { opacity: 0, x: 60 },
    zoomIn:       { opacity: 0, scale: 0.7 },
    zoomInUp:     { opacity: 0, scale: 0.7, y: 60 },
    slideInUp:    { opacity: 0, y: 80 },
    slideInLeft:  { opacity: 0, x: -80 },
    slideInRight: { opacity: 0, x: 80 },
    rotateIn:     { opacity: 0, rotation: -45, transformOrigin: "center center" },
    bounceIn:     { opacity: 0, scale: 0.3 },
    flipInX:      { opacity: 0, rotationX: 90, transformOrigin: "center center" },
    flipInY:      { opacity: 0, rotationY: 90, transformOrigin: "center center" }
  };

  var TO_BASE = {
    opacity: 1, x: 0, y: 0, scale: 1,
    rotation: 0, rotationX: 0, rotationY: 0, overwrite: "auto"
  };

  /*
   * Broad selector that covers:
   * — Elementor Heading widget       (.elementor-heading-title)
   * — Elementor Text Editor widget   (.elementor-widget-container > p/h*)
   * — Any theme/plugin heading or paragraph
   */
  var SPLIT_TARGETS = [
    ".elementor-heading-title",
    ".elementor-text-editor p",
    ".elementor-text-editor h1,.elementor-text-editor h2,.elementor-text-editor h3",
    ".elementor-text-editor h4,.elementor-text-editor h5,.elementor-text-editor h6",
    "h1","h2","h3","h4","h5","h6","p"
  ].join(",");

  /* =====================================================================
   * SMALL UTILITIES
   * ===================================================================== */
  function isEditor() {
    return typeof elementorFrontend !== "undefined" &&
      typeof elementorFrontend.isEditMode === "function" &&
      elementorFrontend.isEditMode();
  }

  function gs() { // shorthand for sitsGsapSettings
    return (typeof sitsGsapSettings !== "undefined") ? sitsGsapSettings : {};
  }

  function sizeVal(s, fb) { return (s && s.size !== undefined) ? s.size : fb; }

  function killTriggers(el) {
    if (typeof ScrollTrigger === "undefined") return;
    ScrollTrigger.getAll().forEach(function (st) {
      if (st.vars && (st.vars.sitsEl === el || st.vars.trigger === el)) st.kill();
    });
  }

  function resetEl(el) {
    if (typeof gsap !== "undefined") gsap.killTweensOf(el);
    killTriggers(el);
    delete el.dataset.gsapInitialized;   
    delete el.dataset.gsapSplitInitialized;
    el.style.opacity = el.style.transform = el.style.visibility = "";
    el.classList.remove("sits-gsap-hidden");
  }

  /* =====================================================================
   * EDITOR — READ LIVE SETTINGS
   * ===================================================================== */
  function getEditorSettings(id) {
    try {
      var p = window.parent && window.parent.elementor;
      if (!p) return null;
      var sid = String(id);

      if (typeof p.getContainer === "function") {
        var c = p.getContainer(sid);
        if (c && c.settings) return c.settings.attributes;
      }
      if (p.elements) {
        var hit = null;
        p.elements.each(function (m) {
          if (!hit && String(m.id) === sid) hit = m.get("settings").attributes;
        });
        if (hit) return hit;
      }
      if (p.elements && typeof p.elements.recursiveFind === "function") {
        var deep = p.elements.recursiveFind(function (m) { return String(m.id) === sid; });
        if (deep && deep.get) { var ds = deep.get("settings"); return ds ? ds.attributes : null; }
      }
    } catch (e) {}
    return null;
  }

  function injectEditorAttributes($scope) {
    var el = $scope[0];
    var id = $scope.data("id") || $scope.attr("data-id");
    if (!id) return;
    var s = getEditorSettings(id);
    if (!s) return;

    /* entrance */
    if (s.sits_gsap_enable === "yes") {
      el.setAttribute("data-gsap",              "true");
      el.setAttribute("data-gsap-animation",    s.sits_gsap_animation    || "fadeIn");
      el.setAttribute("data-gsap-duration",     sizeVal(s.sits_gsap_duration,     0.8));
      el.setAttribute("data-gsap-delay",        sizeVal(s.sits_gsap_delay,        0));
      el.setAttribute("data-gsap-ease",         s.sits_gsap_ease         || "power2.out");
      el.setAttribute("data-gsap-trigger",      s.sits_gsap_trigger      || "scroll");
      el.setAttribute("data-gsap-scroll-start", sizeVal(s.sits_gsap_scroll_start, 20));
    } else {
      ["data-gsap","data-gsap-animation","data-gsap-duration","data-gsap-delay",
       "data-gsap-ease","data-gsap-trigger","data-gsap-scroll-start"].forEach(function (a) { el.removeAttribute(a); });
      el.classList.remove("sits-gsap-hidden");
    }

    

    /* split */
    var globalOn = s.sits_gsap_split_global_enable === "yes";
    var customOn = s.sits_gsap_split_custom_enable  === "yes" && !globalOn;
    var mode = globalOn ? "global" : (customOn ? "custom" : "");
    if (mode === "global") {
      el.setAttribute("data-gsap-split-standalone", "global");
    } else if (mode === "custom") {
          el.setAttribute("data-gsap-split-standalone",   "yes");
         var rawSelAttr = (s.sits_gsap_split_standalone_selector || ".elementor-heading-title");
         var normSelAttr = rawSelAttr.split(",").map(function(s) { return s.trim(); }).filter(Boolean).join(",");
         el.setAttribute("data-gsap-split-selector", normSelAttr);
          el.setAttribute("data-gsap-split-type",         s.sits_gsap_split_standalone_type     || "chars");
          el.setAttribute("data-gsap-split-stagger",      sizeVal(s.sits_gsap_split_standalone_stagger,      0.008));
          el.setAttribute("data-gsap-split-line-stagger", sizeVal(s.sits_gsap_split_standalone_line_stagger, 0.08));
          el.setAttribute("data-gsap-split-animation",    s.sits_gsap_split_animation || "slideUp");
          el.setAttribute("data-gsap-split-trigger", s.sits_gsap_split_trigger || "scroll");
    } else {
      el.removeAttribute("data-gsap-split-standalone");
    }
  }

  /* =====================================================================
   * ENTRANCE ANIMATION
   * ===================================================================== */
  function animateElement(el) {
    if (typeof gsap === "undefined") { el.style.visibility = "visible"; return; }

    var dur   = parseFloat(el.dataset.gsapDuration)      || 0.8;
    var delay = parseFloat(el.dataset.gsapDelay)         || 0;
    var ease  = el.dataset.gsapEase                      || "power2.out";
    var trig  = el.dataset.gsapTrigger                   || "scroll";
    var pct   = parseInt(el.dataset.gsapScrollStart, 10) || 20;

    killTriggers(el);
    gsap.killTweensOf(el);
    gsap.set(el, Object.assign({}, PRESETS[el.dataset.gsapAnimation] || PRESETS.fadeIn));
    el.classList.remove("sits-gsap-hidden");
    el.style.visibility = "visible";

    var to = Object.assign({}, TO_BASE, { duration: dur, ease: ease });

    if (isEditor()) {
      gsap.to(el, Object.assign({}, to, { delay: 0.15 }));
    } else if (trig === "load" || typeof ScrollTrigger === "undefined") {
      gsap.to(el, Object.assign({}, to, { delay: delay }));
    } else {
      gsap.to(el, Object.assign({}, to, {
        delay: delay,
        scrollTrigger: { trigger: el, start: "top " + pct + "%", once: true, sitsEl: el }
      }));
    }
    el.dataset.gsapInitialized = "true";
  }

  function initGSAPAnimations(scope) {
    if (typeof gsap === "undefined") return;
    if (typeof ScrollTrigger !== "undefined") gsap.registerPlugin(ScrollTrigger);
    var els = scope
      ? scope.filter("[data-gsap='true']").add(scope.find("[data-gsap='true']")).toArray()
      : Array.from(document.querySelectorAll("[data-gsap='true']"));
    els.forEach(function (el) { if (el.dataset.gsapInitialized !== "true") animateElement(el); });
  }

 

  /* =====================================================================
   * SPLIT TEXT — helpers
   * ===================================================================== */

  /**
   * Build animation units (chars or words) inside a single source span,
   * keeping the span itself (and therefore its class / colour / typography)
   * as the outer wrapper. Returns an array of overflow:hidden line-wrapper
   * elements appended into `sourceSpan`.
   */
  function splitStyledSpan(sourceSpan, splitType) {
    var text = sourceSpan.textContent || "";
    if (!text.trim()) return [];

    /* Step 1 — wrap each word so we can measure line breaks */
    sourceSpan.innerHTML = text.split(/(\s+)/).map(function (chunk) {
      return chunk.trim()
        ? '<span class="sits-st-word" style="display:inline-block">' +
          $("<div>").text(chunk).html() + "</span>"
        : '<span style="display:inline-block">&nbsp;</span>';
    }).join("");

    /* Step 2 — group words into visual lines via getBoundingClientRect */
    var wordEls = Array.from(sourceSpan.querySelectorAll(".sits-st-word"));
    if (!wordEls.length) return [];

    var lines = [], curTop = null, curLine = [];
    wordEls.forEach(function (w) {
      var t = Math.round(w.getBoundingClientRect().top);
      if (curTop === null) curTop = t;
      if (Math.abs(t - curTop) > 5) { lines.push(curLine); curLine = []; curTop = t; }
      curLine.push(w);
    });
    if (curLine.length) lines.push(curLine);

    /* Step 3 — rebuild as overflow:hidden lines + animation units */
    var lineEls = lines.map(function (group) {
      var inner = document.createElement("span");
      inner.style.cssText = "display:inline-block";  // keeps text flow inside coloured span

      group.forEach(function (w, wi) {
        var wt = w.textContent;
        if (splitType === "words") {
          var ws = document.createElement("span");
          ws.className = "sits-st-unit";
          ws.style.cssText = "display:inline-block";
          ws.textContent = wt;
          inner.appendChild(ws);
        } else {
          var ww = document.createElement("span");
          ww.style.cssText = "display:inline-block";
          Array.from(wt).forEach(function (ch) {
            var cs = document.createElement("span");
            cs.className = "sits-st-unit";
            cs.style.cssText = "display:inline-block";
            cs.textContent = ch;
            ww.appendChild(cs);
          });
          inner.appendChild(ww);
        }
        if (wi < group.length - 1) {
          var sp = document.createElement("span");
          sp.style.cssText = "display:inline-block";
          sp.innerHTML = "&nbsp;";
          inner.appendChild(sp);
        }
      });

      var outer = document.createElement("span");
      outer.style.cssText = "display:inline-block;overflow:hidden";
      outer.appendChild(inner);
      return outer;
    });

    sourceSpan.innerHTML = "";
    lineEls.forEach(function (l) { sourceSpan.appendChild(l); });
    return lineEls;
  }

  /* =====================================================================
   * SPLIT TEXT — core worker
   * ===================================================================== */
  function doSplit(el, splitType, stagger, lineStagger, inEd, useGlobal) {
    var rawSel = el.dataset.gsapSplitSelector || SPLIT_TARGETS;
    var sel = rawSel.split(",").map(function(s) { return s.trim(); }).filter(Boolean).join(",");
    
    var targets = [];
    try {
      targets = Array.from(el.querySelectorAll(sel));
    } catch(e) {
      // invalid selector fallback
      sel = SPLIT_TARGETS;
      targets = Array.from(el.querySelectorAll(sel));
    }
    if (!targets.length) {
      try { if (el.matches && el.matches(sel)) targets = [el]; } catch(e) {}
    }
    if (!targets.length) {
      targets = Array.from(el.querySelectorAll("h1,h2,h3,h4,h5,h6,p"));
    }
    if (!targets.length) return;

    targets.forEach(function (target) {
      /* Restore original HTML on re-run (editor) */
      if (target._sitsOrig !== undefined) target.innerHTML = target._sitsOrig;

      if (!target.textContent.trim()) return;

      target._sitsOrig = target.innerHTML;
      target.style.visibility = "hidden";

      /* ----------------------------------------------------------------
       * DETECT styled child spans (e.g. .first-part / .second-part from
       * the Dual Color Heading widget).  When present we split INSIDE
       * each coloured span so their class / colour / typography is kept.
       * --------------------------------------------------------------- */
      var styledChildren = Array.from(target.children).filter(function (child) {
        return child.tagName === "SPAN" && child.className && child.className.trim();
      });

      var allLineEls = [];

      if (styledChildren.length) {
        /* --- per-span splitting: preserves colour classes ------------- */
        styledChildren.forEach(function (span) {
          var lineEls = splitStyledSpan(span, splitType);
          allLineEls = allLineEls.concat(lineEls);
        });
      } else {
        /* --- original whole-target splitting -------------------------- */
        var text = target.textContent || "";

        target.innerHTML = text.split(/(\s+)/).map(function (chunk) {
          return chunk.trim()
            ? '<span class="sits-st-word" style="display:inline-block">' +
              $("<div>").text(chunk).html() + "</span>"
            : '<span style="display:inline-block">&nbsp;</span>';
        }).join("");

        var wordEls = Array.from(target.querySelectorAll(".sits-st-word"));
        if (!wordEls.length) return;

        var lines = [], curTop = null, curLine = [];
        wordEls.forEach(function (w) {
          var t = Math.round(w.getBoundingClientRect().top);
          if (curTop === null) curTop = t;
          if (Math.abs(t - curTop) > 5) { lines.push(curLine); curLine = []; curTop = t; }
          curLine.push(w);
        });
        if (curLine.length) lines.push(curLine);

        var lineEls = lines.map(function (group) {
          var inner = document.createElement("span");
          inner.style.cssText = "display:block";

          group.forEach(function (w, wi) {
            var wt = w.textContent;
            if (splitType === "words") {
              var ws = document.createElement("span");
              ws.className = "sits-st-unit";
              ws.style.cssText = "display:inline-block";
              ws.textContent = wt;
              inner.appendChild(ws);
            } else {
              var ww = document.createElement("span");
              ww.style.cssText = "display:inline-block";
              Array.from(wt).forEach(function (ch) {
                var cs = document.createElement("span");
                cs.className = "sits-st-unit";
                cs.style.cssText = "display:inline-block";
                cs.textContent = ch;
                ww.appendChild(cs);
              });
              inner.appendChild(ww);
            }
            if (wi < group.length - 1) {
              var sp = document.createElement("span");
              sp.style.cssText = "display:inline-block";
              sp.innerHTML = "&nbsp;";
              inner.appendChild(sp);
            }
          });

          var outer = document.createElement("span");
          outer.style.cssText = "display:block;overflow:hidden";
          outer.appendChild(inner);
          return outer;
        });

        target.innerHTML = "";
        lineEls.forEach(function (l) { target.appendChild(l); });
        allLineEls = lineEls;
      }

      /* Step 4 — animate */
      if (!allLineEls.length) return;

      var SPLIT_PRESETS = {
          slideUp:   { yPercent: 120, opacity: 0, rotationX: -90, transformOrigin: "0% 100%",   ease: "power2.out",   duration: 0.8 },
          slideDown: { yPercent: -120,opacity: 0, rotationX:  90, transformOrigin: "0% 0%",     ease: "power2.out",   duration: 0.8 },
          fadeIn:    { opacity: 0,                                                               ease: "power1.out",   duration: 1.0 },
          rotateIn:  { opacity: 0, rotationX: -90, transformOrigin: "50% 100%",                 ease: "back.out(2)",  duration: 0.9 },
          scaleIn:   { opacity: 0, scale: 0,       transformOrigin: "center center",            ease: "elastic.out(1,0.4)", duration: 1.0 },
          blurIn:    { opacity: 0, filter: "blur(12px)", y: 10,                                 ease: "power2.out",   duration: 0.9 },
          flipIn:    { opacity: 0, rotationX: 90,  transformOrigin: "center center",            ease: "power3.out",   duration: 0.8 },
          waveIn:    { yPercent: 120, opacity: 0,  transformOrigin: "0% 100%",                  ease: "elastic.out(1,0.3)", duration: 1.0 },
        };
        
        // Resolve animation: element attr → global cfg → default
        var animKey = el.dataset.gsapSplitAnimation
            || (useGlobal && gs().globalSplitAnimation)
            || "slideUp";
        var fromProps = SPLIT_PRESETS[animKey] || SPLIT_PRESETS.slideUp;
        
        var extraStaggerOpts = {};
            if (animKey === "waveIn") {
                extraStaggerOpts = { each: stagger, from: "start", ease: "sine.inOut" };
            } else {
                extraStaggerOpts = { each: stagger, from: "start" };
            }

      var splitTrigger = el.dataset.gsapSplitTrigger || "scroll";

if (inEd || splitTrigger === "load") {
  target.style.visibility = "visible";
  var tl = gsap.timeline({ delay: inEd ? 0.1 : 0 });
  allLineEls.forEach(function (l, i) {
    var units = Array.from(l.querySelectorAll(".sits-st-unit"));
    if (units.length) tl.from(units, Object.assign({}, fromProps, { stagger: extraStaggerOpts }), i * lineStagger);
  });

} else if (splitTrigger === "hover") {
  target.style.visibility = "visible";
  // Reset units to from-state initially
  allLineEls.forEach(function (l) {
  var units = Array.from(l.querySelectorAll(".sits-st-unit"));
  if (units.length) gsap.set(units, { opacity: 1, yPercent: 0, y: 0, x: 0, scale: 1, rotationX: 0, filter: "none" }); // visible by default
});
  // Re-run on every mouseenter (not just once)
  el.addEventListener("mouseenter", function () {
    allLineEls.forEach(function (l, i) {
      var units = Array.from(l.querySelectorAll(".sits-st-unit"));
      if (units.length) {
        gsap.fromTo(units, fromProps, Object.assign({}, fromProps, {
          opacity: 1, yPercent: 0, y: 0, x: 0, scale: 1,
          rotationX: 0, filter: "none",
          stagger: extraStaggerOpts,
          duration: fromProps.duration || 0.8,
          ease: fromProps.ease || "power2.out",
          delay: i * lineStagger,
          overwrite: true,
        }));
      }
    });
  });

} else {
  // scroll (default)
  var scrollPct = parseInt(el.dataset.gsapSplitScrollStart, 10);
  if (isNaN(scrollPct)) scrollPct = useGlobal ? (parseInt(gs().globalSplitScrollStart, 10) || 100) : 100;
  var tl = gsap.timeline({
    scrollTrigger: { trigger: el, start: "top " + scrollPct + "%", toggleActions: "play none none none" },
    onStart: function () { target.style.visibility = "visible"; }
  });
  allLineEls.forEach(function (l, i) {
    var units = Array.from(l.querySelectorAll(".sits-st-unit"));
    if (units.length) tl.from(units, Object.assign({}, fromProps, { stagger: extraStaggerOpts }), i * lineStagger);
  });
}
    });
  }

  function initSplitTextAnimations(scope) {
    if (typeof gsap === "undefined" || typeof ScrollTrigger === "undefined") return;

    var cfg = gs();
    
    if (cfg.globalSplitEnable !== "yes") {
        // remove visibility:hidden set by PHP for global class targets
        var gc = cfg.globalSplitClass;
        if (gc) {
            Array.from(document.querySelectorAll(gc)).forEach(function(el) {
                el.style.visibility = "";
            });
        }
        // still allow widget-level custom splits to run (filter them below)
    }

    /* 1. Widget-level elements (custom or global mode) */
    var q = "[data-gsap-split-standalone='yes'],[data-gsap-split-standalone='global']";
    var elements = scope
      ? Array.from(scope[0].querySelectorAll(q)).concat(scope.filter(q).get())
      : Array.from(document.querySelectorAll(q));
      
    if (cfg.globalSplitEnable !== "yes") {
        elements = elements.filter(function(el) {
            return el.getAttribute("data-gsap-split-standalone") !== "global";
        });
    }  

    /* 2. Elements with the global CSS class applied manually */
    if (cfg.globalSplitEnable === "yes" && cfg.globalSplitClass) {
      var byClass = scope
        ? Array.from(scope[0].querySelectorAll(cfg.globalSplitClass)).concat(scope.filter(cfg.globalSplitClass).get())
        : Array.from(document.querySelectorAll(cfg.globalSplitClass));
      byClass = byClass.filter(function (el) { return !el.hasAttribute("data-gsap-split-standalone"); });
      elements = elements.concat(byClass);
    }

    /* Deduplicate */
    elements = elements.filter(function (el, i, arr) { return arr.indexOf(el) === i; });

    var inEd = isEditor();

    elements.forEach(function (el) {
      if (!inEd && el.dataset.gsapSplitInitialized === "true") return;
      el.dataset.gsapSplitInitialized = "true";

      var mode = el.getAttribute("data-gsap-split-standalone");
      var useGlobal = mode === "global" || (!mode && cfg.globalSplitEnable === "yes");

      var splitType, stagger, lineStagger;

      if (useGlobal) {
        splitType   = cfg.globalSplitType || "chars";
        stagger     = parseFloat(cfg.globalSplitStagger)     || 0.008;
        lineStagger = parseFloat(cfg.globalSplitLineStagger) || 0.08;
        el.removeAttribute("data-gsap-split-selector");
      } else {
        splitType   = el.dataset.gsapSplitType || "chars";
        stagger     = parseFloat(el.dataset.gsapSplitStagger)     || 0.008;
        lineStagger = parseFloat(el.dataset.gsapSplitLineStagger) || 0.08;
      }

      doSplit(el, splitType, stagger, lineStagger, inEd, useGlobal);
    });
  }

  /* =====================================================================
   * REINITIALIZE (editor live-preview on panel change)
   * ===================================================================== */
  function reinit($scope) {
    if (!$scope || !$scope.length) return;
    var el = $scope[0];
    resetEl(el);
    Array.from(el.querySelectorAll("[data-gsap='true']")).forEach(resetEl);
    if (isEditor()) injectEditorAttributes($scope);
    setTimeout(function () {
      initGSAPAnimations($scope);
      initSplitTextAnimations($scope);
    }, 50);
  }

  /* =====================================================================
   * EDITOR CHANGE LISTENER
   * ===================================================================== */
  function bindEditorChangeListener() {
    if (!isEditor() || window._sitsGsapEditorBound) return;
    window._sitsGsapEditorBound = true;

    var ch = null;
    try { ch = window.parent.elementor.channels.editor; } catch(e) {}
    if (!ch) return;

    ch.on("change", function (cv) {
      var name = "";
      try { name = cv.model.get("name") || ""; } catch(e) {}
      if (!name || name.indexOf("sits_gsap") !== 0) return;

      var $el = null;
      try { var cont = cv.options && cv.options.container; if (cont && cont.$el && cont.$el.length) $el = cont.$el; } catch(e) {}
      if (!$el) {
        try {
          var pv = window.parent.elementor.getPanelView();
          var pv2 = pv && pv.getCurrentPageView && pv.getCurrentPageView();
          if (pv2 && pv2.getOption) { var ev = pv2.getOption("editedElementView"); if (ev) $el = ev.$el; }
        } catch(e) {}
      }
      if (!$el) {
        try {
          var sel = window.parent.elementor.selection && window.parent.elementor.selection.getElements();
          if (sel && sel.length) $el = $("[data-id='" + String(sel[0].id) + "']");
        } catch(e) {}
      }
      if ($el && $el.length) {
        clearTimeout(window._sitsGsapTimer);
        window._sitsGsapTimer = setTimeout(function () { reinit($el); }, 120);
      }
    });
  }

  /* =====================================================================
   * BOOT
   * ===================================================================== */
  $(window).on("elementor/frontend/init", function () {
    if (typeof elementorFrontend === "undefined" || !elementorFrontend.hooks) return;

    elementorFrontend.hooks.addAction("frontend/element_ready/global", function ($scope) {
      if (isEditor()) injectEditorAttributes($scope);
      initGSAPAnimations($scope);
      initSplitTextAnimations($scope);
    });

    if (isEditor()) bindEditorChangeListener();
    initGSAPAnimations();
  });

  /* Fallback for non-Elementor / plain frontend */
  document.addEventListener("DOMContentLoaded", function () {
  initGSAPAnimations();
  initSplitTextAnimations();
  // also re-run after full load in case of late-rendered images shifting layout
  window.addEventListener("load", function () {
    if (typeof ScrollTrigger !== "undefined") ScrollTrigger.refresh(true);
    initGSAPAnimations();
    initSplitTextAnimations();
  });
});

// Refresh ScrollTrigger on viewport resize (fixes DevTools device switching)
var _sitsResizeTimer;
window.addEventListener('resize', function () {
  clearTimeout(_sitsResizeTimer);
  _sitsResizeTimer = setTimeout(function () {
    if (typeof ScrollTrigger !== 'undefined') {
      ScrollTrigger.refresh(true);
    }
  }, 300);
});

})(jQuery);