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ACA,sBACA,wBACA,wBACA,mBACA,mBACA,kBACA,iBACA,mBACA,oBACA,oBACA,mBACA,kBACA,oBACA,kBACA,mBACA,mBACA,mBACA,iBACA,mBACA,iBACA,iBACA,iBACA,kBACA,kBACA,oBACA,iBACA,mBACA,mBACA,mBACA,mBACA,kBACA,kBACA,kBACA,iBACA,mBACA,mBACA,mBACA,mBACA,kBACA,kBACA,kBACA,iBACA,mBACA,mBACA,kBACA,kBACA,iBACA,kBACA,kBACA,iBACA,mBACA,mBACA,mBACA,mBACA,kBACA,kBACA,kBACA,iBACA,mBACA,mBACA,mBACA,mBACA,kBACA,kBACA,kBACA,iBACA,mBACA,mBACA,mBACA,kBACA,kBACA,kBACA,iBACA,mBACA,mBACA,mBACA,mBACA,kBACA,kBACA,kBACA,iBACA,mBACA,mBACA,mBACA,mBACA,kBACA,kBACA,kBACA,iBACA,kBACA,kBACA,kBACA,iBACA,mBACA,mBACA,mBACA,mBACA,kBACA,kBACA,kBACA,iBACA,mBACA,mBACA,mBACA,mBACA,kBACA,kBACA,kBACA,iBACA,mBACA,kBACA,kBACA,kBACA,iBACA,mBACA,mBACA,mBACA,mBACA,kBACA,kBACA,mBAGgB,CAChB,iBACA,kBACA,kBACA,iBACA,iBACA,iBACA,kBACA,kBACA,kBACA,kBACA,gBACA,kBACA,gBACA,gBACA,kBACA,kBACA,kBACA,gBACA,gBACA,gBACA,gBACA,gBACA,gBACA,gBACA,gBACA,gBACA,gBACA,gBACA,gBACA,gBACA,gBACA,gBACA,gBACA,kBACA,iBACA,gBACA,gBACA,gBACA,gBACA,gBACA,gBACA,gBACA,gBACA,gBACA,gBACA,gBACA,gBACA,gBACA,gBACA,gBACA,gBACA,gBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,gBACA,kBACA,kBACA,kBACA,kBACA,iBACA,iBACA,iBACA,iBACA,iBACA,iBACA,iBACA,iBACA,iBACA,iBACA,iBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,iBACA,kBACA,iBACA,mBACA,mBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,mBACA,mBACA,mBACA,mBACA,mBACA,mBACA,mBACA,mBACA,mBACA,mBACA,mBACA,mBACA,mBACA,mBACA,mBACA,mBACA,mBACA,mBACA,mBACA,mBACA,mBACA,mBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,mBACA,kBACA,kBACA,kBACA,kBACA,mBACA,mBACA,mBACA,mBACA,mBACA,mBACA,mBACA,mBACA,mBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,mBACA,kBACA,mBACA,kBACA,mBACA,mBACA,mBACA,iBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,mBACA,mBACA,kBACA,kBACA,mBACA,mBACA,mBACA,mBACA,mBACA,mBACA,mBACA,mBACA,mBACA,kBACA,kBACA,kBACA,mBACA,mBACA,mBACA,mBACA,mBACA,mBACA,kBACA,kBACA,kBACA,mBACA,mBACA,mBACA,kBACA,mBACA,mBACA,mBACA,mBACA,mBACA,mBACA,mBACA,mBACA,kBACA,kBACA,mBACA,mBACA,mBACA,kBACA,mBACA,kBACA,kBACA,kBACA,kBACA,kBACA,iBACA,iBACA,iBACA,iBACA,kBACA,iBACA,mBACA,iBACA,sBACA,sBACA,mBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,iBACA,iBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,mBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,iBACA,iBACA,mBACA,mBACA,mBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,mBACA,mBACA,mBACA,mBACA,mBACA,mBACA,mBACA,sBACA,sBACA,sBACA,mBACA,mBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,mBACA,mBACA,sBACA,sBACA,sBACA,sBACA,oBACA,mBACA,oBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,oBACA,oBACA,oBACA,oBACA,oBACA,oBACA,oBACA,oBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,oBACA,oBACA,oBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,oBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,sBACA,oBACA,yBACA,kBAGe,CACf,kBACA,kBACA,mBAGY,CACZ,iBACA,iBACA,iBACA,iBACA,iBACA,kBACA,iBACA,kBACA,mBACA,kBACA,qBACA,kBACA,kBACA,mBACA,mBACA,kBACA,mBACA,iBACA,mBACA,iBACA,iBACA,iBACA,iBACA,iBACA,kBAGiB,CACjB,gBACA,gBACA,gBACA,gBACA,iBACA,iBACA,iBACA,mBAGc,CACd,eACA,iBACA,iBAGa,CACb,kBACA,kBAGc,CACd,iBACA,eAGa,CACb,iBACA,kBACA,mBACA,kBACA,kBACA,kBACA,gBACA,gBACA,gBACA,kBACA,mBACA,kBACA,kBACA,oBACA,oBACA,kBACA,mBACA,mBACA,mBACA,mBACA,iBACA,kBACA,mBACA,mBACA,mBAGkB,CAClB,gBACA,eACA,gBACA,cACA,eACA,gBACA,eACA,gBACA,gBACA,eACA,gBACA,iBAGa,CACb,iBACA,eACA,iBACA,iBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,iBACA,iBACA,iBACA,iBACA,iBACA,gBACA,cACA,eACA,eACA,eACA,eACA,eACA,gBACA,eACA,gBACA,kBACA,iBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,iBACA,iBACA,iBACA,mBACA,kBAGc,CACd,iBACA,gBACA,kBACA,gBACA,gBACA,gBACA,gBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,kBACA,oBACA,kBACA,kBACA,iBACA,kBACA,iBACA,mBACA,qBACA,iBACA,kBACA,mBACA,mBACA,mBACA,mBACA,cACA,eACA,iBACA,kBACA,kBACA,mBACA,mBACA,mBACA,mBACA,kBACA,iBACA,gBACA,iBACA,kBACA,kBACA,iBACA,iBACA,iBACA,iBACA,qBACA,qBACA,qBACA,qBAGa,CACb,mBACA,mBACA,mBACA,gBACA,gBACA,iBAGc,CACd,oBACA,qBAyBAkzB,EACA,CAGF,CAxnCA,CAwnCCzlB,OAAOnB,IAAMmB,OAAOnB,KAAO,CAAC,EAAGR,O,WCjmCjCymB,GAAGC,MAAMa,UACR,iDACA,iCACAxkB,IAKCvC,IAAIgZ,iBAAiBzW,EAAK+C,QAAQzC,GAAI,EAAE,IAO1CojB,GAAGC,MAAMa,UACR,0DACA,iCACAxkB,IAGKA,EAAKwD,SAAWxD,EAAK+C,QAAQS,UAChC/F,IAAIgZ,iBAAiBzW,EAAK+C,QAAQzC,GAAIN,EAAKwD,SAAWxD,EAAK+C,QAAQS,UAGhExD,EAAKwD,SAAWxD,EAAK+C,QAAQS,UAChC/F,IAAI+V,sBAAsBxT,EAAK+C,QAAQzC,GAAIN,EAAK+C,QAAQS,SAAWxD,EAAKwD,SACzE,IAOFkgB,GAAGC,MAAMa,UACR,oDACA,iCACAxkB,IAECvC,IAAI+V,sBAAsBxT,EAAK+C,QAAQ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q,EAAQ,IAAiC,IAI1CA,EAAQ,KAERmR,IAAImmB,uBAGJnmB,IAAI+kB,oBAIA/kB,IAAI2kB,8BAGR91B,EAAQ,KACRA,EAAQ,KACRA,EAAQ,KAuBR4Q,SAASqU,cAAc,IAAIC,MAAM,qBAGjCtU,SAASqU,cAAc,IAAIC,MAAM,kBAG3B/T,IAAIwjB,aACVxjB,IAAIslB,uBAAsB,EAG3BuC,E","sources":["webpack://Pixel-Manager-for-WooCommerce/../../src/index.ts","webpack://Pixel-Manager-for-WooCommerce/../../src/ipRange.ts","webpack://Pixel-Manager-for-WooCommerce/../../src/ipv4.ts","webpack://Pixel-Manager-for-WooCommerce/../../src/ipv6.ts","webpack://Pixel-Manager-for-WooCommerce/../../src/util.ts","webpack://Pixel-Manager-for-WooCommerce/../node_modules/ipaddr.js/lib/ipaddr.js","webpack://Pixel-Manager-for-WooCommerce/../node_modules/ip6/ip6.js","webpack://Pixel-Manager-for-WooCommerce/../src/range-check.ts","webpack://Pixel-Manager-for-WooCommerce/./src/js-src/public/facebook/event_listeners.js","webpack://Pixel-Manager-for-WooCommerce/./src/js-src/public/facebook/functions.js","webpack://Pixel-Manager-for-WooCommerce/./src/js-src/public/facebook/loader.js","webpack://Pixel-Manager-for-WooCommerce/./src/js-src/public/google/ads/event_listeners.js","webpack://Pixel-Manager-for-WooCommerce/./src/js-src/public/google/ads/functions.js","webpack://Pixel-Manager-for-WooCommerce/./src/js-src/public/google/ads/loader.js","webpack://Pixel-Manager-for-WooCommerce/./src/js-src/public/google/analytics/ga4/event_listeners.js","webpack://Pixel-Manager-for-WooCommerce/./src/js-src/public/google/analytics/ga4/functions.js","webpack://Pixel-Manager-for-WooCommerce/./src/js-src/public/google/analytics/ga4/loader.js","webpack://Pixel-Manager-for-WooCommerce/./src/js-src/public/google/analytics/loader.js","webpack://Pixel-Manager-for-WooCommerce/./src/js-src/public/google/base/event_listeners.js","webpack://Pixel-Manager-for-WooCommerce/./src/js-src/public/google/base/functions.js","webpack://Pixel-Manager-for-WooCommerce/./src/js-src/public/google/base/loader.js","webpack://Pixel-Manager-for-WooCommerce/./src/js-src/public/google/loader.js","webpack://Pixel-Manager-for-WooCommerce/./src/js-src/public/google/optimize/event_listeners.js","webpack://Pixel-Manager-for-WooCommerce/./src/js-src/public/google/optimize/functions.js","webpack://Pixel-Manager-for-WooCommerce/./src/js-src/public/google/optimize/loader.js","webpack://Pixel-Manager-for-WooCommerce/./src/js-src/public/hotjar/event_listeners.js","webpack://Pixel-Manager-for-WooCommerce/./src/js-src/public/hotjar/functions.js","webpack://Pixel-Manager-for-WooCommerce/./src/js-src/public/hotjar/loader.js","webpack://Pixel-Manager-for-WooCommerce/./src/js-src/public/wpm/cookie_consent.js","webpack://Pixel-Manager-for-WooCommerce/./src/js-src/public/wpm/event_listeners.js","webpack://Pixel-Manager-for-WooCommerce/./src/js-src/public/wpm/event_listeners_on_ready.js","webpack://Pixel-Manager-for-WooCommerce/./src/js-src/public/wpm/functions.js","webpack://Pixel-Manager-for-WooCommerce/./src/js-src/public/wpm/functions_loader.js","webpack://Pixel-Manager-for-WooCommerce/./src/js-src/public/wpm/functions_main.js","webpack://Pixel-Manager-for-WooCommerce/./src/js-src/public/wpm/ip_check.js","webpack://Pixel-Manager-for-WooCommerce/./src/js-src/public/wpm/wc_hooks.js","webpack://Pixel-Manager-for-WooCommerce/webpack/bootstrap","webpack://Pixel-Manager-for-WooCommerce/webpack/runtime/define property getters","webpack://Pixel-Manager-for-WooCommerce/webpack/runtime/global","webpack://Pixel-Manager-for-WooCommerce/webpack/runtime/hasOwnProperty shorthand","webpack://Pixel-Manager-for-WooCommerce/webpack/runtime/make namespace object","webpack://Pixel-Manager-for-WooCommerce/./src/js-src/public/main.js"],"sourcesContent":[null,null,null,null,null,"(function() {\n var expandIPv6, ipaddr, ipv4Part, ipv4Regexes, ipv6Part, ipv6Regexes, matchCIDR, root, zoneIndex;\n\n ipaddr = {};\n\n root = this;\n\n if ((typeof module !== \"undefined\" && module !== null) && module.exports) {\n module.exports = ipaddr;\n } else {\n root['ipaddr'] = ipaddr;\n }\n\n matchCIDR = function(first, second, partSize, cidrBits) {\n var part, shift;\n if (first.length !== second.length) {\n throw new Error(\"ipaddr: cannot match CIDR for objects with different lengths\");\n }\n part = 0;\n while (cidrBits > 0) {\n shift = partSize - cidrBits;\n if (shift < 0) {\n shift = 0;\n }\n if (first[part] >> shift !== second[part] >> shift) {\n return false;\n }\n cidrBits -= partSize;\n part += 1;\n }\n return true;\n };\n\n ipaddr.subnetMatch = function(address, rangeList, defaultName) {\n var k, len, rangeName, rangeSubnets, subnet;\n if (defaultName == null) {\n defaultName = 'unicast';\n }\n for (rangeName in rangeList) {\n rangeSubnets = rangeList[rangeName];\n if (rangeSubnets[0] && !(rangeSubnets[0] instanceof Array)) {\n rangeSubnets = [rangeSubnets];\n }\n for (k = 0, len = rangeSubnets.length; k < len; k++) {\n subnet = rangeSubnets[k];\n if (address.kind() === subnet[0].kind()) {\n if (address.match.apply(address, subnet)) {\n return rangeName;\n }\n }\n }\n }\n return defaultName;\n };\n\n ipaddr.IPv4 = (function() {\n function IPv4(octets) {\n var k, len, octet;\n if (octets.length !== 4) {\n throw new Error(\"ipaddr: ipv4 octet count should be 4\");\n }\n for (k = 0, len = octets.length; k < len; k++) {\n octet = octets[k];\n if (!((0 <= octet && octet <= 255))) {\n throw new Error(\"ipaddr: ipv4 octet should fit in 8 bits\");\n }\n }\n this.octets = octets;\n }\n\n IPv4.prototype.kind = function() {\n return 'ipv4';\n };\n\n IPv4.prototype.toString = function() {\n return this.octets.join(\".\");\n };\n\n IPv4.prototype.toNormalizedString = function() {\n return this.toString();\n };\n\n IPv4.prototype.toByteArray = function() {\n return this.octets.slice(0);\n };\n\n IPv4.prototype.match = function(other, cidrRange) {\n var ref;\n if (cidrRange === void 0) {\n ref = other, other = ref[0], cidrRange = ref[1];\n }\n if (other.kind() !== 'ipv4') {\n throw new Error(\"ipaddr: cannot match ipv4 address with non-ipv4 one\");\n }\n return matchCIDR(this.octets, other.octets, 8, cidrRange);\n };\n\n IPv4.prototype.SpecialRanges = {\n unspecified: [[new IPv4([0, 0, 0, 0]), 8]],\n broadcast: [[new IPv4([255, 255, 255, 255]), 32]],\n multicast: [[new IPv4([224, 0, 0, 0]), 4]],\n linkLocal: [[new IPv4([169, 254, 0, 0]), 16]],\n loopback: [[new IPv4([127, 0, 0, 0]), 8]],\n carrierGradeNat: [[new IPv4([100, 64, 0, 0]), 10]],\n \"private\": [[new IPv4([10, 0, 0, 0]), 8], [new IPv4([172, 16, 0, 0]), 12], [new IPv4([192, 168, 0, 0]), 16]],\n reserved: [[new IPv4([192, 0, 0, 0]), 24], [new IPv4([192, 0, 2, 0]), 24], [new IPv4([192, 88, 99, 0]), 24], [new IPv4([198, 51, 100, 0]), 24], [new IPv4([203, 0, 113, 0]), 24], [new IPv4([240, 0, 0, 0]), 4]]\n };\n\n IPv4.prototype.range = function() {\n return ipaddr.subnetMatch(this, this.SpecialRanges);\n };\n\n IPv4.prototype.toIPv4MappedAddress = function() {\n return ipaddr.IPv6.parse(\"::ffff:\" + (this.toString()));\n };\n\n IPv4.prototype.prefixLengthFromSubnetMask = function() {\n var cidr, i, k, octet, stop, zeros, zerotable;\n zerotable = {\n 0: 8,\n 128: 7,\n 192: 6,\n 224: 5,\n 240: 4,\n 248: 3,\n 252: 2,\n 254: 1,\n 255: 0\n };\n cidr = 0;\n stop = false;\n for (i = k = 3; k >= 0; i = k += -1) {\n octet = this.octets[i];\n if (octet in zerotable) {\n zeros = zerotable[octet];\n if (stop && zeros !== 0) {\n return null;\n }\n if (zeros !== 8) {\n stop = true;\n }\n cidr += zeros;\n } else {\n return null;\n }\n }\n return 32 - cidr;\n };\n\n return IPv4;\n\n })();\n\n ipv4Part = \"(0?\\\\d+|0x[a-f0-9]+)\";\n\n ipv4Regexes = {\n fourOctet: new RegExp(\"^\" + ipv4Part + \"\\\\.\" + ipv4Part + \"\\\\.\" + ipv4Part + \"\\\\.\" + ipv4Part + \"$\", 'i'),\n longValue: new RegExp(\"^\" + ipv4Part + \"$\", 'i')\n };\n\n ipaddr.IPv4.parser = function(string) {\n var match, parseIntAuto, part, shift, value;\n parseIntAuto = function(string) {\n if (string[0] === \"0\" && string[1] !== \"x\") {\n return parseInt(string, 8);\n } else {\n return parseInt(string);\n }\n };\n if (match = string.match(ipv4Regexes.fourOctet)) {\n return (function() {\n var k, len, ref, results;\n ref = match.slice(1, 6);\n results = [];\n for (k = 0, len = ref.length; k < len; k++) {\n part = ref[k];\n results.push(parseIntAuto(part));\n }\n return results;\n })();\n } else if (match = string.match(ipv4Regexes.longValue)) {\n value = parseIntAuto(match[1]);\n if (value > 0xffffffff || value < 0) {\n throw new Error(\"ipaddr: address outside defined range\");\n }\n return ((function() {\n var k, results;\n results = [];\n for (shift = k = 0; k <= 24; shift = k += 8) {\n results.push((value >> shift) & 0xff);\n }\n return results;\n })()).reverse();\n } else {\n return null;\n }\n };\n\n ipaddr.IPv6 = (function() {\n function IPv6(parts, zoneId) {\n var i, k, l, len, part, ref;\n if (parts.length === 16) {\n this.parts = [];\n for (i = k = 0; k <= 14; i = k += 2) {\n this.parts.push((parts[i] << 8) | parts[i + 1]);\n }\n } else if (parts.length === 8) {\n this.parts = parts;\n } else {\n throw new Error(\"ipaddr: ipv6 part count should be 8 or 16\");\n }\n ref = this.parts;\n for (l = 0, len = ref.length; l < len; l++) {\n part = ref[l];\n if (!((0 <= part && part <= 0xffff))) {\n throw new Error(\"ipaddr: ipv6 part should fit in 16 bits\");\n }\n }\n if (zoneId) {\n this.zoneId = zoneId;\n }\n }\n\n IPv6.prototype.kind = function() {\n return 'ipv6';\n };\n\n IPv6.prototype.toString = function() {\n return this.toNormalizedString().replace(/((^|:)(0(:|$))+)/, '::');\n };\n\n IPv6.prototype.toRFC5952String = function() {\n var bestMatchIndex, bestMatchLength, match, regex, string;\n regex = /((^|:)(0(:|$)){2,})/g;\n string = this.toNormalizedString();\n bestMatchIndex = 0;\n bestMatchLength = -1;\n while ((match = regex.exec(string))) {\n if (match[0].length > bestMatchLength) {\n bestMatchIndex = match.index;\n bestMatchLength = match[0].length;\n }\n }\n if (bestMatchLength < 0) {\n return string;\n }\n return string.substring(0, bestMatchIndex) + '::' + string.substring(bestMatchIndex + bestMatchLength);\n };\n\n IPv6.prototype.toByteArray = function() {\n var bytes, k, len, part, ref;\n bytes = [];\n ref = this.parts;\n for (k = 0, len = ref.length; k < len; k++) {\n part = ref[k];\n bytes.push(part >> 8);\n bytes.push(part & 0xff);\n }\n return bytes;\n };\n\n IPv6.prototype.toNormalizedString = function() {\n var addr, part, suffix;\n addr = ((function() {\n var k, len, ref, results;\n ref = this.parts;\n results = [];\n for (k = 0, len = ref.length; k < len; k++) {\n part = ref[k];\n results.push(part.toString(16));\n }\n return results;\n }).call(this)).join(\":\");\n suffix = '';\n if (this.zoneId) {\n suffix = '%' + this.zoneId;\n }\n return addr + suffix;\n };\n\n IPv6.prototype.toFixedLengthString = function() {\n var addr, part, suffix;\n addr = ((function() {\n var k, len, ref, results;\n ref = this.parts;\n results = [];\n for (k = 0, len = ref.length; k < len; k++) {\n part = ref[k];\n results.push(part.toString(16).padStart(4, '0'));\n }\n return results;\n }).call(this)).join(\":\");\n suffix = '';\n if (this.zoneId) {\n suffix = '%' + this.zoneId;\n }\n return addr + suffix;\n };\n\n IPv6.prototype.match = function(other, cidrRange) {\n var ref;\n if (cidrRange === void 0) {\n ref = other, other = ref[0], cidrRange = ref[1];\n }\n if (other.kind() !== 'ipv6') {\n throw new Error(\"ipaddr: cannot match ipv6 address with non-ipv6 one\");\n }\n return matchCIDR(this.parts, other.parts, 16, cidrRange);\n };\n\n IPv6.prototype.SpecialRanges = {\n unspecified: [new IPv6([0, 0, 0, 0, 0, 0, 0, 0]), 128],\n linkLocal: [new IPv6([0xfe80, 0, 0, 0, 0, 0, 0, 0]), 10],\n multicast: [new IPv6([0xff00, 0, 0, 0, 0, 0, 0, 0]), 8],\n loopback: [new IPv6([0, 0, 0, 0, 0, 0, 0, 1]), 128],\n uniqueLocal: [new IPv6([0xfc00, 0, 0, 0, 0, 0, 0, 0]), 7],\n ipv4Mapped: [new IPv6([0, 0, 0, 0, 0, 0xffff, 0, 0]), 96],\n rfc6145: [new IPv6([0, 0, 0, 0, 0xffff, 0, 0, 0]), 96],\n rfc6052: [new IPv6([0x64, 0xff9b, 0, 0, 0, 0, 0, 0]), 96],\n '6to4': [new IPv6([0x2002, 0, 0, 0, 0, 0, 0, 0]), 16],\n teredo: [new IPv6([0x2001, 0, 0, 0, 0, 0, 0, 0]), 32],\n reserved: [[new IPv6([0x2001, 0xdb8, 0, 0, 0, 0, 0, 0]), 32]]\n };\n\n IPv6.prototype.range = function() {\n return ipaddr.subnetMatch(this, this.SpecialRanges);\n };\n\n IPv6.prototype.isIPv4MappedAddress = function() {\n return this.range() === 'ipv4Mapped';\n };\n\n IPv6.prototype.toIPv4Address = function() {\n var high, low, ref;\n if (!this.isIPv4MappedAddress()) {\n throw new Error(\"ipaddr: trying to convert a generic ipv6 address to ipv4\");\n }\n ref = this.parts.slice(-2), high = ref[0], low = ref[1];\n return new ipaddr.IPv4([high >> 8, high & 0xff, low >> 8, low & 0xff]);\n };\n\n IPv6.prototype.prefixLengthFromSubnetMask = function() {\n var cidr, i, k, part, stop, zeros, zerotable;\n zerotable = {\n 0: 16,\n 32768: 15,\n 49152: 14,\n 57344: 13,\n 61440: 12,\n 63488: 11,\n 64512: 10,\n 65024: 9,\n 65280: 8,\n 65408: 7,\n 65472: 6,\n 65504: 5,\n 65520: 4,\n 65528: 3,\n 65532: 2,\n 65534: 1,\n 65535: 0\n };\n cidr = 0;\n stop = false;\n for (i = k = 7; k >= 0; i = k += -1) {\n part = this.parts[i];\n if (part in zerotable) {\n zeros = zerotable[part];\n if (stop && zeros !== 0) {\n return null;\n }\n if (zeros !== 16) {\n stop = true;\n }\n cidr += zeros;\n } else {\n return null;\n }\n }\n return 128 - cidr;\n };\n\n return IPv6;\n\n })();\n\n ipv6Part = \"(?:[0-9a-f]+::?)+\";\n\n zoneIndex = \"%[0-9a-z]{1,}\";\n\n ipv6Regexes = {\n zoneIndex: new RegExp(zoneIndex, 'i'),\n \"native\": new RegExp(\"^(::)?(\" + ipv6Part + \")?([0-9a-f]+)?(::)?(\" + zoneIndex + \")?$\", 'i'),\n transitional: new RegExp((\"^((?:\" + ipv6Part + \")|(?:::)(?:\" + ipv6Part + \")?)\") + (ipv4Part + \"\\\\.\" + ipv4Part + \"\\\\.\" + ipv4Part + \"\\\\.\" + ipv4Part) + (\"(\" + zoneIndex + \")?$\"), 'i')\n };\n\n expandIPv6 = function(string, parts) {\n var colonCount, lastColon, part, replacement, replacementCount, zoneId;\n if (string.indexOf('::') !== string.lastIndexOf('::')) {\n return null;\n }\n zoneId = (string.match(ipv6Regexes['zoneIndex']) || [])[0];\n if (zoneId) {\n zoneId = zoneId.substring(1);\n string = string.replace(/%.+$/, '');\n }\n colonCount = 0;\n lastColon = -1;\n while ((lastColon = string.indexOf(':', lastColon + 1)) >= 0) {\n colonCount++;\n }\n if (string.substr(0, 2) === '::') {\n colonCount--;\n }\n if (string.substr(-2, 2) === '::') {\n colonCount--;\n }\n if (colonCount > parts) {\n return null;\n }\n replacementCount = parts - colonCount;\n replacement = ':';\n while (replacementCount--) {\n replacement += '0:';\n }\n string = string.replace('::', replacement);\n if (string[0] === ':') {\n string = string.slice(1);\n }\n if (string[string.length - 1] === ':') {\n string = string.slice(0, -1);\n }\n parts = (function() {\n var k, len, ref, results;\n ref = string.split(\":\");\n results = [];\n for (k = 0, len = ref.length; k < len; k++) {\n part = ref[k];\n results.push(parseInt(part, 16));\n }\n return results;\n })();\n return {\n parts: parts,\n zoneId: zoneId\n };\n };\n\n ipaddr.IPv6.parser = function(string) {\n var addr, k, len, match, octet, octets, zoneId;\n if (ipv6Regexes['native'].test(string)) {\n return expandIPv6(string, 8);\n } else if (match = string.match(ipv6Regexes['transitional'])) {\n zoneId = match[6] || '';\n addr = expandIPv6(match[1].slice(0, -1) + zoneId, 6);\n if (addr.parts) {\n octets = [parseInt(match[2]), parseInt(match[3]), parseInt(match[4]), parseInt(match[5])];\n for (k = 0, len = octets.length; k < len; k++) {\n octet = octets[k];\n if (!((0 <= octet && octet <= 255))) {\n return null;\n }\n }\n addr.parts.push(octets[0] << 8 | octets[1]);\n addr.parts.push(octets[2] << 8 | octets[3]);\n return {\n parts: addr.parts,\n zoneId: addr.zoneId\n };\n }\n }\n return null;\n };\n\n ipaddr.IPv4.isIPv4 = ipaddr.IPv6.isIPv6 = function(string) {\n return this.parser(string) !== null;\n };\n\n ipaddr.IPv4.isValid = function(string) {\n var e;\n try {\n new this(this.parser(string));\n return true;\n } catch (error1) {\n e = error1;\n return false;\n }\n };\n\n ipaddr.IPv4.isValidFourPartDecimal = function(string) {\n if (ipaddr.IPv4.isValid(string) && string.match(/^(0|[1-9]\\d*)(\\.(0|[1-9]\\d*)){3}$/)) {\n return true;\n } else {\n return false;\n }\n };\n\n ipaddr.IPv6.isValid = function(string) {\n var addr, e;\n if (typeof string === \"string\" && string.indexOf(\":\") === -1) {\n return false;\n }\n try {\n addr = this.parser(string);\n new this(addr.parts, addr.zoneId);\n return true;\n } catch (error1) {\n e = error1;\n return false;\n }\n };\n\n ipaddr.IPv4.parse = function(string) {\n var parts;\n parts = this.parser(string);\n if (parts === null) {\n throw new Error(\"ipaddr: string is not formatted like ip address\");\n }\n return new this(parts);\n };\n\n ipaddr.IPv6.parse = function(string) {\n var addr;\n addr = this.parser(string);\n if (addr.parts === null) {\n throw new Error(\"ipaddr: string is not formatted like ip address\");\n }\n return new this(addr.parts, addr.zoneId);\n };\n\n ipaddr.IPv4.parseCIDR = function(string) {\n var maskLength, match, parsed;\n if (match = string.match(/^(.+)\\/(\\d+)$/)) {\n maskLength = parseInt(match[2]);\n if (maskLength >= 0 && maskLength <= 32) {\n parsed = [this.parse(match[1]), maskLength];\n Object.defineProperty(parsed, 'toString', {\n value: function() {\n return this.join('/');\n }\n });\n return parsed;\n }\n }\n throw new Error(\"ipaddr: string is not formatted like an IPv4 CIDR range\");\n };\n\n ipaddr.IPv4.subnetMaskFromPrefixLength = function(prefix) {\n var filledOctetCount, j, octets;\n prefix = parseInt(prefix);\n if (prefix < 0 || prefix > 32) {\n throw new Error('ipaddr: invalid IPv4 prefix length');\n }\n octets = [0, 0, 0, 0];\n j = 0;\n filledOctetCount = Math.floor(prefix / 8);\n while (j < filledOctetCount) {\n octets[j] = 255;\n j++;\n }\n if (filledOctetCount < 4) {\n octets[filledOctetCount] = Math.pow(2, prefix % 8) - 1 << 8 - (prefix % 8);\n }\n return new this(octets);\n };\n\n ipaddr.IPv4.broadcastAddressFromCIDR = function(string) {\n var cidr, error, i, ipInterfaceOctets, octets, subnetMaskOctets;\n try {\n cidr = this.parseCIDR(string);\n ipInterfaceOctets = cidr[0].toByteArray();\n subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray();\n octets = [];\n i = 0;\n while (i < 4) {\n octets.push(parseInt(ipInterfaceOctets[i], 10) | parseInt(subnetMaskOctets[i], 10) ^ 255);\n i++;\n }\n return new this(octets);\n } catch (error1) {\n error = error1;\n throw new Error('ipaddr: the address does not have IPv4 CIDR format');\n }\n };\n\n ipaddr.IPv4.networkAddressFromCIDR = function(string) {\n var cidr, error, i, ipInterfaceOctets, octets, subnetMaskOctets;\n try {\n cidr = this.parseCIDR(string);\n ipInterfaceOctets = cidr[0].toByteArray();\n subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray();\n octets = [];\n i = 0;\n while (i < 4) {\n octets.push(parseInt(ipInterfaceOctets[i], 10) & parseInt(subnetMaskOctets[i], 10));\n i++;\n }\n return new this(octets);\n } catch (error1) {\n error = error1;\n throw new Error('ipaddr: the address does not have IPv4 CIDR format');\n }\n };\n\n ipaddr.IPv6.parseCIDR = function(string) {\n var maskLength, match, parsed;\n if (match = string.match(/^(.+)\\/(\\d+)$/)) {\n maskLength = parseInt(match[2]);\n if (maskLength >= 0 && maskLength <= 128) {\n parsed = [this.parse(match[1]), maskLength];\n Object.defineProperty(parsed, 'toString', {\n value: function() {\n return this.join('/');\n }\n });\n return parsed;\n }\n }\n throw new Error(\"ipaddr: string is not formatted like an IPv6 CIDR range\");\n };\n\n ipaddr.isValid = function(string) {\n return ipaddr.IPv6.isValid(string) || ipaddr.IPv4.isValid(string);\n };\n\n ipaddr.parse = function(string) {\n if (ipaddr.IPv6.isValid(string)) {\n return ipaddr.IPv6.parse(string);\n } else if (ipaddr.IPv4.isValid(string)) {\n return ipaddr.IPv4.parse(string);\n } else {\n throw new Error(\"ipaddr: the address has neither IPv6 nor IPv4 format\");\n }\n };\n\n ipaddr.parseCIDR = function(string) {\n var e;\n try {\n return ipaddr.IPv6.parseCIDR(string);\n } catch (error1) {\n e = error1;\n try {\n return ipaddr.IPv4.parseCIDR(string);\n } catch (error1) {\n e = error1;\n throw new Error(\"ipaddr: the address has neither IPv6 nor IPv4 CIDR format\");\n }\n }\n };\n\n ipaddr.fromByteArray = function(bytes) {\n var length;\n length = bytes.length;\n if (length === 4) {\n return new ipaddr.IPv4(bytes);\n } else if (length === 16) {\n return new ipaddr.IPv6(bytes);\n } else {\n throw new Error(\"ipaddr: the binary input is neither an IPv6 nor IPv4 address\");\n }\n };\n\n ipaddr.process = function(string) {\n var addr;\n addr = this.parse(string);\n if (addr.kind() === 'ipv6' && addr.isIPv4MappedAddress()) {\n return addr.toIPv4Address();\n } else {\n return addr;\n }\n };\n\n}).call(this);\n","/**\n * Created by elgs on 3/5/16.\n */\nconst normalize = function (a) {\n if (!_validate(a)) {\n throw new Error('Invalid address: ' + a);\n }\n a = a.toLowerCase()\n\n const nh = a.split(/\\:\\:/g);\n if (nh.length > 2) {\n throw new Error('Invalid address: ' + a);\n }\n\n let sections = [];\n if (nh.length == 1) {\n // full mode\n sections = a.split(/\\:/g);\n if (sections.length !== 8) {\n throw new Error('Invalid address: ' + a);\n }\n } else if (nh.length == 2) {\n // compact mode\n const n = nh[0];\n const h = nh[1];\n const ns = n.split(/\\:/g);\n const hs = h.split(/\\:/g);\n for (let i in ns) {\n sections[i] = ns[i];\n }\n for (let i = hs.length; i > 0; --i) {\n sections[7 - (hs.length - i)] = hs[i - 1];\n }\n }\n for (let i = 0; i < 8; ++i) {\n if (sections[i] === undefined) {\n sections[i] = '0000';\n }\n sections[i] = _leftPad(sections[i], '0', 4);\n }\n return sections.join(':');\n};\n\nconst abbreviate = function (a) {\n if (!_validate(a)) {\n throw new Error('Invalid address: ' + a);\n }\n a = normalize(a);\n a = a.replace(/0000/g, 'g');\n a = a.replace(/\\:000/g, ':');\n a = a.replace(/\\:00/g, ':');\n a = a.replace(/\\:0/g, ':');\n a = a.replace(/g/g, '0');\n const sections = a.split(/\\:/g);\n let zPreviousFlag = false;\n let zeroStartIndex = -1;\n let zeroLength = 0;\n let zStartIndex = -1;\n let zLength = 0;\n for (let i = 0; i < 8; ++i) {\n const section = sections[i];\n let zFlag = (section === '0');\n if (zFlag && !zPreviousFlag) {\n zStartIndex = i;\n }\n if (!zFlag && zPreviousFlag) {\n zLength = i - zStartIndex;\n }\n if (zLength > 1 && zLength > zeroLength) {\n zeroStartIndex = zStartIndex;\n zeroLength = zLength;\n }\n zPreviousFlag = (section === '0');\n }\n if (zPreviousFlag) {\n zLength = 8 - zStartIndex;\n }\n if (zLength > 1 && zLength > zeroLength) {\n zeroStartIndex = zStartIndex;\n zeroLength = zLength;\n }\n //console.log(zeroStartIndex, zeroLength);\n //console.log(sections);\n if (zeroStartIndex >= 0 && zeroLength > 1) {\n sections.splice(zeroStartIndex, zeroLength, 'g');\n }\n //console.log(sections);\n a = sections.join(':');\n //console.log(a);\n a = a.replace(/\\:g\\:/g, '::');\n a = a.replace(/\\:g/g, '::');\n a = a.replace(/g\\:/g, '::');\n a = a.replace(/g/g, '::');\n //console.log(a);\n return a;\n};\n\n// Basic validation\nconst _validate = function (a) {\n return /^[a-f0-9\\\\:]+$/ig.test(a);\n};\n\nconst _leftPad = function (d, p, n) {\n const padding = p.repeat(n);\n if (d.length < padding.length) {\n d = padding.substring(0, padding.length - d.length) + d;\n }\n return d;\n};\n\nconst _hex2bin = function (hex) {\n return parseInt(hex, 16).toString(2)\n};\nconst _bin2hex = function (bin) {\n return parseInt(bin, 2).toString(16)\n};\n\nconst _addr2bin = function (addr) {\n const nAddr = normalize(addr);\n const sections = nAddr.split(\":\");\n let binAddr = '';\n for (const section of sections) {\n binAddr += _leftPad(_hex2bin(section), '0', 16);\n }\n return binAddr;\n};\n\nconst _bin2addr = function (bin) {\n const addr = [];\n for (let i = 0; i < 8; ++i) {\n const binPart = bin.substr(i * 16, 16);\n const hexSection = _leftPad(_bin2hex(binPart), '0', 4);\n addr.push(hexSection);\n }\n return addr.join(':');\n};\n\nconst divideSubnet = function (addr, mask0, mask1, limit, abbr) {\n if (!_validate(addr)) {\n throw new Error('Invalid address: ' + addr);\n }\n mask0 *= 1;\n mask1 *= 1;\n limit *= 1;\n mask1 = mask1 || 128;\n if (mask0 < 1 || mask1 < 1 || mask0 > 128 || mask1 > 128 || mask0 > mask1) {\n throw new Error('Invalid masks.');\n }\n const ret = [];\n const binAddr = _addr2bin(addr);\n const binNetPart = binAddr.substr(0, mask0);\n const binHostPart = '0'.repeat(128 - mask1);\n const numSubnets = Math.pow(2, mask1 - mask0);\n for (let i = 0; i < numSubnets; ++i) {\n if (!!limit && i >= limit) {\n break;\n }\n const binSubnet = _leftPad(i.toString(2), '0', mask1 - mask0);\n const binSubAddr = binNetPart + binSubnet + binHostPart;\n const hexAddr = _bin2addr(binSubAddr);\n if (!!abbr) {\n ret.push(abbreviate(hexAddr));\n } else {\n ret.push(hexAddr);\n }\n\n }\n // console.log(numSubnets);\n // console.log(binNetPart, binSubnetPart, binHostPart);\n // console.log(binNetPart.length, binSubnetPart.length, binHostPart.length);\n // console.log(ret.length);\n return ret;\n};\n\nconst range = function (addr, mask0, mask1, abbr) {\n if (!_validate(addr)) {\n throw new Error('Invalid address: ' + addr);\n }\n mask0 *= 1;\n mask1 *= 1;\n mask1 = mask1 || 128;\n if (mask0 < 1 || mask1 < 1 || mask0 > 128 || mask1 > 128 || mask0 > mask1) {\n throw new Error('Invalid masks.');\n }\n const binAddr = _addr2bin(addr);\n const binNetPart = binAddr.substr(0, mask0);\n const binHostPart = '0'.repeat(128 - mask1);\n const binStartAddr = binNetPart + '0'.repeat(mask1 - mask0) + binHostPart;\n const binEndAddr = binNetPart + '1'.repeat(mask1 - mask0) + binHostPart;\n if (!!abbr) {\n return {\n start: abbreviate(_bin2addr(binStartAddr)),\n end: abbreviate(_bin2addr(binEndAddr)),\n size: Math.pow(2, mask1 - mask0)\n };\n } else {\n return {\n start: _bin2addr(binStartAddr),\n end: _bin2addr(binEndAddr),\n size: Math.pow(2, mask1 - mask0)\n };\n }\n};\n\nconst randomSubnet = function (addr, mask0, mask1, limit, abbr) {\n if (!_validate(addr)) {\n throw new Error('Invalid address: ' + addr);\n }\n mask0 *= 1;\n mask1 *= 1;\n limit *= 1;\n mask1 = mask1 || 128;\n limit = limit || 1;\n if (mask0 < 1 || mask1 < 1 || mask0 > 128 || mask1 > 128 || mask0 > mask1) {\n throw new Error('Invalid masks.');\n }\n const ret = [];\n const binAddr = _addr2bin(addr);\n const binNetPart = binAddr.substr(0, mask0);\n const binHostPart = '0'.repeat(128 - mask1);\n const numSubnets = Math.pow(2, mask1 - mask0);\n for (let i = 0; i < numSubnets && i < limit; ++i) {\n // generate an binary string with length of mask1 - mask0\n let binSubnet = '';\n for (let j = 0; j < mask1 - mask0; ++j) {\n binSubnet += Math.floor(Math.random() * 2);\n }\n const binSubAddr = binNetPart + binSubnet + binHostPart;\n const hexAddr = _bin2addr(binSubAddr);\n if (!!abbr) {\n ret.push(abbreviate(hexAddr));\n } else {\n ret.push(hexAddr);\n }\n }\n // console.log(numSubnets);\n // console.log(binNetPart, binSubnetPart, binHostPart);\n // console.log(binNetPart.length, binSubnetPart.length, binHostPart.length);\n // console.log(ret.length);\n return ret;\n};\n\nconst ptr = function (addr, mask) {\n if (!_validate(addr)) {\n throw new Error('Invalid address: ' + addr);\n }\n mask *= 1;\n if (mask < 1 || mask > 128 || Math.floor(mask / 4) != mask / 4) {\n throw new Error('Invalid masks.');\n }\n const fullAddr = normalize(addr);\n const reverse = fullAddr.replace(/:/g, '').split('').reverse();\n return reverse.slice(0, (128 - mask) / 4).join('.');\n};\n\nif (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {\n exports.normalize = normalize;\n exports.abbreviate = abbreviate;\n exports.divideSubnet = divideSubnet;\n exports.range = range;\n exports.randomSubnet = randomSubnet;\n exports.ptr = ptr;\n} else {\n window.normalize = normalize;\n window.abbreviate = abbreviate;\n window.divideSubnet = divideSubnet;\n window.range = range;\n window.randomSubnet = randomSubnet;\n window.ptr = ptr;\n}\n","import ipaddr from 'ipaddr.js';\n// @ts-ignore: Can't find a @types/ip6 package\nimport ip6 from 'ip6';\n\nexport function isIP(addr: string) {\n return ipaddr.isValid(addr);\n}\n\nexport function version(addr: string): number {\n try {\n const parse_addr = ipaddr.parse(addr);\n const kind = parse_addr.kind();\n\n if (kind === 'ipv4') {\n return 4; //IPv4\n } else if (kind === 'ipv6') {\n return 6; //IPv6\n } else {\n /* istanbul ignore next */\n return 0; //not 4 or 6\n }\n } catch (err) {\n return 0; //not 4 or 6\n }\n}\n\nexport function isV4(addr: string) {\n return version(addr) === 4;\n}\n\nexport function isV6(addr: string) {\n return version(addr) === 6;\n}\n\nexport function isRange(range: string) {\n try {\n const cidr = ipaddr.parseCIDR(range);\n return true;\n } catch (err) {\n return false;\n }\n}\n\nexport function inRange(addr: string, range: string | string[]) {\n if (typeof range === 'string') {\n if (range.indexOf('/') !== -1) {\n try {\n const range_data = range.split('/');\n\n const parse_addr = ipaddr.parse(addr);\n const parse_range = ipaddr.parse(range_data[0]);\n\n //@ts-ignore: It works.\n return parse_addr.match(parse_range, range_data[1]);\n } catch (err) {\n return false;\n }\n } else {\n addr = isV6(addr) ? ip6.normalize(addr) : addr; //v6 normalize addr\n range = isV6(range) ? ip6.normalize(range) : range; //v6 normalize range\n\n return isIP(range as string) && addr === range;\n }\n } else if (range && typeof range === 'object') {\n //list\n for (const check_range in range) {\n if (inRange(addr, range[check_range]) === true) {\n return true;\n }\n }\n return false;\n } else {\n return false;\n }\n}\n\nexport function storeIP(addr: string) {\n try {\n var parse_addr = ipaddr.parse(addr);\n var kind = parse_addr.kind();\n\n if (kind === 'ipv4') {\n //is a plain v4 address\n return addr;\n } else if (kind === 'ipv6') {\n //@ts-ignore: it exists!\n if (parse_addr.isIPv4MappedAddress()) {\n //convert v4 mapped to v6 addresses to a v4 in it's original format\n //@ts-ignore: it exists!\n return parse_addr.toIPv4Address().toString();\n } //is a v6, abbreviate it\n else {\n return ip6.abbreviate(addr);\n }\n } else {\n return null; //invalid IP address\n }\n } catch (err) {\n return null; //invalid IP address\n }\n}\n\n// searchIP is a aliases of storeIP\nexport { storeIP as searchIP };\n\nexport function displayIP(addr: string) {\n try {\n var parse_addr = ipaddr.parse(addr);\n var kind = parse_addr.kind();\n\n if (kind === 'ipv4') {\n //is a plain v4 address\n return addr;\n } else if (kind === 'ipv6') {\n //@ts-ignore: it exists!\n if (parse_addr.isIPv4MappedAddress()) {\n //convert v4 mapped to v6 addresses to a v4 in it's original format\n //@ts-ignore: it exists!\n return parse_addr.toIPv4Address().toString();\n } //is a v6, normalize it\n else {\n return ip6.normalize(addr);\n }\n } else {\n return ''; //invalid IP address\n }\n } catch (err) {\n return ''; //invalid IP address\n }\n}\n","/**\n * All event listeners\n *\n * https://developers.facebook.com/docs/meta-pixel/reference\n * */\n\n// Load pixel event\njQuery(document).on(\"wpmLoadPixels\", () => {\n\n\tif (\n\t\twpmDataLayer?.pixels?.facebook?.pixel_id\n\t\t&& !wpmDataLayer?.pixels?.facebook?.loaded\n\t\t&& !wpm.doesUrlContainPatterns(wpmDataLayer?.pixels?.facebook?.exclusion_patterns)\n\t) {\n\t\tif (wpm.canIFire(\"ads\", \"facebook-ads\")) wpm.loadFacebookPixel()\n\t}\n})\n\n// AddToCart event\n// https://developers.facebook.com/docs/meta-pixel/reference\njQuery(document).on(\"wpmClientSideAddToCart\", (event, payload) => {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\tfbq(\"track\", \"AddToCart\", payload.facebook.custom_data, {\n\t\t\teventID: payload.facebook.event_id,\n\t\t})\n\t} catch (error) {\n\t\tconsole.error(error)\n\t}\n})\n\n// InitiateCheckout event\n// https://developers.facebook.com/docs/meta-pixel/reference\njQuery(document).on(\"wpmClientSideBeginCheckout\", (event, payload) => {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\tfbq(\"track\", \"InitiateCheckout\", payload.facebook.custom_data, {\n\t\t\teventID: payload.facebook.event_id,\n\t\t})\n\t} catch (error) {\n\t\tconsole.error(error)\n\t}\n})\n\n// AddToWishlist event\n// https://developers.facebook.com/docs/meta-pixel/reference\njQuery(document).on(\"wpmClientSideAddToWishlist\", (event, payload) => {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\tfbq(\"track\", \"AddToWishlist\", payload.facebook.custom_data, {\n\t\t\teventID: payload.facebook.event_id,\n\t\t})\n\t} catch (error) {\n\t\tconsole.error(error)\n\t}\n})\n\n// ViewContent event\n// https://developers.facebook.com/docs/meta-pixel/reference\njQuery(document).on(\"wpmClientSideViewItem\", (event, payload) => {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\tfbq(\"track\", \"ViewContent\", payload.facebook.custom_data, {\n\t\t\teventID: payload.facebook.event_id,\n\t\t})\n\t} catch (error) {\n\t\tconsole.error(error)\n\t}\n})\n\n\n// view search event\n// https://developers.facebook.com/docs/meta-pixel/reference\njQuery(document).on(\"wpmClientSideSearch\", (event, payload) => {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\tfbq(\"track\", \"Search\", payload.facebook.custom_data, {\n\t\t\teventID: payload.facebook.event_id,\n\t\t})\n\t} catch (error) {\n\t\tconsole.error(error)\n\t}\n})\n\n// load always event\njQuery(document).on(\"wpmLoadAlways\", () => {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\twpm.setFbUserData()\n\t} catch (error) {\n\t\tconsole.error(error)\n\t}\n})\n\n// view order received page event\n// https://developers.facebook.com/docs/meta-pixel/reference\njQuery(document).on(\"wpmClientSideOrderReceivedPage\", (event, payload) => {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\tfbq(\"track\", \"Purchase\", payload.facebook.custom_data, {\n\t\t\teventID: payload.facebook.event_id,\n\t\t})\n\t} catch (error) {\n\t\tconsole.error(error)\n\t}\n})\n","/**\n * Add functions for Facebook\n * */\n\n(function (wpm, $, undefined) {\n\n\tlet fbUserData\n\n\twpm.fbeventsJsUrl = () => {\n\n\t\tlet searchParams = new URLSearchParams(window.location.search)\n\n\t\tif (searchParams.has(\"fbevents-version\")) {\n\t\t\treturn `https://connect.facebook.net/en_US/fbevents.js?v=${searchParams.get(\"fbevents-version\")}`\n\t\t}\n\n\t\treturn wpmDataLayer?.pixels?.facebook?.fbevents_js_url\n\t}\n\n\twpm.loadFacebookPixel = () => {\n\n\t\ttry {\n\t\t\twpmDataLayer.pixels.facebook.loaded = true\n\n\t\t\t// @formatter:off\n\t\t\t!function(f,b,e,v,n,t,s)\n\t\t\t{if(f.fbq)return;n=f.fbq=function(){n.callMethod?\n\t\t\t\tn.callMethod.apply(n,arguments):n.queue.push(arguments)};\n\t\t\t\tif(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';\n\t\t\t\tn.queue=[];t=b.createElement(e);t.async=!0;\n\t\t\t\tt.src=v;s=b.getElementsByTagName(e)[0];\n\t\t\t\ts.parentNode.insertBefore(t,s)}(window, document,'script',\n\t\t\t\twpm.fbeventsJsUrl());\n\t\t\t// @formatter:on\n\n\t\t\tlet data = {}\n\n\t\t\t// Add user identifiers to data,\n\t\t\t// and only if fbp was set\n\t\t\tif (wpm.isFbpSet() && wpm.isFbAdvancedMatchingEnabled()) {\n\t\t\t\tdata = {...wpm.getUserIdentifiersForFb()}\n\t\t\t}\n\n\t\t\t// https://developers.facebook.com/docs/meta-pixel/advanced/#automatic-configuration\n\t\t\t// fbq(\"set\", \"autoConfig\", false, wpmDataLayer.pixels.facebook.pixel_id)\n\n\t\t\t// Initialize the Facebook Pixel and send the first PageView event\n\t\t\tfbq(\"init\", wpmDataLayer.pixels.facebook.pixel_id, data)\n\n\t\t\tif (wpmDataLayer?.pixels?.facebook?.mobile_bridge_app_id) {\n\t\t\t\tfbq(\"set\", \"mobileBridge\", wpmDataLayer.pixels.facebook.pixel_id, wpmDataLayer?.pixels?.facebook?.mobile_bridge_app_id)\n\t\t\t}\n\n\t\t\tfbq(\"track\", \"PageView\")\n\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\t// https://developers.facebook.com/docs/meta-pixel/advanced/advanced-matching\n\twpm.getUserIdentifiersForFb = () => {\n\n\t\tlet data = {}\n\n\t\t// external ID\n\t\tif (wpmDataLayer?.user?.id?.raw) data.external_id = wpmDataLayer.user.id.raw\n\t\tif (wpmDataLayer?.order?.user_id) data.external_id = wpmDataLayer.order.user_id\n\n\t\t// email\n\t\tif (wpmDataLayer?.user?.email?.facebook) data.em = wpmDataLayer.user.email.facebook\n\t\tif (wpmDataLayer?.order?.billing_email_hashed) data.em = wpmDataLayer.order.billing_email_hashed\n\n\t\t// first name\n\t\tif (wpmDataLayer?.user?.first_name?.facebook) data.fn = wpmDataLayer.user.first_name.facebook\n\t\tif (wpmDataLayer?.order?.billing_first_name) data.fn = wpmDataLayer.order.billing_first_name.toLowerCase()\n\n\t\t// last name\n\t\tif (wpmDataLayer?.user?.last_name?.facebook) data.ln = wpmDataLayer.user.last_name.facebook\n\t\tif (wpmDataLayer?.order?.billing_last_name) data.ln = wpmDataLayer.order.billing_last_name.toLowerCase()\n\n\t\t// phone\n\t\tif (wpmDataLayer?.user?.phone?.facebook) data.ph = wpmDataLayer.user.phone.facebook\n\t\tif (wpmDataLayer?.order?.billing_phone) data.ph = wpmDataLayer.order.billing_phone.replace(\"+\", \"\")\n\n\t\t// city\n\t\tif (wpmDataLayer?.user?.city?.facebook) data.ct = wpmDataLayer.user.city.facebook\n\t\tif (wpmDataLayer?.order?.billing_city) data.ct = wpmDataLayer.order.billing_city.toLowerCase().replace(/ /g, \"\")\n\n\t\t// state\n\t\tif (wpmDataLayer?.user?.state?.facebook) data.st = wpmDataLayer.user.state.facebook\n\t\tif (wpmDataLayer?.order?.billing_state) data.st = wpmDataLayer.order.billing_state.toLowerCase().replace(/[a-zA-Z]{2}-/, \"\")\n\n\t\t// postcode\n\t\tif (wpmDataLayer?.user?.postcode?.facebook) data.zp = wpmDataLayer.user.postcode.facebook\n\t\tif (wpmDataLayer?.order?.billing_postcode) data.zp = wpmDataLayer.order.billing_postcode\n\n\t\t// country\n\t\tif (wpmDataLayer?.user?.country?.facebook) data.country = wpmDataLayer.user.country.facebook\n\t\tif (wpmDataLayer?.order?.billing_country) data.country = wpmDataLayer.order.billing_country.toLowerCase()\n\n\t\treturn data\n\t}\n\n\twpm.getFbRandomEventId = () => (Math.random() + 1).toString(36).substring(2)\n\n\twpm.getFbUserData = () => {\n\n\t\t/**\n\t\t * We need to cache the FB user data for InitiateCheckout\n\t\t * where getting the user data from the browser is too slow\n\t\t * using wpm.getCookie().\n\t\t *\n\t\t * And we need the object merge because the ViewContent hit happens too fast\n\t\t * after adding a variation to the cart because the function to cache\n\t\t * the user data is too slow.\n\t\t *\n\t\t * But we can get the user_data using wpm.getCookie()\n\t\t * because we don't move away from the page and can wait for the browser\n\t\t * to get it.\n\t\t *\n\t\t * Also, the merge ensures that new data will be added to fbUserData if new\n\t\t * data is being added later, like user ID, or fbc.\n\t\t */\n\n\t\tfbUserData = {...fbUserData, ...wpm.getFbUserDataFromBrowser()}\n\n\t\treturn fbUserData\n\t}\n\n\twpm.isFbAdvancedMatchingEnabled = () => {\n\t\tif (wpmDataLayer?.pixels?.facebook?.advanced_matching) {\n\t\t\treturn true\n\t\t}\n\n\t\treturn false\n\t}\n\n\twpm.setFbUserData = () => {\n\t\tfbUserData = wpm.getFbUserDataFromBrowser()\n\t}\n\n\twpm.getFbUserDataFromBrowser = () => {\n\n\t\tlet\n\t\t\tdata = {}\n\n\t\tif (wpm.getCookie(\"_fbp\") && wpm.isValidFbp(wpm.getCookie(\"_fbp\"))) {\n\t\t\tdata.fbp = wpm.getCookie(\"_fbp\")\n\t\t}\n\n\t\tif (wpm.getCookie(\"_fbc\") && wpm.isValidFbc(wpm.getCookie(\"_fbc\"))) {\n\t\t\tdata.fbc = wpm.getCookie(\"_fbc\")\n\t\t}\n\n\t\tif (wpm.isFbAdvancedMatchingEnabled()) {\n\t\t\tif (wpmDataLayer?.user?.id?.raw) data.external_id = wpmDataLayer.user.id.raw\n\t\t}\n\n\t\tif (navigator.userAgent) data.client_user_agent = navigator.userAgent\n\n\t\treturn data\n\t}\n\n\twpm.isFbpSet = () => {\n\t\treturn !!wpm.getCookie(\"_fbp\")\n\t}\n\n\t// https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/fbp-and-fbc/\n\twpm.isValidFbp = fbp => {\n\n\t\tlet re = new RegExp(/^fb\\.[0-2]\\.\\d{13}\\.\\d{8,20}$/)\n\n\t\treturn re.test(fbp)\n\t}\n\n\t// https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/fbp-and-fbc/\n\twpm.isValidFbc = fbc => {\n\n\t\tlet re = new RegExp(/^fb\\.[0-2]\\.\\d{13}\\.[\\da-zA-Z_-]{8,}/)\n\n\t\treturn re.test(fbc)\n\t}\n\n\t// wpm.fbViewContent = (product = null) => {\n\t//\n\t// \ttry {\n\t// \t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\t//\n\t// \t\tlet eventId = wpm.getFbRandomEventId()\n\t//\n\t// \t\tlet data = {}\n\t//\n\t// \t\tif (product) {\n\t// \t\t\tdata.content_type = \"product\"\n\t// \t\t\tdata.content_name = product.name\n\t// \t\t\t// data.content_category = product.category\n\t// \t\t\tdata.content_ids = product.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type]\n\t// \t\t\tdata.currency = wpmDataLayer.shop.currency\n\t// \t\t\tdata.value = product.price\n\t// \t\t}\n\t//\n\t// \t\tfbq(\"track\", \"ViewContent\", data, {\n\t// \t\t\teventID: eventId,\n\t// \t\t})\n\t//\n\t// \t\tlet capiData = {\n\t// \t\t\tevent_name : \"ViewContent\",\n\t// \t\t\tevent_id : eventId,\n\t// \t\t\tuser_data : wpm.getFbUserData(),\n\t// \t\t\tevent_source_url: window.location.href,\n\t// \t\t}\n\t//\n\t// \t\tif (product) {\n\t// \t\t\tproduct[\"currency\"] = wpmDataLayer.shop.currency\n\t// \t\t\tcapiData.custom_data = wpm.fbGetProductDataForCapiEvent(product)\n\t// \t\t}\n\t//\n\t// \t\tjQuery(document).trigger(\"wpmFbCapiEvent\", capiData)\n\t// \t} catch (e) {\n\t// \t\tconsole.error(e)\n\t// \t}\n\t// }\n\n\twpm.fbGetProductDataForCapiEvent = product => {\n\t\treturn {\n\t\t\tcontent_type: \"product\",\n\t\t\tcontent_name: product.name,\n\t\t\tcontent_ids : [\n\t\t\t\tproduct.dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type],\n\t\t\t],\n\t\t\tvalue : parseFloat(product.quantity * product.price),\n\t\t\tcurrency : product.currency,\n\t\t}\n\t}\n\n\twpm.facebookContentIds = () => {\n\t\tlet prodIds = []\n\n\t\tObject.values(wpmDataLayer.order.items).forEach(item => {\n\t\t\tif (wpmDataLayer?.general?.variationsOutput && 0 !== item.variation_id) {\n\t\t\t\tprodIds.push(String(wpmDataLayer.products[item.variation_id].dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type]))\n\t\t\t} else {\n\t\t\t\tprodIds.push(String(wpmDataLayer.products[item.id].dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type]))\n\t\t\t}\n\t\t})\n\n\t\treturn prodIds\n\t}\n\n\twpm.trackCustomFacebookEvent = (eventName, customData = {}) => {\n\t\ttry {\n\t\t\tif (!wpmDataLayer?.pixels?.facebook?.loaded) return\n\n\t\t\tlet eventId = wpm.getFbRandomEventId()\n\n\t\t\tfbq(\"trackCustom\", eventName, customData, {\n\t\t\t\teventID: eventId,\n\t\t\t})\n\n\t\t\tjQuery(document).trigger(\"wpmFbCapiEvent\", {\n\t\t\t\tevent_name : eventName,\n\t\t\t\tevent_id : eventId,\n\t\t\t\tuser_data : wpm.getFbUserData(),\n\t\t\t\tevent_source_url: window.location.href,\n\t\t\t\tcustom_data : customData,\n\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.fbGetContentIdsFromCart = () => {\n\n\t\tlet content_ids = []\n\n\t\tfor (const key in wpmDataLayer.cart) {\n\t\t\tcontent_ids.push(wpmDataLayer.products[key].dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type])\n\t\t}\n\n\t\treturn content_ids\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery));\n","/**\n * Facebook loader\n */\n\nrequire(\"./functions\")\nrequire(\"./event_listeners\")\n\n// #if process.env.TIER === 'premium'\n// if (wpm.canLoadPremiumFeatures()) {\n// \trequire(\"./functions_premium\")\n// \trequire(\"./event_listeners_premium\")\n// }\n// #endif\n\n","/**\n * Load Google Ads event listeners\n * */\n\n// view_item_list event\njQuery(document).on(\"wpmViewItemList\", (event, product) => {\n\n\ttry {\n\t\tif (jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return\n\t\tif (!wpmDataLayer?.pixels?.google?.ads?.dynamic_remarketing?.status) return\n\t\tif (!wpm.googleConfigConditionsMet(\"ads\")) return\n\n\n\t\tif (\n\t\t\twpmDataLayer?.general?.variationsOutput &&\n\t\t\tproduct.isVariable &&\n\t\t\twpmDataLayer.pixels.google.ads.dynamic_remarketing.send_events_with_parent_ids === false\n\t\t) return\n\n\t\t// try to prevent that WC sends cached hits to Google\n\t\tif (!product) return\n\n\t\tlet data = {\n\t\t\tsend_to: wpm.getGoogleAdsConversionIdentifiers(),\n\t\t\titems : [{\n\t\t\t\tid : product.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],\n\t\t\t\tgoogle_business_vertical: wpmDataLayer.pixels.google.ads.google_business_vertical,\n\t\t\t}],\n\t\t}\n\n\t\tif (wpmDataLayer?.user?.id?.raw) {\n\t\t\tdata.user_id = wpmDataLayer.user.id.raw\n\t\t}\n\n\t\twpm.gtagLoaded().then(() => {\n\t\t\tgtag(\"event\", \"view_item_list\", data)\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// add_to_cart event\njQuery(document).on(\"wpmAddToCart\", (event, product) => {\n\n\ttry {\n\t\tif (jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return\n\t\tif (!wpmDataLayer?.pixels?.google?.ads?.dynamic_remarketing?.status) return\n\t\tif (!wpm.googleConfigConditionsMet(\"ads\")) return\n\n\t\tlet data = {\n\t\t\tsend_to: wpm.getGoogleAdsConversionIdentifiers(),\n\t\t\tvalue : product.quantity * product.price,\n\t\t\titems : [{\n\t\t\t\tid : product.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],\n\t\t\t\tquantity : product.quantity,\n\t\t\t\tprice : product.price,\n\t\t\t\tgoogle_business_vertical: wpmDataLayer.pixels.google.ads.google_business_vertical,\n\t\t\t}],\n\t\t}\n\n\t\tif (wpmDataLayer?.user?.id?.raw) {\n\t\t\tdata.user_id = wpmDataLayer.user.id.raw\n\t\t}\n\n\t\twpm.gtagLoaded().then(() => {\n\t\t\tgtag(\"event\", \"add_to_cart\", data)\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// view_item event\njQuery(document).on(\"wpmViewItem\", (event, product = null) => {\n\n\ttry {\n\t\tif (jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return\n\t\tif (!wpmDataLayer?.pixels?.google?.ads?.dynamic_remarketing?.status) return\n\t\tif (!wpm.googleConfigConditionsMet(\"ads\")) return\n\n\t\tlet data = {\n\t\t\tsend_to: wpm.getGoogleAdsConversionIdentifiers(),\n\t\t}\n\n\t\tif (product) {\n\t\t\tdata.value = (product.quantity ? product.quantity : 1) * product.price\n\t\t\tdata.items = [{\n\t\t\t\tid : product.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],\n\t\t\t\tquantity : (product.quantity ? product.quantity : 1),\n\t\t\t\tprice : product.price,\n\t\t\t\tgoogle_business_vertical: wpmDataLayer.pixels.google.ads.google_business_vertical,\n\t\t\t}]\n\t\t}\n\n\t\tif (wpmDataLayer?.user?.id?.raw) {\n\t\t\tdata.user_id = wpmDataLayer.user.id.raw\n\t\t}\n\n\t\twpm.gtagLoaded().then(() => {\n\t\t\tgtag(\"event\", \"view_item\", data)\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n\n// view search event\njQuery(document).on(\"pmwEvent:Search\", () => {\n\n\ttry {\n\t\tif (jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return\n\t\tif (!wpmDataLayer?.pixels?.google?.ads?.dynamic_remarketing?.status) return\n\t\tif (!wpm.googleConfigConditionsMet(\"ads\")) return\n\n\n\t\tlet products = []\n\n\t\tObject.values(wpmDataLayer.products).forEach(product => {\n\n\t\t\tif (\n\t\t\t\twpmDataLayer?.general?.variationsOutput &&\n\t\t\t\tproduct.isVariable &&\n\t\t\t\twpmDataLayer.pixels.google.ads.dynamic_remarketing.send_events_with_parent_ids === false\n\t\t\t) return\n\n\t\t\tproducts.push({\n\t\t\t\tid : product.dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type],\n\t\t\t\tgoogle_business_vertical: wpmDataLayer.pixels.google.ads.google_business_vertical,\n\t\t\t})\n\t\t})\n\n\t\t// console.log(products);\n\n\t\tlet data = {\n\t\t\tsend_to: wpm.getGoogleAdsConversionIdentifiers(),\n\t\t\t// value : 1 * product.price,\n\t\t\titems: products,\n\t\t}\n\n\t\tif (wpmDataLayer?.user?.id?.raw) {\n\t\t\tdata.user_id = wpmDataLayer.user.id.raw\n\t\t}\n\n\t\twpm.gtagLoaded().then(() => {\n\t\t\tgtag(\"event\", \"view_search_results\", data)\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n\n// user log in event\njQuery(document).on(\"wpmLogin\", () => {\n\n\ttry {\n\t\tif (jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) return\n\t\tif (!wpmDataLayer?.pixels?.google?.ads?.dynamic_remarketing?.status) return\n\t\tif (!wpm.googleConfigConditionsMet(\"ads\")) return\n\n\t\tlet data = {\n\t\t\tsend_to: wpm.getGoogleAdsConversionIdentifiers(),\n\t\t}\n\n\t\tif (wpmDataLayer?.user?.id?.raw) {\n\t\t\tdata.user_id = wpmDataLayer.user.id.raw\n\t\t}\n\n\t\twpm.gtagLoaded().then(() => {\n\t\t\tgtag(\"event\", \"login\", data)\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n/**\n * Google Ads remarketing purchase\n *\n * https://support.google.com/google-ads/answer/7305793\n */\njQuery(document).on(\"wpmOrderReceivedPage\", () => {\n\n\ttry {\n\t\tif (jQuery.isEmptyObject(wpm.getGoogleAdsConversionIdentifiersWithLabel())) return\n\t\tif (!wpm.googleConfigConditionsMet(\"ads\")) return\n\n\t\tlet data = {\n\t\t\tsend_to: wpm.getGoogleAdsConversionIdentifiers(),\n\t\t\tvalue : wpmDataLayer.order.value_filtered,\n\t\t\t// currency: wpmDataLayer.order.currency,\n\t\t\titems: wpm.getGoogleAdsRegularOrderItems(),\n\t\t}\n\n\t\twpm.gtagLoaded().then(() => {\n\t\t\tgtag(\"event\", \"purchase\", data)\n\t\t})\n\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n/**\n * Google Ads conversion event\n *\n * new_customer parameter: https://support.google.com/google-ads/answer/9917012\n * cart data: https://support.google.com/google-ads/answer/9028614\n * customer_lifetime_value is undocumented, but available in gtag.js\n */\njQuery(document).on(\"wpmOrderReceivedPage\", () => {\n\n\ttry {\n\t\tif (jQuery.isEmptyObject(wpm.getGoogleAdsConversionIdentifiersWithLabel())) return\n\t\tif (!wpm.googleConfigConditionsMet(\"ads\")) return\n\n\t\tlet data = {\n\t\t\tsend_to : wpm.getGoogleAdsConversionIdentifiersWithLabel(),\n\t\t\ttransaction_id: wpmDataLayer.order.number,\n\t\t\tvalue : wpmDataLayer.order.value_filtered,\n\t\t\tcurrency : wpmDataLayer.order.currency,\n\t\t\tnew_customer : wpmDataLayer.order.new_customer,\n\t\t}\n\n\t\tif (wpmDataLayer?.order?.clv_order_value_filtered) {\n\t\t\tdata.customer_lifetime_value = wpmDataLayer.order.clv_order_value_filtered\n\t\t}\n\n\t\tif (wpmDataLayer?.user?.id?.raw) {\n\t\t\tdata.user_id = wpmDataLayer.user.id.raw\n\t\t}\n\n\t\t// https://support.google.com/google-ads/answer/9028614\n\t\tif (wpmDataLayer?.order?.aw_merchant_id) {\n\t\t\tdata.discount = wpmDataLayer.order.discount\n\t\t\tdata.aw_merchant_id = wpmDataLayer.order.aw_merchant_id\n\t\t\tdata.aw_feed_country = wpmDataLayer.order.aw_feed_country\n\t\t\tdata.aw_feed_language = wpmDataLayer.order.aw_feed_language\n\t\t\tdata.items = wpm.getGoogleAdsRegularOrderItems()\n\t\t}\n\n\t\twpm.gtagLoaded().then(() => {\n\t\t\t// Event needs to be \"purchase\" (not \"conversion\") in order to be able to track cart data:\n\t\t\t// https://support.google.com/google-ads/answer/9028614\n\t\t\tgtag(\"event\", \"purchase\", data)\n\t\t})\n\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n","/**\n * Load Google Ads functions\n * */\n\n(function (wpm, $, undefined) {\n\n\n\twpm.getGoogleAdsConversionIdentifiersWithLabel = () => {\n\n\t\tlet conversionIdentifiers = []\n\n\t\tif (wpmDataLayer?.pixels?.google?.ads?.conversionIds) {\n\t\t\tObject.entries(wpmDataLayer.pixels.google.ads.conversionIds).forEach(([key, item]) => {\n\t\t\t\tif (item) {\n\t\t\t\t\tconversionIdentifiers.push(key + \"/\" + item)\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\treturn conversionIdentifiers\n\t}\n\n\twpm.getGoogleAdsConversionIdentifiers = function () {\n\n\t\tlet conversionIdentifiers = []\n\n\t\tObject.keys(wpmDataLayer.pixels.google.ads.conversionIds).forEach((key) => {\n\t\t\tconversionIdentifiers.push(key)\n\t\t})\n\n\t\treturn conversionIdentifiers\n\t}\n\n\twpm.getGoogleAdsRegularOrderItems = () => {\n\n\t\tlet orderItems = []\n\n\t\tObject.values(wpmDataLayer.order.items).forEach((item) => {\n\n\t\t\tlet orderItem\n\n\t\t\torderItem = {\n\t\t\t\tquantity : item.quantity,\n\t\t\t\tprice : item.price,\n\t\t\t\tgoogle_business_vertical: wpmDataLayer.pixels.google.ads.google_business_vertical,\n\t\t\t}\n\n\t\t\tif (wpmDataLayer?.general?.variationsOutput && 0 !== item.variation_id) {\n\n\t\t\t\torderItem.id = String(wpmDataLayer.products[item.variation_id].dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type])\n\t\t\t\torderItems.push(orderItem)\n\t\t\t} else {\n\n\t\t\t\torderItem.id = String(wpmDataLayer.products[item.id].dyn_r_ids[wpmDataLayer.pixels.google.ads.dynamic_remarketing.id_type])\n\t\t\t\torderItems.push(orderItem)\n\t\t\t}\n\t\t})\n\n\t\treturn orderItems\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery))\n","/**\n * Load Google Ads\n */\n\nrequire(\"./functions\")\nrequire(\"./event_listeners\")\n","/**\n * Load GA4 event listeners\n * */\n\n\n// view order received page event\njQuery(document).on(\"wpmOrderReceivedPage\", function () {\n\n\ttry {\n\t\tif (!wpmDataLayer?.pixels?.google?.analytics?.ga4?.measurement_id) return\n\n\t\t// ga4_server_and_browser_tracking experiment\n\t\t// https://app.asana.com/0/1110999795232049/1204453591507565\n\t\t// ga4e: if (wpmDataLayer?.pixels?.google?.analytics?.ga4?.mp_active) {\n\t\t// \tif (wpmDataLayer?.experiments?.ga4_server_and_browser_tracking) {\n\t\t// \t\tbreak ga4e\n\t\t// \t}\n\t\t// \treturn\n\t\t// }\n\n\t\t// Deactivated for the ga4_server_and_browser_tracking experiment\n\t\tif (wpmDataLayer?.pixels?.google?.analytics?.ga4?.mp_active) return\n\n\t\tif (!wpm.googleConfigConditionsMet(\"analytics\")) return\n\n\t\twpm.gtagLoaded().then(function () {\n\t\t\tgtag(\"event\", \"purchase\", {\n\t\t\t\tsend_to : [wpmDataLayer.pixels.google.analytics.ga4.measurement_id],\n\t\t\t\ttransaction_id: wpmDataLayer.order.number,\n\t\t\t\taffiliation : wpmDataLayer.order.affiliation,\n\t\t\t\tcurrency : wpmDataLayer.order.currency,\n\t\t\t\tvalue : wpmDataLayer.order.value_regular,\n\t\t\t\tdiscount : wpmDataLayer.order.discount,\n\t\t\t\ttax : wpmDataLayer.order.tax,\n\t\t\t\tshipping : wpmDataLayer.order.shipping,\n\t\t\t\tcoupon : wpmDataLayer.order.coupon,\n\t\t\t\titems : wpm.getGA4OrderItems(),\n\t\t\t})\n\t\t})\n\n\t\t// wpm.gtagLoaded().then(function () {\n\t\t// \tgtag(\"get\", wpmDataLayer.pixels.google.analytics.ga4.measurement_id, \"client_id\", (client_id) => {\n\t\t// \t\tconsole.log(\"transaction_id: \" + wpmDataLayer.order.number + \" client_id: \" + client_id)\n\t\t// \t})\n\t\t// })\n\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n","/**\n * Load GA4 functions\n * */\n\n(function (wpm, $, undefined) {\n\n\twpm.getGA4OrderItems = function () {\n\n\t\t// \"item_id\" : \"34\",\n\t\t// \"item_name\" : \"Hoodie\",\n\t\t// \"quantity\" : 1,\n\t\t// \"item_brand\" : \"\",\n\t\t// \"item_variant\" : \"Color: blue | Logo: yes\",\n\t\t// \"price\" : 45,\n\t\t// \"currency\" : \"CHF\",\n\t\t// \"item_category\": \"Hoodies\"\n\n\n\t\tlet orderItems = []\n\n\t\tObject.values(wpmDataLayer.order.items).forEach((item) => {\n\t\t\tlet orderItem\n\n\t\t\torderItem = {\n\t\t\t\tquantity : item.quantity,\n\t\t\t\tprice : item.price,\n\t\t\t\titem_name : item.name,\n\t\t\t\tcurrency : wpmDataLayer.order.currency,\n\t\t\t\titem_category: wpmDataLayer.products[item.id].category.join(\"/\"),\n\t\t\t}\n\n\t\t\tif (0 !== item.variation_id) {\n\n\t\t\t\torderItem.item_id = String(wpmDataLayer.products[item.variation_id].dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type])\n\t\t\t\torderItem.item_variant = wpmDataLayer.products[item.variation_id].variant_name\n\t\t\t\torderItem.item_brand = wpmDataLayer.products[item.variation_id].brand\n\t\t\t} else {\n\n\t\t\t\torderItem.item_id = String(wpmDataLayer.products[item.id].dyn_r_ids[wpmDataLayer.pixels.google.analytics.id_type])\n\t\t\t\torderItem.item_brand = wpmDataLayer.products[item.id].brand\n\t\t\t}\n\n\t\t\torderItems.push(orderItem)\n\t\t})\n\n\t\treturn orderItems\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery))\n","/**\n * GA4 loader\n */\n\nrequire(\"./functions\")\nrequire(\"./event_listeners\")\n\n// #if process.env.TIER === 'premium'\n// if (wpm.canLoadPremiumFeatures()) {\n// \trequire(\"./functions_premium\")\n// \trequire(\"./event_listeners_premium\")\n// }\n// #endif\n","/**\n * Google Analytics loader\n */\n\n// require(\"./ga3/loader\")\nrequire(\"./ga4/loader\")\n","/**\n * Load Google base event listeners\n */\n\n// Pixel load event listener\njQuery(document).on(\"wpmLoadPixels\", function () {\n\n\tif (typeof wpmDataLayer?.pixels?.google?.state === \"undefined\") {\n\t\tif (wpm.canGoogleLoad()) {\n\t\t\twpm.loadGoogle()\n\t\t} else {\n\t\t\twpm.logPreventedPixelLoading(\"google\", \"analytics / ads\")\n\t\t}\n\t}\n})\n","/**\n * Load Google base functions\n */\n\n(function (wpm, $, undefined) {\n\n\twpm.googleConfigConditionsMet = (type) => {\n\n\t\t// always returns true if Google Consent Mode is active\n\t\tif (wpmDataLayer?.pixels?.google?.consent_mode?.active) {\n\t\t\treturn true\n\t\t} else if (wpm.getConsentValues().mode === \"category\") {\n\t\t\treturn wpm.getConsentValues().categories[type] === true\n\t\t} else if (wpm.getConsentValues().mode === \"pixel\") {\n\t\t\treturn wpm.getConsentValues().pixels.includes(\"google-\" + type)\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\twpm.getVisitorConsentStatusAndUpdateGoogleConsentSettings = (google_consent_settings) => {\n\n\t\tif (wpm.getConsentValues().mode === \"category\") {\n\n\t\t\tif (wpm.getConsentValues().categories.analytics) google_consent_settings.analytics_storage = \"granted\"\n\t\t\tif (wpm.getConsentValues().categories.ads) google_consent_settings.ad_storage = \"granted\"\n\t\t} else if ((wpm.getConsentValues().mode === \"pixel\")) {\n\n\t\t\tgoogle_consent_settings.analytics_storage = wpm.getConsentValues().pixels.includes(\"google-analytics\") ? \"granted\" : \"denied\"\n\t\t\tgoogle_consent_settings.ad_storage = wpm.getConsentValues().pixels.includes(\"google-ads\") ? \"granted\" : \"denied\"\n\t\t}\n\n\t\treturn google_consent_settings\n\t}\n\n\twpm.fireGtagGoogleAds = () => {\n\t\ttry {\n\t\t\twpmDataLayer.pixels.google.ads.state = \"loading\"\n\n\t\t\tif (wpmDataLayer?.pixels?.google?.ads?.enhanced_conversions?.active) {\n\t\t\t\tObject.keys(wpmDataLayer.pixels.google.ads.conversionIds).forEach((key) => {\n\t\t\t\t\tgtag(\"config\", key, {\"allow_enhanced_conversions\": true})\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\tObject.keys(wpmDataLayer.pixels.google.ads.conversionIds).forEach((key) => {\n\t\t\t\t\tgtag(\"config\", key)\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tif (wpmDataLayer?.pixels?.google?.ads?.conversionIds && wpmDataLayer?.pixels?.google?.ads?.phone_conversion_label && wpmDataLayer?.pixels?.google?.ads?.phone_conversion_number) {\n\t\t\t\tgtag(\"config\", Object.keys(wpmDataLayer.pixels.google.ads.conversionIds)[0] + \"/\" + wpmDataLayer.pixels.google.ads.phone_conversion_label, {\n\t\t\t\t\tphone_conversion_number: wpmDataLayer.pixels.google.ads.phone_conversion_number,\n\t\t\t\t})\n\t\t\t}\n\n\t\t\t// https://support.google.com/google-ads/answer/9888145#zippy=%2Cvalidate-your-implementation-using-chrome-developer-tools\n\t\t\tif (\n\t\t\t\twpmDataLayer?.shop?.page_type\n\t\t\t\t&& \"order_received_page\" === wpmDataLayer.shop.page_type\n\t\t\t\t&& wpmDataLayer?.order?.google?.ads?.enhanced_conversion_data\n\t\t\t) {\n\t\t\t\tgtag(\"set\", \"user_data\", wpmDataLayer.order.google.ads.enhanced_conversion_data)\n\t\t\t}\n\n\t\t\twpmDataLayer.pixels.google.ads.state = \"ready\"\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.fireGtagGoogleAnalyticsUA = () => {\n\n\t\ttry {\n\t\t\twpmDataLayer.pixels.google.analytics.universal.state = \"loading\"\n\n\t\t\tgtag(\"config\", wpmDataLayer.pixels.google.analytics.universal.property_id, wpmDataLayer.pixels.google.analytics.universal.parameters)\n\t\t\twpmDataLayer.pixels.google.analytics.universal.state = \"ready\"\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\t// https://developers.google.com/tag-platform/gtagjs/reference\n\twpm.fireGtagGoogleAnalyticsGA4 = () => {\n\n\t\ttry {\n\t\t\twpmDataLayer.pixels.google.analytics.ga4.state = \"loading\"\n\n\t\t\tlet parameters = wpmDataLayer.pixels.google.analytics.ga4.parameters\n\n\t\t\tif (wpmDataLayer?.pixels?.google?.analytics?.ga4?.debug_mode) {\n\t\t\t\tparameters.debug_mode = true\n\t\t\t}\n\n\t\t\tgtag(\"config\", wpmDataLayer.pixels.google.analytics.ga4.measurement_id, parameters)\n\n\t\t\twpmDataLayer.pixels.google.analytics.ga4.state = \"ready\"\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.isGoogleActive = () => {\n\n\t\tif (\n\t\t\twpmDataLayer?.pixels?.google?.analytics?.universal?.property_id ||\n\t\t\twpmDataLayer?.pixels?.google?.analytics?.ga4?.measurement_id ||\n\t\t\t!jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)\n\t\t) {\n\t\t\treturn true\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\twpm.getGoogleGtagId = () => {\n\n\t\tif (wpmDataLayer?.pixels?.google?.analytics?.ga4?.measurement_id) {\n\t\t\treturn wpmDataLayer.pixels.google.analytics.ga4.measurement_id\n\t\t}\n\n\t\tif (\n\t\t\twpmDataLayer?.pixels?.google?.ads?.conversionIds\n\t\t\t&& Object.keys(wpmDataLayer.pixels.google.ads.conversionIds)[0]\n\t\t) {\n\t\t\treturn Object.keys(wpmDataLayer.pixels.google.ads.conversionIds)[0]\n\t\t}\n\n\t\tif (wpmDataLayer?.pixels?.google?.analytics?.universal?.property_id) {\n\t\t\tconsole.log(\"UA analytics ID\")\n\t\t\treturn wpmDataLayer.pixels.google.analytics.universal.property_id\n\t\t}\n\n\t\treturn \"\"\n\t}\n\n\n\twpm.loadGoogle = () => {\n\n\t\tif (wpm.isGoogleActive()) {\n\n\t\t\twpmDataLayer.pixels.google.state = \"loading\"\n\n\t\t\twpm.loadScriptAndCacheIt(\"https://www.googletagmanager.com/gtag/js?id=\" + wpm.getGoogleGtagId())\n\t\t\t\t.then((script, textStatus) => {\n\n\t\t\t\t\ttry {\n\n\t\t\t\t\t\t// Initiate Google dataLayer and gtag\n\t\t\t\t\t\twindow.dataLayer = window.dataLayer || []\n\t\t\t\t\t\twindow.gtag = function gtag() {\n\t\t\t\t\t\t\tdataLayer.push(arguments)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Google Consent Mode\n\t\t\t\t\t\tif (wpmDataLayer?.pixels?.google?.consent_mode?.active) {\n\n\t\t\t\t\t\t\tlet google_consent_settings = {\n\t\t\t\t\t\t\t\t\"ad_storage\" : wpmDataLayer.pixels.google.consent_mode.ad_storage,\n\t\t\t\t\t\t\t\t\"analytics_storage\": wpmDataLayer.pixels.google.consent_mode.analytics_storage,\n\t\t\t\t\t\t\t\t\"wait_for_update\" : wpmDataLayer.pixels.google.consent_mode.wait_for_update,\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (wpmDataLayer?.pixels?.google?.consent_mode?.region) {\n\t\t\t\t\t\t\t\tgoogle_consent_settings.region = wpmDataLayer.pixels.google.consent_mode.region\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tgoogle_consent_settings = wpm.getVisitorConsentStatusAndUpdateGoogleConsentSettings(google_consent_settings)\n\n\t\t\t\t\t\t\tgtag(\"consent\", \"default\", google_consent_settings)\n\t\t\t\t\t\t\tgtag(\"set\", \"ads_data_redaction\", wpmDataLayer.pixels.google.consent_mode.ads_data_redaction)\n\t\t\t\t\t\t\tgtag(\"set\", \"url_passthrough\", wpmDataLayer.pixels.google.consent_mode.url_passthrough)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Google Linker\n\t\t\t\t\t\t// https://developers.google.com/gtagjs/devguide/linker\n\t\t\t\t\t\tif (wpmDataLayer?.pixels?.google?.linker?.settings) {\n\t\t\t\t\t\t\tgtag(\"set\", \"linker\", wpmDataLayer.pixels.google.linker.settings)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tgtag(\"js\", new Date())\n\t\t\t\t\t\tgtag(\"set\", \"developer_id.dNDI5Yz\", true)\n\n\t\t\t\t\t\t// Google Ads loader\n\t\t\t\t\t\tif (!jQuery.isEmptyObject(wpmDataLayer?.pixels?.google?.ads?.conversionIds)) { // Only run if the pixel has set up\n\t\t\t\t\t\t\tif (wpm.googleConfigConditionsMet(\"ads\")) { \t\t\t\t\t\t\t// Only run if cookie consent has been given\n\t\t\t\t\t\t\t\twpm.fireGtagGoogleAds()\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\twpm.logPreventedPixelLoading(\"google-ads\", \"ads\")\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Google Universal Analytics loader\n\t\t\t\t\t\tif (wpmDataLayer?.pixels?.google?.analytics?.universal?.property_id) { \t\t// Only run if the pixel has set up\n\n\t\t\t\t\t\t\tif (wpm.googleConfigConditionsMet(\"analytics\")) {\t\t\t\t\t\t// Only run if cookie consent has been given\n\t\t\t\t\t\t\t\twpm.fireGtagGoogleAnalyticsUA()\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\twpm.logPreventedPixelLoading(\"google-universal-analytics\", \"analytics\")\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// GA4 loader\n\t\t\t\t\t\tif (wpmDataLayer?.pixels?.google?.analytics?.ga4?.measurement_id) { \t\t\t// Only run if the pixel has set up\n\n\t\t\t\t\t\t\tif (wpm.googleConfigConditionsMet(\"analytics\")) {\t\t\t\t\t\t// Only run if cookie consent has been given\n\t\t\t\t\t\t\t\twpm.fireGtagGoogleAnalyticsGA4()\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\twpm.logPreventedPixelLoading(\"ga4\", \"analytics\")\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\twpmDataLayer.pixels.google.state = \"ready\"\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tconsole.error(e)\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t}\n\t}\n\n\twpm.canGoogleLoad = () => {\n\n\t\tif (wpmDataLayer?.pixels?.google?.consent_mode?.active) {\n\t\t\treturn true\n\t\t} else if (\"category\" === wpm.getConsentValues().mode) {\n\t\t\treturn !!(wpm.getConsentValues().categories[\"ads\"] || wpm.getConsentValues().categories[\"analytics\"])\n\t\t} else if (\"pixel\" === wpm.getConsentValues().mode) {\n\t\t\treturn wpm.getConsentValues().pixels.includes(\"google-ads\") || wpm.getConsentValues().pixels.includes(\"google-analytics\")\n\t\t} else {\n\t\t\tconsole.error(\"Couldn't find a valid load condition for Google mode in wpmConsentValues\")\n\t\t\treturn false\n\t\t}\n\t}\n\n\twpm.gtagLoaded = () => {\n\t\treturn new Promise((resolve, reject) => {\n\n\t\t\tif (typeof wpmDataLayer?.pixels?.google?.state === \"undefined\") reject()\n\n\t\t\tlet startTime = 0\n\t\t\tlet timeout = 5000\n\t\t\tlet frequency = 200;\n\n\t\t\t(function wait() {\n\t\t\t\tif (wpmDataLayer?.pixels?.google?.state === \"ready\") return resolve()\n\t\t\t\tif (startTime >= timeout) return reject()\n\t\t\t\tstartTime += frequency\n\t\t\t\tsetTimeout(wait, frequency)\n\t\t\t})()\n\t\t})\n\t}\n\n\n}(window.wpm = window.wpm || {}, jQuery))\n","/**\n * Load Google base\n */\n\n// Load base\nrequire(\"./functions\")\nrequire(\"./event_listeners\")\n\n// #if process.env.TIER === 'premium'\n// if (wpm.canLoadPremiumFeatures()) {\n// \trequire(\"./functions_premium\")\n// \trequire(\"./event_listeners_premium\")\n// }\n// #endif\n","/**\n * Load Google\n */\n\n// Load base\nrequire(\"./base/loader\")\n\n//Load additional Google libraries\nrequire(\"./ads/loader\")\nrequire(\"./analytics/loader\")\nrequire(\"./optimize/loader\")\n\n\n","/**\n * Load Google Optimize event listeners\n */\n\njQuery(document).on(\"wpmLoadPixels\", function () {\n\n\tif (wpmDataLayer?.pixels?.google?.optimize?.container_id && !wpmDataLayer?.pixels?.google?.optimize?.loaded) {\n\t\tif (wpm.canIFire(\"analytics\", \"google-optimize\")) wpm.load_google_optimize_pixel()\n\t}\n})\n","/**\n * Load Google Optimize functions\n */\n\n\n(function (wpm, $, undefined) {\n\n\twpm.load_google_optimize_pixel = function () {\n\n\t\ttry {\n\t\t\twpmDataLayer.pixels.google.optimize.loaded = true\n\n\t\t\twpm.loadScriptAndCacheIt(\"https://www.googleoptimize.com/optimize.js?id=\" + wpmDataLayer.pixels.google.optimize.container_id)\n\t\t\t// .then(function (script, textStatus) {\n\t\t\t// \t\tconsole.log('Google Optimize loaded')\n\t\t\t// });\n\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery))\n","/**\n * Load Google Optimize\n */\n\nrequire(\"./functions\")\nrequire(\"./event_listeners\")\n","/**\n * Load Hotjar event listeners\n */\n\n// Pixel load event listener\njQuery(document).on(\"wpmLoadPixels\", function () {\n\n\tif (wpmDataLayer?.pixels?.hotjar?.site_id && !wpmDataLayer?.pixels?.hotjar?.loaded) {\n\t\tif (wpm.canIFire(\"analytics\", \"hotjar\") && !wpmDataLayer?.pixels?.hotjar?.loaded) wpm.load_hotjar_pixel()\n\t}\n})\n","/**\n * Load Hotjar functions\n */\n\n(function (wpm, $, undefined) {\n\n\twpm.load_hotjar_pixel = function () {\n\n\t\ttry {\n\t\t\twpmDataLayer.pixels.hotjar.loaded = true;\n\n\t\t\t// @formatter:off\n\t\t\t(function(h,o,t,j,a,r){\n\t\t\t\th.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};\n\t\t\t\th._hjSettings={hjid:wpmDataLayer.pixels.hotjar.site_id,hjsv:6};\n\t\t\t\ta=o.getElementsByTagName('head')[0];\n\t\t\t\tr=o.createElement('script');r.async=1;\n\t\t\t\tr.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;\n\t\t\t\ta.appendChild(r);\n\t\t\t})(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');\n\t\t\t// @formatter:on\n\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery));\n","/**\n * Hotjar loader\n */\n\nrequire(\"./functions\")\nrequire(\"./event_listeners\")\n","/**\n * Consent Mode functions\n */\n\n(function (wpm, $, undefined) {\n\n\t/**\n\t * Handle Cookie Management Platforms\n\t */\n\n\tconst getComplianzCookies = () => {\n\n\t\tlet cmplz_statistics = wpm.getCookie(\"cmplz_statistics\")\n\t\tlet cmplz_marketing = wpm.getCookie(\"cmplz_marketing\")\n\t\tlet cmplz_consent_status = wpm.getCookie(\"cmplz_consent_status\") || wpm.getCookie(\"cmplz_banner-status\")\n\n\t\tif (cmplz_consent_status) {\n\t\t\treturn {\n\t\t\t\tanalytics : cmplz_statistics === \"allow\",\n\t\t\t\tads : cmplz_marketing === \"allow\",\n\t\t\t\tvisitorHasChosen: true,\n\t\t\t}\n\t\t}\n\n\t\treturn false\n\t}\n\n\tconst getCookieYesCookies = () => {\n\n\t\t/**\n\t\t * Process the new cookieyes-consent cookie that contains all the information\n\t\t */\n\n\t\tlet cookie = wpm.getCookie(\"cookieyes-consent\")\n\n\t\tif (cookie) {\n\n\t\t\t// This cookie has the following structure:\n\t\t\t// consentid:OERmMEJCSVQxRk1SRWVwZkJTUjFBZTJHSEhkdjhLbUI,consent:yes,action:yes,necessary:yes,functional:yes,analytics:yes,performance:yes,advertisement:yes\n\t\t\t// First split the comma-separated values into an array\n\t\t\t// Then split each array item into a key value pair. The key and the value are separated by a colon.\n\t\t\t// Then create an object from the key value pairs.\n\t\t\t// Then console.log the object to see what it looks like.\n\n\t\t\tcookie = cookie\n\t\t\t\t.split(\",\")\n\t\t\t\t.map(item => item.split(\":\"))\n\t\t\t\t.reduce((acc, [key, value]) => ({\n\t\t\t\t\t...acc,\n\t\t\t\t\t[key]: value,\n\t\t\t\t}), {})\n\n\t\t\t// console.log(\"new cookie\", cookie)\n\n\t\t\treturn {\n\t\t\t\tanalytics : cookie.analytics && cookie.analytics === \"yes\",\n\t\t\t\tads : cookie.advertisement && cookie.advertisement === \"yes\",\n\t\t\t\tvisitorHasChosen: cookie.advertisement && cookie.advertisement === \"yes\",\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Process the old cookieyes-* cookies\n\t\t *\n\t\t * @param cookieNames\n\t\t * @returns {string|string|boolean}\n\t\t */\n\n\t\tfunction checkCookie(cookieNames) {\n\t\t\tfor (let name of cookieNames) {\n\n\t\t\t\tconst cookieValue = wpm.getCookie(name)\n\n\t\t\t\tif (cookieValue) {\n\t\t\t\t\treturn cookieValue\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false\n\t\t}\n\n\t\tlet analyticsCookieNames = [\n\t\t\t\"cookielawinfo-checkbox-analytics\",\n\t\t\t\"cookielawinfo-checkbox-analytiques\",\n\t\t\t\"cookieyes-analytics\",\n\t\t]\n\n\t\tconst adsCookieNames = [\n\t\t\t\"cookielawinfo-checkbox-advertisement\",\n\t\t\t\"cookielawinfo-checkbox-performance\",\n\t\t\t\"cookielawinfo-checkbox-publicite\",\n\t\t\t\"cookieyes-advertisement\",\n\t\t]\n\n\t\tconst visitorHasChosenCookieNames = [\n\t\t\t\"CookieLawInfoConsent\",\n\t\t\t\"cky-action\",\n\t\t]\n\n\t\t// let analyticsCookie = wpm.getCookie(\"cookielawinfo-checkbox-analytics\") || wpm.getCookie(\"cookielawinfo-checkbox-analytiques\")\n\t\t// let adsCookie = wpm.getCookie(\"cookielawinfo-checkbox-advertisement\") || wpm.getCookie(\"cookielawinfo-checkbox-performance\") || wpm.getCookie(\"cookielawinfo-checkbox-publicite\")\n\t\t// let visitorHasChosen = wpm.getCookie(\"CookieLawInfoConsent\")\n\n\t\tconst analyticsCookie = checkCookie(analyticsCookieNames)\n\t\tconst adsCookie = checkCookie(adsCookieNames)\n\t\tconst visitorHasChosen = checkCookie(visitorHasChosenCookieNames)\n\n\t\tif (analyticsCookie || adsCookie) {\n\n\t\t\treturn {\n\t\t\t\tanalytics : analyticsCookie === \"yes\",\n\t\t\t\tads : adsCookie === \"yes\",\n\t\t\t\tvisitorHasChosen: !!visitorHasChosen,\n\t\t\t}\n\t\t}\n\n\t\treturn false\n\t}\n\n\t/**\n\t * Get the Iubenda cookie.\n\t * Then parse it and return the analytics and marketing values.\n\t *\n\t * 1 = Necessary\n\t * 2 = Functionality\n\t * 3 = n/a\n\t * 4 = Measurement\n\t * 5 = Marketing\n\t */\n\tconst getIubendaCookieInfo = () => {\n\n\t\t// Regex that matches _iub_cs-59340121 but not _iub_cs-59340121-granular\n\n\t\tlet regex = new RegExp(\"_iub_cs-\\\\d{8,}\")\n\n\t\t// let cookie = wpm.getCookieThatContainsRegex(\"_iub_cs-\")\n\t\tlet cookie = wpm.getCookieThatContainsRegex(regex)\n\n\t\t// Parse the cookie into an object\n\t\t// The structure looks like this:\n\t\t// %7B%22timestamp%22%3A%222023-07-11T06%3A43%3A40.886Z%22%2C%22version%22%3A%221.48.0%22%2C%22purposes%22%3A%7B%221%22%3Atrue%2C%222%22%3Atrue%2C%224%22%3Atrue%2C%225%22%3Atrue%7D%2C%22id%22%3A63374232%7D\n\n\t\tif (cookie) {\n\n\t\t\tcookie = decodeURIComponent(cookie)\n\n\t\t\t// Now the structure looks like this:\n\t\t\t// _iub_cs-63374232={\"timestamp\":\"2023-07-11T06:43:40.886Z\",\"version\":\"1.48.0\",\"purposes\":{\"1\":true,\"2\":true,\"4\":true,\"5\":true},\"id\":63374232}\n\t\t\t// Remove the _iub_cs- prefix until and with the equal sign. The rest is the object we want to keep and parse.\n\t\t\tcookie = cookie.replace(/_iub_cs-.*=/, \"\")\n\n\t\t\tcookie = JSON.parse(cookie)\n\n\t\t\treturn {\n\t\t\t\tanalytics : cookie.purposes[\"4\"],\n\t\t\t\tads : cookie.purposes[\"5\"],\n\t\t\t\tvisitorHasChosen: true,\n\t\t\t}\n\t\t}\n\n\t\treturn false\n\t}\n\n\tconst getTermlyCookies = () => {\n\n\t\t// Get Termly cookies from localStorage from termly_gtm_template_default_consents for ad_storage and for analytics_storage\n\t\tlet termlyConsent = localStorage.getItem(\"termly_gtm_template_default_consents\")\n\n\t\tif (termlyConsent) {\n\t\t\ttermlyConsent = JSON.parse(termlyConsent)\n\n\t\t\treturn {\n\t\t\t\tanalytics : termlyConsent.analytics_storage === \"granted\",\n\t\t\t\tads : termlyConsent.ad_storage === \"granted\",\n\t\t\t\tvisitorHasChosen: true,\n\t\t\t}\n\t\t}\n\n\t\treturn false\n\t}\n\n\n\t/**\n\t * Initialize and set default values\n\t */\n\n\tlet\n\t\twpmConsentValues = {}\n\twpmConsentValues.categories = {}\n\twpmConsentValues.pixels = []\n\twpmConsentValues.mode = \"category\"\n\twpmConsentValues.visitorHasChosen = false\n\n\t// Return current consent values\n\twpm.getConsentValues = () => wpmConsentValues\n\n\twpm.setConsentValueCategories = (analytics = false, ads = false) => {\n\t\twpmConsentValues.categories.analytics = analytics\n\t\twpmConsentValues.categories.ads = ads\n\t}\n\n\t// Update the PMW consent values with values coming from a CMP\n\twpm.updateConsentCookieValues = (analytics = null, ads = null, explicitConsent = false) => {\n\n\t\t// ad_storage\n\t\t// analytics_storage\n\t\t// functionality_storage\n\t\t// personalization_storage\n\t\t// security_storage\n\n\t\tlet cookie\n\n\t\t/**\n\t\t * Setup defaults\n\t\t */\n\n\t\t// consentValues.categories.analytics = true\n\t\t// consentValues.categories.ads = true\n\n\t\twpmConsentValues.categories.analytics = !explicitConsent\n\t\twpmConsentValues.categories.ads = !explicitConsent\n\n\n\t\tif (analytics || ads) {\n\n\t\t\tif (analytics) {\n\t\t\t\twpmConsentValues.categories.analytics = !!analytics\n\t\t\t}\n\n\t\t\tif (ads) {\n\t\t\t\twpmConsentValues.categories.ads = !!ads\n\t\t\t}\n\n\t\t\treturn\n\t\t}\n\n\t\t/**\n\t\t * PMW Cookie Consent\n\t\t *\n\t\t * Must be processed before every other CMP for the case that one of the included CMPs\n\t\t * decides to implement the PMW cookie consent API. In that case\n\t\t * the PMW consent cookie must take precedence.\n\t\t */\n\n\t\tif (cookie = wpm.getCookie(\"pmw_cookie_consent\")) {\n\n\t\t\tcookie = JSON.parse(cookie)\n\n\t\t\twpmConsentValues.categories.analytics = cookie.analytics === true\n\t\t\twpmConsentValues.categories.ads = cookie.ads === true\n\t\t\twpmConsentValues.visitorHasChosen = true\n\n\t\t\treturn\n\t\t}\n\n\t\t/**\n\t\t * Cookiebot\n\t\t * https://wordpress.org/plugins/cookiebot/\n\t\t */\n\n\t\tif (cookie = wpm.getCookie(\"CookieConsent\")) {\n\n\t\t\tcookie = decodeURI(cookie)\n\n\t\t\twpmConsentValues.categories.analytics = cookie.indexOf(\"statistics:true\") >= 0\n\t\t\twpmConsentValues.categories.ads = cookie.indexOf(\"marketing:true\") >= 0\n\t\t\twpmConsentValues.visitorHasChosen = true\n\n\t\t\treturn\n\t\t}\n\n\t\t/**\n\t\t * WP Consent API\n\t\t * https://github.com/rlankhorst/wp-consent-level-api\n\t\t * https://wordpress.org/plugins/wp-consent-api/\n\t\t */\n\n\t\t// if a at least one cookie exists that starts with wp_consent_ then the visitor has chosen\n\t\tif (wpm.getCookieThatContainsRegex(/^wp_consent_/)) {\n\t\t\t// console.log(\"WP Consent API settings detected\")\n\n\t\t\t// if the cookie wp_consent_statistics exists and is set to allow, then analytics is true\n\t\t\t// If it is set to deny, then analytics is false\n\t\t\twpmConsentValues.categories.analytics = wpm.getCookie(\"wp_consent_statistics\") === \"allow\"\n\t\t\twpmConsentValues.categories.ads = wpm.getCookie(\"wp_consent_marketing\") === \"allow\"\n\n\t\t\twpmConsentValues.visitorHasChosen = true\n\n\t\t\t// console log the consent values\n\t\t\t// console.log(\"WP Consent API settings detected: \", wpmConsentValues)\n\n\t\t\treturn\n\t\t}\n\n\t\t/**\n\t\t * Cookie Script\n\t\t * https://wordpress.org/plugins/cookie-script-com/\n\t\t */\n\n\t\tif (cookie = wpm.getCookie(\"CookieScriptConsent\")) {\n\n\t\t\tcookie = JSON.parse(cookie)\n\n\t\t\t// if cookie.categories is not an array, but a string, parse it\n\t\t\tif (typeof cookie.categories === \"string\") cookie.categories = JSON.parse(cookie.categories)\n\n\t\t\tif (\n\t\t\t\tcookie.action\n\t\t\t\t&& cookie.action === \"reject\"\n\t\t\t) {\n\t\t\t\twpmConsentValues.categories.analytics = false\n\t\t\t\twpmConsentValues.categories.ads = false\n\t\t\t} else if (\n\t\t\t\tcookie.categories\n\t\t\t\t&& cookie.categories.length > 0\n\t\t\t) {\n\t\t\t\twpmConsentValues.categories.analytics = cookie.categories.indexOf(\"performance\") >= 0\n\t\t\t\twpmConsentValues.categories.ads = cookie.categories.indexOf(\"targeting\") >= 0\n\t\t\t} else {\n\t\t\t\twpmConsentValues.categories.analytics = true\n\t\t\t\twpmConsentValues.categories.ads = true\n\t\t\t}\n\n\t\t\twpmConsentValues.visitorHasChosen = true\n\n\t\t\treturn\n\t\t}\n\n\t\t/**\n\t\t * Borlabs Cookie\n\t\t * https://borlabs.io/borlabs-cookie/\n\t\t */\n\t\tif (cookie = wpm.getCookie(\"borlabs-cookie\")) {\n\n\t\t\tcookie = decodeURI(cookie)\n\t\t\tcookie = JSON.parse(cookie)\n\n\t\t\twpmConsentValues.categories.analytics = !!cookie?.consents?.statistics\n\t\t\twpmConsentValues.categories.ads = !!cookie?.consents?.marketing\n\t\t\twpmConsentValues.visitorHasChosen = true\n\t\t\twpmConsentValues.pixels = [...cookie?.consents?.statistics || [], ...cookie?.consents?.marketing || []]\n\t\t\twpmConsentValues.mode = \"pixel\"\n\n\t\t\treturn\n\t\t}\n\n\t\t/**\n\t\t * Complianz Cookie\n\t\t * https://wordpress.org/plugins/complianz-gdpr/\n\t\t */\n\n\t\tif (cookie = getComplianzCookies()) {\n\n\t\t\twpmConsentValues.categories.analytics = cookie.analytics === true\n\t\t\twpmConsentValues.categories.ads = cookie.ads === true\n\t\t\twpmConsentValues.visitorHasChosen = cookie.visitorHasChosen\n\n\t\t\treturn\n\t\t}\n\n\t\t/**\n\t\t * Cookie Compliance (free version)\n\t\t * https://wordpress.org/plugins/cookie-notice/\n\t\t */\n\n\t\tif (cookie = wpm.getCookie(\"cookie_notice_accepted\")) {\n\n\t\t\twpmConsentValues.categories.analytics = true\n\t\t\twpmConsentValues.categories.ads = true\n\t\t\twpmConsentValues.visitorHasChosen = true\n\n\t\t\treturn\n\t\t}\n\n\t\t/**\n\t\t * Cookie Compliance (pro version)\n\t\t * https://wordpress.org/plugins/cookie-notice/\n\t\t */\n\n\t\tif (cookie = wpm.getCookie(\"hu-consent\")) {\n\n\t\t\tcookie = JSON.parse(cookie)\n\n\t\t\twpmConsentValues.categories.analytics = !!cookie.categories[\"3\"]\n\t\t\twpmConsentValues.categories.ads = !!cookie.categories[\"4\"]\n\t\t\twpmConsentValues.visitorHasChosen = true\n\n\t\t\treturn\n\t\t}\n\n\t\t/**\n\t\t * CookieYes, GDPR Cookie Consent (Cookie Law Info)\n\t\t * https://wordpress.org/plugins/cookie-law-info/\n\t\t */\n\n\t\tif (cookie = getCookieYesCookies()) {\n\n\t\t\twpmConsentValues.categories.analytics = cookie.analytics === true\n\t\t\twpmConsentValues.categories.ads = cookie.ads === true\n\t\t\twpmConsentValues.visitorHasChosen = cookie.visitorHasChosen === true\n\n\t\t\treturn\n\t\t}\n\n\t\t/**\n\t\t * GDPR Cookie Compliance Plugin by Moove Agency\n\t\t * https://wordpress.org/plugins/gdpr-cookie-compliance/\n\t\t *\n\t\t * TODO write documentation on how to set up the plugin in order for this to work properly\n\t\t */\n\n\t\tif (cookie = wpm.getCookie(\"moove_gdpr_popup\")) {\n\n\t\t\tcookie = JSON.parse(cookie)\n\n\t\t\twpmConsentValues.categories.analytics = cookie.thirdparty === \"1\"\n\t\t\twpmConsentValues.categories.ads = cookie.advanced === \"1\"\n\t\t\twpmConsentValues.visitorHasChosen = true\n\n\t\t\treturn\n\t\t}\n\n\t\t/**\n\t\t * Iubenda\n\t\t * https://www.iubenda.com\n\t\t */\n\n\t\tif (cookie = getIubendaCookieInfo()) {\n\n\t\t\tcookie = cookie\n\n\t\t\twpmConsentValues.categories.analytics = cookie.analytics === true\n\t\t\twpmConsentValues.categories.ads = cookie.ads === true\n\t\t\twpmConsentValues.visitorHasChosen = true\n\n\t\t\t// console.log(\"Iubenda settings detected: \", wpmConsentValues)\n\n\t\t\treturn\n\t\t}\n\n\t\t/**\n\t\t * WP AutoTerms\n\t\t * https://wordpress.org/plugins/auto-terms-of-service-and-privacy-policy/\n\t\t */\n\n\t\tif (cookie = wpm.getCookie(\"wpautoterms-cookies-notice\")) {\n\n\t\t\tif (cookie !== \"1\") return\n\n\t\t\twpmConsentValues.categories.analytics = true\n\t\t\twpmConsentValues.categories.ads = true\n\t\t\twpmConsentValues.visitorHasChosen = true\n\n\t\t\treturn\n\t\t}\n\n\t\t/**\n\t\t * Usercentrics\n\t\t *\n\t\t * https://usercentrics.com/\n\t\t * https://docs.usercentrics.com/#/cmp-v2-ui-api\n\t\t * https://docs.usercentrics.com/#/cmp-v2-ui-api?id=getservicesbaseinfo\n\t\t */\n\n\t\tif (window.localStorage && window.localStorage.getItem(\"uc_settings\")) {\n\n\t\t\tconsole.log(\"Usercentrics settings detected\")\n\n\t\t\tif (typeof UC_UI === \"undefined\") {\n\n\t\t\t\t// register event to block unblock after UC_UI library is loaded\n\t\t\t\twindow.addEventListener(\"UC_UI_INITIALIZED\", (event) => {\n\t\t\t\t\twpm.ucUiProcessConsent()\n\t\t\t\t})\n\n\t\t\t\t// Don't continue because in here the UC_UI library is not loaded yet\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif (UC_UI.areAllConsentsAccepted()) {\n\t\t\t\twpmConsentValues.categories.analytics = true\n\t\t\t\twpmConsentValues.categories.ads = true\n\t\t\t\twpmConsentValues.visitorHasChosen = true\n\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\twpm.ucUiProcessConsent()\n\t\t}\n\n\t\t/**\n\t\t * OneTrust\n\t\t *\n\t\t * https://www.onetrust.com/\n\t\t */\n\n\t\tif (cookie = wpm.getCookie(\"OptanonConsent\")) {\n\n\t\t\t// console.log(\"OneTrust settings detected\")\n\n\t\t\tlet params = new URLSearchParams(cookie)\n\t\t\tlet groups = params.get(\"groups\").split(\",\")\n\n\t\t\t// Groups is an array like this ['1:1', '2:0', '3:1', '4:1']. Make it an object with key value pairs\n\t\t\tlet groupsObject = {}\n\t\t\tgroups.forEach((group) => {\n\n\t\t\t\tlet groupArray = group.split(\":\")\n\t\t\t\tgroupsObject[groupArray[0]] = groupArray[1]\n\t\t\t})\n\n\t\t\t// group mapping\n\t\t\t// 1 = necessary\n\t\t\t// 2 = analytics\n\t\t\t// 3 = functional\n\t\t\t// 4 = ads\n\n\t\t\twpmConsentValues.categories.analytics = groupsObject[\"2\"] === \"1\"\n\t\t\twpmConsentValues.categories.ads = groupsObject[\"4\"] === \"1\"\n\t\t\twpmConsentValues.visitorHasChosen = true\n\n\t\t\treturn\n\t\t}\n\n\t\t/**\n\t\t * Termly\n\t\t *\n\t\t * https://www.termly.io/\n\t\t */\n\n\t\tif (cookie = getTermlyCookies()) {\n\t\t\twpmConsentValues.categories.analytics = cookie.analytics === true\n\t\t\twpmConsentValues.categories.ads = cookie.ads === true\n\t\t\twpmConsentValues.visitorHasChosen = cookie.visitorHasChosen === true\n\t\t\treturn\n\t\t}\n\n\t\t/**\n\t\t * Real Cookie Banner\n\t\t *\n\t\t * https://devowl.io/wordpress-real-cookie-banner/\n\t\t */\n\t\tif (wpm.doesACookieForTheRealCookieBannerExist()) {\n\n\t\t\t// console.log(\"Real Cookie Banner settings detected\")\n\n\t\t\twpmConsentValues.mode = \"pixel\"\n\t\t\twpmConsentValues.visitorHasChosen = true\n\n\t\t\twpm.waitForLibrary(\"consentApi\")\n\n\t\t\t// console.log(\"Real Cookie Banner consentApi loaded\")\n\n\t\t\tif (!window.consentApi) {\n\t\t\t\tconsole.error(\"Pixel Manager for WooCommerce: window.consentApi is not available\")\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst settings = [\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"adroll-ads\",\n\t\t\t\t\t\"type\" : \"marketing\",\n\t\t\t\t\t\"cookies\": [\"__adroll_fpc\", \"_ar_v4\", \"_adroll\"],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"bing-ads\",\n\t\t\t\t\t\"type\" : \"marketing\",\n\t\t\t\t\t\"cookies\": [\"_uetsid\", \"_uetvid\"],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"facebook-ads\",\n\t\t\t\t\t\"type\" : \"marketing\",\n\t\t\t\t\t\"cookies\": [\"_fbp\"],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"google-analytics\",\n\t\t\t\t\t\"type\" : \"statistics\",\n\t\t\t\t\t\"cookies\": [\"_ga\", \"_gid\", \"_gat\", \"_gat_gtag_UA_*\"],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"google-optimize\",\n\t\t\t\t\t\"type\" : \"statistics\",\n\t\t\t\t\t\"cookies\": [\"_ga\", \"_gid\", \"_gat\", \"_gat_gtag_UA_*\"],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"google-ads\",\n\t\t\t\t\t\"type\" : \"marketing\",\n\t\t\t\t\t\"cookies\": [\"_gcl_au\", \"_gcl_aw\", \"_gcl_dc\", \"_gac_*\"],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"hotjar\",\n\t\t\t\t\t\"type\" : \"statistics\",\n\t\t\t\t\t\"cookies\": [\"_hj*\", \"_hjid\"],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"linkedin-ads\",\n\t\t\t\t\t\"type\" : \"marketing\",\n\t\t\t\t\t\"cookies\": [\"_li_ss\", \"_li_id\", \"_li_mk_*\"],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"microsoft-ads\",\n\t\t\t\t\t\"type\" : \"marketing\",\n\t\t\t\t\t\"cookies\": [\"_uetsid\", \"_uetvid\"],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"outbrain-ads\",\n\t\t\t\t\t\"type\" : \"marketing\",\n\t\t\t\t\t\"cookies\": [],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"pinterest-ads\",\n\t\t\t\t\t\"type\" : \"marketing\",\n\t\t\t\t\t\"cookies\": [\"_pinterest_ct_ua\", \"_pinterest_ct_rt\", \"_pin_unauth\", \"_derived_epik\", \"_pinterest_sess\"],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"reddit-ads\",\n\t\t\t\t\t\"type\" : \"marketing\",\n\t\t\t\t\t\"cookies\": [\"_rdt_uuid\"],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"snapchat-ads\",\n\t\t\t\t\t\"type\" : \"marketing\",\n\t\t\t\t\t\"cookies\": [\"sc_at\", \"sc_anonymous_id\", \"sc_id\", \"_scid\", \"_scid_r\"],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"taboola-ads\",\n\t\t\t\t\t\"type\" : \"marketing\",\n\t\t\t\t\t\"cookies\": [],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"tiktok-ads\",\n\t\t\t\t\t\"type\" : \"marketing\",\n\t\t\t\t\t\"cookies\": [\"_ttp\", \"_ttclid\", \"ttwid\"],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"service\": \"twitter-ads\",\n\t\t\t\t\t\"type\" : \"marketing\",\n\t\t\t\t\t\"cookies\": [\"twitter_ads_id\", \"twid\", \"_twclid\", \"muc_ads\"],\n\t\t\t\t},\n\t\t\t]\n\n\n\t\t\t// For each service in settings\n\t\t\t// and each cookie in service.cookies\n\t\t\t// check if consentApi.consentSync(\"http\", cookie, \"*\") returns an object that contains a not empty object called \"cookie\"\n\t\t\t// If one of the cookies returns true, then push service.service to wpmConsentValues.pixels\n\t\t\tsettings.forEach((service) => {\n\n\t\t\t\tservice.cookies.forEach((cookie) => {\n\n\t\t\t\t\tlet consent = window.consentApi.consentSync(\"http\", cookie, \"*\")\n\n\t\t\t\t\tif (consent?.cookie && consent?.cookieOptIn) {\n\n\t\t\t\t\t\twpmConsentValues.pixels.push(service.service)\n\n\t\t\t\t\t\tif (service.type === \"statistics\") {\n\t\t\t\t\t\t\twpmConsentValues.categories.analytics = true\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (service.type === \"marketing\") {\n\t\t\t\t\t\t\twpmConsentValues.categories.ads = true\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// continue with the next service\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\n\t\t\treturn\n\t\t}\n\t}\n\n\twpm.doesACookieForTheRealCookieBannerExist = () => {\n\n\t\t// Find a cookie that has a prefix of real_cookie_banner\n\t\t// If one is found, then return true\n\t\t// If none is found, then return false\n\n\t\tlet cookies = document.cookie.split(\";\")\n\n\t\tfor (let i = 0; i < cookies.length; i++) {\n\t\t\tlet cookie = cookies[i].trim()\n\n\t\t\tif (cookie.startsWith(\"real_cookie_banner\")) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\n\t\treturn false\n\t}\n\n\t// Only run after having made sure that the UC_UI library is loaded\n\twpm.ucUiProcessConsent = () => {\n\n\t\tif (typeof UC_UI === \"undefined\") return\n\n\t\tif (UC_UI.areAllConsentsAccepted()) {\n\t\t\tpmw.consentAcceptAll()\n\t\t}\n\n\t\tconst ucStatisticsSlug = UC_UI.getSettingsLabels().categories.filter(data => data.label === \"Statistics\")[0].slug\n\n\t\tpmw.consentAdjustSelectively(\n\t\t\t{\n\t\t\t\tanalytics: !UC_UI.getServicesBaseInfo().filter(data => data.categorySlug === ucStatisticsSlug && data.consent.status === false).length > 0,\n\t\t\t\tads : !UC_UI.getServicesBaseInfo().filter(data => data.categorySlug === \"marketing\" && data.consent.status === false).length > 0,\n\t\t\t},\n\t\t)\n\t}\n\n\twpm.updateConsentCookieValues()\n\n\twpm.setConsentDefaultValuesToExplicit = () => {\n\t\twpmConsentValues.categories = {\n\t\t\tanalytics: false,\n\t\t\tads : false,\n\t\t}\n\t}\n\n\twpm.canIFire = (category, pixelName) => {\n\n\t\tlet canIFireMode\n\n\t\tif (\"category\" === wpmConsentValues.mode) {\n\t\t\tcanIFireMode = !!wpmConsentValues.categories[category]\n\t\t} else if (\"pixel\" === wpmConsentValues.mode) {\n\t\t\tcanIFireMode = wpmConsentValues.pixels.includes(pixelName)\n\n\t\t\t// If a user sets \"bing-ads\" in Borlabs Cookie instead of\n\t\t\t// \"microsoft-ads\" in the Borlabs settings, we need to check\n\t\t\t// for that too.\n\t\t\tif (false === canIFireMode && \"microsoft-ads\" === pixelName) {\n\t\t\t\tcanIFireMode = wpmConsentValues.pixels.includes(\"bing-ads\")\n\t\t\t}\n\t\t} else {\n\t\t\tconsole.error(\"Couldn't find a valid consent mode in wpmConsentValues\")\n\t\t\tcanIFireMode = false\n\t\t}\n\n\t\tif (canIFireMode) {\n\t\t\treturn true\n\t\t} else {\n\t\t\tif (true || wpm.urlHasParameter(\"debugConsentMode\")) {\n\t\t\t\twpm.logPreventedPixelLoading(pixelName, category)\n\t\t\t}\n\n\t\t\treturn false\n\t\t}\n\t}\n\n\twpm.logPreventedPixelLoading = (pixelName, category) => {\n\n\t\tif (wpmDataLayer?.shop?.cookie_consent_mgmt?.explicit_consent) {\n\t\t\tconsole.log(\"Pixel Manager for WooCommerce: The \\\"\" + pixelName + \" (category: \" + category + \")\\\" pixel has not fired because you have not given consent for it yet. (PMW is in explicit consent mode.)\")\n\t\t} else {\n\t\t\tconsole.log(\"Pixel Manager for WooCommerce: The \\\"\" + pixelName + \" (category: \" + category + \")\\\" pixel has not fired because you have removed consent for this pixel. (PMW is in implicit consent mode.)\")\n\t\t}\n\t}\n\n\t/**\n\t * Runs through each script in
and blocks / unblocks it according to the plugin settings\n\t * and user consent.\n\t */\n\n\t// https://stackoverflow.com/q/65453565/4688612\n\twpm.scriptTagObserver = new MutationObserver((mutations) => {\n\t\tmutations.forEach(({addedNodes}) => {\n\t\t\t[...addedNodes]\n\t\t\t\t.forEach(node => {\n\n\t\t\t\t\tif ($(node).data(\"wpm-cookie-category\")) {\n\n\t\t\t\t\t\t// If the pixel category has been approved > unblock\n\t\t\t\t\t\t// If the pixel belongs to more than one category, then unblock if one of the categories has been approved\n\t\t\t\t\t\t// If no category has been approved, but the Google Consent Mode is active, then only unblock the Google scripts\n\n\t\t\t\t\t\tif (wpm.shouldScriptBeActive(node)) {\n\t\t\t\t\t\t\twpm.unblockScript(node)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\twpm.blockScript(node)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t})\n\t})\n\n\twpm.scriptTagObserver.observe(document.head, {childList: true, subtree: true})\n\t// jQuery(document).on(\"DOMContentLoaded\", () => wpm.scriptTagObserver.disconnect())\n\tdocument.addEventListener(\"DOMContentLoaded\", () => wpm.scriptTagObserver.disconnect())\n\n\twpm.shouldScriptBeActive = node => {\n\n\t\tif (\n\t\t\twpmDataLayer.shop.cookie_consent_mgmt.explicit_consent ||\n\t\t\twpmConsentValues.visitorHasChosen\n\t\t) {\n\n\t\t\tif (wpmConsentValues.mode === \"category\" && $(node).data(\"wpm-cookie-category\").split(\",\").some(element => wpmConsentValues.categories[element])) {\n\t\t\t\treturn true\n\t\t\t} else if (wpmConsentValues.mode === \"pixel\" && wpmConsentValues.pixels.includes($(node).data(\"wpm-pixel-name\"))) {\n\t\t\t\treturn true\n\t\t\t} else if (wpmConsentValues.mode === \"pixel\" && $(node).data(\"wpm-pixel-name\") === \"google\" && [\"google-analytics\", \"google-ads\"].some(element => wpmConsentValues.pixels.includes(element))) {\n\t\t\t\treturn true\n\t\t\t} else if (wpmDataLayer?.pixels?.google?.consent_mode?.active && $(node).data(\"wpm-pixel-name\") === \"google\") {\n\t\t\t\treturn true\n\t\t\t} else {\n\t\t\t\treturn false\n\t\t\t}\n\t\t} else {\n\t\t\treturn true\n\t\t}\n\t}\n\n\n\twpm.unblockScript = (scriptNode, removeAttach = false) => {\n\n\t\tif (removeAttach) $(scriptNode).remove()\n\n\t\tlet wpmSrc = $(scriptNode).data(\"wpm-src\")\n\t\tif (wpmSrc) $(scriptNode).attr(\"src\", wpmSrc)\n\n\t\tscriptNode.type = \"text/javascript\"\n\n\t\tif (removeAttach) $(scriptNode).appendTo(\"head\")\n\n\t\t// jQuery(document).trigger(\"wpmPreLoadPixels\")\n\t\tdocument.dispatchEvent(new Event(\"wpmPreLoadPixels\"))\n\t}\n\n\twpm.blockScript = (scriptNode, removeAttach = false) => {\n\n\t\tif (removeAttach) $(scriptNode).remove()\n\n\t\tif ($(scriptNode).attr(\"src\")) $(scriptNode).removeAttr(\"src\")\n\t\tscriptNode.type = \"blocked/javascript\"\n\n\t\tif (removeAttach) $(scriptNode).appendTo(\"head\")\n\t}\n\n\twpm.unblockAllScripts = (analytics = true, ads = true) => {\n\t\t// jQuery(document).trigger(\"wpmPreLoadPixels\")\n\t\twpm.setConsentValueCategories(analytics, ads)\n\t\tdocument.dispatchEvent(new Event(\"wpmPreLoadPixels\"))\n\t}\n\n\twpm.unblockSelectedPixels = () => {\n\t\t// jQuery(document).trigger(\"wpmPreLoadPixels\")\n\t\tdocument.dispatchEvent(new Event(\"wpmPreLoadPixels\"))\n\t}\n\n\twpm.explicitConsentStateAlreadySet = () => {\n\n\t\tif (wpmConsentValues.explicitConsentStateAlreadySet) {\n\t\t\treturn true\n\t\t} else {\n\t\t\twpmConsentValues.explicitConsentStateAlreadySet = true\n\t\t}\n\t}\n\n\twpm.updatePixelConsentForPixelTypeCMPs = () => {\n\n\t\twpm.updateConsentCookieValues()\n\n\t\tif (wpmConsentValues.mode === \"pixel\") {\n\n\t\t\twpm.unblockSelectedPixels()\n\t\t\twpm.updateGoogleConsentMode(wpmConsentValues.pixels.includes(\"google-analytics\"), wpmConsentValues.pixels.includes(\"google-ads\"))\n\t\t} else {\n\n\t\t\twpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\t\twpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\t}\n\t}\n\n\n\t/**\n\t * Block or unblock scripts for each CMP immediately after cookie consent has been updated\n\t * by the visitor.\n\t */\n\n\t/**\n\t * Borlabs Cookie\n\t * If the visitor accepts cookies in Borlabs Cookie unblock the scripts.\n\t */\n\tdocument.addEventListener(\"borlabs-cookie-consent-saved\", () => {\n\t\twpm.updatePixelConsentForPixelTypeCMPs()\n\t})\n\n\t/**\n\t * Real Cookie Banner\n\t * If the visitor accepts cookies in Real Cookie Banner unblock the scripts.\n\t */\n\n\tdocument.addEventListener(\"RCB/OptIn/All\", () => {\n\t\tconsole.log(\"consent given or changed, check again with consentSync...\")\n\n\t\twpm.updatePixelConsentForPixelTypeCMPs()\n\t})\n\n\n\t/**\n\t * Cookiebot\n\t * \tIf visitor accepts cookies in Cookiebot unblock the scripts\n\t * \thttps://www.cookiebot.com/en/developer/\n\t */\n\twindow.addEventListener(\"CookiebotOnAccept\", () => {\n\t\tif (Cookiebot.consent.statistics) wpmConsentValues.categories.analytics = true\n\t\tif (Cookiebot.consent.marketing) wpmConsentValues.categories.ads = true\n\n\t\twpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\twpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\n\t}, false)\n\n\t/**\n\t * WP Consent API\n\t * https://github.com/rlankhorst/wp-consent-level-api\n\t * https://wordpress.org/plugins/wp-consent-api/\n\t */\n\n\tdocument.addEventListener(\"wp_listen_for_consent_change\", e => {\n\n\t\tconst changedConsentCategory = e.detail\n\n\t\tfor (const key in changedConsentCategory) {\n\n\t\t\t// console.log(\"consent given or changed, check again with consentSync...\", key, changedConsentCategory[key])\n\n\t\t\t// if the key is marketing\n\t\t\tif (key === \"marketing\") {\n\t\t\t\twpmConsentValues.categories.ads = changedConsentCategory[key] === \"allow\"\n\t\t\t}\n\n\t\t\t// if the key is statistics\n\t\t\tif (key === \"statistics\") {\n\t\t\t\twpmConsentValues.categories.analytics = changedConsentCategory[key] === \"allow\"\n\t\t\t}\n\n\t\t}\n\n\t\t// console log the consent values\n\t\t// console.log(\"WP Consent API settings detected: \", wpmConsentValues)\n\n\t\twpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\twpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t})\n\n\n\t/**\n\t * Cookie Script\n\t * If visitor accepts cookies in Cookie Script unblock the scripts\n\t * https://support.cookie-script.com/article/20-custom-events\n\t */\n\t// jQuery(document).on(\"CookieScriptAccept\", e => {\n\tdocument.addEventListener(\"CookieScriptAccept\", e => {\n\n\t\tif (e.detail.categories.includes(\"performance\")) wpmConsentValues.categories.analytics = true\n\t\tif (e.detail.categories.includes(\"targeting\")) wpmConsentValues.categories.ads = true\n\n\t\twpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\twpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t})\n\n\t/**\n\t * Cookie Script\n\t * If visitor accepts cookies in Cookie Script unblock the scripts\n\t * https://support.cookie-script.com/\n\t */\n\t// jQuery(document).on(\"CookieScriptAcceptAll\", () => {\n\tdocument.addEventListener(\"CookieScriptAcceptAll\", () => {\n\n\t\twpm.setConsentValueCategories(true, true)\n\t\twpm.unblockAllScripts(true, true)\n\t\twpm.updateGoogleConsentMode(true, true)\n\t})\n\n\t/**\n\t * Complianz Cookie\n\t *\n\t * If visitor accepts cookies in Complianz unblock the scripts\n\t */\n\n\twpm.cmplzStatusChange = (cmplzConsentData) => {\n\n\t\tif (cmplzConsentData.detail.categories.includes(\"statistics\")) wpm.updateConsentCookieValues(true, null)\n\t\tif (cmplzConsentData.detail.categories.includes(\"marketing\")) wpm.updateConsentCookieValues(null, true)\n\n\t\twpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\twpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t}\n\n\t// jQuery(document).on(\"cmplzStatusChange\", wpm.cmplzStatusChange)\n\tdocument.addEventListener(\"cmplzStatusChange\", wpm.cmplzStatusChange)\n\t// jQuery(document).on(\"cmplz_status_change\", wpm.cmplzStatusChange)\n\tdocument.addEventListener(\"cmplz_status_change\", wpm.cmplzStatusChange)\n\n\t// Cookie Compliance by hu-manity.co (free and pro)\n\t// If visitor accepts cookies in Cookie Notice by hu-manity.co unblock the scripts (free version)\n\t// https://wordpress.org/support/topic/events-on-consent-change/#post-15202792\n\t// jQuery(document).on(\"setCookieNotice\", () => {\n\tdocument.addEventListener(\"setCookieNotice\", () => {\n\t\twpm.updateConsentCookieValues()\n\n\t\twpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\twpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t})\n\n\t/**\n\t * Cookie Compliance by hu-manity.co (free and pro)\n\t * If visitor accepts cookies in Cookie Notice by hu-manity.co unblock the scripts (pro version)\n\t * https://wordpress.org/support/topic/events-on-consent-change/#post-15202792\n\t * Because Cookie Notice has no documented API or event that is being triggered on consent save or update\n\t * we have to solve this by using a mutation observer.\n\t *\n\t * @type {MutationObserver}\n\t */\n\n\twpm.huObserver = new MutationObserver(mutations => {\n\t\tmutations.forEach(({addedNodes}) => {\n\t\t\t[...addedNodes]\n\t\t\t\t.forEach(node => {\n\n\t\t\t\t\tif (node.id === \"hu\") {\n\n\t\t\t\t\t\t// jQuery(\".hu-cookies-save\").on(\"click\", function () {\n\t\t\t\t\t\t// jQuery(\".hu-cookies-save\") in pure JavaScript\n\t\t\t\t\t\tdocument.querySelector(\".hu-cookies-save\").addEventListener(\"click\", () => {\n\t\t\t\t\t\t\twpm.updateConsentCookieValues()\n\t\t\t\t\t\t\twpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\t\t\t\t\t\twpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t})\n\t})\n\n\tif (window.hu) {\n\t\twpm.huObserver.observe(document.documentElement || document.body, {childList: true, subtree: true})\n\t}\n\n\t/**\n\t * Iubenda CMP\n\t *\n\t * https://www.iubenda.com/en/help/1205-how-to-configure-your-cookie-solution-advanced-guide\n\t *\n\t * If visitor accepts cookies in Iubenda CMP unblock the scripts\n\t *\n\t * This might not work as of now (11.07.2023) the Iubenda CMP does not trigger any events.\n\t *\n\t * We might have to use a mutation observer to detect changes in the DOM.\n\t * This is also risky because we might read out the values faster than Iubenda can update them.\n\t */\n\n\t// Load after the document is fully loaded\n\t// Check if a button with one of the following classes was clicked\n\t// iubenda-cs-btn-primary\n\t// If it was clicked, recheck the cookies and unblock the scripts\n\t// jQuery(document).ready(() => {\n\t//\n\t// \tjQuery(document).on(\"click\", \".iubenda-cs-btn-primary\", () => {\n\t// \t\twpm.updateConsentCookieValues()\n\t// \t\twpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t// \t\twpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t// \t})\n\t//\n\t// \t// if the event save-button-clicked is triggered, recheck the cookies and unblock the scripts\n\t// \tjQuery(document).on(\"iubenda-cs-btn-primary\", () => {\n\t// \t\t// wpm.updateConsentCookieValues()\n\t// \t\t// wpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t// \t\t// wpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t// \t\tconsole.log(\"iubenda-cs-btn-primary clicked\")\n\t// \t})\n\t//\n\t// })\n\t//\n\t// wpm.iubObserver = new MutationObserver(mutations => {\n\t// \tmutations.forEach(({addedNodes}) => {\n\t// \t\t[...addedNodes]\n\t// \t\t\t.forEach(node => {\n\t//\n\t// \t\t\t\t// console.log(node)\n\t//\n\t// \t\t\t\tif (node.id === \"iubenda-cs-banner\") {\n\t//\n\t// \t\t\t\t\t// jQuery(\".hu-cookies-save\").on(\"click\", function () {\n\t// \t\t\t\t\t// jQuery(\".hu-cookies-save\") in pure JavaScript\n\t// \t\t\t\t\tdocument.querySelector(\".iubenda-cs-btn-primary\").addEventListener(\"click\", () => {\n\t// \t\t\t\t\t\t// wpm.updateConsentCookieValues()\n\t// \t\t\t\t\t\t// wpm.unblockAllScripts(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t// \t\t\t\t\t\t// wpm.updateGoogleConsentMode(wpmConsentValues.categories.analytics, wpmConsentValues.categories.ads)\n\t//\n\t// \t\t\t\t\t\tconsole.log(\"iubenda-cs-btn-primary clicked\")\n\t// \t\t\t\t\t})\n\t// \t\t\t\t}\n\t// \t\t\t})\n\t// \t})\n\t// })\n\t//\n\t// if (window._iub) {\n\t// \twpm.iubObserver.observe(document.documentElement || document.body, {childList: true, subtree: true})\n\t// }\n\n\n\t/**\n\t * Usercentrics Event Listeners\n\t *\n\t * https://docs.usercentrics.com/#/v2-events?id=usage-as-window-event\n\t */\n\n\twindow.addEventListener(\"ucEvent\", e => {\n\t\tif (e.detail && e.detail.event == \"consent_status\") {\n\t\t\t// check for consent status of service \"Google Ads Remarketing\"\n\t\t\tif (e.detail[\"Google Ads Remarketing\"] === true) {\n\t\t\t\tconsole.log(\"Google Ads Remarketing has consent\")\n\t\t\t} else {\n\t\t\t\tconsole.log(\"Google Ads Remarketing has no consent\")\n\t\t\t}\n\t\t}\n\t})\n\n\t// https://docs.usercentrics.com/#/v2-events?id=uc_ui_cmp_event\n\twindow.addEventListener(\"UC_UI_CMP_EVENT\", event => {\n\n\t\tif (event.detail.type === \"ACCEPT_ALL\") {\n\t\t\t// console.log('accept all');\n\n\t\t\tpmw.consentAcceptAll()\n\t\t}\n\n\t\tif (event.detail.type === \"DENY_ALL\") {\n\t\t\tpmw.consentRevokeAll()\n\t\t}\n\n\t\tif (event.detail.type === \"SAVE\") {\n\t\t\tconsole.log(\"event.detail\", event.detail)\n\t\t}\n\t})\n\n\n\t/**\n\t * OneTrust Event Listeners\n\t *\n\t * CookiePro by OneTrust doesn't emit any events when the user accepts or declines cookies.\n\t */\n\n\t// There are two accept all buttons. One in the first banner and one in the settings window. Both have different identifiers.\n\tjQuery(\"#accept-recommended-btn-handler, #onetrust-accept-btn-handler\").on(\"click\", () => {\n\n\t\t// If OneTrust is not loaded, return\n\t\tif (typeof window.OneTrust === \"undefined\") return\n\n\t\tpmw.consentAcceptAll()\n\t})\n\n\t// There are two revoke all buttons. One in the first banner and one in the settings window. Both have different identifiers.\n\tjQuery(\".ot-pc-refuse-all-handler, #onetrust-reject-all-handler\").on(\"click\", () => {\n\t\tpmw.consentRevokeAll()\n\t})\n\n\t// There is one save button that saves mixed consent. It is in the settings window. We reload the page after saving to reflect the changes.\n\tjQuery(\".save-preference-btn-handler.onetrust-close-btn-handler\").on(\"click\", () => {\n\t\tlocation.reload()\n\n\t\t// OneTrust.OnConsentChanged(function (e) {\n\t\t// \tpmw.consentAdjustSelectively({\n\t\t// \t\tanalytics: e.detail.includes(\"2\"),\n\t\t// \t\tads : e.detail.includes(\"4\"),\n\t\t// \t})\n\t\t// })\n\t})\n\n\t/**\n\t * Termly Event Listeners\n\t *\n\t * The event listener is within /sources/termly_web/resource-blocker/src/constants/lifeCycle.js\n\t */\n\n\tdocument.addEventListener(\"termlyConsent\", function (e) {\n\n\t\tconst consent = e.detail\n\n\t\tif (consent.advertising && consent.analytics) {\n\t\t\tpmw.consentAcceptAll()\n\t\t} else if (!consent.advertising && !consent.analytics) {\n\t\t\tpmw.consentRevokeAll()\n\t\t} else {\n\t\t\tpmw.consentAdjustSelectively({\n\t\t\t\tanalytics: consent.analytics,\n\t\t\t\tads : consent.advertising,\n\t\t\t})\n\t\t}\n\t})\n\n\twpm.updateGoogleConsentMode = (analytics = true, ads = true) => {\n\n\t\ttry {\n\t\t\tif (\n\t\t\t\t!window.gtag ||\n\t\t\t\t!wpmDataLayer.shop.cookie_consent_mgmt.explicit_consent\n\t\t\t) return\n\n\t\t\tgtag(\"consent\", \"update\", {\n\t\t\t\tanalytics_storage: analytics ? \"granted\" : \"denied\",\n\t\t\t\tad_storage : ads ? \"granted\" : \"denied\",\n\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n}(window.wpm = window.wpm || {}, jQuery));\n\n\n(function (pmw, $, undefined) {\n\n\t/**\n\t * Pixel Manager Cookie Consent API\n\t */\n\n\t// Accept consent for all cookies\n\tpmw.consentAcceptAll = (settings = {}) => {\n\n\t\tsettings.duration = settings.duration || 365\n\n\t\tpmw.consentSetCookie(true, true, settings.duration)\n\t\twpm.unblockAllScripts(true, true)\n\t\twpm.updateGoogleConsentMode(true, true)\n\t}\n\n\t// Accept consent selectively\n\tpmw.consentAdjustSelectively = (settings) => {\n\n\t\t// if settings.marketing is set\n\t\t// write its value to settings.ads\n\t\t// and delete settings.marketing\n\t\tif (settings.marketing !== undefined) {\n\t\t\tsettings.ads = settings.marketing\n\t\t\tdelete settings.marketing\n\t\t}\n\n\t\t// If settings.analytics is set, keep it, otherwise set it to wpm.getConsentValues().categories.analytics\n\t\tsettings.analytics = settings.analytics !== undefined ? settings.analytics : wpm.getConsentValues().categories.analytics\n\t\tsettings.ads = settings.ads !== undefined ? settings.ads : wpm.getConsentValues().categories.ads\n\t\tsettings.duration = settings.duration || 365\n\n\t\t// console.log(\"settings\", settings)\n\n\t\tpmw.consentSetCookie(settings.analytics, settings.ads, settings.duration)\n\t\twpm.unblockAllScripts(settings.analytics, settings.ads)\n\t\twpm.updateGoogleConsentMode(settings.analytics, settings.ads)\n\t}\n\n\t// Remove consent for all cookies\n\tpmw.consentRevokeAll = (settings = {}) => {\n\n\t\tsettings.duration = settings.duration || 365\n\n\t\twpm.setConsentValueCategories(false, false)\n\t\tpmw.consentSetCookie(false, false, settings.duration)\n\t\twpm.updateGoogleConsentMode(false, false)\n\t}\n\n\t// Set a cookie called pmw_cookie_consent with the value of pmw_cookie_consent\n\t// and set the default expiration date to 1 year from now\n\tpmw.consentSetCookie = (analytics, ads, duration = 365) => {\n\t\twpm.setCookie(\"pmw_cookie_consent\", JSON.stringify({analytics, ads}), duration)\n\t}\n\n\tpmw.triggerPmwCookieConsentManagementLoaded = () => {\n\t\t// Trigger an event once the PMW consent management has been loaded\n\t\tdocument.dispatchEvent(new Event(\"pmw_cookie_consent_management_loaded\"))\n\t\tdocument.dispatchEvent(new Event(\"pmwCookieConsentManagementLoaded\"))\n\t}\n\n\tpmw.triggerPmwCookieConsentManagementLoaded()\n\n\t// Get that state for the statistics or marketing cookies\n\tpmw.getConsentValues = () => {\n\t\treturn wpm.getConsentValues()\n\t}\n\n}(window.pmw = window.pmw || {}, jQuery))\n","/**\n * remove_from_cart event\n *\n * Cannot be attached directly because the mini cart doesn't necessarily contain the remove button on page load.\n */\njQuery(document).on(\"click\", \".remove_from_cart_button, .remove\", (event) => {\n\n\t// console.log(\"remove_from_cart event\" + new Date().getTime())\n\n\ttry {\n\n\t\tlet url = new URL(jQuery(event.currentTarget).attr(\"href\"))\n\t\tlet productId = wpm.getProductIdByCartItemKeyUrl(url)\n\n\t\twpm.removeProductFromCart(productId)\n\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n\n/**\n * begin_checkout event\n *\n * Cannot be attached directly because the mini cart doesn't necessarily contain the remove button on page load.\n */\nlet checkoutButtonClasses = [\n\t// \".checkout\", // this is too generic. It triggers on the checkout page on some themes fore each interaction with the checkout form.\n\t\".checkout-button\",\n\t\".cart-checkout-button\",\n\t\".button.checkout\",\n\t\".xoo-wsc-ft-btn-checkout\", // https://xootix.com/side-cart-for-woocommerce/\n\t\".elementor-button--checkout\",\n\t\".xt_woofc-checkout\", // https://wordpress.org/plugins/woo-floating-cart-lite/\n\t\".fkcart-checkout--text\", // https://funnelkit.com/\n]\n\nconst checkoutButtonSelectors = wpm.prepareSelectors(checkoutButtonClasses, \"beginCheckout\")\n\n// console.log(\"checkoutButtonSelectors\", checkoutButtonSelectors)\n\n// https://wordpress.stackexchange.com/a/352171/68337\njQuery(document).on(\"click init_checkout\", checkoutButtonSelectors, () => {\n\n\t// console.log(\"init_checkout at: \" + new Date().getTime())\n\n\tjQuery(document).trigger(\"wpmBeginCheckout\")\n})\n\njQuery(document).on(\"updated_cart_totals\", () => {\n\tjQuery(document).trigger(\"wpmViewCart\")\n})\n\n/**\n * Set up PWM events\n */\n\n// track checkout option event: purchase click\n// https://wordpress.stackexchange.com/a/352171/68337\njQuery(document).on(\"wpmLoad\", (event) => {\n\tjQuery(document).on(\"payment_method_selected\", () => {\n\n\t\tif (false === wpm.paymentMethodSelected) {\n\t\t\twpm.fireCheckoutProgress(3)\n\t\t}\n\n\t\twpm.fireCheckoutOption(3, jQuery(\"input[name='payment_method']:checked\").val())\n\t\twpm.paymentMethodSelected = true\n\t})\n})\n\n// populate the wpmDataLayer with the cart items\njQuery(document).on(\"wpmLoad\", () => {\n\n\ttry {\n\t\t// When a new session is initiated there are no items in the cart,\n\t\t// so we can save the call to get the cart items\n\t\tif (wpm.doesWooCommerceCartExist()) wpm.getCartItems()\n\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// get all add-to-cart= products from backend\njQuery(document).on(\"wpmLoad\", () => {\n\n\twpmDataLayer.products = wpmDataLayer.products || {}\n\n\t// scan page for add-to-cart= links\n\tlet productIds = wpm.getAddToCartLinkProductIds()\n\n\twpm.getProductsFromBackend(productIds)\n})\n\n/**\n * Save the referrer into a cookie\n */\n\njQuery(document).on(\"wpmLoad\", () => {\n\n\t// can't use session storage as we can't read it from the server\n\tif (!wpm.getCookie(\"wpmReferrer\")) {\n\n\t\tif (document.referrer) {\n\t\t\tlet referrerUrl = new URL(document.referrer)\n\t\t\tlet referrerHostname = referrerUrl.hostname\n\n\t\t\tif (referrerHostname !== window.location.host) {\n\t\t\t\twpm.setCookie(\"wpmReferrer\", referrerHostname)\n\t\t\t}\n\t\t}\n\t}\n})\n\n\n/**\n * Create our own load event in order to better handle script flow execution when JS \"optimizers\" shuffle the code.\n */\njQuery(document).on(\"wpmLoad\", () => {\n\t// document.addEventListener(\"wpmLoad\", function () {\n\ttry {\n\t\tif (typeof wpmDataLayer != \"undefined\" && !wpmDataLayer?.wpmLoadFired) {\n\n\t\t\tjQuery(document).trigger(\"wpmLoadAlways\")\n\n\t\t\tif (wpmDataLayer?.shop) {\n\t\t\t\tif (\n\t\t\t\t\t\"product\" === wpmDataLayer.shop.page_type &&\n\t\t\t\t\t\"variable\" !== wpmDataLayer.shop.product_type &&\n\t\t\t\t\twpm.getMainProductIdFromProductPage()\n\t\t\t\t) {\n\t\t\t\t\tlet product = wpm.getProductDataForViewItemEvent(wpm.getMainProductIdFromProductPage())\n\t\t\t\t\tjQuery(document).trigger(\"wpmViewItem\", product)\n\t\t\t\t} else if (\"product_category\" === wpmDataLayer.shop.page_type) {\n\t\t\t\t\tjQuery(document).trigger(\"wpmCategory\")\n\t\t\t\t} else if (\"search\" === wpmDataLayer.shop.page_type) {\n\t\t\t\t\tjQuery(document).trigger(\"pmwEvent:Search\")\n\t\t\t\t} else if (\"cart\" === wpmDataLayer.shop.page_type) {\n\t\t\t\t\tjQuery(document).trigger(\"wpmViewCart\")\n\t\t\t\t} else if (\"order_received_page\" === wpmDataLayer.shop.page_type) {\n\t\t\t\t\tif (wpmDataLayer?.order && !wpm.isOrderIdStored(wpmDataLayer.order.id)) {\n\t\t\t\t\t\tjQuery(document).trigger(\"wpmOrderReceivedPage\")\n\t\t\t\t\t\twpm.writeOrderIdToStorage(wpmDataLayer.order.id, wpmDataLayer.order.key)\n\t\t\t\t\t\tif (typeof wpm.acrRemoveCookie === \"function\") wpm.acrRemoveCookie()\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tjQuery(document).trigger(\"wpmEverywhereElse\")\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tjQuery(document).trigger(\"wpmEverywhereElse\")\n\t\t\t}\n\n\t\t\tif (wpmDataLayer?.user?.id && !wpm.hasLoginEventFired()) {\n\t\t\t\tjQuery(document).trigger(\"wpmLogin\")\n\t\t\t\twpm.setLoginEventFired()\n\t\t\t}\n\n\t\t\t// /**\n\t\t\t// * Load mini cart fragments into a wpm session storage key,\n\t\t\t// * after the document load event.\n\t\t\t// */\n\t\t\t// jQuery(document).ajaxSend(function (event, jqxhr, settings) {\n\t\t\t// \t// console.log('settings.url: ' + settings.url);\n\t\t\t//\n\t\t\t// \tif (settings.url.includes(\"get_refreshed_fragments\") && sessionStorage) {\n\t\t\t// \t\tif (!sessionStorage.getItem(\"wpmMiniCartActive\")) {\n\t\t\t// \t\t\tsessionStorage.setItem(\"wpmMiniCartActive\", JSON.stringify(true))\n\t\t\t// \t\t}\n\t\t\t// \t}\n\t\t\t// })\n\n\t\t\twpmDataLayer.wpmLoadFired = true\n\t\t}\n\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\njQuery(document).on(\"wpmLoad\", async () => {\n\n\tif (\n\t\twindow.sessionStorage &&\n\t\twindow.sessionStorage.getItem(\"_pmw_endpoint_available\") &&\n\t\t!JSON.parse(window.sessionStorage.getItem(\"_pmw_endpoint_available\"))\n\t) {\n\t\tconsole.error(\"Pixel Manager for WooCommerce: REST endpoint is not available. Using admin-ajax.php instead.\")\n\t}\n})\n\n\n/**\n * Load all pixels\n */\njQuery(document).on(\"wpmPreLoadPixels\", () => {\n\n\tif (wpmDataLayer?.shop?.cookie_consent_mgmt?.explicit_consent && !wpm.explicitConsentStateAlreadySet()) {\n\t\twpm.updateConsentCookieValues(null, null, true)\n\t}\n\n\tjQuery(document).trigger(\"wpmLoadPixels\", {})\n})\n\n\n/**\n * All ecommerce events\n */\n\n/**\n * Add to cart event\n */\njQuery(document).on(\"wpmAddToCart\", (event, product) => {\n\n\t/**\n\t * Prepare the payload\n\t */\n\n\tlet payload = {\n\t\tevent : \"addToCart\",\n\t\tproduct: product,\n\t}\n\n\t// Facebook\n\t// If Facebook pixel is loaded, add Facebook server to server event data to the payload\n\tif (wpmDataLayer?.pixels?.facebook?.loaded) {\n\t\tpayload.facebook = {\n\t\t\tevent_name : \"AddToCart\",\n\t\t\tevent_id : wpm.getFbRandomEventId(),\n\t\t\tuser_data : wpm.getFbUserData(),\n\t\t\tevent_source_url: window.location.href,\n\t\t\tcustom_data : wpm.fbGetProductDataForCapiEvent(product),\n\t\t}\n\t}\n\n\t// Pinterest\n\t// https://developers.pinterest.com/docs/conversions/best/\n\t// https://developers.pinterest.com/docs/api/v5/#operation/events/create\n\t// https://developers.pinterest.com/docs/conversions/event/\n\tif (wpmDataLayer?.pixels?.pinterest?.loaded) {\n\n\t\tpayload.pinterest = wpm.getPinterestS2SBaseData()\n\n\t\tpayload.pinterest.event_name = \"addtocart\"\n\t\tpayload.pinterest.custom_data = wpm.pinterestGetProductDataForCapiEvent(product)\n\t}\n\n\t// TikTok\n\t// https://ads.tiktok.com/gateway/docs/index?identify_key=c0138ffadd90a955c1f0670a56fe348d1d40680b3c89461e09f78ed26785164b&language=ENGLISH&doc_id=1739585702922241#item-link-Adding%20parameters%20to%20event%20code\n\tif (wpmDataLayer?.pixels?.tiktok?.loaded) {\n\t\tpayload.tiktok = {\n\t\t\tevent : \"AddToCart\",\n\t\t\tevent_id : wpm.getRandomEventId(),\n\t\t\tcontext : wpm.getTikTokUserDataFromBrowser(),\n\t\t\tproperties: {\n\t\t\t\tvalue : product.price * product.quantity,\n\t\t\t\tcurrency: product.currency,\n\t\t\t\tcontents: [{\n\t\t\t\t\tcontent_id : product.dyn_r_ids[wpmDataLayer.pixels.tiktok.dynamic_remarketing.id_type],\n\t\t\t\t\tcontent_type: \"product\",\n\t\t\t\t\tcontent_name: product.name,\n\t\t\t\t\tquantity : product.quantity,\n\t\t\t\t\tprice : product.price,\n\t\t\t\t}],\n\t\t\t},\n\t\t}\n\t}\n\n\t/**\n\t * Process the client-to-server event\n\t */\n\n\tjQuery(document).trigger(\"wpmClientSideAddToCart\", payload)\n\n\t/**\n\t * Process the server-to-server event\n\t */\n\n\t// If function wpm.isServerToServerEnabled() exists, then run it\n\tif (typeof wpm.sendEventPayloadToServer === \"function\") {\n\t\twpm.sendEventPayloadToServer(payload)\n\t}\n})\n\n/**\n * Begin checkout event\n */\njQuery(document).on(\"wpmBeginCheckout\", () => {\n\n\t/**\n\t * Prepare the payload\n\t */\n\n\tlet payload = {\n\t\tevent: \"beginCheckout\",\n\t}\n\n\t// Facebook\n\tif (wpmDataLayer?.pixels?.facebook?.loaded) {\n\t\tpayload.facebook = {\n\t\t\tevent_name : \"InitiateCheckout\",\n\t\t\tevent_id : wpm.getFbRandomEventId(),\n\t\t\tuser_data : wpm.getFbUserData(),\n\t\t\tevent_source_url: window.location.href,\n\t\t\tcustom_data : {},\n\t\t}\n\n\t\tif (wpmDataLayer?.cart && !jQuery.isEmptyObject(wpmDataLayer.cart)) {\n\t\t\tpayload.facebook.custom_data = {\n\t\t\t\tcontent_type: \"product\",\n\t\t\t\tcontent_ids : wpm.fbGetContentIdsFromCart(),\n\t\t\t\tvalue : wpm.getCartValue(),\n\t\t\t\tcurrency : wpmDataLayer.shop.currency,\n\t\t\t}\n\t\t}\n\t}\n\n\t// TikTok\n\tif (wpmDataLayer?.pixels?.tiktok?.loaded) {\n\t\tpayload.tiktok = {\n\t\t\tevent : \"InitiateCheckout\",\n\t\t\tevent_id : wpm.getRandomEventId(),\n\t\t\tcontext : wpm.getTikTokUserDataFromBrowser(),\n\t\t\tproperties: wpm.tiktokGetPropertiesFromCart(),\n\t\t}\n\t}\n\n\t/**\n\t * Process the client-to-server event\n\t */\n\n\tjQuery(document).trigger(\"wpmClientSideBeginCheckout\", payload)\n\n\t/**\n\t * Process the server-to-server event\n\t */\n\n\t// If function wpm.isServerToServerEnabled() exists, then run it\n\tif (typeof wpm.sendEventPayloadToServer === \"function\") {\n\t\twpm.sendEventPayloadToServer(payload)\n\t}\n})\n\n/**\n * Add to wishlist event\n */\njQuery(document).on(\"wpmAddToWishlist\", (event, product) => {\n\n\t/**\n\t * Prepare the payload\n\t */\n\n\tlet payload = {\n\t\tevent : \"addToWishlist\",\n\t\tproduct: product,\n\t}\n\n\t// Facebook\n\tif (wpmDataLayer?.pixels?.facebook?.loaded) {\n\t\tpayload.facebook = {\n\t\t\tevent_name : \"AddToWishlist\",\n\t\t\tevent_id : wpm.getFbRandomEventId(),\n\t\t\tuser_data : wpm.getFbUserData(),\n\t\t\tevent_source_url: window.location.href,\n\t\t\tcustom_data : wpm.fbGetProductDataForCapiEvent(product),\n\t\t}\n\t}\n\n\t// TikTok\n\tif (wpmDataLayer?.pixels?.tiktok?.loaded) {\n\t\tpayload.tiktok = {\n\t\t\tevent : \"AddToWishlist\",\n\t\t\tevent_id : wpm.getRandomEventId(),\n\t\t\tcontext : wpm.getTikTokUserDataFromBrowser(),\n\t\t\tproperties: {\n\t\t\t\tvalue : product.price * product.quantity,\n\t\t\t\tcurrency: product.currency,\n\t\t\t\tcontents: [{\n\t\t\t\t\tcontent_id : product.dyn_r_ids[wpmDataLayer.pixels.tiktok.dynamic_remarketing.id_type],\n\t\t\t\t\tcontent_type: \"product\",\n\t\t\t\t\tcontent_name: product.name,\n\t\t\t\t\tquantity : product.quantity,\n\t\t\t\t\tprice : product.price,\n\t\t\t\t}],\n\t\t\t},\n\t\t}\n\t}\n\n\t/**\n\t * Process the client-to-server event\n\t */\n\n\tjQuery(document).trigger(\"wpmClientSideAddToWishlist\", payload)\n\n\t/**\n\t * Process the server-to-server event\n\t */\n\n\t// If function wpm.isServerToServerEnabled() exists, then run it\n\tif (typeof wpm.sendEventPayloadToServer === \"function\") {\n\t\twpm.sendEventPayloadToServer(payload)\n\t}\n})\n\n/**\n * View Item event\n */\njQuery(document).on(\"wpmViewItem\", (event, product = null) => {\n\n\t/**\n\t * Prepare the payload\n\t */\n\n\tlet payload = {\n\t\tevent : \"viewItem\",\n\t\tproduct: product,\n\t}\n\n\t// Facebook\n\tif (wpmDataLayer?.pixels?.facebook?.loaded) {\n\t\tpayload.facebook = {\n\t\t\tevent_name : \"ViewContent\",\n\t\t\tevent_id : wpm.getFbRandomEventId(),\n\t\t\tuser_data : wpm.getFbUserData(),\n\t\t\tevent_source_url: window.location.href,\n\t\t\tcustom_data : {},\n\t\t}\n\n\t\tif (product) {\n\t\t\tpayload.facebook.custom_data = wpm.fbGetProductDataForCapiEvent(product)\n\t\t}\n\t}\n\n\t// Pinterest\n\t// https://developers.pinterest.com/docs/conversions/best/\n\t// https://developers.pinterest.com/docs/api/v5/#operation/events/create\n\t// https://developers.pinterest.com/docs/conversions/event/\n\tif (wpmDataLayer?.pixels?.pinterest?.loaded) {\n\n\t\tpayload.pinterest = wpm.getPinterestS2SBaseData()\n\n\t\tpayload.pinterest.event_name = \"pagevisit\"\n\n\t\tif (product) {\n\t\t\tpayload.pinterest.custom_data = wpm.pinterestGetProductDataForCapiEvent(product)\n\t\t}\n\t}\n\n\t// TikTok\n\tif (wpmDataLayer?.pixels?.tiktok?.loaded) {\n\t\tpayload.tiktok = {\n\t\t\tevent : \"ViewContent\",\n\t\t\tevent_id: wpm.getRandomEventId(),\n\t\t\tcontext : wpm.getTikTokUserDataFromBrowser(),\n\t\t}\n\n\t\tif (product) {\n\t\t\tpayload.tiktok.properties = {\n\t\t\t\tvalue : product.price * product.quantity,\n\t\t\t\tcurrency: product.currency,\n\t\t\t\tcontents: [{\n\t\t\t\t\tcontent_id : product.dyn_r_ids[wpmDataLayer.pixels.tiktok.dynamic_remarketing.id_type],\n\t\t\t\t\tcontent_type: \"product\",\n\t\t\t\t\tcontent_name: product.name,\n\t\t\t\t\tquantity : product.quantity,\n\t\t\t\t\tprice : product.price,\n\t\t\t\t}],\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Process the client-to-server event\n\t */\n\n\tjQuery(document).trigger(\"wpmClientSideViewItem\", payload)\n\n\t/**\n\t * Process the server-to-server event\n\t */\n\n\t// If function wpm.isServerToServerEnabled() exists, then run it\n\tif (typeof wpm.sendEventPayloadToServer === \"function\") {\n\t\twpm.sendEventPayloadToServer(payload)\n\t}\n})\n\n/**\n * View category event\n */\njQuery(document).on(\"wpmCategory\", (event, product = null) => {\n\n\t/**\n\t * Prepare the payload\n\t */\n\n\tlet payload = {\n\t\tevent: \"viewCategory\",\n\t}\n\n\t// Pinterest\n\t// https://developers.pinterest.com/docs/conversions/best/\n\t// https://developers.pinterest.com/docs/api/v5/#operation/events/create\n\t// https://developers.pinterest.com/docs/conversions/event/\n\tif (wpmDataLayer?.pixels?.pinterest?.loaded) {\n\n\t\tpayload.pinterest = wpm.getPinterestS2SBaseData()\n\n\t\tpayload.pinterest.event_name = \"viewcategory\"\n\t}\n\n\t/**\n\t * Process the client-to-server event\n\t */\n\n\tjQuery(document).trigger(\"wpmClientSideViewCategory\", payload)\n\n\t/**\n\t * Process the server-to-server event\n\t */\n\n\t// If function wpm.isServerToServerEnabled() exists, then run it\n\tif (typeof wpm.sendEventPayloadToServer === \"function\") {\n\t\twpm.sendEventPayloadToServer(payload)\n\t}\n})\n\n/**\n * Search event\n */\njQuery(document).on(\"pmwEvent:Search\", () => {\n\n\t/**\n\t * Prepare the payload\n\t */\n\n\tlet payload = {\n\t\tevent: \"search\",\n\t}\n\n\t// Facebook\n\tif (wpmDataLayer?.pixels?.facebook?.loaded) {\n\t\tpayload.facebook = {\n\t\t\tevent_name : \"Search\",\n\t\t\tevent_id : wpm.getFbRandomEventId(),\n\t\t\tuser_data : wpm.getFbUserData(),\n\t\t\tevent_source_url: window.location.href,\n\t\t\tcustom_data : {\n\t\t\t\tsearch_string: wpm.getSearchTermFromUrl(),\n\t\t\t},\n\t\t}\n\t}\n\n\t// Pinterest\n\t// https://developers.pinterest.com/docs/conversions/best/\n\t// https://developers.pinterest.com/docs/api/v5/#operation/events/create\n\t// https://developers.pinterest.com/docs/conversions/event/\n\tif (wpmDataLayer?.pixels?.pinterest?.loaded) {\n\n\t\tpayload.pinterest = wpm.getPinterestS2SBaseData()\n\n\t\tpayload.pinterest.event_name = \"search\"\n\t\tpayload.pinterest.custom_data = {\n\t\t\tsearch_string: wpm.getSearchTermFromUrl(),\n\t\t}\n\t}\n\n\t// TikTok\n\tif (wpmDataLayer?.pixels?.tiktok?.loaded) {\n\t\tpayload.tiktok = {\n\t\t\tevent : \"Search\",\n\t\t\tevent_id : wpm.getRandomEventId(),\n\t\t\tcontext : wpm.getTikTokUserDataFromBrowser(),\n\t\t\tproperties: {\n\t\t\t\tquery: wpm.getSearchTermFromUrl(),\n\t\t\t},\n\t\t}\n\t}\n\n\t/**\n\t * Process the client-to-server event\n\t */\n\n\tjQuery(document).trigger(\"wpmClientSideSearch\", payload)\n\n\t/**\n\t * Process the server-to-server event\n\t */\n\n\t// If function wpm.isServerToServerEnabled() exists, then run it\n\tif (typeof wpm.sendEventPayloadToServer === \"function\") {\n\t\twpm.sendEventPayloadToServer(payload)\n\t}\n})\n\n/**\n * Place order event\n */\njQuery(document).on(\"wpmPlaceOrder\", () => {\n\n\t/**\n\t * Prepare the payload\n\t */\n\n\tlet payload = {\n\t\tevent: \"placeOrder\",\n\t}\n\n\t// TikTok\n\tif (wpmDataLayer?.pixels?.tiktok?.loaded) {\n\t\tpayload.tiktok = {\n\t\t\tevent : \"PlaceAnOrder\",\n\t\t\tevent_id : wpm.getRandomEventId(),\n\t\t\tcontext : wpm.getTikTokUserDataFromBrowser(),\n\t\t\tproperties: wpm.tiktokGetPropertiesFromCart(),\n\t\t}\n\t}\n\n\t/**\n\t * Process the client-to-server event\n\t */\n\n\tjQuery(document).trigger(\"wpmClientPlaceOrder\", payload)\n\n\t/**\n\t * Process the server-to-server event\n\t */\n\n\t// If function wpm.isServerToServerEnabled() exists, then run it\n\tif (typeof wpm.sendEventPayloadToServer === \"function\") {\n\t\twpm.sendEventPayloadToServer(payload)\n\t}\n})\n\n/**\n * Order received event\n */\njQuery(document).on(\"wpmOrderReceivedPage\", () => {\n\n\t/**\n\t * Prepare the payload\n\t */\n\n\tlet payload = {\n\t\tevent: \"orderReceived\",\n\t}\n\n\t// Facebook\n\tif (wpmDataLayer?.pixels?.facebook?.loaded) {\n\t\tpayload.facebook = {\n\t\t\tevent_name : \"Purchase\",\n\t\t\tevent_id : wpmDataLayer.order.id.toString(),\n\t\t\tuser_data : wpm.getFbUserData(),\n\t\t\tevent_source_url: window.location.href,\n\t\t\tcustom_data : {\n\t\t\t\tcontent_type: \"product\",\n\t\t\t\tvalue : wpmDataLayer.order.value_filtered,\n\t\t\t\tcurrency : wpmDataLayer.order.currency,\n\t\t\t\tcontent_ids : wpm.facebookContentIds(),\n\t\t\t},\n\t\t}\n\t}\n\n\t// Pinterest\n\t// https://developers.pinterest.com/docs/conversions/best/\n\t// https://developers.pinterest.com/docs/api/v5/#operation/events/create\n\t// https://developers.pinterest.com/docs/conversions/event/\n\tif (wpmDataLayer?.pixels?.pinterest?.loaded) {\n\n\t\tpayload.pinterest = wpm.getPinterestS2SBaseData()\n\n\t\tpayload.pinterest.event_name = \"checkout\"\n\t}\n\n\t// TikTok\n\t// https://ads.tiktok.com/help/article/standard-events-parameters\n\tif (wpmDataLayer?.pixels?.tiktok?.loaded) {\n\t\tpayload.tiktok = {\n\t\t\tevent : \"CompletePayment\",\n\t\t\tevent_id : wpmDataLayer.order.id.toString(),\n\t\t\tcontext : wpm.getTikTokUserDataFromBrowser(),\n\t\t\tproperties: {\n\t\t\t\tvalue : wpmDataLayer.order.value_filtered,\n\t\t\t\tcurrency: wpmDataLayer.order.currency,\n\t\t\t\tcontents: wpm.getTikTokOrderItemIds(),\n\t\t\t},\n\t\t}\n\t}\n\n\t/**\n\t * Process the client-to-server event\n\t */\n\n\tjQuery(document).trigger(\"wpmClientSideOrderReceivedPage\", payload)\n\n\t/**\n\t * Process the server-to-server event\n\t */\n\n\t// ! No server-to-server event is sent for this event because it is compiled and sent from the server directly\n})\n\njQuery(document).on(\"pmw:ready\", async () => {\n\n\t/**\n\t * Run as soon as wpm namespace is loaded\n\t */\n\n\t// Watch for products visible in viewport\n\twpm.startIntersectionObserverToWatch()\n\n\t// Watch for lazy loaded products\n\twpm.startProductsMutationObserverToWatch()\n})\n\n\n\n\n","/**\n * Register event listeners\n */\n\n\n/**\n * add_to_cart event\n *\n * WC is inconsistent with events that emit add-to-cart events.\n * adding_to_cart and added_to_are legacy events. Also, they only work\n * on Ajax buttons on shop pages.\n *\n * Never add document or body selectors.\n * The document selector doesn't work.\n * The body selector will cause the events to fire twice and other erratic behaviour if used along with other selectors.\n */\nconst addToCartSelectorsArray = [\n\t// \"document\",\n\t// \"body\",\n\t\".add_to_cart_button:not(.product_type_variable)\",\n\t\".ajax_add_to_cart\",\n\t\".single_add_to_cart_button\",\n]\n\nconst addToCartSelectors = wpm.prepareSelectors(addToCartSelectorsArray, \"addToCart\")\n\njQuery(addToCartSelectors).on(\"click adding_to_cart\", (event, data) => {\n\n\t// console.log(\"add_to_cart event fired at: \" + new Date().getTime())\n\t// console.log('add to cart data', data)\n\t// console.log('add to cart event', event)\n\t// console.log('add to cart jQuery(event.target.dataset)', jQuery(event.target.dataset))\n\t// console.log(\"add to cart event.target.dataset\", event.target.dataset)\n\t// console.log(\"add to cart event.target.dataset.quantity\", event.target.dataset.quantity)\n\t// console.log(\"add to cart event.target.dataset.product_id\", event.target.dataset.product_id)\n\n\ttry {\n\n\t\t// console.log(\"add_to_cart event detected\")\n\n\t\tlet quantity = event?.target?.dataset?.quantity ? event.target.dataset.quantity : null\n\t\tlet productId = event?.target?.dataset?.product_id ? event.target.dataset.product_id : null\n\n\t\t// let quantity = event.target.dataset.quantity ? event.target.dataset.quantity : 1\n\t\t// let productId = event.target.dataset.product_id ? event.target.dataset.product_id : null\n\n\t\t// Only process on product pages\n\t\tif (wpmDataLayer.shop.page_type === \"product\") {\n\n\t\t\t// First process related and upsell products\n\t\t\tif (\n\t\t\t\ttypeof jQuery(event.currentTarget).attr(\"href\") !== \"undefined\"\n\t\t\t\t&& jQuery(event.currentTarget).attr(\"href\").includes(\"add-to-cart\")\n\t\t\t) {\n\n\t\t\t\tif (!productId) {\n\t\t\t\t\tproductId = jQuery(event.currentTarget).data(\"product_id\")\n\t\t\t\t}\n\n\t\t\t\twpm.addProductToCart(productId, 1)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// If is simple product\n\t\t\tif (wpmDataLayer.shop.product_type === \"simple\") {\n\n\t\t\t\tif (quantity === null) {\n\t\t\t\t\tquantity = Number(jQuery(\".input-text.qty\").val()) ? Number(jQuery(\".input-text.qty\").val()) : 1\n\t\t\t\t}\n\n\t\t\t\tif (!productId) {\n\t\t\t\t\tproductId = jQuery(event.currentTarget).val()\n\t\t\t\t}\n\n\t\t\t\t// Fallback if the body selector is used\n\t\t\t\tif (!productId) {\n\t\t\t\t\t// get the product ID from the element that has the class .product\n\t\t\t\t\t// that element will also have an ID that start with product- and ends with the product ID\n\t\t\t\t\t// example: product-123\n\t\t\t\t\t// save the product ID in the variable productId\n\t\t\t\t\tproductId = jQuery(\".product\").attr(\"id\").replace(\"product-\", \"\")\n\t\t\t\t}\n\n\t\t\t\twpm.addProductToCart(productId, quantity)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// If is variable product or variable-subscription\n\t\t\tif ([\"variable\", \"variable-subscription\"].indexOf(wpmDataLayer.shop.product_type) >= 0) {\n\n\t\t\t\tif (quantity === null) {\n\t\t\t\t\tquantity = Number(jQuery(\".input-text.qty\").val()) ? Number(jQuery(\".input-text.qty\").val()) : 1\n\t\t\t\t}\n\n\t\t\t\tif (!productId) {\n\t\t\t\t\tproductId = jQuery(\"[name='variation_id']\").val()\n\t\t\t\t}\n\n\t\t\t\twpm.addProductToCart(productId, quantity)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// If is grouped product\n\t\t\tif (wpmDataLayer.shop.product_type === \"grouped\") {\n\n\t\t\t\tjQuery(\".woocommerce-grouped-product-list-item\").each((index, element) => {\n\n\t\t\t\t\t// Can't rely on event.target.dataset as it always is sent with the parent product ID and the quantity 1\n\n\t\t\t\t\tquantity = Number(jQuery(element).find(\".input-text.qty\").val()) ? Number(jQuery(element).find(\".input-text.qty\").val()) : 1\n\n\t\t\t\t\tlet classes = jQuery(element).attr(\"class\")\n\t\t\t\t\tproductId = wpm.getPostIdFromString(classes)\n\n\t\t\t\t\twpm.addProductToCart(productId, quantity)\n\t\t\t\t})\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// If is bundle product\n\t\t\tif (wpmDataLayer.shop.product_type === \"bundle\") {\n\n\t\t\t\tif (quantity === null) {\n\t\t\t\t\tquantity = Number(jQuery(\".input-text.qty\").val()) ? Number(jQuery(\".input-text.qty\").val()) : 1\n\t\t\t\t}\n\n\t\t\t\tif (!productId) {\n\t\t\t\t\tproductId = jQuery(\"input[name=add-to-cart]\").val()\n\t\t\t\t}\n\n\t\t\t\twpm.addProductToCart(productId, quantity)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// everything else\n\t\t\tif (quantity === null) {\n\t\t\t\tquantity = Number(jQuery(\".input-text.qty\").val()) ? Number(jQuery(\".input-text.qty\").val()) : 1\n\t\t\t}\n\n\t\t\twpm.addProductToCart(productId, quantity)\n\n\t\t} else {\n\n\t\t\tif (quantity === null) {\n\t\t\t\tquantity = 1\n\t\t\t}\n\n\t\t\tif (!productId) {\n\t\t\t\t// console.log(\"add to cart event.currentTarget\", event.currentTarget)\n\t\t\t\tproductId = jQuery(event.currentTarget).data(\"product_id\") ? jQuery(event.currentTarget).data(\"product_id\") : null\n\t\t\t}\n\n\t\t\t// Another fallback to retrieve the product ID in case the ID is saved in the value attribute\n\t\t\tif (!productId) {\n\t\t\t\tproductId = jQuery(event.currentTarget).val() ? jQuery(event.currentTarget).val() : null\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tproductId\n\t\t\t\t&& quantity\n\t\t\t) {\n\t\t\t\twpm.addProductToCart(productId, quantity)\n\t\t\t}\n\t\t}\n\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n\n/**\n * If someone clicks anywhere on a custom /?add-to-cart=123 link\n * trigger the add to cart event\n */\n\n// jQuery(document).one(\"click\", \"a:not(.add_to_cart_button, .ajax_add_to_cart, .single_add_to_cart_button)\", (event) => {\njQuery(\"a:not(.add_to_cart_button, .ajax_add_to_cart, .single_add_to_cart_button)\").one(\"click\", (event) => {\n\n\ttry {\n\t\tif (jQuery(event.target).closest(\"a\").attr(\"href\")) {\n\n\t\t\tlet url = new URL(jQuery(event.currentTarget).attr(\"href\"), window.location.origin)\n\n\t\t\tif (url.searchParams.has(\"add-to-cart\")) {\n\n\t\t\t\tlet productId = url.searchParams.get(\"add-to-cart\")\n\t\t\t\twpm.addProductToCart(productId, 1)\n\t\t\t}\n\t\t}\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n// select item event\n// jQuery(document).on(\"click\", \".woocommerce-LoopProduct-link, .wc-block-grid__product, .product, .product-small, .type-product\", (event) => {\njQuery(\".woocommerce-LoopProduct-link, .wc-block-grid__product, .product, .product-small, .type-product\").on(\"click\", (event) => {\n\n\ttry {\n\n\t\t/**\n\t\t * On some pages the event fires multiple times, and on product pages\n\t\t * even on page load. Using e.stopPropagation helps to prevent this,\n\t\t * but I don't know why. We don't even have to use this, since only a real\n\t\t * product click yields a valid productId. So we filter the invalid click\n\t\t * events out later down in the code. I'll keep it that way because this is\n\t\t * the most compatible way across shops.\n\t\t *\n\t\t * e.stopPropagation();\n\t\t * */\n\n\t\tlet productId = jQuery(event.currentTarget).nextAll(\".wpmProductId:first\").data(\"id\")\n\n\t\t/**\n\t\t * On product pages, for some reason, the click event is triggered on the main product on page load.\n\t\t * In that case no ID is found. But we can discard it, since we only want to trigger the event on\n\t\t * related products, which are found below.\n\t\t */\n\n\t\tif (productId) {\n\n\t\t\tproductId = wpm.getIdBasedOndVariationsOutputSetting(productId)\n\n\t\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\t\tif (wpmDataLayer.products && wpmDataLayer.products[productId]) {\n\n\t\t\t\tlet product = wpm.getProductDetailsFormattedForEvent(productId)\n\n\t\t\t\tjQuery(document).trigger(\"wpmSelectContentGaUa\", product)\n\t\t\t\tjQuery(document).trigger(\"wpmSelectItem\", product)\n\t\t\t}\n\t\t}\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n\n// checkout_progress event\n// track checkout option event: entered valid billing email\n// jQuery(document).on(\"input\", \"#billing_email\", (event) => {\njQuery(\"#billing_email\").on(\"input\", (event) => {\n\n\tif (wpm.isEmail(jQuery(event.currentTarget).val())) {\n\t\t// wpm.fireCheckoutOption(2);\n\t\twpm.fireCheckoutProgress(2)\n\t\twpm.emailSelected = true\n\t}\n})\n\n\n/**\n * Place order button\n *\n * Track checkout option event: purchase click\n * https://stackoverflow.com/a/34112407/4688612\n * jQuery(document).one(\"click\", \"#place_order\", () => {\n *\n * Has to be hooked after document ready !\n */\njQuery(\"form.checkout\").on(\"checkout_place_order_success\", () => {\n\n\t// console log current time\n\t// console.log(\"checkout_place_order_success event fired at: \" + new Date().getTime())\n\n\tif (false === wpm.emailSelected) {\n\t\twpm.fireCheckoutProgress(2)\n\t}\n\n\tif (false === wpm.paymentMethodSelected) {\n\t\twpm.fireCheckoutProgress(3)\n\t\twpm.fireCheckoutOption(3, jQuery(\"input[name='payment_method']:checked\").val())\n\t}\n\n\twpm.fireCheckoutProgress(4)\n\n\tjQuery(document).trigger(\"wpmPlaceOrder\", {})\n})\n\n/**\n * Update cart event\n *\n * Has to be hooked after document ready !\n */\njQuery(\"[name='update_cart']\").on(\"click\", () => {\n\n\t// console.log(\"update_cart event fired at: \" + new Date().getTime())\n\n\ttry {\n\t\tjQuery(\".cart_item\").each((index, element) => {\n\n\t\t\tconst productId = wpm.getProductIdByCartItemElement(element)\n\n\t\t\tif (!productId) {\n\t\t\t\tconsole.error(\"Pixel Manager: Wasn't able to retrieve a productId\")\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst quantity = wpm.getProductQuantityByCartItemElement(element)\n\n\t\t\tif (!quantity) {\n\t\t\t\tconsole.error(\"Pixel Manager: Wasn't able to retrieve a quantity\")\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// console.log(\"productId\", productId)\n\t\t\t// console.log(\"quantity\", quantity)\n\n\t\t\tif (quantity === 0) {\n\t\t\t\twpm.removeProductFromCart(productId)\n\t\t\t} else if (quantity < wpmDataLayer.cart[productId].quantity) {\n\t\t\t\twpm.removeProductFromCart(productId, wpmDataLayer.cart[productId].quantity - quantity)\n\t\t\t} else if (quantity > wpmDataLayer.cart[productId].quantity) {\n\t\t\t\twpm.addProductToCart(productId, quantity - wpmDataLayer.cart[productId].quantity)\n\t\t\t}\n\t\t})\n\t} catch (e) {\n\t\tconsole.error(e)\n\t\twpm.getCartItemsFromBackend()\n\t}\n})\n\n// add_to_wishlist\njQuery(\".add_to_wishlist,.wl-add-to\").on(\"click\", event => {\n\n\ttry {\n\n\t\tlet productId\n\n\t\tif (jQuery(event.currentTarget).data(\"productid\")) { // for the WooCommerce wishlist plugin\n\n\t\t\tproductId = jQuery(event.currentTarget).data(\"productid\")\n\t\t} else if (jQuery(event.currentTarget).data(\"product-id\")) { // for the YITH wishlist plugin\n\n\t\t\tproductId = jQuery(event.currentTarget).data(\"product-id\")\n\t\t}\n\n\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\tlet product = wpm.getProductDetailsFormattedForEvent(productId)\n\n\n\t\tjQuery(document).trigger(\"wpmAddToWishlist\", product)\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n\n/**\n * Called when the user selects all the required dropdowns / attributes\n *\n * Has to be hooked after document ready !\n *\n * https://stackoverflow.com/a/27849208/4688612\n * https://stackoverflow.com/a/65065335/4688612\n */\n\njQuery(\".single_variation_wrap\").on(\"show_variation\", (event, variation) => {\n\n\ttry {\n\t\tlet productId = wpm.getIdBasedOndVariationsOutputSetting(variation.variation_id)\n\n\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\twpm.triggerViewItemEventPrep(productId)\n\n\t} catch (e) {\n\t\tconsole.error(e)\n\t}\n})\n\n\n/**\n * Called on variable products when no selection has been done yet\n * or when the visitor deselects his choice.\n *\n * Has to be hooked after document ready !\n */\n\n// jQuery(function () {\n//\n// \tjQuery(\".single_variation_wrap\").on(\"hide_variation\", function () {\n//\n// \t\ttry {\n// \t\t\tlet classes = jQuery(\"body\").attr(\"class\")\n// \t\t\tlet productId = classes.match(/(postid-)(\\d+)/)[2]\n//\n// \t\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n//\n// \t\t\t/**\n// \t\t\t * If we have a variable product with no preset,\n// \t\t\t * and variations output is enabled,\n// \t\t\t * then we send a viewItem event with the first\n// \t\t\t * variation we find for the parent.\n// \t\t\t * If variations output is disabled,\n// \t\t\t * we just send the parent ID.\n// \t\t\t *\n// \t\t\t * And if Facebook microdata is active, use the\n// \t\t\t * microdata product ID.\n// \t\t\t */\n//\n// \t\t\tif (\n// \t\t\t\t\"variable\" === wpmDataLayer.shop.product_type &&\n// \t\t\t\twpmDataLayer?.general?.variationsOutput\n// \t\t\t) {\n// \t\t\t\tfor (const [key, product] of Object.entries(wpmDataLayer.products)) {\n// \t\t\t\t\tif (\"parentId\" in product) {\n//\n// \t\t\t\t\t\tproductId = product.id\n// \t\t\t\t\t\tbreak\n// \t\t\t\t\t}\n// \t\t\t\t}\n//\n// \t\t\t\tif (wpmDataLayer?.pixels?.facebook?.microdata_product_id) {\n// \t\t\t\t\tproductId = wpmDataLayer.pixels.facebook.microdata_product_id\n// \t\t\t\t}\n// \t\t\t}\n//\n// \t\t\t// console.log(\"hmm\")\n// \t\t\twpm.triggerViewItemEventPrep(productId)\n//\n// \t\t} catch (e) {\n// \t\t\tconsole.error(e)\n// \t\t}\n// \t})\n// })\n\n// jQuery(function () {\n//\n// \tjQuery(\".single_variation_wrap\").on(\"hide_variation\", function () {\n// \t\tjQuery(document).trigger(\"wpmviewitem\")\n// \t})\n// })\n","/**\n * Create a wpm namespace under which all functions are declared\n */\n\n// https://stackoverflow.com/a/5947280/4688612\n\n(function (wpm, $, undefined) {\n\n\tconst wpmDeduper = {\n\t\tkeyName : \"_wpm_order_ids\",\n\t\tcookieExpiresDays: 365,\n\t}\n\n\tconst wpmRestSettings = {\n\t\t// cookiesAvailable : '_wpm_cookies_are_available',\n\t\tcookiePmwRestEndpointAvailable: \"_pmw_endpoint_available\",\n\t\trestEndpointPost : \"pmw/v1/test/\",\n\t\trestFails : 0,\n\t\trestFailsThreshold : 10,\n\t}\n\n\twpm.emailSelected = false\n\twpm.paymentMethodSelected = false\n\n\t// wpm.checkIfCookiesAvailable = function () {\n\t//\n\t// // read the cookie if previously set, if it is return true, otherwise continue\n\t// if (wpm.getCookie(wpmRestSettings.cookiesAvailable)) {\n\t// return true;\n\t// }\n\t//\n\t// // set the cookie for the session\n\t// Cookies.set(wpmRestSettings.cookiesAvailable, true);\n\t//\n\t// // read cookie, true if ok, false if not ok\n\t// return !!wpm.getCookie(wpmRestSettings.cookiesAvailable);\n\t// }\n\n\twpm.useRestEndpoint = () => {\n\n\t\t// only if sessionStorage is available\n\n\t\t// only if REST API endpoint is generally accessible\n\t\t// check in sessionStorage if we checked before and return answer\n\t\t// otherwise check if the endpoint is available, save answer in sessionStorage and return answer\n\n\t\t// only if not too many REST API errors happened\n\n\t\treturn wpm.isSessionStorageAvailable() &&\n\t\t\twpm.isRestEndpointAvailable() &&\n\t\t\twpm.isBelowRestErrorThreshold()\n\t}\n\n\twpm.isBelowRestErrorThreshold = () => window.sessionStorage.getItem(wpmRestSettings.restFails) <= wpmRestSettings.restFailsThreshold\n\n\twpm.isRestEndpointAvailable = async () => {\n\n\t\tif (window.sessionStorage.getItem(wpmRestSettings.cookiePmwRestEndpointAvailable)) {\n\t\t\treturn JSON.parse(window.sessionStorage.getItem(wpmRestSettings.cookiePmwRestEndpointAvailable))\n\t\t} else {\n\t\t\treturn await wpm.testEndpoint()\n\t\t}\n\t}\n\n\twpm.isSessionStorageAvailable = () => !!window.sessionStorage\n\n\t// Test the endpoint by sending a POST request\n\twpm.testEndpoint = async (\n\t\turl = wpm.root + wpmRestSettings.restEndpointPost,\n\t\tcookieName = wpmRestSettings.cookiePmwRestEndpointAvailable,\n\t) => {\n\n\t\tlet response = await fetch(url, {\n\t\t\tmethod : \"POST\",\n\t\t\tmode : \"cors\",\n\t\t\tcache : \"no-cache\",\n\t\t\tkeepalive: true,\n\t\t})\n\n\t\tif (response.status === 200) {\n\t\t\twindow.sessionStorage.setItem(cookieName, JSON.stringify(true))\n\t\t\treturn true\n\t\t} else if (response.status === 404) {\n\t\t\twindow.sessionStorage.setItem(cookieName, JSON.stringify(false))\n\t\t\treturn false\n\t\t} else if (response.status === 0) {\n\t\t\twindow.sessionStorage.setItem(cookieName, JSON.stringify(false))\n\t\t\treturn false\n\t\t}\n\t}\n\n\twpm.isWpmRestEndpointAvailable = (cookieName = wpmRestSettings.cookiePmwRestEndpointAvailable) => !!wpm.getCookie(cookieName)\n\n\twpm.writeOrderIdToStorage = (orderId, orderKey, source = \"thankyou_page\", expireDays = 365) => {\n\n\t\t// save the order ID in the browser storage\n\n\t\tif (!window.Storage) {\n\t\t\tlet expiresDate = new Date()\n\t\t\texpiresDate.setDate(expiresDate.getDate() + wpmDeduper.cookieExpiresDays)\n\n\t\t\tlet ids = []\n\t\t\tif (checkCookie()) {\n\t\t\t\tids = JSON.parse(wpm.getCookie(wpmDeduper.keyName))\n\t\t\t}\n\n\t\t\tif (!ids.includes(orderId)) {\n\t\t\t\tids.push(orderId)\n\t\t\t\tdocument.cookie = wpmDeduper.keyName + \"=\" + JSON.stringify(ids) + \";expires=\" + expiresDate.toUTCString()\n\t\t\t}\n\n\t\t} else {\n\t\t\tif (localStorage.getItem(wpmDeduper.keyName) === null) {\n\t\t\t\tlet ids = []\n\t\t\t\tids.push(orderId)\n\t\t\t\twindow.localStorage.setItem(wpmDeduper.keyName, JSON.stringify(ids))\n\n\t\t\t} else {\n\t\t\t\tlet ids = JSON.parse(localStorage.getItem(wpmDeduper.keyName))\n\t\t\t\tif (!ids.includes(orderId)) {\n\t\t\t\t\tids.push(orderId)\n\t\t\t\t\twindow.localStorage.setItem(wpmDeduper.keyName, JSON.stringify(ids))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (typeof wpm.storeOrderIdOnServer === \"function\" && wpmDataLayer.orderDeduplication) {\n\t\t\twpm.storeOrderIdOnServer({\n\t\t\t\torderId : orderId,\n\t\t\t\torderKey: orderKey,\n\t\t\t\tsource : source,\n\t\t\t})\n\t\t}\n\t}\n\n\tfunction checkCookie() {\n\t\tlet key = wpm.getCookie(wpmDeduper.keyName)\n\t\treturn key !== \"\"\n\t}\n\n\twpm.isOrderIdStored = orderId => {\n\n\t\tif (wpmDataLayer.orderDeduplication) {\n\n\t\t\tif (!window.Storage) {\n\n\t\t\t\tif (checkCookie()) {\n\t\t\t\t\tlet ids = JSON.parse(wpm.getCookie(wpmDeduper.keyName))\n\t\t\t\t\treturn ids.includes(orderId)\n\t\t\t\t} else {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (localStorage.getItem(wpmDeduper.keyName) !== null) {\n\t\t\t\t\tlet ids = JSON.parse(localStorage.getItem(wpmDeduper.keyName))\n\t\t\t\t\treturn ids.includes(orderId)\n\t\t\t\t} else {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tconsole.log(\"order duplication prevention: off\")\n\t\t\treturn false\n\t\t}\n\t}\n\n\t/**\n\t * Check if the email address is valid\n\t *\n\t * https://stackoverflow.com/questions/201323/how-can-i-validate-an-email-address-using-a-regular-expression\n\t * https://www.w3.org/TR/html5/forms.html#valid-e-mail-address\n\t * https://fightingforalostcause.net/content/misc/2006/compare-email-regex.php\n\t *\n\t * @param email\n\t * @returns {boolean}\n\t */\n\twpm.isEmail = email => {\n\n\t\t/**\n\t\t * GitHub Copilot generated RFC 5322 compliant regex\n\t\t * - Don't allow emails without a top-level domain like \"john@localhost\"\n\t\t * - Don't allow emails with dots at the end of the name like \"john.doe.@example.com\"\n\t\t */\n\t\tlet regex = new RegExp(\n\t\t\t\"^(([^<>()\\\\[\\\\]\\\\\\\\.,;:\\\\s@\\\"]+(\\\\.[^<>()\\\\[\\\\]\\\\\\\\.,;:\\\\s@\\\"]+)*)|(\\\".+\\\"))\"\n\t\t\t+ \"@\"\n\t\t\t+ \"((\\\\[[0-9]{1,3}\\\\.[0-9]{1,3}\\\\.[0-9]{1,3}\\\\.[0-9]{1,3}\\\\])\"\n\t\t\t+ \"|(([a-zA-Z\\\\-0-9]+\\\\.)+[a-zA-Z]{2,}))$\",\n\t\t)\n\n\t\treturn regex.test(email)\n\t}\n\n\twpm.removeProductFromCart = async (productId, quantityToRemove = null) => {\n\n\t\ttry {\n\n\t\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\t\tproductId = wpm.getIdBasedOndVariationsOutputSetting(productId)\n\n\t\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\t\tlet quantity\n\n\t\t\tif (quantityToRemove == null) {\n\t\t\t\tquantity = wpmDataLayer.cart[productId].quantity\n\t\t\t} else {\n\t\t\t\tquantity = quantityToRemove\n\t\t\t}\n\n\t\t\tif (!wpmDataLayer.cart[productId]) {\n\t\t\t\tawait wpm.getProductsFromBackend([productId])\n\t\t\t}\n\n\t\t\tlet product = wpm.getProductDetailsFormattedForEvent(productId, quantity)\n\n\t\t\tjQuery(document).trigger(\"wpmRemoveFromCart\", product)\n\n\t\t\tif (quantityToRemove == null || wpmDataLayer.cart[productId].quantity === quantityToRemove) {\n\n\t\t\t\tdelete wpmDataLayer.cart[productId]\n\n\t\t\t\tif (sessionStorage) sessionStorage.setItem(\"wpmDataLayerCart\", JSON.stringify(wpmDataLayer.cart))\n\t\t\t} else {\n\n\t\t\t\twpmDataLayer.cart[productId].quantity = wpmDataLayer.cart[productId].quantity - quantity\n\n\t\t\t\tif (sessionStorage) sessionStorage.setItem(\"wpmDataLayerCart\", JSON.stringify(wpmDataLayer.cart))\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t\t// console.log('getting cart from back end');\n\t\t\t// wpm.getCartItemsFromBackend();\n\t\t\t// console.log('getting cart from back end done');\n\t\t}\n\t}\n\n\twpm.getIdBasedOndVariationsOutputSetting = productId => {\n\n\t\ttry {\n\t\t\tif (wpmDataLayer?.general?.variationsOutput) return productId\n\n\t\t\tif (wpmDataLayer.products[productId].isVariation) return wpmDataLayer.products[productId].parentId\n\n\t\t\treturn productId\n\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.prepareSelectors = (selectors, type) => {\n\n\t\tif (wpmDataLayer?.shop?.selectors?.[type]) {\n\n\t\t\t// merge the selectors from the addToCartSelectors array with the selectors from the wpmDataLayer.shop.selectors.addToCart array\n\t\t\tselectors = selectors.concat(wpmDataLayer.shop.selectors[type])\n\n\t\t\t// Remove duplicates\n\t\t\tselectors = [...new Set(selectors)]\n\n\t\t\t// If one of the selectors is document, remove it\n\t\t\tif (selectors.indexOf(\"document\") >= 0) {\n\t\t\t\tselectors.splice(selectors.indexOf(\"document\"), 1)\n\t\t\t}\n\n\t\t\t// If one of the selectors is body, remove all others\n\t\t\tif (selectors.indexOf(\"body\") >= 0) {\n\t\t\t\tselectors = [\"body\"]\n\t\t\t}\n\t\t}\n\n\t\treturn selectors.join(\", \")\n\t}\n\n\t// add_to_cart\n\twpm.addProductToCart = async (productId, quantity) => {\n\n\t\t// Cast quantity to number to make sure it's a number\n\t\tquantity = Number(quantity)\n\n\t\ttry {\n\n\t\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\t\tproductId = wpm.getIdBasedOndVariationsOutputSetting(productId)\n\n\t\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\t\tif (!wpmDataLayer?.products[productId]) {\n\t\t\t\tawait wpm.getProductsFromBackend([productId])\n\t\t\t}\n\n\t\t\tlet product = wpm.getProductDetailsFormattedForEvent(productId, quantity)\n\n\t\t\tjQuery(document).trigger(\"wpmAddToCart\", product)\n\n\t\t\t// add product to cart wpmDataLayer['cart']\n\n\t\t\t// if the product already exists in the object, only add the additional quantity\n\t\t\t// otherwise create that product object in the wpmDataLayer['cart']\n\t\t\tif (wpmDataLayer?.cart[productId]) {\n\n\t\t\t\twpmDataLayer.cart[productId].quantity = wpmDataLayer.cart[productId].quantity + quantity\n\t\t\t} else {\n\n\t\t\t\tif (!(\"cart\" in wpmDataLayer)) wpmDataLayer.cart = {}\n\n\t\t\t\twpmDataLayer.cart[productId] = wpm.getProductDetailsFormattedForEvent(productId, quantity)\n\t\t\t}\n\n\t\t\tif (sessionStorage) sessionStorage.setItem(\"wpmDataLayerCart\", JSON.stringify(wpmDataLayer.cart))\n\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\n\t\t\t// fallback if wpmDataLayer.cart and wpmDataLayer.products got out of sync in case cart caching has an issue\n\t\t\twpm.getCartItemsFromBackend()\n\t\t}\n\t}\n\n\twpm.getCartItems = () => {\n\n\t\tif (sessionStorage) {\n\t\t\tif (!sessionStorage.getItem(\"wpmDataLayerCart\") || wpmDataLayer.shop.page_type === \"order_received_page\") {\n\t\t\t\tsessionStorage.setItem(\"wpmDataLayerCart\", JSON.stringify({}))\n\t\t\t} else {\n\t\t\t\twpm.saveCartObjectToDataLayer(JSON.parse(sessionStorage.getItem(\"wpmDataLayerCart\")))\n\t\t\t}\n\t\t} else {\n\t\t\twpm.getCartItemsFromBackend()\n\t\t}\n\t}\n\n\t// get all cart items from the backend\n\twpm.getCartItemsFromBackend = () => {\n\t\ttry {\n\n\t\t\t/**\n\t\t\t * Can't use a REST API endpoint, as the cart session will not be loaded if the\n\t\t\t * endpoint is called.\n\t\t\t *\n\t\t\t * https://wordpress.org/support/topic/wc-cart-is-null-in-custom-rest-api/#post-11442843\n\t\t\t */\n\n\t\t\t/**\n\t\t\t * Get the cart items from the backend the data object using fetch API\n\t\t\t * and log success or error messages\n\t\t\t * and url encoded data\n\t\t\t */\n\t\t\tfetch(wpm.ajax_url, {\n\t\t\t\tmethod : \"POST\",\n\t\t\t\tcache : \"no-cache\",\n\t\t\t\tbody : new URLSearchParams({action: \"pmw_get_cart_items\"}),\n\t\t\t\tkeepalive: true,\n\t\t\t})\n\t\t\t\t.then(response => {\n\t\t\t\t\tif (response.ok) {\n\t\t\t\t\t\treturn response.json()\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow Error(\"Error getting cart items from backend\")\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.then(data => {\n\n\t\t\t\t\tif (data.success) {\n\n\t\t\t\t\t\tif (!data.data[\"cart\"]) data.data[\"cart\"] = {}\n\n\t\t\t\t\t\twpm.saveCartObjectToDataLayer(data.data[\"cart\"])\n\n\t\t\t\t\t\tif (sessionStorage) sessionStorage.setItem(\"wpmDataLayerCart\", JSON.stringify(data.data[\"cart\"]))\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow Error(\"Error getting cart items from backend\")\n\t\t\t\t\t}\n\t\t\t\t})\n\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\t// get productIds from the backend\n\twpm.getProductsFromBackend = async productIds => {\n\n\t\tif (wpmDataLayer?.products) {\n\t\t\t// If productIds already exists as key in wpmDataLayer.products, remove it from the array\n\t\t\tproductIds = productIds.filter(productId => !(productId in wpmDataLayer.products))\n\t\t}\n\n\t\t// if no products IDs are in the object, don't try to get anything from the server\n\t\tif (!productIds || productIds.length === 0) return\n\n\t\ttry {\n\n\t\t\tlet response\n\n\t\t\tif (await wpm.isRestEndpointAvailable()) {\n\t\t\t\tresponse = await fetch(wpm.root + \"pmw/v1/products/\", {\n\t\t\t\t\tmethod : \"POST\",\n\t\t\t\t\tcache : \"no-cache\",\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t\t\t},\n\t\t\t\t\tbody : JSON.stringify({\n\t\t\t\t\t\tpageId : wpmDataLayer.general.pageId,\n\t\t\t\t\t\tpageType : wpmDataLayer.shop.page_type,\n\t\t\t\t\t\tproductIds: productIds,\n\t\t\t\t\t}),\n\t\t\t\t})\n\t\t\t} else {\n\n\t\t\t\t// Get the product details from the backend the data object using fetch API\n\t\t\t\t// and log success or error messages\n\t\t\t\t// and url encoded data\n\t\t\t\tresponse = await fetch(wpm.ajax_url, {\n\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\tcache : \"no-cache\",\n\t\t\t\t\tbody : new URLSearchParams({\n\t\t\t\t\t\taction : \"pmw_get_product_ids\",\n\t\t\t\t\t\tpageId : wpmDataLayer.general.pageId,\n\t\t\t\t\t\tpageType : wpmDataLayer.shop.page_type,\n\t\t\t\t\t\tproductIds: productIds,\n\t\t\t\t\t}),\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tif (response.ok) {\n\t\t\t\tlet responseData = await response.json()\n\t\t\t\tif (responseData.success) {\n\t\t\t\t\twpmDataLayer.products = Object.assign({}, wpmDataLayer.products, responseData.data)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconsole.error(\"Error getting products from backend\")\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\n\t\treturn true\n\t}\n\n\twpm.saveCartObjectToDataLayer = cartObject => {\n\n\t\twpmDataLayer.cart = cartObject\n\t\twpmDataLayer.products = Object.assign({}, wpmDataLayer.products, cartObject)\n\t}\n\n\twpm.triggerViewItemEventPrep = async productId => {\n\n\t\tif (wpmDataLayer.products && wpmDataLayer.products[productId]) {\n\n\t\t\twpm.triggerViewItemEvent(productId)\n\t\t} else {\n\t\t\tawait wpm.getProductsFromBackend([productId])\n\t\t\twpm.triggerViewItemEvent(productId)\n\t\t}\n\t}\n\n\twpm.triggerViewItemEvent = productId => {\n\n\t\tlet product = wpm.getProductDetailsFormattedForEvent(productId)\n\n\t\tjQuery(document).trigger(\"wpmViewItem\", product)\n\t}\n\n\twpm.triggerViewItemEventNoProduct = () => {\n\t\tjQuery(document).trigger(\"wpmViewItem\")\n\t}\n\n\twpm.fireCheckoutOption = (step, checkout_option = null, value = null) => {\n\n\t\tlet data = {\n\t\t\tstep : step,\n\t\t\tcheckout_option: checkout_option,\n\t\t\tvalue : value,\n\t\t}\n\n\t\tjQuery(document).trigger(\"wpmFireCheckoutOption\", data)\n\t}\n\n\twpm.fireCheckoutProgress = step => {\n\n\t\tlet data = {\n\t\t\tstep: step,\n\t\t}\n\n\t\tjQuery(document).trigger(\"wpmFireCheckoutProgress\", data)\n\t}\n\n\twpm.getPostIdFromString = string => {\n\n\t\ttry {\n\t\t\treturn string.match(/(post-)(\\d+)/)[2]\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.triggerViewItemList = productId => {\n\n\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\tproductId = wpm.getIdBasedOndVariationsOutputSetting(productId)\n\n\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\tjQuery(document).trigger(\"wpmViewItemList\", wpm.getProductDataForViewItemEvent(productId))\n\t}\n\n\twpm.getProductDataForViewItemEvent = productId => {\n\n\t\tif (!productId) throw Error(\"Wasn't able to retrieve a productId\")\n\n\t\ttry {\n\t\t\tif (wpmDataLayer.products[productId]) {\n\n\t\t\t\treturn wpm.getProductDetailsFormattedForEvent(productId)\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.getMainProductIdFromProductPage = () => {\n\n\t\ttry {\n\t\t\tif ([\"simple\", \"variable\", \"grouped\", \"composite\", \"bundle\"].indexOf(wpmDataLayer.shop.product_type) >= 0) {\n\t\t\t\treturn jQuery(\".wpmProductId:first\").data(\"id\")\n\t\t\t} else {\n\t\t\t\treturn false\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.viewItemListTriggerTestMode = target => {\n\n\t\tjQuery(target).css({\"position\": \"relative\"})\n\t\tjQuery(target).append(\"\")\n\t\tjQuery(target).find(\"#viewItemListTriggerOverlay\").css({\n\t\t\t\"z-index\" : \"10\",\n\t\t\t\"display\" : \"block\",\n\t\t\t\"position\" : \"absolute\",\n\t\t\t\"height\" : \"100%\",\n\t\t\t\"top\" : \"0\",\n\t\t\t\"left\" : \"0\",\n\t\t\t\"right\" : \"0\",\n\t\t\t\"opacity\" : wpmDataLayer.viewItemListTrigger.opacity,\n\t\t\t\"background-color\": wpmDataLayer.viewItemListTrigger.backgroundColor,\n\t\t})\n\t}\n\n\twpm.getSearchTermFromUrl = () => {\n\n\t\ttry {\n\t\t\tlet urlParameters = new URLSearchParams(window.location.search)\n\t\t\treturn urlParameters.get(\"s\")\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\t// we need this to track timeouts for intersection observers\n\tlet ioTimeouts = {}\n\n\twpm.observerCallback = (entries, observer) => {\n\n\t\tentries.forEach((entry) => {\n\n\t\t\ttry {\n\t\t\t\tlet productId\n\n\t\t\t\tlet elementId = jQuery(entry.target).data(\"ioid\")\n\n\t\t\t\t// Get the productId from next element, if wpmProductId is a sibling, like in Gutenberg blocks\n\t\t\t\t// otherwise go search in children, like in regular WC loop items\n\t\t\t\tif (jQuery(entry.target).next(\".wpmProductId\").length) {\n\t\t\t\t\t// console.log('test 1');\n\t\t\t\t\tproductId = jQuery(entry.target).next(\".wpmProductId\").data(\"id\")\n\t\t\t\t} else {\n\t\t\t\t\tproductId = jQuery(entry.target).find(\".wpmProductId\").data(\"id\")\n\t\t\t\t}\n\n\n\t\t\t\tif (!productId) throw Error(\"wpmProductId element not found\")\n\n\t\t\t\tif (entry.isIntersecting) {\n\n\t\t\t\t\tioTimeouts[elementId] = setTimeout(() => {\n\n\t\t\t\t\t\twpm.triggerViewItemList(productId)\n\t\t\t\t\t\tif (wpmDataLayer.viewItemListTrigger.testMode) wpm.viewItemListTriggerTestMode(entry.target)\n\t\t\t\t\t\tif (wpmDataLayer.viewItemListTrigger.repeat === false) observer.unobserve(entry.target)\n\t\t\t\t\t}, wpmDataLayer.viewItemListTrigger.timeout)\n\n\t\t\t\t} else {\n\n\t\t\t\t\tclearTimeout(ioTimeouts[elementId])\n\t\t\t\t\tif (wpmDataLayer.viewItemListTrigger.testMode) jQuery(entry.target).find(\"#viewItemListTriggerOverlay\").remove()\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\tconsole.error(e)\n\t\t\t}\n\t\t})\n\t}\n\n\t// fire view_item_list only on products that have become visible\n\tlet io\n\tlet ioid = 0\n\n\tconst getCommonIdentifiersToWatch = () => {\n\n\t\tlet listOfClassNames = {\n\t\t\tnested: [],\n\t\t\tflat : [],\n\t\t}\n\n\t\ttry {\n\n\t\t\tconst haveSameNestingDepth = (element1, element2) => {\n\n\t\t\t\t// If both are the same, return the parent\n\t\t\t\treturn jQuery(element1).parents().length === jQuery(element2).parents().length\n\t\t\t}\n\n\t\t\tconst findCommonParentElement = (element1, element2) => {\n\t\t\t\t// If both are the same, return the parent\n\t\t\t\tif (jQuery(element1).parent().is(jQuery(element2).parent())) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tnode: jQuery(element1).parent(),\n\t\t\t\t\t\ttype: \"flat\",\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\tnode: jQuery(element1).parents().has(jQuery(element2).parents()).first(),\n\t\t\t\t\ttype: \"nested\",\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst countOfChildren = (element) => {\n\t\t\t\t// Return the count of \"wpmProductId\" elements\n\t\t\t\treturn jQuery(element).find(\".wpmProductId\").length\n\t\t\t}\n\n\t\t\tconst getCommonClass = (classes1, classes2) => {\n\n\t\t\t\t// console.log(\"classes1\", classes1);\n\t\t\t\t// console.log(\"classes2\", classes2);\n\t\t\t\t// classes 1 and 2 are arrays of classes\n\t\t\t\t// They may contain the same classes, but not in the same order\n\t\t\t\t// Return the first common class that's present in both arrays\n\n\t\t\t\treturn classes1.filter(value => classes2.includes(value))[0] || null\n\t\t\t}\n\n\t\t\tconst wpmProductIds = document.querySelectorAll(\".wpmProductId\")\n\n\t\t\t// If zero or only one product template is found, then we can't run the algorithm\n\t\t\tif (wpmProductIds.length === 1) {\n\t\t\t\tconsole.log(\"No product or too few templates found\")\n\t\t\t\treturn listOfClassNames\n\t\t\t}\n\n\t\t\t// console.log(\"wpmProductIds\", wpmProductIds);\n\t\t\t// console.log(\"looping\")\n\n\t\t\tfor (let i = 0; i < wpmProductIds.length - 1; i++) {\n\n\t\t\t\t// console.log(\"i\", i)\n\n\t\t\t\tif (!haveSameNestingDepth(wpmProductIds[i], wpmProductIds[i + 1])) {\n\t\t\t\t\t// console.log(\"The nesting depth is not the same\")\n\t\t\t\t\ti++\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tlet productsNode = findCommonParentElement(wpmProductIds[i], wpmProductIds[i + 1])\n\t\t\t\t// console.log(\"productsNode.node\", productsNode.node)\n\t\t\t\t// console.log(\"productsNode.type\", productsNode.type)\n\n\t\t\t\t// If the productsNode is nested, get the first class of the first child. Then console log the class\n\t\t\t\tif (productsNode.type === \"nested\") {\n\n\t\t\t\t\tlet firstChildClasses = productsNode.node.children().first().attr(\"class\").split(\" \")\n\t\t\t\t\tlet secondChildClasses = productsNode.node.children().first().next().attr(\"class\").split(\" \")\n\n\t\t\t\t\tconst commonClass = getCommonClass(firstChildClasses, secondChildClasses)\n\n\t\t\t\t\tlistOfClassNames.nested.push(commonClass)\n\t\t\t\t} else if (productsNode.type === \"flat\") {\n\n\t\t\t\t\t// If class is not found, continue\n\t\t\t\t\tif (!productsNode.node.children().first().attr(\"class\")) continue\n\n\t\t\t\t\t// firstProductTemplateClasses is the classes of the first child element of the productsNode\n\t\t\t\t\tlet firstProductTemplateClasses = productsNode.node.children().first().attr(\"class\").split(\" \")[0]\n\n\t\t\t\t\tlistOfClassNames.flat.push(firstProductTemplateClasses)\n\t\t\t\t}\n\n\t\t\t\t// which wpmProductIds is the last one in the productsNode? console log the index of the last wpmProductId in the productsNode\n\t\t\t\t// console.log(\"productsNode.children().length\", countOfChildren(productsNode));\n\n\t\t\t\ti = i + countOfChildren(productsNode.node) - 1\n\t\t\t}\n\n\t\t\t// Make the list of class names unique\n\t\t\tlistOfClassNames.nested = [...new Set(listOfClassNames.nested)]\n\t\t\tlistOfClassNames.flat = [...new Set(listOfClassNames.flat)]\n\n\t\t\treturn listOfClassNames\n\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t\treturn listOfClassNames\n\t\t}\n\t}\n\n\n\tlet detectedProductTemplateClasses = {\n\t\tnested: [],\n\t\tflat : [],\n\t}\n\n\tconst isNestedClass = (elem) => {\n\t\tlet nestedClassNames = [\n\t\t\t\"product\",\n\t\t\t\"type-product\",\n\t\t\t\"product-item-inner\",\n\t\t\t...detectedProductTemplateClasses.nested,\n\t\t]\n\n\t\treturn nestedClassNames.some(className => jQuery(elem).closest(\".\" + className).length)\n\t}\n\n\tconst isFlatClass = (elem) => {\n\n\t\tlet flatClassNames = [\n\t\t\t\"wc-block-grid__product\",\n\t\t\t\"product\",\n\t\t\t\"product-small\",\n\t\t\t\"woocommerce-LoopProduct-link\",\n\t\t\t...detectedProductTemplateClasses.flat,\n\t\t]\n\n\t\treturn flatClassNames.some(className => jQuery(elem).prev().hasClass(className))\n\t}\n\n\tconst getAllElementsToWatch = () => {\n\n\t\tdetectedProductTemplateClasses = getCommonIdentifiersToWatch()\n\n\t\treturn jQuery(\".wpmProductId\")\n\t\t\t.map(function (i, elem) {\n\n\t\t\t\tif (isNestedClass(elem)) {\n\t\t\t\t\treturn jQuery(elem).parent()\n\t\t\t\t} else if (isFlatClass(elem)) {\n\t\t\t\t\treturn jQuery(this).prev()\n\t\t\t\t} else if (jQuery(elem).closest(\".product\").length) {\n\t\t\t\t\treturn jQuery(elem).closest(\".product\")\n\t\t\t\t}\n\t\t\t})\n\t}\n\n\twpm.startIntersectionObserverToWatch = () => {\n\n\t\ttry {\n\t\t\t// enable view_item_list test mode from browser\n\t\t\tif (wpm.urlHasParameter(\"vildemomode\")) wpmDataLayer.viewItemListTrigger.testMode = true\n\n\t\t\t// set up intersection observer\n\t\t\t// https://stackoverflow.com/questions/62084306/intersectionobserver-not-working-in-safari-or-ios\n\t\t\tio = new IntersectionObserver(wpm.observerCallback, {\n\t\t\t\troot: null,\n\t\t\t\t// root : document.body,\n\t\t\t\tthreshold: wpmDataLayer.viewItemListTrigger.threshold,\n\t\t\t})\n\n\t\t\tgetAllElementsToWatch().each((i, elem) => {\n\n\t\t\t\tjQuery(elem[0]).data(\"ioid\", ioid++)\n\n\t\t\t\tio.observe(elem[0])\n\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\t// Watch DOM for new lazy loaded products and add them to the intersection observer\n\twpm.startProductsMutationObserverToWatch = () => {\n\n\t\ttry {\n\t\t\t// Pass in the target node, as well as the observer options\n\n\t\t\t// selects the most common parent node\n\t\t\t// https://stackoverflow.com/a/7648323/4688612\n\t\t\tlet productsNode = jQuery(\".wpmProductId:eq(0)\").parents().has(jQuery(\".wpmProductId:eq(1)\").parents()).first()\n\n\t\t\tif (productsNode.length) {\n\t\t\t\tproductsMutationObserver.observe(productsNode[0], {\n\t\t\t\t\tattributes : true,\n\t\t\t\t\tchildList : true,\n\t\t\t\t\tcharacterData: true,\n\t\t\t\t})\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\t// Create an observer instance\n\tconst productsMutationObserver = new MutationObserver(mutations => {\n\n\t\tmutations.forEach(mutation => {\n\t\t\tlet newNodes = mutation.addedNodes // DOM NodeList\n\t\t\tif (newNodes !== null) { // If there are new nodes added\n\t\t\t\tlet nodes = jQuery(newNodes) // jQuery set\n\t\t\t\tnodes.each((i, node) => {\n\t\t\t\t\tif (\n\t\t\t\t\t\t// jQuery(this).hasClass(\"type-product\") ||\n\t\t\t\t\t\t// jQuery(this).hasClass(\"product-small\") ||\n\t\t\t\t\t\t// jQuery(this).hasClass(\"wc-block-grid__product\")\n\t\t\t\t\t\t// jQuery(this).hasClass(\"type-product\")\n\t\t\t\t\t\tisNestedClass(node) || isFlatClass(node)\n\t\t\t\t\t) {\n\t\t\t\t\t\t// check if the node has a child or sibling wpmProductId\n\t\t\t\t\t\t// if yes add it to the intersectionObserver\n\t\t\t\t\t\tif (hasWpmProductIdElement(node)) {\n\t\t\t\t\t\t\tjQuery(node).data(\"ioid\", ioid++)\n\t\t\t\t\t\t\tio.observe(node)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t})\n\n\tlet hasWpmProductIdElement = elem =>\n\t\t!!(jQuery(elem).find(\".wpmProductId\").length ||\n\t\t\tjQuery(elem).siblings(\".wpmProductId\").length)\n\n\twpm.setCookie = (cookieName, cookieValue = \"\", expiryDays = null) => {\n\n\t\tif (expiryDays) {\n\n\t\t\tlet d = new Date()\n\t\t\td.setTime(d.getTime() + (expiryDays * 24 * 60 * 60 * 1000))\n\t\t\tlet expires = \"expires=\" + d.toUTCString()\n\t\t\tdocument.cookie = cookieName + \"=\" + cookieValue + \";\" + expires + \";path=/\"\n\t\t} else {\n\t\t\tdocument.cookie = cookieName + \"=\" + cookieValue + \";path=/\"\n\t\t}\n\t}\n\n\twpm.getCookie = cookieName => {\n\n\t\tlet name = cookieName + \"=\"\n\t\tlet decodedCookie = decodeURIComponent(document.cookie)\n\t\tlet ca = decodedCookie.split(\";\")\n\n\t\tfor (let i = 0; i < ca.length; i++) {\n\n\t\t\tlet c = ca[i]\n\n\t\t\twhile (c.charAt(0) == \" \") {\n\t\t\t\tc = c.substring(1)\n\t\t\t}\n\n\t\t\tif (c.indexOf(name) == 0) {\n\t\t\t\treturn c.substring(name.length, c.length)\n\t\t\t}\n\t\t}\n\n\t\treturn \"\"\n\t}\n\n\t/**\n\t * Find and get the cookie with a name that contains the string.\n\t * If one is found, then return the cookie.\n\t * If none is found, then return false.\n\t *\n\t * @param string\n\t * @returns {boolean|string}\n\t *\n\t * @since 1.32.5\n\t */\n\twpm.getCookieThatContainsRegex = (regex) => {\n\n\t\tlet cookies = document.cookie.split(\";\")\n\n\t\tfor (let i = 0; i < cookies.length; i++) {\n\t\t\tlet cookie = cookies[i].trim()\n\n\t\t\tif (regex.test(cookie)) {\n\t\t\t\treturn cookie\n\t\t\t}\n\t\t}\n\n\t\treturn false\n\t}\n\n\twpm.deleteCookie = cookieName => {\n\t\twpm.setCookie(cookieName, \"\", -1)\n\t}\n\n\twpm.getWpmSessionData = () => {\n\n\t\tif (window.sessionStorage) {\n\n\t\t\tlet data = window.sessionStorage.getItem(\"_wpm\")\n\n\t\t\tif (data !== null) {\n\t\t\t\treturn JSON.parse(data)\n\t\t\t} else {\n\t\t\t\treturn {}\n\t\t\t}\n\t\t} else {\n\t\t\treturn {}\n\t\t}\n\t}\n\n\twpm.setWpmSessionData = data => {\n\t\tif (window.sessionStorage) {\n\t\t\twindow.sessionStorage.setItem(\"_wpm\", JSON.stringify(data))\n\t\t}\n\t}\n\n\twpm.storeOrderIdOnServer = async (orderDetails) => {\n\n\t\ttry {\n\n\t\t\tlet response\n\n\t\t\tif (await wpm.isRestEndpointAvailable()) {\n\n\t\t\t\tresponse = await fetch(wpm.root + \"pmw/v1/pixels-fired/\", {\n\t\t\t\t\tmethod : \"POST\",\n\t\t\t\t\theaders : {\n\t\t\t\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t\t\t\t// \"X-WP-Nonce\" : wpm.nonce_wp_rest,\n\t\t\t\t\t},\n\t\t\t\t\tbody : JSON.stringify({\n\t\t\t\t\t\torder_id : orderDetails.orderId,\n\t\t\t\t\t\torder_key: orderDetails.orderKey,\n\t\t\t\t\t\tsource : orderDetails.source,\n\t\t\t\t\t\t// nonce : wpm.pmw_nonce,\n\t\t\t\t\t}),\n\t\t\t\t\tkeepalive: true,\n\t\t\t\t\tcache : \"no-cache\",\n\t\t\t\t})\n\n\t\t\t} else {\n\n\t\t\t\tconsole.log(\"Pixel Manager for WooCommerce: REST API not available, falling back to AJAX\")\n\n\t\t\t\t// save the state in the database\n\n\t\t\t\t// Send the data object with ajax request\n\t\t\t\t// and log success or error using fetch API and url encoded\n\t\t\t\tresponse = await fetch(wpm.ajax_url, {\n\t\t\t\t\tmethod : \"POST\",\n\t\t\t\t\tbody : new URLSearchParams({\n\t\t\t\t\t\taction : \"pmw_purchase_pixels_fired\",\n\t\t\t\t\t\torder_id : orderDetails.orderId,\n\t\t\t\t\t\torder_key: orderDetails.orderKey,\n\t\t\t\t\t\tsource : orderDetails.source,\n\t\t\t\t\t\t// nonce_ajax: wpm.nonce_ajax,\n\t\t\t\t\t}),\n\t\t\t\t\tkeepalive: true,\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tconst responseJson = await response.json()\n\n\t\t\tif (responseJson.success) {\n\t\t\t\tconsole.log(\"Pixel Manager for WooCommerce: \" + responseJson.data)\n\t\t\t} else {\n\t\t\t\tconsole.error(\"Pixel Manager for WooCommerce error: \", responseJson.data)\n\t\t\t}\n\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}\n\n\twpm.getProductIdByCartItemElement = element => {\n\n\t\tconst href = jQuery(element).find(\".product-remove\").find(\"a\").attr(\"href\")\n\t\tif (href) return wpm.getProductIdByCartItemKeyUrl(new URL(href))\n\n\t\tconst productId = jQuery(element).find(\"[data-product_id]\").first().attr(\"data-product_id\")\n\t\treturn productId ? productId : null\n\t}\n\n\twpm.getProductQuantityByCartItemElement = element => {\n\n\t\treturn jQuery(element).find(\".qty\").val() || null\n\t}\n\n\twpm.getProductIdByCartItemKeyUrl = url => {\n\n\t\tlet searchParams = new URLSearchParams(url.search)\n\t\tlet cartItemKey = searchParams.get(\"remove_item\")\n\n\t\tlet productId\n\n\t\tif (wpmDataLayer.cartItemKeys[cartItemKey][\"variation_id\"] === 0) {\n\t\t\tproductId = wpmDataLayer.cartItemKeys[cartItemKey][\"product_id\"]\n\t\t} else {\n\t\t\tproductId = wpmDataLayer.cartItemKeys[cartItemKey][\"variation_id\"]\n\t\t}\n\n\t\treturn productId\n\t}\n\n\twpm.getAddToCartLinkProductIds = () =>\n\t\tjQuery(\"a\").map(function () {\n\t\t\tlet href = jQuery(this).attr(\"href\")\n\n\t\t\tif (href && href.includes(\"?add-to-cart=\")) {\n\t\t\t\tlet matches = href.match(/(add-to-cart=)(\\d+)/)\n\t\t\t\tif (matches) return matches[2]\n\t\t\t}\n\t\t}).get()\n\n\twpm.getProductDetailsFormattedForEvent = (productId, quantity = 1) => {\n\n\t\tlet product = {\n\t\t\tid : productId.toString(),\n\t\t\tdyn_r_ids : wpmDataLayer.products[productId].dyn_r_ids,\n\t\t\tname : wpmDataLayer.products[productId].name,\n\t\t\tlist_name : wpmDataLayer.shop.list_name,\n\t\t\tbrand : wpmDataLayer.products[productId].brand,\n\t\t\tcategory : wpmDataLayer.products[productId].category,\n\t\t\tvariant : wpmDataLayer.products[productId].variant,\n\t\t\tlist_position: wpmDataLayer.products[productId].position,\n\t\t\tquantity : quantity,\n\t\t\tprice : wpmDataLayer.products[productId].price,\n\t\t\tcurrency : wpmDataLayer.shop.currency,\n\t\t\tisVariable : wpmDataLayer.products[productId].isVariable,\n\t\t\tisVariation : wpmDataLayer.products[productId].isVariation,\n\t\t\tparentId : wpmDataLayer.products[productId].parentId,\n\t\t}\n\n\t\tif (product.isVariation) product[\"parentId_dyn_r_ids\"] = wpmDataLayer.products[productId].parentId_dyn_r_ids\n\n\t\treturn product\n\t}\n\n\twpm.setReferrerToCookie = () => {\n\n\t\t// can't use session storage as we can't read it from the server\n\t\tif (!wpm.getCookie(\"wpmReferrer\")) {\n\t\t\twpm.setCookie(\"wpmReferrer\", document.referrer)\n\t\t}\n\t}\n\n\twpm.getReferrerFromCookie = () => {\n\n\t\tif (wpm.getCookie(\"wpmReferrer\")) {\n\t\t\treturn wpm.getCookie(\"wpmReferrer\")\n\t\t} else {\n\t\t\treturn null\n\t\t}\n\t}\n\n\twpm.getClidFromBrowser = (clidId = \"gclid\") => {\n\n\t\tlet clidCookieId\n\n\t\tclidCookieId = {\n\t\t\tgclid: \"_gcl_aw\",\n\t\t\tdclid: \"_gcl_dc\",\n\t\t}\n\n\t\tif (wpm.getCookie(clidCookieId[clidId])) {\n\n\t\t\tlet clidCookie = wpm.getCookie(clidCookieId[clidId])\n\t\t\tlet matches = clidCookie.match(/(GCL.[\\d]*.)(.*)/)\n\t\t\treturn matches[2]\n\t\t} else {\n\t\t\treturn \"\"\n\t\t}\n\t}\n\n\twpm.getUserAgent = () => navigator.userAgent\n\n\twpm.getViewPort = () => ({\n\t\twidth : Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0),\n\t\theight: Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0),\n\t})\n\n\n\twpm.version = () => {\n\t\tconsole.log(wpmDataLayer.version)\n\t}\n\n\t/**\n\t * https://api.jquery.com/jquery.getscript/\n\t *\n\t * Switched back to jQuery.ajax as the fetch method on some sites returned a type error\n\t * Possible reasons are:\n\t * * CORS mismatch\n\t * * The user is using an ad blocker\n\t *\n\t * This code is .thenable\n\t */\n\n\twpm.loadScriptAndCacheIt = url => {\n\n\t\t// Get and load the script using fetch API, if possible from cache, and return it without using eval\n\t\t// return fetch(url, {\n\t\t// \tmethod : \"GET\",\n\t\t// \tcache : \"default\",\n\t\t// \tkeepalive: true,\n\t\t// })\n\t\t// \t.then(response => {\n\t\t// \t\tif (response.ok) {\n\t\t// \t\t\t// console.log(\"response\", response)\n\t\t// \t\t\treturn response.text()\n\t\t// \t\t\t// console.log(\"wpm.loadScriptAndCacheIt success: \" + url)\n\t\t// \t\t} else {\n\t\t// \t\t\tthrow new Error(\"Network response was not ok: \" + url)\n\t\t// \t\t}\n\t\t// \t})\n\t\t// \t.then(script => {\n\t\t// \t\t// Execute the script\n\t\t// \t\t// console.error(\"executing script: \" + script)\n\t\t// \t\teval(script)\n\t\t// \t\t// console.log(\"executed script: \" + script)\n\t\t// \t})\n\t\t// \t.catch(e => {\n\t\t// \t\tconsole.error(e)\n\t\t// \t})\n\n\t\tlet options = {\n\t\t\tdataType: \"script\",\n\t\t\tcache : true,\n\t\t\turl : url,\n\t\t}\n\n\t\treturn jQuery.ajax(options)\n\t}\n\n\twpm.getOrderItemPrice = orderItem => (orderItem.total + orderItem.total_tax) / orderItem.quantity\n\n\twpm.hasLoginEventFired = () => {\n\t\tlet data = wpm.getWpmSessionData()\n\t\treturn data?.loginEventFired\n\t}\n\n\twpm.setLoginEventFired = () => {\n\t\tlet data = wpm.getWpmSessionData()\n\t\tdata[\"loginEventFired\"] = true\n\t\twpm.setWpmSessionData(data)\n\t}\n\n\twpm.pageLoaded = async () => new Promise(resolve => {\n\t\t(function waitForVar() {\n\t\t\tif (\"complete\" === document.readyState) return resolve()\n\t\t\tsetTimeout(waitForVar, 50)\n\t\t})()\n\t})\n\n\twpm.pageReady = () => {\n\t\treturn new Promise(resolve => {\n\t\t\t(function waitForVar() {\n\t\t\t\tif (\"interactive\" === document.readyState || \"complete\" === document.readyState) return resolve()\n\t\t\t\tsetTimeout(waitForVar, 50)\n\t\t\t})()\n\t\t})\n\t}\n\n\twpm.isMiniCartActive = () => {\n\t\tif (window.sessionStorage) {\n\t\t\tObject.keys(window.sessionStorage).forEach(key => {\n\t\t\t\tif (key.includes(\"wc_fragments\")) {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t})\n\t\t\treturn false\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\twpm.doesWooCommerceCartExist = () => document.cookie.includes(\"woocommerce_items_in_cart\")\n\n\twpm.urlHasParameter = parameter => {\n\t\tlet urlParams = new URLSearchParams(window.location.search)\n\t\treturn urlParams.has(parameter)\n\t}\n\n\twpm.getUrlParameter = parameter => {\n\t\tlet urlParams = new URLSearchParams(window.location.search)\n\t\treturn urlParams.get(parameter)\n\t}\n\n\t// https://stackoverflow.com/a/60606893/4688612\n\twpm.hashAsync = (algo, str) => {\n\t\treturn crypto.subtle.digest(algo, new TextEncoder(\"utf-8\").encode(str)).then(buf => {\n\t\t\treturn Array.prototype.map.call(new Uint8Array(buf), x => ((\"00\" + x.toString(16)).slice(-2))).join(\"\")\n\t\t})\n\t}\n\n\twpm.getCartValue = () => {\n\n\t\tlet value = 0\n\n\t\tif (wpmDataLayer?.cart) {\n\n\t\t\tfor (const key in wpmDataLayer.cart) {\n\t\t\t\t// content_ids.push(wpmDataLayer.products[key].dyn_r_ids[wpmDataLayer.pixels.facebook.dynamic_remarketing.id_type])\n\n\t\t\t\tlet product = wpmDataLayer.cart[key]\n\n\t\t\t\tvalue += product.quantity * product.price\n\t\t\t}\n\t\t}\n\n\t\treturn value\n\t}\n\n\t/**\n\t * Detect if the current URL contains at least one pattern\n\t *\n\t * @param patterns\n\t * @returns {boolean}\n\t */\n\twpm.doesUrlContainPatterns = patterns => {\n\n\t\tfor (const pattern of patterns) {\n\t\t\tif (new RegExp(pattern).test(window.location.href)) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\n\t\treturn false\n\t}\n\n\t/**\n\t * Detect if the current URL contains at least one pattern that is on the tracking exclusion list\n\t *\n\t * https://www.linkedin.com/pulse/how-remove-google-robot-problem-via-gtm-facebook-pixel-hjelpdahl/\n\t * https://www.youtube.com/watch?v=b4I1ePZt8Z0\n\t *\n\t * @returns {boolean}\n\t */\n\twpm.excludeDomainFromTracking = () => {\n\n\t\tlet excludeDomains = [\n\t\t\t\"appspot.com\",\n\t\t\t\"translate.google.com\",\n\t\t]\n\n\t\tif (wpmDataLayer?.general?.excludeDomains) {\n\t\t\texcludeDomains = [...excludeDomains, ...wpmDataLayer.general.excludeDomains]\n\t\t}\n\n\t\t// Abort if URL contains excluded domains\n\t\tif (excludeDomains.some(domain => window.location.href.includes(domain))) {\n\t\t\tconsole.debug(\"Pixel Manager for WooCommerce: Aborted due to excluded domain\")\n\t\t\treturn true\n\t\t}\n\n\t\treturn false\n\t}\n\n\twpm.getRandomEventId = () => (Math.random() + 1).toString(36).substring(2)\n\n\twpm.pmwConsoleMessage = () => {\n\t\tlet message = \"Pixel Manager for WooCommerce: \"\n\t\tmessage += wpmDataLayer.version.pro ? \"pro\" : \"free\"\n\t\tmessage += \" | distro: \" + wpmDataLayer.version.distro\n\t\tif (wpmDataLayer.version.distro === \"fms\" && wpmDataLayer.version.pro) {\n\t\t\tmessage += \" | active license: \" + (wpmDataLayer.version.eligibleForUpdates ? \"yes\" : \"no\")\n\t\t}\n\t\tmessage += \" | version: \" + wpmDataLayer.version.number\n\n\t\tconsole.log(message)\n\t}\n\n\twpm.canLoadPremiumFeatures = () => {\n\t\treturn (wpmDataLayer.version.distro === \"fms\" && wpmDataLayer.version.pro && wpmDataLayer.version.eligibleForUpdates) || wpmDataLayer.version.distro === \"wcm\"\n\t}\n\n\tlet jQueryReadyFired = false\n\n\twpm.triggerDomReadyEvent = () => {\n\t\tif (jQueryReadyFired === false) {\n\t\t\tdocument.dispatchEvent(new Event(\"pmw:ready\"))\n\t\t}\n\t\tjQueryReadyFired = true\n\t}\n\n\tjQuery(document).on(\"ready\", () => {\n\t\twpm.triggerDomReadyEvent()\n\t})\n\n\tdocument.addEventListener(\"DOMContentLoaded\", () => {\n\t\twpm.triggerDomReadyEvent()\n\t})\n\n\twpm.getEmailFromTarget = target => {\n\n\t\t// Only try to add the clicked email if href is set\n\t\tif (target.href) {\n\n\t\t\t// Get the email from the link\n\t\t\t// But only if there is a valid email address in the link\n\t\t\t// Also, the href may contain other parameters, so we need to check for that and remove them\n\t\t\tlet email = target.href.replace(\"mailto:\", \"\")\n\n\n\t\t\tif (email.indexOf(\"?\") > -1) {\n\t\t\t\temail = email.split(\"?\")[0]\n\t\t\t}\n\n\t\t\t// Trim the email and remove all whitespaces\n\t\t\temail = email.replace(/\\s/g, \"\")\n\n\t\t\t// If the email is not empty and valid, add it to the data object\n\t\t\tif (email && wpm.isEmail(email)) {\n\t\t\t\treturn email\n\t\t\t}\n\t\t}\n\n\t\treturn \"\"\n\t}\n\n\n}(window.wpm = window.wpm || {}, jQuery))\n","/**\n * Load all WPM functions\n *\n * Ignore event listeners. They need to be loaded after\n * we made sure that jQuery has been loaded.\n */\n\nrequire(\"./functions\")\nrequire(\"./cookie_consent\")\nrequire(\"./ip_check\")\n\n// #if process.env.TIER === 'premium'\n// if (wpm.canLoadPremiumFeatures()) {\n// \trequire(\"./functions_premium\")\n// }\n// #endif\n","(function (wpm, $, undefined) {\n\n\twpm.jQueryExists = async () => new Promise(resolve => {\n\n\t\t(function waitForjQuery() {\n\t\t\tif (typeof jQuery !== \"undefined\") return resolve()\n\t\t\tsetTimeout(waitForjQuery, 100)\n\t\t})()\n\t})\n\n\twpm.waitForLibrary = (library, timeout = 5000, interval = 100) => {\n\n\t\tconst startTime = Date.now()\n\t\twhile (typeof window[library] === \"undefined\") {\n\t\t\t// Check if timeout in milliseconds has passed\n\t\t\tif (Date.now() - startTime > timeout) {\n\t\t\t\tbreak // Maximum wait time reached, exit the loop\n\t\t\t}\n\t\t\t// Wait for the interval in milliseconds before checking again\n\t\t\tsetTimeout(() => {\n\t\t\t}, interval)\n\t\t}\n\t}\n\n\twpm.wpmDataLayerFullyLoaded = async () => {\n\n\t\t// Promise that checks if the nested object wpmDataLayer.version is defined.\n\t\t// If so, resolve.\n\t\t// We must check for the nested object wpmDataLayer.version,\n\t\t// because the wpmDataLayer object can be defined early by adding products to the data layer through\n\t\t// template inline scripts. So we need to wait until the wpmDataLayer configuration objects\n\t\t// are defined.\n\t\tlet checkVar = new Promise((resolve) => {\n\t\t\t(function waitForVar() {\n\t\t\t\tif (\n\t\t\t\t\ttypeof wpmDataLayer !== \"undefined\"\n\t\t\t\t\t&& typeof wpmDataLayer.version !== \"undefined\"\n\t\t\t\t) {\n\t\t\t\t\treturn resolve()\n\t\t\t\t}\n\t\t\t\tsetTimeout(waitForVar, 100)\n\t\t\t})()\n\t\t})\n\n\t\t// Set a timeout to log a message after 6 seconds\n\t\tlet logTimeoutId = setTimeout(() => {\n\t\t\tconsole.error(\"Pixel Manager error: The wpmDataLayer is not defined. Please make sure that the wpmDataLayer script snippet is inserted and not modified by any third-party plugin, such as a consent management platform or a JavaScript optimizer.\")\n\n\t\t}, 6000)\n\n\t\tcheckVar.then(() => {\n\t\t\tclearTimeout(logTimeoutId)\n\t\t})\n\n\t\treturn checkVar\n\t}\n\n\twpm.wpHooksExists = async () => new Promise(resolve => {\n\t\t(function waitForVar() {\n\n\t\t\t// Resolve if wp.hooks is defined\n\t\t\tif (typeof wp !== \"undefined\" && typeof wp.hooks !== \"undefined\") return resolve()\n\t\t\tsetTimeout(waitForVar, 50)\n\t\t})()\n\t})\n\n\t/**\n\t * Load all WooCommerce hooks functions\n\t *\n\t * Includes safeguard in case the user changed the default load order for wp-hooks, or removed it completely.\n\t *\n\t * @returns {Promise