/*!
* jQuery Password Strength plugin for Twitter Bootstrap
* Version: 2.0.6
*
* Copyright (c) 2008-2013 Tane Piper
* Copyright (c) 2013 Alejandro Blanco
* Dual licensed under the MIT and GPL licenses.
*/
(function(n){var u={},r,n,f,t,i,e;(function(n,t){"use strict";n.fallback={wordLength:"Your password is too short",wordNotEmail:"Do not use your email as your password",wordSimilarToUsername:"Your password cannot contain your username",wordTwoCharacterClasses:"Use different character classes",wordRepetitions:"Too many repetitions",wordSequences:"Your password contains sequences",errorList:"Errors:",veryWeak:"Very Weak",weak:"Weak",normal:"Normal",medium:"Medium",strong:"Strong",veryStrong:"Very Strong"};n.t=function(i){var r="";return r=t?t.t(i):n.fallback[i],r===i?"":r}})(u,window.i18next);r={};try{!n&&module&&module.exports&&(n=require("jquery"),f=require("jsdom").jsdom,n=n(f().defaultView))}catch(o){}(function(n,t){"use strict";var i={};t.forbiddenSequences=["0123456789","abcdefghijklmnopqrstuvwxyz","qwertyuiop","asdfghjkl","zxcvbnm","!@#$%^&*()_+"];i.wordNotEmail=function(n,t,i){return t.match(/^([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*[\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+@((((([a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,6})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)$/i)?i:0};i.wordLength=function(n,t,i){var u=t.length,r=Math.pow(u,n.rules.raisePower);return u<n.common.minChar&&(r=r+i),r};i.wordSimilarToUsername=function(t,i,r){var u=n(t.common.usernameField).val();return u&&i.toLowerCase().match(u.replace(/[\-\[\]\/\{\}\(\)\*\+\=\?\:\.\\\^\$\|\!\,]/g,"\\$&").toLowerCase())?r:0};i.wordTwoCharacterClasses=function(n,t,i){return t.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)||t.match(/([a-zA-Z])/)&&t.match(/([0-9])/)||t.match(/(.[!,@,#,$,%,\^,&,*,?,_,~])/)&&t.match(/[a-zA-Z0-9_]/)?i:0};i.wordRepetitions=function(n,t,i){return t.match(/(.)\1\1/)?i:0};i.wordSequences=function(i,r,u){var e=!1,f;return r.length>2&&(n.each(t.forbiddenSequences,function(t,i){if(!e){var u=[i,i.split("").reverse().join("")];n.each(u,function(n,t){for(f=0;f<r.length-2;f+=1)t.indexOf(r.toLowerCase().substring(f,f+3))>-1&&(e=!0)})}}),e)?u:0};i.wordLowercase=function(n,t,i){return t.match(/[a-z]/)&&i};i.wordUppercase=function(n,t,i){return t.match(/[A-Z]/)&&i};i.wordOneNumber=function(n,t,i){return t.match(/\d+/)&&i};i.wordThreeNumbers=function(n,t,i){return t.match(/(.*[0-9].*[0-9].*[0-9])/)&&i};i.wordOneSpecialChar=function(n,t,i){return t.match(/[!,@,#,$,%,\^,&,*,?,_,~]/)&&i};i.wordTwoSpecialChar=function(n,t,i){return t.match(/(.*[!,@,#,$,%,\^,&,*,?,_,~].*[!,@,#,$,%,\^,&,*,?,_,~])/)&&i};i.wordUpperLowerCombo=function(n,t,i){return t.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)&&i};i.wordLetterNumberCombo=function(n,t,i){return t.match(/([a-zA-Z])/)&&t.match(/([0-9])/)&&i};i.wordLetterNumberCharCombo=function(n,t,i){return t.match(/([a-zA-Z0-9].*[!,@,#,$,%,\^,&,*,?,_,~])|([!,@,#,$,%,\^,&,*,?,_,~].*[a-zA-Z0-9])/)&&i};t.validation=i;t.executeRules=function(i,r){var u=0;return n.each(i.rules.activated,function(f,e){if(e){var c=i.rules.scores[f],s=t.validation[f],o,h;n.isFunction(s)||(s=i.rules.extra[f]);n.isFunction(s)&&(o=s(i,r,c),o&&(u+=o),(o<0||!n.isNumeric(o)&&!o)&&(h=i.ui.spanError(i,f),h.length>0&&i.instances.errors.push(h)))}}),n.isFunction(i.common.onScore)&&(u=i.common.onScore(i,r,u)),u}})(n,r);try{module&&module.exports&&(module.exports=r)}catch(o){}t={};t.common={};t.common.minChar=6;t.common.usernameField="#username";t.common.userInputs=[];t.common.onLoad=undefined;t.common.onKeyUp=undefined;t.common.onScore=undefined;t.common.zxcvbn=!1;t.common.zxcvbnTerms=[];t.common.events=["keyup","change","paste"];t.common.debug=!1;t.rules={};t.rules.extra={};t.rules.scores={wordNotEmail:-100,wordLength:-50,wordSimilarToUsername:-100,wordSequences:-20,wordTwoCharacterClasses:2,wordRepetitions:-25,wordLowercase:1,wordUppercase:3,wordOneNumber:3,wordThreeNumbers:5,wordOneSpecialChar:3,wordTwoSpecialChar:5,wordUpperLowerCombo:2,wordLetterNumberCombo:2,wordLetterNumberCharCombo:2};t.rules.activated={wordNotEmail:!0,wordLength:!0,wordSimilarToUsername:!0,wordSequences:!0,wordTwoCharacterClasses:!1,wordRepetitions:!1,wordLowercase:!0,wordUppercase:!0,wordOneNumber:!0,wordThreeNumbers:!0,wordOneSpecialChar:!0,wordTwoSpecialChar:!0,wordUpperLowerCombo:!0,wordLetterNumberCombo:!0,wordLetterNumberCharCombo:!0};t.rules.raisePower=1.4;t.ui={};t.ui.bootstrap2=!1;t.ui.bootstrap4=!1;t.ui.colorClasses=["danger","danger","danger","warning","warning","success"];t.ui.showProgressBar=!0;t.ui.progressBarEmptyPercentage=1;t.ui.progressBarMinPercentage=1;t.ui.progressBarExtraCssClasses="";t.ui.showPopover=!1;t.ui.popoverPlacement="bottom";t.ui.showStatus=!1;t.ui.spanError=function(n,t){"use strict";var i=n.i18n.t(t);return i?'<span style="color: #d52929">'+i+"<\/span>":""};t.ui.popoverError=function(t){"use strict";var r=t.instances.errors,u=t.i18n.t("errorList"),i="<div>"+u+"<ul class='error-list' style='margin-bottom: 0;'>";return n.each(r,function(n,t){i+="<li>"+t+"<\/li>"}),i+="<\/ul><\/div>"};t.ui.showVerdicts=!0;t.ui.showVerdictsInsideProgressBar=!1;t.ui.useVerdictCssClass=!1;t.ui.showErrors=!1;t.ui.showScore=!1;t.ui.container=undefined;t.ui.viewports={progress:undefined,verdict:undefined,errors:undefined,score:undefined};t.ui.scores=[0,14,26,38,50];t.i18n={};t.i18n.t=u.t;i={},function(n,t){"use strict";var i=["error","warning","success"],r=["veryWeak","weak","normal","medium","strong","veryStrong"];t.getContainer=function(t,i){var r;return r=n(t.ui.container),r&&r.length===1||(r=i.parent()),r};t.findElement=function(n,t,i){return t?n.find(t).find(i):n.find(i)};t.getUIElements=function(n,i){var u,r;return n.instances.viewports?n.instances.viewports:(u=t.getContainer(n,i),r={},r.$progressbar=t.findElement(u,n.ui.viewports.progress,"div.progress"),n.ui.showVerdictsInsideProgressBar&&(r.$verdict=r.$progressbar.find("span.password-verdict")),n.ui.showPopover||(n.ui.showVerdictsInsideProgressBar||(r.$verdict=t.findElement(u,n.ui.viewports.verdict,"span.password-verdict")),r.$errors=t.findElement(u,n.ui.viewports.errors,"ul.error-list")),r.$score=t.findElement(u,n.ui.viewports.score,"span.password-score"),n.instances.viewports=r,r)};t.initProgressBar=function(i,r){var f=t.getContainer(i,r),u="<div class='progress ";u+=i.ui.bootstrap2?i.ui.progressBarExtraCssClasses+"'><div class='":"'><div class='"+i.ui.progressBarExtraCssClasses+" progress-";u+="bar'>";i.ui.showVerdictsInsideProgressBar&&(u+="<span class='password-verdict'><\/span>");u+="<\/div><\/div>";i.ui.viewports.progress?f.find(i.ui.viewports.progress).append(u):n(u).insertAfter(r)};t.initHelper=function(i,r,u,f){var e=t.getContainer(i,r);f?e.find(f).append(u):n(u).insertAfter(r)};t.initVerdict=function(n,i){t.initHelper(n,i,"<span class='password-verdict'><\/span>",n.ui.viewports.verdict)};t.initErrorList=function(n,i){t.initHelper(n,i,"<ul class='error-list'><\/ul>",n.ui.viewports.errors)};t.initScore=function(n,i){t.initHelper(n,i,"<span class='password-score'><\/span>",n.ui.viewports.score)};t.initPopover=function(n,t){t.popover("destroy");t.popover({html:!0,placement:n.ui.popoverPlacement,trigger:"manual",content:" "})};t.initUI=function(n,i){n.ui.showPopover?t.initPopover(n,i):(n.ui.showErrors&&t.initErrorList(n,i),n.ui.showVerdicts&&!n.ui.showVerdictsInsideProgressBar&&t.initVerdict(n,i));n.ui.showProgressBar&&t.initProgressBar(n,i);n.ui.showScore&&t.initScore(n,i)};t.updateProgressBar=function(i,r,u,f){var s=t.getUIElements(i,r).$progressbar,e=s.find(".progress-bar"),o="progress-";i.ui.bootstrap2&&(e=s.find(".bar"),o="");n.each(i.ui.colorClasses,function(n,t){i.ui.bootstrap4?e.removeClass("bg-"+t):e.removeClass(o+"bar-"+t)});i.ui.bootstrap4?e.addClass("bg-"+i.ui.colorClasses[u]):e.addClass(o+"bar-"+i.ui.colorClasses[u]);e.css("width",f+"%")};t.updateVerdict=function(n,i,r,u){var f=t.getUIElements(n,i).$verdict;f.removeClass(n.ui.colorClasses.join(" "));r>-1&&f.addClass(n.ui.colorClasses[r]);f.html(u)};t.updateErrors=function(i,r,u){var e=t.getUIElements(i,r).$errors,f="";u||n.each(i.instances.errors,function(n,t){f+="<li>"+t+"<\/li>"});e.html(f)};t.updateScore=function(n,i,r,u){var e=t.getUIElements(n,i).$score,f="";u||(f=r.toFixed(2));e.html(f)};t.updatePopover=function(n,t,i,r){var u=t.data("bs.popover"),f="",e=!0;if(n.ui.showVerdicts&&!n.ui.showVerdictsInsideProgressBar&&i.length>0&&(f="<h5><span class='password-verdict'>"+i+"<\/span><\/h5>",e=!1),n.ui.showErrors&&(n.instances.errors.length>0&&(e=!1),f+=n.ui.popoverError(n)),e||r){t.popover("hide");return}n.ui.bootstrap2&&(u=t.data("popover"));u.$arrow&&u.$arrow.parents("body").length>0?t.find("+ .popover .popover-content").html(f):(u.options.content=f,t.popover("show"))};t.updateFieldStatus=function(t,r,u,f){var o=t.ui.bootstrap2?".control-group":".form-group",e=r.parents(o).first();(n.each(i,function(n,i){t.ui.bootstrap2||(i="has-"+i);e.removeClass(i)}),f)||(u=i[u],t.ui.bootstrap2||(u="has-"+u),e.addClass(u))};t.percentage=function(n,t,i){var r=Math.floor(100*t/i),u=n.ui.progressBarMinPercentage;return r=r<=u?u:r,r>100?100:r};t.getVerdictAndCssClass=function(n,t){var i,u;return t===undefined?["",0]:(i=t<=n.ui.scores[0]?0:t<n.ui.scores[1]?1:t<n.ui.scores[2]?2:t<n.ui.scores[3]?3:t<n.ui.scores[4]?4:5,u=r[i],[n.i18n.t(u),i])};t.updateUI=function(n,i,r){var u,o,f,e;u=t.getVerdictAndCssClass(n,r);f=r===0?"":u[0];u=u[1];e=n.ui.useVerdictCssClass?u:-1;n.ui.showProgressBar&&(o=r===undefined?n.ui.progressBarEmptyPercentage:t.percentage(n,r,n.ui.scores[4]),t.updateProgressBar(n,i,u,o),n.ui.showVerdictsInsideProgressBar&&t.updateVerdict(n,i,e,f));n.ui.showStatus&&t.updateFieldStatus(n,i,u,r===undefined);n.ui.showPopover?t.updatePopover(n,i,f,r===undefined):(n.ui.showVerdicts&&!n.ui.showVerdictsInsideProgressBar&&t.updateVerdict(n,i,e,f),n.ui.showErrors&&t.updateErrors(n,i,r===undefined));n.ui.showScore&&t.updateScore(n,i,r,r===undefined)}}(n,i);e={},function(n,u){"use strict";var f,o,e;f=function(t){var s=n(t.target),u=s.data("pwstrength-bootstrap"),h=s.val(),o,e,c,f;if(u!==undefined&&(u.instances.errors=[],h.length===0?f=undefined:u.common.zxcvbn?(o=[],n.each(u.common.userInputs.concat([u.common.usernameField]),function(t,i){var r=n(i).val();r&&o.push(r)}),o=o.concat(u.common.zxcvbnTerms),f=zxcvbn(h,o).guesses,f=Math.log(f)*Math.LOG2E):f=r.executeRules(u,h),i.updateUI(u,s,f),e=i.getVerdictAndCssClass(u,f),c=e[1],e=e[0],u.common.debug&&console.log(f+" - "+e),n.isFunction(u.common.onKeyUp)))u.common.onKeyUp(t,{score:f,verdictText:e,verdictLevel:c})};o=function(t){var r=n(t.target),e=r.val(),u=0,i;i=function(){var n=r.val();n!==e?f(t):u<3&&(u+=1,setTimeout(i,100))};setTimeout(i,100)};u.init=function(r){return this.each(function(u,e){var c=n.extend(!0,{},t),s=n.extend(!0,c,r),h=n(e);s.instances={};h.data("pwstrength-bootstrap",s);n.each(s.common.events,function(n,t){var i=t==="paste"?o:f;h.on(t,i)});i.initUI(s,h);h.trigger("keyup");n.isFunction(s.common.onLoad)&&s.common.onLoad()}),this};u.destroy=function(){this.each(function(t,r){var u=n(r),e=u.data("pwstrength-bootstrap"),f=i.getUIElements(e,u);f.$progressbar.remove();f.$verdict.remove();f.$errors.remove();u.removeData("pwstrength-bootstrap")})};u.forceUpdate=function(){this.each(function(n,t){var i={target:t};f(i)})};u.addRule=function(t,i,r,u){this.each(function(f,e){var o=n(e).data("pwstrength-bootstrap");o.rules.activated[t]=u;o.rules.scores[t]=r;o.rules.extra[t]=i})};e=function(t,i,r){this.each(function(u,f){n(f).data("pwstrength-bootstrap").rules[i][t]=r})};u.changeScore=function(n,t){e.call(this,n,"scores",t)};u.ruleActive=function(n,t){e.call(this,n,"activated",t)};n.fn.pwstrength=function(t){var i;return u[t]?i=u[t].apply(this,Array.prototype.slice.call(arguments,1)):typeof t!="object"&&t?n.error("Method "+t+" does not exist on jQuery.pwstrength-bootstrap"):i=u.init.apply(this,arguments),i}}(n,e)})(jQuery)