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ACAvC,OAAOC,YAAYC,SAASwC,WAAY","sources":["webpack://advanced-web/./UI/js/core/modules/observer.js"],"sourcesContent":["(function () {\r\n\r\n window.oneadvanced = window.oneadvanced || {};\r\n window.oneadvanced.observer = window.oneadvanced.observer || {};\r\n window.oneadvanced.observer.init = function () {\r\n //console.log(\"initialising observer...\");\r\n\r\n // IntersectionObserver\r\n if ('IntersectionObserver' in window &&\r\n 'IntersectionObserverEntry' in window &&\r\n 'intersectionRatio' in window.IntersectionObserverEntry.prototype) {\r\n\r\n var theObservered = document.querySelectorAll('.card, .o-fade');\r\n\r\n var observer = new IntersectionObserver((entries, self) => {\r\n entries.forEach(entry => {\r\n if (entry.intersectionRatio > 0) {\r\n entry.target.classList.add('fadeInUp');\r\n entry.target.addEventListener('animationend', animationEndCallback);\r\n self.unobserve(entry.target);\r\n }\r\n });\r\n });\r\n\r\n theObservered.forEach(observation => {\r\n observer.observe(observation);\r\n });\r\n\r\n }\r\n function animationEndCallback(event) {\r\n this.removeEventListener('animationEnd', animationEndCallback);\r\n this.classList.remove('fadeInUp');\r\n }\r\n\r\n // MutationObserver\r\n\r\n // Options for the observer (which mutations to observe)\r\n window.oneadvanced.observer.mutation_observer = window.oneadvanced.observer.mutation_observer || {};\r\n window.oneadvanced.observer.mutation_observer_config = window.oneadvanced.observer.mutation_observer_config || { attributes: true, attributeFilter: ['class'], childList: true, subtree: true };\r\n\r\n // Callback function to execute when mutations are observed\r\n var callback = function (mutationsList, observer) {\r\n // Use traditional 'for loops' for IE 11\r\n for (var mutationIndex = 0; mutationIndex < mutationsList.length; mutationIndex++) {\r\n if (mutationsList[mutationIndex].type === 'attributes' && mutationsList[mutationIndex].target.className === 'slick-slide slick-cloned') {\r\n //console.log('The ' + mutationsList[mutationIndex].attributeName + ' attribute was modified.');\r\n var img = mutationsList[mutationIndex].target.getElementsByTagName('img')[0];\r\n if (img && window.oneadvanced.lazyload.hasLoaded) {\r\n window.oneadvanced.lazyload.observer.observe(img);\r\n } else {\r\n //console.log(\"The lazy loading observer has not been loaded. Unable to observe.\")\r\n }\r\n }\r\n }\r\n };\r\n\r\n // Create an observer instance linked to the callback function\r\n window.oneadvanced.observer.mutation_observer = new MutationObserver(callback);\r\n };\r\n window.oneadvanced.observer.hasLoaded = true;\r\n\r\n})();"],"names":["window","oneadvanced","observer","init","IntersectionObserverEntry","prototype","theObservered","document","querySelectorAll","IntersectionObserver","entries","self","forEach","entry","intersectionRatio","target","classList","add","addEventListener","animationEndCallback","unobserve","observation","observe","event","this","removeEventListener","remove","mutation_observer","mutation_observer_config","attributes","attributeFilter","childList","subtree","MutationObserver","mutationsList","mutationIndex","length","type","className","img","getElementsByTagName","lazyload","hasLoaded"],"sourceRoot":""}