PageSourceSearch

https://static.nitehushpro24.com//statics/statics.js

js nitehushpro24.com collected 2026-10-08 03:27:39 UTC 60,845 bytes, 1,807 lines download raw bytes

1// polyfills for IE11
2var __start = Date.now();
3!function(t){"use strict";var n,r,e=function(){try{if(t.URLSearchParams&&"bar"===new t.URLSearchParams("foo=bar").get("foo"))return t.URLSearchParams}catch(n){}return null}(),o=e&&"a=1"===new e({a:1}).toString(),i=e&&"+"===new e("s=%2B").get("s"),a="__URLSearchParams__",s=!e||((n=new e).append("s"," &"),"s=+%26"===n.toString()),u=h.prototype,f=!!(t.Symbol&&t.Symbol.iterator);if(!e||!o||!i||!s){u.append=function(t,n){v(this[a],t,n)},u.delete=function(t){delete this[a][t]},u.get=function(t){var n=this[a];return this.has(t)?n[t][0]:null},u.getAll=function(t){var n=this[a];return this.has(t)?n[t].slice(0):[]},u.has=function(t){return $(this[a],t)},u.set=function t(n,r){this[a][n]=[""+r]},u.toString=function(){var t,n,r,e,o=this[a],i=[];for(n in o)for(t=0,r=l(n),e=o[n];t<e.length;t++)i.push(r+"="+l(e[t]));return i.join("&")},i&&e&&!o&&t.Proxy?(r=new Proxy(e,{construct:function(t,n){return new t(new h(n[0]).toString())}})).toString=Function.prototype.toString.bind(h):r=h,Object.defineProperty(t,"URLSearchParams",{value:r});var c=t.URLSearchParams.prototype;c.polyfill=!0,c.forEach=c.forEach||function(t,n){var r=y(this.toString());Object.getOwnPropertyNames(r).forEach(function(e){r[e].forEach(function(r){t.call(n,r,e,this)},this)},this)},c.sort=c.sort||function(){var t,n,r,e=y(this.toString()),o=[];for(t in e)o.push(t);for(o.sort(),n=0;n<o.length;n++)this.delete(o[n]);for(n=0;n<o.length;n++){var i=o[n],a=e[i];for(r=0;r<a.length;r++)this.append(i,a[r])}},c.keys=c.keys||function(){var t=[];return this.forEach(function(n,r){t.push(r)}),g(t)},c.values=c.values||function(){var t=[];return this.forEach(function(n){t.push(n)}),g(t)},c.entries=c.entries||function(){var t=[];return this.forEach(function(n,r){t.push([r,n])}),g(t)},f&&(c[t.Symbol.iterator]=c[t.Symbol.iterator]||c.entries)}function h(t){((t=t||"")instanceof URLSearchParams||t instanceof h)&&(t=t.toString()),this[a]=y(t)}function l(t){var n={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'\(\)~]|%20|%00/g,function(t){return n[t]})}function p(t){return t.replace(/[ +]/g,"%20").replace(/(%[a-f0-9]{2})+/ig,function(t){return decodeURIComponent(t)})}function g(n){var r={next:function(){var t=n.shift();return{done:void 0===t,value:t}}};return f&&(r[t.Symbol.iterator]=function(){return r}),r}function y(t){var n={};if("object"==typeof t){if(S(t))for(var r=0;r<t.length;r++){var e=t[r];if(S(e)&&2===e.length)v(n,e[0],e[1]);else throw TypeError("Failed to construct 'URLSearchParams': Sequence initializer must only contain pair elements")}else for(var o in t)t.hasOwnProperty(o)&&v(n,o,t[o])}else{0===t.indexOf("?")&&(t=t.slice(1));for(var i=t.split("&"),a=0;a<i.length;a++){var s=i[a],u=s.indexOf("=");-1<u?v(n,p(s.slice(0,u)),p(s.slice(u+1))):s&&v(n,p(s),"")}}return n}function v(t,n,r){var e="string"==typeof r?r:null!=r&&"function"==typeof r.toString?r.toString():JSON.stringify(r);$(t,n)?t[n].push(e):t[n]=[e]}function S(t){return!!t&&"[object Array]"===Object.prototype.toString.call(t)}function $(t,n){return Object.prototype.hasOwnProperty.call(t,n)}}("undefined"!=typeof global?global:"undefined"!=typeof window?window:this);
4!function(){if(!Array.prototype.forEach){Array.prototype.forEach = function(callback){for (var i = 0; i < this.length; i++) {callback(this[i], i, this);}}}}();
5!function(){if('HTMLCollection' in window && !HTMLCollection.prototype.forEach) {HTMLCollection.prototype.forEach = function (callback, thisArg) {thisArg = thisArg || window;for (var i = 0; i < this.length; i++) {callback.call(thisArg, this[i], i, this);}};}}();
6!function(){if('NodeList' in window && !NodeList.prototype.forEach) {NodeList.prototype.forEach = function (callback, thisArg) {thisArg = thisArg || window;for (var i = 0; i < this.length; i++) {callback.call(thisArg, this[i], i, this);}};}}();
7
8/*
9	AFOP implementation!
10	check vtid/avatar implementation is ok
11
12*/
13LUI.domain = (function(){
14	var url = document.querySelector('script[src*="statics.js"]');
15	var domain = (new RegExp(/http(s)??\:\/\/([a-z0-9\-\.]+)/ig)).exec(url.src)[2];
16	return "//" + domain + (domain=="localhost"?"/backend-video-delivery/":"");
17})();
18LUI.events = {
19	push: async function(event){
20		// let event = LUI.events.shift();
21		let [evt,env] = Object.entries(event)[0];
22		let envs = JSON.parse(env);
23		
24		envs.event = evt;
25		if(envs.event=="lander" || LUI.env["hour"]>0)
26		{
27			try{
28				var response = await fetch(LUI.domain + "/saveenv", { 
29			        method: 'POST',
30			        headers: {
31			        	'Content-Type': 'application/json'
32			        },
33			        body: JSON.stringify(envs)
34		        });
35				console.log("EVT:" + envs.event + " - " +  envs.funnel);
36				return await response.json();
37			}catch(e)
38			{
39				console.log(e);
40			}
41		}
42	}
43};
44
45LUI.getURLParameter = function($paramName)
46{
47	var params = new URLSearchParams(window.location.search);
48	
49	if(typeof $paramName == "undefined")
50	{
51		var result = {};
52		params.forEach(function(value,key){
53			result[key] = value;
54		})
55		return result;
56	}
57	if(typeof $paramName == "string")
58	{
59		return params.get($paramName);
60	}
61	else if(Array.isArray($paramName))
62	{
63		var result = {};
64		for(var i in $paramName)
65		{
66			result[$paramName[i]] = params.get($paramName[i]);
67		}
68		return result;
69	}
70};
71
72LUI.createElementFromHTML =  function ($htmlString) {
73	
74	var tpl = document.createElement('template');
75	tpl.innerHTML = $htmlString.trim();
76	return tpl.content;
77}
78
79LUI.setCookie = function($key, $value,$days)
80{
81	var date, expires;
82		if ($days) {
83			date = new Date();
84			date.setTime(date.getTime()+($days*24*60*60*1000));
85			expires = "; expires="+date.toGMTString();
86		} else {
87			expires = "";
88		}
89		
90		document.cookie = $key+"="+$value+expires+"; path=/; " + (location.hostname === "localhost"?"":"SameSite=None; Secure");
91}
92
93LUI.getCookie = function($key)
94{
95	var c_ar = document.cookie.split(";");
96	for(var i in c_ar)
97	{
98		var c = c_ar[i].split("=");
99		if(c[0].trim() == $key)
100			return decodeURI(c[1]); 
101	}
102}
103
104LUI.isMobile = function()
105{
106	let useragent = window.navigator.userAgent;
107	if(
108		useragent.match(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i)
109		|| useragent.substring(0,4).match(/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i))
110	{
111		return true;
112	}
113	return false;
114};
115
116(function(){
117	try{
118		
119	
120	var staticenv = localStorage.getItem("staticenv");
121	var env = null;
122	if(staticenv)
123	{
124		env = JSON.parse(staticenv);
125	}
126	let hour = null;
127	let vsl = null;
128	let cid = null;
129	let vtid = null;
130	let page = window.location.hostname + window.location.pathname;
131	let cvalue = 0;
132	let oid = "";
133	let b = LUI.getURLParameter("_b");
134	if(b > "")
135	{
136		let ar = atob(b).split(";");
137		console.log(ar);
138		hour = ar[0];
139		page = ar[1];
140		vtid = ar[2];
141		vsl = ar[3];
142		cid = ar[4];
143		cvalue = ar[5];
144		clabel = ar[6];
145		oid = ar[7];
146	}
147	
148	if(env!==null)
149	{
150		// console.log(env);
151		LUI.env = env;
152		LUI.env["vtid"] = vtid;
153		
154		
155		if(cid > 0 && LUI.env["convs"][cid] == undefined)
156		{
157			LUI.env["convs"][cid] = false;
158			LUI.env["conv"] = cid;
159			LUI.env["convv"] = cvalue;
160			LUI.env["convl"] = clabel;
161		}
162	}
163	else
164	{
165		LUI.env = {
166			"hour": hour,
167			"vsl": vsl,
168			"convs":{},// set each written id to true once written to server!
169			"buyclick": false,
170			"conv":cid,
171			"convv":cvalue,
172			"convl":"fe",
173			//"lander": false,
174			"vtid": vtid,
175			"domain": window.location.hostname,
176			"path": window.location.pathname,
177			"page": page,
178			"query_string": window.location.search,
179			"vw": Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0),
180			"vh": Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0
180)
181		};
182		if(cid)
183		{
184			LUI.env.convs[cid] = false;
185		}
186	}
187	LUI.env["vum"] = false;// we always start muted!
188	localStorage.setItem("staticenv", JSON.stringify(LUI.env));
189	
190	}catch(e){console.log(e);}
191})();
192
193
194LUI.started_reel = false;
195LUI.start_reel = function(host_selector,male_percent)
196{
197	if(male_percent===undefined)
198		male_percent=0.5;
199	
200    if(!LUI.started_reel)
201    {
202		var reel_element = document.createRange().createContextualFragment('<style>'
203			+'.orderreel{'
204			+'  display:none;'
205			+'  border:solid 4px #6C757D!important;'
206			+'}'
207			+'.orderreel .map{'
208			+'	width:60px;'
209			+'	height: 60px;'
210			+'	border-radius:30px;'
211			+'	display:none;'
212			+'	pointer-events: none;'
213			+'	background-position:center;'
214			+'}'
215			+'.orderreel .icon{'
216			+'	width:60px;'
217			+'	height: 60px;'
218			+'	border-radius:30px;'
219			+'	display:inline-block;'
220			+'	background:url('+ LUI.domain + '/statics/img/order_reel.png) no-repeat;'
221			+'	background-size: 70%;'
222			+'	background-position: center;'
223			+'}'
224			+'</style> '
225			+'<div class="orderreel">'
226			+'  <div map class="map"></div>'
227			+'  <div icon class="icon"></div>'
228			+'  <div class="message">'
229			+'  </div>'
230			+'</div>'
231			+'<script>'
232		);
233		var host = document.querySelector(host_selector);
234		
235		host.appendChild(reel_element);
236        LUI.started_reel = true
237        var reel = document.querySelector(".orderreel");
238        reel.style.display = "flex";
239        
240    function updateMap (name){
241       var map = document.querySelector(".orderreel .map");
242       var img = "url(" + LUI.domain + "/statics/img/states/"+ name.replace(" ","%20") +".png)";
243       map.style.backgroundImage = img;
244      
245      }
246        
247      function getNextOrder(){
248
249					var offer_unit = "Bottle";
250					var offer_name = "";
251
252						if(LUI.setup && LUI.setup.offer_unit)
253							offer_unit = LUI.setup.offer_unit;
254
255						if(LUI.setup && LUI.setup.offer_name)
256							offer_name += " of " + LUI.setup.offer_name;
257						
258
259
260          var states = ["Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming"];
261          var names = "SmFtZXMsNDcwMDIyOSxNYXJ5LDMxOTYzODUsU21pdGgsMjQ0Mjk3NwpSb2JlcnQsNDQ1NTY5NixQYXRyaWNpYSwxNTU4NDA3LEpvaG5zb24sMTkzMjgxMgpKb2huLDQ0NTM4MDcsSmVubmlmZXIsMTQ2ODM3NyxXaWxsaWFtcywxNjI1MjUyCk1pY2hhZWwsNDMzNTkxOSxMaW5kYSwxNDQ4MzAzLEJyb3duLDE0MzcwMjYKV2lsbGlhbSwzNTY0Mjc2LEVsaXphYmV0aCwxNDIwMzc3LEpvbmVzLDE0MjU0NzAKRGF2aWQsMzU2NDA1MyxCYXJ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55LDMwODI4OSxLYXlsYSwzNDA1MTEsSmltZW5leiwyMjcxMTgK";
262          var data = atob(names);
263          var ar = data.split("\n");
264          var config = {"m":[],"f":[],"s":[]};
265          var m=0,f=0,s = 0;
266          for(var i in ar)
267          {
268            var ars = ar[i].split(",");
269            
270            if(ars[0] > "")
271            {
272                config.m.push({
273                  name: ars[0],
274                  from: m,
275                  to: m += (1*ars[1])
276                });
277                
278                config.f.push({
279                  name:ars[2],
280                  from: f,
281                  to: f+= (1*ars[3])
282                });
283                
284                config.s.push({
285                  name:ars[4],
286                  from: s,
287                  to: s+= (1*ars[5])
288                });
289            }
290          }
291          config.f_max = f;
292          config.m_max = m;
293          config.s_max = s;
294
295         var sx = Math.random() > male_percent?"m":"f";
296
297          var cnt = 0;
298          
299          if(sx=="f")
300            cnt = Math.floor(Math.random()*config.f_max);
301          else 
302          	cnt = Math.floor(Math.random()*config.m_max);
303          
304          getInRange = function(n,range)
305                {
306                  for(var i in range)
307                  {
308                    if(n>= range[i].from && n<= range[i].to)
309                      return range[i].name;
310                  }
311                }
312          var nm = getInRange(cnt,config[sx]);
313          var sm = getInRange(Math.floor(Math.random()*config.s_max), config.s);
314          
315          var st = states[Math.floor(Math.random()*states.length)];
316          var p = [6,3,6,6,6,6,6,6,6,3][Math.floor(Math.random()*10)];
317          updateMap(st);
318
319          return '<text x="50%" y="20" alignment-baseline="middle" text-anchor="middle"><tspan font-weight="bold">' + nm + " " + sm[0] + ".</tspan> <tspan> from " + st + " just bought </tspan></text>"
320              + '<text x="50%" y="35" alignment-baseline="middle" text-anchor="middle" font-weight="bold">' + p + " "+ offer_unit + (p>1?"s":"") + offer_name +"</text>";
321      	};
322      
323
324
325      var show = function(){
326        var ord_msg = host.querySelector(".message");
327        var reel = host.querySelector(".orderreel");
328        var icon = host.querySelector(".icon");
329        var map = host.querySelector(".map");
330        
331        ord_msg.innerHTML = "";
332        reel.style.transform = "scale(1)";
333        reel.style.left = "2px";
334        ord_msg.style.width = "240px";
335		ord_msg.style.height = "60px";
336        ord_msg.style.opacity = "1";
337        ord_msg.innerHTML ='<svg viewBox="0 0 320 70" class="msg">'
338            + getNextOrder()
339            + '<image href="' + LUI.domain + '/statics/img/verified_purchase.png" x="85px" y="50"  width="150"/>'
340            + '</svg>';
341        map.style.display = "inline-block";
342    	icon.style.display = "none";
343        
344        
345        var close = function(){
346
347			ord_msg.innerHTML = "";
348			reel.style.transform = "scale(0.45)";
349			reel.style.left = "-15px";
350			ord_msg.style.width = "0px";
351			icon.style.display = "block";
352			map.style.display = "none";
353  
354		  };
355		  
356		   setTimeout(close, 13000);
357		};
358  
359		setInterval(show ,Math.random()*10000+25000);
360		
361		
362		
363	  }
364	  setTimeout(show,7000);
365	  
366  };
367
368
369LUI.started_timer = false;
370LUI.start_vsltimer = function(host_selector)
371{
372    if(!LUI.started_timer)
373    {	
374    		var offer_name = "product";
375
376    			if(LUI.setup && LUI.setup.offer_name)
377    				offer_name = LUI.setup.offer_name
378
379    	  var timer_element = document.createRange().createContextualFragment(
380	    	  	'<style>'
381				+'.vsl_timer article {'
382				+'	width: auto;'
383				+'	text-align: center;'
384				+'	background-color: inherit;'
385				+'	border-radius: 10px!important;'
386				+'	margin: 15px auto 20px;'
387				+'	padding: 5px;'
388				+'	overflow: hidden;'
389				+'	box-shadow: 3px 3px 10px #ccc;'
390				+'}'
391				+'.vsl_timer article h2 {'
392				+'	font-weight: bold;'
393				+'	line-height: 1.4;'
394				+'	padding: 15px;'
395				+'	padding-bottom: 0!important;'
396				+'	color: #000;'
397				+'}'
398				+'.vsl_timer article .count {'
399				+'	padding: 5px;'
400				+'}'
401				+'.vsl_timer article #timer{'
402				+'	padding-bottom: 5px;'
403				+'	padding-top: 0!important;'
404				+'	margin-top: -10px;'
405				+'	color: red;'
406				+'	font-size : 54px;'
407				+'	background-color: inherit;'
408				+'	border-radius: 2px;'
409				+'}'
410				+'</style>'
411				+'<div class="container vsl_timer">'
412				+'<div class="row">'
413				+'		<div class="col-12">'
414				+'		  <article class="clock" id="model3">'
415				+'		  <h2 class="clock-headline"><b>Claim Your Discounted ' + offer_name+ '<br>While Stocks Last!</b></h2>'
416				+'			<div class="count">'
417				+'			<b><h2 class="bold timer" id="timer">30:00</h2></b>'
418				+'		  </div>'
419				+'		  </article>'
420				+'		</div>'
421				+'</div>'
422				+'</div>'
423				+'<script>'
424			);
425    	var host = document.querySelector(host_selector);
426
427		host.appendChild(timer_element);
428        LUI.started_timer = true
429        var timer = document.querySelector("article .clock-headline");
430		
431		if (offer_name === "GumGenics") {
432            timer.innerHTML = "<b>Snatch Your Discounted " + offer_name + " <br>While Stocks Are Still Available!</b>";
433        } else {
434            timer.innerHTML = "<b>Claim Your Discounted " + offer_name + "<br>While Stocks Last!</b>";
435        }
436
437		var secpass = function () {
438		     'use strict';
439		     
440		     var min     = Math.floor(sec / 60),
441		         remSec  = sec % 60;
442		     
443		     if (remSec < 10) {
444		         
445		         remSec = '0' + remSec;
446		     
447		     }
448		     if (min < 10) {
449		         
450		         min = '0' + min;
451		     
452		     }
453		     countDiv.innerHTML = min + ":" + remSec;
454		     
455		     if (sec > 0) {
456		         
457		         sec = sec - 1;
458		         
459		     } else {
460		         
461		         clearInterval(countDown);
462		         countDiv.innerHTML = '';
463		     }
464		}
465		var sec     = 1800;
466		var countDiv    = document.querySelector("article .timer");
467		var countDown   = setInterval(secpass, 1000);
468	        
469    }
470
471}
472
473LUI.started_ordbtn = false;
474LUI.start_ordbtn = function(host_selector)
475{
476	if(!LUI.started_ordbtn)
477	{
478		var elm = document.createElement("SPAN");
479		var rto_element = document.createRange().createContextualFragment('<style>'
480				+'.buy-container{'
481				+'	padding: 35px 10px!important;'
482				+'	position: fixed;'
483				+'	top: 0;'
484				+'	left: 0;'
485				+'	width: 100%;'
486				+'	z-index: 999;'
487				+'}'
488				+''
489				+'.buy-container .buy-action{'
490				+'   float: right;'
491				+'   display: block;'
492				+'}'
493				+'.buy-container .action-btn{'
494				+'	background: linear-gradient(180deg,  #FFDE00 0%, #FF8700 100%);'
495				+'	border-radius: 10px!important;'
496				+'	color: #000 !important;'
497				+'	padding: 15px;'
498				+'	font-size: 16px!important;'
499				+'	font-family: Arial;'
500				+'	display: inline-block;'
501				+'	font-weight: 700 !important;'
502				+'	transition: transform .3s;'
503				+'	margin-left: auto;'
504				+'	margin-right: auto;'
505				+'	float: none;'
506				+'	box-shadow: 1px 2px 22px rgb(0 0 0 / 20%);'
507				+'	border-radius: 0px;'
508				+'	text-decoration: none!important;'
509				+'}'
510				+'.buy-container .action-btn:hover{'
511				+'	transform: scale(1.05);'
512				+'	transition: transform .3s;'
513				+'}'
514				+''
515				+'@media screen '
516				+'and (max-device-width: 820px) { '
517				+''
518				+'.buy-container{'
519				+'   display: none!important;'
520				+'}'
521				+'.buy-container .buy-action{'
522				+'	display: none!important;'
523				+'}'
524				+'.buy-container .action-btn{'
525				+'	display: none!important;'
526				+'}'
527				+'}'
528				+'</style>'
529				+''
530				+'<div class="buy-container" id="rto_btn" style="display:none;">'
531				+'<div class="buy-action">'
532				+'<a href="#btn-cta" class="action-btn">READY TO ORDER?</a>'
533				+'</div>'
534				+'</div>'
535				+'<script>');
536    	var host = document.querySelector(host_selector);
537
538		host.appendChild(rto_element);
539		
540		LUI.attachGEvents(host);
541		var rto = document.querySelector(".buy-container");
542        rto.style.display = "block";
543		LUI.started_ordbtn = true;
544	}
545}
546
547
548var gtm = "GTM-N5JSL76";
549var gtm_datalayer = "evttrk_dataLayer";
550LUI.createEventTrackingPx = function()
551{
552	if(typeof window[gtm_datalayer] =="undefined")
553	{
554		window[gtm_datalayer] = window[gtm_datalayer] || [];
555		(function(w,d,s,l,i){
556			w[l]=w[l]||[];
557			w[l].push({ affiliate_id: LUI.env["affiliate"] || null });
558			w[l].push({
559				'gtm.start': new Date().getTime(),
560				event:'gtm.js'});
561			var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';
562			j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;
563			f.parentNode.insertBefore(j,f);
564		})(window,document,'script',gtm_datalayer, gtm);
565	}
566}
567LUI.createEventTrackingPx();
568
569LUI.myGoogleEvent = async function(setup)
570{
571	try{
572		LUI.env["t"] = ((Date.now()- __start)/1000).toFixed(2);
573		if(setup.target)
574		{
575			window[gtm_datalayer].push({"event":"lion-click", "lion-label": "" + this.getAttribute("g-evt")});
576			await LUI.events.push({"click":JSON.stringify(LUI.env),"label": this.getAttribute("g-evt")});
577		}
578		else
579		{
580			if(setup.indexNow)
581				LUI.env["vi"] = setup.indexNow.toFixed(2);
582			if(setup.timeNow)
583				LUI.env["vt"] = setup.timeNow.toFixed(2);
584			
585			if(setup.unmute)
586			{
587				LUI.env["vum"] = true;
588				await LUI.events.push({"videostart":JSON.stringify(LUI.env)});
589				// we only count from this moment on!
590				
591			}
592			else if(setup.pause)
593			{
594				LUI.env["vum"] = false;
595				await LUI.events.push({"video_pause":JSON.stringify(LUI.env)});	
596			}
597			else if(setup.play)
598			{
599				LUI.env["vum"] = true;
600				await LUI.events.push({"video_play":JSON.stringify(LUI.env)});
601			}
602			else if(setup.videostart)
603			{
604				
605				LUI.env["vs"] = ((Date.now()- __start)/1000 - setup.timeNow).toFixed(2);
606				if(LUI.env["vs"]<0)
607					LUI.env["vs"] = 0;
608				else
609					await LUI.events.push({"videoloaded":JSON.stringify(LUI.env)});
610			}else
611			{
612				if(LUI.env["vum"] && LUI.env["lvt"] != LUI.env["vt"])
613				{
614					LUI.env["lvt"] = LUI.env["vt"];
615					await LUI.events.push({"video":JSON.stringify(LUI.env)});
616					window[gtm_datalayer].push({
617						"event":"video_ping", 
618						"watch_time_sec": Math.floor(setup.timeNow/10), 
619						"video_host": window.location.hostname,
620						"video_name": window.UPplayer.config_setup,
621						"video_vtid": LUI.env["vtid"],
622						"video_affid": LUI.env["affiliate"],
623					});
624				}
625			}
626			window[gtm_datalayer].push({"event":"lion-video", "lion-label": "" + setup.indexNow, "lion-host":window.location.hostname,"lion-vsl":window.UPplayer.config_setup});
627			// new setup
628			
629			
630			
631		}
632		localStorage.setItem("staticenv", JSON.stringify(LUI.env));
633	}catch(e){console.log(e)};
634	
635}
636
637LUI.attachGEvents = function(scope)
638{
639	// attach g-event management
640	var list = scope.querySelectorAll("[g-evt]");
641	
642	for(var i=0; i<list.length; i++)
643	{
644		list[i].addEventListener("pointerdown",LUI.myGoogleEvent);
645	}
646}
647
648LUI.getFlowID = function()
649{
650	var flow_id = LUI.getURLParameter("ax_item");
651	if(flow_id == null)
652		flow_id = LUI.getURLParameter("item");
653	if(isNaN(flow_id))
654	{
655		for(var id in LUI.setup)
656		{
657			if(LUI.setup[id]["codename"] == flow_id)
658				flow_id = id;
659		}
660	}
661	return flow_id;
662}
663
664LUI.getReplaceParameter = function(type, parameter,item=null)
665{
666	var flow_id = 0;
667	try{
668		var type_ar = type.split(".");
669		type = type_ar[0];
670		variant = type_ar[1];
671		 
672		flow_id = LUI.getFlowID();
673		
674		var sitem = (type =="fe")? (flow_id >""? flow_id: item) : LUI.setup.flow[flow_id].flow[type];
675		
676		if(variant && Array.isArray(sitem))
677			sitem = sitem[variant];
678		else if(!variant && Array.isArray(sitem))
679			sitem = sitem[0];
680		
681		if(typeof sitem == "object")
682			sitem = sitem["item"];
683		if(Array.isArray(sitem))
684			sitem = sitem[variant?variant:0];
685		
686		return LUI.setup[sitem][parameter];
687	}catch(e)
688	{
689		console.error("Variable not defined:[" + parameter + "] for [" + type + "] on flow [" + flow_id + "]");
690		return "[" + flow_id + ":" + type + "/" + parameter + "/" + item + "]"
691	}
692}
693
694LUI.getProductLayer = function()
695{
696	let fid = LUI.getFlowID();
697	let upsell_map = LUI.setup["upsell_map"]!=undefined?LUI.setup["upsell_map"]:null;
698	if(LUI.setup["flow"][fid]!=undefined)
699	{
700		upsell_map = LUI.setup["flow"][fid]["upsell_map"]!=undefined?LUI.setup["flow"][fid]["upsell_map"]:LUI.setup["upsell_map"];
701	}
702	
703	if(upsell_map)
704	{
705		let path = window.location.pathname;
706		for (const [key, value] of Object.entries(upsell_map)) 
707		{
708	        if (path.includes(value)) {
709	            return key; // Return the matching key
710	        }
711	    }
712		return null;
713	}
714}
715
716LUI.getProd4Buylink = function(buylink)
717{
718	let $return = ((buylink)=>{
719		
720		let buylink_ar = buylink.split(".");
721		buylink = buylink_ar[0];
722		let variant = buylink_ar[1];
723		
724		if(LUI.setup["links_map"])
725		{
726			let lsetup = LUI.setup["links_map"][buylink];
727			let fid = LUI.getFlowID();
728			
729			if(lsetup[0]=="fe")
730			{
731				let p = LUI.setup[lsetup[1]]; 
732				return {product:p, id:lsetup[1], label:"fe", value:p["price"]};
733			}
734			
735			if(fid)
736			{
737				let pid = LUI.setup["flow"][fid]["flow"][lsetup[0]];
738				
739				if(pid["item"])
740					pid = pid["item"];
741				
742				if(Array.isArray(pid))
743					pid = pid[variant?variant:0];
744				
745				let p = LUI.setup[pid];
746				
747				if(lsetup[2]=="yes")
748					return {product:p, id:pid, label:lsetup[0], value:p["price"]};
749				else
750					return {product:p, id:pid, label:lsetup[0], value:0};
751			}
752		}
753		else
754		{
755			
756			let mapped = {
757				buy1_link:1,
758				buy2_link:6,
759				buy3_link:2,
760				buy6_link:3,
761				retargeting_link:66
762			}[buylink];
763			if(!mapped)
764			{
765				let linksetup = {
766					upsell1_yes: ["up",1],
767					upsell1_no: ["up",0],
768					downsell1_yes: ["down",1],
769					downsell1_no: ["down",0],
770					upsell3_yes: ["up3",1],
771					upsell3_no: ["up3",0],
772					upsell4_yes: ["up4",1],
773					upsell4_no: ["up4",0]
774				}[buylink];
775				
776				let fid = LUI.getFlowID();
777				if(fid)
778				{
779					let pid = LUI.setup["flow"][fid]["flow"][linksetup[0]];
780					if(Array.isArray(pid) && variant)
781						pid = pid[variant];
782					
783					let p = LUI.setup[pid];
784					
785					if(linksetup[1])
786						return {product:p, id:pid, label:linksetup[0], value:p["price"]};
787					else
788						return {product:p, id:pid, label:linksetup[0], value:0};
789				}
790				
791			}
792			else
793			{
794				let p = LUI.setup[mapped]; 
795				return {product:p, id:mapped, label:"fe", value:p["price"]};
796			}
797		}
798	})(buylink);
799	
800	return $return;
801}
802
803LUI.getProduct = function($type, $id)
804{
805	var flow_id = LUI.getFlowID();
806	var sitem = ($type =="fe")? $id : LUI.setup.flow[flow_id].flow[$type];
807	if(typeof sitem == "object")
808		sitem = sitem["item"];
809	return sitem;
810}
811
812LUI.replace = function(base, config)
813{
814	if(typeof config == "object")
815	{
816		for(var i in config)
817		{
818			
819			base = base.replace((config[i][0][0]=="/")?config[i][0]:new RegExp('(?<=\\b)'+config[i][0]+'(?=\\b)'), config[i][1]);
820		}
821			
822		return base;
823	}
824	return config;
825}
826
827LUI.date = {};
828LUI.date.setYear = function(obj, year)
829{
830	var obj_year = obj.getFullYear();
831	var match = "";
832	if(match = /([+-]*)([0-9]+)/g.exec(year))
833	{
834		var sign = match[1];
835		var value = parseInt(match[2]);
836		
837		if(sign=="+")
838		{
839			obj.setFullYear(obj_year + value);
840		}
841		else if(sign=="-")
842		{
843			obj.setFullYear(obj_year - value);
844		}
845		else
846		{
847			obj.setFullYear(value);
848		}
849	}
850}
851
852LUI.date.setMonth = function(obj, month)
853{
854	var obj_month = obj.getMonth();
855	var match = "";
856	if(match = /([+-]*)([0-9]+)/g.exec(month))
857	{
858		var sign = match[1];
859		var value = parseInt(match[2]);
860		
861		if(sign=="+")
862		{
863			obj.setMonth(obj_month + value);
864		}
865		else if(sign=="-")
866		{
867			obj.setMonth(obj_month - value);
868		}
869		else
870		{
871			obj.setMonth(value-1);
872		}
873	}
874}
875
876
877LUI.date.setDay = function(obj, day)
878{
879	var obj_day = obj.getDay(); // week day!
880	var obj_date = obj.getDate(); // month day
881	var match = "";
882	if(match = /([+-]*)([0-9]+)/g.exec(day))
883	{
884		var sign = match[1];
885		var value = parseInt(match[2]);
886		
887		if(sign=="+")
888		{
889			obj.setDate(obj_date + value);
890		}
891		else if(sign=="-")
892		{
893			obj.setDate(obj_date - value);
894		}
895		else
896		{
897			obj.setDate(value);
898		}
899	}
900	else if(match = /(MO|TU|WE|TH|FR|SA|SU)/ig.exec(day))
901	{
902		var day = {
903			"MO":1,
904			"TU":2,
905			"WE":3,
906			"TH":4,
907			"FR":5,
908			"SA":6,
909			"SO":0
910		}[match[1]];
911		
912		obj.setDate(1);
913		
914		while (obj.getDay() !== day) {
915            obj.setDate(obj.getDate() + 1);
916        }
917	}
918}
919
920/**************************************
921 * Date class extension
922 * 
923 */
924    // Provide month names
925    Date.prototype.getMonthName = function(){
926        var month_names = [
927                            'January',
928                            'February',
929                            'March',
930                            'April',
931                            'May',
932                            'June',
933                            'July',
934                            'August',
935                            'September',
936                            'October',
937                            'November',
938                            'December'
939                        ];
940
941        return month_names[this.getMonth()];
942    }
943
944    // Provide month abbreviation
945    Date.prototype.getMonthAbbr = function(){
946        var month_abbrs = [
947                            'Jan',
948                            'Feb',
949                            'Mar',
950                            'Apr',
951                            'May',
952                            'Jun',
953                            'Jul',
954                            'Aug',
955                            'Sep',
956                            'Oct',
957                            'Nov',
958                            'Dec'
959                        ];
960
961        return month_abbrs[this.getMonth()];
962    }
963
964    // Provide full day of week name
965    Date.prototype.getDayFull = function(){
966        var days_full = [
967                            'Sunday',
968                            'Monday',
969                            'Tuesday',
970                            'Wednesday',
971                            'Thursday',
972                            'Friday',
973                            'Saturday'
974                        ];
975        return days_full[this.getDay()];
976    };
977
978    // Provide full day of week name
979    Date.prototype.getDayAbbr = function(){
980        var days_abbr = [
981                            'Sun',
982                            'Mon',
983                            'Tue',
984                            'Wed',
985                            'Thur',
986                            'Fri',
987                            'Sat'
988                        ];
989        return days_abbr[this.getDay()];
990    };
991
992    // Provide the day of year 1-365
993    Date.prototype.getDayOfYear = function() {
994        var onejan = new Date(this.getFullYear(),0,1);
995        return Math.ceil((this - onejan) / 86400000);
996    };
997
998    // Provide the day suffix (st,nd,rd,th)
999    Date.prototype.getDaySuffix = function() {
1000        var d = this.getDate();
1001        var sfx = ["th","st","nd","rd"];
1002        var val = d%100;
1003
1004        return (sfx[(val-20)%10] || sfx[val] || sfx[0]);
1005    };
1006
1007    // Provide Week of Year
1008    Date.prototype.getWeekOfYear = function() {
1009        var onejan = new Date(this.getFullYear(),0,1);
1010        return Math.ceil((((this - onejan) / 86400000) + onejan.getDay()+1)/7);
1011    } 
1012
1013    // Provide if it is a leap year or not
1014    Date.prototype.isLeapYear = function(){
1015        var yr = this.getFullYear();
1016
1017        if ((parseInt(yr)%4) == 0){
1018            if (parseInt(yr)%100 == 0){
1019                if (parseInt(yr)%400 != 0){
1020                    return false;
1021                }
1022                if (parseInt(yr)%400 == 0){
1023                    return true;
1024                }
1025            }
1026            if (parseInt(yr)%100 != 0){
1027                return true;
1028            }
1029        }
1030        if ((parseInt(yr)%4) != 0){
1031            return false;
1032        } 
1033    };
1034
1035    // Provide Number of Days in a given month
1036    Date.prototype.getMonthDayCount = function() {
1037        var month_day_counts = [
1038                                    31,
1039                                    this.isLeapYear() ? 29 : 28,
1040                                    31,
1041                                    30,
1042                                    31,
1043                                    30,
1044                                    31,
1045                                    31,
1046                                    30,
1047                                    31,
1048                                    30,
1049                                    31
1050                                ];
1051
1052        return month_day_counts[this.getMonth()];
1053    } 
1054
1055    // format provided date into this.format format
1056    Date.prototype.format = function(dateFormat){
1057        // break apart format string into array of characters
1058        dateFormat = dateFormat.split("");
1059
1060        var date = this.getDate(),
1061            month = this.getMonth(),
1062            hours = this.getHours(),
1063            minutes = this.getMinutes(),
1064            seconds = this.getSeconds();
1065        // get all date properties ( based on PHP date object functionality )
1066        var date_props = {
1067            d: date < 10 ? '0'+date : date,
1068            D: this.getDayAbbr(),
1069            j: this.getDate(),
1070            l: this.getDayFull(),
1071            S: this.getDaySuffix(),
1072            w: this.getDay(),
1073            z: this.getDayOfYear(),
1074            W: this.getWeekOfYear(),
1075            F: this.getMonthName(),
1076            m: month < 10 ? '0'+(month+1) : month+1,
1077            M: this.getMonthAbbr(),
1078            n: month+1,
1079            t: this.getMonthDayCount(),
1080            L: this.isLeapYear() ? '1' : '0',
1081            Y: this.getFullYear(),
1082            y: this.getFullYear()+''.substring(2,4),
1083            a: hours > 12 ? 'pm' : 'am',
1084            A: hours > 12 ? 'PM' : 'AM',
1085            g: hours % 12 > 0 ? hours % 12 : 12,
1086            G: hours > 0 ? hours : "12",
1087            h: hours % 12 > 0 ? hours % 12 : 12,
1088            H: hours,
1089            i: minutes < 10 ? '0' + minutes : minutes,
1090            s: seconds < 10 ? '0' + seconds : seconds           
1091        };
1092
1093        // loop through format array of characters and add matching data else add the format character (:,/, etc.)
1094        var date_string = "";
1095        for(var i=0;i < dateFormat.length;i++){
1096            var f = dateFormat[i];
1097            if(f.match(/[a-zA-Z]/g)){
1098                date_string += date_props[f] ? date_props[f] : '';
1099            } else {
1100                date_string += f;
1101            }
1102        }
1103
1104        return date_string;
1105    };
1106/*
1107 *
1108 * END - Date class extension
1109 * 
1110 ************************************/
1111
1112$evrtrack_px_url = "";
1113(function(){
1114try{
1115    LUI.setup = JSON.parse(atob(LUI.set));
1116    var afop = LUI.getURLParameter("affop");
1117    if(afop > "" && typeof LUI.setup.aff_hops != "undefined" && typeof LUI.setup.aff_hops[afop] != "undefined")
1118    {
1119    	var params = LUI.getURLParameter();
1120    	delete params.affop;
1121    	var ar = window.location.pathname.split("/");
1122    	ar.shift();
1123    	ar.pop();
1124		var af_ar = LUI.setup.aff_hops[afop].split("?");
1125		if(af_ar.length > 1)
1126		{
1127			ar.push(af_ar[0] + ".php");
1128			var addp = new URLSearchParams(af_ar[1]);
1129			
1130			for (const [key, value] of addp) 
1131				params[key] = value;
1132		}
1133		else
1134		{
1135			ar.push(LUI.setup.aff_hops[afop] + ".php");
1136		}
1137		
1138    	window.location.replace(window.location.protocol + "//" + window.location.hostname + "/" + ar.join("/") + "?" + new URLSearchParams(params).toString());
1139    }
1140}catch(e){console.log(e)};
1141})();
1142
1143
1144async function initStatic(){
1145	
1146	LUI.env["stl"] = ((Date.now()- __start)/1000).toFixed(2);
1147	// process product images
1148	elements = document.querySelectorAll("[filter]");
1149	for (var i = 0; i < elements.length; i++) {
1150		var item = elements[i];
1151		var ar = item.getAttribute("filter").split(";");
1152		for(var j in ar)
1153		{
1154			var sar = ar[j].split("=");
1155			
1156			var params = LUI.getURLParameter(sar[0])?.split("|");
1157			if(params)
1158			for(param of params)
1159			if(param >"" && param == sar[1])
1160			{
1161				item.style.display = "block";
1162				break;
1163			}
1164		}
1165	}
1166	
1167	// process svgize
1168	var tosvg = document.querySelectorAll("[svgize]");
1169	for(var i=0; i<tosvg.length; i++)
1170	{
1171		var inner_html = tosvg[i].innerHTML;
1172		var lines = inner_html.split("<br>");
1173		var y = 0;
1174		var y_step = 1*tosvg[i].getAttribute("svgize");
1175		var y_dist = 2;
1176		var x = 500;
1177		var final_html = "";
1178		
1179		for(var k in lines)
1180		{
1181			y += y_step;
1182			final_html += '<text x="50%" y="' + y  +'" text-anchor="middle" class="vsl-headline">' + lines[k].replace(/span/g,"tspan") + '</text>';
1183			y += y_dist;
1184		}
1185		
1186		tosvg[i].innerHTML = '<svg viewBox="0 0 550 ' + (y + 8) + '">' + final_html + "</svg>";
1187		
1188		var adjust = function(myelm){
1189	    	setTimeout(function(){
1190	    		if(myelm.getBBox().width != 0)
1191	    		{
1192	    			var view_box = myelm.getAttribute("viewBox").split(" ");
1193	    			view_box[3] = myelm.getBBox().height;
1194	    			view_box[2] = myelm.getBBox().width + 5;
1195	    			myelm.setAttribute("viewBox",view_box.join(" "));
1196	    		}
1197	    		else
1198	    		{
1199	    			adjust(myelm);
1200	    		}
1201	    		
1202	    	},"100");
1203		}
1204		adjust(tosvg[i].children[0]);
1205	}
1206	
1207	// process dates
1208	elements = document.querySelectorAll("[date]");
1209	for (var i = 0; i < elements.length; i++) {
1210		var item = elements[i];
1211	
1212		var year = item.getAttribute("year");
1213		var d = new Date();
1214		if(year > "")
1215			LUI.date.setYear(d, year);
1216		
1217		var month = item.getAttribute("month");
1218		if(month > "")
1219			LUI.date.setMonth(d, month);
1220			
1221		var day = item.getAttribute("day");
1222		if(day > "")
1223			LUI.date.setDay(d, day);
1224		
1225		var format = item.getAttribute("format");
1226		if(format > "")
1227			item.innerHTML = d.format(format);
1228		else
1229			item.innerHTML = d;
1230	}
1231	
1232	if(LUI.set > "")
1233	{
1234		
1235		var is_mobile = LUI.isMobile();
1236		
1237		LUI.setup = JSON.parse(atob(LUI.set));
1238		
1239		LUI.env["project"] = LUI.setup["offer_name"];
1240		LUI.env["is_mobile"] = is_mobile?"true":"false";
1241		
1242		var afop = LUI.getURLParameter("affop");
1243		if(afop > "" && typeof LUI.setup.aff_hops != "undefined" && typeof LUI.setup.aff_hops[afop] != "undefined")
1244		{
1245			var params = LUI.getURLParameter();
1246			
1247			delete params.affop;
1248			
1249			var ar = window.location.pathname.split("/");
1250			ar.shift();
1251			ar.pop();
1252			var af_ar = LUI.setup.aff_hops[afop].split("?");
1253			if(af_ar.length > 1)
1254			{
1255				ar.push(af_ar[0] + ".php");
1256				var addp = new URLSearchParams(af_ar[1]);
1257				
1258				for (const [key, value] of addp) 
1259					params[key] = value;
1260			}
1261			else
1262			{
1263				ar.push(LUI.setup.aff_hops[afop] + ".php");
1264			}
1265			window.location.replace(window.location.protocol + "//" + window.location.hostname + "/" + ar.join("/") + "?" + new URLSearchParams(params).toString());
1266			return;
1267		}
1268		
1269		document.body.style.display = "block";
1270		
1271		// process all products
1272		var elements = document.querySelectorAll("span[replace]");
1273		var flow_id = LUI.getFlowID();
1274		
1275		// process product mentions
1276		elements.forEach(function(item){
1277			item.parentNode.replaceChild(document.createTextNode(LUI.getReplaceParameter(item.getAttribute("type"),item.getAttribute("parameter"),item.getAttribute("item"))),item);
1278		});
1279		
1280		// process product images
1281		elements = document.querySelectorAll("img[productimage]");
1282		elements.forEach(function(item){
1283			var img_name = item.getAttribute("img");
1284			if(!(img_name>""))
1285				img_name = "image";
1286			var type  = item.getAttribute("type");
1287			var type_ar = type.split(".");
1288			var variant  = type_ar[1];
1289			type = type_ar[0];
1290			
1291			var sitem = (item.getAttribute("type") =="fe")? (flow_id >""? flow_id: item.getAttribute("productimage")) : LUI.setup.flow[flow_id].flow[type];
1292			
1293			if(variant && Array.isArray(sitem))
1294				sitem = sitem[variant];
1295			else if(!variant && Array.isArray(sitem))
1296				sitem = sitem[0];
1297			 
1298			if(typeof sitem == "object")
1299				sitem = sitem["item"];
1300				
1301			if(Array.isArray(sitem))
1302				sitem = sitem[variant?variant:0];
1303			
1304			item.setAttribute("src",LUI.setup[sitem][img_name]);
1305		});
1306		
1307		
1308		// process buy links
1309		
1310		// process vtid
1311		var vtid = LUI.getURLParameter("vtid");
1312		var vtid_ds = LUI.getURLParameter("ds24tr");
1313		var vtid_bg = LUI.getURLParameter("subid5");
1314		if(vtid>"" && vtid_ds >"")
1315		{
1316			vtid = vtid_ds;
1317		}
1318		else if(!(vtid>"") && vtid_bg >"")
1319		{
1320			vtid = vtid_bg;
1321		}
1322		else if(LUI.env["vtid"] >"")
1323		{
1324			vtid = LUI.env["vtid"];
1325		}
1326		
1327		LUI.env["vtid"] = vtid;
1328		
1329		if(vtid <= "")
1330		{
1331			LUI.env["vtid"] = vtid = LUI.getCookie("vtid");
1332		}
1333		else
1334		{
1335			LUI.setCookie("vtid", vtid);
1336		}
1337		
1338		// pasrams for buylinks
1339		var params = new URLSearchParams(window.location.search);
1340		params.delete("cbitems");
1341		params.delete("cbur");
1342		/*
1343
1344		cb: vtid ->  vtid
1345		ds: ds24tr -> trackingkey
1346		bg: subid5 -> subid5
1347		 */
1348		if(vtid_ds > "")
1349			params.set("ds24tr",vtid_ds);
1350		else if(vtid_bg > "")
1351			params.set("subid5",vtid_bg);
1352		else if(vtid>"")
1353			params.set("vtid",vtid);
1354			
1355		elements = document.querySelectorAll("[buylink]");
1356		elements.forEach(function(item){
1357			
1358			let clean = item.getAttribute("clean")=="yes";
1359			
1360			var sparams = new URLSearchParams();
1361			// copy
1362			params.forEach(function(value,key){
1363				if(key && key!='null'&&key!="cbur")
1364					sparams.set(key,value);
1365			})
1366			
1367			var added_params = new URLSearchParams(item.getAttribute("addedparams"));
1368			added_params.forEach(function(value,key){
1369				if(key && key!='null')
1370					sparams.set(key,value);
1371			})
1372			
1373			var buylink = item.getAttribute("buylink");
1374			var buylink_part = buylink.split(".")[0];
1375			
1376			if(buylink == buylink_part && !LUI.setup.links[buylink])
1377				buylink = buylink + ".0";
1378			
1379			function updateRedirectWithAxItem(url, axItemValue) {
1380				try{
1381					let ourl = new URL(url);
1382					
1383					let redp = ourl.searchParams.get('redirect');
1384					if (redp) 
1385					{
1386						let redURL = new URL(atob(redp));
1387						if (!redURL.searchParams.has('ax_item')) 
1388						{
1389							redURL.searchParams.set('ax_item', axItemValue);
1390							ourl.searchParams.set('redirect', btoa(redURL.toString()));
1391						}
1392					}
1393					let res = ourl.toString();
1394					return res;
1395				}catch(e)
1396				{
1397					console.log(e);
1398					return url;
1399				}
1400			}
1401			
1402			try{
1403				if(flow_id > "" && LUI.setup.links[buylink][flow_id] != undefined)
1404				{
1405					// upsell links
1406					if(clean)
1407						item.setAttribute("href",LUI.setup.links[buylink][flow_id]);
1408					else
1409						item.setAttribute("href",updateRedirectWithAxItem(LUI.setup.links[buylink][flow_id],flow_id) + "&" + sparams.toString() );
1410				}
1411				else if(flow_id > "" && LUI.setup.links[buylink_part][flow_id] != undefined)
1412				{
1413					// upsell links
1414					if(clean)
1415						item.setAttribute("href",LUI.setup.links[buylink_part][flow_id]);
1416					else
1417						item.setAttribute("href",updateRedirectWithAxItem(LUI.setup.links[buylink_part][flow_id],flow_id) + "&" + sparams.toString() );
1418				}
1419				else
1420				{
1421					// front end links
1422					if(clean)
1423						item.setAttribute("href",LUI.setup.links[buylink][is_mobile?"mobile":"desktop"]);
1424					else 
1425						item.setAttribute("href",LUI.setup.links[buylink][is_mobile?"mobile":"desktop"] + "&" + sparams.toString() );
1426				}
1427			}catch(e)
1428			{
1429				console.log(e, "Not found: "  + buylink_part + " -> " + flow_id);
1430			}
1431		});
1432		
1433		// we have correct vtid value
1434		if(vtid > "")
1435		{
1436			// get the avatar and replace the image with the correct one!
1437			if(LUI.vtid_map[vtid] !== undefined)
1438			{
1439				for(var conf in LUI.vtid_map[vtid] )
1440				{
1441					var ar = conf.split("@");
1442					
1443					var elms = document.querySelectorAll(ar[0]);
1444					for(var i =0; i< elms.length; i++)
1445					{
1446						var elm  = elms[i];
1447						if(elm!== null)
1448						{
1449							if(ar[1] == "_text")
1450							{
1451								elm.innerHTML = LUI.replace(elm.innerHTML,LUI.vtid_map[vtid][conf]);
1452							}
1453							else
1454							{
1455								elm.setAttribute(ar[1],LUI.replace(elm.getAttribute(ar[1]),LUI.vtid_map[vtid][conf]));
1456							}
1457						}
1458					}
1459				}
1460			}
1461		}	
1462		
1463		// handle google 
1464		var gwait = 0;
1465		var makeLinks = function(){
1466			var gcid = LUI.getCookie("_ga");
1467			gwait++;
1468			
1469			if(gcid > "" || gwait>10)
1470			{
1471				if(gcid > "")
1472				{
1473					var gcidar = gcid.split(".");
1474					gcidar.shift();
1475					gcidar.shift();
1476					gcid = gcidar.join(".");
1477				}
1478				
1479				clearInterval(mklinterval);
1480				
1481				elements = document.querySelectorAll('[buylink]:not([clean="yes"])');
1482				elements.forEach(function(item){
1483					item.setAttribute("href",item.getAttribute("href") + "&_ga=" + gcid);
1484				});
1485				
1486			}
1487		};
1488		var mklinterval =  setInterval(makeLinks,100);
1489		
1490		// process nmx
1491		var nmx = LUI.getURLParameter("nmx"); 
1492		if(nmx == "1")
1493		{
1494			var advertorial = LUI.createElementFromHTML("<div class='text-center pt-3 advertorial' id='advertorial' ><span style='letter-spacing: 0.2rem;'>advertorial</span></div>");
1495			var container = document.querySelector(".atf_wrapper");
1496			container.parentNode.insertBefore(advertorial, container);
1497		}
1498		
1499		// process popz
1500		var popz = LUI.getURLParameter("popz");
1501		
1502		if(typeof video_setup !== "undefined" && typeof video_config !== "undefined")
1503		{
1504			var v_setup = video_setup;
1505			var v_config = video_config;
1506			
1507			if(popz == "1" && v_setup["popz"])
1508			{
1509				v_setup = v_setup["popz"];
1510				v_config = v_config["popz"];
1511			}
1512			else if(typeof v_setup["default"] !== "undefined")
1513			{
1514				v_setup = v_setup["default"];
1515				v_config = v_config["default"];
1516			}
1517			new UPManager(v_setup, v_config);
1518		}
1519		
1520		// compose conversion pixel
1521		let conversion_value = 1;
1522		let get_item = "";
1523		let affiliate_id = "";
1524		let aff = LUI.getCookie("aff");
1525		let aff_id = "";
1526		
1527		if(LUI.getURLParameter("aff_id")) // BG - pass via cookie
1528		{
1529			let _aff = LUI.getURLParameter("aff_id");
1530			LUI.setCookie("aff",_aff);
1531			LUI.env["affiliate"] = _aff;
1532			LUI.env["tid"] = LUI.getURLParameter("subid");
1533		} 
1534		else if(LUI.getURLParameter("aff")) // DS - pass via cookie
1535		{
1536			let _aff = LUI.getURLParameter("aff");
1537			LUI.setCookie("aff",_aff);
1538			LUI.env["affiliate"] = _aff;
1539			LUI.env["tid"] = LUI.getURLParameter("cam");
1540		}
1541		else
1542		{
1543			if(LUI.getURLParameter("cbaffi") > "")
1544			{
1545				aff = aff_id = LUI.getURLParameter("cbaffi"); // CB
1546				get_item = LUI.getURLParameter("item"); // CB
1547			}
1548			else if(LUI.getURLParameter("hop") > "")
1549			{
1550				aff = aff_id = LUI.getURLParameter("hop"); // CB
1551			}
1552			else if(LUI.getURLParameter("affiliate") > "")
1553			{
1554				
1555				aff = aff_id = LUI.getURLParameter("affiliate"); // CB - direct
1556				LUI.env["tid"] = LUI.getURLParameter("tid");
1557			}
1558			else if(LUI.getURLParameter("aff_id"))
1559			{
1560				aff_id = LUI.getCookie("aff"); // BG
1561				get_item = LUI.getURLParameter("ax_item"); // BG
1562			}
1563			else if(LUI.getURLParameter("aff"))
1564			{
1565				aff_id = LUI.getCookie("aff");;// DS
1566				get_item = LUI.getURLParameter("ax_item"); // DS
1567				// get_item = LUI.getURLParameter("digistore_initial_product_id"); // DS?
1568			}
1569			LUI.env["affiliate"] = aff_id;
1570		}
1571		if(aff_id > "")
1572		{
1573			affiliate_id = aff_id;
1574		    LUI.setCookie("aff", aff_id);
1575		    
1576		} 
1577		else if(aff > ""  && get_item > "")
1578		{
1579		    affiliate_id = aff;
1580	
1581			if(get_item > "" && typeof LUI.setup[get_item]["price"] != "undefined")
1582			{
1583				conversion_value = LUI.setup[get_item]["price"];
1584			}
1585		}
1586		
1587		/*
1588		if(aff > "" && LUI.tracking > "" )
1589		{
1590		    var scr = document.createElement("SCRIPT");
1591            scr.setAttribute("src", "https://evrtrack.com/basepixel.php?p=" + LUI.setup["offer_id"] + "&affid=" + aff + "&value=" + conversion_value + "&type=" + LUI.tracking);
1592            document.head.appendChild(scr);
1593		}
1594		*/
1595	}
1596	
1597	// process grvm4cb
1598	try{
1599		(function(){
1600			if(LUI.getURLParameter("grvm") > "" && LUI.setup["offer_id"].split("_")[1] == "CB")
1601			{
1602				// activate gracvity machine
1603				// console.log(LUI.setup["links"]["buy1_link"]["desktop"]);
1604				var buylinks = document.querySelectorAll('A[href*="pay.clickbank.net"]');
1605				
1606				var setaff = function(except){
1607					var list_affs = ["1aeroslim","1brainsync","5mediaprom","alphaxtra","alphazym","apexbyr","apexdog","apexfer","apexfmap","apexrrr","apexsgc","apexsqg","apexsss","apexstc","apextmf","aquapeace","arteris","biomelt","biorest","bogdanapex","boldapex","boldapex1","boldapex2","boldapex3","boldapex4","brandcash","brandedd","brandedp","brandetf","brandfks","brandguf","brandhaf","brandhbt","brandhlp","brandhrp","brandlast","brandmeg","brandmms","brandpfw","brandpls","brandsbp","brandsdt","brandser","brandsoc","brandsre","brandsugar","brandvif","brandwell","breathebls","cbfast1","claritox","cleanestbd","dentatonic","denticore","dentitox","dentivive","dermaprime","elprodent","enzymelt","everfaff","eyefortin","fastleanpr","flexobliss","flowforce","foliprime","fortbite","fortiprime","fungalfpro","glucoflush","glucoshld","glucotune","gutoptim","hidragenix","honeyburn","hydracel","hydrossent","illuderma","kerabiotic","kerafort","keragenis","kerassent","keravita","leanbliss","lightmrk","lightningm","liongtm","lionlpt","liposlend","lissham","mannaslim","masterss99","memodef","memomaxpro","metslim","mitoboost","mycosyn","
1607nanodefpro","neotonics","nervogen","nervolink","neurocalm","neurotonix","nightslim","orexiburn","pawbiotix","powerbite","prodentim","promindc","pronailcom","prostadine","prostas","purelumine","purpleburn","pushyt","quietplus","refirmance","restolin","revivaglow","revivalt","seanapex","sonobliss","sonofit","sonovive","srnprime","steelbite","synogut","terracalm","thelld","ultrak9pro","vigortonic","visium","ytlion"];
1608					
1609					var list_affs = list_affs.filter(function(item) {
1610					    return item !== except;
1611					});
1612					var aff = list_affs[Math.floor(Math.random() * list_affs.length)];
1613					var url = window.location.href;
1614					window.history.pushState({}, document.title, url + ( url.includes('?') ? '&' : '?' ) + 'affiliate=' + aff);
1615					return aff;
1616				}
1617				
1618				var aff = setaff();
1619				
1620				for(var i=0; i<buylinks.length; i++)
1621				{
1622					
1623					var vendor = buylinks[i].href.match(/https\:\/\/(.*)\.pay\.clickbank\.net/ims)[1];
1624					if(vendor == aff)
1625						aff = setaff(vendor);// try another random
1626					buylinks[i].href = buylinks[i].href.replace(vendor,aff+"_"+vendor);
1627					
1628				}
1629				
1630			
1631		}})();
1632	} catch(e){console.log(e);}
1633	
1634	document.body.style.display = "block";
1635	LUI.attachGEvents(document);
1636	const event = document.createEvent("Event");
1637	event.initEvent("staticsDone", true, true);
1638	document.body.dispatchEvent(event);
1639	
1640	// tracking
1641	let match = LUI.setup["offer_id"].match(/^([A-Z]+)_.*?(CB|BG|DS)/);
1642    let res = match ? { pj: match[1], gw: match[2] } : { pj: null, gw: null };
1643	LUI.env["pj"] = res["pj"];
1644	LUI.env["gw"] = res["gw"];
1645	LUI.env["oid"] = LUI.setup["offer_id"];
1646	
1647	
1648	if(window.UPplayer)
1649	{
1650		LUI.env["bact"] = Object.keys(window.UPplayer.config)
1651	        .filter(key => /^\d+$/.test(key) && key !== "1") 
1652	        .find(key => data[key].some(obj => obj.show === "#btn-cta"));
1653	}
1654	 
1655	
1656	document.addEventListener("scroll", function(e){
1657		LUI.env["st"] = window.scrollY;
1658		LUI.env["sl"] = window.scrollX;
1659	});
1660	
1661	document.addEventListener("resize", function(e){
1662		LUI.env["vw"] = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0),
1663		LUI.env["vh"] = Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0)
1664	});
1665	
1666	//let flow_id = LUI.getFlowID();
1667	LUI.env["flow"] = flow_id;
1668	if(!LUI.env["vsl"])
1669		LUI.env["vsl"] = window.UPplayer?window.UPplayer.config_setup:"text";
1670	// console.log(LUI.env);
1671	
1672	let upsell_map = {};
1673	let upsell_map_s = "";
1674	
1675	if(LUI.setup.flow[flow_id]!==undefined && LUI.setup.flow[flow_id].upsell_map!==undefined)
1676		upsell_map = LUI.setup.flow[flow_id].upsell_map;
1677	else if(LUI.setup.upsell_map!==undefined)
1678		upsell_map = LUI.setup.upsell_map;
1679	
1680	upsell_map_s = Object.values(upsell_map).join("|").replace(/([.*\-+?^${}()\\\/])/g, '\\$1');
1681	upsell_map_s += (upsell_map_s > ""?"|":"") + "upsell|thank\\\-you\\\.php";
1682	
1683	if(LUI.tracking && LUI.tracking == "lander")
1684	{
1685		// force vsl override if lander is triggered!
1686		LUI.env["vsl"] = window.UPplayer?window.UPplayer.config_setup:"text";
1687		
1688		//if(LUI.env["lander"] == false)
1689		//{
1690			let hour = await LUI.events.push({"lander":JSON.stringify(LUI.env)});
1691			if(hour>0)
1692			{
1693				LUI.env["hour"] = hour;
1694			}
1695			//LUI.env["lander"] = true;
1696		//}
1697	}
1698	else if(LUI.tracking && LUI.tracking == "conversion")
1699	{
1700		window[gtm_datalayer].push({"event":"conversion"});
1701		
1702		// we need to add it to total
1703		if(LUI.env["convs"][LUI.env["conv"]] == false)
1704		{
1705			LUI.env["funnel"] = "fe:"+LUI.env["conv"];
1706			
1707			await LUI.events.push({"conversion":JSON.stringify(LUI.env)});
1708			LUI.env["convs"][LUI.env["conv"]] = true;
1709			LUI.env["convv"] = 0;
1710			LUI.env["conv"] = null;
1711		}
1712	} 
1713	else if(window.location.pathname.match(new RegExp(upsell_map_s)))
1714	{
1715		if(LUI.env["convs"][LUI.env["conv"]] == false)
1716		{
1717			let s = {};
1718			
1719			// let layer = LUI.getProductLayer();
1720			
1721			
1722			
1723			// conv1 - up/down/up3/up4
1724			//s[LUI.env["convl"]] = JSON.stringify(LUI.env);
1725			if(LUI.env["convv"] > 0 )
1726			{
1727				LUI.env["funnel"] += "-" + LUI.env["convl"] + ":" +LUI.env["conv"];
1728				s["funnel"] = JSON.stringify(LUI.env);
1729				await LUI.events.push(s);
1730			}
1731			
1732			LUI.env["convs"][LUI.env["conv"]] = true;
1733			LUI.env["convv"] = 0;
1734			LUI.env["convl"] = null;
1735			LUI.env["conv"] = null;
1736		}
1737	}
1738	
1739	localStorage.setItem("staticenv", JSON.stringify(LUI.env));
1740
1741	var b_elms = document.querySelectorAll('[buylink]:not([clean="yes"])');
1742	b_elms.forEach(function(item){
1743		// get buy value - 
1744		var buylink = item.getAttribute("buylink");
1745		
1746		try{
1747			
1748			var p = LUI.getProd4Buylink(buylink);
1749			let urlObj = new URL(item.getAttribute("href"));
1750		    urlObj.searchParams.set("_b", btoa(LUI.env["hour"] + ";" + LUI.env["page"] + ";" + LUI.env["vtid"] + ";"+ LUI.env["vsl"] + ";" + p["id"] + ";" + p["value"]+ ";" + p["label"] + ";" + LUI.env["vtid"]));
1751		    
1752			item.setAttribute("href", urlObj.toString() );
1753			item.addEventListener("pointerdown", async function(event){
1754				if ({"pen":1,"touch":1}[event.pointerType]>0|| (event.pointerType === "mouse" && event.button === 0)) {
1755					//console.log("PASS1");
1756					event.preventDefault();
1757					//console.log("PASS2");
1758					try{
1759						//console.log("PASS3");
1760						var buylink_name = this.getAttribute("buylink");
1761						var ps = LUI.getProd4Buylink(buylink_name);
1762						//console.log("PASS4");
1763						if(LUI.env["convs"][ps.id] == undefined)
1764						{
1765							//console.log("PASS5");
1766							LUI.env["convs"][ps.id] = false;
1767							LUI.env["convv"] = ps.value;
1768							LUI.env["conv"] = ps.id;
1769							LUI.env["convl"] = ps.label;
1770							
1771							if(!LUI.env["buyclick"] && LUI.tracking && LUI.tracking == "lander" && LUI.env["vt"]>0)
1772							{
1773								//console.log("PASS6");
1774								let s = {};
1775								if(window.UPplayer)
1776									LUI.env["return_visit"] = window.UPplayer.return_visit?1:0;
1777																
1778								s["buyclick"] = JSON.stringify(LUI.env);
1779								await LUI.events.push(s);
1780								//console.log("PASS7");
1781							}
1782							LUI.env["buyclick"] = true;
1783							localStorage.setItem("staticenv", JSON.stringify(LUI.env));
1784						}
1785					}catch(e){
1786						console.log(e);
1787						
1788					} // any error doesn't stop the redirect!
1789					//console.log("MOVE!");
1790					//window.location.href = event.currentTarget.href;
1791				}
1792			});
1793		}catch(e)
1794		{
1795			console.log(e);
1796		}
1797	});
1798	
1799	LUI.env["std"] = ((Date.now()- __start)/1000).toFixed(2);
1800}
1801
1802if (document.readyState === "complete" 
1803     || document.readyState === "loaded" 
1804     || document.readyState === "interactive")
1805	initStatic();
1806else
1807	window.addEventListener("DOMContentLoaded", initStatic);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.