/* Scoped to: home-appliances-template-who_we_are */
(function() {
  'use strict';
  var componentRoots = document.querySelectorAll('[data-component-slug="home-appliances-template-who_we_are"]');
  componentRoots.forEach(function(componentRoot) {
    // Helper to query within component, with fallback to document for sibling elements
    var $ = function(sel) { 
      return componentRoot.querySelector(sel) || document.querySelector('[data-component-slug="home-appliances-template-who_we_are"] ~ ' + sel) || document.querySelector(sel);
    };
    var $$ = function(sel) { 
      var results = componentRoot.querySelectorAll(sel);
      return results.length ? results : document.querySelectorAll(sel);
    };
    // Original component JS runs in this scope
    (function() { const playBtn = document.querySelector('#playButton'); const component = document.currentScript.previousElementSibling; if (component) { const btn = component.querySelector('#playButton'); const videoContainer = component.querySelector('#videoContainer'); const mainImage = component.querySelector('#mainImage'); const iframe = component.querySelector('#videoFrame'); const videoUrlSpan = component.querySelector('#videoUrlNode'); if (btn && videoContainer && iframe && videoUrlSpan) { btn.addEventListener('click', function(e) { e.preventDefault(); const url = videoUrlSpan.innerText.trim(); if (url) { iframe.src = url; mainImage.classList.add('hidden'); btn.classList.add('hidden'); videoContainer.classList.remove('hidden'); } }); } } })();(function () { setTimeout(function () { var CONFIG = { counter1: parseInt("{{counter_1_value}}") || 1500, duration: parseInt("{{animation_duration}}") || 2000, }; var counters = document.querySelectorAll("[data-counter]"); if (!counters.length) return; function easeOutQuart(t) { return 1 - Math.pow(1 - t, 4); } function animateCounter(element, target, duration) { var startTime = null; function step(timestamp) { if (!startTime) startTime = timestamp; var progress = Math.min((timestamp - startTime) / duration, 1); var easedProgress = easeOutQuart(progress); var current = Math.floor(easedProgress * target); element.textContent = current.toLocaleString(); if (progress < 1) { requestAnimationFrame(step); } else { element.textContent = target.toLocaleString(); } } requestAnimationFrame(step); } var observer = new IntersectionObserver( function (entries) { entries.forEach(function (entry) { if (entry.isIntersecting) { var counterEl = entry.target; var counterNum = counterEl.getAttribute("data-counter"); var target = CONFIG["counter" + counterNum]; animateCounter(counterEl, target, CONFIG.duration); observer.unobserve(counterEl); } }); }, { threshold: 0.3 }, ); counters.forEach(function (counter) { observer.observe(counter); }); }, 0); })();
  });
})();