### Handle Rocket Start Loading Event Source: https://www.metabarwise.com/urun/sase-cikolata-15/ Listens for the custom 'rocket-startLoading' event on the window. When triggered, it clears any existing animation timeouts, preventing potential race conditions or redundant animations. ```javascript window.addEventListener("rocket-startLoading", function() { clearTimeout(s) }) ``` -------------------------------- ### RocketLazyLoadScripts Initialization and Methods Source: https://www.metabarwise.com/urun/sase-cikolata-15/ This JavaScript snippet appears to be part of a lazy loading script, likely for optimizing web performance. It includes methods for handling page load events, managing document writes, and performing asynchronous operations based on document visibility and animation frames. The `run` method suggests it's designed to be instantiated and executed. ```javascript class RocketLazyLoadScripts { constructor() { this.persisted = false; this.windowLoaded = false; this.lastBreath = 0; this.trash = []; } async m() { document.onreadystatechange && document.onreadystatechange(); window.onload && window.onload(); window.onpageshow && window.onpageshow({ persisted: this.persisted }); this.windowLoaded = true; } q() { const t = new Map(); document.write = document.writeln = function(e) { const i = document.currentScript; if (!i) { console.error("WPRocket unable to document.write this: " + e); return; } const o = document.createRange(); const n = i.parentElement; let s = t.get(i); if (void 0 === s) { s = i.nextSibling; t.set(i, s); } const c = document.createDocumentFragment(); o.setStart(c, 0); c.appendChild(o.createContextualFragment(e)); n.insertBefore(c, s); }; } async G() { if (Date.now() - this.lastBreath > 45) { await this.K(); this.lastBreath = Date.now(); } } async K() { return document.hidden ? new Promise((t) => setTimeout(t)) : new Promise((t) => requestAnimationFrame(t)); } N() { this.trash.forEach((t) => t.remove()); } static run() { const t = new RocketLazyLoadScripts(); t.k(t); } } RocketLazyLoadScripts.run(); ``` -------------------------------- ### Google Site Kit WooCommerce Data Initialization Source: https://www.metabarwise.com/iletisim/ Initializes the `window._googlesitekit.wcdata` object, which is used by Google Site Kit to track WooCommerce data. It sets up an empty array for products, null for add-to-cart status, specifies the currency as TRY, and defines events to track, such as 'add_to_cart' and 'purchase'. ```javascript window._googlesitekit.wcdata = window._googlesitekit.wcdata || {}; window._googlesitekit.wcdata.products = []; window._googlesitekit.wcdata.add_to_cart = null; window._googlesitekit.wcdata.currency = "TRY"; window._googlesitekit.wcdata.eventsToTrack = ["add_to_cart","purchase"]; ``` -------------------------------- ### CSS Image Styling for Auto Sizes Source: https://www.metabarwise.com/urun/sase-cilek-15/ CSS rule to apply `contain-intrinsic-size` to images with `sizes` attribute set to 'auto' or starting with 'auto,'. This helps with layout stability by providing intrinsic sizing hints. ```css img:is([sizes="auto" i], [sizes^="auto," i]) { contain-intrinsic-size: 3000px 1500px } ``` -------------------------------- ### Google Site Kit WCData Initialization Source: https://www.metabarwise.com/urun/sase-muz-15/ This JavaScript code initializes or augments the `window._googlesitekit.wcdata` object, specifically populating the `products` array with WooCommerce product data. It includes product IDs and names. ```JavaScript window._googlesitekit.wcdata = window._googlesitekit.wcdata || {}; window._googlesitekit.wcdata.products = [ { "id": 27996, "name": "Metabar Wise Whey Protein - \u00c7ilek Aromal\u0131 Sa\u015f" } ]; ``` -------------------------------- ### RocketElementorAnimation Class Source: https://www.metabarwise.com/gizlilik-politikasi/ Manages Elementor animations for website elements. It detects animations based on device mode, applies animation classes with delays, and removes them after execution. It also handles clearing timeouts when the page starts loading. ```javascript class RocketElementorAnimation { constructor() { this.deviceMode = document.createElement("span"); this.deviceMode.id = "elementor-device-mode-wpr"; this.deviceMode.setAttribute("class", "elementor-screen-only"); document.body.appendChild(this.deviceMode); } _detectAnimations() { let t = getComputedStyle(this.deviceMode, ":after").content.replace(/"/g, ""); this.animationSettingKeys = this._listAnimationSettingsKeys(t); document.querySelectorAll(".elementor-invisible[data-settings]").forEach(t => { const e = t.getBoundingClientRect(); if (e.bottom >= 0 && e.top <= window.innerHeight) { try { this._animateElement(t); } catch (t) { // Handle potential errors during animation } } }); } _animateElement(t) { const e = JSON.parse(t.dataset.settings); const i = e._animation_delay || e.animation_delay || 0; const n = e[this.animationSettingKeys.find(t => e[t])]; if ("none" === n) { return void t.classList.remove("elementor-invisible"); } t.classList.remove(n); this.currentAnimation && t.classList.remove(this.currentAnimation); this.currentAnimation = n; let s = setTimeout(() => { t.classList.remove("elementor-invisible"); t.classList.add("animated", n); this._removeAnimationSettings(t, e); }, i); window.addEventListener("rocket-startLoading", function() { clearTimeout(s); }); } _listAnimationSettingsKeys(t = "mobile") { const e = [""]; switch (t) { case "mobile": e.unshift("_mobile"); case "tablet": e.unshift("_tablet"); case "desktop": e.unshift("_desktop"); } const i = []; ["animation", "_animation"].forEach(t => { e.forEach(e => { i.push(t + e); }); }); return i; } _removeAnimationSettings(t, e) { this._listAnimationSettingsKeys().forEach(t => delete e[t]); t.dataset.settings = JSON.stringify(e); } static run() { const t = new RocketElementorAnimation; requestAnimationFrame(t._detectAnimations.bind(t)); } } document.addEventListener("DOMContentLoaded", RocketElementorAnimation.run); ``` -------------------------------- ### CSS Image Styling for Auto Sizes Source: https://www.metabarwise.com/urun/sase-kavun-15/ This CSS rule targets `img` elements with specific `sizes` attributes (`auto` or starting with `auto,`). It applies `contain-intrinsic-size` to these images, which can help with layout stability by providing intrinsic sizing hints before the image loads. ```css img:is([sizes="auto" i], [sizes^="auto," i]) { contain-intrinsic-size: 3000px 1500px } ``` -------------------------------- ### Rocket Preload Links Initialization (Partial) Source: https://www.metabarwise.com/urun/tablet-kavun-60/ The beginning of a JavaScript class or function for initializing Rocket's preloading links feature. It sets up properties related to browser compatibility and configuration, preparing for link prefetching logic. ```javascript (function () { "use strict"; var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) { return typeof e; } : function(e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e; }; var e = function() { function i(e, t) { for (var n = 0; n < t.length; n++) { var i = t[n]; i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, i.key, i) } } return function(e, t, n) { return t && i(e.prototype, t), n && i(e, n), e; }; }(); function i(e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); } var t = function() { function n(e, t) { i(this, n), this.browser = e, this.config = t, this.options = this.browser.options, this.prefetched = new Set, this.eventTime = null; ``` -------------------------------- ### Initialize Google Site Kit WooCommerce Data Source: https://www.metabarwise.com/e-ticaret-mesafeli-satis-sozlesmesi/ Initializes the Google Site Kit data object for WooCommerce, setting up product tracking, add-to-cart events, currency, and specific events to monitor. ```javascript window._googlesitekit.wcdata = window._googlesitekit.wcdata || {}; window._googlesitekit.wcdata.products = []; window._googlesitekit.wcdata.add_to_cart = null; window._googlesitekit.wcdata.currency = "TRY"; window._googlesitekit.wcdata.eventsToTrack = ["add_to_cart","purchase"]; ``` -------------------------------- ### CSS for Image Contain-Intrinsic-Size Source: https://www.metabarwise.com/urun/sase-cikolata-15/ This CSS rule applies a `contain-intrinsic-size` property to `img` elements that have `sizes` attributes set to `auto` or starting with `auto,`. This is often used for performance optimization, particularly with responsive images, to help the browser reserve space for the image before it loads. ```css img:is([sizes="auto" i], [sizes^="auto," i]) { contain-intrinsic-size: 3000px 1500px; } ``` -------------------------------- ### RocketLazyLoadScripts Initialization and Methods Source: https://www.metabarwise.com/urun/sase-aromasiz-30/ This JavaScript code defines a class `RocketLazyLoadScripts` responsible for lazy loading scripts. It includes methods for managing window load events, handling document ready states, and optimizing script execution. The `run` method initializes the class and executes its core logic. ```javascript class RocketLazyLoadScripts { constructor() { this.windowLoaded = !1; this.trash = []; this.lastBreath = 0; } k(t) { this.windowLoaded = !0; const e = document.currentScript; e && (e.remove(), this.trash.push(e)); this.m(); window.dispatchEvent(new CustomEvent("rocketonpageshow", { detail: { persisted: this.persisted } })); window.rocketonpageshow && window.rocketonpageshow({ persisted: this.persisted }); this.windowLoaded = !0; } m() { document.onreadystatechange && document.onreadystatechange(); window.onload && window.onload(); window.onpageshow && window.onpageshow({ persisted: this.persisted }); } q() { const t = new Map; document.write = document.writeln = function(e) { const i = document.currentScript; i || console.error("WPRocket unable to document.write this: " + e); const o = document.createRange(), n = i.parentElement; let s = t.get(i); void 0 === s && (s = i.nextSibling, t.set(i, s)); const c = document.createDocumentFragment(); o.setStart(c, 0), c.appendChild(o.createContextualFragment(e)), n.insertBefore(c, s); }; } async G() { Date.now() - this.lastBreath > 45 && (await this.K(), this.lastBreath = Date.now()); } async K() { return document.hidden ? new Promise((t => setTimeout(t))) : new Promise((t => requestAnimationFrame(t))); } N() { this.trash.forEach((t => t.remove())); } static run() { const t = new RocketLazyLoadScripts; t.k(t); } } RocketLazyLoadScripts.run(); ``` -------------------------------- ### CSS Image Sizing for Auto Sizes Source: https://www.metabarwise.com/urun/sase-cikolata-30/ This CSS rule applies a 'contain-intrinsic-size' property to images that have their 'sizes' attribute set to 'auto' or starting with 'auto,'. This helps in preventing layout shifts by providing intrinsic sizing information to the browser before the image is fully loaded. ```css img:is("[sizes='auto' i]", "[sizes^='auto,' i]") { contain-intrinsic-size: 3000px 1500px } ``` -------------------------------- ### Lazy Load Mutation Observer Setup Source: https://www.metabarwise.com/urun/sase-mix-30/ This JavaScript code sets up a MutationObserver to detect when new DOM elements are added to the page. If images, iframes, or elements with the 'rocket-lazyload' class are added, it updates the lazy load instance to ensure these new elements are also processed for lazy loading. ```javascript window.addEventListener('LazyLoad::Initialized',function(e){ var lazyLoadInstance=e.detail.instance; if(window.MutationObserver){ var observer=new MutationObserver(function(mutations){ var image_count=0; var iframe_count=0; var rocketlazy_count=0; mutations.forEach(function(mutation){ for(var i=0;i0||iframe_count>0||rocketlazy_count>0){ lazyLoadInstance.update() } }); var b=document.getElementsByTagName("body")[0]; var config={childList:!0,subtree:!0}; observer.observe(b,config) } },!1) ``` -------------------------------- ### Rocket Preload Links Initialization Source: https://www.metabarwise.com/urun/tablet-kavun-60/ Initializes the Rocket Preload Links script, which enhances website performance by prefetching links based on user interaction. It checks browser compatibility and applies prefetching logic. ```javascript var n = function() { function n(e, t) { this.config = e, this.browser = t, this.prefetched = new Set, this.regex = null, this.numOnHover = 0 } return e(n, [ { key: "init", value: function() { !this.browser.supportsLinkPrefetch() || this.browser.isDataSaverModeOn() || this.browser.isSlowConnection() || (this.regex = { excludeUris: RegExp(this.config.excludeUris, "i"), images: RegExp(".(" + this.config.imageExt + ")$", "i"), fileExt: RegExp(".(" + this.config.fileExt + ")$", "i") }, this._initListeners(this)) } }, { key: "_initListeners", value: function(e) { -1 < this.config.onHoverDelay && document.addEventListener("mouseover", e.listener.bind(e), e.listenerOptions), document.addEventListener("mousedown", e.listener.bind(e), e.listenerOptions), document.addEventListener("touchstart", e.listener.bind(e), e.listenerOptions) } }, { key: "listener", value: function(e) { var t = e.target.closest("a"), n = this._prepareUrl(t); null !== n && ("mousedown" === e.type || "touchstart" === e.type ? this._addPrefetchLink(n) : "mouseover" === e.type && this._earlyPrefetch(t, n, "mouseout")) } }, { key: "_earlyPrefetch", value: function(t, e, n) { var i = this, r = setTimeout(function() { r = null, 0 === i.numOnHover ? setTimeout(function() { return i.numOnHover = 0 }, 1e3) : i.numOnHover > i.config.rateThrottle ? void 0 : (i.numOnHover++, i._addPrefetchLink(e)) }, this.config.onHoverDelay); t.addEventListener(n, function e() { t.removeEventListener(n, e, { passive: !0 }), null !== r && (clearTimeout(r), r = null) }, { passive: !0 }) } }, { key: "_addPrefetchLink", value: function(i) { return this.prefetched.add(i.href), new Promise(function(e, t) { var n = document.createElement("link"); n.rel = "prefetch", n.href = i.href, n.onload = e, n.onerror = t, document.head.appendChild(n) }).catch(function() {}) } }, { key: "_prepareUrl", value: function(e) { if (null === e || "object" !== (void 0 === e ? "undefined" : r(e)) || !1 in e || -1 === ["http:", "https:"].indexOf(e.protocol)) return null; var t = e.href.substring(0, this.config.siteUrl.length), n = this._getPathname(e.href, t), i = { original: e.href, protocol: e.protocol, origin: t, pathname: n, href: t + n }; return this._isLinkOk(i) ? i : null } }, { key: "_getPathname", value: function(e, t) { var n = t ? e.substring(this.config.siteUrl.length) : e; return n.startsWith("/") || (n = "/" + n), this._shouldAddTrailingSlash(n) ? n + "/" : n } }, { key: "_shouldAddTrailingSlash", value: function(e) { return this.config.usesTrailingSlash && !e.endsWith("/") && !this.regex.fileExt.test(e) } }, { key: "_isLinkOk", value: function(e) { return null !== e && "object" === (void 0 === e ? "undefined" : r(e)) && (!this.prefetched.has(e.href) && e.origin === this.config.siteUrl && -1 === e.href.indexOf("?") && -1 === e.href.indexOf("#") && !this.regex.excludeUris.test(e.href) && !this.regex.images.test(e.href)) } } ], [ { key: "run", value: function() { "undefined" != typeof RocketPreloadLinksConfig && new n(new RocketBrowserCompatibilityChecker({ capture: !0, passive: !0 }), RocketPreloadLinksConfig).init() } } ]), n }(); t.run(); ``` -------------------------------- ### RocketLazyLoadScripts Initialization and Methods Source: https://www.metabarwise.com/kisisel-verilerin-korunmasi-ve-islenmesine-dair-bilgilendirme/ This JavaScript code defines a class `RocketLazyLoadScripts` responsible for lazy loading scripts. It includes methods for managing page load events, handling document writes, and optimizing script execution based on browser visibility and animation frames. The `run` method is the entry point for initializing the class. ```javascript class RocketLazyLoadScripts { constructor() { this.windowLoaded = false; this.persisted = false; this.lastBreath = Date.now(); this.trash = []; } k() { if (this.windowLoaded) { return; } window.dispatchEvent(new Event('lazyload')); this.G(); if (window.rocketonpageshow) { window.rocketonpageshow({ persisted: this.persisted }); } this.windowLoaded = true; } m() { if (document.onreadystatechange) { document.onreadystatechange(); } if (window.onload) { window.onload(); } if (window.onpageshow) { window.onpageshow({ persisted: this.persisted }); } } q() { const t = new Map(); document.write = document.writeln = function(e) { const i = document.currentScript; if (!i) { console.error("WPRocket unable to document.write this: " + e); return; } const o = document.createRange(); const n = i.parentElement; let s = t.get(i); if (s === undefined) { s = i.nextSibling; t.set(i, s); } const c = document.createDocumentFragment(); o.setStart(c, 0); c.appendChild(o.createContextualFragment(e)); n.insertBefore(c, s); }; } async G() { if (Date.now() - this.lastBreath > 45000) { await this.K(); this.lastBreath = Date.now(); } } async K() { return document.hidden ? new Promise(t => setTimeout(t)) : new Promise(t => requestAnimationFrame(t)); } N() { this.trash.forEach(t => t.remove()); } static run() { const t = new RocketLazyLoadScripts(); t.k(t); } } RocketLazyLoadScripts.run(); ``` -------------------------------- ### RocketLazyLoadScripts Initialization Source: https://www.metabarwise.com/urun/sase-cilek-30/ Initializes the RocketLazyLoadScripts class, handling document ready states, window load events, and page show events for script optimization. It also includes logic for documenting document.write calls and managing script execution based on browser visibility. ```javascript (() => { class RocketLazyLoadScripts { constructor() { this.windowLoaded = !1; this.trash = []; this.lastBreath = 0; this.k(this) } k(t) { const e = document.currentScript; e && (e.closest("body") ? (this.m(), this.windowLoaded || (document.addEventListener("DOMContentLoaded", () => this.m()), window.addEventListener("load", () => this.m())), this.q()) : console.error("RocketLazyLoadScripts must be in the body.")) } m() { document.onreadystatechange && document.onreadystatechange(), window.onload && window.onload(), window.onpageshow && window.onpageshow({ persisted: this.persisted }), this.windowLoaded = !0 } q() { const t = new Map; document.write = document.writeln = function(e) { const i = document.currentScript; i || console.error("WPRocket unable to document.write this: " + e); const o = document.createRange(), n = i.parentElement; let s = t.get(i); void 0 === s && (s = i.nextSibling, t.set(i, s)); const c = document.createDocumentFragment(); o.setStart(c, 0), c.appendChild(o.createContextualFragment(e)), n.insertBefore(c, s) } } async G() { Date.now() - this.lastBreath > 45 && (await this.K(), this.lastBreath = Date.now()) } async K() { return document.hidden ? new Promise((t => setTimeout(t))) : new Promise((t => requestAnimationFrame(t))) } N() { this.trash.forEach((t => t.remove())) } static run() { const t = new RocketLazyLoadScripts; t.k(t) } } RocketLazyLoadScripts.run() })(); ``` -------------------------------- ### Rocket Preload Links Initialization (Partial) Source: https://www.metabarwise.com/gizlilik-politikasi/ The beginning of a JavaScript class or function for initializing Rocket's preloading links feature. It sets up properties related to browser compatibility and configuration, preparing for link prefetching logic. ```javascript (function () { "use strict"; var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) { return typeof e; } : function(e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e; }; var e = function() { function i(e, t) { for (var n = 0; n < t.length; n++) { var i = t[n]; i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, i.key, i) } } return function(e, t, n) { return t && i(e.prototype, t), n && i(e, n), e; }; }(); function i(e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); } var t = function() { function n(e, t) { i(this, n), this.browser = e, this.config = t, this.options = this.browser.options, this.prefetched = new Set, this.eventTime = null; ``` -------------------------------- ### Rocket Preload Links Initialization (Partial) Source: https://www.metabarwise.com/cerez-politikasi/ The beginning of a JavaScript class or function for initializing Rocket's preloading links feature. It sets up properties related to browser compatibility and configuration, preparing for link prefetching logic. ```javascript (function () { "use strict"; var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) { return typeof e; } : function(e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e; }; var e = function() { function i(e, t) { for (var n = 0; n < t.length; n++) { var i = t[n]; i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, i.key, i) } } return function(e, t, n) { return t && i(e.prototype, t), n && i(e, n), e; }; }(); function i(e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); } var t = function() { function n(e, t) { i(this, n), this.browser = e, this.config = t, this.options = this.browser.options, this.prefetched = new Set, this.eventTime = null; ``` -------------------------------- ### Rocket Preload Links Initialization (Partial) Source: https://www.metabarwise.com/kisisel-verilerin-korunmasi-ve-islenmesine-dair-bilgilendirme/ The beginning of a JavaScript class or function for initializing Rocket's preloading links feature. It sets up properties related to browser compatibility and configuration, preparing for link prefetching logic. ```javascript (function () { "use strict"; var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) { return typeof e; } : function(e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e; }; var e = function() { function i(e, t) { for (var n = 0; n < t.length; n++) { var i = t[n]; i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, i.key, i) } } return function(e, t, n) { return t && i(e.prototype, t), n && i(e, n), e; }; }(); function i(e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); } var t = function() { function n(e, t) { i(this, n), this.browser = e, this.config = t, this.options = this.browser.options, this.prefetched = new Set, this.eventTime = null; ``` -------------------------------- ### Google Site Kit WooCommerce Data Configuration Source: https://www.metabarwise.com/gizlilik-politikasi/ Initializes and configures WooCommerce data for Google Site Kit. It sets up product tracking, add-to-cart events, and currency settings. ```javascript window._googlesitekit.wcdata = window._googlesitekit.wcdata || {}; window._googlesitekit.wcdata.products = []; window._googlesitekit.wcdata.add_to_cart = null; window._googlesitekit.wcdata.currency = "TRY"; window._googlesitekit.wcdata.eventsToTrack = ["add_to_cart","purchase"]; ``` -------------------------------- ### WooCommerce Product Data Initialization Source: https://www.metabarwise.com/urun/sase-kavun-15/ Initializes product data for WooCommerce integration, including product IDs, names, categories, and prices. This script populates the `_googlesitekit.wcdata.products` array. ```javascript window._googlesitekit.wcdata = window._googlesitekit.wcdata || {}; window._googlesitekit.wcdata.products = [ { "id": 27994, "name": "Metabar Wise Whey Protein - Çikolata Aromalı Saşe - 7'li Kutu", "categories": [ { "name": "Saşe" } ], "price": 950 }, { "id": 27996, "name": "Metabar Wise Whey Protein - Çilek Aromalı Saşe - 7'li Kutu", "categories": [ { "name": "Saşe" } ], "price": 950 }, { "id": 27998, "name": "Metabar Wise Whey Protein - Kavun Aromal" } ]; ``` -------------------------------- ### Rocket Preload Links Initialization (Partial) Source: https://www.metabarwise.com/sss/ The beginning of a JavaScript class or function for initializing Rocket's preloading links feature. It sets up properties related to browser compatibility and configuration, preparing for link prefetching logic. ```javascript (function () { "use strict"; var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) { return typeof e; } : function(e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e; }; var e = function() { function i(e, t) { for (var n = 0; n < t.length; n++) { var i = t[n]; i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, i.key, i) } } return function(e, t, n) { return t && i(e.prototype, t), n && i(e, n), e; }; }(); function i(e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); } var t = function() { function n(e, t) { i(this, n), this.browser = e, this.config = t, this.options = this.browser.options, this.prefetched = new Set, this.eventTime = null; ``` -------------------------------- ### Google Site Kit WooCommerce Data Initialization Source: https://www.metabarwise.com/urun/sase-cilek-15/ This JavaScript code initializes the `_googlesitekit.wcdata` object, which is part of the Google Site Kit plugin. It includes an array of product data, likely for analytics or integration purposes. ```JavaScript /* ]]> */ /* i.config.rateThrottle ? void 0 : (i.numOnHover++, i._addPrefetchLink(e)) }, this.config.onHoverDelay); t.addEventListener(n, function e() { t.removeEventListener(n, e, { passive: !0 }), null !== r && (clearTimeout(r), r = null) }, { passive: !0 }) } }, { key: "_addPrefetchLink", value: function(i) { return this.prefetched.add(i.href), new Promise(function(e, t) { var n = document.createElement("link"); n.rel = "prefetch", n.href = i.href, n.onload = e, n.onerror = t, document.head.appendChild(n) }).catch(function() {}) } }, { key: "_prepareUrl", value: function(e) { if (null === e || "object" !== (void 0 === e ? "undefined" : r(e)) || !1 in e || -1 === ["http:", "https:"].indexOf(e.protocol)) return null; var t = e.href.substring(0, this.config.siteUrl.length), n = this._getPathname(e.href, t), i = { original: e.href, protocol: e.protocol, origin: t, pathname: n, href: t + n }; return this._isLinkOk(i) ? i : null } }, { key: "_getPathname", value: function(e, t) { var n = t ? e.substring(this.config.siteUrl.length) : e; return n.startsWith("/") || (n = "/" + n), this._shouldAddTrailingSlash(n) ? n + "/" : n } }, { key: "_shouldAddTrailingSlash", value: function(e) { return this.config.usesTrailingSlash && !e.endsWith("/") && !this.regex.fileExt.test(e) } }, { key: "_isLinkOk", value: function(e) { return null !== e && "object" === (void 0 === e ? "undefined" : r(e)) && (!this.prefetched.has(e.href) && e.origin === this.config.siteUrl && -1 === e.href.indexOf("?") && -1 === e.href.indexOf("#") && !this.regex.excludeUris.test(e.href) && !this.regex.images.test(e.href)) } } ], [ { key: "run", value: function() { "undefined" != typeof RocketPreloadLinksConfig && new n(new RocketBrowserCompatibilityChecker({ capture: !0, passive: !0 }), RocketPreloadLinksConfig).init() } } ]), n }(); t.run(); ``` -------------------------------- ### Google Site Kit WooCommerce Data Initialization Source: https://www.metabarwise.com/urun/shaker/ Initializes the Google Site Kit JavaScript object with WooCommerce-specific data, including product information, add-to-cart status, currency, and events to track. ```javascript window._googlesitekit.wcdata = window._googlesitekit.wcdata || {}; window._googlesitekit.wcdata.products = []; window._googlesitekit.wcdata.add_to_cart = null; window._googlesitekit.wcdata.currency = "TRY"; window._googlesitekit.wcdata.eventsToTrack = ["add_to_cart","purchase"]; ```