index of
/
home
/
thefkyzp
/
hulmvisaadvisor.com
/
wp-content
/
plugins
/
chaty
/
admin
/
assets
/
js
/
File: /home/thefkyzp/hulmvisaadvisor.com/wp-content/plugins/chaty/admin/assets/js/mailcheck.js
var Mailcheck={domainThreshold:2,secondLevelThreshold:2,topLevelThreshold:2,defaultDomains:["msn.com","bellsouth.net","telus.net","comcast.net","optusnet.com.au","earthlink.net","qq.com","sky.com","icloud.com","mac.com","sympatico.ca","googlemail.com","att.net","xtra.co.nz","web.de","cox.net","gmail.com","ymail.com","aim.com","rogers.com","verizon.net","rocketmail.com","google.com","optonline.net","sbcglobal.net","aol.com","me.com","btinternet.com","charter.net","shaw.ca","premio.io"],defaultSecondLevelDomains:["yahoo","hotmail","mail","live","outlook","gmx"],defaultTopLevelDomains:["com","com.au","com.tw","ca","co.nz","co.uk","de","fr","it","ru","net","org","edu","gov","jp","nl","kr","se","eu","ie","co.il","us","at","be","dk","hk","es","gr","ch","no","cz","in","net","net.au","info","biz","mil","co.jp","sg","hu","uk","io"],run:function(e){e.domains=e.domains||Mailcheck.defaultDomains,e.secondLevelDomains=e.secondLevelDomains||Mailcheck.defaultSecondLevelDomains,e.topLevelDomains=e.topLevelDomains||Mailcheck.defaultTopLevelDomains,e.distanceFunction=e.distanceFunction||Mailcheck.sift4Distance;var t=function(e){return e},i=e.suggested||t,s=e.empty||t,o=Mailcheck.suggest(Mailcheck.encodeEmail(e.email),e.domains,e.secondLevelDomains,e.topLevelDomains,e.distanceFunction);return o?i(o):s()},suggest:function(e,t,i,s,o){e=e.toLowerCase();var n=this.splitEmail(e);if(i&&s&&-1!==i.indexOf(n.secondLevelDomain)&&-1!==s.indexOf(n.topLevelDomain))return!1;var a=this.findClosestDomain(n.domain,t,o,this.domainThreshold);if(a)return a!=n.domain&&{address:n.address,domain:a,full:n.address+"@"+a};var l=this.findClosestDomain(n.secondLevelDomain,i,o,this.secondLevelThreshold),c=this.findClosestDomain(n.topLevelDomain,s,o,this.topLevelThreshold);if(n.domain){a=n.domain;var h=!1;if(l&&l!=n.secondLevelDomain&&(a=a.replace(n.secondLevelDomain,l),h=!0),c&&c!=n.topLevelDomain&&""!==n.secondLevelDomain&&(a=a.replace(new RegExp(n.topLevelDomain+"$"),c),h=!0),h)return{address:n.address,domain:a,full:n.address+"@"+a}}return!1},findClosestDomain:function(e,t,i,s){var o;s=s||this.topLevelThreshold;var n=1/0,a=null;if(!e||!t)return!1;i||(i=this.sift4Distance);for(var l=0;l<t.length;l++){if(e===t[l])return e;(o=i(e,t[l]))<n&&(n=o,a=t[l])}return n<=s&&null!==a&&a},sift4Distance:function(e,t,i){if(void 0===i&&(i=5),!e||!e.length)return t?t.length:0;if(!t||!t.length)return e.length;for(var s=e.length,o=t.length,n=0,a=0,l=0,c=0,h=0,r=[];n<s&&a<o;){if(e.charAt(n)==t.charAt(a)){c++;for(var d=!1,f=0;f<r.length;){var u=r[f];if(n<=u.c1||a<=u.c2){(d=Math.abs(a-n)>=Math.abs(u.c2-u.c1))?h++:u.trans||(u.trans=!0,h++);break}n>u.c2&&a>u.c1?r.splice(f,1):f++}r.push({c1:n,c2:a,trans:d})}else{l+=c,c=0,n!=a&&(n=a=Math.min(n,a));for(var m=0;m<i&&(n+m<s||a+m<o);m++){if(n+m<s&&e.charAt(n+m)==t.charAt(a)){n+=m-1,a--;break}if(a+m<o&&e.charAt(n)==t.charAt(a+m)){n--,a+=m-1;break}}}a++,(++n>=s||a>=o)&&(l+=c,c=0,n=a=Math.min(n,a))}return l+=c,Math.round(Math.max(s,o)-l+h)},splitEmail:function(e){var t=(e=null!==e?e.replace(/^\s*/,"").replace(/\s*$/,""):null).split("@");if(t.length<2)return!1;for(var i=0;i<t.length;i++)if(""===t[i])return!1;var s=t.pop(),o=s.split("."),n="",a="";if(0===o.length)return!1;if(1==o.length)a=o[0];else{n=o[0];for(var l=1;l<o.length;l++)a+=o[l]+".";a=a.substring(0,a.length-1)}return{topLevelDomain:a,secondLevelDomain:n,domain:s,address:t.join("@")}},encodeEmail:function(e){var t=encodeURI(e);return t=t.replace("%20"," ").replace("%25","%").replace("%5E","^").replace("%60","`").replace("%7B","{").replace("%7C","|").replace("%7D","}")}};"undefined"!=typeof module&&module.exports&&(module.exports=Mailcheck),"function"==typeof define&&define.amd&&define("mailcheck",[],(function(){return Mailcheck})),"undefined"!=typeof window&&window.jQuery&&(jQuery.fn.mailcheck=function(e){var t=this;if(e.suggested){var i=e.suggested;e.suggested=function(e){i(t,e)}}if(e.empty){var s=e.empty;e.empty=function(){s.call(null,t)}}e.email=this.val(),Mailcheck.run(e)}),function(e,t,i,s){var o="emailautocomplete",n={suggClass:"eac-sugg",domains:["yahoo.com","hotmail.com","gmail.com","me.com","aol.com","mac.com","live.com","comcast.net","googlemail.com","msn.com","hotmail.co.uk","yahoo.co.uk","facebook.com","verizon.net","sbcglobal.net","att.net","gmx.com","outlook.com","icloud.com"]};function a(t,i){this.$field=e(t),this.options=e.extend(!0,{},n,i),this._defaults=n,this._domains=this.options.domains,this.init()}a.prototype={init:function(){Array.prototype.indexOf||this.doIndexOf(),this.fieldLeftOffset=null;var t=e("<div class='eac-input-wrap' />").css({display:this.$field.css("display"),position:"static"===this.$field.css("position")?"relative":this.$field.css("position"),fontSize:this.$field.css("fontSize")});this.$field.wrap(t),this.$cval=e("<span class='eac-cval' />").css({visibility:"hidden",position:"absolute",display:"inline-block",fontFamily:this.$field.css("fontFamily"),fontWeight:this.$field.css("fontWeight"),letterSpacing:this.$field.css("letterSpacing")}).insertAfter(this.$field);var i=(this.$field.outerHeight(!0)-this.$field.height())/2;this.$suggOverlay=e("<span class='"+this.options.suggClass+"' />").css({display:"block","box-sizing":"content-box",lineHeight:this.$field.css("lineHeight"),paddingTop:i+"px",paddingBottom:i+"px",fontFamily:this.$field.css("fontFamily"),fontWeight:this.$field.css("fontWeight"),letterSpacing:this.$field.css("letterSpacing"),position:"absolute",top:0,left:0}).insertAfter(this.$field),this.$field.on("keyup.eac",e.proxy(this.displaySuggestion,this)),this.$field.on("blur.eac",e.proxy(this.autocomplete,this)),this.$field.on("keydown.eac",e.proxy((function(e){39!==e.which&&9!==e.which&&32!==e.which&&13!==e.which||this.autocomplete(),9!==e.which||this.$field.hasClass("email-focus")?(32===e.which&&e.preventDefault(),this.$field.removeClass("email-focus")):this.$field.addClass("email-focus")}),this)),this.$field.on("click",e.proxy((function(e){this.autocomplete()}),this)),this.$suggOverlay.on("mousedown.eac touchstart.eac",e.proxy(this.autocomplete,this))},suggest:function(t){var i=(t=e.trim(t.toLowerCase())).split("@");return i.length>1&&(t=i.pop()).length?(this._domains.filter((function(e){return 0===e.indexOf(t)})).shift()||"").replace(t,""):""},autocomplete:function(){if(void 0===this.suggestion||this.suggestion.length<1)return!1;this.$field.val(this.val+this.suggestion),this.$suggOverlay.text(""),this.$cval.text("")},displaySuggestion:function(e){this.val=this.$field.val(),this.suggestion=this.suggest(this.val),this.suggestion.length?e.preventDefault():this.$suggOverlay.text(""),this.$suggOverlay.text(this.suggestion),this.$cval.text(this.val),null===this.fieldLeftOffset&&(this.fieldLeftOffset=(this.$field.outerWidth(!0)-this.$field.width())/2);var t=this.$cval.width();this.$field.outerWidth()>t&&this.$suggOverlay.css("left",this.fieldLeftOffset+t+"px")},doIndexOf:function(){Array.prototype.indexOf=function(e,t){if(null==this)throw new TypeError('"this" is null or not defined');var i=this.length>>>0;for(t=+t||0,Math.abs(t)===1/0&&(t=0),t<0&&(t+=i)<0&&(t=0);t<i;t++)if(this[t]===e)return t;return-1}}},e.fn[o]=function(t){return this.each((function(){e.data(this,"yz_"+o)||e.data(this,"yz_"+o,new a(this,t))}))}}(jQuery,window,document);