/* Minification failed. Returning unminified contents.
(14912,22-23): run-time error JS1300: Strict-mode does not allow assignment to undefined variables: i
(14912,56-57): run-time error JS1294: Strict-mode does not allow ++ or -- on certain objects: i
 */
/*! jQuery v3.2.1 | (c) JS Foundation and other contributors | jquery.org/license */
!function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.2.1",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null==a?f.call(this):a<0?this[a+this.length]:this[a]},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(a<0?b:0);return this.pushStack(c>=0&&c<b?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:h,sort:c.sort,splice:c.splice},r.extend=r.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||r.isFunction(g)||(g={}),h===i&&(g=this,h--);h<i;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(r.isPlainObject(d)||(e=Array.isArray(d)))?(e?(e=!1,f=c&&Array.isArray(c)?c:[]):f=c&&r.isPlainObject(c)?c:{},g[b]=r.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},r.extend({expando:"jQuery"+(q+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===r.type(a)},isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=r.type(a);return("number"===b||"string"===b)&&!isNaN(a-parseFloat(a))},isPlainObject:function(a){var b,c;return!(!a||"[object Object]"!==k.call(a))&&(!(b=e(a))||(c=l.call(b,"constructor")&&b.constructor,"function"==typeof c&&m.call(c)===n))},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?j[k.call(a)]||"object":typeof a},globalEval:function(a){p(a)},camelCase:function(a){return a.replace(t,"ms-").replace(u,v)},each:function(a,b){var c,d=0;if(w(a)){for(c=a.length;d<c;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(s,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(w(Object(a))?r.merge(c,"string"==typeof a?[a]:a):h.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:i.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;d<c;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;f<g;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,f=0,h=[];if(w(a))for(d=a.length;f<d;f++)e=b(a[f],f,c),null!=e&&h.push(e);else for(f in a)e=b(a[f],f,c),null!=e&&h.push(e);return g.apply([],h)},guid:1,proxy:function(a,b){var c,d,e;if("string"==typeof b&&(c=a[b],b=a,a=c),r.isFunction(a))return d=f.call(arguments,2),e=function(){return a.apply(b||this,d.concat(f.call(arguments)))},e.guid=a.guid=a.guid||r.guid++,e},now:Date.now,support:o}),"function"==typeof Symbol&&(r.fn[Symbol.iterator]=c[Symbol.iterator]),r.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){j["[object "+b+"]"]=b.toLowerCase()});function w(a){var b=!!a&&"length"in a&&a.length,c=r.type(a);return"function"!==c&&!r.isWindow(a)&&("array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a)}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",M="\\["+K+"*("+L+")(?:"+K+"*([*^$|!~]?=)"+K+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+L+"))|)"+K+"*\\]",N=":("+L+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+M+")*)|.*)\\)|)",O=new RegExp(K+"+","g"),P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ca=function(a,b){return b?"\0"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0&&("form"in a||"label"in a)},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"form"in b?b.parentNode&&b.disabled===!1?"label"in b?"label"in b.parentNode?b.parentNode.disabled===a:b.disabled===a:b.isDisabled===a||b.isDisabled!==!a&&ea(b)===a:b.disabled===a:"label"in b&&b.disabled===a}}function pa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}}):(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c,d,e,f=b.getElementById(a);if(f){if(c=f.getAttributeNode("id"),c&&c.value===a)return[f];e=b.getElementsByName(a),d=0;while(f=e[d++])if(c=f.getAttributeNode("id"),c&&c.value===a)return[f]}return[]}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){if("undefined"!=typeof b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:!b||(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[c<0?c+b:c]}),even:pa(function(a,b){for(var c=0;c<b;c+=2)a.push(c);return a}),odd:pa(function(a,b){for(var c=1;c<b;c+=2)a.push(c);return a}),lt:pa(function(a,b,c){for(var d=c<0?c+b:c;--d>=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=c<0?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=ma(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=na(b);function ra(){}ra.prototype=d.filters=d.pseudos,d.setFilters=new ra,g=ga.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){c&&!(e=Q.exec(h))||(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=R.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(P," ")}),h=h.slice(c.length));for(g in d.filter)!(e=V[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?ga.error(a):z(a,i).slice(0)};function sa(a){for(var b=0,c=a.length,d="";b<c;b++)d+=a[b].value;return d}function ta(a,b,c){var d=b.dir,e=b.next,f=e||d,g=c&&"parentNode"===f,h=x++;return b.first?function(b,c,e){while(b=b[d])if(1===b.nodeType||g)return a(b,c,e);return!1}:function(b,c,i){var j,k,l,m=[w,h];if(i){while(b=b[d])if((1===b.nodeType||g)&&a(b,c,i))return!0}else while(b=b[d])if(1===b.nodeType||g)if(l=b[u]||(b[u]={}),k=l[b.uniqueID]||(l[b.uniqueID]={}),e&&e===b.nodeName.toLowerCase())b=b[d]||b;else{if((j=k[f])&&j[0]===w&&j[1]===h)return m[2]=j[2];if(k[f]=m,m[2]=a(b,c,i))return!0}return!1}}function ua(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;d<e;d++)ga(a,b[d],c);return c}function wa(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;h<i;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function xa(a,b,c,d,e,f){return d&&!d[u]&&(d=xa(d)),e&&!e[u]&&(e=xa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||va(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:wa(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=wa(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?I(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];i<f;i++)if(c=d.relative[a[i].type])m=[ta(ua(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;e<f;e++)if(d.relative[a[e].type])break;return xa(i>1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,i<e&&ya(a.slice(i,e)),e<f&&ya(a=a.slice(e)),e<f&&sa(a))}m.push(c)}return ua(m)}function za(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,c,e){var f,i,j,k,l,m="function"==typeof a&&a,n=!e&&g(a=m.selector||a);if(c=c||[],1===n.length){if(i=n[0]=n[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&9===b.nodeType&&p&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(_,aa),b)||[])[0],!b)return c;m&&(b=b.parentNode),a=a.slice(i.shift().value.length)}f=V.needsContext.test(a)?0:i.length;while(f--){if(j=i[f],d.relative[k=j.type])break;if((l=d.find[k])&&(e=l(j.matches[0].replace(_,aa),$.test(i[0].type)&&qa(b.parentNode)||b))){if(i.splice(f,1),a=e.length&&sa(i),!a)return G.apply(c,e),c;break}}}return(m||h(a,n))(e,b,!p,c,!b||$.test(a)&&qa(b.parentNode)||b),c},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext;function B(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()}var C=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,D=/^.[^:#\[\.,]*$/;function E(a,b,c){return r.isFunction(b)?r.grep(a,function(a,d){return!!b.call(a,d,a)!==c}):b.nodeType?r.grep(a,function(a){return a===b!==c}):"string"!=typeof b?r.grep(a,function(a){return i.call(b,a)>-1!==c}):D.test(b)?r.filter(b,a,c):(b=r.filter(b,a),r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType}))}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;b<d;b++)if(r.contains(e[b],this))return!0}));for(c=this.pushStack([]),b=0;b<d;b++)r.find(a,e[b],c);return d>1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(E(this,a||[],!1))},not:function(a){return this.pushStack(E(this,a||[],!0))},is:function(a){return!!E(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var F,G=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,H=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||F,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:G.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),C.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};H.prototype=r.fn,F=r(d);var I=/^(?:parents|prev(?:Until|All))/,J={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;a<c;a++)if(r.contains(this,b[a]))return!0})},closest:function(a,b){var c,d=0,e=this.length,f=[],g="string"!=typeof a&&r(a);if(!A.test(a))for(;d<e;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function K(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return K(a,"nextSibling")},prev:function(a){return K(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return B(a,"iframe")?a.contentDocument:(B(a,"template")&&(a=a.content||a),r.merge([],a.childNodes))}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(J[a]||r.uniqueSort(e),I.test(a)&&e.reverse()),this.pushStack(e)}});var L=/[^\x20\t\r\n\f]+/g;function M(a){var b={};return r.each(a.match(L)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?M(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=e||a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){r.each(b,function(b,c){r.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==r.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return r.each(arguments,function(a,b){var c;while((c=r.inArray(b,f,c))>-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function N(a){return a}function O(a){throw a}function P(a,b,c,d){var e;try{a&&r.isFunction(e=a.promise)?e.call(a).done(b).fail(c):a&&r.isFunction(e=a.then)?e.call(a,b,c):b.apply(void 0,[a].slice(d))}catch(a){c.apply(void 0,[a])}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(b<f)){if(a=d.apply(h,i),a===c.promise())throw new TypeError("Thenable self-resolution");j=a&&("object"==typeof a||"function"==typeof a)&&a.then,r.isFunction(j)?e?j.call(a,g(f,c,N,e),g(f,c,O,e)):(f++,j.call(a,g(f,c,N,e),g(f,c,O,e),g(f,c,N,c.notifyWith))):(d!==N&&(h=void 0,i=[a]),(e||c.resolveWith)(h,i))}},k=e?j:function(){try{j()}catch(a){r.Deferred.exceptionHook&&r.Deferred.exceptionHook(a,k.stackTrace),b+1>=f&&(d!==O&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:N,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:N)),c[2][3].add(g(0,a,r.isFunction(d)?d:O))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(b<=1&&(P(a,g.done(h(c)).resolve,g.reject,!b),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)P(e[c],h(c),g.reject);return g.promise()}});var Q=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&Q.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout(function(){throw b})};var R=r.Deferred();r.fn.ready=function(a){return R.then(a)["catch"](function(a){r.readyException(a)}),this},r.extend({isReady:!1,readyWait:1,ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||R.resolveWith(d,[r]))}}),r.ready.then=R.then;function S(){d.removeEventListener("DOMContentLoaded",S),
a.removeEventListener("load",S),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",S),a.addEventListener("load",S));var T=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)T(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h<i;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},U=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function V(){this.expando=r.expando+V.uid++}V.uid=1,V.prototype={cache:function(a){var b=a[this.expando];return b||(b={},U(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[r.camelCase(b)]=c;else for(d in b)e[r.camelCase(d)]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][r.camelCase(b)]},access:function(a,b,c){return void 0===b||b&&"string"==typeof b&&void 0===c?this.get(a,b):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d=a[this.expando];if(void 0!==d){if(void 0!==b){Array.isArray(b)?b=b.map(r.camelCase):(b=r.camelCase(b),b=b in d?[b]:b.match(L)||[]),c=b.length;while(c--)delete d[b[c]]}(void 0===b||r.isEmptyObject(d))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!r.isEmptyObject(b)}};var W=new V,X=new V,Y=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Z=/[A-Z]/g;function $(a){return"true"===a||"false"!==a&&("null"===a?null:a===+a+""?+a:Y.test(a)?JSON.parse(a):a)}function _(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Z,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c=$(c)}catch(e){}X.set(a,b,c)}else c=void 0;return c}r.extend({hasData:function(a){return X.hasData(a)||W.hasData(a)},data:function(a,b,c){return X.access(a,b,c)},removeData:function(a,b){X.remove(a,b)},_data:function(a,b,c){return W.access(a,b,c)},_removeData:function(a,b){W.remove(a,b)}}),r.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=X.get(f),1===f.nodeType&&!W.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=r.camelCase(d.slice(5)),_(f,d,e[d])));W.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){X.set(this,a)}):T(this,function(b){var c;if(f&&void 0===b){if(c=X.get(f,a),void 0!==c)return c;if(c=_(f,a),void 0!==c)return c}else this.each(function(){X.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){X.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=W.get(a,b),c&&(!d||Array.isArray(c)?d=W.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return W.get(a,c)||W.access(a,c,{empty:r.Callbacks("once memory").add(function(){W.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?r.queue(this[0],a):void 0===b?this:this.each(function(){var c=r.queue(this,a,b);r._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&r.dequeue(this,a)})},dequeue:function(a){return this.each(function(){r.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=r.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=W.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var aa=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ba=new RegExp("^(?:([+-])=|)("+aa+")([a-z%]*)$","i"),ca=["Top","Right","Bottom","Left"],da=function(a,b){return a=b||a,"none"===a.style.display||""===a.style.display&&r.contains(a.ownerDocument,a)&&"none"===r.css(a,"display")},ea=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};function fa(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return r.css(a,b,"")},i=h(),j=c&&c[3]||(r.cssNumber[b]?"":"px"),k=(r.cssNumber[b]||"px"!==j&&+i)&&ba.exec(r.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,r.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var ga={};function ha(a){var b,c=a.ownerDocument,d=a.nodeName,e=ga[d];return e?e:(b=c.body.appendChild(c.createElement(d)),e=r.css(b,"display"),b.parentNode.removeChild(b),"none"===e&&(e="block"),ga[d]=e,e)}function ia(a,b){for(var c,d,e=[],f=0,g=a.length;f<g;f++)d=a[f],d.style&&(c=d.style.display,b?("none"===c&&(e[f]=W.get(d,"display")||null,e[f]||(d.style.display="")),""===d.style.display&&da(d)&&(e[f]=ha(d))):"none"!==c&&(e[f]="none",W.set(d,"display",c)));for(f=0;f<g;f++)null!=e[f]&&(a[f].style.display=e[f]);return a}r.fn.extend({show:function(){return ia(this,!0)},hide:function(){return ia(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){da(this)?r(this).show():r(this).hide()})}});var ja=/^(?:checkbox|radio)$/i,ka=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,la=/^$|\/(?:java|ecma)script/i,ma={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ma.optgroup=ma.option,ma.tbody=ma.tfoot=ma.colgroup=ma.caption=ma.thead,ma.th=ma.td;function na(a,b){var c;return c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[],void 0===b||b&&B(a,b)?r.merge([a],c):c}function oa(a,b){for(var c=0,d=a.length;c<d;c++)W.set(a[c],"globalEval",!b||W.get(b[c],"globalEval"))}var pa=/<|&#?\w+;/;function qa(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],n=0,o=a.length;n<o;n++)if(f=a[n],f||0===f)if("object"===r.type(f))r.merge(m,f.nodeType?[f]:f);else if(pa.test(f)){g=g||l.appendChild(b.createElement("div")),h=(ka.exec(f)||["",""])[1].toLowerCase(),i=ma[h]||ma._default,g.innerHTML=i[1]+r.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;r.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",n=0;while(f=m[n++])if(d&&r.inArray(f,d)>-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=na(l.appendChild(f),"script"),j&&oa(g),c){k=0;while(f=g[k++])la.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var ra=d.documentElement,sa=/^key/,ta=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ua=/^([^.]*)(?:\.(.+)|)/;function va(){return!0}function wa(){return!1}function xa(){try{return d.activeElement}catch(a){}}function ya(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ya(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=wa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(ra,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(L)||[""],j=b.length;while(j--)h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.hasData(a)&&W.get(a);if(q&&(i=q.events)){b=(b||"").match(L)||[""],j=b.length;while(j--)if(h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&W.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(W.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;c<arguments.length;c++)i[c]=arguments[c];if(b.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,b)!==!1){h=r.event.handlers.call(this,b,j),c=0;while((f=h[c++])&&!b.isPropagationStopped()){b.currentTarget=f.elem,d=0;while((g=f.handlers[d++])&&!b.isImmediatePropagationStopped())b.rnamespace&&!b.rnamespace.test(g.namespace)||(b.handleObj=g,b.data=g.data,e=((r.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(b.result=e)===!1&&(b.preventDefault(),b.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,b),b.result}},handlers:function(a,b){var c,d,e,f,g,h=[],i=b.delegateCount,j=a.target;if(i&&j.nodeType&&!("click"===a.type&&a.button>=1))for(;j!==this;j=j.parentNode||this)if(1===j.nodeType&&("click"!==a.type||j.disabled!==!0)){for(f=[],g={},c=0;c<i;c++)d=b[c],e=d.selector+" ",void 0===g[e]&&(g[e]=d.needsContext?r(e,this).index(j)>-1:r.find(e,this,null,[j]).length),g[e]&&f.push(d);f.length&&h.push({elem:j,handlers:f})}return j=this,i<b.length&&h.push({elem:j,handlers:b.slice(i)}),h},addProp:function(a,b){Object.defineProperty(r.Event.prototype,a,{enumerable:!0,configurable:!0,get:r.isFunction(b)?function(){if(this.originalEvent)return b(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[a]},set:function(b){Object.defineProperty(this,a,{enumerable:!0,configurable:!0,writable:!0,value:b})}})},fix:function(a){return a[r.expando]?a:new r.Event(a)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==xa()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===xa()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&B(this,"input"))return this.click(),!1},_default:function(a){return B(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}}},r.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)},r.Event=function(a,b){return this instanceof r.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?va:wa,this.target=a.target&&3===a.target.nodeType?a.target.parentNode:a.target,this.currentTarget=a.currentTarget,this.relatedTarget=a.relatedTarget):this.type=a,b&&r.extend(this,b),this.timeStamp=a&&a.timeStamp||r.now(),void(this[r.expando]=!0)):new r.Event(a,b)},r.Event.prototype={constructor:r.Event,isDefaultPrevented:wa,isPropagationStopped:wa,isImmediatePropagationStopped:wa,isSimulated:!1,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=va,a&&!this.isSimulated&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=va,a&&!this.isSimulated&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=va,a&&!this.isSimulated&&a.stopImmediatePropagation(),this.stopPropagation()}},r.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(a){var b=a.button;return null==a.which&&sa.test(a.type)?null!=a.charCode?a.charCode:a.keyCode:!a.which&&void 0!==b&&ta.test(a.type)?1&b?1:2&b?3:4&b?2:0:a.which}},r.event.addProp),r.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){r.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return e&&(e===d||r.contains(d,e))||(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),r.fn.extend({on:function(a,b,c,d){return ya(this,a,b,c,d)},one:function(a,b,c,d){return ya(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,r(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return b!==!1&&"function"!=typeof b||(c=b,b=void 0),c===!1&&(c=wa),this.each(function(){r.event.remove(this,a,c,b)})}});var za=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,Aa=/<script|<style|<link/i,Ba=/checked\s*(?:[^=]|=\s*.checked.)/i,Ca=/^true\/(.*)/,Da=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Ea(a,b){return B(a,"table")&&B(11!==b.nodeType?b:b.firstChild,"tr")?r(">tbody",a)[0]||a:a}function Fa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Ga(a){var b=Ca.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ha(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(W.hasData(a)&&(f=W.access(a),g=W.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;c<d;c++)r.event.add(b,e,j[e][c])}X.hasData(a)&&(h=X.access(a),i=r.extend({},h),X.set(b,i))}}function Ia(a,b){var c=b.nodeName.toLowerCase();"input"===c&&ja.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function Ja(a,b,c,d){b=g.apply([],b);var e,f,h,i,j,k,l=0,m=a.length,n=m-1,q=b[0],s=r.isFunction(q);if(s||m>1&&"string"==typeof q&&!o.checkClone&&Ba.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ja(f,b,c,d)});if(m&&(e=qa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(na(e,"script"),Fa),i=h.length;l<m;l++)j=e,l!==n&&(j=r.clone(j,!0,!0),i&&r.merge(h,na(j,"script"))),c.call(a[l],j,l);if(i)for(k=h[h.length-1].ownerDocument,r.map(h,Ga),l=0;l<i;l++)j=h[l],la.test(j.type||"")&&!W.access(j,"globalEval")&&r.contains(k,j)&&(j.src?r._evalUrl&&r._evalUrl(j.src):p(j.textContent.replace(Da,""),k))}return a}function Ka(a,b,c){for(var d,e=b?r.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||r.cleanData(na(d)),d.parentNode&&(c&&r.contains(d.ownerDocument,d)&&oa(na(d,"script")),d.parentNode.removeChild(d));return a}r.extend({htmlPrefilter:function(a){return a.replace(za,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=na(h),f=na(a),d=0,e=f.length;d<e;d++)Ia(f[d],g[d]);if(b)if(c)for(f=f||na(a),g=g||na(h),d=0,e=f.length;d<e;d++)Ha(f[d],g[d]);else Ha(a,h);return g=na(h,"script"),g.length>0&&oa(g,!i&&na(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(U(c)){if(b=c[W.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[W.expando]=void 0}c[X.expando]&&(c[X.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ka(this,a,!0)},remove:function(a){return Ka(this,a)},text:function(a){return T(this,function(a){return void 0===a?r.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return Ja(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ea(this,a);b.appendChild(a)}})},prepend:function(){return Ja(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ea(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ja(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ja(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(r.cleanData(na(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return r.clone(this,a,b)})},html:function(a){return T(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!Aa.test(a)&&!ma[(ka.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;c<d;c++)b=this[c]||{},1===b.nodeType&&(r.cleanData(na(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return Ja(this,arguments,function(b){var c=this.parentNode;r.inArray(this,a)<0&&(r.cleanData(na(this)),c&&c.replaceChild(b,this))},a)}}),r.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){r.fn[a]=function(a){for(var c,d=[],e=r(a),f=e.length-1,g=0;g<=f;g++)c=g===f?this:this.clone(!0),r(e[g])[b](c),h.apply(d,c.get());return this.pushStack(d)}});var La=/^margin/,Ma=new RegExp("^("+aa+")(?!px)[a-z%]+$","i"),Na=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)};!function(){function b(){if(i){i.style.cssText="box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",i.innerHTML="",ra.appendChild(h);var b=a.getComputedStyle(i);c="1%"!==b.top,g="2px"===b.marginLeft,e="4px"===b.width,i.style.marginRight="50%",f="4px"===b.marginRight,ra.removeChild(h),i=null}}var c,e,f,g,h=d.createElement("div"),i=d.createElement("div");i.style&&(i.style.backgroundClip="content-box",i.cloneNode(!0).style.backgroundClip="",o.clearCloneStyle="content-box"===i.style.backgroundClip,h.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",h.appendChild(i),r.extend(o,{pixelPosition:function(){return b(),c},boxSizingReliable:function(){return b(),e},pixelMarginRight:function(){return b(),f},reliableMarginLeft:function(){return b(),g}}))}();function Oa(a,b,c){var d,e,f,g,h=a.style;return c=c||Na(a),c&&(g=c.getPropertyValue(b)||c[b],""!==g||r.contains(a.ownerDocument,a)||(g=r.style(a,b)),!o.pixelMarginRight()&&Ma.test(g)&&La.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function Pa(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Qa=/^(none|table(?!-c[ea]).+)/,Ra=/^--/,Sa={position:"absolute",visibility:"hidden",display:"block"},Ta={letterSpacing:"0",fontWeight:"400"},Ua=["Webkit","Moz","ms"],Va=d.createElement("div").style;function Wa(a){if(a in Va)return a;var b=a[0].toUpperCase()+a.slice(1),c=Ua.length;while(c--)if(a=Ua[c]+b,a in Va)return a}function Xa(a){var b=r.cssProps[a];return b||(b=r.cssProps[a]=Wa(a)||a),b}function Ya(a,b,c){var d=ba.exec(b);return d?Math.max(0,d[2]-(c||0))+(d[3]||"px"):b}function Za(a,b,c,d,e){var f,g=0;for(f=c===(d?"border":"content")?4:"width"===b?1:0;f<4;f+=2)"margin"===c&&(g+=r.css(a,c+ca[f],!0,e)),d?("content"===c&&(g-=r.css(a,"padding"+ca[f],!0,e)),"margin"!==c&&(g-=r.css(a,"border"+ca[f]+"Width",!0,e))):(g+=r.css(a,"padding"+ca[f],!0,e),"padding"!==c&&(g+=r.css(a,"border"+ca[f]+"Width",!0,e)));return g}function $a(a,b,c){var d,e=Na(a),f=Oa(a,b,e),g="border-box"===r.css(a,"boxSizing",!1,e);return Ma.test(f)?f:(d=g&&(o.boxSizingReliable()||f===a.style[b]),"auto"===f&&(f=a["offset"+b[0].toUpperCase()+b.slice(1)]),f=parseFloat(f)||0,f+Za(a,b,c||(g?"border":"content"),d,e)+"px")}r.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Oa(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=r.camelCase(b),i=Ra.test(b),j=a.style;return i||(b=Xa(h)),g=r.cssHooks[b]||r.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:j[b]:(f=typeof c,"string"===f&&(e=ba.exec(c))&&e[1]&&(c=fa(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(r.cssNumber[h]?"":"px")),o.clearCloneStyle||""!==c||0!==b.indexOf("background")||(j[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i?j.setProperty(b,c):j[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=r.camelCase(b),i=Ra.test(b);return i||(b=Xa(h)),g=r.cssHooks[b]||r.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=Oa(a,b,d)),"normal"===e&&b in Ta&&(e=Ta[b]),""===c||c?(f=parseFloat(e),c===!0||isFinite(f)?f||0:e):e}}),r.each(["height","width"],function(a,b){r.cssHooks[b]={get:function(a,c,d){if(c)return!Qa.test(r.css(a,"display"))||a.getClientRects().length&&a.getBoundingClientRect().width?$a(a,b,d):ea(a,Sa,function(){return $a(a,b,d)})},set:function(a,c,d){var e,f=d&&Na(a),g=d&&Za(a,b,d,"border-box"===r.css(a,"boxSizing",!1,f),f);return g&&(e=ba.exec(c))&&"px"!==(e[3]||"px")&&(a.style[b]=c,c=r.css(a,b)),Ya(a,c,g)}}}),r.cssHooks.marginLeft=Pa(o.reliableMarginLeft,function(a,b){if(b)return(parseFloat(Oa(a,"marginLeft"))||a.getBoundingClientRect().left-ea(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}))+"px"}),r.each({margin:"",padding:"",border:"Width"},function(a,b){r.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];d<4;d++)e[a+ca[d]+b]=f[d]||f[d-2]||f[0];return e}},La.test(a)||(r.cssHooks[a+b].set=Ya)}),r.fn.extend({css:function(a,b){return T(this,function(a,b,c){var d,e,f={},g=0;if(Array.isArray(b)){for(d=Na(a),e=b.length;g<e;g++)f[b[g]]=r.css(a,b[g],!1,d);return f}return void 0!==c?r.style(a,b,c):r.css(a,b)},a,b,arguments.length>1)}});function _a(a,b,c,d,e){return new _a.prototype.init(a,b,c,d,e)}r.Tween=_a,_a.prototype={constructor:_a,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||r.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(r.cssNumber[c]?"":"px")},cur:function(){var a=_a.propHooks[this.prop];return a&&a.get?a.get(this):_a.propHooks._default.get(this)},run:function(a){var b,c=_a.propHooks[this.prop];return this.options.duration?this.pos=b=r.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):_a.propHooks._default.set(this),this}},_a.prototype.init.prototype=_a.prototype,_a.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=r.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){r.fx.step[a.prop]?r.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[r.cssProps[a.prop]]&&!r.cssHooks[a.prop]?a.elem[a.prop]=a.now:r.style(a.elem,a.prop,a.now+a.unit)}}},_a.propHooks.scrollTop=_a.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},r.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},r.fx=_a.prototype.init,r.fx.step={};var ab,bb,cb=/^(?:toggle|show|hide)$/,db=/queueHooks$/;function eb(){bb&&(d.hidden===!1&&a.requestAnimationFrame?a.requestAnimationFrame(eb):a.setTimeout(eb,r.fx.interval),r.fx.tick())}function fb(){return a.setTimeout(function(){ab=void 0}),ab=r.now()}function gb(a,b){var c,d=0,e={height:a};for(b=b?1:0;d<4;d+=2-b)c=ca[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function hb(a,b,c){for(var d,e=(kb.tweeners[b]||[]).concat(kb.tweeners["*"]),f=0,g=e.length;f<g;f++)if(d=e[f].call(c,b,a))return d}function ib(a,b,c){var d,e,f,g,h,i,j,k,l="width"in b||"height"in b,m=this,n={},o=a.style,p=a.nodeType&&da(a),q=W.get(a,"fxshow");c.queue||(g=r._queueHooks(a,"fx"),null==g.unqueued&&(g.unqueued=0,h=g.empty.fire,g.empty.fire=function(){g.unqueued||h()}),g.unqueued++,m.always(function(){m.always(function(){g.unqueued--,r.queue(a,"fx").length||g.empty.fire()})}));for(d in b)if(e=b[d],cb.test(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}n[d]=q&&q[d]||r.style(a,d)}if(i=!r.isEmptyObject(b),i||!r.isEmptyObject(n)){l&&1===a.nodeType&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=q&&q.display,null==j&&(j=W.get(a,"display")),k=r.css(a,"display"),"none"===k&&(j?k=j:(ia([a],!0),j=a.style.display||j,k=r.css(a,"display"),ia([a]))),("inline"===k||"inline-block"===k&&null!=j)&&"none"===r.css(a,"float")&&(i||(m.done(function(){o.display=j}),null==j&&(k=o.display,j="none"===k?"":k)),o.display="inline-block")),c.overflow&&(o.overflow="hidden",m.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]})),i=!1;for(d in n)i||(q?"hidden"in q&&(p=q.hidden):q=W.access(a,"fxshow",{display:j}),f&&(q.hidden=!p),p&&ia([a],!0),m.done(function(){p||ia([a]),W.remove(a,"fxshow");for(d in n)r.style(a,d,n[d])})),i=hb(p?q[d]:0,d,m),d in q||(q[d]=i.start,p&&(i.end=i.start,i.start=0))}}function jb(a,b){var c,d,e,f,g;for(c in a)if(d=r.camelCase(c),e=b[d],f=a[c],Array.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=r.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kb(a,b,c){var d,e,f=0,g=kb.prefilters.length,h=r.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=ab||fb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;g<i;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),f<1&&i?c:(i||h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:r.extend({},b),opts:r.extend(!0,{specialEasing:{},easing:r.easing._default},c),originalProperties:b,originalOptions:c,startTime:ab||fb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=r.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;c<d;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jb(k,j.opts.specialEasing);f<g;f++)if(d=kb.prefilters[f].call(j,a,k,j.opts))return r.isFunction(d.stop)&&(r._queueHooks(j.elem,j.opts.queue).stop=r.proxy(d.stop,d)),d;return r.map(k,hb,j),r.isFunction(j.opts.start)&&j.opts.start.call(a,j),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always),r.fx.timer(r.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j}r.Animation=r.extend(kb,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return fa(c.elem,a,ba.exec(b),c),c}]},tweener:function(a,b){r.isFunction(a)?(b=a,a=["*"]):a=a.match(L);for(var c,d=0,e=a.length;d<e;d++)c=a[d],kb.tweeners[c]=kb.tweeners[c]||[],kb.tweeners[c].unshift(b)},prefilters:[ib],prefilter:function(a,b){b?kb.prefilters.unshift(a):kb.prefilters.push(a)}}),r.speed=function(a,b,c){var d=a&&"object"==typeof a?r.extend({},a):{complete:c||!c&&b||r.isFunction(a)&&a,duration:a,easing:c&&b||b&&!r.isFunction(b)&&b};return r.fx.off?d.duration=0:"number"!=typeof d.duration&&(d.duration in r.fx.speeds?d.duration=r.fx.speeds[d.duration]:d.duration=r.fx.speeds._default),null!=d.queue&&d.queue!==!0||(d.queue="fx"),d.old=d.complete,d.complete=function(){r.isFunction(d.old)&&d.old.call(this),d.queue&&r.dequeue(this,d.queue)},d},r.fn.extend({fadeTo:function(a,b,c,d){return this.filter(da).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=r.isEmptyObject(a),f=r.speed(b,c,d),g=function(){var b=kb(this,r.extend({},a),f);(e||W.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=r.timers,g=W.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&db.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));!b&&c||r.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=W.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=r.timers,g=d?d.length:0;for(c.finish=!0,r.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;b<g;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),r.each(["toggle","show","hide"],function(a,b){var c=r.fn[b];r.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gb(b,!0),a,d,e)}}),r.each({slideDown:gb("show"),slideUp:gb("hide"),slideToggle:gb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){r.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),r.timers=[],r.fx.tick=function(){var a,b=0,c=r.timers;for(ab=r.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||r.fx.stop(),ab=void 0},r.fx.timer=function(a){r.timers.push(a),r.fx.start()},r.fx.interval=13,r.fx.start=function(){bb||(bb=!0,eb())},r.fx.stop=function(){bb=null},r.fx.speeds={slow:600,fast:200,_default:400},r.fn.delay=function(b,c){return b=r.fx?r.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a=d.createElement("input"),b=d.createElement("select"),c=b.appendChild(d.createElement("option"));a.type="checkbox",o.checkOn=""!==a.value,o.optSelected=c.selected,a=d.createElement("input"),a.value="t",a.type="radio",o.radioValue="t"===a.value}();var lb,mb=r.expr.attrHandle;r.fn.extend({attr:function(a,b){return T(this,r.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?lb:void 0)),void 0!==c?null===c?void r.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=r.find.attr(a,b),
null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&B(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(L);if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),lb={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=mb[b]||r.find.attr;mb[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=mb[g],mb[g]=e,e=null!=c(a,b,d)?g:null,mb[g]=f),e}});var nb=/^(?:input|select|textarea|button)$/i,ob=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return T(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):nb.test(a.nodeName)||ob.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});function pb(a){var b=a.match(L)||[];return b.join(" ")}function qb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,qb(this)))});if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=pb(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,qb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=pb(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,qb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(L)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=qb(this),b&&W.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":W.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+pb(qb(c))+" ").indexOf(b)>-1)return!0;return!1}});var rb=/\r/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":Array.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(rb,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:pb(r.text(a))}},select:{get:function(a){var b,c,d,e=a.options,f=a.selectedIndex,g="select-one"===a.type,h=g?null:[],i=g?f+1:e.length;for(d=f<0?i:g?f:0;d<i;d++)if(c=e[d],(c.selected||d===f)&&!c.disabled&&(!c.parentNode.disabled||!B(c.parentNode,"optgroup"))){if(b=r(c).val(),g)return b;h.push(b)}return h},set:function(a,b){var c,d,e=a.options,f=r.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=r.inArray(r.valHooks.option.get(d),f)>-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){if(Array.isArray(b))return a.checked=r.inArray(r(a).val(),b)>-1}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var sb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!sb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,sb.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(W.get(h,"events")||{})[b.type]&&W.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&U(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!U(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each(function(){r.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];if(c)return r.event.trigger(a,b,c,!0)}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=W.access(d,b);e||d.addEventListener(a,c,!0),W.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=W.access(d,b)-1;e?W.access(d,b,e):(d.removeEventListener(a,c,!0),W.remove(d,b))}}});var tb=a.location,ub=r.now(),vb=/\?/;r.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+b),c};var wb=/\[\]$/,xb=/\r?\n/g,yb=/^(?:submit|button|image|reset|file)$/i,zb=/^(?:input|select|textarea|keygen)/i;function Ab(a,b,c,d){var e;if(Array.isArray(b))r.each(b,function(b,e){c||wb.test(a)?d(a,e):Ab(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==r.type(b))d(a,b);else for(e in b)Ab(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(Array.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)Ab(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&zb.test(this.nodeName)&&!yb.test(a)&&(this.checked||!ja.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:Array.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(xb,"\r\n")}}):{name:b.name,value:c.replace(xb,"\r\n")}}).get()}});var Bb=/%20/g,Cb=/#.*$/,Db=/([?&])_=[^&]*/,Eb=/^(.*?):[ \t]*([^\r\n]*)$/gm,Fb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Gb=/^(?:GET|HEAD)$/,Hb=/^\/\//,Ib={},Jb={},Kb="*/".concat("*"),Lb=d.createElement("a");Lb.href=tb.href;function Mb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(L)||[];if(r.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Nb(a,b,c,d){var e={},f=a===Jb;function g(h){var i;return e[h]=!0,r.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Ob(a,b){var c,d,e=r.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&r.extend(!0,a,d),a}function Pb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}if(f)return f!==i[0]&&i.unshift(f),c[f]}function Qb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:tb.href,type:"GET",isLocal:Fb.test(tb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Kb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Ob(Ob(a,r.ajaxSettings),b):Ob(r.ajaxSettings,a)},ajaxPrefilter:Mb(Ib),ajaxTransport:Mb(Jb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m,n,o=r.ajaxSetup({},c),p=o.context||o,q=o.context&&(p.nodeType||p.jquery)?r(p):r.event,s=r.Deferred(),t=r.Callbacks("once memory"),u=o.statusCode||{},v={},w={},x="canceled",y={readyState:0,getResponseHeader:function(a){var b;if(k){if(!h){h={};while(b=Eb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return k?g:null},setRequestHeader:function(a,b){return null==k&&(a=w[a.toLowerCase()]=w[a.toLowerCase()]||a,v[a]=b),this},overrideMimeType:function(a){return null==k&&(o.mimeType=a),this},statusCode:function(a){var b;if(a)if(k)y.always(a[y.status]);else for(b in a)u[b]=[u[b],a[b]];return this},abort:function(a){var b=a||x;return e&&e.abort(b),A(0,b),this}};if(s.promise(y),o.url=((b||o.url||tb.href)+"").replace(Hb,tb.protocol+"//"),o.type=c.method||c.type||o.method||o.type,o.dataTypes=(o.dataType||"*").toLowerCase().match(L)||[""],null==o.crossDomain){j=d.createElement("a");try{j.href=o.url,j.href=j.href,o.crossDomain=Lb.protocol+"//"+Lb.host!=j.protocol+"//"+j.host}catch(z){o.crossDomain=!0}}if(o.data&&o.processData&&"string"!=typeof o.data&&(o.data=r.param(o.data,o.traditional)),Nb(Ib,o,c,y),k)return y;l=r.event&&o.global,l&&0===r.active++&&r.event.trigger("ajaxStart"),o.type=o.type.toUpperCase(),o.hasContent=!Gb.test(o.type),f=o.url.replace(Cb,""),o.hasContent?o.data&&o.processData&&0===(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&(o.data=o.data.replace(Bb,"+")):(n=o.url.slice(f.length),o.data&&(f+=(vb.test(f)?"&":"?")+o.data,delete o.data),o.cache===!1&&(f=f.replace(Db,"$1"),n=(vb.test(f)?"&":"?")+"_="+ub++ +n),o.url=f+n),o.ifModified&&(r.lastModified[f]&&y.setRequestHeader("If-Modified-Since",r.lastModified[f]),r.etag[f]&&y.setRequestHeader("If-None-Match",r.etag[f])),(o.data&&o.hasContent&&o.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",o.contentType),y.setRequestHeader("Accept",o.dataTypes[0]&&o.accepts[o.dataTypes[0]]?o.accepts[o.dataTypes[0]]+("*"!==o.dataTypes[0]?", "+Kb+"; q=0.01":""):o.accepts["*"]);for(m in o.headers)y.setRequestHeader(m,o.headers[m]);if(o.beforeSend&&(o.beforeSend.call(p,y,o)===!1||k))return y.abort();if(x="abort",t.add(o.complete),y.done(o.success),y.fail(o.error),e=Nb(Jb,o,c,y)){if(y.readyState=1,l&&q.trigger("ajaxSend",[y,o]),k)return y;o.async&&o.timeout>0&&(i=a.setTimeout(function(){y.abort("timeout")},o.timeout));try{k=!1,e.send(v,A)}catch(z){if(k)throw z;A(-1,z)}}else A(-1,"No Transport");function A(b,c,d,h){var j,m,n,v,w,x=c;k||(k=!0,i&&a.clearTimeout(i),e=void 0,g=h||"",y.readyState=b>0?4:0,j=b>=200&&b<300||304===b,d&&(v=Pb(o,y,d)),v=Qb(o,v,y,j),j?(o.ifModified&&(w=y.getResponseHeader("Last-Modified"),w&&(r.lastModified[f]=w),w=y.getResponseHeader("etag"),w&&(r.etag[f]=w)),204===b||"HEAD"===o.type?x="nocontent":304===b?x="notmodified":(x=v.state,m=v.data,n=v.error,j=!n)):(n=x,!b&&x||(x="error",b<0&&(b=0))),y.status=b,y.statusText=(c||x)+"",j?s.resolveWith(p,[m,x,y]):s.rejectWith(p,[y,x,n]),y.statusCode(u),u=void 0,l&&q.trigger(j?"ajaxSuccess":"ajaxError",[y,o,j?m:n]),t.fireWith(p,[y,x]),l&&(q.trigger("ajaxComplete",[y,o]),--r.active||r.event.trigger("ajaxStop")))}return y},getJSON:function(a,b,c){return r.get(a,b,c,"json")},getScript:function(a,b){return r.get(a,void 0,b,"script")}}),r.each(["get","post"],function(a,b){r[b]=function(a,c,d,e){return r.isFunction(c)&&(e=e||d,d=c,c=void 0),r.ajax(r.extend({url:a,type:b,dataType:e,data:c,success:d},r.isPlainObject(a)&&a))}}),r._evalUrl=function(a){return r.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this},wrapInner:function(a){return r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(a){return this.parent(a).not("body").each(function(){r(this).replaceWith(this.childNodes)}),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},r.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Rb={0:200,1223:204},Sb=r.ajaxSettings.xhr();o.cors=!!Sb&&"withCredentials"in Sb,o.ajax=Sb=!!Sb,r.ajaxTransport(function(b){var c,d;if(o.cors||Sb&&!b.crossDomain)return{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Rb[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}}),r.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return r.globalEval(a),a}}}),r.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),r.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=r("<script>").prop({charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&f("error"===a.type?404:200,a.type)}),d.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Tb=[],Ub=/(=)\?(?=&|$)|\?\?/;r.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Tb.pop()||r.expando+"_"+ub++;return this[a]=!0,a}}),r.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Ub.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ub.test(b.data)&&"data");if(h||"jsonp"===b.dataTypes[0])return e=b.jsonpCallback=r.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Ub,"$1"+e):b.jsonp!==!1&&(b.url+=(vb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||r.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?r(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Tb.push(e)),g&&r.isFunction(f)&&f(g[0]),g=f=void 0}),"script"}),o.createHTMLDocument=function(){var a=d.implementation.createHTMLDocument("").body;return a.innerHTML="<form></form><form></form>",2===a.childNodes.length}(),r.parseHTML=function(a,b,c){if("string"!=typeof a)return[];"boolean"==typeof b&&(c=b,b=!1);var e,f,g;return b||(o.createHTMLDocument?(b=d.implementation.createHTMLDocument(""),e=b.createElement("base"),e.href=d.location.href,b.head.appendChild(e)):b=d),f=C.exec(a),g=!c&&[],f?[b.createElement(f[1])]:(f=qa([a],b,g),g&&g.length&&r(g).remove(),r.merge([],f.childNodes))},r.fn.load=function(a,b,c){var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=pb(a.slice(h)),a=a.slice(0,h)),r.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&r.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?r("<div>").append(r.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(this,f||[a.responseText,b,a])})}),this},r.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){r.fn[b]=function(a){return this.on(b,a)}}),r.expr.pseudos.animated=function(a){return r.grep(r.timers,function(b){return a===b.elem}).length},r.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=r.css(a,"position"),l=r(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=r.css(a,"top"),i=r.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),r.isFunction(b)&&(b=b.call(a,c,r.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},r.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){r.offset.setOffset(this,a,b)});var b,c,d,e,f=this[0];if(f)return f.getClientRects().length?(d=f.getBoundingClientRect(),b=f.ownerDocument,c=b.documentElement,e=b.defaultView,{top:d.top+e.pageYOffset-c.clientTop,left:d.left+e.pageXOffset-c.clientLeft}):{top:0,left:0}},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===r.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),B(a[0],"html")||(d=a.offset()),d={top:d.top+r.css(a[0],"borderTopWidth",!0),left:d.left+r.css(a[0],"borderLeftWidth",!0)}),{top:b.top-d.top-r.css(c,"marginTop",!0),left:b.left-d.left-r.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&"static"===r.css(a,"position"))a=a.offsetParent;return a||ra})}}),r.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c="pageYOffset"===b;r.fn[a]=function(d){return T(this,function(a,d,e){var f;return r.isWindow(a)?f=a:9===a.nodeType&&(f=a.defaultView),void 0===e?f?f[b]:a[d]:void(f?f.scrollTo(c?f.pageXOffset:e,c?e:f.pageYOffset):a[d]=e)},a,d,arguments.length)}}),r.each(["top","left"],function(a,b){r.cssHooks[b]=Pa(o.pixelPosition,function(a,c){if(c)return c=Oa(a,b),Ma.test(c)?r(a).position()[b]+"px":c})}),r.each({Height:"height",Width:"width"},function(a,b){r.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){r.fn[d]=function(e,f){var g=arguments.length&&(c||"boolean"!=typeof e),h=c||(e===!0||f===!0?"margin":"border");return T(this,function(b,c,e){var f;return r.isWindow(b)?0===d.indexOf("outer")?b["inner"+a]:b.document.documentElement["client"+a]:9===b.nodeType?(f=b.documentElement,Math.max(b.body["scroll"+a],f["scroll"+a],b.body["offset"+a],f["offset"+a],f["client"+a])):void 0===e?r.css(b,c,h):r.style(b,c,e,h)},b,g?e:void 0,g)}})}),r.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}}),r.holdReady=function(a){a?r.readyWait++:r.ready(!0)},r.isArray=Array.isArray,r.parseJSON=JSON.parse,r.nodeName=B,"function"==typeof define&&define.amd&&define("jquery",[],function(){return r});var Vb=a.jQuery,Wb=a.$;return r.noConflict=function(b){return a.$===r&&(a.$=Wb),b&&a.jQuery===r&&(a.jQuery=Vb),r},b||(a.jQuery=a.$=r),r});
;
/** vim: et:ts=4:sw=4:sts=4
 * @license RequireJS 2.3.2 Copyright jQuery Foundation and other contributors.
 * Released under MIT license, https://github.com/requirejs/requirejs/blob/master/LICENSE
 */
var requirejs,require,define;!function(global,setTimeout){function commentReplace(e,t){return t||""}function isFunction(e){return"[object Function]"===ostring.call(e)}function isArray(e){return"[object Array]"===ostring.call(e)}function each(e,t){if(e){var i;for(i=0;i<e.length&&(!e[i]||!t(e[i],i,e));i+=1);}}function eachReverse(e,t){if(e){var i;for(i=e.length-1;i>-1&&(!e[i]||!t(e[i],i,e));i-=1);}}function hasProp(e,t){return hasOwn.call(e,t)}function getOwn(e,t){return hasProp(e,t)&&e[t]}function eachProp(e,t){var i;for(i in e)if(hasProp(e,i)&&t(e[i],i))break}function mixin(e,t,i,r){return t&&eachProp(t,function(t,n){!i&&hasProp(e,n)||(!r||"object"!=typeof t||!t||isArray(t)||isFunction(t)||t instanceof RegExp?e[n]=t:(e[n]||(e[n]={}),mixin(e[n],t,i,r)))}),e}function bind(e,t){return function(){return t.apply(e,arguments)}}function scripts(){return document.getElementsByTagName("script")}function defaultOnError(e){throw e}function getGlobal(e){if(!e)return e;var t=global;return each(e.split("."),function(e){t=t[e]}),t}function makeError(e,t,i,r){var n=new Error(t+"\nhttp://requirejs.org/docs/errors.html#"+e);return n.requireType=e,n.requireModules=r,i&&(n.originalError=i),n}function newContext(e){function t(e){var t,i;for(t=0;t<e.length;t++)if(i=e[t],"."===i)e.splice(t,1),t-=1;else if(".."===i){if(0===t||1===t&&".."===e[2]||".."===e[t-1])continue;t>0&&(e.splice(t-1,2),t-=2)}}function i(e,i,r){var n,o,a,s,u,c,d,p,f,l,h,m,g=i&&i.split("/"),v=y.map,x=v&&v["*"];if(e&&(e=e.split("/"),d=e.length-1,y.nodeIdCompat&&jsSuffixRegExp.test(e[d])&&(e[d]=e[d].replace(jsSuffixRegExp,"")),"."===e[0].charAt(0)&&g&&(m=g.slice(0,g.length-1),e=m.concat(e)),t(e),e=e.join("/")),r&&v&&(g||x)){a=e.split("/");e:for(s=a.length;s>0;s-=1){if(c=a.slice(0,s).join("/"),g)for(u=g.length;u>0;u-=1)if(o=getOwn(v,g.slice(0,u).join("/")),o&&(o=getOwn(o,c))){p=o,f=s;break e}!l&&x&&getOwn(x,c)&&(l=getOwn(x,c),h=s)}!p&&l&&(p=l,f=h),p&&(a.splice(0,f,p),e=a.join("/"))}return n=getOwn(y.pkgs,e),n?n:e}function r(e){isBrowser&&each(scripts(),function(t){if(t.getAttribute("data-requiremodule")===e&&t.getAttribute("data-requirecontext")===q.contextName)return t.parentNode.removeChild(t),!0})}function n(e){var t=getOwn(y.paths,e);if(t&&isArray(t)&&t.length>1)return t.shift(),q.require.undef(e),q.makeRequire(null,{skipMap:!0})([e]),!0}function o(e){var t,i=e?e.indexOf("!"):-1;return i>-1&&(t=e.substring(0,i),e=e.substring(i+1,e.length)),[t,e]}function a(e,t,r,n){var a,s,u,c,d=null,p=t?t.name:null,f=e,l=!0,h="";return e||(l=!1,e="_@r"+(T+=1)),c=o(e),d=c[0],e=c[1],d&&(d=i(d,p,n),s=getOwn(j,d)),e&&(d?h=s&&s.normalize?s.normalize(e,function(e){return i(e,p,n)}):e.indexOf("!")===-1?i(e,p,n):e:(h=i(e,p,n),c=o(h),d=c[0],h=c[1],r=!0,a=q.nameToUrl(h))),u=!d||s||r?"":"_unnormalized"+(A+=1),{prefix:d,name:h,parentMap:t,unnormalized:!!u,url:a,originalName:f,isDefine:l,id:(d?d+"!"+h:h)+u}}function s(e){var t=e.id,i=getOwn(S,t);return i||(i=S[t]=new q.Module(e)),i}function u(e,t,i){var r=e.id,n=getOwn(S,r);!hasProp(j,r)||n&&!n.defineEmitComplete?(n=s(e),n.error&&"error"===t?i(n.error):n.on(t,i)):"defined"===t&&i(j[r])}function c(e,t){var i=e.requireModules,r=!1;t?t(e):(each(i,function(t){var i=getOwn(S,t);i&&(i.error=e,i.events.error&&(r=!0,i.emit("error",e)))}),r||req.onError(e))}function d(){globalDefQueue.length&&(each(globalDefQueue,function(e){var t=e[0];"string"==typeof t&&(q.defQueueMap[t]=!0),O.push(e)}),globalDefQueue=[])}function p(e){delete S[e],delete k[e]}function f(e,t,i){var r=e.map.id;e.error?e.emit("error",e.error):(t[r]=!0,each(e.depMaps,function(r,n){var o=r.id,a=getOwn(S,o);!a||e.depMatched[n]||i[o]||(getOwn(t,o)?(e.defineDep(n,j[o]),e.check()):f(a,t,i))}),i[r]=!0)}function l(){var e,t,i=1e3*y.waitSeconds,o=i&&q.startTime+i<(new Date).getTime(),a=[],s=[],u=!1,d=!0;if(!x){if(x=!0,eachProp(k,function(e){var i=e.map,c=i.id;if(e.enabled&&(i.isDefine||s.push(e),!e.error))if(!e.inited&&o)n(c)?(t=!0,u=!0):(a.push(c),r(c));else if(!e.inited&&e.fetched&&i.isDefine&&(u=!0,!i.prefix))return d=!1}),o&&a.length)return e=makeError("timeout","Load timeout for modules: "+a,null,a),e.contextName=q.contextName,c(e);d&&each(s,function(e){f(e,{},{})}),o&&!t||!u||!isBrowser&&!isWebWorker||w||(w=setTimeout(function(){w=0,l()},50)),x=!1}}function h(e){hasProp(j,e[0])||s(a(e[0],null,!0)).init(e[1],e[2])}function m(e,t,i,r){e.detachEvent&&!isOpera?r&&e.detachEvent(r,t):e.removeEventListener(i,t,!1)}function g(e){var t=e.currentTarget||e.srcElement;return m(t,q.onScriptLoad,"load","onreadystatechange"),m(t,q.onScriptError,"error"),{node:t,id:t&&t.getAttribute("data-requiremodule")}}function v(){var e;for(d();O.length;){if(e=O.shift(),null===e[0])return c(makeError("mismatch","Mismatched anonymous define() module: "+e[e.length-1]));h(e)}q.defQueueMap={}}var x,b,q,E,w,y={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},S={},k={},M={},O=[],j={},P={},R={},T=1,A=1;return E={require:function(e){return e.require?e.require:e.require=q.makeRequire(e.map)},exports:function(e){if(e.usingExports=!0,e.map.isDefine)return e.exports?j[e.map.id]=e.exports:e.exports=j[e.map.id]={}},module:function(e){return e.module?e.module:e.module={id:e.map.id,uri:e.map.url,config:function(){return getOwn(y.config,e.map.id)||{}},exports:e.exports||(e.exports={})}}},b=function(e){this.events=getOwn(M,e.id)||{},this.map=e,this.shim=getOwn(y.shim,e.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0},b.prototype={init:function(e,t,i,r){r=r||{},this.inited||(this.factory=t,i?this.on("error",i):this.events.error&&(i=bind(this,function(e){this.emit("error",e)})),this.depMaps=e&&e.slice(0),this.errback=i,this.inited=!0,this.ignore=r.ignore,r.enabled||this.enabled?this.enable():this.check())},defineDep:function(e,t){this.depMatched[e]||(this.depMatched[e]=!0,this.depCount-=1,this.depExports[e]=t)},fetch:function(){if(!this.fetched){this.fetched=!0,q.startTime=(new Date).getTime();var e=this.map;return this.shim?void q.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,function(){return e.prefix?this.callPlugin():this.load()})):e.prefix?this.callPlugin():this.load()}},load:function(){var e=this.map.url;P[e]||(P[e]=!0,q.load(this.map.id,e))},check:function(){if(this.enabled&&!this.enabling){var e,t,i=this.map.id,r=this.depExports,n=this.exports,o=this.factory;if(this.inited){if(this.error)this.emit("error",this.error);else if(!this.defining){if(this.defining=!0,this.depCount<1&&!this.defined){if(isFunction(o)){if(this.events.error&&this.map.isDefine||req.onError!==defaultOnError)try{n=q.execCb(i,o,r,n)}catch(t){e=t}else n=q.execCb(i,o,r,n);if(this.map.isDefine&&void 0===n&&(t=this.module,t?n=t.exports:this.usingExports&&(n=this.exports)),e)return e.requireMap=this.map,e.requireModules=this.map.isDefine?[this.map.id]:null,e.requireType=this.map.isDefine?"define":"require",c(this.error=e)}else n=o;if(this.exports=n,this.map.isDefine&&!this.ignore&&(j[i]=n,req.onResourceLoad)){var a=[];each(this.depMaps,function(e){a.push(e.normalizedMap||e)}),req.onResourceLoad(q,this.map,a)}p(i),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else hasProp(q.defQueueMap,i)||this.fetch()}},callPlugin:function(){var e=this.map,t=e.id,r=a(e.prefix);this.depMaps.push(r),u(r,"defined",bind(this,function(r){var n,o,d,f=getOwn(R,this.map.id),l=this.map.name,h=this.map.parentMap?this.map.parentMap.name:null,m=q.makeRequire(e.parentMap,{enableBuildCallback:!0});return this.map.unnormalized?(r.normalize&&(l=r.normalize(l,function(e){return i(e,h,!0)})||""),o=a(e.prefix+"!"+l,this.map.parentMap),u(o,"defined",bind(this,function(e){this.map.normalizedMap=o,this.init([],function(){return e},null,{enabled:!0,ignore:!0})})),d=getOwn(S,o.id),void(d&&(this.depMaps.push(o),this.events.error&&d.on("error",bind(this,function(e){this.emit("error",e)})),d.enable()))):f?(this.map.url=q.nameToUrl(f),void this.load()):(n=bind(this,function(e){this.init([],function(){return e},null,{enabled:!0})}),n.error=bind(this,function(e){this.inited=!0,this.error=e,e.requireModules=[t],eachProp(S,function(e){0===e.map.id.indexOf(t+"_unnormalized")&&p(e.map.id)}),c(e)}),n.fromText=bind(this,function(i,r){var o=e.name,u=a(o),d=useInteractive;r&&(i=r),d&&(useInteractive=!1),s(u),hasProp(y.config,t)&&(y.config[o]=y.config[t]);try{req.exec(i)}catch(e){return c(makeError("fromtexteval","fromText eval for "+t+" failed: "+e,e,[t]))}d&&(useInteractive=!0),this.depMaps.push(u),q.completeLoad(o),m([o],n)}),void r.load(e.name,m,n,y))})),q.enable(r,this),this.pluginMaps[r.id]=r},enable:function(){k[this.map.id]=this,this.enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,function(e,t){var i,r,n;if("string"==typeof e){if(e=a(e,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[t]=e,n=getOwn(E,e.id))return void(this.depExports[t]=n(this));this.depCount+=1,u(e,"defined",bind(this,function(e){this.undefed||(this.defineDep(t,e),this.check())})),this.errback?u(e,"error",bind(this,this.errback)):this.events.error&&u(e,"error",bind(this,function(e){this.emit("error",e)}))}i=e.id,r=S[i],hasProp(E,i)||!r||r.enabled||q.enable(e,this)})),eachProp(this.pluginMaps,bind(this,function(e){var t=getOwn(S,e.id);t&&!t.enabled&&q.enable(e,this)})),this.enabling=!1,this.check()},on:function(e,t){var i=this.events[e];i||(i=this.events[e]=[]),i.push(t)},emit:function(e,t){each(this.events[e],function(e){e(t)}),"error"===e&&delete this.events[e]}},q={config:y,contextName:e,registry:S,defined:j,urlFetched:P,defQueue:O,defQueueMap:{},Module:b,makeModuleMap:a,nextTick:req.nextTick,onError:c,configure:function(e){if(e.baseUrl&&"/"!==e.baseUrl.charAt(e.baseUrl.length-1)&&(e.baseUrl+="/"),"string"==typeof e.urlArgs){var t=e.urlArgs;e.urlArgs=function(e,i){return(i.indexOf("?")===-1?"?":"&")+t}}var i=y.shim,r={paths:!0,bundles:!0,config:!0,map:!0};eachProp(e,function(e,t){r[t]?(y[t]||(y[t]={}),mixin(y[t],e,!0,!0)):y[t]=e}),e.bundles&&eachProp(e.bundles,function(e,t){each(e,function(e){e!==t&&(R[e]=t)})}),e.shim&&(eachProp(e.shim,function(e,t){isArray(e)&&(e={deps:e}),!e.exports&&!e.init||e.exportsFn||(e.exportsFn=q.makeShimExports(e)),i[t]=e}),y.shim=i),e.packages&&each(e.packages,function(e){var t,i;e="string"==typeof e?{name:e}:e,i=e.name,t=e.location,t&&(y.paths[i]=e.location),y.pkgs[i]=e.name+"/"+(e.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")}),eachProp(S,function(e,t){e.inited||e.map.unnormalized||(e.map=a(t,null,!0))}),(e.deps||e.callback)&&q.require(e.deps||[],e.callback)},makeShimExports:function(e){function t(){var t;return e.init&&(t=e.init.apply(global,arguments)),t||e.exports&&getGlobal(e.exports)}return t},makeRequire:function(t,n){function o(i,r,u){var d,p,f;return n.enableBuildCallback&&r&&isFunction(r)&&(r.__requireJsBuild=!0),"string"==typeof i?isFunction(r)?c(makeError("requireargs","Invalid require call"),u):t&&hasProp(E,i)?E[i](S[t.id]):req.get?req.get(q,i,t,o):(p=a(i,t,!1,!0),d=p.id,hasProp(j,d)?j[d]:c(makeError("notloaded",'Module name "'+d+'" has not been loaded yet for context: '+e+(t?"":". Use require([])")))):(v(),q.nextTick(function(){v(),f=s(a(null,t)),f.skipMap=n.skipMap,f.init(i,r,u,{enabled:!0}),l()}),o)}return n=n||{},mixin(o,{isBrowser:isBrowser,toUrl:function(e){var r,n=e.lastIndexOf("."),o=e.split("/")[0],a="."===o||".."===o;return n!==-1&&(!a||n>1)&&(r=e.substring(n,e.length),e=e.substring(0,n)),q.nameToUrl(i(e,t&&t.id,!0),r,!0)},defined:function(e){return hasProp(j,a(e,t,!1,!0).id)},specified:function(e){return e=a(e,t,!1,!0).id,hasProp(j,e)||hasProp(S,e)}}),t||(o.undef=function(e){d();var i=a(e,t,!0),n=getOwn(S,e);n.undefed=!0,r(e),delete j[e],delete P[i.url],delete M[e],eachReverse(O,function(t,i){t[0]===e&&O.splice(i,1)}),delete q.defQueueMap[e],n&&(n.events.defined&&(M[e]=n.events),p(e))}),o},enable:function(e){var t=getOwn(S,e.id);t&&s(e).enable()},completeLoad:function(e){var t,i,r,o=getOwn(y.shim,e)||{},a=o.exports;for(d();O.length;){if(i=O.shift(),null===i[0]){if(i[0]=e,t)break;t=!0}else i[0]===e&&(t=!0);h(i)}if(q.defQueueMap={},r=getOwn(S,e),!t&&!hasProp(j,e)&&r&&!r.inited){if(!(!y.enforceDefine||a&&getGlobal(a)))return n(e)?void 0:c(makeError("nodefine","No define call for "+e,null,[e]));h([e,o.deps||[],o.exportsFn])}l()},nameToUrl:function(e,t,i){var r,n,o,a,s,u,c,d=getOwn(y.pkgs,e);if(d&&(e=d),c=getOwn(R,e))return q.nameToUrl(c,t,i);if(req.jsExtRegExp.test(e))s=e+(t||"");else{for(r=y.paths,n=e.split("/"),o=n.length;o>0;o-=1)if(a=n.slice(0,o).join("/"),u=getOwn(r,a)){isArray(u)&&(u=u[0]),n.splice(0,o,u);break}s=n.join("/"),s+=t||(/^data\:|^blob\:|\?/.test(s)||i?"":".js"),s=("/"===s.charAt(0)||s.match(/^[\w\+\.\-]+:/)?"":y.baseUrl)+s}return y.urlArgs&&!/^blob\:/.test(s)?s+y.urlArgs(e,s):s},load:function(e,t){req.load(q,e,t)},execCb:function(e,t,i,r){return t.apply(r,i)},onScriptLoad:function(e){if("load"===e.type||readyRegExp.test((e.currentTarget||e.srcElement).readyState)){interactiveScript=null;var t=g(e);q.completeLoad(t.id)}},onScriptError:function(e){var t=g(e);if(!n(t.id)){var i=[];return eachProp(S,function(e,r){0!==r.indexOf("_@r")&&each(e.depMaps,function(e){if(e.id===t.id)return i.push(r),!0})}),c(makeError("scripterror",'Script error for "'+t.id+(i.length?'", needed by: '+i.join(", "):'"'),e,[t.id]))}}},q.require=q.makeRequire(),q}function getInteractiveScript(){return interactiveScript&&"interactive"===interactiveScript.readyState?interactiveScript:(eachReverse(scripts(),function(e){if("interactive"===e.readyState)return interactiveScript=e}),interactiveScript)}var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.3.2",commentRegExp=/\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/gm,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,isBrowser=!("undefined"==typeof window||"undefined"==typeof navigator||!window.document),isWebWorker=!isBrowser&&"undefined"!=typeof importScripts,readyRegExp=isBrowser&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),contexts={},cfg={},globalDefQueue=[],useInteractive=!1;if("undefined"==typeof define){if("undefined"!=typeof requirejs){if(isFunction(requirejs))return;cfg=requirejs,requirejs=void 0}"undefined"==typeof require||isFunction(require)||(cfg=require,require=void 0),req=requirejs=function(e,t,i,r){var n,o,a=defContextName;return isArray(e)||"string"==typeof e||(o=e,isArray(t)?(e=t,t=i,i=r):e=[]),o&&o.context&&(a=o.context),n=getOwn(contexts,a),n||(n=contexts[a]=req.s.newContext(a)),o&&n.configure(o),n.require(e,t,i)},req.config=function(e){return req(e)},req.nextTick="undefined"!=typeof setTimeout?function(e){setTimeout(e,4)}:function(e){e()},require||(require=req),req.version=version,req.jsExtRegExp=/^\/|:|\?|\.js$/,req.isBrowser=isBrowser,s=req.s={contexts:contexts,newContext:newContext},req({}),each(["toUrl","undef","defined","specified"],function(e){req[e]=function(){var t=contexts[defContextName];return t.require[e].apply(t,arguments)}}),isBrowser&&(head=s.head=document.getElementsByTagName("head")[0],baseElement=document.getElementsByTagName("base")[0],baseElement&&(head=s.head=baseElement.parentNode)),req.onError=defaultOnError,req.createNode=function(e,t,i){var r=e.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");return r.type=e.scriptType||"text/javascript",r.charset="utf-8",r.async=!0,r},req.load=function(e,t,i){var r,n=e&&e.config||{};if(isBrowser)return r=req.createNode(n,t,i),r.setAttribute("data-requirecontext",e.contextName),r.setAttribute("data-requiremodule",t),!r.attachEvent||r.attachEvent.toString&&r.attachEvent.toString().indexOf("[native code")<0||isOpera?(r.addEventListener("load",e.onScriptLoad,!1),r.addEventListener("error",e.onScriptError,!1)):(useInteractive=!0,r.attachEvent("onreadystatechange",e.onScriptLoad)),r.src=i,n.onNodeCreated&&n.onNodeCreated(r,n,t,i),currentlyAddingScript=r,baseElement?head.insertBefore(r,baseElement):head.appendChild(r),currentlyAddingScript=null,r;if(isWebWorker)try{setTimeout(function(){},0),importScripts(i),e.completeLoad(t)}catch(r){e.onError(makeError("importscripts","importScripts failed for "+t+" at "+i,r,[t]))}},isBrowser&&!cfg.skipDataMain&&eachReverse(scripts(),function(e){if(head||(head=e.parentNode),dataMain=e.getAttribute("data-main"))return mainScript=dataMain,cfg.baseUrl||mainScript.indexOf("!")!==-1||(src=mainScript.split("/"),mainScript=src.pop(),subPath=src.length?src.join("/")+"/":"./",cfg.baseUrl=subPath),mainScript=mainScript.replace(jsSuffixRegExp,""),req.jsExtRegExp.test(mainScript)&&(mainScript=dataMain),cfg.deps=cfg.deps?cfg.deps.concat(mainScript):[mainScript],!0}),define=function(e,t,i){var r,n;"string"!=typeof e&&(i=t,t=e,e=null),isArray(t)||(i=t,t=null),!t&&isFunction(i)&&(t=[],i.length&&(i.toString().replace(commentRegExp,commentReplace).replace(cjsRequireRegExp,function(e,i){t.push(i)}),t=(1===i.length?["require"]:["require","exports","module"]).concat(t))),useInteractive&&(r=currentlyAddingScript||getInteractiveScript(),r&&(e||(e=r.getAttribute("data-requiremodule")),n=contexts[r.getAttribute("data-requirecontext")])),n?(n.defQueue.push([e,t,i]),n.defQueueMap[e]=!0):globalDefQueue.push([e,t,i])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},req(cfg)}}(this,"undefined"==typeof setTimeout?void 0:setTimeout);;
(function () {
    'use strict';

    var deps = [];
    var templatePath;



    /* For html2js templates checking and inject the templates*/
    var templates = document.getElementById('injectTemplates');
    templatePath = '../Templates/LoginAssistant/';
    deps = ['ui.bootstrap', 'ui.router', 'CommonModule', 'sharedAuthStepUp', 'ngAnimate', 'ngBusy', 'ui.mask', 'ActimizeModule'];

    if (typeof (templates) != 'undefined' && templates != null) {
        if ((templates.innerText || templates.textContent) === 'True') {
            deps = ['ui.bootstrap', 'ui.router', 'CommonModule', 'sharedAuthStepUp', 'ngAnimate', 'ngBusy', 'ui.mask', , 'ActimizeModule', 'LoginAssistantTemplateModule'];
            templatePath = '';
        }
    }

    angular.module("LoginAssistantModule", deps)
        .config([
            '$stateProvider', 'CommonConstants', 'LoginAssistantConstants', '$locationProvider', 'uiMask.ConfigProvider', function ($stateProvider, CommonConstants, LoginAssistantConstants, $location, uiMaskConfigProvider) {

                uiMaskConfigProvider.clearOnBlur(false);
                $stateProvider
                    .state('default', {
                        url: '/LoginAssistant',
                        data: { pageTitle: "Login Assistant test  title" }
                    })

                    .state(LoginAssistantConstants.LA_RETRIEVEPERSONALID, {
                        url: '/RetrievePersonalId',
                        templateUrl: templatePath + LoginAssistantConstants.LA_TEMPLATE_RETRIEVEPERSONALID,
                        controller: LoginAssistantConstants.LA_CONTROLLER_RETRIEVEPERSONALID,
                        controllerAs: 'vm',
                        data: { pageTitle: LoginAssistantConstants.LA_PAGETITLE_RETRIEVE_PERSONAL_ID }
                    })

                    .state(LoginAssistantConstants.LA_GENERICLANDING, {
                        url: '/GenericLanding',
                        templateUrl: templatePath + LoginAssistantConstants.LA_TEMPLATE_GENERICLANDING,
                        controller: LoginAssistantConstants.LA_CONTROLLER_GENERICLANDING,
                        controllerAs: 'vm',
                        data: { pageTitle: LoginAssistantConstants.LA_PAGETITLE_GENERIC_LINK }
                    })
                    .state(LoginAssistantConstants.LA_CHOOSEIDMETHOD, {
                        url: '/ChooseIdMethod',
                        templateUrl: templatePath + LoginAssistantConstants.LA_TEMPLATE_CHOOSEIDMETHOD,
                        controller: LoginAssistantConstants.LA_CONTROLLER_CHOOSEIDMETHOD,
                        controllerAs: 'vm',
                        data: { pageTitle: LoginAssistantConstants.LA_PAGETITLE_CHOOSE_ID }
                    })

                    .state(LoginAssistantConstants.LA_ENTERIDINFO, {
                        url: '/EnterIdInfo',
                        templateUrl: templatePath + LoginAssistantConstants.LA_TEMPLATE_ENTERIDINFO,
                        controller: LoginAssistantConstants.LA_CONTROLLER_ENTERIDINFO,
                        controllerAs: 'vm',
                        data: { pageTitle: LoginAssistantConstants.LA_PAGETITLE_ENTER_ID_INFO }
                    })

                    .state(LoginAssistantConstants.LA_ENTERBUSINESSIDINFO, {
                        url: '/EnterBusinessIdInfo',
                        templateUrl: templatePath + LoginAssistantConstants.LA_TEMPLATE_ENTERBUSINESSIDINFO,
                        controller: LoginAssistantConstants.LA_CONTROLLER_ENTERBUSINESSIDINFO,
                        controllerAs: 'vm',
                        data: { pageTitle: LoginAssistantConstants.LA_PAGETITLE_ENTER_BUSINESS_ID_INFO }
                    })
                    .state(LoginAssistantConstants.LA_VERIFYIDENTITY, {
                        url: '/VerifyIdentity',
                        templateUrl: templatePath + LoginAssistantConstants.LA_TEMPLATE_VERIFYIDENTITY,
                        controller: LoginAssistantConstants.LA_CONTROLLER_VERIFYIDENTITY,
                        controllerAs: 'vm',
                        data: { pageTitle: LoginAssistantConstants.LA_PAGETITLE_VERIFY_IDENTITY }
                    })
                    .state(LoginAssistantConstants.LA_VERIFYIDENTITYVIAACCOUNTNUMBERORPIN, {
                        url: '/VerifyIdentityViaAccountNumberOrPin',
                        templateUrl: templatePath + LoginAssistantConstants.LA_TEMPLATE_VERIFYIDENTITYVIAACCOUNTNUMBERORPIN,
                        controller: LoginAssistantConstants.LA_CONTROLLER_VERIFYIDENTITYVIAACCOUNTNUMBERORPIN,
                        controllerAs: 'vm',
                        data: { pageTitle: LoginAssistantConstants.LA_PAGETITLE_VERIFY_IDENTITY }
                    })
                    .state(LoginAssistantConstants.LA_ENTERCODE, {
                        url: '/EnterCode',
                        templateUrl: templatePath + LoginAssistantConstants.LA_TEMPLATE_ENTERCODE,
                        controller: LoginAssistantConstants.LA_CONTROLLER_ENTERCODE,
                        controllerAs: 'vm',
                        data: { pageTitle: LoginAssistantConstants.LA_PAGETITLE_ENTER_CODE }
                    })
                    .state(LoginAssistantConstants.LA_PERSONALID, {
                        url: '/PersonalId',
                        templateUrl: templatePath + LoginAssistantConstants.LA_TEMPLATE_PERSONALID,
                        controller: LoginAssistantConstants.LA_CONTROLLER_PERSONALID,
                        controllerAs: 'vm',
                        data: { pageTitle: LoginAssistantConstants.LA_PAGETITLE_PERSONAL_ID }
                    })
                    .state(LoginAssistantConstants.LA_MULTIPLESHAREDACCESSADMINS, {
                        url: '/MultipleSharedAccessAdmins',
                        templateUrl: templatePath + LoginAssistantConstants.LA_TEMPLATE_MULTIPLESHAREDACCESSADMINS,
                        controller: LoginAssistantConstants.LA_CONTROLLER_MULTIPLESHAREDACCESSADMINS,
                        controllerAs: 'vm',
                        data: { pageTitle: LoginAssistantConstants.LA_PAGETITLE_MULTIPLE_SHAREDACCESS_ADMIN }
                    })
                    .state(LoginAssistantConstants.LA_ENTERTAXID, {
                        url: '/EnterTaxId',
                        templateUrl: templatePath + LoginAssistantConstants.LA_TEMPLATE_ENTERTAXID,
                        controller: LoginAssistantConstants.LA_CONTROLLER_ENTERTAXID,
                        controllerAs: 'vm',
                        data: { pageTitle: LoginAssistantConstants.LA_PAGETITLE_ENTER_TAXID }
                    })
                    .state(LoginAssistantConstants.LA_MULTIPLEACCOUNTS, {
                        url: '/MultipleAccounts',
                        templateUrl: templatePath + LoginAssistantConstants.LA_TEMPLATE_MULTIPLEACCOUNTS,
                        controller: LoginAssistantConstants.LA_CONTROLLER_MULTIPLEACCOUNTS,
                        controllerAs: 'vm',
                        data: { pageTitle: LoginAssistantConstants.LA_PAGETITLE_SELECT_ACCOUNT }
                    })
                    .state(LoginAssistantConstants.LA_MULTIPLEMOBILENUMBER, {
                        url: '/MultipleMobileNumber',
                        templateUrl: templatePath + LoginAssistantConstants.LA_TEMPLATE_MULTIPLEMOBILENUMBER,
                        controller: LoginAssistantConstants.LA_CONTROLLER_MULTIPLEMOBILENUMBER,
                        controllerAs: 'vm',
                        data: { pageTitle: LoginAssistantConstants.LA_PAGETITLE_SELECT_MOBILE_NUMBER }
                    })
                    .state(LoginAssistantConstants.LA_LOCKERROR, {
                        url: '/LockError',
                        templateUrl: templatePath + LoginAssistantConstants.LA_LOCKERROR_TEMPLATE,
                        controller: LoginAssistantConstants.LA_LOCKERROR_CONTROLLER,
                        controllerAs: 'vm',
                        data: { pageTitle: LoginAssistantConstants.LA_PAGETITLE_LOCK_ERROR }
                    })
                    .state(LoginAssistantConstants.LA_RESETCOMMON, {
                        url: '/ResetCommon',
                        templateUrl: templatePath + LoginAssistantConstants.LA_TEMPLATE_RESETCOMMON,
                        controller: LoginAssistantConstants.LA_CONTROLLER_RESETCOMMON,
                        controllerAs: 'vm',
                        data: { pageTitle: LoginAssistantConstants.LA_PAGETITLE_RESET_COMMON }
                    })
                    .state(LoginAssistantConstants.LA_RESETPASSWORD, {
                        url: '/ResetPassword',
                        templateUrl: templatePath + LoginAssistantConstants.LA_RESETPASSWORD_TEMPLATE,
                        controller: LoginAssistantConstants.LA_RESETPASSWORD_CONTROLLER,
                        controllerAs: 'vm',
                        data: { pageTitle: LoginAssistantConstants.LA_PAGETITLE_RESET_PASSWORD }
                    })
                    .state(LoginAssistantConstants.LA_RESETPASSWORD_CONFIRMATION, {
                        url: '/ResetPasswordConfirmation',
                        templateUrl: templatePath + LoginAssistantConstants.LA_RESETPASSWORD_CONFIRMATION_TEMPLATE,
                        controller: LoginAssistantConstants.LA_RESETPASSWORD_CONFIRMATION_CONTROLLER,
                        controllerAs: 'vm',
                        data: { pageTitle: LoginAssistantConstants.LA_PAGETITLE_RESET_PASSWORD }
                    })
                    .state(LoginAssistantConstants.LA_ENTERPASSWORD, {
                        url: '/EnterPassword',
                        templateUrl: templatePath + LoginAssistantConstants.LA_ENTERPASSWORD_TEMPLATE,
                        controller: LoginAssistantConstants.LA_ENTERPASSWORD_CONTROLLER,
                        controllerAs: 'vm',
                        data: { pageTitle: LoginAssistantConstants.LA_PAGETITLE_ENTER_PASSWORD }
                    })

            }
        ]);
})();;
(function () {
    angular
        .module('LoginAssistantModule')
        .constant('LoginAssistantConstants',
            {
                LA_CONTINUEBUTTON: 'Continue',
                LA_NEXTBUTTON: 'Next',
                LA_CANCELBUTTON: 'Cancel',
                LA_FOURTHATMPTPOPUP: 'FourthAtmptPopUp.html',
                LA_RESENDOTPBUTTON: 'Resend',
                LA_COMMON_ERROR_TEXT_VALIDATION_M881: 'Please enter missing details, or correct any errors.',
                LA_COMMON_ERROR_TEXT_VALIDATION_M103: 'Some of the information provided doesn\'t match our records.Please try again.',
                LA_TAXID_ERROR_TEXT_VALIDATION_M883: 'The Tax ID you entered doesn\'t match our records.Please try again.',
                LA_RETRIEVEMYPERSONALID: 'RetrieveMyPersonalID',
                LA_RETRIEVEPERSONALID: 'RetrievePersonalId',
                LA_TEMPLATE_RETRIEVEPERSONALID: 'RetrievePersonalId.html',
                LA_CONTROLLER_RETRIEVEPERSONALID: 'RetrievePersonalIdController',
                LA_RETRIEVEBUSINESSPERSONALID: 'RetrieveBusinessPersonalId',
                LA_MULTIPLESHAREDACCESSADMINS: 'MultipleSharedAccessAdmins',
                LA_TEMPLATE_MULTIPLESHAREDACCESSADMINS: 'MultipleSharedAccessAdmins.html',
                LA_CONTROLLER_MULTIPLESHAREDACCESSADMINS: 'MultipleSharedAccessAdminsController',
                LA_MULTIPLEACCOUNTS: 'MultipleAccounts',
                LA_TEMPLATE_MULTIPLEACCOUNTS: 'MultipleAccounts.html',
                LA_CONTROLLER_MULTIPLEACCOUNTS: 'MultipleAccountsController',
                LA_MULTIPLEMOBILENUMBER: 'MultipleMobileNumber',
                LA_TEMPLATE_MULTIPLEMOBILENUMBER: 'MultipleMobileNumber.html',
                LA_CONTROLLER_MULTIPLEMOBILENUMBER: 'MultipleMobileNumberController',
                LA_GENERICLANDING: 'GenericLanding',
                LA_TEMPLATE_GENERICLANDING: 'GenericLanding.html',
                LA_CONTROLLER_GENERICLANDING: 'GenericLandingController',
                LA_CHOOSEIDMETHOD: 'ChooseIdMethod',
                LA_TEMPLATE_CHOOSEIDMETHOD: 'ChooseIdMethod.html',
                LA_CONTROLLER_CHOOSEIDMETHOD: 'ChooseIdMethodController',
                LA_ENTERIDINFO: 'EnterIdInfo',
                LA_TEMPLATE_ENTERIDINFO: 'EnterIdInfo.html',
                LA_CONTROLLER_ENTERIDINFO: 'EnterIdInfoController',
                LA_ENTERBUSINESSIDINFO: 'EnterBusinessIdInfo',
                LA_TEMPLATE_ENTERBUSINESSIDINFO: 'EnterBusinessIdInfo.html',
                LA_CONTROLLER_ENTERBUSINESSIDINFO: 'EnterBusinessIdInfoController',
                LA_VERIFYIDENTITY: 'VerifyIdentity',
                LA_TEMPLATE_VERIFYIDENTITY: 'VerifyIdentity.html',
                LA_CONTROLLER_VERIFYIDENTITY: 'VerifyIdentityController',
                LA_VERIFYIDENTITYVIATEXT: 'VerifyIdentityViaText',
                LA_ENTERCODE: 'EnterCode',
                LA_TEMPLATE_ENTERCODE: 'EnterCode.html',
                LA_CONTROLLER_ENTERCODE: 'EnterCodeController',
                LA_VERIFYIDENTITYVIAACCOUNTNUMBERORPIN: 'VerifyIdentityViaAccountNumberOrPin',
                LA_TEMPLATE_VERIFYIDENTITYVIAACCOUNTNUMBERORPIN: 'VerifyIdentityViaAccountNumberOrPin.html',
                LA_CONTROLLER_VERIFYIDENTITYVIAACCOUNTNUMBERORPIN: 'VerifyIdentityViaAccountNumberOrPinController',
                LA_PERSONALID: 'PersonalId',
                LA_TEMPLATE_PERSONALID: 'PersonalId.html',
                LA_CONTROLLER_PERSONALID: 'PersonalIdController',
                LA_SELECTACCOUNT: 'SelectAccount',
                LA_PROFILENOTFOUND: 'ProfileNotFound',
                LA_ENTERTAXID: 'EnterTaxId',
                LA_TEMPLATE_ENTERTAXID: 'EnterTaxId.html',
                LA_CONTROLLER_ENTERTAXID: 'EnterTaxIdController',
                LA_PHONE: 'PhoneSSN',
                LA_EMAIL: 'EmailSSN',
                LA_CARDORACCOUNT: 'AccountSSN',
                LA_BUSSINESS_CARDORACCOUNT: 'AccountSSNTIN',
                LA_DDA_ACCOUNT: 'DDA',
                LA_CCD_ACCOUNT: 'CCD',
                LA_LLLMW_ACCOUNT: 'LLLMW',
                LA_PERSONAL_BANKING: 'Personal',
                LA_BUSINESS_BANKING: 'Business',
                LA_SHARED_ACCESS_BANKING: 'SharedAccess',
                LA_RESETMYPASSWORD: 'ResetMyPassword',
                LA_RESETPASSWORD: 'ResetPassword',
                LA_RESETPASSWORD_TEMPLATE: 'ResetPassword.html',
                LA_RESETPASSWORD_CONTROLLER: 'ResetPasswordController',
                LA_RESETPASSWORD_CONFIRMATION: 'ResetPasswordConfirmation',
                LA_RESETPASSWORD_CONFIRMATION_TEMPLATE: 'ResetPasswordConfirmation.html',
                LA_RESETPASSWORD_CONFIRMATION_CONTROLLER: 'ResetPasswordConfirmationController',
                LA_SELECT_ADMIN: 'SharedAccessSelectAdmin',
                LA_ENTERPASSWORD: 'EnterPassword',
                LA_ENTERPASSWORD_TEMPLATE: 'EnterPassword.html',
                LA_ENTERPASSWORD_CONTROLLER: 'EnterPasswordController',
                LA_RESETCOMMON: 'ResetCommon',
                LA_TEMPLATE_RESETCOMMON: 'ResetCommon.html',
                LA_CONTROLLER_RESETCOMMON: 'ResetCommonController',
                LA_LOCKERROR: 'LockError',
                LA_LOCKERROR_TEMPLATE: 'LockError.html',
                LA_LOCKERROR_CONTROLLER: 'LockErrorController',
                LA_SIGNON_ERRORMESSAGE_ID: 'SignOnErrorMessage',
                LA_REDIRECTION_ERRORMESSAGE_ID: 'RedirectionErrorMessage',
                LA_COMMON_ERRORMESSAGE_ID: 'CommonErrorMessage',
                LA_TEMPORARYACCESSCODE: 'TemporaryAccessCode',
                LA_CHANGEIDSHIELDQA: 'ChangeIDShieldQA',
                LA_SLIDE_RIGHT: 'slide-right',
                LA_SLIDE_LEFT: 'slide-left',
                LA_BUSINESS: 'Business',
                LA_PROTECTED_RESOURCE_URL: '/Auth/Login/ProtectedResource',
                LA_PROTECTED_RESOURCE: 'ProtectedResource',
                LA_PASSWORD_WIDGET_URL: '/Auth/Login/PasswordWidget',
                LA_SIGNON_WITH_TRANSMIT_URL: '/Auth/Signon/SignonWithTransmit',
                LA_GETSTEPUP_URL: 'LoginAssistant/GetStepUp',
                LA_LOGIN: 'Login',
                LA_RETRIEVE_PERSONAL_ID: 'RetrievePersonalId',
                LA_COMMON_LOCK_ERROR_MESSAGE: 'Sorry, we’re still unable to verify the information you entered. For your security, you’ve been locked out of login assistance. For help, please call 877-202-0043. (Error Code = A00183)',
                LA_COMMON_LOCK_ERROR_MESSAGE_TITLE_REBRAND: 'Sorry, we’re still unable to verify the information you entered. For your security, you’ve been locked out of login assistance. For help, please call 877-202-0043. (Error Code = A00183)',
                LA_COMMON_LOCK_ERROR_MESSAGE_REBRAND: 'For your security, you’ve been locked out of login assistance. Please call 877.202.0043 for help. (Error Code = A00183)',
                LA_SHAREED_ACCESS_ERROR_MESSAGE_M882: "We don't recognize that security code. Please try again.",
                LA_ENTERCODE_ERROR_MESSAGE_M1013: "For your security, your account is about to be locked. Please check and re-enter the code we sent you.",
                LA_ENTERPIN_ERROR_MESSAGE_M1012: "For your security, your account is about to be locked. Please check and re-enter your account info.",
                LA_ENTERINFO_ERROR_MESSAGE_M607: "Hmm. That doesn\’t match our records. Please try again.",
                LA_ENTERINFO_ERROR_MESSAGE_M1010: "For your security, your account is about to be locked. Please use a different option to find your ID.",
                LA_ENTERINFO_ERROR_MESSAGE_M1011: "For your security, your account is about to be locked. Please make sure all the information you entered is correct.",
                LA_SHAREED_ACCESS_INACTIVE_ERROR_MSG: 'For your security, you’ve been locked out of login assistance. Please call 877.202.0043 for help. (Error Code = A00183)',
                LA_PAGETITLE_GENERIC_LINK: 'Login Assistant | Landing Page',
                LA_PAGETITLE_RETRIEVE_PERSONAL_ID: 'Login Assistant | Retrieve Personal ID',
                LA_PAGETITLE_RETRIEVE_BUSINESS_PERSONAL_ID: 'Login Assistant | Retrieve Business Personal ID',
                LA_PAGETITLE_CHOOSE_ID: 'Login Assistant | Choose Identification Method',
                LA_PAGETITLE_ENTER_ID_INFO: 'Login Assistant | Enter Identification Info',
                LA_PAGETITLE_ENTER_BUSINESS_ID_INFO: 'Login Assistant | Enter Business Identification Info',
                LA_PAGETITLE_VERIFY_IDENTITY: 'Login Assistant | Verify Identity',
                LA_PAGETITLE_ENTER_CODE: 'Login Assistant | Enter Code',
                LA_PAGETITLE_SELECT_ACCOUNT: 'Login Assistant | Select Account',
                LA_PAGETITLE_SELECT_MOBILE_NUMBER: 'Login Assistant | Select Mobile Number',
                LA_PAGETITLE_SELECT_ADMIN: 'Login Assistant | Select Admin',
                LA_PAGETITLE_ENTER_TAXID: 'Login Assistant | Enter TaxId',
                LA_PAGETITLE_PERSONAL_ID: 'Login Assistant | Personal Id',
                LA_PAGETITLE_MULTIPLE_SHAREDACCESS_ADMIN: 'Login Assistant | Multiple Shared Access Admin',
                LA_PAGETITLE_PROFILE_NOT_FOUND: 'Login Assistant | Profile Not Found',
                LA_PAGETITLE_RESET_PASSWORD: 'Login Assistant | Reset Password',
                LA_PAGETITLE_ENTER_PASSWORD: 'Login Assistant | Enter Password',
                LA_PAGETITLE_RESET_COMMON: 'Login Assistant | Reset Common',
                LA_PAGETITLE_LOCK_ERROR: 'Login Assistant | Locking Error Page',
                LA_PAGETITLE_RESET_PASSWORD_CONFIRMATION: 'Login Assistant | Reset Password Confirmation',
                REQUIRE_JQUERY_PATH: "/OLS/Content/Shared/Scripts/SharedAuthStepUp/SharedAuthModule/require-jquery-1.4.4",
                REQUIRE_XM_PATH: "/OLS/Content/Shared/Scripts/SharedAuthStepUp/SharedAuthModule/TransmitScripts",
                LA_REDIRECT_FORGET_USERID: 'forgotUserID',
                LA_REDIRECT_FORGET_PASSWORD: 'forgotPassword',


                LA_RESETWITHPIN: 'ResetWithPIN',
                LA_RESETWITHCCD: 'ResetWithCCD',
                LA_RESETWITHACCOUNTZIP: 'ResetWithAccountZIP',
                LA_RESETWITHOTP: 'ResetWithOTP',

                LA_SENDCODE: 'SendCode',
                LA_USEACCNO: 'UseAccNo',
                LA_EMAIL_PATTERN: /^((?!\.)[\w\._-]+@[A-Za-z0-9\-_]+(\.[A-Za-z0-9\-_]+)+)$/,
                LA_EXPIRATIONDATE_PATTERN: /^(0[1-9]|1[012]|\d)(20\d{2}|19\d{2}|0(?!0)\d|[1-9]\d)$/,
                LA_DIGIT_PATTERN: /^[0-9]*$/,
                LA_THREEDIGIT_PATTERN: /[0-9]{3}/,
                LA_FIVEDIGIT_PATTERN: /[0-9]{5}/,
                LA_PASSWORD_PATTERN_STRING: /^(?=.*\d)(?=.*[a-zA-Z%$&]).{8,24}$/,
                LA_PASSWORD_PATTERN: /^(?=.*\d)(?=.*[a-zA-Z])(?!.*\s)(?!.*[\x80-\xFF]).{8,24}$/,
                LA_CARDNUMBER_PATTERN: /^[a-zA-Z0-9- ]*$/,
                LA_FOURDIGIT_PATTERN: /[0-9]{4}/,
                LA_PERSONALID_PATTERN: /^[a-zA-Z0-9]{7,22}$/,

                LA_GETAPPNAME_ACTION_URL: 'LoginAssistant/GetAppName',
                LA_SENDOTPVIATEXTOREMAIL_ACTION_URL: 'LoginAssistant/SendOtpViaTextOrEmail',
                LA_COMMON_ERROR_MESSAGE_M618: 'Sorry, our system is currently unavailable. Please try again.',
                LA_COMMON_ERROR_MESSAGE_M459: 'Please enter a new password that is not the same as your current password.',
                LA_COMMON_ERROR_MESSAGE_ACCOUNT_LOCKEDBY_FRAUD: 'We\'re sorry, it looks like your personal ID has been disabled. Please contact 800-987-7237 for help.',
                LA_VERIFYCUSTOMER_ACTION_URL: 'LoginAssistant/VerifyCustomer',
                LA_GENERATETRANSMITTOKEN_ACTION_URL: 'LoginAssistant/GenerateTransmitToken',
                LA_VALIDATECUSTOMER_ACTION_URL: 'LoginAssistant/ValidateCustomer',
                LA_ELIGIBLE_ACCOUNT_LIST_URL: 'LoginAssistant/GetEligibleAccountList',
                LA_CHECK_SHARED_AUTH_PILOT: 'LoginAssistant/CheckSharedAuthPilotUser',
                LA_VERIFYOTP_ACTION_URL: 'LoginAssistant/VerifyOtp',
                LA_REDIRECT_FOCUS_URL: 'LoginAssist/getRedirectionDetails',
                LA_RESETPASSWORD_ACTION_URL: 'LoginAssistant/ForgotPassword',
                LA_SET_GENERIC_CACHE_DATA_URL: 'LoginAssistant/SetGenericCacheData',
                LA_FOURDIGITPATTERNVALID: 'fourDigitPatternValid',
                LA_DIGITPATTERNVALID: 'digitPatternValid',
                LA_O_RESETPASSWORD: 'LaResetPassword',
                LA_O_RESETIDSHIELD: 'ResetIdShield',
                LA_O_RETRIEVEPERSONALID: 'RetrievePersonalId',
                LA_O_RETRIEVEID: 'RetrieveId',
                LA_GENERIC_LANDING: 'GenericLanding',
                LA_O_MultipleMobileNumber: 'MultipleMobileNumber',
                LA_O_MultipleAccounts: 'MultipleAccounts',
                LA_O_RETRIEVEBUSINESSID: 'RetrieveBusinessId',
                LA_O_LOCKEDOUTSTATUS: 203,
                LA_O_FIRSTTIMEERROR: 'FirstTimeError',
                LA_O_SECONDTIMEERROR: 'SecondTimeError',
                LA_O_THIRDTIMEERROR: 'ThirdTimeError',
                LA_O_FOURTHTIMEERROR: 'FourthTimeError',
                LA_O_PILOTUSERFIRSTTIMEERROR: 'PilotUserFirstTimeError',
                LA_O_PILOTUSERSECONDTIMEERROR: 'PilotUserSecondTimeError',
                LA_O_PILOTUSERTHIRDTIMEERROR: 'PilotUserThirdTimeError',
                LA_O_PILOTUSERFOURTHTIMEERROR: 'PilotUserFourthTimeError',
                LA_ISINVALID: 'isInValid',
                LA_ISDIRTY: 'isDirty',
                LA_ISSUBMITTED: 'isSubmitted',
                LA_SITECAT_PAGENAME_RESENDBUTTON: "LoginAssistanceResend",
                LA_SITECAT_EVENT_RESENDBUTTON_RESETPASSWORD: "resetPassword",
                LA_SITECAT_EVENT_RESENDBUTTON_RESETIDSHIELD: "resetIDShield",
                LA_SITECAT_EVENT_RESENDBUTTON_RETRIEVE_PERSONALID: "retrievePersonalID",
                LA_SITECAT_EVENT_RESENDBUTTON_RETRIEVE_BUSINESSLID: "retrieveBusinessID",
                LA_RESEND_LIMIT_EXCEEDS_ERROR: 'We’re sorry, but you’ve requested the maximum number of codes. Please call 877.202.0043 for help.',
                LA_PIN: 'PIN',
                LA_OTP: 'OTP',
                LA_STEPUPTRX: 'OLBFORGOTPASSWORDPERSONAL',
                RequestTypeCode: {
                    RTIDACCT: 'RTIDACCT',
                    RTIDPHON: 'RTIDPHON',
                    RSPW: 'RSPW',
                    PIN: 'PIN',
                    CVV2: 'CVV2',
                    ZIP: 'ZIP'
                },
                LA_DONT_HAVE_ACCOUNT: 'DontHaveAccount',
                LA_I_DONT_HAVE_AN_ACCOUNT: 'Not sure? Try another way.',

                //BEGIN - CI:Jan-2018, B-58352
                GenericLandingStatics: {
                    LA_GENERIC_LANDING_TITLE: 'Login Assistance',
                    LA_GENERIC_LANDING_MAINTEXT: 'Having trouble logging in?',
                    LA_GENERIC_LANDING_MAINTEXT_ERROR: 'Looks like you had trouble logging in.',
                    LA_GENERIC_LANDING_SUB_MAINTEXT_ERROR: 'We can help.',
                    LA_GENERIC_LANDING_SUB_MAINTEXT: 'No problem. We can help.',
                    LA_GENERIC_LANDING_CHOOSE_TEXT: 'Choose one',
                    LA_GENERIC_LANDING_RETRIEVE_ID: 'Retrieve ID',
                    LA_GENERIC_LANDING_RESET_PASSWORD: 'Reset Password',
                    LA_GENERIC_LANDING_RESET_PASSWORD_REBRAND: 'Reset password',
                    LA_GENERIC_LANDING_RESET_ID_SHIELD: 'Reset Security Questions',
                    LA_GENERIC_LANDING_RESET_ID_SHIELD_REBRAND: 'Reset ID Shield questions',
                    LA_GENERIC_LANDING: 'GenericLanding'
                },
                //END - CI:Jan-2018, B-58352
                RetrivePersonalIDStatics: {
                    LA_RETRIEVE_PERSONALID_TITLE: 'Retrieve ID',
                    LA_RETRIEVE_SHIELD_QUESTION_TITLE: 'Reset Id Shield Questions',
                    LA_RETRIEVE_PASSWORD_TITLE: 'RESET Password',
                    LA_RETRIEVE_PERSONALID_MAINTEXT: 'Which type of account are you looking for?',
                    LA_RETRIEVE_PERSONALID_MAINTEXT_NEWBRAND: 'What kind of account do you have?',
                    LA_CHOOSEONE_TEXT: 'Choose One',
                    LA_PERSONAL_TEXT: 'Personal',
                    LA_BUSINESS_TEXT: 'Business',
                    LA_SHARED_ACCESS_TEXT: 'Shared Access',
                    LA_INVALIDVCONTEXT_WRONGPERSONALID_M876: 'Did you forget your ID? That\'s ok. Let\'s find it.',
                    LA_O_RETRIEVEID: 'RetrieveId',
                    LA_O_RETRIEVEPERSONALIDDIRECTEDLOCKEDOUT: 'RetrievePersonalIdDirectedLockedOut',
                    LA_O_RETRIEVEPERSONALIDALREADYENROLLED: 'RetrievePersonalIdAlreadyEnrolled',//CI July 2017 B-36094 Enrollment - Retrieve ID Flow Tagging change
                    LA_USER_ALREADY_ENROLL_ERROR_MESSAGE: 'You’ve already enrolled for Online Banking. To retrieve your login information, select from the options below.'
                },

                RetriveBusinessPersonalIDStatics: {
                    LA_RETRIEVE_BUSINESS_PERSONALID_TITLE: 'Retrieve Personal ID',
                    LA_RETRIEVE_BUSINESS_PERSONALID_MAINTEXT: 'Which type of account are you looking for?',
                    LA_CHOOSEONE_TEXT: 'Choose One',
                    LA_TRUST_TEXT: 'Trust',
                    LA_BROKERAGE_TEXT: 'Brokerage',
                    LA_CREDITCARD_TEXT: 'Credit Card',
                    LA_ANOTHERACCOUNT_TEXT: 'I have another type of account',
                    LA_O_RETRIEVEBUSINESSPERSONALID: 'RetrieveBusinessPersonalId',
                },

                ChooseIdMethodStatics: {
                    LA_RETRIEVE_PERSONALID_TITLE: 'Retrieve ID',
                    LA_RETRIEVE_SHIELD_QUESTION_TITLE: 'Reset Authentication Options',
                    LA_RETRIEVE_PASSWORD_TITLE: 'RESET Password',
                    LA_CHOOSEIDMETHOD_MOBILETITLE: 'Choose ID Method',
                    LA_CHOOSEIDMETHOD_TITLE: 'Choose Identification Method',
                    LA_CHOOSEIDMETHOD_MAINTEXT: ' How should we look for your profile?',
                    LA_CHOOSEIDMETHOD_USETEXT: 'I’d Like to Use My...',
                    LA_PHONENUMBER_TEXT: 'Phone Number',
                    LA_PHONENUMBER_TEXT_REBRAND: 'Phone',
                    LA_EMAILADDRESS_TEXT: 'Email Address',
                    LA_EMAILADDRESS_TEXT_REBRAND: 'Email',
                    LA_CARDORACCOUNT_TEXT: 'Card or Account',
                    LA_CARDORACCOUNT_TEXT_REBRAND: 'Card or account number',
                    LA_CHOOSEIDMETHOD_CONTENT: 'If you’ve changed the email address or phone number in your profile within the last 3 days, please select “card or account”.',
                    LA_CHOOSEIDMETHOD_CONTENT_REBRAND: 'Changed your contact info within the last 3 days? If so, please call 877.202.0043 for help.',
                    LA_O_SELECTIDMETHOD: 'SelectIdMethod'
                },
                VerifyIdentityStatics: {
                    LA_VERIFY_IDENTITY_TITLE: 'Verify Identity',
                    LA_VERIFY_IDENTITY_MAINTEXT: 'Let us know you’re you.',
                    LA_VERIFY_IDENTITY_MAINTEXT_REBRAND: 'We’d like you to verify your ID.',
                    LA_VERIFY_IDENTITY_CONTEXT_TITLE_REBRAND: ' Please verify your ID.',
                    LA_VERIFY_IDENTITY_CHOOSETEXT: 'Choose a Secure Option',
                    LA_VERIFY_IDENTITY_CHOOSETEXT_REBRAND: 'Choose an option — both are quick and secure.',
                    LA_VERIFY_IDENTITY_SENDCODEBY_TEXT: 'Send me a code by text or email',
                    LA_VERIFY_IDENTITY_USEMYACCNO_OR_PIN_TEXT: 'I’ll use my account or PIN',
                    LA_VERIFY_IDENTITY_USEMYACCNO_OR_ACCOUNT_TEXT: 'I’ll use my card or account',
                    LA_VERIFY_IDENTITY_USEMYACCNO_OR_PIN_TEXT_ADA: 'Click here to use either account or PIN',
                    LA_VERIFY_IDENTITY_TPSH_SENDCODEBY_TEXT: 'Send me a code by text',
                    LA_VERIFY_IDENTITY_TPSH_SENDCODEBY_TEXT_ADA: 'Click here to send code by text',
                    LA_VERIFY_IDENTITY_USEMYACCNO_OR_ACCOUNT_TEXT_ADA: 'Click here to use either card or account',
                    LA_VERIFY_IDENTITY_RESET_PASSWORD: 'Forgot your password?',
                    LA_VERIFY_IDENTITY_RESET_IDSHIELD: 'Forgot the answer to your security questions?',
                    LA_VERIFY_IDENTITY_RESET_IDSHIELD_REBRAND: 'Forgot the answers to your ID Shield questions?',
                    LA_O_VERIFYIDENTITY: 'VerifyIdentity',
                    LA_O_VERIFYIDENTITYSYSTEMUNAVAILABLE: 'VerifyIdentitySystemUnavailable',
                    LA_O_VERIFYIDENTITY_RESETOPTIONS: 'Please verify your identity. Let us know you’re you.',
                    LA_SHARED_ACCESS_SERVICE_DOWN_M1006: 'We\'re sorry, we are experiencing technical difficulties and can\'t complete your request right now. Please try again later. If this problem persists or if you need immediate help, contact us at 1-800-USBANKS.',
                    LA_SHARED_ACCESS_NO_MATCH_M1040: 'That information doesn\'t match our records. Please contact your Shared Access Administrator for assistance.',
                    LA_SHARED_ACCESS_ERROR_MSG_E60027_M1041: 'The Shared Access delegate is inactive.',
                    LA_SHARED_ACCESS_ERROR_MSG_E60085: 'Multiple Matching Customers',
                    LA_DOESNT_MATCH: 'That doesn’t match our records.',
                    LA_SHARED_ACCESS_NO_PHONE_MSG: 'If you’ve changed your primary mobile number within the last 3 days. Please contact your Shared Access Administrator for assistance.'

                },
                VerifyIdentityViaTextOrEmailStatics: {
                    LA_VERIFY_IDENTITY_VIA_TEXT_OR_EMAIL_TITLE: 'Verify Identity',
                    LA_VERIFY_IDENTITY_VIA_TEXT_OR_EMAIL_MAINTEXT: 'Please select how you want us to deliver a one-time passcode to you.',
                    LA_VERIFY_IDENTITY_VIA_TEXT_OR_EMAIL_HEADERTEXT: 'We’ll send you a one-time passcode.',
                    LA_VERIFY_IDENTITY_VIA_TEXT_OR_EMAIL_MAINTEXT_REDIRECTAAPAGE: "Please enter the code received. You will then be taken to the Authentications Options page where you can manage your authenticators, ex. Choose new ID Shield Questions.",
                    LA_VERIFY_IDENTITY_VIA_TEXT_OR_EMAIL_CHOOSETEXT: 'Choose one',
                    LA_O_VERIFYIDENTITYVIATEXTOREMAIL: 'VerifyIdentityViaTextOrEmail',
                    LA_O_VERIFYIDENTITYVIATEXTOREMAILSYSTEMUNAVAILABLE: 'VerifyIdentityViaTextOrEmailSystemUnavailable',
                    LA_O_VERIFYIDENTITYVIATEXTOREMAILLOCKEDOUTERROR: 'VerifyIdentityViaTextOrEmailLockedOutError'
                },
                VerifyIdentityViaAccountNumberOrPinStatics: {
                    LA_VERIFY_IDENTITY_ENTERPIN_TITLE: 'Enter PIN',
                    LA_VERIFY_IDENTITY_HEADING_TEXT:'Please enter the PIN for one of your accounts',
                    LA_VERIFY_IDENTITY_ENTERACCOUNTINFO_TITLE: 'Enter Account Info',
                    LA_VERIFY_IDENTITY_ENTERZIPCODE_TITLE: 'Enter Zip Code',
                    LA_VERIFY_IDENTITY_PROFILENOTFOUND_TITLE: 'Profile Not Found',
                    LA_VERIFY_IDENTITY_PROFILENOTFOUND_MAINTEXT: 'Sorry, we’re having trouble finding you. Let’s try something else.',
                    LA_VERIFY_IDENTITY_DDA_ACCOUNT_WITH_ACCNO_MAINTEXT: 'Please enter the PIN for one of your deposit accounts.',
                    LA_VERIFY_IDENTITY_DDA_ACCOUNT_WITH_ACCNO_MAINTEXT_REDIRECTAAPAGE: 'Please enter the PIN for one of your accounts. You will then be taken to the Authentication Options page where you can manage your authenticators, ex. Choose new IDShield Questions.',
                    LA_VERIFY_IDENTITY_DDA_ACCOUNT_WITH_ACCNO_MAINTEXT_PilotUser: 'Please enter the PIN for one of your accounts.',
                    LA_VERIFY_IDENTITY_WITH_ACCNO_MAINTEXT: 'Please enter your PIN.',
                    LA_VERIFY_IDENTITY_WITH_ACCNO_SUBTEXT: 'Enter the four-digit PIN for either your ATM card, debit card or credit card. If you have a PIN that you only use with our automated phone system, you can use that here too.',
                    LA_VERIFY_IDENTITY_PIN_TEXT: 'PIN',
                    LA_VERIFY_IDENTITY_CARD_ACCNO_TEXT: 'Card or Account Number',
                    LA_VERIFY_IDENTITY_CREDITCARD_WITH_ACCNO_MAINTEXT: 'Please enter the following for the card ending in ',
                    LA_VERIFY_IDENTITY_CREDITCARD_CARDEND_TEXT: '',
                    LA_VERIFY_IDENTITY_ZIPCODE_TEXT: 'ZIP code',
                    LA_VERIFY_IDENTITY_CVV_TEXT: 'CVV',
                    LA_VERIFY_IDENTITY_SECURITYCODE_TEXT: 'Security code',
                    LA_VERIFY_IDENTITY_EXPIRATIONDATE_TEXT: 'Expiration date (mmyy)',
                    LA_VERIFY_IDENTITY_CREDITCARDNO_TEXT: 'Credit Card Number',
                    LA_VERIFY_IDENTITY_ACCOUNTNUMBER_TEXT: 'Account Number',
                    LA_VERIFY_IDENTITY_LLMW_ACCOUNT_WITH_ACCNO_MAINTEXT_MOBILE: 'Use the ZIP code associated with your account ending in ',
                    LA_VERIFY_IDENTITY_LLMW_ACCOUNT_WITH_ACCNO_MAINTEXT: 'Please enter the ZIP code associated with your account ending in  ',
                    LA_CARDORACCOUNT_REQUIRED_TEXT_VALIDATION: 'Please Enter Card Or Account Number',
                    LA_CREDITCARDNUMBER_REQUIRED_TEXT_VALIDATION: 'Please Enter Credit Card Number',
                    LA_ACCOUNTNUMBER_REQUIRED_TEXT_VALIDATION: 'Please Enter Account Number',
                    LA_PIN_VALIDATION: 'Hmm. We don\'t recognize that PIN, Please try again',
                    LA_ZIP_VALIDATION: 'Hmm. We don\'t recognize that ZIP, Please try again',


                    LA_O_DDAACCOUNT: 'DdaAccount',
                    LA_O_CCDACCOUNT: 'CcdAccount',
                    LA_O_LLLMWACCOUNT: 'LllmwAccount',
                    LA_O_DDAACCOUNTSYSTEMUNAVAILABLE: 'DdaAccountSystemUnavailable',
                    LA_O_DDAACCOUNTNOTENTEREDERROR: 'DdaAccountNotEnteredError',
                    LA_O_DDAACCOUNTFORMATERROR: 'DdaAccountFormatError',
                    LA_O_DDAACCOUNTFIRSTTIMEERROR: 'DdaAccountFirstTimeError',
                    LA_O_DDAACCOUNTSECONDTIMEERROR: 'DdaAccountSecondTimeError',
                    LA_O_DDAACCOUNTTHIRDTIMEERROR: 'DdaAccountThirdTimeError',
                    LA_O_DDAACCOUNTFOURTHTIMEERROR: 'DdaAccountFourthTimeError',
                    LA_O_DDAACCOUNTLOCKEDOUTERROR: 'DdaAccountLockedOutError',
                    LA_O_CCDACCOUNTSYSTEMUNAVAILABLE: 'CcdAccountSystemUnavailable',
                    LA_O_CCDACCOUNTVALIDATIONERROR: 'CcdAccountValidationError',
                    LA_O_CCDACCOUNTNOTENTEREDERROR: 'CcdAccountNotEnteredError',
                    LA_O_CCDACCOUNTCVVNOTENTEREDERROR: 'CcdAccountCvvNotEnteredError',
                    LA_O_CCDACCOUNTCVVFORMATERROR: 'CcdAccountCvvFormatError',
                    LA_O_CCDACCOUNTEXPIRATIONDATENOTENTEREDERROR: 'CcdAccountExpirationDateNotEnteredError',
                    LA_O_CCDACCOUNTEXPIRATIONDATEFORMATERROR: 'CcdAccountExpirationDateFormatError',
                    LA_O_CCDACCOUNTZIPNOTENTEREDERROR: 'CcdAccountZipNotEnteredError',
                    LA_O_CCDACCOUNTZIPFORMATERROR: 'CcdAccountZipFormatError',
                    LA_O_CCDACCOUNTFIRSTTIMEERROR: 'CcdAccountFirstTimeError',
                    LA_O_CCDACCOUNTSECONDTIMEERROR: 'CcdAccountSecondTimeError',
                    LA_O_CCDACCOUNTTHIRDTIMEERROR: 'CcdAccountThirdTimeError',
                    LA_O_CCDACCOUNTFOURTHTIMEERROR: 'CcdAccountFourthTimeError',
                    LA_O_CCDACCOUNTLOCKEDOUTERROR: 'CcdAccountLockedOutError',
                    LA_O_LLLMWACCOUNTSYSTEMUNAVAILABLE: 'LllmwAccountSystemUnavailable',
                    LA_O_LLLMWACCOUNTNOTENTEREDERROR: 'LllmwAccountNotEnteredError',
                    LA_O_LLLMWACCOUNTFORMATERROR: 'LllmwAccountFormatError',
                    LA_O_LLLMWACCOUNTFIRSTTIMEERROR: 'LllmwAccountFirstTimeError',
                    LA_O_LLLMWACCOUNTSECONDTIMEERROR: 'LllmwAccountSecondTimeError',
                    LA_O_LLLMWACCOUNTTHIRDTIMEERROR: 'LllmwAccountThirdTimeError',
                    LA_O_LLLMWACCOUNTFOURTHTIMEERROR: 'LllmwAccountFourthTimeError',
                    LA_O_LLLMWACCOUNTLOCKEDOUTERROR: 'LllmwAccountLockedOutError',
                    LA_O_SELECTACCOUNTSYSTEMUNAVAILABLE: 'SelectAccountSystemUnavailable',
                    LA_O_FOURTHTIMEPINERROROVERLAY: 'FourthTimePinErrorOverlay',
                    LA_O_FOURTHTIMECCDACCOUNTERROROVERLAY: 'FourthTimeCCDAccountErrorOverlay',
                    LA_O_FOURTHTIMELLLMWACCOUNTERROROVERLAY: 'FourthTimeLLLMWAccountErrorOverlay'
                },
                EnterIdInfoStatics: {
                    LA_RETRIEVE_PERSONALID_TITLE: 'Retrieve ID',
                    LA_ENTERIDINFO_TITLE: 'Tell us more about you.',
                    LA_ENTERBOTH_MAINTEXT: 'Please enter both.',
                    LA_PHONENUMBER_TEXT: 'Phone number',
                    LA_PHONENUMBER_TEXT_REBRAND: 'Phone',
                    LA_EMAILADDRESS_TEXT: 'Email address',
                    LA_EMAILADDRESS_TEXT_REBRAND: 'Email',
                    LA_CARDORACCOUNT_TEXT: 'Any card or account number',
                    LA_SSN_TEXT: 'Last 4 digits of SSN',
                    LA_PROFILENOTFOUND_STATUSCODE: 60070,
                    LA_PHONE_INVALID_TEXT_VALIDATION_M481: 'Please double-check your 10-digit phone number, and make sure you’re entering only numbers.',
                    LA_CARDORACCOUNT_INVALID_TEXT_VALIDATION_M330: 'Please double-check what you entered for the account number, and make sure you are entering only numbers.',
                    LA_O_PHONE: 'Phone',
                    LA_O_EMAIL: 'Email',
                    LA_O_ACCOUNT: 'Account',
                    LA_O_PHONESSNSYSTEMUNAVAILABLE: 'PhoneSsnSystemUnavailable',
                    LA_O_PHONESSNVALIDATIONERROR: 'PhoneSsnValidationError',
                    LA_O_PHONESSNFIRSTTIMEERROR: 'PhoneSsnFirstTimeError',
                    LA_O_PHONESSNSECONDTIMEERROR: 'PhoneSsnSecondTimeError',
                    LA_O_PHONESSNTHIRDTIMEERROR: 'PhoneSsnThirdTimeError',
                    LA_O_PHONESSNFOURTHTIMEERROR: 'PhoneSsnFourthTimeError',
                    LA_O_PHONESSNLOCKEDOUTERROR: 'PhoneSsnLockedOutError',
                    LA_O_EMAILSSNSYSTEMUNAVAILABLE: 'EmailSsnSystemUnavailable',
                    LA_O_EMAILSSNVALIDATIONERROR: 'EmailSsnValidationError',
                    LA_O_EMAILSSNFIRSTTIMEERROR: 'EmailSsnFirstTimeError',
                    LA_O_EMAILSSNSECONDTIMEERROR: 'EmailSsnSecondTimeError',
                    LA_O_EMAILSSNTHIRDTIMEERROR: 'EmailSsnThirdTimeError',
                    LA_O_EMAILSSNFOURTHTIMEERROR: 'EmailSsnFourthTimeError',
                    LA_O_EMAILSSNLOCKEDOUTERROR: 'EmailSsnLockedOutError',
                    LA_O_ACCOUNTSSNSYSTEMUNAVAILABLE: 'AccountSsnSystemUnavailable',
                    LA_O_ACCOUNTSSNVALIDATIONERROR: 'AccountSsnValidationError',
                    LA_O_ACCOUNTSSNFIRSTTIMEERROR: 'AccountSsnFirstTimeError',
                    LA_O_ACCOUNTSSNSECONDTIMEERROR: 'AccountSsnSecondTimeError',
                    LA_O_ACCOUNTSSNTHIRDTIMEERROR: 'AccountSsnThirdTimeError',
                    LA_O_ACCOUNTSSNFOURTHTIMEERROR: 'AccountSsnFourthTimeError',
                    LA_O_ACCOUNTSSNLOCKEDOUTERROR: 'AccountSsnLockedOutError',
                    LA_O_Multiple_MobileNumber: 'Multiple mobile number',
                    LA_O_MULTIPLEMOBILEERROR: 'MultipleMobileNumberError',
                    LA_O_Multiple_AccountNumber: 'Multiple account number',
                    LA_SSNHELP_TEXT: 'No SSN? That\'s okay! Contact customer service for assistance.',
                    LA_SSNHELP_TEXT_REBRAND: 'No Social Security number? Call 877.202.0043 for help.'
                },
                EnterBusinessIdInfoStatics: {
                    LA_ENTERIDINFO_TITLE: 'Enter Details',
                    LA_ENTERBUSINESSIDINFO_TITLE: 'Tell us more about you.',
                    LA_ENTERALL_MAINTEXT: 'Please enter all three.',
                    LA_CARDORACCOUNT_TEXT: 'Business account or card number',
                    LA_SSN_TEXT: 'Last 4 digits of personal SSN',
                    LA_TIN_TEXT: 'Last 4 digits of TIN',
                    LA_SSNHELP_TEXT: 'No SSN? That\'s okay! Contact customer service for assistance.',
                    LA_SSNHELP_TEXT_REBRAND: 'No Social Security number? Call 877.202.0043 for help.',
                    LA_TINHELP_TEXT: 'Sole proprietors: use the last 4 of your SSN.',
                    LA_O_ACCOUNT: 'Account',
                    LA_O_ACCOUNTSSNTINLOCKEDOUTERROR: 'AccountSsnTinLockedOutError',
                    LA_O_ACCOUNTSSNTINFIRSTTIMEERROR: 'AccountSsnTinFirstTimeError',
                    LA_O_ACCOUNTSSNTINSECONDTIMEERROR: 'AccountSsnTinSecondTimeError',
                    LA_O_ACCOUNTSSNTINTHIRDTIMEERROR: 'AccountSsnTinThirdTimeError',
                    LA_O_ACCOUNTSSNTINFOURTHTIMEERROR: 'AccountSsnTinFourthTimeError',
                    LA_O_ACCOUNTSSNTINSYSTEMUNAVAILABLE: 'AccountSsnTinSystemUnavailable',
                    LA_O_ACCOUNTSSNTINVALIDATIONERROR: 'AccountSsnTinValidationError'
                },
                EnterCodeStatics: {
                    LA_ENTERCODE_MAINTEXT: 'Please enter the one-time passcode we sent you. It will expire in 15 minutes.',
                    LA_ENTERCODE_MAINTEXT_RESEND: 'Please enter the one-time passcode we sent you. It will expire in 15 minutes.',
                    LA_6DIGITCODE_TEXT: '6-digit code',
                    LA_CODE_REQUIRED_TEXT_VALIDATION: 'Please Enter Code',
                    LA_O_ENTERCODE: 'EnterCode',
                    LA_O_ENTERCODESYSTEMUNAVAILABLE: 'EnterCodeSystemUnavailable',
                    LA_O_ENTERCODEOTPNOTENTEREDERROR: 'EnterCodeOtpNotEnteredError',
                    LA_O_ENTERCODEOTPFORMATERROR: 'EnterCodeOtpFormatError',
                    LA_O_ENTERCODEOTPEXPIREDERROR: 'EnterCodeOtpExpiredError',
                    LA_O_ENTERCODEOTPFIRSTTIMEERROR: 'EnterCodeOtpFirstTimeError',
                    LA_O_ENTERCODEOTPSECONDTIMEERROR: 'EnterCodeOtpSecondTimeError',
                    LA_O_ENTERCODEOTPLOCKEDOUTERROR: 'EnterCodeOtpLockedOutError',
                    LA_O_ENTERCODEOTPERROROVERLAY: 'EnterCodeOtpErrorOverLay',
                    LA_ENTERCODE_TITLE: 'Enter Code',
                    LA_OTPEXPIREDSTATUS: 212,
                    LA_ENTERCODENEWRESENDPASSCODE: 'A new passcode is on its way.',
                    ENROLLMENT_ENTER_CODE_6_DIGIT_INVALID_ERR_MSG: 'That doesn’t seem to be the right code. Try again.',
                    ENROLLMENT_ENTER_CODE_6_DIGIT_LAST_ATTEMPT_ERR_MSG: 'That’s still the wrong code. You’ll get one more try before you’re locked out.',
                    ENROLLMENT_ENTER_CODE_6_DIGIT_OTP_LOCK_OUT_ERR_MSG: 'Use general lock out screen.'


                },
                SelectAccountStatics: {
                    LA_SELECT_ACCOUNT_TITLE: 'Select Account',
                    LA_SELECT_ACCOUNT_MAINTEXT: 'Please select one of the following accounts.',
                    LA_CHOOSEONE_TEXT: ' Choose One',
                    LA_O_SELECTACCOUNT: 'SelectAccount',
                    LA_BROKERAGE_ACCT_BRANDING: 'U.S. Bancorp Investments'
                },
                ProfileNotFoundStatics: {
                    LA_PROFILE_NOT_FOUND_TITLE: 'Profile Not Found',
                    LA_PROFILE_NOT_FOUND_MAINTEXT: 'Sorry, we’re having trouble finding you. Let’s try something else.',
                    LA_CARDORACCOUNT_TEXT: 'Card or Account Number',
                    LA_CARDORACCOUNT_REQUIRED_TEXT_VALIDATION: 'Please enter Card Or Account Number',
                },
                //BEGIN - CI:Jan-2018, B-58349
                EnterTaxIdStatics: {
                    LA_ENTERTAXID_TITLE: 'Retrieve ID',
                    LA_ENTERTAXID_MAINTEXT: 'We need a bit more info to find your ID.',
                    LA_TAXIDNUMBER_TEXT: 'Tax ID number',
                    LA_TAXID_INVALID_TEXT_VALIDATION: 'Please Enter Valid Tax ID Number',
                },
                //END - CI:Jan-2018, B-58349
                PersonalIdStatics: {
                    LA_PERSONALID_TITLE: 'Personal ID',
                    LA_PERSONALID_MAINTEXT: 'Here’s your Personal ID.',
                    LA_PERSONALID_MAINTEXT_REBRAND: 'We found your Personal ID.',
                    LA_ENTEPASSWORD_TEXT: 'Enter password',
                    LA_FORGOTPASSWORD_TEXT: 'Forgot Password?',
                    LA_LOGINBUTTON: 'Log In',
                    LA_PASSWORD_MINCRITERIA_TEXT_VALIDATION_OLD: 'Passwords are 8-24 characters. Use letters and numbers.',
                    LA_PASSWORD_PASSWORDMATCH_TEXT_VALIDATION_M601: 'Please enter a password that is not the word \'password\'.',
                    LA_O_PERSONALID: 'PersonalId',
                    LA_O_PERSONALIDSYSTEMUNAVAILABLE: 'PersonalIdSystemUnavailable',
                    LA_O_PERSONALIDNOTENTEREDERROR: 'PersonalIdNotEnteredError',
                    LA_O_PERSONALIDFORMATERROR: 'PersonalIdFormatError',
                    LA_O_PILOTUSERPERSONALIDNOTENTEREDERROR: 'PilotUserPersonalIdNotEnteredError',
                    LA_O_PILOTUSERPERSONALIDFORMATERROR: 'PilotUserPersonalIdFormatError',
                    LA_PASSWORD_ERROR_MESSAGE_EXPIRED: 'Your temporary password expired. Please reset it below.',
                    LA_PASSWORD_ERROR_MESSAGE_M943: 'Incorrect password Remember: passwords are case sensitive.',
                    LA_PASSWORD_ERROR_MESSAGE_M895: 'Did you forget your password? That\'s okay; we can help.'
                },
                EnterPasswordStatics: {
                    LA_ENTERPASSWORD_TITLE: 'Enter Password',
                    LA_ENTEPASSWORD_TEXT: 'Password',
                    LA_FORGOTPASSWORD_TEXT: 'Forgot Password?',
                    LA_PASSWORD_REQUIRED_TEXT_VALIDATION: 'Please enter a password. Your password should include both letters and numbers and may also include special characters (such as %, $, &).',
                    LA_PASSWORD_MINCRITERIA_TEXT_VALIDATION_M648: 'Please re-enter a new password that\'s between 8 and 24 characters with no spaces. Your Password should include both letters and numbers and may also include special characters (such as %, $, &).',
                    LA_PASSWORD_PASSWORDMATCH_TEXT_VALIDATION_M601: 'Please enter a password that is not the word \'password\'.',
                    LA_O_ENTERPASSWORD: 'EnterPassword',
                    LA_ENTEPASSWORD_TEXT_REBRAND: 'Log in and we’ll take you to reset your ID Shield questions.',
                    LA_ENTEPASSWORD_TEXT_REDIRECT_AAPAGE: 'Log in to reset your authentication options.',
                    LA_O_ENTERPASSWORDSYSTEMUNAVAILABLE: 'EnterPasswordSystemUnavailable',
                    LA_O_ENTERPASSWORDNOTENTEREDERROR: 'EnterPasswordNotEnteredError',
                    LA_O_ENTERPASSWORDFORMATERROR: 'EnterPasswordFormatError',
                    LA_O_PILOTENTERPASSWORDNOTENTEREDERROR: 'EnterPasswordPilotNotEnteredError',
                    LA_O_PILOTENTERPASSWORDFORMATERROR: 'EnterPasswordPilotFormatError'
                },
                ResetPasswordStatics: {
                    LA_RESETPASSWORD_MAINTITLE: 'Let’s create a new password.',
                    LA_RESETPASSWORD_TITLE: 'Reset Password',
                    LA_RESETPASSWORD_PILOTUSER_MAINTEXT: 'Please create a new password that\'s between 8 and 24 characters with no spaces. Your password is case sensitive. It should include both letters and numbers and may also include special characters (such as %, $, &).',
                    LA_RESETPASSWORD_ALREADYVERIFIED_MAINTEXT: 'Forgot your password? You’re already verified.<br/>Please create a new password that\'s between 8 and 24 characters with no spaces. Your password should include both letters and numbers and may also include special characters (such as %, $, &).',
                    LA_RESETPASSWORD_MAINTEXT: 'Passwords should be between 8 and 24 characters with no spaces. You should include both letters and numbers and you can also include special characters, like % or $.',
                    LA_RESETPASSWORD_ALREADYVERIFIED_MAINTEXT_REBRAND: 'You’re already verified. Passwords should be between 8 and 24 characters with no spaces. You should include both letters and numbers and you can also include special characters, like % or $.',
                    LA_NEWPASSWORD_TEXT: 'New password',
                    LA_NEWPASSWORDAGAIN_TEXT: 'Re-enter new password',
                    LA_PASSWORD_RESET_MAINTEXT: 'You’ve reset your password.',
                    LA_CONTINUEBUTTON: 'Continue',
                    LA_LOG_IN: 'Log In',
                    LA_PASSWORD_MINCRITERIA_TEXT_VALIDATION_M648: 'Please re-enter a new password that\'s between 8 and 24 characters with no spaces. Your Password should include both letters and numbers and may also include special characters (such as %, $, &).',
                    LA_PASSWORD_PASSWORDMATCH_TEXT_VALIDATION_M601: 'Please enter a password that is not the word \'password\'.',
                    LA_EQUALSTOPASSWORD: 'equalsToPassword',
                    LA_EQUALSTOUSERID: 'equalsToUserId',
                    LA_VALIDPASSWORD: 'validPassword',
                    LA_WORDPASSWORD: 'password',
                    LA_O_RESETPASSWORD: 'ResetPassword',
                    LA_O_RESETPASSWORDCOMPLETE: 'ResetPasswordComplete',
                    LA_O_RESETPASSWORDSYSTEMUNAVAILABLE: 'ResetPasswordSystemUnavailable',
                    LA_O_RESETPASSWORDNOTENTEREDERROR: 'ResetPasswordNotEnteredError',
                    LA_O_RESETPASSWORDFORMATERROR: 'ResetPasswordFormatError',
                    LA_O_RESETPASSWORDSAMEASPERSONALIDERROR: 'ResetPasswordSameAsPersonalIdError',
                    LA_O_RESETPASSWORDWORDPASSWORDERROR: 'ResetPasswordWordPasswordError',
                    LA_O_RESETPASSWORDCURRENTPASSWORDERROR: 'ResetPasswordCurrentPasswordError',
                    LA_O_RESETPASSWORDDOESNOTMATCHERROR: 'ResetPasswordDoesNotMatchError',
                    LA_O_RESETPASSWORDCOMPLETEDSYSTEMUNAVAILABLE: 'ResetPasswordCompletedSystemUnavailable',
                    LA_EXISTINGPASSWORDSTATUS: 19,
                    LA_O_RESETPASSWORDPILOTNOINPUT: "ResetPasswordPilotNoInput",
                    LA_O_RESETPASSWORDPILOTDONOTMET: "ResetPasswordPilotDoNotMet",
                    LA_O_RESETPASSWORDPILOTSAMEASPERSONALID: "ResetPasswordPilotSameAsPersonalID",
                    LA_O_RESETPASSWORDPILOTWORDPASSWORD: "ResetPasswordPilotWordPassword",
                    LA_O_RESETPASSWORDPILOTCURRENTPASSWORD: "ResetPasswordPilotCurrentPassword",
                    LA_O_RESETPASSWORDPILOTDONOTMATCH: "ResetPasswordPilotDoNotMatch"
                },
                ResetCommonStatics: {
                    LA_RESETCOMMON_TITLE: 'Verify Identity',
                    LA_RESETCOMMON_GENERIC_RESETPASSWORD_TITLE: 'Reset Password',
                    LA_RESETCOMMON_GENERIC_RESETIDSHILD_TITLE: 'Reset Security Questions',
                    LA_RESETCOMMON_MAINTEXT: 'Please enter the last four digits of the Social Security Number on your account.',
                    LA_RESETCOMMON_MAINTEXT_REBRAND: 'What’s the Social Security number linked to this account?',
                    LA_RESETCOMMON_GENERIC_MAINTEXT: 'Help us find your profile.',
                    LA_ENTEPERSONALID_TEXT: 'Personal ID', //CI:Jan-2018, B-55885
                    LA_FORGOTPERSONALID_TEXT: 'Forgot Personal ID?',
                    LA_SSN_TEXT: 'Last 4 digits of SSN',
                    LA_PERSONALID_REQUIRED_TEXT_VALIDATION: 'Please Enter Personal ID.',
                    LA_SSN_REQUIRED_TEXT_VALIDATION: 'Please Enter Social Security Number.',
                    LA_INVALIDVCONTEXT_WRONGIDSHIELD_M907: 'For your security, your Personal ID has been locked. To access your account, you\'ll need to reset your security questions and answers.',
                    LA_INVALIDVCONTEXT_WRONGPASSWORD_M908: 'For your security, your account has been locked. Let\'s reset your password to access your account.',
                    LA_INVALIDVCONTEXT_WRONGPASSWORD_M895: 'Did you forget your password? That\'s okay; we can help.',
                    LA_O_RESETCOMMON: 'ResetCommon',
                    LA_O_RESETCOMMONSSNFIRSTTIMEERROR: 'ResetCommonSsnFirstTimeError',
                    LA_O_RESETCOMMONSSNSECONDTIMEERROR: 'ResetCommonSsnSecondTimeError',
                    LA_O_RESETCOMMONSSNTHIRDTIMEERROR: 'ResetCommonSsnThirdTimeError',
                    LA_O_RESETCOMMONSSNFOURTHTIMEERROR: 'ResetCommonSsnFourthTimeError',
                    LA_O_RESETCOMMONSSNLOCKEDOUTERROR: 'ResetCommonSsnLockedOutError',
                    LA_O_RESETCOMMONSYSTEMUNAVAILABLE: 'ResetCommonSystemUnavailable',
                    LA_O_RESETCOMMONSSNNOTENTEREDERROR: 'ResetCommonSsnNotEnteredError',
                    LA_O_RESETCOMMONSSNNONNUMERICERROR: 'ResetCommonSsnNonNumericError',
                    LA_O_RESETCOMMONSSNFORMATERROR: 'ResetCommonSsnFormatError',
                    LA_O_RESETCOMMONDIRECTEDLOCKEDOUT: 'ResetCommonDirectedLockedOut',
                    LA_SSNHELP_TEXT: 'No SSN? That\'s okay! Contact customer service for assistance.',
                    LA_O_RESETCOMMONWRONGSSNERROROVERLAY: 'ResetCommonWrongSSNErrorOverlay',
                    LA_SSNHELP_TEXT_REBRAND: 'No Social Security number? Call 877.202.0043 for help.',
                    LA_O_COMMON_ERROR_TEXT_VALIDATION_M881: 'Please enter missing details, or correct any errors.'
                },
                LAVerificationContext: {
                    LA_PERSONEL_ID: 'RetrieveMyPersonalID',
                    LA_ID_SHIELD: 'ResetMyIDShieldAnswers',
                    LA_PASSWORD: 'ResetMyPassword',
                    LA_GENERIC_LANDING: 'GenericLanding',
                    LA_CHANGEPASSWORD: 'ChangePassword'
                },
                ResetPasswordConfirmation: {
                    LA_OAUTHMODULE: "oauth", /// Keep it as lower case as "LA_GETAPPNAME_ACTION_URL" returns the result in lower case
                    LA_OAUTHMODULE_REDIRECTIONURL: "/Auth/oAuthLogin",
                    LA_REF_APP_NAME_ELEM: "#divAppName"
                }
            });
})();
;
(function () {
    'use strict';

    angular
        .module('LoginAssistantModule')
        .factory('LoginAssistantService', ['CommonService', 'CommonConstants', 'LoginAssistantConstants', '$compile', '$state', 'SiteCatService', '$injector', '$timeout', '$http', '$rootScope', LoginAssistantService]);

    function LoginAssistantService(commonService, commonConstants, LoginAssistantConstants, $compile, $state, siteCatService, $injector, $timeout, $http, $rootScope) {
        var userType;
        var idMethodType;
        var unHandledRejectionHandler;
        var MultipleAccountTypeforBack;
        var MultipleAccountSharedAccessforBack;
        var isProfileNotFound;
        var secureOptionType;
        var eligibleAccountsList;
        var verifyCustomerModel;
        var enterIdInfoDetails;
        var selectedAccount;
        var acctNumberLastFour;
        var isUserVerified = false;
        var isUserRedirectToPin;
        var loginAssistModel;
        var userIdentifier;
        var passwordText;
        var otpCache;
        var requestTypeCode;
        var LASTransmitToken;
        var sharedAccessAdmins;
        var sharedAccessAdminSelected;
        var isSharedAccessMultipleAdmin;
        var idAccountType;
        var multipleAccountType;
        var headingType;
        var ChangeMethodAfterFourAttempts;
        this.accountType = "";
        this.retrievalModes = {};
        this.userData = {};
        var AccountOption = {};
        var userInputData = {};
        var ResetCommonData = {};
        var UserDataToken;
        var isGenericLanding;
        var bbData = "";
        var ErrorMessage;
        var OTPValidationCount;
        var PinValidationCount;
        var MultipleMobileNumber;
        var ContinueWithPassword = false;
        var PersonalIDShield;
        var resetPassword = false;
        var resetpasswordflow = false;
        var ErrorCode;
        var UserFlow;
        var ContextData;
        var SessionID;
        var ChangePwd;
        var CancelURL;
        var Devices;
        // cancel mobile approve
        var cancelMobileApprove = false;
        var FsvUser = false;
        var FsvRedirectionFails = false;
        var FsvUsername;
        var FsvResponseNumber;
        var FSVGuid;
        var FSVReturnUrl;

        window.addEventListener("unhandledrejection", function (err, promise) {
            $rootScope.$broadcast('Exceptionhandle', err);
            event.preventDefault();
            if (err.reason._data) {
                if (err.reason._data.server_error_data) {
                    var err_msg = err.reason._data.server_error_data.failure_data.reason.data;
                    if (err_msg.action == "reject" && err_msg.code == 5 && err_msg.reason == "locked") {
                        $state.go(LoginAssistantConstants.LA_LOCKERROR);
                    }
                }
            }


        });
        return {
            setVoiceOverFocus: function (elementSelector, delay) {

                var _delay = delay ? delay : 0;
                $timeout(function () {
                    var element = document.getElementById(elementSelector);
                    //element.setAttribute('tabindex', '-1');

                    // element.setAttribute("ng-show", "true");

                    // element.blur();
                    $timeout(function () {
                        // element.focus();
                    }, _delay);
                }, _delay);
            },
            isMobileWeb: function () {
                var isTouch = false;
                var divTouch = document.getElementById('divIsTouch');

                if (typeof (divTouch) != 'undefined' && divTouch != null) {
                    isTouch = (document.getElementById('divIsTouch').innerText || document.getElementById('divIsTouch').textContent);
                }
                if (isTouch) {
                    var cookieValue = angular.element(document.getElementById("hiddUXName"))[0].value;
                    // Added desktop condition since UX cookie has desktop value in some scenario in TUX
                    if (cookieValue != "" && cookieValue != undefined && (cookieValue.toLowerCase() == "touch" || cookieValue.toLowerCase() == "desktop")) {
                        return true;
                    }
                }
                return false;
            },
            isIOSDevice: function () {
                var cookieValue = angular.element(document.getElementById("hiddUXName"))[0].value;
                if (cookieValue != "" && cookieValue != undefined && (cookieValue.toLowerCase() == "iphone" || cookieValue.toLowerCase() == "ipad")) {
                    return true;
                }
                return false;
            },
            removeVoiceOverFocus: function (elementSelector, delay) {
                var _delay = delay ? delay : 0;
                var element = document.getElementById(elementSelector);
                element.setAttribute("aria-hidden", "true");
                if (delay) {
                    $timeout(function () {
                        element.blur();
                    }, _delay);
                }
            },
            //get,set password for reset password confirmation page.  
            getPassword: function () {
                return passwordText;
            },
            setPassword: function (value) {
                passwordText = value;
            },
            getUserDataToken: function () {
                return UserDataToken;
            },
            setUserDataToken: function (value) {
                UserDataToken = value;
            },
            setHeaderFocus: function (id) {
                document.getElementById(id).focus();
            },
            //get,set Peronal or Business banking.  
            getUserType: function () {
                return userType;
            },
            setUserType: function (value) {
                userType = value;
            },
            //get,set Shared Access Admin.  
            getSelectedSharedAccessAdmin: function () {
                return sharedAccessAdminSelected;
            },
            setSelectedSharedAccessAdmin: function (value) {
                sharedAccessAdminSelected = value;
            },
            getIsSharedAccessMultipleAdmin: function () {
                return isSharedAccessMultipleAdmin;
            },
            setIsSharedAccessMultipleAdmin: function (value) {
                isSharedAccessMultipleAdmin = value;
            },
            setMultipleSharedAccessAdmins: function (value) {
                sharedAccessAdmins = value;
            },
            getMultipleSharedAccessAdmins: function (value) {
                return sharedAccessAdmins;
            },
            setMultipleAccountSharedAccessforBack: function (value) {
                MultipleAccountSharedAccessforBack = value;
            },
            getMultipleAccountSharedAccessforBack: function (value) {
                return MultipleAccountSharedAccessforBack;
            },
            //get,set Phone, Email, Any Card or AccountNumber.
            getIdMethodType: function () {
                return idMethodType;
            },
            setIdMethodType: function (value) {
                idMethodType = value;
            },

            //get,set send me code by text/email or Use Account number or pin. 
            getSecureOptionType: function () {
                return secureOptionType;
            },
            setSecureOptionType: function (value) {
                secureOptionType = value;
            },
            getIsProfileNotFound: function () {
                return isProfileNotFound;
            },
            getEligibleAccountsList: function () {
                return eligibleAccountsList;
            },
            setEligibleAccountsList: function (value) {
                eligibleAccountsList = value;
            },
            setIsProfileNotFound: function (value) {
                isProfileNotFound = value;
            },
            getVerifyCustomerModel: function () {
                return verifyCustomerModel;
            },
            setVerifyCustomerModel: function (value) {
                verifyCustomerModel = value;
            },
            getEnterIdInfoDetails: function () {
                return enterIdInfoDetails;
            },
            setEnterIdInfoDetails: function (value) {
                enterIdInfoDetails = value;
            },
            getSelectedAccount: function () {
                return selectedAccount;
            },
            setSelectedAccount: function (value) {
                selectedAccount = value;
            },
            getAcctNumberLastFour: function () {
                return acctNumberLastFour;
            },
            setAcctNumberLastFour: function (value) {
                acctNumberLastFour = value;
            },
            getIsUserVerified: function () {
                return isUserVerified;
            },
            setIsUserVerified: function (value) {
                return isUserVerified = value;
            },
            getLoginAssistModel: function () {
                return loginAssistModel;
            },
            setLoginAssistModel: function (value) {
                loginAssistModel = value;
            },
            getLASTransmitToken: function () {
                return LASTransmitToken;
            },
            setLASTransmitToken: function (value) {
                LASTransmitToken = value;
            },
            setOtpCache: function (value) {
                otpCache = value;
            },

            getOtpCache: function () {
                return otpCache;
            },

            setFsvUser: function (value) {
                FsvUser = value;
            },
            getFsvUser: function () {
                return FsvUser;
            },
            setFsvResponsePhoneNumber: function (value) {
                FsvResponseNumber = value;
            },
            getFsvResponsePhoneNumber: function () {
                return FsvResponseNumber;
            },
            setFSVGuid: function (value) {
                FSVGuid = value;
            },
            getFSVGuid: function () {
                return FSVGuid;
            },
            setFsvRedirectionFails: function (value) {
                FsvRedirectionFails = value;
            },
            getFsvRedirectionFails: function () {
                return FsvRedirectionFails;
            },
            setFsvUsername: function (value) {
                FsvUsername = value;
            },
            getFsvUsername: function () {
                return FsvUsername;
            },
            setFSVReturnUrl: function (value) {
                FSVReturnUrl = value;
            },
            getFSVReturnUrl: function () {
                return FSVReturnUrl;
            },
            //get set for cancel mobile approve
            getCancelMobileApprove: function () {
                return cancelMobileApprove;
            },
            setCancelMobileApprove: function (value) {
                cancelMobileApprove = value;
            },

            handleReturnUrl: function (returnUrl) {
                var isTouch = commonService.getIsTouch();
                if (isTouch.toLowerCase() === commonConstants.FALSE) {
                    window.location = returnUrl;
                }
                if (isTouch.toLowerCase() === commonConstants.TRUE) {
                    commonService.navigateBackToMobileReturnUrl(returnUrl);
                }
            },
            callEligibleAccountList: function (baseUrl, scope) {
                var method = commonConstants.METHOD_TYPE_POST;
                var url = baseUrl + LoginAssistantConstants.LA_ELIGIBLE_ACCOUNT_LIST_URL;
                var inputData = {
                };
                var headerData = commonConstants.HEADERDATA;

                commonService.result(method, url, inputData, headerData)
                    .success(function (result) {
                        if (result != null && result.EligibleAccountList != null) {
                            eligibleAccountsList = result;
                            if (!result.IsSavingsAccountExist && result.EligibleAccountList.length > 1) {
                                $state.go(LoginAssistantConstants.LA_SELECTACCOUNT);
                            } else {
                                selectedAccount = result.EligibleAccountList[0];
                                $state.go(LoginAssistantConstants.LA_VERIFYIDENTITYVIAACCOUNTNUMBERORPIN);
                            }
                        } else {
                            scope.$broadcast(LoginAssistantConstants.LA_COMMON_ERRORMESSAGE_ID, LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M618);
                        }

                    }).error(function () {
                        scope.$broadcast(LoginAssistantConstants.LA_COMMON_ERRORMESSAGE_ID, LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M618);
                    });
            },
            populateEligibleAccountList: function (baseUrl, scope) {
                var method = commonConstants.METHOD_TYPE_POST;
                var url = baseUrl + LoginAssistantConstants.LA_ELIGIBLE_ACCOUNT_LIST_URL;
                var inputData = {
                };
                var headerData = commonConstants.HEADERDATA;

                commonService.result(method, url, inputData, headerData)
                    .success(function (result) {
                        eligibleAccountsList = result;
                    }).error(function () {
                        scope.$broadcast(LoginAssistantConstants.LA_COMMON_ERRORMESSAGE_ID, LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M618);
                    });
            },
            setIsUserRedirectToPin: function (value) {
                isUserRedirectToPin = value;
            },
            getIsUserRedirectToPin: function () {
                return isUserRedirectToPin;
            },
            RedirectToCCAPWEB: function (urlPath, functionName, returnUrl, olbLoginAssitanceUrl, keepAliveUrl, logOutUrl) {
                var params = {
                    AccountIndex: '',
                    AccountType: '' //,
                    //Olbloginassitanceurl: olbLoginAssitanceUrl
                };

                var form = document.createElement("form");
                var functionToCall = functionName;

                form.setAttribute("method", "post");
                form.setAttribute("action", urlPath);
                var accountType = "";

                var hdFunctionName = document.createElement("input");
                hdFunctionName.setAttribute("type", "hidden");
                hdFunctionName.setAttribute("name", "FunctionName");
                hdFunctionName.setAttribute("value", functionToCall);

                var hdReturnurl = document.createElement("input");
                hdReturnurl.setAttribute("type", "hidden");
                hdReturnurl.setAttribute("name", "Returnurl");
                hdReturnurl.setAttribute("value", returnUrl);

                var hdKeepaliveurl = document.createElement("input");
                hdKeepaliveurl.setAttribute("type", "hidden");
                hdKeepaliveurl.setAttribute("name", "Keepaliveurl");
                hdKeepaliveurl.setAttribute("value", keepAliveUrl);

                var hdTimeout = document.createElement("input");
                hdTimeout.setAttribute("type", "hidden");
                hdTimeout.setAttribute("name", "Timeout");
                hdTimeout.setAttribute("value", "1000");

                var hdLogouturl = document.createElement("input");
                hdLogouturl.setAttribute("type", "hidden");
                hdLogouturl.setAttribute("name", "Logouturl");
                hdLogouturl.setAttribute("value", logOutUrl);

                var customerSegmentTypeCode = "";
                var hdCustomerSegmentType = document.createElement("input");
                hdCustomerSegmentType.setAttribute("type", "hidden");
                hdCustomerSegmentType.setAttribute("name", "CustomerTypeCode");
                hdCustomerSegmentType.setAttribute("value", customerSegmentTypeCode);
                //START : B-32752 Upgrade ForeSee Code Package to v19.3.3
                var olbloginassitanceurl = "LAResetAnswers";
                var hdOlbloginassitanceurl = document.createElement("input");
                hdOlbloginassitanceurl.setAttribute("type", "hidden");
                hdOlbloginassitanceurl.setAttribute("name", "Olbloginassitanceurl");
                hdOlbloginassitanceurl.setAttribute("value", olbloginassitanceurl);
                //END : B-32752 Upgrade ForeSee Code Package to v19.3.3
                form.appendChild(hdFunctionName);
                form.appendChild(hdReturnurl);
                form.appendChild(hdKeepaliveurl);
                form.appendChild(hdTimeout);
                form.appendChild(hdLogouturl);
                form.appendChild(hdCustomerSegmentType);
                form.appendChild(hdOlbloginassitanceurl);//B-32752 Upgrade ForeSee Code Package to v19.3.3 change

                //for all other parameters we can use this logic
                for (var key in params) {
                    if (params.hasOwnProperty(key)) {
                        if (key != undefined && key.length > 0) {
                            var value = params[key];
                            if (key == "AccountType" || value != undefined && value != "") {
                                var hiddenField = document.createElement("input");
                                hiddenField.setAttribute("type", "hidden");
                                hiddenField.setAttribute("name", key);
                                if (key == "AccountType") {
                                    hiddenField.setAttribute("value", accountType);
                                } else {
                                    hiddenField.setAttribute("value", value);
                                }
                                form.appendChild(hiddenField);
                            }
                        }
                    }
                }
                // if (openInNewWindow != undefined && openInNewWindow === true)
                //     form.target = "_self";
                document.body.appendChild(form);
                form.submit();
                document.body.removeChild(form);
            },

            CallSiteCatService: function (vContext, eventName, dynamicVars) {
                switch (vContext) {
                    case LoginAssistantConstants.LAVerificationContext.LA_PERSONEL_ID:
                        var omniturePageName = userType === LoginAssistantConstants.LA_PERSONAL_BANKING ?
                            LoginAssistantConstants.LA_O_RETRIEVEPERSONALID : LoginAssistantConstants.LA_O_RETRIEVEBUSINESSID;
                        siteCatService.SiteCatTCall(omniturePageName, eventName, dynamicVars);
                        break;
                    case LoginAssistantConstants.LAVerificationContext.LA_PASSWORD:
                        siteCatService.SiteCatTCall(LoginAssistantConstants.LA_O_RESETPASSWORD, eventName, dynamicVars);
                        break;
                    case LoginAssistantConstants.LAVerificationContext.LA_ID_SHIELD:
                        siteCatService.SiteCatTCall(LoginAssistantConstants.LA_O_RESETIDSHIELD, eventName, dynamicVars);
                        break;
                    case LoginAssistantConstants.LA_O_RETRIEVEID:
                        siteCatService.SiteCatTCall(LoginAssistantConstants.LA_O_RETRIEVEID, eventName, dynamicVars);
                        break;
                    case LoginAssistantConstants.LA_GENERIC_LANDING:
                        siteCatService.SiteCatTCall(LoginAssistantConstants.LA_GENERIC_LANDING, eventName, dynamicVars);
                        break;
                }
            },
            CallSiteCatTLService: function (eventName, dynamicVars) {
                siteCatService.SiteCatTLCall(LoginAssistantConstants.LA_SITECAT_PAGENAME_RESENDBUTTON, eventName, dynamicVars);
            },
            CallSiteCatServiceForSystemUnavailableMessage: function (errorMessage, vContext, eventName, dynamicVars) {
                if (errorMessage == LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M618) {
                    switch (vContext) {
                        case LoginAssistantConstants.LAVerificationContext.LA_PASSWORD:
                            siteCatService.SiteCatTCall(LoginAssistantConstants.LA_O_RESETPASSWORD, eventName, dynamicVars);
                            break;
                        case LoginAssistantConstants.LAVerificationContext.LA_PERSONEL_ID:
                            var omniturePageName = userType === LoginAssistantConstants.LA_PERSONAL_BANKING ?
                                LoginAssistantConstants.LA_O_RETRIEVEPERSONALID : LoginAssistantConstants.LA_O_RETRIEVEBUSINESSID;
                            siteCatService.SiteCatTCall(omniturePageName, eventName, dynamicVars);
                            break;
                        case LoginAssistantConstants.LAVerificationContext.LA_ID_SHIELD:
                            siteCatService.SiteCatTCall(LoginAssistantConstants.LA_O_RESETIDSHIELD, eventName, dynamicVars);
                            break;
                    }
                }
            },
            CallSiteCatServiceForLockedOutOrExpiredMessage: function (vContext, eventName) {
                switch (vContext) {
                    case LoginAssistantConstants.LAVerificationContext.LA_PASSWORD:
                        siteCatService.SiteCatTCall(LoginAssistantConstants.LA_O_RESETPASSWORD, eventName);
                        break;
                    case LoginAssistantConstants.LAVerificationContext.LA_PERSONEL_ID:
                        var omniturePageName = userType === LoginAssistantConstants.LA_PERSONAL_BANKING ?
                            LoginAssistantConstants.LA_O_RETRIEVEPERSONALID : LoginAssistantConstants.LA_O_RETRIEVEBUSINESSID;
                        siteCatService.SiteCatTCall(omniturePageName, eventName);
                        break;
                    case LoginAssistantConstants.LAVerificationContext.LA_ID_SHIELD:
                        siteCatService.SiteCatTCall(LoginAssistantConstants.LA_O_RESETIDSHIELD, eventName);
                        break;
                }
            },
            CallSiteCatServiceForPageErrorMessage: function (vContext, failedAttemptCount, firstTimeErrorEvent, secondTimeErrorEvent, thirdTimeErrorEvent,
                fourthTimeErrorEvent, dynamicVars) {
                switch (vContext) {
                    case LoginAssistantConstants.LAVerificationContext.LA_PASSWORD:
                        switch (failedAttemptCount) {
                            case 1:
                                siteCatService.SiteCatTCall(LoginAssistantConstants.LA_O_RESETPASSWORD, firstTimeErrorEvent, dynamicVars);
                                break;
                            case 2:
                                siteCatService.SiteCatTCall(LoginAssistantConstants.LA_O_RESETPASSWORD, secondTimeErrorEvent, dynamicVars);
                                break;
                            case 3:
                                siteCatService.SiteCatTCall(LoginAssistantConstants.LA_O_RESETPASSWORD, thirdTimeErrorEvent, dynamicVars);
                                break;
                            case 4:
                                siteCatService.SiteCatTCall(LoginAssistantConstants.LA_O_RESETPASSWORD, fourthTimeErrorEvent, dynamicVars);
                                break;
                        }
                        break;
                    case LoginAssistantConstants.LAVerificationContext.LA_PERSONEL_ID:
                        var omniturePageName = userType === LoginAssistantConstants.LA_PERSONAL_BANKING ?
                            LoginAssistantConstants.LA_O_RETRIEVEPERSONALID : LoginAssistantConstants.LA_O_RETRIEVEBUSINESSID;
                        switch (failedAttemptCount) {
                            case 1:
                                siteCatService.SiteCatTCall(omniturePageName, firstTimeErrorEvent, dynamicVars);
                                break;
                            case 2:
                                siteCatService.SiteCatTCall(omniturePageName, secondTimeErrorEvent, dynamicVars);
                                break;
                            case 3:
                                siteCatService.SiteCatTCall(omniturePageName, thirdTimeErrorEvent, dynamicVars);
                                break;
                            case 4:
                                siteCatService.SiteCatTCall(omniturePageName, fourthTimeErrorEvent, dynamicVars);
                                break;
                        }
                        break;

                    case LoginAssistantConstants.LAVerificationContext.LA_ID_SHIELD:
                        switch (failedAttemptCount) {
                            case 1:
                                siteCatService.SiteCatTCall(LoginAssistantConstants.LA_O_RESETIDSHIELD, firstTimeErrorEvent, dynamicVars);
                                break;
                            case 2:
                                siteCatService.SiteCatTCall(LoginAssistantConstants.LA_O_RESETIDSHIELD, secondTimeErrorEvent, dynamicVars);
                                break;
                            case 3:
                                siteCatService.SiteCatTCall(LoginAssistantConstants.LA_O_RESETIDSHIELD, thirdTimeErrorEvent, dynamicVars);
                                break;
                            case 4:
                                siteCatService.SiteCatTCall(LoginAssistantConstants.LA_O_RESETIDSHIELD, fourthTimeErrorEvent, dynamicVars);
                                break;
                        }
                        break;
                }
            },
            // CI B-55052 Changes Start
            CallSiteCatServiceForOverlayErrorMessage: function (vContext, fourthTimeErrorEvent, dynamicVars) {
                switch (vContext) {
                    case LoginAssistantConstants.LAVerificationContext.LA_PASSWORD:
                        siteCatService.SiteCatTCall(LoginAssistantConstants.LA_O_RESETPASSWORD, fourthTimeErrorEvent, dynamicVars);
                        break;

                    case LoginAssistantConstants.LAVerificationContext.LA_PERSONEL_ID:
                        var omniturePageName = userType === LoginAssistantConstants.LA_PERSONAL_BANKING ?
                            LoginAssistantConstants.LA_O_RETRIEVEPERSONALID : LoginAssistantConstants.LA_O_RETRIEVEBUSINESSID;
                        siteCatService.SiteCatTCall(omniturePageName, fourthTimeErrorEvent, dynamicVars);
                        break;

                    case LoginAssistantConstants.LAVerificationContext.LA_ID_SHIELD:
                        siteCatService.SiteCatTCall(LoginAssistantConstants.LA_O_RESETIDSHIELD, fourthTimeErrorEvent, dynamicVars);
                        break;
                }
            },
            // CI B-55052 Changes End
            getUserIdentifier: function () {
                return userIdentifier;
            },
            setUserIdentifier: function (value) {
                userIdentifier = value;
            },
            checkSharedAuthPilotUser: function () {
                var method = commonConstants.METHOD_TYPE_GET;
                var rootUrl = document.querySelector(commonConstants.ROOT_URL_DIV_TEXT);
                var baseUrl = rootUrl.textContent || rootUrl.innerText;
                return $http({
                    method: method,
                    headers: {
                        'Content-Type': 'application/json'
                    },
                    url: baseUrl + LoginAssistantConstants.LA_CHECK_SHARED_AUTH_PILOT,
                    data: {}
                });
            },
            showRedirectPopUp: function (redirectToPage) {
                var modalObj = {};
                var openModalService = $injector.get('OpenModalService');
                var modalInstanceCtrl = ['$scope', '$modalInstance', 'LoginAssistantService', function ($scope, $modalInstance, LoginAssistantService) {


                    //$modalInstance.opened.then(function () {
                    //    setTimeout(function () {

                    //        if (angular.element(document.getElementById("are-you-sure-user-id"))) {
                    //            angular.element(document.getElementById("are-you-sure-user-id")).focus();
                    //        }

                    //    }, 400);
                    //}); 

                    $scope.otpRedirect_Continue = function () {
                        document.getElementsByClassName("mainBodyWidth")[0].setAttribute("aria-hidden", "false");
                        var inputs = angular.element(document.querySelector('body').querySelectorAll('input'));
                        var links = angular.element(document.querySelector('body').querySelectorAll('a'));
                        var headings = angular.element(document.querySelector('body').querySelectorAll('h1'));
                        var headingsh2 = angular.element(document.querySelector('body').querySelectorAll('h2'));
                        angular.forEach(headings, function (v) {
                            v.setAttribute('aria-hidden', 'false'); v.setAttribute('tabindex', '0');
                        });
                        angular.forEach(headingsh2, function (v) {
                            v.setAttribute('aria-hidden', 'false'); v.setAttribute('tabindex', '0');
                        });
                        angular.forEach(inputs, function (v) {
                            v.setAttribute('aria-hidden', 'false'); v.setAttribute('tabindex', '0');
                        });
                        angular.forEach(links, function (v) {
                            v.setAttribute('aria-hidden', 'false'); v.setAttribute('tabindex', '0');
                        });
                        $modalInstance.close();
                        if (redirectToPage == "PIN") {
                            var rootUrl = document.querySelector(commonConstants.ROOT_URL_DIV_TEXT);
                            var baseUrl = rootUrl.textContent || rootUrl.innerText;
                            LoginAssistantService.callEligibleAccountList(baseUrl, $scope);
                        }
                        else if (redirectToPage == "OTP") {
                            $state.go(LoginAssistantConstants.LA_VERIFYIDENTITYVIATEXTOREMAIL);
                        }
                    };

                    $scope.closePopup = function () {
                        document.getElementsByClassName("mainBodyWidth")[0].setAttribute("aria-hidden", "false");
                        var inputs = angular.element(document.querySelector('body').querySelectorAll('input'));
                        var links = angular.element(document.querySelector('body').querySelectorAll('a'));
                        var headings = angular.element(document.querySelector('body').querySelectorAll('h1'));
                        var headingsh2 = angular.element(document.querySelector('body').querySelectorAll('h2'));
                        angular.forEach(headings, function (v) {
                            v.setAttribute('aria-hidden', 'false'); v.setAttribute('tabindex', '0');
                        });
                        angular.forEach(headingsh2, function (v) {
                            v.setAttribute('aria-hidden', 'false'); v.setAttribute('tabindex', '0');
                        });
                        angular.forEach(inputs, function (v) {
                            v.setAttribute('aria-hidden', 'false'); v.setAttribute('tabindex', '0');
                        });
                        angular.forEach(links, function (v) {
                            v.setAttribute('aria-hidden', 'false'); v.setAttribute('tabindex', '0');
                        });
                        $modalInstance.close();
                        document.getElementById("ContinueButton").focus();
                    };

                    $modalInstance.opened.then(function () {
                        document.getElementsByClassName("mainBodyWidth")[0].setAttribute("aria-hidden", "true");
                        var inputs = angular.element(document.querySelector('body').querySelectorAll('input'));
                        var links = angular.element(document.querySelector('body').querySelectorAll('a'));
                        var headings = angular.element(document.querySelector('body').querySelectorAll('h1'));
                        var headingsh2 = angular.element(document.querySelector('body').querySelectorAll('h2'));
                        angular.forEach(headings, function (v) {
                            v.setAttribute('aria-hidden', 'true'); v.setAttribute('tabindex', '-1');
                        });
                        angular.forEach(headingsh2, function (v) {
                            v.setAttribute('aria-hidden', 'true'); v.setAttribute('tabindex', '-1');
                        });
                        angular.forEach(inputs, function (v) {
                            v.setAttribute('aria-hidden', 'true'); v.setAttribute('tabindex', '-1');
                        });
                        angular.forEach(links, function (v) {
                            v.setAttribute('aria-hidden', 'true'); v.setAttribute('tabindex', '-1');
                        });
                        setTimeout(function () {
                            if (document.getElementById("areYouSureUserModal")) {
                                document.getElementById("areYouSureUserModal").parentElement.parentElement.className = "";
                                document.getElementById("areYouSureUserModal").parentElement.parentElement.parentElement.className = "";
                                document.getElementById("are-you-sure-user-id").focus();
                            }
                        }, 100);
                        //setTimeout(function () {
                        //    if (document.getElementById("areYouSureUserModal"))
                        //    {
                        //        document.getElementById("overlayContinueButton").focus();
                        //    }
                        //}, 1500);
                    });
                }];
                modalObj.templateUrl = "areYouSureUser.html";
                openModalService.popup(modalInstanceCtrl, modalObj, "static");
            },
            setRequestTypeCode: function (value) {
                requestTypeCode = value;
            },
            getRequestTypeCode: function () {
                return requestTypeCode;
            },

            /*New Codes*/
            getRetrievalModes: function () {
                return this.retrievalModes;
            },
            getAccountType: function () {
                return this.accountType;
            },
            setRetrievalModes: function (value) {
                this.retrievalModes = value;
            },
            setAccountType: function (value) {
                this.accountType = value;
                idAccountType = value;
            },
            getMultipleAccountType: function () {
                return multipleAccountType;
            },
            setMultipleAccountType: function (value) {
                multipleAccountType = value;
            },
            getMultipleAccountTypeforBack: function () {
                return MultipleAccountTypeforBack;
            },
            setMultipleAccountTypeforBack: function (value) {
                MultipleAccountTypeforBack = value;
            },
            getheadingType: function () {
                return this.headingType;
            },
            setheadingType: function (value) {
                this.headingType = value;
            },
            getContextData: function () {
                return this.ContextData;
            },
            setContextData: function (value) {
                this.ContextData = value;
            },
            getSessionID: function () {
                return this.SessionID;
            },
            setSessionID: function (value) {
                this.SessionID = value;
            },
            invokeLoginAssistPolicy: function (userID) {
                this.invokeLogout();
                return new Promise(function (resolve, reject) {
                    reqXmJs(['jquery', 'xmsdk', 'xmui'], function ($, xm, xmui) {
                        var transmitSDK = xm.XmSdk();
                        var connectionSettings = com.ts.mobile.sdk.SDKConnectionSettings.create("/Proxy/TS", "web");
                        var channel = commonService.getIsTouch().toLowerCase() == "true" ? "MOBILE_WEB" : "WEB";
                        var PolicyParams = { "Channel": channel };
                        transmitSDK.setConnectionSettings(connectionSettings);
                        function MyUIHandler() {
                            xmui.XmUIHandler.call(this);
                        }
                        MyUIHandler.prototype = Object.create(xmui.XmUIHandler.prototype);
                        MyUIHandler.prototype.constructor = MyUIHandler;
                        var uiHandler = new MyUIHandler();
                        transmitSDK.setUiHandler(uiHandler);

                        transmitSDK.initialize().then(function () {
                            if (userID) {
                                transmitSDK.authenticate(userID, "login_assistant", PolicyParams, {})
                                    .then(function (successfulAuth) {
                                        resolve(successfulAuth);
                                        $rootScope.$broadcast("resetpwdNavigation", successfulAuth);
                                    })
                                    .catch(function (err) {
                                        console.log('Authentication error: ' + err.toString());
                                    });
                            } else {

                                // get username, then invoke authenticate
                            }
                        });

                    });
                }).catch(function (e) {
                    // console.log(e);
                });
            },



            invokeLogout: function () {
                return new Promise(function (resolve, reject) {
                    reqXmJs(['jquery', 'xmsdk', 'xmui'], function ($, xm, xmui) {
                        var transmitSDK = xm.XmSdk();
                        var connectionSettings = com.ts.mobile.sdk.SDKConnectionSettings.create("/Proxy/TS", "web");
                        transmitSDK.setConnectionSettings(connectionSettings);
                        transmitSDK.initialize().then(function () {
                            transmitSDK.logout().then(function (response) {
                                // console.log(response);
                            }).catch(function (response) {
                                // console.log(response);
                            });
                        });
                    });
                }).catch(function (e) {
                    // console.log(e);
                });
            },
            invokeForgotPasswordPolicy: function () {

                return new Promise(function (resolve, reject) {
                    reqXmJs(['jquery', 'xmsdk', 'xmui'], function ($, xm, xmui) {
                        var transmitSDK = xm.XmSdk();
                        var connectionSettings = com.ts.mobile.sdk.SDKConnectionSettings.create("/Proxy/TS", "web");
                        var UserName = userIdentifier;
                        var PolicyId = "reset_passwd";
                        var blackboxdata = "BlackboxData";
                        if (bbData) {
                            blackboxdata = bbData ? bbData : "BlackboxData";
                        }
                        var channel = commonService.getIsTouch().toLowerCase() == "true" ? "MOBILE_WEB" : "WEB";
                        var PolicyParams = { "BlackBoxData": blackboxdata, "token": UserDataToken, "pid": "forgot_password", "branch_flow": ChangePwd, "Channel": channel };
                        var clientContext = { "clientContext": "clientContext" };
                        transmitSDK.setConnectionSettings(connectionSettings);
                        transmitSDK.initialize().then(function () {
                            if (UserName) {
                                transmitSDK.invokePolicy(PolicyId, PolicyParams, clientContext).then(function (successfulAuth) {
                                    resolve(successfulAuth);
                                    $rootScope.$broadcast("forgetPasswordflowdata", successfulAuth);
                                }).catch(function (e) {
                                    //console.log(e);
                                });

                            }
                        }).catch(function (e) {
                            // console.log("failed to initialize sdk");
                        });
                        function LASUIHandler() {
                            xmui.XmUIHandler.call(this);
                        }
                        LASUIHandler.prototype = Object.create(xmui.XmUIHandler.prototype);
                        LASUIHandler.prototype.constructor = LASUIHandler;
                        var uiHandler = new LASUIHandler();
                        transmitSDK.setUiHandler(uiHandler);
                        LASUIHandler.prototype.processJsonData = function (jsonData, actionContext, clientContext) {
                            $rootScope.$broadcast("AccountRetrievalvalidation", jsonData);
                            return Promise.resolve(dummyJsonDataProcess);
                        }
                        var dummyJsonDataProcess = {
                            getContinueProcessing: function () {
                                return true;
                            }
                        };
                        LASUIHandler.prototype.startActivityIndicator = function (actionContext, clientContext) {
                            $("#spinner").show();

                        }
                        LASUIHandler.prototype.endActivityIndicator = function (actionContext, clientContext) {
                            $("#spinner").hide();

                        }
                        LASUIHandler.prototype.shouldIncludeDisabledAuthenticatorsInMenu = function (actionContext, clientContext) {
                            return false;

                        }
                        LASUIHandler.prototype.controlOptionForCancellationRequestInSession = function (validOptions, session) {
                            //var container = XmUIHandler.getContainer(session.clientContext);
                            return new Promise(function (resolve, reject) {
                                var list = $('#changeAuth').parent().parent();
                                validOptions.forEach(function (option) {
                                    var requestType = com.ts.mobile.sdk.ControlRequestType[option];

                                    var text = document.createTextNode(requestType);
                                    var listItem = document.createElement("li");
                                    listItem.appendChild(text);
                                    listItem.onclick = function () {
                                        resolve(com.ts.mobile.sdk.ControlRequest.create(option));
                                    }
                                    list.append(listItem);
                                });
                                //container.appendChild(list);
                            });
                        }
                        LASUIHandler.prototype.createFormSession = function (formId, payload) {
                            var tsPayload = payload;
                            function FormSession(formId, payload, common) {
                                this.formId = formId;
                                this.payload = payload;
                                this.common = common;
                            }
                            LASUIHandler.prototype.handlePolicyRejection = function (title, text, buttonText, failureData, actionContext, clientContext) {
                                var errReason = {};
                                errReason.reject = (((failureData || {}).reason || {}).data || {}).code
                                errReason.locked = (((failureData || {}).reason || {}).data || {}).locked;
                                $rootScope.$broadcast("ExceptionhandlePolicyRejection", failureData);

                            }
                            LASUIHandler.prototype.handlePolicyRedirect = function (redirectType, policyId, userId, additionalParameters, clientContext) {
                                return Promise.resolve(com.ts.mobile.sdk.RedirectInput.create(com.ts.mobile.sdk.RedirectResponseType.RedirectToPolicy));
                            }
                            $rootScope.$broadcast("ResetpasswordFlow", payload);
                            FormSession.prototype.getContainer = function (clientContext) {
                                return xmui.XmUIHandler.getContainer(clientContext);
                            };
                            FormSession.prototype.startSession = function (clientContext, actionContext) {
                                this.actionContext = actionContext;
                                this.clientContext = clientContext;
                            };
                            FormSession.prototype.promiseFormInput = function () {
                                return new Promise(function (resolve, reject) {
                                    $rootScope.$broadcast("RenderRetrieveMode", tsPayload);
                                    $("input.button").click(function () {
                                        var inputData = userInputData;
                                        var data = {
                                            "data": {
                                                "newPassword": inputData.newPassword
                                            }
                                        };

                                        // console.log(data);
                                        var formInput = com.ts.mobile.sdk.FormInput.createFormInputSubmissionRequest(data);
                                        resolve(formInput);
                                    });

                                    $rootScope.$on('resetFormInput', function (event, data) {
                                        var formInput = com.ts.mobile.sdk.FormInput.createFormInputSubmissionRequest("");
                                        resolve(formInput);
                                    });

                                });
                            };
                            FormSession.prototype.onContinue = function (payload) {

                            };
                            FormSession.prototype.onError = function (payload) {
                                $rootScope.$broadcast("ErrorMessageDisplay", payload);

                            };
                            FormSession.prototype.endSession = function () {
                            };
                            return new FormSession(formId, payload, this.common);
                        };
                        LASUIHandler.prototype.createMobileApproveAuthSession = function (title, username, instructions) {
                            function MobileApproveAuthenticatorSession(title, username, instructions, common) {
                                this.title = title;
                                this.username = username;
                                this.instructions = instructions;
                                this.common = common;
                                this.pollingIntervalMillis = 5000;
                            }
                            var MobileApproveAuthenticationState;
                            (function (MobileApproveAuthenticationState) {
                                MobileApproveAuthenticationState[MobileApproveAuthenticationState["TargetSelection"] = 0] = "TargetSelection";
                                MobileApproveAuthenticationState[MobileApproveAuthenticationState["PollingRequested"] = 1] = "PollingRequested";
                                MobileApproveAuthenticationState[MobileApproveAuthenticationState["PollingStarted"] = 2] = "PollingStarted";
                            })(MobileApproveAuthenticationState || (MobileApproveAuthenticationState = {}));
                            //var MobileApproveAuthenticatorSession = (function (_super) {
                            //  __extends(MobileApproveAuthenticatorSession, _super);
                            /*function MobileApproveAuthenticatorSession(title, username, instructions, common) {
                                  var _this = _super.call(this, title, username, common) || this;
                                  _this.state = MobileApproveAuthenticationState.TargetSelection;
                                  _this.pollingIntervalMillis = 3000;
                                  _this.instructions = instructions;
                                  return _this;
                              }*/
                            MobileApproveAuthenticatorSession.prototype.setPollingIntervalInMillis = function (millis) {
                                this.pollingIntervalMillis = millis;
                            };
                            MobileApproveAuthenticatorSession.prototype.setCreatedApprovalInfo = function (targets, otp) {
                                if (targets != null) {
                                    this.createdForTargets = targets;
                                    this.otp = otp;
                                    this.state = MobileApproveAuthenticationState.PollingRequested;
                                }
                                else {
                                    this.createdForTargets = null;
                                    this.otp = null;
                                    this.state = MobileApproveAuthenticationState.TargetSelection;
                                    clearTimeout(this.pollingTimer);
                                    this.hidePendingUi();
                                }
                            };
                            MobileApproveAuthenticatorSession.prototype.setAvailableTargets = function (targets) {
                                this.availableTargets = targets;
                            };
                            MobileApproveAuthenticatorSession.prototype.startSession = function (description, mode, actionContext, clientContext) {
                                this.description = description;
                                this.mode = mode;
                                this.actionContext = actionContext;
                                this.clientContext = clientContext;
                            };
                            MobileApproveAuthenticatorSession.prototype.endSession = function () {
                                this.common.clearContainer(this.clientContext);
                                clearTimeout(this.pollingTimer);
                            };
                            MobileApproveAuthenticatorSession.prototype.promiseInput = function () {
                                var _this = this;
                                switch (this.mode) {
                                    case com.ts.mobile.sdk.AuthenticatorSessionMode.Authentication:
                                        this.common.setAriaBusy(this.clientContext);
                                        console.log("Fetching Mobile Approve authentication input;");
                                        switch (this.state) {
                                            case MobileApproveAuthenticationState.TargetSelection:
                                                return this.promiseTargetSelectionInput();
                                            case MobileApproveAuthenticationState.PollingRequested:
                                                this.state = MobileApproveAuthenticationState.PollingStarted;
                                                this.promisePendingUI().then(function (input) {
                                                    if (input.isControlRequest()) {
                                                        _this.hidePendingUi();
                                                        clearTimeout(_this.pollingTimer);
                                                    }
                                                    _this.currentPollingResolver(input);
                                                });
                                                return this.startPolling();
                                            case MobileApproveAuthenticationState.PollingStarted:
                                                return this.startPolling();
                                            default:
                                                return Promise.reject("Illegal state");
                                        }
                                    case com.ts.mobile.sdk.AuthenticatorSessionMode.Registration:
                                        throw new Error("Method not implemented.");
                                }
                            };
                            MobileApproveAuthenticatorSession.prototype.promiseTargetSelectionInput = function () {
                                var _this = this;
                                return new Promise(function (resolve, reject) {

                                    _this.availableTargets.forEach(function (target) {
                                        var description = target.getDescription();
                                        $rootScope.$broadcast('targetDesc', target);
                                    });

                                    /*$rootScope.$on('goToMobileApproveAfterQuestions', function (event, data) {
                                        _this.availableTargets.forEach(function (target) {
                                           var description = target.getDescription();
                                            $rootScope.$broadcast('targetDesc', target);
                                        });
                                    });*/

                                    $rootScope.$on('selectedDevice', function (event, data) {
                                        if (data) {
                                            var selectedTargets = [];
                                            selectedTargets.push(data);
                                            if (selectedTargets.length <= 0) {
                                                selectionPrompt.text(_this.common.resolveString("mobileApprove.deviceSelection.noneError"));
                                                selectionPrompt.addClass("xmuiPromptError");
                                                selectionPrompt.attr("role", "alert").attr("aria-label", _this.common.resolveString("aria.noDeviceSelected"));
                                            }
                                            else {
                                                // authMobileAuthSelectDeviceForm.fadeOut(function () {
                                                var input = com.ts.mobile.sdk.TargetBasedAuthenticatorInput.createTargetsSelectionRequest(selectedTargets);
                                                resolve(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(input));
                                                $rootScope.$broadcast('goToPendingApproval', null);
                                                // });
                                            }
                                        }
                                    });

                                    $rootScope.$on('changeAuth', function (event, data) {
                                        var controlRequest = com.ts.mobile.sdk.ControlRequest.create(com.ts.mobile.sdk.ControlRequestType.SelectMethod);
                                        resolve(com.ts.mobile.sdk.InputOrControlResponse.createControlResponse(controlRequest));
                                    });

                                    // _this.common.prependPageHeader(authMobileAuthSelectDeviceForm, _this.title, resolve);
                                }).then(function (input) {
                                    _this.common.unsetAriaBusy(_this.clientContext);
                                    _this.common.clearContainer(_this.clientContext);
                                    return input;
                                });
                                ;
                            };
                            MobileApproveAuthenticatorSession.prototype.promisePendingUI = function () {
                                var _this = this;
                                /* var pollingForm = $('<div class="xmuiCore xmuiForm xmuiMobileAuthForm" style="display:none;">\
              <div class="xmuiFullHeightContentBelowPrompt">\
                  <div class="xmuiHalfHeight">\
                      <span class="xmuiHalfHeightText" data-xmui-customstringtext="mobileAuth.approvalPending"/>\
                  </div>\
                  <div class="xmuiLoginInstructionsLabel"></div>\
                  <div class="xmuiOtpText" style="display:none;"></div>\
                  <div>\
                      <img class="xmuiOtpImg" style="display:none;"/></img>\
                  </div>\
                  <div class="xmuiSpinner xmuiInProgress"></div>\
              </div>\
          </div>');*/
                                return new Promise(function (resolve, reject) {
                                    //_this.common.appendElement(pollingForm, _this.clientContext);
                                    //ar authMobileAuthFormInstructions = pollingForm.find(".xmuiLoginInstructionsLabel");
                                    //authMobileAuthFormInstructions.text(_this.instructions);
                                    _this.updateOtp();
                                    //_this.common.prependPageHeader(pollingForm, _this.title, resolve);
                                    _this.common.unsetAriaBusy(_this.clientContext);
                                    $rootScope.$broadcast('mobileApprovesent', '');
                                    //pollingForm.fadeIn();
                                });
                            };
                            MobileApproveAuthenticatorSession.prototype.updateOtp = function () {
                                if (this.otp) {
                                    var otpFormatType = this.otp.getFormat().getType();
                                    switch (otpFormatType) {
                                        case com.ts.mobile.sdk.OtpFormatType.Numeric:
                                            var text = $(".xmuiMobileAuthForm").find(".xmuiOtpText");
                                            text.text(this.otp.getValue());
                                            text.show();
                                            break;
                                        case com.ts.mobile.sdk.OtpFormatType.QrCode:
                                            var img = $(".xmuiMobileAuthForm").find(".xmuiOtpImg");
                                            img.attr("src", "data:image/jpeg;base64," + this.otp.getValue());
                                            img.show();
                                            break;
                                        default:
                                            console.log("Unsupported otp format");
                                            throw new Error("Unsupported otp format");
                                    }
                                }
                            };
                            MobileApproveAuthenticatorSession.prototype.hidePendingUi = function () {
                                this.common.unsetAriaBusy(this.clientContext);
                                $(".xmuiMobileAuthForm").hide();
                            };
                            MobileApproveAuthenticatorSession.prototype.promiseRecoveryForError = function (error, validRecoveries, defaultRecovery) {
                                var _this = this;
                                return new Promise(function (resolve, reject) {
                                    _this.hidePendingUi();
                                    resolve(_super.prototype.promiseRecoveryForError.call(_this, error, validRecoveries, defaultRecovery));
                                });
                            };
                            MobileApproveAuthenticatorSession.prototype.startPolling = function () {
                                var _this = this;
                                return new Promise(function (resolve, reject) {
                                    _this.updateOtp();
                                    _this.pollingTimer = setTimeout(function () {
                                        resolve(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(com.ts.mobile.sdk.TargetBasedAuthenticatorInput.createAuthenticatorInput(com.ts.mobile.sdk.MobileApproveInputRequestPolling.createRequestPollingInput())));
                                    }, _this.pollingIntervalMillis);
                                    _this.currentPollingResolver = resolve;

                                    $rootScope.$on('changeAuth', function (event, data) {
                                        var controlRequest = com.ts.mobile.sdk.ControlRequest.create(com.ts.mobile.sdk.ControlRequestType.SelectMethod);
                                        resolve(com.ts.mobile.sdk.InputOrControlResponse.createControlResponse(controlRequest));
                                    });

                                });
                            };
                            MobileApproveAuthenticatorSession.prototype.promiseAuthInput = function () {
                                throw new Error("Method not implemented");
                            };
                            MobileApproveAuthenticatorSession.prototype.promiseRegInput = function () {
                                throw new Error("Method not implemented");
                            };

                            return new MobileApproveAuthenticatorSession(title, username, instructions, this.common);
                        };

                        LASUIHandler.prototype.selectAuthenticator = function (options, actionContext, clientContext) {
                            return new Promise(function (resolve, reject) {
                                // $rootScope.$broadcast("changeAuthScreen", "");                              
                                document.getElementById('authenticatorheader').innerHTML = "Please select authentication method";
                                var list = $('#changeAuth').parent().parent();
                                list.empty();
                                options.forEach(function (option) {
                                    var authenticator = option.getAuthenticator();
                                    var text = document.createTextNode(authenticator.getName());
                                    var listItem = document.createElement("li");
                                    var ahref = document.createElement("a");
                                    if (authenticator.getName() == "Questions") {
                                        ahref.setAttribute("id", "questions");
                                    } else if (authenticator.getName() == "MobileApprove") {
                                        ahref.setAttribute("id", "mobileapprove");
                                    }
                                    ahref.appendChild(text);
                                    listItem.appendChild(ahref);
                                    listItem.onclick = function () {
                                        resolve(com.ts.mobile.sdk.AuthenticatorSelectionResult.createSelectionRequest(authenticator));
                                    }
                                    list.append(listItem);
                                    $("#questions").text('ID Shield questions');
                                    $("#mobileapprove").text('Visual pattern, fingerprint scan or Face ID (iPhone X only)');

                                });

                                /*$rootScope.$on('authChangeMethod', function (event, data) {
                                    document.getElementById('authenticatorheader').innerHTML = "Please select authentication method";
                                    var list = $('#changeAuth').parent().parent();
                                    list.empty();
                                    options.forEach(function (option) {
                                        var authenticator = option.getAuthenticator();
                                        var text = document.createTextNode(authenticator.getName());
                                        var listItem = document.createElement("li");
                                        var ahref = document.createElement("a");
                                        if (authenticator.getName() == "Questions") {
                                            ahref.setAttribute("id", "questions");
                                        } else if (authenticator.getName() == "MobileApprove") {
                                            ahref.setAttribute("id", "mobileapprove");
                                        }
                                        ahref.appendChild(text);
                                        listItem.appendChild(ahref);
                                        listItem.onclick = function () {
                                            resolve(com.ts.mobile.sdk.AuthenticatorSelectionResult.createSelectionRequest(authenticator));
                                            if (authenticator.getName() === 'MobileApprove') {
                                                //var lASUIHandler = new LASUIHandler();
                                                //lASUIHandler.createMobileApproveAuthSession();
                                                //$rootScope.$broadcast("goToMobileApproveAfterQuestions", null);
                                                $rootScope.$broadcast("goToMobileApprove", null);
                                            } else if (authenticator.getName() === 'Questions') {
                                                $rootScope.$broadcast("goToQuestions", null);
                                            }
                                        }
                                        list.append(listItem);
                                        $("#questions").text('ID Shield questions');
                                        $("#mobileapprove").text('Visual pattern, fingerprint scan or Face ID (iPhone X only)');
                                    });

                                });*/

                                $rootScope.$on('commonCancelButton', function (event, data) {
                                    //resolve(com.ts.mobile.sdk.AuthenticatorSelectionResult.createAbortRequest());
                                    var controlRequest = com.ts.mobile.sdk.ControlRequest.create(com.ts.mobile.sdk.ControlRequestType.CancelAuthenticator);
                                    resolve(com.ts.mobile.sdk.InputOrControlResponse.createControlResponse(controlRequest));


                                });
                            });
                        }




                        LASUIHandler.prototype.createPlaceholderAuthSession = function (placeholderName, placeholderType, title, username, authenticatorConfiguredData, serverPayload) {
                            function LASPlaceholderAuthSession(placeholderName, placeholderType, title, username, authenticatorConfiguredData, serverPayload) {
                                this.title = title;
                                this.username = username;
                                this.serverPayload = serverPayload;
                                //alert(serverPayload);
                                $rootScope.$broadcast("serverPayload", serverPayload);
                            }
                            LASPlaceholderAuthSession.prototype.startSession = function (description, mode, actionContext, clientContext) {
                                this.description = description;
                                this.mode = mode;
                                this.actionContext = actionContext;
                                this.clientContext = clientContext;
                                SessionID = description._session._sessionId ? description._session._sessionId : "";
                                $rootScope.$broadcast("sessionID", SessionID);


                            };
                            LASPlaceholderAuthSession.prototype.endSession = function () {
                            };
                            LASPlaceholderAuthSession.prototype.promiseRecoveryForError = function (error, validRecoveries, defaultRecovery) {
                                return Promise.resolve(defaultRecovery);
                            };


                            LASPlaceholderAuthSession.prototype.promiseInput = function () {
                                var _this = this;
                                //  this.common.setAriaBusy(this.clientContext);
                                var promise;
                                switch (this.mode) {
                                    case com.ts.mobile.sdk.AuthenticatorSessionMode.Authentication:
                                        console.log("Fetching authentication input; authenticator: [" + this.title + "]");
                                        // this.common.unsetAriaBusy(this.clientContext);
                                        promise = this.promiseAuthInput();
                                        break;
                                    case com.ts.mobile.sdk.AuthenticatorSessionMode.Registration:
                                        console.log("Fetching registration input; authenticator: [" + this.title + "]");
                                        // this.common.unsetAriaBusy(this.clientContext);
                                        promise = this.promiseRegInput();
                                        break;
                                }
                                return promise.then(function (input) {
                                    // _this.common.clearContainer(_this.clientContext);
                                    return input;
                                });
                            };
                            LASPlaceholderAuthSession.prototype.promiseAuthInput = function () {
                                return new Promise(function (resolve, reject) {
                                    $rootScope.$on('transmitTokenRecieved', function (event, data) {
                                        if (data) {
                                            angular.element(document.querySelector("#sharedAuthStepUpId")).empty();
                                            // var promise1 = new Promise(function (resolve, reject) {
                                            var placeholderinput = com.ts.mobile.sdk.PlaceholderInputResponse.createSuccessResponse(data.token);
                                            var inputresponse = com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(placeholderinput);
                                            resolve(inputresponse);
                                            $state.go('ResetPassword');
                                            //$rootScope.$broadcast("ResetpasswordFlow", { action: "change_password" });
                                            //  alert("resolve completed");
                                            // });
                                            // promise1.then(function (value) {
                                            // alert("passing to controller");

                                            // });

                                        }
                                    });

                                    $rootScope.$on('changeAuth', function (event, data) {

                                        var controlRequest = com.ts.mobile.sdk.ControlRequest.create(com.ts.mobile.sdk.ControlRequestType.SelectMethod);
                                        resolve(com.ts.mobile.sdk.InputOrControlResponse.createControlResponse(controlRequest));

                                    });






                                });
                            };
                            return new LASPlaceholderAuthSession(placeholderName, placeholderType, title, username, authenticatorConfiguredData, serverPayload); /// Construct a placeholder auth session object and return it. 
                        }


                    });
                }).catch(function (e) {
                    //console.log(e);
                });

            },

            invokeRetrieveIdPolicy: function () {
                return new Promise(function (resolve, reject) {
                    reqXmJs(['jquery', 'xmsdk', 'xmui'], function ($, xm, xmui) {
                        var transmitSDK = xm.XmSdk();
                        var connectionSettings = com.ts.mobile.sdk.SDKConnectionSettings.create("/Proxy/TS", "web");
                        var UserName = userIdentifier;
                        var PolicyId = "retrieve_uid";
                        var channel = commonService.getIsTouch().toLowerCase() == "true" ? "MOBILE_WEB" : "WEB";
                        var PolicyParams = { "token": UserDataToken, "flow": UserFlow, "pid": "uid_lookup", "Channel": channel };
                        var clientContext = { "clientContext": "clientContext" };
                        transmitSDK.setConnectionSettings(connectionSettings);
                        transmitSDK.initialize().then(function () {
                            if (UserName) {
                                transmitSDK.invokePolicy(PolicyId, PolicyParams, clientContext).then(function (successfulAuth) {
                                    resolve(successfulAuth);
                                    $rootScope.$broadcast("forgetPassworddata", successfulAuth);
                                }).catch(function (e) {
                                    //console.log(e);
                                });

                            }
                        }).catch(function (e) {
                            // console.log("failed to initialize sdk");
                        });
                        function LASUIHandler() {
                            xmui.XmUIHandler.call(this);
                        }
                        LASUIHandler.prototype = Object.create(xmui.XmUIHandler.prototype);
                        LASUIHandler.prototype.constructor = LASUIHandler;
                        var uiHandler = new LASUIHandler();
                        transmitSDK.setUiHandler(uiHandler);

                        LASUIHandler.prototype.createFormSession = function (formId, payload) {
                            var tsPayload = payload;
                            function FormSession(formId, payload, common) {
                                this.formId = formId;
                                this.payload = payload;
                                this.common = common;
                            }
                            LASUIHandler.prototype.startActivityIndicator = function (actionContext, clientContext) {
                                $("#spinner").show();
                            }
                            LASUIHandler.prototype.endActivityIndicator = function (actionContext, clientContext) {
                                $("#spinner").hide();
                            }
                            LASUIHandler.prototype.handlePolicyRedirect = function (redirectType, policyId, userId, additionalParameters, clientContext) {
                                return Promise.resolve(com.ts.mobile.sdk.RedirectInput.create(com.ts.mobile.sdk.RedirectResponseType.RedirectToPolicy));

                            }
                            LASUIHandler.prototype.handlePolicyRejection = function (title, text, buttonText, failureData, actionContext, clientContext) {
                                var errReason = {};
                                errReason.reject = (((failureData || {}).reason || {}).data || {}).code
                                errReason.locked = (((failureData || {}).reason || {}).data || {}).locked;
                                $rootScope.$broadcast("ExceptionhandlePolicyRejection", failureData);

                            }
                            $rootScope.$broadcast("AccountRetrievalvalidation", payload);
                            FormSession.prototype.getContainer = function (clientContext) {
                                return xmui.XmUIHandler.getContainer(clientContext);
                            };
                            FormSession.prototype.startSession = function (clientContext, actionContext) {
                                this.actionContext = actionContext;
                                this.clientContext = clientContext;
                            };
                            FormSession.prototype.promiseFormInput = function () {
                                return new Promise(function (resolve, reject) {
                                    $rootScope.$broadcast("RenderRetrieveMode", tsPayload);
                                    $("input.button").click(function () {
                                        var formInput = com.ts.mobile.sdk.FormInput.createFormInputSubmissionRequest(data);
                                        resolve(formInput);
                                    });


                                });
                            };
                            FormSession.prototype.onContinue = function (payload) {
                            };
                            FormSession.prototype.onError = function (payload) {
                                $rootScope.$broadcast("ErrorMessageDisplay", payload);
                            };
                            FormSession.prototype.endSession = function () {
                            };
                            return new FormSession(formId, payload, this.common);
                        };



                    });
                }).catch(function (e) {
                    //console.log(e);
                });

            },
            invokeResetChallengePolicy: function () {

                return new Promise(function (resolve, reject) {
                    reqXmJs(['jquery', 'xmsdk', 'xmui'], function ($, xm, xmui) {
                        var transmitSDK = xm.XmSdk();
                        var connectionSettings = com.ts.mobile.sdk.SDKConnectionSettings.create("/Proxy/TS", "web");
                        var UserName = userIdentifier;
                        var PolicyId = "reset_challenge";
                        var channel = commonService.getIsTouch().toLowerCase() == "true" ? "MOBILE_WEB" : "WEB";
                        var PolicyParams = { "token": UserDataToken, "pid": "forgot_challenge", "Channel": channel };
                        var clientContext = { "clientContext": "clientContext" };
                        transmitSDK.setConnectionSettings(connectionSettings);
                        transmitSDK.initialize().then(function () {
                            if (UserName) {
                                transmitSDK.invokePolicy(PolicyId, PolicyParams, clientContext).then(function (successfulAuth) {
                                    resolve(successfulAuth);
                                    $rootScope.$broadcast("forgetPassworddata", successfulAuth);
                                }).catch(function (e) {
                                    //console.log(e);
                                });

                            }
                        }).catch(function (e) {
                            // console.log("failed to initialize sdk");
                        });
                        function LASUIHandler() {
                            xmui.XmUIHandler.call(this);
                        }
                        LASUIHandler.prototype = Object.create(xmui.XmUIHandler.prototype);
                        LASUIHandler.prototype.constructor = LASUIHandler;
                        var uiHandler = new LASUIHandler();
                        transmitSDK.setUiHandler(uiHandler);
                        LASUIHandler.prototype.processJsonData = function (jsonData, actionContext, clientContext) {
                            $rootScope.$broadcast("AccountRetrievalvalidation", jsonData);
                            return Promise.resolve(dummyJsonDataProcess);
                        }
                        var dummyJsonDataProcess = {
                            getContinueProcessing: function () {
                                return true;
                            }
                        };
                        LASUIHandler.prototype.startActivityIndicator = function (actionContext, clientContext) {
                            $("#spinner").show();
                        }
                        LASUIHandler.prototype.endActivityIndicator = function (actionContext, clientContext) {
                            $("#spinner").hide();
                        }
                        LASUIHandler.prototype.createFormSession = function (formId, payload) {
                            var tsPayload = payload;
                            function FormSession(formId, payload, common) {
                                this.formId = formId;
                                this.payload = payload;
                                this.common = common;
                            }
                            LASUIHandler.prototype.handlePolicyRedirect = function (redirectType, policyId, userId, additionalParameters, clientContext) {
                                return Promise.resolve(com.ts.mobile.sdk.RedirectInput.create(com.ts.mobile.sdk.RedirectResponseType.RedirectToPolicy));

                            }
                            LASUIHandler.prototype.handlePolicyRejection = function (title, text, buttonText, failureData, actionContext, clientContext) {
                                var errReason = {};
                                errReason.reject = (((failureData || {}).reason || {}).data || {}).code
                                errReason.locked = (((failureData || {}).reason || {}).data || {}).locked;
                                $rootScope.$broadcast("ExceptionhandlePolicyRejection", failureData);
                            }
                            $rootScope.$broadcast("AccountRetrievalvalidation", payload);
                            FormSession.prototype.getContainer = function (clientContext) {
                                return xmui.XmUIHandler.getContainer(clientContext);
                            };
                            FormSession.prototype.startSession = function (clientContext, actionContext) {
                                this.actionContext = actionContext;
                                this.clientContext = clientContext;
                            };
                            FormSession.prototype.promiseFormInput = function () {
                                return new Promise(function (resolve, reject) {
                                    $rootScope.$broadcast("RenderRetrieveMode", tsPayload);
                                    $("input.button").click(function () {
                                        // console.log(data);
                                        var formInput = com.ts.mobile.sdk.FormInput.createFormInputSubmissionRequest(data);
                                        resolve(formInput);
                                    });


                                });
                            };
                            FormSession.prototype.onContinue = function (payload) {
                            };
                            FormSession.prototype.onError = function (payload) {
                                $rootScope.$broadcast("ErrorMessageDisplay", payload);
                            };
                            FormSession.prototype.endSession = function () {
                            };
                            return new FormSession(formId, payload, this.common);
                        };



                    });
                }).catch(function (e) {
                    //console.log(e);
                });

            },

            invokeForgotIdPolicy: function () {
                this.invokeLogout();
                return new Promise(function (resolve, reject) {
                    reqXmJs(['jquery', 'xmsdk', 'xmui'], function ($, xm, xmui) {
                        var transmitSDK = xm.XmSdk();
                        var connectionSettings = com.ts.mobile.sdk.SDKConnectionSettings.create("/Proxy/TS", "web");
                        transmitSDK.setConnectionSettings(connectionSettings);
                        var blackboxdata = "blackboxdata";
                        if (bbData) {
                            blackboxdata = bbData ? bbData : "blackboxdata";
                        }

                        /* Change for focus card */

                        var channel = commonService.getIsTouch().toLowerCase() == "true" ? "MOBILE_WEB" : "WEB";
                        if (FSVGuid) {
                            var guid = FSVGuid;
                            var transmitRoutingKey = location.host.split('-').length > 1 ? location.host.split('-')[0] : undefined;
                        }

                        if (FsvUser) {
                            var PolicyParams = { "BlackBoxData": blackboxdata, "Channel": channel, "GUID": guid, "isFsv": true, "routingkey": transmitRoutingKey };
                        } else {
                            var PolicyParams = { "BlackBoxData": blackboxdata, "Channel": channel };
                        }
                        transmitSDK.initialize().then(function () {
                            transmitSDK.invokeAnonymousPolicy("uid_lookup", PolicyParams, {})
                                .then(function (successfulAuth) {
                                    resolve(successfulAuth);
                                    $rootScope.$broadcast("AccountRetrievalvalidation", successfulAuth);

                                })
                                .catch(function (err) {
                                    var errorMessage = err._data != null ?
                                        (err._data.js_error_message != null ?
                                            err._data.js_error_message :
                                            (err._data.server_error_data != null ? err._data.server_error_data.failure_data.source.name : "")
                                        )
                                        : "";
                                    if (errorMessage !== "") { }
                                    //console.log(errorMessage);
                                });
                        }).catch(function (err) {
                            reject(err);
                        });

                        function LASUIHandler() {
                            xmui.XmUIHandler.call(this);
                        }
                        LASUIHandler.prototype = Object.create(xmui.XmUIHandler.prototype);
                        LASUIHandler.prototype.constructor = LASUIHandler;
                        var uiHandler = new LASUIHandler();
                        transmitSDK.setUiHandler(uiHandler);
                        LASUIHandler.prototype.processJsonData = function (jsonData, actionContext, clientContext) {
                            $rootScope.$broadcast("AccountRetrievalvalidation", jsonData);
                            return Promise.resolve(dummyJsonDataProcess);
                        }
                        var dummyJsonDataProcess = {
                            getContinueProcessing: function () {
                                return true;
                            }
                        };
                        LASUIHandler.prototype.startActivityIndicator = function (actionContext, clientContext) {
                            $("#spinner").show();

                        }
                        LASUIHandler.prototype.endActivityIndicator = function (actionContext, clientContext) {
                            $("#spinner").hide();

                        }
                        LASUIHandler.prototype.handlePolicyRedirect = function (redirectType, policyId, userId, additionalParameters, clientContext) {
                            return Promise.resolve(com.ts.mobile.sdk.RedirectInput.create(com.ts.mobile.sdk.RedirectResponseType.RedirectToPolicy));

                        }
                        LASUIHandler.prototype.handlePolicyRejection = function (title, text, buttonText, failureData, actionContext, clientContext) {
                            var errReason = {};
                            errReason.reject = (((failureData || {}).reason || {}).data || {}).code
                            errReason.locked = (((failureData || {}).reason || {}).data || {}).locked;
                            $rootScope.$broadcast("ExceptionhandlePolicyRejection", failureData);
                        }
                        LASUIHandler.prototype.createOtpAuthSession = function (title, username, possibleTargets, autoExecedTarget) {
                            {
                                return new OtpAuthenticatorSession(title, username, possibleTargets, autoExecedTarget, uiHandler);
                            }
                            function OtpAuthenticatorSession(title, username, possibleTargets, autoExecedTarget, uiHandler) {
                                var OtpAuthenticationState;
                                (function (OtpAuthenticationState) {
                                    OtpAuthenticationState[OtpAuthenticationState["TargetSelection"] = 0] = "TargetSelection";
                                    OtpAuthenticationState[OtpAuthenticationState["Input"] = 1] = "Input";
                                })(OtpAuthenticationState || (OtpAuthenticationState = {}));

                                this.title = title;
                                this.username = username;
                                this.possibleTargets = possibleTargets;
                                this.autoExecedTarget = autoExecedTarget;
                                this.state = OtpAuthenticationState.TargetSelection;
                                this.uiHandler = uiHandler;
                                OtpAuthenticatorSession.prototype.processJsonData = function (jsonData, actionContext, clientContext) {
                                    $rootScope.$broadcast("AccountRetrievalvalidation", jsonData);
                                    return Promise.resolve(dummyJsonDataProcess);
                                }
                                var dummyJsonDataProcess = {
                                    getContinueProcessing: function () {
                                        return true;
                                    }
                                };

                                OtpAuthenticatorSession.prototype.setAvailableTargets = function (targets) {
                                    this.possibleTargets = targets;
                                };
                                OtpAuthenticatorSession.prototype.setGeneratedOtp = function (format, target) {
                                    this.generatedFormat = format;
                                    this.generatedForTarget = target;
                                    if (!target) {
                                        this.state = OtpAuthenticationState.TargetSelection;
                                    }
                                };
                                OtpAuthenticatorSession.prototype.startSession = function (description, mode, actionContext, clientContext) {

                                    $rootScope.$broadcast('OpenTransmitOTP', '');
                                    this.description = description;
                                    this.mode = mode;
                                    this.actionContext = actionContext;
                                    this.clientContext = clientContext;
                                    xmui.XmUIHandler.getContainer(clientContext).append(""); // not appending any form
                                }

                                OtpAuthenticatorSession.prototype.promiseInput = function () {
                                    var _this = this;

                                    switch (this.state) {
                                        case OtpAuthenticationState.TargetSelection:
                                            if (FsvUser) {
                                                $rootScope.$broadcast("AccountRetrievalvalidation", _this.possibleTargets);
                                            }
                                            return new Promise(function (resolve, reject) {
                                                _this.authError = null;
                                                _this.state = OtpAuthenticationState.Input;

                                                if (FsvUser) {
                                                    $rootScope.$on('FSvMobileNumberClick', function (event, data) {

                                                        var input = com.ts.mobile.sdk.TargetBasedAuthenticatorInput.createTargetSelectionRequest(_this.possibleTargets[data]);
                                                        resolve(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(input));
                                                    });
                                                } else {
                                                    //returning the first target as the mobile number is already sent for MNO - no target selection required.
                                                    var input = com.ts.mobile.sdk.TargetBasedAuthenticatorInput.createTargetSelectionRequest(_this.possibleTargets[0]);
                                                    return resolve(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(input));
                                                }

                                                //returning the first target as the mobile number is already sent for MNO - no target selection required.
                                                //var input = com.ts.mobile.sdk.TargetBasedAuthenticatorInput.createTargetSelectionRequest(_this.possibleTargets[0]);
                                                // return resolve(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(input));

                                            });

                                    }
                                    return new Promise(function (resolve, reject) {
                                        $("#ContinueButton").click(function () {
                                            if ((userInputData.Code) && (userInputData.Code.replace("", "").length == 6)) {
                                                var input = com.ts.mobile.sdk.OtpInputOtpSubmission.createOtpSubmission(userInputData.Code.replace("", "").toString());
                                                var inputTargetBased = com.ts.mobile.sdk.TargetBasedAuthenticatorInput.createAuthenticatorInput(input);
                                                resolve(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(inputTargetBased));
                                            }
                                        });

                                        $("#ResendotpButton").click(function () {
                                            var resend = com.ts.mobile.sdk.OtpInputRequestResend.createOtpResendRequest();
                                            var inputTargetBased = com.ts.mobile.sdk.TargetBasedAuthenticatorInput.createAuthenticatorInput(resend);
                                            resolve(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(inputTargetBased));
                                        });
                                    });
                                }

                                OtpAuthenticatorSession.prototype.promiseRecoveryForError = function (error, validRecoveries, defaultRecovery) {
                                    setErrorPrompt(error);
                                    return Promise.resolve(defaultRecovery);
                                    // No recovery option is provided to the user
                                }

                                OtpAuthenticatorSession.prototype.endSession = function () {
                                    // xmui.XmUIHandler.getContainer(clientContext).empty();
                                }

                                function setErrorPrompt(error) {

                                    var errorData = error.getData();
                                    var retryattempt = ((errorData || {}).additional_data || {}).retries_left; // wrong_inputs_left for 3 attempts
                                    var locked = (((((errorData || {}).server_error_data || {}).failure_data || {}).reason || {}).data || {}).locked; //Needed for IT env due to proxy


                                    if (typeof locked != 'undefined' && locked) //it should happen in handlePolicyRejection function
                                    {
                                        broadcastError(LoginAssistantConstants.EnterCodeStatics.ENROLLMENT_ENTER_CODE_6_DIGIT_OTP_LOCK_OUT_ERR_MSG, retryattempt);
                                    }
                                    else if (typeof retryattempt != 'undefined' && retryattempt == 1) {
                                        broadcastError(LoginAssistantConstants.EnterCodeStatics.ENROLLMENT_ENTER_CODE_6_DIGIT_LAST_ATTEMPT_ERR_MSG, retryattempt);
                                    }
                                    else if (typeof retryattempt != 'undefined' && retryattempt > 0) {
                                        broadcastError(LoginAssistantConstants.EnterCodeStatics.ENROLLMENT_ENTER_CODE_6_DIGIT_INVALID_ERR_MSG, retryattempt);
                                    }
                                    else {
                                        broadcastError(); // catch unknownexceptions
                                    }

                                }

                                function broadcastError(msg, count) {
                                    $rootScope.$broadcast('TransmitError', msg, count);
                                }
                            }


                        };

                        LASUIHandler.prototype.createFormSession = function (formId, payload) {
                            var tsPayload = payload;
                            function FormSession(formId, payload, common) {
                                this.formId = formId;
                                this.payload = payload;
                                this.common = common;
                            }
                            $rootScope.$broadcast("AccountRetrievalvalidation", payload);
                            FormSession.prototype.getContainer = function (clientContext) {
                                return xmui.XmUIHandler.getContainer(clientContext);
                            };
                            FormSession.prototype.startSession = function (clientContext, actionContext) {
                                this.actionContext = actionContext;
                                this.clientContext = clientContext;
                            };
                            FormSession.prototype.promiseFormInput = function () {
                                return new Promise(function (resolve, reject) {
                                    $rootScope.$broadcast("RenderRetrieveMode", tsPayload);
                                    $("input.button").click(function () {
                                        var inputData = userInputData;
                                        if (selectedAccount != null && multipleAccountType == null) {//OTP
                                            var data = {
                                                "data": {
                                                    "reset_option": "OTP",
                                                    "user_input": selectedAccount
                                                }
                                            };

                                        } else if (sharedAccessAdminSelected != null) {
                                            var data = {
                                                "data": {
                                                    "idx": sharedAccessAdminSelected.idx,
                                                    "name": sharedAccessAdminSelected.name
                                                }
                                            };
                                        } else if (multipleAccountType != null) { //PIN
                                            var data = {
                                                "data": {
                                                    "reset_option": "PIN",
                                                    "user_input": {
                                                        "pin": inputData.PIN ? inputData.PIN : "",
                                                        "cvv": inputData.CVV ? inputData.CVV : "",
                                                        "expireDate": inputData.ExpirationDate ? inputData.ExpirationDate : "",
                                                        "zip": inputData.ZIPCode ? inputData.ZIPCode : ""
                                                    }
                                                }
                                            };
                                            if (multipleAccountType == LoginAssistantConstants.LA_DDA_ACCOUNT) {
                                                delete data.data.user_input.cvv;
                                                delete data.data.user_input.expireDate;
                                                delete data.data.user_input.zip;
                                                delete data.data.user_input.zipLLLMW;
                                            } else if (multipleAccountType == LoginAssistantConstants.LA_CCD_ACCOUNT) {
                                                delete data.data.user_input.pin;
                                                delete data.data.user_input.zipLLLMW;
                                                data.data.reset_option = "CVV";
                                                data.data.user_input["index"] = selectedAccount.index;
                                            } else if (multipleAccountType == LoginAssistantConstants.LA_LLLMW_ACCOUNT) {
                                                delete data.data.user_input.pin;
                                                delete data.data.user_input.cvv;
                                                delete data.data.user_input.expireDate;
                                                data.data.reset_option = "ZIP"
                                                data.data.user_input["index"] = selectedAccount.index;
                                            }

                                        } else if (AccountOption.required) {
                                            var data = {
                                                "tin": inputData.TaxId ? inputData.TaxId : "",
                                            };
                                        } else {
                                            var data = {
                                                "data": {
                                                    "account_type": idAccountType,
                                                    "mode": idMethodType,
                                                    "phone": inputData.Phone ? inputData.Phone : "",
                                                    "email": inputData.Email ? inputData.Email : "",
                                                    "account": inputData.CardOrAccountNumber ? inputData.CardOrAccountNumber : "",
                                                    "ssn": inputData.Ssn,
                                                    "tin": inputData.Tin ? inputData.Tin : ""
                                                }
                                            };
                                            if (idMethodType == "PhoneSSN") {
                                                delete data.data.email;
                                                delete data.data.account;
                                                delete data.data.tin;
                                                data.data.phone = (data.data.phone).replace(/-|\s/g, "");
                                            } else if (idMethodType == "EmailSSN") {
                                                delete data.data.phone;
                                                delete data.data.account;
                                                delete data.data.tin;
                                            } else if (idMethodType == "AccountSSN") {
                                                delete data.data.email;
                                                delete data.data.phone;
                                                delete data.data.tin;
                                            } else if (idMethodType == "AccountSSNTIN") {
                                                delete data.data.email;
                                                delete data.data.phone;
                                            }
                                        }
                                        // console.log(data);
                                        var formInput = com.ts.mobile.sdk.FormInput.createFormInputSubmissionRequest(data);
                                        resolve(formInput);
                                    });

                                    $rootScope.$on('resetFormInput', function (event, data) {
                                        var formInput = com.ts.mobile.sdk.FormInput.createFormInputSubmissionRequest("");
                                        resolve(formInput);
                                    });

                                }).catch(function (e) {
                                    //console.log(e);
                                });
                            };
                            FormSession.prototype.onContinue = function (payload) {

                            };
                            FormSession.prototype.onError = function (payload) {
                                $rootScope.$broadcast("ErrorMessageDisplay", payload);
                            };
                            FormSession.prototype.endSession = function () {
                            };

                            return new FormSession(formId, payload, this.common);
                        };
                    });
                }).catch(function (e) {
                    //console.log(e);
                });

            },

            invokeResetPasswordPolicy: function (uid) {
                this.invokeLogout();
                return new Promise(function (resolve, reject) {
                    reqXmJs(['jquery', 'xmsdk', 'xmui'], function ($, xm, xmui) {
                        var transmitSDK = xm.XmSdk();
                        var UserName = uid;
                        var blackboxdata = "blackboxdata";
                        bbData = document.getElementById("bb_holder").innerText;
                        if (bbData) {
                            blackboxdata = bbData ? bbData : "blackboxdata";
                        }
                        var channel = commonService.getIsTouch().toLowerCase() == "true" ? "MOBILE_WEB" : "WEB";
                        if (FSVGuid) {
                            var guid = FSVGuid;
                            var transmitRoutingKey = location.host.split('-').length > 1 ? location.host.split('-')[0] : undefined;
                        }
                        if (FsvUser) {
                            if (FsvUsername) {
                                var username = FsvUsername;
                            }
                            var PolicyParams = { "BlackBoxData": blackboxdata, "Channel": channel, "GUID": guid, "retrieve_id_flow": "false", "uid": username, "isFsv": true, "routingkey": transmitRoutingKey };
                        } else {
                            var PolicyParams = { "uid": UserName, "BlackBoxData": blackboxdata, "retrieve_id_flow": "false", "Channel": channel };
                        }
                        // var PolicyParams = { "uid": UserName, "BlackBoxData": blackboxdata, "retrieve_id_flow": "false", "Channel": channel };

                        var connectionSettings = com.ts.mobile.sdk.SDKConnectionSettings.create("/Proxy/TS", "web");
                        transmitSDK.setConnectionSettings(connectionSettings);
                        transmitSDK.initialize().then(function () {
                            transmitSDK.invokeAnonymousPolicy("forgot_password", PolicyParams, {}, {})
                                .then(function (successfulAuth) {
                                    resolve(successfulAuth);
                                    $rootScope.$broadcast("AccountRetrievalvalidation", successfulAuth);
                                })
                                .catch(function (err) {
                                    var errorMessage = err._data != null ?
                                        (err._data.js_error_message != null ?
                                            err._data.js_error_message :
                                            (err._data.server_error_data != null ? err._data.server_error_data.failure_data.source.name : "")
                                        )
                                        : "";
                                    if (errorMessage !== "") { }
                                    //console.log(errorMessage);
                                });
                        }).catch(function (err) {
                            reject(err);
                        });

                        function LASUIHandler() {
                            xmui.XmUIHandler.call(this);
                        }
                        LASUIHandler.prototype = Object.create(xmui.XmUIHandler.prototype);
                        LASUIHandler.prototype.constructor = LASUIHandler;
                        var uiHandler = new LASUIHandler();
                        transmitSDK.setUiHandler(uiHandler);
                        LASUIHandler.prototype.processJsonData = function (jsonData, actionContext, clientContext) {
                            $rootScope.$broadcast("AccountRetrievalvalidation", jsonData);
                            return Promise.resolve(dummyJsonDataProcess);
                        }
                        var dummyJsonDataProcess = {
                            getContinueProcessing: function () {
                                return true;
                            }
                        };
                        LASUIHandler.prototype.startActivityIndicator = function (actionContext, clientContext) {
                            $("#spinner").show();
                        }
                        LASUIHandler.prototype.endActivityIndicator = function (actionContext, clientContext) {
                            $("#spinner").hide();
                        }
                        LASUIHandler.prototype.handlePolicyRedirect = function (redirectType, policyId, userId, additionalParameters, clientContext) {
                            return Promise.resolve(com.ts.mobile.sdk.RedirectInput.create(com.ts.mobile.sdk.RedirectResponseType.RedirectToPolicy));

                        }
                        LASUIHandler.prototype.handlePolicyRejection = function (title, text, buttonText, failureData, actionContext, clientContext) {
                            var errReason = {};
                            errReason.reject = (((failureData || {}).reason || {}).data || {}).code
                            errReason.locked = (((failureData || {}).reason || {}).data || {}).locked;
                            $rootScope.$broadcast("ExceptionhandlePolicyRejection", failureData);
                        }
                        LASUIHandler.prototype.createOtpAuthSession = function (title, username, possibleTargets, autoExecedTarget) {
                            {
                                return new OtpAuthenticatorSession(title, username, possibleTargets, autoExecedTarget, uiHandler);
                            }
                            function OtpAuthenticatorSession(title, username, possibleTargets, autoExecedTarget, uiHandler) {
                                var OtpAuthenticationState;
                                (function (OtpAuthenticationState) {
                                    OtpAuthenticationState[OtpAuthenticationState["TargetSelection"] = 0] = "TargetSelection";
                                    OtpAuthenticationState[OtpAuthenticationState["Input"] = 1] = "Input";
                                })(OtpAuthenticationState || (OtpAuthenticationState = {}));

                                this.title = title;
                                this.username = username;
                                this.possibleTargets = possibleTargets;
                                this.autoExecedTarget = autoExecedTarget;
                                this.state = OtpAuthenticationState.TargetSelection;
                                this.uiHandler = uiHandler;
                                OtpAuthenticatorSession.prototype.processJsonData = function (jsonData, actionContext, clientContext) {
                                    $rootScope.$broadcast("AccountRetrievalvalidation", jsonData);
                                    return Promise.resolve(dummyJsonDataProcess);
                                }
                                var dummyJsonDataProcess = {
                                    getContinueProcessing: function () {
                                        return true;
                                    }
                                };

                                OtpAuthenticatorSession.prototype.setAvailableTargets = function (targets) {
                                    this.possibleTargets = targets;
                                };
                                OtpAuthenticatorSession.prototype.setGeneratedOtp = function (format, target) {
                                    this.generatedFormat = format;
                                    this.generatedForTarget = target;
                                    if (!target) {
                                        this.state = OtpAuthenticationState.TargetSelection;
                                    }
                                };
                                OtpAuthenticatorSession.prototype.startSession = function (description, mode, actionContext, clientContext) {

                                    $rootScope.$broadcast('OpenTransmitOTP', '');
                                    this.description = description;
                                    this.mode = mode;
                                    this.actionContext = actionContext;
                                    this.clientContext = clientContext;
                                    xmui.XmUIHandler.getContainer(clientContext).append(""); // not appending any form
                                }

                                OtpAuthenticatorSession.prototype.promiseInput = function () {
                                    var _this = this;

                                    switch (this.state) {
                                        case OtpAuthenticationState.TargetSelection:
                                            if (FsvUser) {

                                                $rootScope.$broadcast("AccountRetrievalvalidation", _this.possibleTargets);
                                            }
                                            return new Promise(function (resolve, reject) {
                                                _this.authError = null;
                                                _this.state = OtpAuthenticationState.Input;

                                                if (FsvUser) {
                                                    $rootScope.$on('FSvMobileNumberClick', function (event, data) {
                                                        var input = com.ts.mobile.sdk.TargetBasedAuthenticatorInput.createTargetSelectionRequest(_this.possibleTargets[data]);
                                                        resolve(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(input));

                                                    });
                                                } else {
                                                    var input = com.ts.mobile.sdk.TargetBasedAuthenticatorInput.createTargetSelectionRequest(_this.possibleTargets[0]);
                                                    return resolve(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(input));
                                                }

                                                //returning the first target as the mobile number is already sent for MNO - no target selection required.
                                            });

                                    }
                                    return new Promise(function (resolve, reject) {
                                        $("#ContinueButton").click(function () {
                                            if ((userInputData.Code) && (userInputData.Code.replace("U-", "").length == 6)) {
                                                var input = com.ts.mobile.sdk.OtpInputOtpSubmission.createOtpSubmission(userInputData.Code.replace("U-", "").toString());
                                                var inputTargetBased = com.ts.mobile.sdk.TargetBasedAuthenticatorInput.createAuthenticatorInput(input);
                                                resolve(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(inputTargetBased));
                                            }
                                        });

                                        $("#ResendotpButton").click(function () {
                                            var resend = com.ts.mobile.sdk.OtpInputRequestResend.createOtpResendRequest();
                                            var inputTargetBased = com.ts.mobile.sdk.TargetBasedAuthenticatorInput.createAuthenticatorInput(resend);
                                            resolve(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(inputTargetBased));
                                            $rootScope.$broadcast('ResendOtpButton', '');
                                        });
                                    });
                                }

                                OtpAuthenticatorSession.prototype.promiseRecoveryForError = function (error, validRecoveries, defaultRecovery) {
                                    setErrorPrompt(error);
                                    return Promise.resolve(defaultRecovery);
                                    // No recovery option is provided to the user
                                }

                                OtpAuthenticatorSession.prototype.endSession = function () {
                                    // xmui.XmUIHandler.getContainer(clientContext).empty();
                                }

                                function setErrorPrompt(error) {

                                    var errorData = error.getData();
                                    var retryattempt = ((errorData || {}).additional_data || {}).retries_left; // wrong_inputs_left for 5 attempts
                                    var locked = (((((errorData || {}).server_error_data || {}).failure_data || {}).reason || {}).data || {}).locked; //Needed for IT env due to proxy


                                    if (typeof locked != 'undefined' && locked) //it should happen in handlePolicyRejection function
                                    {
                                        broadcastError(LoginAssistantConstants.EnterCodeStatics.ENROLLMENT_ENTER_CODE_6_DIGIT_OTP_LOCK_OUT_ERR_MSG, retryattempt);
                                    }
                                    else if (typeof retryattempt != 'undefined' && retryattempt == 1) {
                                        broadcastError(LoginAssistantConstants.EnterCodeStatics.ENROLLMENT_ENTER_CODE_6_DIGIT_LAST_ATTEMPT_ERR_MSG, retryattempt);
                                    }
                                    else if (typeof retryattempt != 'undefined' && retryattempt > 0) {
                                        broadcastError(LoginAssistantConstants.EnterCodeStatics.ENROLLMENT_ENTER_CODE_6_DIGIT_INVALID_ERR_MSG, retryattempt);
                                    }
                                    else {
                                        broadcastError(); // catch unknownexceptions
                                    }

                                }

                                function broadcastError(msg, count) {
                                    $rootScope.$broadcast('TransmitError', msg, count);
                                }
                            }


                        };

                        LASUIHandler.prototype.createFormSession = function (formId, payload) {
                            var tsPayload = payload;
                            function FormSession(formId, payload, common) {
                                this.formId = formId;
                                this.payload = payload;
                                this.common = common;
                            }
                            $rootScope.$broadcast("AccountRetrievalvalidation", payload);
                            FormSession.prototype.getContainer = function (clientContext) {
                                return xmui.XmUIHandler.getContainer(clientContext);
                            };
                            FormSession.prototype.startSession = function (clientContext, actionContext) {
                                this.actionContext = actionContext;
                                this.clientContext = clientContext;
                            };
                            FormSession.prototype.promiseFormInput = function () {
                                return new Promise(function (resolve, reject) {
                                    $rootScope.$broadcast("ResetCommonValidation", tsPayload);
                                    $("input.button").click(function () {
                                        var inputData = userInputData;
                                        if (selectedAccount != null && multipleAccountType == null) {//OTP
                                            var data = {
                                                "data": {
                                                    "reset_option": "OTP",
                                                    "user_input": selectedAccount
                                                }
                                            };

                                        } else if (multipleAccountType != null) {//PIN
                                            var data = {
                                                "data": {
                                                    "reset_option": "PIN",
                                                    "user_input": {
                                                        "pin": inputData.PIN ? inputData.PIN : "",
                                                        "cvv": inputData.CVV ? inputData.CVV : "",
                                                        "expireDate": inputData.ExpirationDate ? inputData.ExpirationDate : "",
                                                        "zip": inputData.ZIPCode ? inputData.ZIPCode : ""
                                                    }
                                                }
                                            };
                                            if (multipleAccountType == LoginAssistantConstants.LA_DDA_ACCOUNT) {
                                                delete data.data.user_input.cvv;
                                                delete data.data.user_input.expireDate;
                                                delete data.data.user_input.zip;
                                                delete data.data.user_input.zipLLLMW;
                                            } else if (multipleAccountType == LoginAssistantConstants.LA_CCD_ACCOUNT) {
                                                delete data.data.user_input.pin;
                                                delete data.data.user_input.zipLLLMW;
                                                data.data.reset_option = "CVV";
                                                data.data.user_input["index"] = selectedAccount.index;
                                            } else if (multipleAccountType == LoginAssistantConstants.LA_LLLMW_ACCOUNT) {
                                                delete data.data.user_input.pin;
                                                delete data.data.user_input.cvv;
                                                delete data.data.user_input.expireDate;
                                                data.data.reset_option = "ZIP"
                                                data.data.user_input["index"] = selectedAccount.index;
                                            }

                                        } else {
                                            var data = {
                                                "data": {
                                                    "uid": inputData.PersonalId,
                                                    "ssn": inputData.pwdSSN
                                                }
                                            };

                                        }

                                        var formInput = com.ts.mobile.sdk.FormInput.createFormInputSubmissionRequest(data);
                                        resolve(formInput);
                                    });

                                    $rootScope.$on('resetFormInput', function (event, data) {
                                        var formInput = com.ts.mobile.sdk.FormInput.createFormInputSubmissionRequest("");
                                        resolve(formInput);
                                    });

                                }).catch(function (e) {
                                    console.log(e);
                                });
                            };
                            FormSession.prototype.onContinue = function (payload) {
                            };
                            FormSession.prototype.onError = function (payload) {
                                $rootScope.$broadcast("ErrorMessageDisplay", payload);
                            };
                            FormSession.prototype.endSession = function () {
                            };

                            return new FormSession(formId, payload, this.common);
                        };
                    });
                }).catch(function (e) {
                    //console.log(e);
                });

            },

            invokeResetAnswerPolicy: function (uid) {
                this.invokeLogout();
                return new Promise(function (resolve, reject) {
                    reqXmJs(['jquery', 'xmsdk', 'xmui'], function ($, xm, xmui) {
                        var transmitSDK = xm.XmSdk();
                        userIdentifier = uid;
                        var UserName = uid;
                        var blackboxdata = "blackboxdata";
                        bbData = document.getElementById("bb_holder").innerText;
                        if (bbData) {
                            blackboxdata = bbData ? bbData : "blackboxdata";
                        }
                        var channel = commonService.getIsTouch().toLowerCase() == "true" ? "MOBILE_WEB" : "WEB";
                        var PolicyParams = { "uid": UserName, "BlackBoxData": blackboxdata, "retrieve_id_flow": "false", "Channel": channel };

                        var connectionSettings = com.ts.mobile.sdk.SDKConnectionSettings.create("/Proxy/TS", "web");
                        transmitSDK.setConnectionSettings(connectionSettings);
                        transmitSDK.initialize().then(function () {
                            transmitSDK.invokeAnonymousPolicy("forgot_challenge", PolicyParams, {}, {})
                                .then(function (successfulAuth) {
                                    resolve(successfulAuth);
                                    $rootScope.$broadcast("AccountRetrievalvalidation", successfulAuth);
                                })
                                .catch(function (err) {
                                    //reject(err);
                                    var errorMessage = err._data != null ?
                                        (err._data.js_error_message != null ?
                                            err._data.js_error_message :
                                            (err._data.server_error_data != null ? err._data.server_error_data.failure_data.source.name : "")
                                        )
                                        : "";
                                    if (errorMessage !== "") { }
                                    //console.log(errorMessage);
                                });
                        }).catch(function (err) {
                            reject(err);
                        });

                        function LASUIHandler() {
                            xmui.XmUIHandler.call(this);
                        }
                        LASUIHandler.prototype = Object.create(xmui.XmUIHandler.prototype);
                        LASUIHandler.prototype.constructor = LASUIHandler;
                        var uiHandler = new LASUIHandler();
                        transmitSDK.setUiHandler(uiHandler);
                        LASUIHandler.prototype.processJsonData = function (jsonData, actionContext, clientContext) {
                            $rootScope.$broadcast("AccountRetrievalvalidation", jsonData);
                            return Promise.resolve(dummyJsonDataProcess);
                        }
                        var dummyJsonDataProcess = {
                            getContinueProcessing: function () {
                                return true;
                            }
                        };
                        LASUIHandler.prototype.startActivityIndicator = function (actionContext, clientContext) {
                            $("#spinner").show();
                        }
                        LASUIHandler.prototype.endActivityIndicator = function (actionContext, clientContext) {
                            $("#spinner").hide();
                        }
                        LASUIHandler.prototype.handlePolicyRedirect = function (redirectType, policyId, userId, additionalParameters, clientContext) {
                            return Promise.resolve(com.ts.mobile.sdk.RedirectInput.create(com.ts.mobile.sdk.RedirectResponseType.RedirectToPolicy));

                        }
                        LASUIHandler.prototype.handlePolicyRejection = function (title, text, buttonText, failureData, actionContext, clientContext) {
                            var errReason = {};
                            errReason.reject = (((failureData || {}).reason || {}).data || {}).code
                            errReason.locked = (((failureData || {}).reason || {}).data || {}).locked;
                            $rootScope.$broadcast("ExceptionhandlePolicyRejection", failureData);
                        }
                        LASUIHandler.prototype.createOtpAuthSession = function (title, username, possibleTargets, autoExecedTarget) {
                            {
                                return new OtpAuthenticatorSession(title, username, possibleTargets, autoExecedTarget, uiHandler);
                            }
                            function OtpAuthenticatorSession(title, username, possibleTargets, autoExecedTarget, uiHandler) {
                                var OtpAuthenticationState;
                                (function (OtpAuthenticationState) {
                                    OtpAuthenticationState[OtpAuthenticationState["TargetSelection"] = 0] = "TargetSelection";
                                    OtpAuthenticationState[OtpAuthenticationState["Input"] = 1] = "Input";
                                })(OtpAuthenticationState || (OtpAuthenticationState = {}));

                                this.title = title;
                                this.username = username;
                                this.possibleTargets = possibleTargets;
                                this.autoExecedTarget = autoExecedTarget;
                                this.state = OtpAuthenticationState.TargetSelection;
                                this.uiHandler = uiHandler;
                                OtpAuthenticatorSession.prototype.processJsonData = function (jsonData, actionContext, clientContext) {
                                    $rootScope.$broadcast("AccountRetrievalvalidation", jsonData);
                                    return Promise.resolve(dummyJsonDataProcess);
                                }
                                var dummyJsonDataProcess = {
                                    getContinueProcessing: function () {
                                        return true;
                                    }
                                };

                                OtpAuthenticatorSession.prototype.setAvailableTargets = function (targets) {
                                    this.possibleTargets = targets;
                                };
                                OtpAuthenticatorSession.prototype.setGeneratedOtp = function (format, target) {
                                    this.generatedFormat = format;
                                    this.generatedForTarget = target;
                                    if (!target) {
                                        this.state = OtpAuthenticationState.TargetSelection;
                                    }
                                };
                                OtpAuthenticatorSession.prototype.startSession = function (description, mode, actionContext, clientContext) {

                                    $rootScope.$broadcast('OpenTransmitOTP', '');
                                    this.description = description;
                                    this.mode = mode;
                                    this.actionContext = actionContext;
                                    this.clientContext = clientContext;
                                    xmui.XmUIHandler.getContainer(clientContext).append(""); // not appending any form
                                }

                                OtpAuthenticatorSession.prototype.promiseInput = function () {
                                    var _this = this;

                                    switch (this.state) {
                                        case OtpAuthenticationState.TargetSelection:
                                            return new Promise(function (resolve, reject) {
                                                _this.authError = null;
                                                _this.state = OtpAuthenticationState.Input;
                                                //returning the first target as the mobile number is already sent for MNO - no target selection required.
                                                var input = com.ts.mobile.sdk.TargetBasedAuthenticatorInput.createTargetSelectionRequest(_this.possibleTargets[0]);
                                                return resolve(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(input));

                                            });

                                    }
                                    return new Promise(function (resolve, reject) {
                                        $("#ContinueButton").click(function () {
                                            if ((userInputData.Code) && (userInputData.Code.replace("U-", "").length == 6)) {
                                                var input = com.ts.mobile.sdk.OtpInputOtpSubmission.createOtpSubmission(userInputData.Code.replace("U-", "").toString());
                                                var inputTargetBased = com.ts.mobile.sdk.TargetBasedAuthenticatorInput.createAuthenticatorInput(input);
                                                resolve(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(inputTargetBased));
                                            }
                                        });

                                        $("#ResendotpButton").click(function () {
                                            var resend = com.ts.mobile.sdk.OtpInputRequestResend.createOtpResendRequest();
                                            var inputTargetBased = com.ts.mobile.sdk.TargetBasedAuthenticatorInput.createAuthenticatorInput(resend);
                                            resolve(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(inputTargetBased));
                                        });
                                    });
                                }

                                OtpAuthenticatorSession.prototype.promiseRecoveryForError = function (error, validRecoveries, defaultRecovery) {
                                    setErrorPrompt(error);
                                    return Promise.resolve(defaultRecovery);
                                    // No recovery option is provided to the user
                                }

                                OtpAuthenticatorSession.prototype.endSession = function () {
                                    // xmui.XmUIHandler.getContainer(clientContext).empty();
                                }

                                function setErrorPrompt(error) {

                                    var errorData = error.getData();
                                    var retryattempt = ((errorData || {}).additional_data || {}).retries_left; // wrong_inputs_left for 5 attempts
                                    var locked = (((((errorData || {}).server_error_data || {}).failure_data || {}).reason || {}).data || {}).locked; //Needed for IT env due to proxy


                                    if (typeof locked != 'undefined' && locked) //it should happen in handlePolicyRejection function
                                    {
                                        broadcastError(LoginAssistantConstants.EnterCodeStatics.ENROLLMENT_ENTER_CODE_6_DIGIT_OTP_LOCK_OUT_ERR_MSG, retryattempt);
                                    }
                                    else if (typeof retryattempt != 'undefined' && retryattempt == 1) {
                                        broadcastError(LoginAssistantConstants.EnterCodeStatics.ENROLLMENT_ENTER_CODE_6_DIGIT_LAST_ATTEMPT_ERR_MSG, retryattempt);
                                    }
                                    else if (typeof retryattempt != 'undefined' && retryattempt > 0) {
                                        broadcastError(LoginAssistantConstants.EnterCodeStatics.ENROLLMENT_ENTER_CODE_6_DIGIT_INVALID_ERR_MSG, retryattempt);
                                    }
                                    else {
                                        broadcastError(); // catch unknownexceptions
                                    }

                                }

                                function broadcastError(msg, count) {
                                    $rootScope.$broadcast('TransmitError', msg, count);
                                }
                            }


                        };

                        LASUIHandler.prototype.createFormSession = function (formId, payload) {
                            var tsPayload = payload;
                            function FormSession(formId, payload, common) {
                                this.formId = formId;
                                this.payload = payload;
                                this.common = common;
                            }
                            $rootScope.$broadcast("AccountRetrievalvalidation", payload);
                            FormSession.prototype.getContainer = function (clientContext) {
                                return xmui.XmUIHandler.getContainer(clientContext);
                            };
                            FormSession.prototype.startSession = function (clientContext, actionContext) {
                                this.actionContext = actionContext;
                                this.clientContext = clientContext;
                            };
                            FormSession.prototype.promiseFormInput = function () {
                                return new Promise(function (resolve, reject) {
                                    $rootScope.$broadcast("ResetCommonValidation", tsPayload);
                                    $("input.button").click(function () {
                                        var inputData = userInputData;
                                        if (selectedAccount != null && multipleAccountType == null) {//OTP
                                            var data = {
                                                "data": {
                                                    "reset_option": "OTP",
                                                    "user_input": selectedAccount
                                                }
                                            };

                                        } else if (multipleAccountType != null) {//PIN
                                            var data = {
                                                "data": {
                                                    "reset_option": "PIN",
                                                    "user_input": {
                                                        "pin": inputData.PIN ? inputData.PIN : "",
                                                        "cvv": inputData.CVV ? inputData.CVV : "",
                                                        "expireDate": inputData.ExpirationDate ? inputData.ExpirationDate : "",
                                                        "zip": inputData.ZIPCode ? inputData.ZIPCode : ""
                                                    }

                                                }
                                            };
                                            if (multipleAccountType == LoginAssistantConstants.LA_DDA_ACCOUNT) {
                                                delete data.data.user_input.cvv;
                                                delete data.data.user_input.expireDate;
                                                delete data.data.user_input.zip;
                                                delete data.data.user_input.zipLLLMW;
                                            } else if (multipleAccountType == LoginAssistantConstants.LA_CCD_ACCOUNT) {
                                                delete data.data.user_input.pin;
                                                delete data.data.user_input.zipLLLMW;
                                                data.data.reset_option = "CVV";
                                                data.data.user_input["index"] = selectedAccount.index;
                                            } else if (multipleAccountType == LoginAssistantConstants.LA_LLLMW_ACCOUNT) {
                                                delete data.data.user_input.pin;
                                                delete data.data.user_input.cvv;
                                                delete data.data.user_input.expireDate;
                                                data.data.reset_option = "ZIP"
                                                data.data.user_input["index"] = selectedAccount.index;
                                            }

                                        } else {
                                            var data = {
                                                "data": {
                                                    "uid": inputData.PersonalId,
                                                    "ssn": inputData.pwdSSN
                                                }
                                            };

                                        }
                                        //  console.log(data);
                                        var formInput = com.ts.mobile.sdk.FormInput.createFormInputSubmissionRequest(data);
                                        resolve(formInput);
                                    });

                                    $rootScope.$on('resetFormInput', function (event, data) {
                                        var formInput = com.ts.mobile.sdk.FormInput.createFormInputSubmissionRequest("");
                                        resolve(formInput);
                                    });

                                }).catch(function (e) {
                                    // console.log(e);
                                });
                            };
                            FormSession.prototype.onContinue = function (payload) {

                            };
                            FormSession.prototype.onError = function (payload) {
                                $rootScope.$broadcast("ErrorMessageDisplay", payload);
                            };
                            FormSession.prototype.endSession = function () {
                            };

                            return new FormSession(formId, payload, this.common);
                        };
                    });
                }).catch(function (e) {
                    //console.log(e);
                });

            },

            getUserIdFromResponse: function (response) {
                if (response.server_status_desc != "") {
                    return response.server_status_desc;
                }
                else
                    if (response.uid != "") {
                        return "UID: " + response.uid;
                    }
                return "Unable to retrieve data. Please try again later!!!";
            },
            getUserData: function () {
                return this.userData;
            },
            setUserData: function (value) {
                this.userData = value;
            },
            getAccountOption: function () {
                return AccountOption;
            },
            setAccountOption: function (value) {
                AccountOption = value;
            },
            getUserInputData: function () {
                return userInputData;
            },
            setUserInputData: function (value) {
                userInputData = value;
            },
            getbbData: function () {
                return bbData;
            },
            setbbData: function (value) {
                bbData = value;
            },
            getResetCommonValue: function () {
                return ResetCommonData;
            },
            setResetCommonValue: function (value) {
                ResetCommonData = value;
            },
            getErrorMessage: function () {
                return ErrorMessage;
            },
            setErrorMessage: function (value) {
                ErrorMessage = value;
            },
            getPinValidationCount: function () {
                return PinValidationCount;
            },
            setPinValidationCount: function (value) {
                PinValidationCount = value;
            },
            getOTPValidationCount: function () {
                return OTPValidationCount;
            },
            setOTPValidationCount: function (value) {
                OTPValidationCount = value;
            },
            getChangeMethodAfterFourAttempts: function () {
                return ChangeMethodAfterFourAttempts;
            },
            setChangeMethodAfterFourAttempts: function (value) {
                ChangeMethodAfterFourAttempts = value;
            },
            getMultipleMobileNumber: function () {
                return MultipleMobileNumber;
            },
            setMultipleMobileNumber: function (value) {
                MultipleMobileNumber = value;
            },
            getContinueWithPassword: function () {
                return ContinueWithPassword;
            },
            setContinueWithPassword: function (value) {
                ContinueWithPassword = value;
            },
            getresetPassword: function () {
                return resetPassword;
            },
            setresetPassword: function (value) {
                resetPassword = value;
            },
            getresetpasswordflow: function () {
                return resetpasswordflow;
            },
            setresetpasswordflow: function (value) {
                resetpasswordflow = value;
            },
            getErrorCode: function () {
                return ErrorCode;
            },
            setErrorCode: function (value) {
                ErrorCode = value;
            },
            getUserFlow: function () {
                return UserFlow;
            },
            setUserFlow: function (value) {
                UserFlow = value;
            },
            getPersonalIDShield: function () {
                return PersonalIDShield;
            },
            setPersonalIDShield: function (value) {
                PersonalIDShield = value;
            },
            getChangePwd: function () {
                return ChangePwd;
            },
            setChangePwd: function (value) {
                ChangePwd = value;
            },
            getCancelURL: function () {
                return CancelURL;
            },
            setCancelURL: function (value) {
                CancelURL = value;
            },
            getDevices: function () {
                return Devices;
            },
            setDevices: function (value) {
                Devices = value;
            },
            getisGeneric: function () {
                return isGenericLanding;
            },
            setisGeneric: function (value) {
                isGenericLanding = value;
            }
        }

    };
})();
;
(function () {
    'use strict';

    angular
        .module('LoginAssistantModule')
        .controller('LoginAssistantIndexController', loginAssistantIndexController);

    loginAssistantIndexController.$inject = ['$scope', '$rootScope', '$state', '$http', '$location', 'CommonService', 'CommonConstants', 'LoginAssistantConstants', 'LoginAssistantService', 'ActimizeService'];

    function loginAssistantIndexController($scope, $rootScope, $state, $http, $location, commonService, commonConstants, LoginAssistantConstants, LoginAssistantService, actimizeService) {
        var logger = (function () {
            function writeToLog(message, isError) {
                if (isError && window.console && window.console.error) {
                    window.console.error(message);
                    return;
                }
                if (window.console && window.console.debug)
                    window.console.debug(message);
            }

            var obj = {};
            return {
                error: function (message) {
                    writeToLog(message, true);
                },
                debug: function (message) {
                    writeToLog(message, false);
                }
            };

        })();

        var nativeTSInvokeInProgress = false;
        var nativeTSInvokeCompleted = false;

        var vm = this;
        $scope.init = initialize;
        $scope.parentobj = {};
        $scope.parentobj.isBackDivDisplay = true;
        $scope.parentobj.isGenericLanding = false;
        $scope.parentobj.isBrowserBackButtonClicked = false;

        var rootUrl = document.querySelector(commonConstants.ROOT_URL_DIV_TEXT);
        var baseUrl = rootUrl.textContent || rootUrl.innerText;
        $scope.slide = LoginAssistantConstants.LA_SLIDE_RIGHT;
        var actimizeData = actimizeService.DeviceData();
        vm.rightVisible = false;
        //vm.IsTouch = commonService.getIsTouch().toLowerCase() === commonConstants.TRUE;
        var isTouch = commonService.getIsTouch() === "True" ? true : false;
        var IsTablet = isTouch === false ? false : (screen.availWidth >= 768) ? true : false;
        var loginAssistModel;
        $rootScope.$on('$stateChangeStart', function (event, toState) {
            if (angular.isDefined($scope.backClick) && $scope.backClick) {
                $scope.slide = LoginAssistantConstants.LA_SLIDE_LEFT;
                $scope.backClick = false;
            } else {
                $scope.slide = LoginAssistantConstants.LA_SLIDE_RIGHT;
            }
            vm.rightVisible = false;
            if (toState.data.pageTitle == LoginAssistantConstants.LA_PAGETITLE_RESET_COMMON) {
                if (vm.Model.Vcontext == LoginAssistantConstants.LAVerificationContext.LA_ID_SHIELD)
                    document.title = 'Login Assistance | ' + LoginAssistantConstants.GenericLandingStatics.LA_GENERIC_LANDING_RESET_ID_SHIELD;
                else
                    document.title = 'Login Assistance | ' + LoginAssistantConstants.GenericLandingStatics.LA_GENERIC_LANDING_RESET_PASSWORD;
            }
            else
                document.title = toState.data.pageTitle;

            $scope.parentobj.actualLocation = $location.path() == '/' + LoginAssistantConstants.LA_GENERICLANDING ? '' : $location.path();

        });



        $rootScope.$watch(function () { return $location.path() }, function (newLocation, oldLocation) {
            if ($scope.parentobj.actualLocation != "" && newLocation != "" && $scope.parentobj.actualLocation === newLocation) {
                $scope.parentobj.isBrowserBackButtonClicked = true;
                LoginAssistantService.handleReturnUrl(vm.Model.CancelUrl);
            }
        });

        function getQueryParams(k) {
            var p = {};
            location.search.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (s, k, v) { p[k] = v })
            return k ? p[k] : p;
        }

        function readCookie(a) {
            var b = document.cookie.match('(^|;)\\s*' + a + '\\s*=\\s*([^;]+)');
            return b ? b.pop() : '';
        }

        function initialize(model) {
            //Quick fix for SSO LAS via React login.
            //Read dest sessionStorage value to set LAS Model.dest sessionStorage set at SharedWidgetReact.aspx
            var destSessionStorageVal = window.sessionStorage.getItem('dest');
            if (destSessionStorageVal) {
                model.CancelUrl = destSessionStorageVal;
                model.HelpUrl = destSessionStorageVal + "?navigateToHelp";
                model.ClientName = 'Standalone';
            }

            vm.Model = model;
            var redirectUrlLAS = window.location.pathname;
            LoginAssistantService.setLoginAssistModel(vm.Model);

            if (getQueryParams("id") === "saforgotidmobile") {
                $scope.$on("RenderRetrieveMode", function (event, modes) {
                    $rootScope.$broadcast('busy.end', { remaining: 0 });
                    if (LoginAssistantService.getAccountType() == LoginAssistantConstants.LA_SHARED_ACCESS_BANKING) {
                        LoginAssistantService.setIdMethodType((modes.retrievalModes[LoginAssistantService.getAccountType()].options).toString());
                        $state.go(LoginAssistantConstants.LA_ENTERIDINFO);
                    } else {
                        LoginAssistantService.setRetrievalModes(modes.retrievalModes[LoginAssistantService.getAccountType()].options);
                        $state.go(LoginAssistantConstants.LA_CHOOSEIDMETHOD);
                    }
                });

                setTimeout(function () {
                    $rootScope.$broadcast('busy.begin');
                    LoginAssistantService.setUserType(LoginAssistantConstants.LA_SHARED_ACCESS_BANKING);
                    LoginAssistantService.setbbData(document.getElementById("bb_holder").innerText);
                    LoginAssistantService.setAccountType(LoginAssistantConstants.LA_SHARED_ACCESS_BANKING);
                    LoginAssistantService.invokeForgotIdPolicy();
                }, 1500);
            } else if (getQueryParams("brandIndicator") === "FOCUS") {
                if (redirectUrlLAS.includes("RetriveId")) {
                    // call .net api to get the guid
                    // call the transmit and pass the guid in the param
                    var method = commonConstants.METHOD_TYPE_POST;
                    var rootUrl = document.querySelector(commonConstants.ROOT_URL_DIV_TEXT).innerText || document.querySelector(commonConstants.ROOT_URL_DIV_TEXT).textContent;
                    var url = rootUrl + LoginAssistantConstants.LA_REDIRECT_FOCUS_URL;
                    vm.VerifyLASRequest = {};
                    vm.VerifyLASRequest.authCode = getQueryParams("mid");
                    vm.VerifyLASRequest.brandIndicator = getQueryParams("brandIndicator");
                    vm.VerifyLASRequest.function = LoginAssistantConstants.LA_REDIRECT_FORGET_USERID;
                    vm.VerifyLASRequest.aid = getQueryParams("aid");
                    LoginAssistantService.setFsvUser(true);
                    var headerData = commonConstants.HEADERDATA;
                    commonService.result(method, url, vm.VerifyLASRequest, headerData)
                        .success(function (result) {
                            if (result.StatusCode == '0') {
                                LoginAssistantService.setFSVGuid(result.Guid);
                                LoginAssistantService.setFSVReturnUrl(result.ReturnUrl);
                                LoginAssistantService.invokeForgotIdPolicy();
                            } else if (result.StatusCode == '-1' || result.statusCode == '-1') {
                                LoginAssistantService.setFsvRedirectionFails(true);
                                $state.go(LoginAssistantConstants.LA_MULTIPLEMOBILENUMBER);
                            }
                        }).error(function (result) {
                            LoginAssistantService.setFsvRedirectionFails(true);
                            $state.go(LoginAssistantConstants.LA_MULTIPLEMOBILENUMBER);
                        });
                    setTimeout(function () {
                        $rootScope.$on("AccountRetrievalvalidation", function (successfulAuth, responseData) {
                            LoginAssistantService.setFsvResponsePhoneNumber(responseData);
                            $state.go(LoginAssistantConstants.LA_MULTIPLEMOBILENUMBER);
                        });
                    }, 1500);
                    $scope.$on("ExceptionhandlePolicyRejection", function (event, errorData) {
                        $rootScope.$broadcast('busy.end', { remaining: 0 });
                        vm.loading = false;
                        vm.isFormSubmitted = true;
                        if (errorData != null) {
                            var err_msg = errorData.reason.data;
                            if (err_msg.action == "reject" && err_msg.code == 11132 && err_msg.reason == "email not found") {
                                LoginAssistantService.setFsvRedirectionFails(false);
                                $state.go(LoginAssistantConstants.LA_MULTIPLEMOBILENUMBER);
                                LoginAssistantService.setErrorCode(err_msg.code);
                            }
                        }
                    });
                } else if (redirectUrlLAS.includes("ResetPassword")) {
                    var method = commonConstants.METHOD_TYPE_POST;
                    var rootUrl = document.querySelector(commonConstants.ROOT_URL_DIV_TEXT).innerText || document.querySelector(commonConstants.ROOT_URL_DIV_TEXT).textContent;
                    var url = rootUrl + LoginAssistantConstants.LA_REDIRECT_FOCUS_URL;
                    vm.VerifyLASRequest = {};
                    vm.VerifyLASRequest.authCode = getQueryParams("mid");
                    vm.VerifyLASRequest.brandIndicator = getQueryParams("brandIndicator");
                    vm.VerifyLASRequest.function = LoginAssistantConstants.LA_REDIRECT_FORGET_PASSWORD;
                    vm.VerifyLASRequest.aid = getQueryParams("aid");
                    LoginAssistantService.setFsvUser(true);
                    var headerData = commonConstants.HEADERDATA;
                    commonService.result(method, url, vm.VerifyLASRequest, headerData)
                        .success(function (result) {
                            if (result.StatusCode == '0') {
                                LoginAssistantService.setFSVGuid(result.Guid);
                                LoginAssistantService.setFsvUsername(result.UserName);
                                LoginAssistantService.setFSVReturnUrl(result.ReturnUrl);
                                LoginAssistantService.setUserIdentifier(result.UserName);
                                LoginAssistantService.invokeResetPasswordPolicy();
                            } else if (result.StatusCode == '-1' || result.statusCode == '-1') {
                                LoginAssistantService.setFsvRedirectionFails(true);
                                $state.go(LoginAssistantConstants.LA_MULTIPLEMOBILENUMBER);
                            }
                        }).error(function (result) {
                            logger.error('customer verification failed.');
                            LoginAssistantService.setFsvRedirectionFails(true);
                            $state.go(LoginAssistantConstants.LA_MULTIPLEMOBILENUMBER);
                        });
                    
                    setTimeout(function () {
                        $rootScope.$on("AccountRetrievalvalidation", function (successfulAuth, responseData) {
                            LoginAssistantService.setFsvResponsePhoneNumber(responseData);
                            $state.go(LoginAssistantConstants.LA_MULTIPLEMOBILENUMBER);
                        });
                    }, 1500);
                    $scope.$on("ExceptionhandlePolicyRejection", function (event, errorData) {
                        $rootScope.$broadcast('busy.end', { remaining: 0 });
                        vm.loading = false;
                        vm.isFormSubmitted = true;
                        if (errorData != null) {
                            var err_msg = errorData.reason.data;
                            if (err_msg.action == "reject" && err_msg.code == 11132 && err_msg.reason == "email not found") {
                                LoginAssistantService.setFsvRedirectionFails(false);
                                $state.go(LoginAssistantConstants.LA_MULTIPLEMOBILENUMBER);
                                LoginAssistantService.setErrorCode(err_msg.code);
                            }
                        }
                    });
                }
            } else if (vm.Model.Vcontext == LoginAssistantConstants.LAVerificationContext.LA_GENERIC_LANDING) {
                $scope.parentobj.isGenericLanding = true;
                LoginAssistantService.setisGeneric(true);
                $state.go(LoginAssistantConstants.LA_GENERICLANDING);
            } else if (vm.Model.Vcontext == LoginAssistantConstants.LAVerificationContext.LA_PERSONEL_ID) {
                //invokeTransmitProcess();
                LoginAssistantService.setCancelURL(vm.Model.CancelUrl);
                $state.go(LoginAssistantConstants.LA_RETRIEVEPERSONALID);
            }
            else if (vm.Model.Vcontext == LoginAssistantConstants.LAVerificationContext.LA_CHANGEPASSWORD) {
                LoginAssistantService.setChangePwd(true);
                LoginAssistantService.setUserIdentifier(vm.Model.PersonalID);
                LoginAssistantService.invokeLoginAssistPolicy(vm.Model.PersonalID);
                //$state.go(LoginAssistantConstants.LA_RESETPASSWORD);

            }
            else if (vm.Model.Vcontext == LoginAssistantConstants.LAVerificationContext.LA_PASSWORD) {
                if (vm.Model.PersonalID && vm.Model.IsLocked) {
                    LoginAssistantService.invokeResetPasswordPolicy(vm.Model.PersonalID);
                } else {
                    LoginAssistantService.invokeResetPasswordPolicy("");
                }

            }
            else {
                LoginAssistantService.setPersonalIDShield(vm.Model.PersonalID);
                LoginAssistantService.invokeResetAnswerPolicy(vm.Model.PersonalID);
            }

        };



        $scope.$on("resetpwdNavigation", function (event, responseData) {
            if (responseData) {
                if (responseData.token) {
                    LoginAssistantService.setUserDataToken(responseData.token);
                } else {
                    LoginAssistantService.setUserDataToken(responseData._token);
                }
                LoginAssistantService.invokeForgotPasswordPolicy();
            }
        });

        $scope.$on("ResetpasswordFlow", function (event, response) {
            if (response)
                $state.go(LoginAssistantConstants.LA_RESETPASSWORD);
        });

        $scope.$on("ResetCommonValidation", function (event, responseData) {
            loginAssistModel = LoginAssistantService.getLoginAssistModel();
            if (responseData.inputs) {
                if (responseData.inputs.ssn) {
                    LoginAssistantService.setResetCommonValue(responseData);
                    loginAssistModel.ShowPersonalId = responseData.inputs.uid;
                    $state.go(LoginAssistantConstants.LA_RESETCOMMON);
                }
            }


        });

        $scope.onMenuClick = function () {
            vm.rightVisible = !vm.rightVisible;
        }

        $scope.onLoginClick = function () {
            LoginAssistantService.handleReturnUrl(vm.Model.CancelUrl);
        }
        $scope.onHelpClick = function () {
            LoginAssistantService.handleReturnUrl(vm.Model.HelpUrl);
        }
        $scope.setMainpageJawsInAccessible = function () {
            if (window.parent.document.getElementById('loginsLayout') != null)
                window.parent.document.getElementById('loginsLayout').setAttribute("aria-hidden", "true");
        }
        $scope.disableBack = false;
        $scope.onstartClick = function (event) {
            var loginAssistModel = LoginAssistantService.getLoginAssistModel();
            console.log(loginAssistModel.Vcontext);
            console.log(LoginAssistantConstants.LA_RETRIEVEPERSONALID);
            switch (loginAssistModel.Vcontext) {
                case LoginAssistantConstants.LAVerificationContext.LA_PERSONEL_ID:
                    LoginAssistantService.setMultipleAccountType();
                    LoginAssistantService.setSelectedAccount();
                    $state.go(LoginAssistantConstants.LA_RETRIEVEPERSONALID);
                    break;
                case LoginAssistantConstants.LAVerificationContext.LA_PASSWORD:
                    LoginAssistantService.setMultipleAccountType();
                    LoginAssistantService.setSelectedAccount();
                    LoginAssistantService.invokeResetPasswordPolicy("");
                    //  $state.go(LoginAssistantConstants.LA_RESETCOMMON);
                    break;
                case LoginAssistantConstants.LAVerificationContext.LA_ID_SHIELD:
                    LoginAssistantService.setMultipleAccountType();
                    LoginAssistantService.setSelectedAccount();
                    if (LoginAssistantService.getPersonalIDShield())
                        LoginAssistantService.invokeResetAnswerPolicy(LoginAssistantService.getPersonalIDShield());
                    else
                        LoginAssistantService.invokeResetAnswerPolicy("");
                    // $state.go(LoginAssistantConstants.LA_RESETCOMMON);
                    break;
            }
            //case LoginAssistantConstants.LA_RETRIEVEPERSONALID:
            $rootScope.$broadcast("resetFormInput", "");
        }
        $scope.onBackClick = function (event) {
            vm.isThirdPartySharedAccess = LoginAssistantService.getUserType() == LoginAssistantConstants.LA_SHARED_ACCESS_BANKING ? true : false;
            vm.EnterIdInfoDetails = LoginAssistantService.getEnterIdInfoDetails();
            if (!$scope.disableBack) {
                $scope.disableBack = true;

                $scope.backClick = true;

                if (window.parent.document.getElementById('loginsLayout') != null)
                    window.parent.document.getElementById('loginsLayout').setAttribute("aria-hidden", "false");

                var loginAssistModel = LoginAssistantService.getLoginAssistModel();
                switch ($state.current.name) {
                    case LoginAssistantConstants.LA_RETRIEVEPERSONALID:
                        if (LoginAssistantService.getisGeneric()) {
                            loginAssistModel.Vcontext = LoginAssistantConstants.LAVerificationContext.LA_GENERIC_LANDING;
                            LoginAssistantService.setLoginAssistModel(loginAssistModel);
                            $state.go(LoginAssistantConstants.LA_GENERICLANDING);
                        }
                        else {
                            $scope.setMainpageJawsInAccessible();
                            LoginAssistantService.handleReturnUrl(vm.Model.CancelUrl);
                        }
                        break;
                    case LoginAssistantConstants.LA_RESETCOMMON:
                        if (LoginAssistantService.getisGeneric()) {
                            loginAssistModel.Vcontext = LoginAssistantConstants.LAVerificationContext.LA_GENERIC_LANDING;
                            LoginAssistantService.setLoginAssistModel(loginAssistModel);
                            $state.go(LoginAssistantConstants.LA_GENERICLANDING);
                        }
                        else {
                            $scope.setMainpageJawsInAccessible();
                            LoginAssistantService.handleReturnUrl(vm.Model.CancelUrl);
                        }
                        break;
                    case LoginAssistantConstants.LA_RETRIEVEBUSINESSPERSONALID:
                        $state.go(LoginAssistantConstants.LA_RETRIEVEPERSONALID);
                        break;
                    case LoginAssistantConstants.LA_CHOOSEIDMETHOD:
                        //if (LoginAssistantService.getUserType() === LoginAssistantConstants.LA_BUSINESS_BANKING)
                        //    $state.go(LoginAssistantConstants.LA_RETRIEVEBUSINESSPERSONALID);
                        //else
                        $state.go(LoginAssistantConstants.LA_RETRIEVEPERSONALID);
                        break;
                    case LoginAssistantConstants.LA_ENTERIDINFO:
                        if (LoginAssistantService.getAccountType() == LoginAssistantConstants.LA_SHARED_ACCESS_BANKING)
                            $state.go(LoginAssistantConstants.LA_RETRIEVEPERSONALID);
                        else
                            $state.go(LoginAssistantConstants.LA_CHOOSEIDMETHOD);
                        break;
                    case LoginAssistantConstants.LA_ENTERBUSINESSIDINFO:
                        $state.go(LoginAssistantConstants.LA_CHOOSEIDMETHOD);
                        break;
                    case LoginAssistantConstants.LA_VERIFYIDENTITY:
                        if (loginAssistModel.Vcontext === LoginAssistantConstants.LAVerificationContext.LA_ID_SHIELD || loginAssistModel.Vcontext === LoginAssistantConstants.LAVerificationContext.LA_PASSWORD)
                            $state.go(LoginAssistantConstants.LA_RESETCOMMON, {
                                personalId: loginAssistModel.PersonalId
                            });
                        else if (LoginAssistantService.getUserType() === LoginAssistantConstants.LA_BUSINESS_BANKING && LoginAssistantService.getIdMethodType() === LoginAssistantConstants.LA_CARDORACCOUNT)
                            $state.go(LoginAssistantConstants.LA_ENTERBUSINESSIDINFO);
                        else if (LoginAssistantService.getIsSharedAccessMultipleAdmin() && LoginAssistantService.getUserType() == LoginAssistantConstants.LA_SHARED_ACCESS_BANKING)
                            $state.go(LoginAssistantConstants.LA_SELECT_ADMIN);
                        else
                            $state.go(LoginAssistantConstants.LA_ENTERIDINFO);
                        break;
                    case LoginAssistantConstants.LA_SELECT_ADMIN:
                        $state.go(LoginAssistantConstants.LA_ENTERIDINFO);
                        break;
                    case LoginAssistantConstants.LA_VERIFYIDENTITYVIATEXTOREMAIL:
                        $state.go(LoginAssistantConstants.LA_VERIFYIDENTITY);
                        break;
                    case LoginAssistantConstants.LA_MULTIPLEMOBILENUMBER:
                        if (LoginAssistantService.getChangeMethodAfterFourAttempts()) {
                            $state.go(LoginAssistantConstants.LA_VERIFYIDENTITYVIAACCOUNTNUMBERORPIN);
                        } else {
                            $state.go(LoginAssistantConstants.LA_VERIFYIDENTITY);
                        }

                        break;
                    case LoginAssistantConstants.LA_MULTIPLEACCOUNTS:
                        if (LoginAssistantService.getIsUserRedirectToPin()) { // OTP or Pin selection screen
                            $state.go(LoginAssistantConstants.LA_VERIFYIDENTITY);
                        } else {//Reset Common screen
                            if (loginAssistModel.Vcontext === LoginAssistantConstants.LAVerificationContext.LA_PASSWORD || loginAssistModel.Vcontext === LoginAssistantConstants.LAVerificationContext.LA_ID_SHIELD) {
                                $state.go(LoginAssistantConstants.LA_RESETCOMMON, {
                                    personalId: loginAssistModel.PersonalId
                                });
                            }
                            else {//Taxid screen for multiple business profiles found

                                if (LoginAssistantService.getAccountType() === LoginAssistantConstants.LA_BUSINESS_BANKING && LoginAssistantService.getMultipleAccountTypeforBack())
                                    $state.go(LoginAssistantConstants.LA_ENTERTAXID);
                                else
                                    $state.go(LoginAssistantConstants.LA_ENTERIDINFO, { idMethodType: LoginAssistantService.getIdMethodType() });
                            }
                        }
                        break;

                    case LoginAssistantConstants.LA_MULTIPLESHAREDACCESSADMINS:

                        if (loginAssistModel.Vcontext === LoginAssistantConstants.LAVerificationContext.LA_PASSWORD || loginAssistModel.Vcontext === LoginAssistantConstants.LAVerificationContext.LA_ID_SHIELD) {
                            $state.go(LoginAssistantConstants.LA_RESETCOMMON, {
                                personalId: loginAssistModel.PersonalId
                            });
                        }
                        else {//Taxid screen for multiple business profiles found
                            $state.go(LoginAssistantConstants.LA_ENTERIDINFO, { idMethodType: LoginAssistantService.getIdMethodType() });
                        }

                        break;
                    case LoginAssistantConstants.LA_ENTERCODE:
                        if (LoginAssistantService.getIsUserRedirectToPin()) { // OTP or Pin selection screen
                            $state.go(LoginAssistantConstants.LA_VERIFYIDENTITY);
                        } else if (LoginAssistantService.getChangeMethodAfterFourAttempts()) {
                            $state.go(LoginAssistantConstants.LA_VERIFYIDENTITYVIAACCOUNTNUMBERORPIN);
                        } else if (LoginAssistantService.getMultipleMobileNumber()) {
                            $state.go(LoginAssistantConstants.LA_MULTIPLEMOBILENUMBER);
                        }

                        else {//Reset Common screen
                            if (loginAssistModel.Vcontext === LoginAssistantConstants.LAVerificationContext.LA_PASSWORD || loginAssistModel.Vcontext === LoginAssistantConstants.LAVerificationContext.LA_ID_SHIELD) {
                                $state.go(LoginAssistantConstants.LA_RESETCOMMON, {
                                    personalId: loginAssistModel.PersonalId
                                });
                            }
                            else {//Taxid screen for multiple business profiles found

                                if (LoginAssistantService.getAccountType() === LoginAssistantConstants.LA_BUSINESS_BANKING && LoginAssistantService.getMultipleAccountTypeforBack())
                                    $state.go(LoginAssistantConstants.LA_ENTERTAXID);
                                else if (LoginAssistantService.getAccountType() === LoginAssistantConstants.LA_SHARED_ACCESS_BANKING && LoginAssistantService.setMultipleAccountSharedAccessforBack())
                                    $state.go(LoginAssistantConstants.LA_MULTIPLESHAREDACCESSADMINS);
                                else
                                    $state.go(LoginAssistantConstants.LA_ENTERIDINFO, { idMethodType: LoginAssistantService.getIdMethodType() });
                            }
                        }
                        break;
                    case LoginAssistantConstants.LA_PERSONALID:
                        if (LoginAssistantService.getIdMethodType() === LoginAssistantConstants.LA_PHONE || LoginAssistantService.getIdMethodType() === LoginAssistantConstants.LA_EMAIL) {
                            $state.go(LoginAssistantConstants.LA_ENTERCODE);
                        } else
                            $state.go(LoginAssistantConstants.LA_VERIFYIDENTITYVIAACCOUNTNUMBERORPIN);
                        break;
                    case LoginAssistantConstants.LA_VERIFYIDENTITYVIAACCOUNTNUMBERORPIN:
                        if (LoginAssistantService.getIsUserRedirectToPin()) { // OTP or Pin selection screen
                            $state.go(LoginAssistantConstants.LA_VERIFYIDENTITY);
                        } else if (LoginAssistantService.getChangeMethodAfterFourAttempts()) {
                            $state.go(LoginAssistantConstants.LA_ENTERCODE);
                        }
                        else {//Reset Common screen
                            if (loginAssistModel.Vcontext === LoginAssistantConstants.LAVerificationContext.LA_PASSWORD || loginAssistModel.Vcontext === LoginAssistantConstants.LAVerificationContext.LA_ID_SHIELD) {
                                $state.go(LoginAssistantConstants.LA_RESETCOMMON, {
                                    personalId: loginAssistModel.PersonalId
                                });
                            }
                            else {//Taxid screen for multiple business profiles found
                                if (LoginAssistantService.getAccountType() === LoginAssistantConstants.LA_BUSINESS_BANKING && LoginAssistantService.getMultipleAccountTypeforBack())
                                    $state.go(LoginAssistantConstants.LA_ENTERTAXID);
                                else
                                    $state.go(LoginAssistantConstants.LA_ENTERIDINFO, { idMethodType: LoginAssistantService.getIdMethodType() });
                            }
                        }
                        break;
                    case LoginAssistantConstants.LA_PROFILENOTFOUND:
                        if (loginAssistModel.Vcontext === LoginAssistantConstants.LAVerificationContext.LA_ID_SHIELD || loginAssistModel.Vcontext === LoginAssistantConstants.LAVerificationContext.LA_PASSWORD)
                            $state.go(LoginAssistantConstants.LA_RESETCOMMON, {
                                personalId: loginAssistModel.PersonalId
                            });
                        else
                            $state.go(LoginAssistantConstants.LA_ENTERIDINFO, { idMethodType: LoginAssistantService.getIdMethodType() });
                        break;
                    case LoginAssistantConstants.LA_SELECTACCOUNT:
                        //If the the User is not enrolled for Reset ID Shield/Phone or Email list is empty and the verification context is "Retrieve Personal ID"
                        if (LoginAssistantService.getIsUserRedirectToPin() && (loginAssistModel.Vcontext === LoginAssistantConstants.LAVerificationContext.LA_PERSONEL_ID)) {
                            if (LoginAssistantService.getUserType() === LoginAssistantConstants.LA_BUSINESS_BANKING && LoginAssistantService.getVerifyCustomerModel().IsMultipleUserIdentifier)
                                $state.go(LoginAssistantConstants.LA_ENTERTAXID);
                            else
                                $state.go(LoginAssistantConstants.LA_ENTERIDINFO, { idMethodType: LoginAssistantService.getIdMethodType() });
                        }
                        //If the the User is not enrolled for Reset ID Shield/Phone or Email list is empty and the verification context is "Retrieve ID Shield" or "Reset Password"
                        else if (LoginAssistantService.getIsUserRedirectToPin() && (loginAssistModel.Vcontext === LoginAssistantConstants.LAVerificationContext.LA_ID_SHIELD ||
                            loginAssistModel.Vcontext === LoginAssistantConstants.LAVerificationContext.LA_PASSWORD)) {
                            $state.go(LoginAssistantConstants.LA_RESETCOMMON, {
                                personalId: loginAssistModel.PersonalId
                            });
                        }
                        else {
                            $state.go(LoginAssistantConstants.LA_VERIFYIDENTITY);
                        }
                        break;
                    case LoginAssistantConstants.LA_ENTERTAXID:
                        $state.go(LoginAssistantConstants.LA_ENTERIDINFO, { idMethodType: LoginAssistantService.getIdMethodType() });
                        break;
                    case LoginAssistantConstants.LA_RESETPASSWORD:
                        if (loginAssistModel.Vcontext === LoginAssistantConstants.LAVerificationContext.LA_PASSWORD) {
                            if (LoginAssistantService.getIdMethodType() === LoginAssistantConstants.LA_PHONE || LoginAssistantService.getIdMethodType() === LoginAssistantConstants.LA_EMAIL)
                                $state.go(LoginAssistantConstants.LA_ENTERCODE);
                            else if (LoginAssistantService.getSecureOptionType() === LoginAssistantConstants.LA_SENDCODE) {
                                $state.go(LoginAssistantConstants.LA_ENTERCODE);
                            } else
                                $state.go(LoginAssistantConstants.LA_VERIFYIDENTITYVIAACCOUNTNUMBERORPIN);
                        }
                        else if (loginAssistModel.Vcontext === LoginAssistantConstants.LAVerificationContext.LA_PERSONEL_ID)
                            $state.go(LoginAssistantConstants.LA_PERSONALID);
                        else if (loginAssistModel.Vcontext === LoginAssistantConstants.LAVerificationContext.LA_ID_SHIELD)
                            $state.go(LoginAssistantConstants.LA_ENTERPASSWORD);
                        else if (loginAssistModel.Vcontext === LoginAssistantConstants.LAVerificationContext.LA_CHANGEPASSWORD)
                            LoginAssistantService.handleReturnUrl(vm.Model.CancelUrl);
                        break;
                    case LoginAssistantConstants.LA_ENTERPASSWORD:
                        if (LoginAssistantService.getSecureOptionType() === LoginAssistantConstants.LA_SENDCODE) {
                            $state.go(LoginAssistantConstants.LA_ENTERCODE);
                        } else
                            $state.go(LoginAssistantConstants.LA_VERIFYIDENTITYVIAACCOUNTNUMBERORPIN);
                        break;
                    default:
                        LoginAssistantService.handleReturnUrl(vm.Model.CancelUrl);
                        break;
                }
                setTimeout(function () {
                    $scope.disableBack = false;
                }, 4000)
            }



        };

        $scope.onCancelClick = function () {
            var checkFsvUser = LoginAssistantService.getFsvUser();
            if (window.parent.document.getElementById('loginsLayout') != null)
                window.parent.document.getElementById('loginsLayout').setAttribute("aria-hidden", "false");

            if (checkFsvUser) {
                var cancelReturnUrl = LoginAssistantService.getFSVReturnUrl();
                LoginAssistantService.handleReturnUrl(cancelReturnUrl);
            } else {
                LoginAssistantService.handleReturnUrl(vm.Model.CancelUrl);
            }
        };

        $scope.signOn = function (pwd) {
            var method = commonConstants.METHOD_TYPE_POST;
            var url = baseUrl + LoginAssistantConstants.LA_SET_GENERIC_CACHE_DATA_URL;
            var loginAssistModel = LoginAssistantService.getLoginAssistModel();
            var verifyCustomerModel = LoginAssistantService.getVerifyCustomerModel();
            if (loginAssistModel.Vcontext === LoginAssistantConstants.LAVerificationContext.LA_ID_SHIELD || loginAssistModel.IsIdShieldPasswordLocked) {

                vm.AuthRequestVm = {
                    Password: pwd,
                    AuthenticationType: LoginAssistantConstants.LA_TEMPORARYACCESSCODE,
                    AppName: loginAssistModel.AppName,
                    SignonID: angular.isDefined(loginAssistModel.PersonalID) ? loginAssistModel.PersonalID : LoginAssistantService.getUserIdentifier(),
                    IsExpired: loginAssistModel.PwdExpired,
                    BlackBoxData: document.getElementById("bb_holder") ? document.getElementById("bb_holder").innerText : "blackboxdata",
                    TransmitToken: LoginAssistantService.getUserDataToken()
                };
            } else {
                vm.AuthRequestVm = {
                    Password: pwd,
                    ActimizeData: actimizeData,
                    AppName: loginAssistModel.AppName,
                    SignonID: loginAssistModel.PersonalID,
                    IsExpired: loginAssistModel.PwdExpired,
                    BlackBoxData: document.getElementById("bb_holder") ? document.getElementById("bb_holder").innerText : "blackboxdata",
                    TransmitToken: LoginAssistantService.getUserDataToken()
                };
            }

            // vm.AuthRequestVm.IsIgUserLocked = verifyCustomerModel.IsIgUserLocked;
            vm.AuthRequestVm.CacheValue = loginAssistModel.AppName + "," + loginAssistModel.CancelUrl + "," + loginAssistModel.ReturnUrl + "," + (loginAssistModel.ClientName != null ? loginAssistModel.ClientName : "");
            var headerData = commonConstants.HEADERDATA;
            var inputData = { authRequestVm: vm.AuthRequestVm };
            commonService.result(method, url, inputData, headerData)
                .success(function (result) {
                    if (result != null) {
                        var personalId = loginAssistModel.PwdExpired ? loginAssistModel.PersonalID : LoginAssistantService.getUserIdentifier();
                        var data = personalId ? { 'PersonalId': personalId, 'ShieldImage.Password': pwd } : {};
                        var input = { verifyPwdModel: data };
                        if (result.OAMAuthUrl != '') {
                            data = { 'UserId': personalId, 'Password': pwd };
                            if (!loginAssistModel.IsInSession) {
                                $http.get('/OLS/LoginAssist/Login').then(function (response) {
                                    //Post to Protected resources
                                    protectedResource(data, result);
                                }, function (response) {
                                    $scope.$broadcast(LoginAssistantConstants.LA_SIGNON_ERRORMESSAGE_ID, LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M618);
                                });
                            } else {
                                //Post to Protected resources
                                protectedResource(data, result);
                            }

                        } else {
                            postToAuth(input);
                        }
                    }
                    else {
                        $scope.$broadcast(LoginAssistantConstants.LA_SIGNON_ERRORMESSAGE_ID, LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M618);
                    }
                }).error(function () {
                    $scope.$broadcast(LoginAssistantConstants.LA_SIGNON_ERRORMESSAGE_ID, LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M618);
                });
        };

        function protectedResource(data, result) {
            var method = commonConstants.METHOD_TYPE_POST;
            var headerData = commonConstants.HEADERDATA;
            //Post to Protected resources            
            commonService.result(method, LoginAssistantConstants.LA_PROTECTED_RESOURCE_URL, '', headerData)
                .success(function () {
                    postToOam(data, result.OAMAuthUrl);
                }).error(function () {
                    $scope.isValidResponse(null, LoginAssistantConstants.LA_PROTECTED_RESOURCE, true, true);
                });
        };


        function postToAuth(data) {
            var method = commonConstants.METHOD_TYPE_POST;
            var headerData = commonConstants.HEADERDATA;
            var loginAssistModel = LoginAssistantService.getLoginAssistModel();
            var dataToken = {
                "Token": LoginAssistantService.getUserDataToken(),
                "UserId": LoginAssistantService.getUserIdentifier(),
                "Policy": "password_login"
            };
            commonService.result(method, LoginAssistantConstants.LA_PASSWORD_WIDGET_URL, data, headerData)
                .success(function (response) {
                    if (response.Success) { //sucess , continue with signon
                        commonService.result(method, LoginAssistantConstants.LA_SIGNON_WITH_TRANSMIT_URL, dataToken, headerData)
                            .success(function (response) {
                                if (response.SignOnSuccess == true) {
                                    window.location = response.RedirectUrl;
                                } else {
                                    // console.log(response);
                                }
                            });
                    } else if (response.PasswordExpired) {
                        $scope.$broadcast(LoginAssistantConstants.LA_SIGNON_ERRORMESSAGE_ID, LoginAssistantConstants.PersonalIdStatics.LA_PASSWORD_ERROR_MESSAGE_EXPIRED);

                    } else if (response.UserLocked || response.InvalidLoginAttempts >= 5) {
                        LoginAssistantService.setErrorMessage(LoginAssistantConstants.PersonalIdStatics.LA_PASSWORD_ERROR_MESSAGE_M895);
                        $state.go(LoginAssistantConstants.LA_RESETPASSWORD);
                        /* if (loginAssistModel.Vcontext === LoginAssistantConstants.LAVerificationContext.LA_ID_SHIELD) {
                            loginAssistModel.IsIdShieldPasswordLocked = true;
                        } else {
                            loginAssistModel.ShowPersonalId = false;
                            loginAssistModel.IsIdShieldPasswordLocked = false;
                        }
                        loginAssistModel.InValidVContext = 'WrongInFlowPwd';
                        loginAssistModel.Vcontext = LoginAssistantConstants.LAVerificationContext.LA_PASSWORD;
                        LoginAssistantService.setLoginAssistModel(loginAssistModel);
                        $scope.parentobj.isBackDivDisplay = true;*/

                    } else {
                        /* if (response.InvalidLoginAttempts && response.InvalidLoginAttempts >= 1) {//show error message on same page
                             if (loginAssistModel.Vcontext == LoginAssistantConstants.LAVerificationContext.LA_ID_SHIELD ||
                                 loginAssistModel.Vcontext == LoginAssistantConstants.LAVerificationContext.LA_PERSONEL_ID) {
                                 //Omniture for id displayed enter password error page when wrong password entered by the user for the first/second/third/fourth time
                                 LoginAssistantService.CallSiteCatServiceForPageErrorMessage(loginAssistModel.Vcontext, response.InvalidLoginAttempts,
                                     LoginAssistantConstants.LA_O_PILOTUSERFIRSTTIMEERROR, LoginAssistantConstants.LA_O_PILOTUSERSECONDTIMEERROR,
                                     LoginAssistantConstants.LA_O_PILOTUSERTHIRDTIMEERROR, LoginAssistantConstants.LA_O_PILOTUSERFOURTHTIMEERROR,
                                     { "prop8": LoginAssistantService.getVerifyCustomerModel().HashedLpid, "eVar8": LoginAssistantService.getVerifyCustomerModel().HashedLpid });
                             }
                             $scope.$broadcast(LoginAssistantConstants.LA_SIGNON_ERRORMESSAGE_ID, response.ErrorMessage);
                         } else {
                             $scope.$broadcast(LoginAssistantConstants.LA_SIGNON_ERRORMESSAGE_ID, LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M618);
                         }*/
                        $scope.$broadcast(LoginAssistantConstants.LA_SIGNON_ERRORMESSAGE_ID, LoginAssistantConstants.PersonalIdStatics.LA_PASSWORD_ERROR_MESSAGE_M943);
                    }
                }).error(function () {
                    $scope.$broadcast(LoginAssistantConstants.LA_SIGNON_ERRORMESSAGE_ID, LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M618);
                });
        };

        function postToOam(data, url) {

            var loginAssistModel = LoginAssistantService.getLoginAssistModel();
            var dataToken = {
                "Token": LoginAssistantService.getUserDataToken(),
                "UserId": LoginAssistantService.getUserIdentifier(),
                "Policy": "password_login"
            };
            $http.post(url, data, {
                headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' },
                transformRequest: function (data) { return $scope.param(data); }
            }).then(function (response) {
                if (response.data.Success == true) {
                    
                        var method = commonConstants.METHOD_TYPE_POST;
                        var headerData = commonConstants.HEADERDATA;
                        var loginAssistModel = LoginAssistantService.getLoginAssistModel();
                        commonService.result(method, LoginAssistantConstants.LA_SIGNON_WITH_TRANSMIT_URL, dataToken, headerData)
                            .success(function (response) {
                                if (response != null) {
                                    if (response.SignOnSuccess) {
                                        $scope.parseJWTandSetCookie(LoginAssistantService.getUserDataToken());
                                        var decodeToken = parseJwt(LoginAssistantService.getUserDataToken());
                                        var AppName = loginAssistModel.AppName;
                                        var diyDestFlag = false;
                                        if (vm.Model.CancelUrl) {
                                            if (vm.Model.CancelUrl.toLowerCase().indexOf("client") != -1 || vm.Model.CancelUrl.toLowerCase().indexOf("dest") != -1) {
                                                diyDestFlag = true;
                                            }
                                        }
                                        if (loginAssistModel.Vcontext === LoginAssistantConstants.LAVerificationContext.LA_ID_SHIELD || loginAssistModel.IsIdShieldPasswordLocked) {
                                            diyDestFlag = true;
                                        }
                                        var genericSSOFlow = readCookie("GSF")
                                        if (!genericSSOFlow && !diyDestFlag && decodeToken && decodeToken.isDIYPilot && (AppName == undefined || AppName == null || AppName == "OLB")) {
                                            var CustomerDashboardUrl = document.getElementById("DIYRedirectUrl").value;
                                            var newCustomerDashboardUrl = "";
                                            if (CustomerDashboardUrl && CustomerDashboardUrl.length > 0) {
                                                newCustomerDashboardUrl = CustomerDashboardUrl;
                                            }
                                            else {
                                                newCustomerDashboardUrl = "/Auth/CustHubLandingPage.aspx"; // Hard coding it in case web.config value is coming null;
                                            }
                                            var token = LoginAssistantService.getUserDataToken();
                                            redirectToNewCustomerDashboard(newCustomerDashboardUrl, decodeToken.accesstoken, decodeToken.pilotFlags, decodeToken.isDIYPilot,token);
                                        }
                                        else {
                                            window.location = response.RedirectUrl;
                                        }
                                    }
                                }
                            })
                            .error(function () {
                                $scope.$broadcast(LoginAssistantConstants.LA_SIGNON_ERRORMESSAGE_ID, LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M618);
                            });
                    
                    
                } else if (response.data.PasswordExpired) {
                    $scope.$broadcast(LoginAssistantConstants.LA_SIGNON_ERRORMESSAGE_ID, LoginAssistantConstants.PersonalIdStatics.LA_PASSWORD_ERROR_MESSAGE_EXPIRED);
                } else if (response.data.UserLocked || response.data.InvalidLoginAttempts >= 5) {
                    LoginAssistantService.setErrorMessage(LoginAssistantConstants.PersonalIdStatics.LA_PASSWORD_ERROR_MESSAGE_M895);
                    //$scope.$broadcast(LoginAssistantConstants.LA_SIGNON_ERRORMESSAGE_ID, LoginAssistantConstants.PersonalIdStatics.LA_PASSWORD_ERROR_MESSAGE_M895);
                    $state.go(LoginAssistantConstants.LA_RESETPASSWORD);
                } else if (response.data.OAMUserDisabled == true && response.data.OAMUserDisabledCode == 5) {
                    $scope.$broadcast(LoginAssistantConstants.LA_SIGNON_ERRORMESSAGE_ID, LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_ACCOUNT_LOCKEDBY_FRAUD);
                } else if (response.data.SignOnSuccess ||
                    ((angular.isDefined(response.data.SignOnSuccess) && response.data.SignOnSuccess == false) && angular.isDefined(response.data.RedirectUrl))) {
                    $rootScope.$broadcast('busy.begin');
                    /*Start - TUX DIY User redirect to the new customer dashboard*/
                    var loginAssistModel = LoginAssistantService.getLoginAssistModel();                    
                    var decodeToken = parseJwt(LoginAssistantService.getUserDataToken());
                    var AppName = loginAssistModel.AppName;
                    var diyDestFlag = false;
                    $scope.isSSOUrl = false;
                    if (vm.Model.CancelUrl) {
                        if (vm.Model.CancelUrl.toLowerCase().indexOf("client") != -1 || vm.Model.CancelUrl.toLowerCase().indexOf("dest") != -1) {
                            diyDestFlag = true;
                            $scope.isSSOUrl = true;
                        }
                    }
                    if (loginAssistModel.Vcontext === LoginAssistantConstants.LAVerificationContext.LA_ID_SHIELD || loginAssistModel.IsIdShieldPasswordLocked) {
                        diyDestFlag = true;
                    }
                    $scope.parseJWTandSetSessionStorage(LoginAssistantService.getUserDataToken());
                    if (!diyDestFlag && decodeToken && decodeToken.isDIYPilot && (AppName != "" && AppName != undefined && AppName != null && AppName == "MBL")) {
                        //Fixing DA-6476 For Trigger the LOGIN FBA Event for TUX LAS DIY User
                        $http.get(response.data.RedirectUrl).then(function (response) {
                            var CustomerDashboardUrl = document.getElementById("DIYRedirectUrl").value;
                            var newCustomerDashboardUrl = "";
                            if (CustomerDashboardUrl && CustomerDashboardUrl.length > 0) {
                                newCustomerDashboardUrl = CustomerDashboardUrl;
                            }
                            else {
                                newCustomerDashboardUrl = "/Auth/CustHubLandingPage.aspx"; // Hard coding it in case web.config value is coming null;
                            }
                            var token = LoginAssistantService.getUserDataToken();
                            redirectToNewCustomerDashboard(newCustomerDashboardUrl, decodeToken.accesstoken, decodeToken.pilotFlags, decodeToken.isDIYPilot, token);
                        }, function (response) {
                            $scope.$broadcast(LoginAssistantConstants.LA_SIGNON_ERRORMESSAGE_ID, LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M618);
                        });
                    }
                    else {
                        window.location = response.data.RedirectUrl;
                    }
                    /*End - TUX DIY User redirect to the new customer dashboard*/
                } else {
                    $scope.$broadcast(LoginAssistantConstants.LA_SIGNON_ERRORMESSAGE_ID, LoginAssistantConstants.PersonalIdStatics.LA_PASSWORD_ERROR_MESSAGE_M943);
                }
            }, function (response) {
                $scope.$broadcast(LoginAssistantConstants.LA_SIGNON_ERRORMESSAGE_ID, LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M618);
            });
        };

        $scope.param = function (a) {
            var r20 = /%20/g,
                prefix,
                s = [],
                add = function (key, value) {
                    value == null ? "" : value;
                    s[s.length] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
                };
            for (prefix in a) {
                add(prefix, a[prefix]);
            }
            return s.join("&").replace(r20, "+");
        };

        $scope.parseJWTandSetCookie = function (token) {
            var base64Url = token.split('.')[1];
            var base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');
            var jsonPayload = decodeURIComponent(atob(base64).split('').map(function (c) {
                return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
            }).join(''));

            var decodedToken = JSON.parse(jsonPayload);
            if (decodedToken) {
                var storage = window.sessionStorage;
                if (storage) {
                    if (decodedToken.accesstoken) {
                        storage.setItem('AccessToken', decodedToken.accesstoken);
                    }
                    if (decodedToken.pilotFlags) {
                        storage.setItem('pilotflags', decodedToken.pilotFlags);
                    }
                    if (decodedToken.isDIYPilot) {
                        storage.setItem('isDIYPilot', decodedToken.isDIYPilot);
                    }
                    if (decodedToken.InteractionId) {
                        storage.setItem('InteractionId', decodedToken.InteractionId);
                    }
                }
            }

        };

        $scope.parseJWTandSetSessionStorage = function (token) {
            var base64Url = token.split('.')[1];
            var base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');
            var jsonPayload = decodeURIComponent(atob(base64).split('').map(function (c) {
                return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
            }).join(''));

            var decodedToken = JSON.parse(jsonPayload);
            if (decodedToken) {
                var storage = window.sessionStorage;
                if (storage) {
                    var Accesstoken = decodedToken.accesstoken;
                    var DIYPilotFlag = decodedToken.pilotFlags;
                    var JwToken = token;
                    var tsUserId = decodedToken.sub;
                    var ts_appid = decodedToken.aud;
                    var deviceId = decodedToken.did;
                    var InteractionId = decodedToken.InteractionId;
                    var sessionId = decodedToken.sid;
                    var IsDIYPilot = decodedToken.isDIYPilot;
                    var tsDeviceIdKey = "ts:deviceId:" + tsUserId;
                    var tsSessionIdKey = "ts:sessionId:" + tsUserId;

                    function createSessionStorage(key, val) {
                        if (storage && storage.getItem(key) === null) {
                            if (val !== null && val !== '') {
                                storage.setItem(key, val);
                            }
                        }
                    }
                    createSessionStorage('ts:appid', ts_appid);
                    createSessionStorage('ts:userid', tsUserId);
                    createSessionStorage('ts:usertkn', JwToken);
                    createSessionStorage('pilotflags', DIYPilotFlag);
                    createSessionStorage('AccessToken', Accesstoken);
                    createSessionStorage('InteractionId', InteractionId);
                    createSessionStorage('isDIYPilot', IsDIYPilot);
                    createSessionStorage('isSSOUrl', $scope.isSSOUrl);
                    createSessionStorage(tsDeviceIdKey, deviceId);
                    createSessionStorage(tsSessionIdKey, sessionId);
                }
            }
        };

        function isValidResponse(response) {
            var responseValid = validateServerResponse(response);
            return responseValid.isValidResponse;
        };

        function validateServerResponse(response) {
            if (!response || !response.headers()) {
                return { isValidResponse: false, isNullResponse: true, isOAMError: false, isUAGError: false };
            }

            var jsonContentType = "application/json";

            var responseType = response.headers()["content-type"];
            if (responseType && responseType.indexOf(jsonContentType) >= 0) {
                return { isValidResponse: true, isNullResponse: false, isOAMError: false, isUAGError: false };
            }

            var webHeader = response.headers()["web"];
            var isUagError = !webHeader || (webHeader.toUpperCase().indexOf("OBC") < 0 && webHeader.toUpperCase().indexOf("EPOC") < 0);
            return { isValidResponse: false, isNullResponse: false, isOAMError: !isUagError, isUAGError: isUagError };
        };

        function invokeTransmitProcess() {
            logger.debug('starting transmit process');

            var isTouch = commonService.getIsTouch() === "True" ? true : false;
            var isMobileWeb = LoginAssistantService.isMobileWeb();
            var isIOSDevice = LoginAssistantService.isIOSDevice();
            var isAndroidDevice = isTouch && !isMobileWeb && !isIOSDevice;
            var context_data;
            var tokenFromDevice;

            logger.debug('isTouch: ' + isTouch);
            logger.debug('isMobileWeb: ' + isMobileWeb);
            logger.debug('isIOSDevice: ' + isIOSDevice);
            logger.debug('isAndroidDevice: ' + isAndroidDevice);
            //invokeWebTransmit();
            var loginAssistModel = LoginAssistantService.getLoginAssistModel();
            var userId = loginAssistModel.PersonalID.toLowerCase();
            LoginAssistantService.invokeLoginAssistPolicy(userId);
            function invokeVerifyCustomer(xm, accept, reject) {

                logger.debug('starting to verify customer');

                var method = commonConstants.METHOD_TYPE_POST; //POST
                var rootUrl = document.querySelector(commonConstants.ROOT_URL_DIV_TEXT).innerText || document.querySelector(commonConstants.ROOT_URL_DIV_TEXT).textContent; // "/OLS/"
                var url = rootUrl + LoginAssistantConstants.LA_VALIDATECUSTOMER_ACTION_URL;
                var inputData = {};
                var headerData = commonConstants.HEADERDATA;

                inputData.ContextData = LoginAssistantService.getContextData();
                inputData.AppId = (isIOSDevice || isAndroidDevice) ? 'mbl' : 'web';
                inputData.SignonID = loginAssistModel.PersonalID;
                inputData.Expired = loginAssistModel.PwdExpired;
                inputData.RequestContext = loginAssistModel.RequestContext;

                commonService.result(method, url, inputData, headerData)
                    .success(function (result) {
                        if (result && result.AllowReset && result.TransmitToken) {

                            logger.debug('succesfully verified customer');
                            var sessionData = JSON.parse(sessionStorage.getItem("currentSession"));
                            result.AppId = (isIOSDevice || isAndroidDevice) ? 'mbl' : 'web';
                            result.Policy = 'login_assist';
                            result.DeviceId = xm ? sessionData.device_id : sessionData.device_id;
                            result.ContextData = context_data;

                            LoginAssistantService.setVerifyCustomerModel(result);
                            if (result && result.TransmitToken)
                                processResult(result.TransmitToken, accept);
                            else {
                                if (reject)
                                    reject({ Reason: 'UnExpected Error' });
                                else
                                    errorHandler("Token is empty");
                            }
                        }
                        else {
                            logger.error('customer verification failed.');
                            reject(result);
                        }
                    }).error(function (err) {
                        logger.error('customer verification failed.');

                        LoginAssistantService.removeVoiceOverFocus("loading_progress");
                        $scope.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M618);
                        //callSiteCatServiceForSystemUnavailableMessage();

                        if (reject)
                            reject({ Reason: 'UnExpected Error' });
                        else
                            errorHandler(err);
                    });
            }

            function errorHandler(err) {
                logger.error('running error handler after customer verification.');
                $rootScope.$broadcast('busy.end', { remaining: 0 });
                //console.log(err);

                vm.Model.Vcontext = LoginAssistantConstants.LAVerificationContext.LA_RESETPASSWORD;
                $state.go(LoginAssistantConstants.LA_RESETCOMMON, {
                    personalId: loginAssistModel.PersonalID
                });
            }

            function successHandler() {
                logger.debug('running succes handler after customer verification.');
                if (tokenFromDevice != undefined && tokenFromDevice != null)
                    LoginAssistantService.setLASTransmitToken(tokenFromDevice);
                $rootScope.$broadcast('busy.end', { remaining: 0 });
                if (loginAssistModel.Vcontext == LoginAssistantConstants.LAVerificationContext.LA_PASSWORD) {
                    $state.go(LoginAssistantConstants.LA_RESETPASSWORD);
                }
                else if (loginAssistModel.Vcontext == LoginAssistantConstants.LAVerificationContext.LA_ID_SHIELD) {
                    $state.go(LoginAssistantConstants.LA_ENTERPASSWORD)
                }
                else if (vm.Model.Vcontext == LoginAssistantConstants.LAVerificationContext.LA_CHANGEPASSWORD) {
                    $state.go(LoginAssistantConstants.LA_RESETPASSWORD);
                }
                else {
                    $state.go(LoginAssistantConstants.LA_PERSONALID);
                }
            }

            function processResult(token, acceptHandler) {
                logger.debug('starting process token after customer verification.');

                if (isAndroidDevice && typeof (IDSheildConfigJSInterface) !== "undefined") {
                    logger.debug('Posting data to Android device.');

                    IDSheildConfigJSInterface.resumePlaceHolderFromNative(token);
                    //Defect 27610 - MOB[DMA]-System Unavailabe error when trying to enroll a branch-issued UID
                    //successHandler();
                    //return;
                }

                if (isIOSDevice && typeof (resumePlaceHolderFromNative) !== "undefined") {
                    logger.debug('Posting data to iOS device.');
                    resumePlaceHolderFromNative(token);
                    //Defect 27610 - MOB[DMA]-System Unavailabe error when trying to enroll a branch-issued UID
                    //successHandler();
                    //return;
                }

                if (acceptHandler) {
                    logger.debug('Invoking Web SDK Success Handler.');
                    acceptHandler({ "token": token });
                }
            }


            function invokeMobileTransmit() {
                logger.debug('Registering Interfaces for Mobile Transmit Invocation.');

                // This method will be called from Device once the getAuthenticatorFromNative is injected
                window.initiateTransmitForDevice = function () {

                    if (nativeTSInvokeInProgress) {
                        logger.debug('TS Call in progress');
                        return;
                    }

                    if (nativeTSInvokeCompleted) {
                        logger.debug('TS Call already completed');
                        return;
                    }

                    nativeTSInvokeInProgress = true;

                    logger.debug('Starting Mobile Transmit.');

                    try {
                        if (isAndroidDevice && typeof (IDSheildConfigJSInterface) === "undefined")
                            logger.error("getAuthenticatorFromNative is not defined on the Android Device");

                        if (isIOSDevice && typeof (getAuthenticatorFromNative) === "undefined")
                            logger.error("getAuthenticatorFromNative is not defined on the iOS Device");
                        var params = {
                            policyname: 'login_assist',
                            username: loginAssistModel.PersonalID
                        };
                        if (isAndroidDevice && typeof (IDSheildConfigJSInterface) !== "undefined") {
                            logger.debug('Calling into Android device.');
                            IDSheildConfigJSInterface.getAuthenticatorFromNative(JSON.stringify(params));
                        }

                        if (isIOSDevice && typeof (getAuthenticatorFromNative) !== "undefined") {
                            logger.debug('Calling into iOS Device.');
                            getAuthenticatorFromNative(params);
                        }

                        nativeTSInvokeCompleted = true;
                    }
                    catch (ex) {
                        logg.error('Exception while invoking TS.')
                        logger.error(ex);
                    }

                    nativeTSInvokeInProgress = false;
                };

                // This method will be called from Device once the getAuthenticatorFromNative is injected
                window.getAuthenticatorNativeResponse = function getAuthenticatorNativeResponse(response) {
                    logger.debug('Received token from Device');
                    logger.debug(response);

                    if (response.data) {
                        context_data = response.data;
                    }

                    invokeVerifyCustomer();
                };

                //Defect 27610 - MOB[DMA]-System Unavailabe error when trying to enroll a branch-issued UID
                window.getResumePlaceHolderFromNativeResponse = function (response) {
                    logger.debug('Received token from Device');
                    if (response != undefined && response != null) {
                        if (response.result == "success")
                            tokenFromDevice = response.token;
                    }
                    successHandler();
                    return;
                };
            }

            $rootScope.$broadcast('busy.begin');

            LoginAssistantService.setVoiceOverFocus("loading_progress");
            var loginAssistModel = LoginAssistantService.getLoginAssistModel();

            if (isIOSDevice || isAndroidDevice) {
                invokeMobileTransmit();
            }
            else {
                LoginAssistantService.invokeLoginAssistPolicy(userId);
            }
        }

        function parseJwt(token) {
            var base64Url = token.split('.')[1];
            var base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');
            var jsonPayload = decodeURIComponent(atob(base64).split('').map(function (c) {
                return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
            }).join(''));
            var decodedToken = JSON.parse(jsonPayload);
            return decodedToken;
        }

        function redirectToNewCustomerDashboard(applyUrl, Accesstoken, PilotFlags, isDIYPilot, Token) {
            var laform = document.createElement('form');
            laform.id = "laform";
            laform.method = "POST";
            laform.action = applyUrl;
            var decodedToken = parseJwt(Token);
            var deviceId = decodedToken.did ? decodedToken.did : "";
            var sessionId = decodedToken.sid ? decodedToken.sid : "";
            var tsUserId = decodedToken.sub ? decodedToken.sub : "";
            var tsAppId = decodedToken.aud ? decodedToken.aud : "";
            var currentSession = "";
            var storage = window.sessionStorage;
            if (storage) {
                currentSession = storage.getItem("currentSession") ? storage.getItem("currentSession") : null;
            }
            var encodedCurrentSession = currentSession.replace(/&/g, "&amp;").replace(/>/g, "&gt;").replace(/</g, "&lt;").replace(/"/g, "&quot;");
            var accesstoken = document.createElement("INPUT");
            var diyPilotFlag = document.createElement("INPUT");
            var isDIYPilotInput = document.createElement("INPUT");
            var jwToken = document.createElement("INPUT");
            var TsUserId = document.createElement("INPUT");
            var TsAppId = document.createElement("INPUT");
            var CurrentSession = document.createElement("INPUT");
            var DeviceId = document.createElement("INPUT");
            var SessionId = document.createElement("INPUT");

            accesstoken.name = "Accesstoken";
            accesstoken.value = Accesstoken;
            accesstoken.type = 'hidden';

            diyPilotFlag.name = "DIYPilotFlag";
            diyPilotFlag.value = PilotFlags;
            diyPilotFlag.type = 'hidden';

            isDIYPilotInput.name = "isDIYPilot";
            isDIYPilotInput.value = isDIYPilot;
            isDIYPilotInput.type = 'hidden';

            jwToken.name = "JwToken";
            jwToken.value = Token;
            jwToken.type = 'hidden';

            TsUserId.name = "tsUserId";
            TsUserId.value = tsUserId;
            TsUserId.type = 'hidden';

            TsAppId.name = "ts_appid";
            TsAppId.value = tsAppId;
            TsAppId.type = 'hidden';

            CurrentSession.name = "currentSession";
            CurrentSession.value = encodedCurrentSession;
            CurrentSession.type = 'hidden';

            DeviceId.name = "deviceId";
            DeviceId.value = deviceId;
            DeviceId.type = 'hidden';

            SessionId.name = "sessionId";
            SessionId.value = sessionId;
            SessionId.type = 'hidden';

            laform.appendChild(accesstoken);
            laform.appendChild(diyPilotFlag);
            laform.appendChild(isDIYPilotInput);
            laform.appendChild(jwToken);
            laform.appendChild(TsUserId);
            laform.appendChild(TsAppId);
            laform.appendChild(CurrentSession);
            laform.appendChild(DeviceId);
            laform.appendChild(SessionId);

            document.body.appendChild(laform);
            laform.submit();
        }
    };
})();;
/// <reference path="../loginassist/passwordvalidationdirective.js" />
(function () {
    'use strict';

    angular
        .module('LoginAssistantModule')
        .controller('RetrievePersonalIdController', retrievePersonalIdController);

    retrievePersonalIdController.$inject = ['$scope', '$rootScope', '$state', 'LoginAssistantConstants', 'LoginAssistantService', '$timeout', '$compile'];

    function retrievePersonalIdController($scope, $rootScope, $state, LoginAssistantConstants, LoginAssistantService, $timeout, $compile) {
        var vm = this;
        $scope.parentobj.isBackDivDisplay = true;
        vm.userTypeSelection = userTypeSelection;
        vm.RetrivePersonalIDStatics = LoginAssistantConstants.RetrivePersonalIDStatics;
        vm.CancelButton = LoginAssistantConstants.LA_CANCELBUTTON;
        vm.ChooseIdMethodStatics = LoginAssistantConstants.ChooseIdMethodStatics;
        vm.loginAssistModel = LoginAssistantService.getLoginAssistModel();
        vm.SharedAccesskillSwitch = false;
        if (!vm.loginAssistModel.IsEntitlments3rdpartyKillSwitchEnabled) {
            vm.SharedAccesskillSwitch = true;
        }
                   
        vm.onTabKeyPress = onTabKeyPress;       

        if (document.getElementById("footer") != null)
            document.getElementById("footer").removeAttribute("style");

        if (document.getElementsByClassName("iframeholder") != null && document.getElementsByClassName("iframeholder")[0] != null)
            document.getElementsByClassName("iframeholder")[0].style.height = "auto";

        $scope.initialize = function () {
            if (window.parent.document.getElementById('loginsLayout') != null)
                window.parent.document.getElementById('loginsLayout').setAttribute("aria-hidden", "true");
        }
       
        document.getElementById("la_progress_bar").outerHTML = "<progress role='progressbar' aria-valuenow='15' aria-valuetext='Your progress : 15%' max='100' value='15' />";
       // document.getElementById("headerBackLink").style.display = 'block';
       // document.getElementById("headerstartLink").style.display = 'none';
        
        $timeout(function () {
            document.getElementById("headerBackLink").style.display = 'block';
            document.getElementById("headerstartLink").style.display = 'none';
        }, 100);

        $timeout(function () {

            window.scrollTo(0, 0);
            if (document.getElementById("headerBackLink") != null)
                document.getElementById("headerBackLink").blur();
            
            LoginAssistantService.setHeaderFocus("headingMainText");

        }, 500);

       

        // Start : Omniture for retrieve id select personal or business 
        // Omniture for retrieve id select personal or business screen when user gets directed to this page after entering wrong ID multiple times 
        if (vm.loginAssistModel.InValidVContext === 'WrongPersonalId') {
            LoginAssistantService.CallSiteCatService(LoginAssistantConstants.LA_O_RETRIEVEID, vm.RetrivePersonalIDStatics.LA_O_RETRIEVEPERSONALIDDIRECTEDLOCKEDOUT);
        }
        //CI July Release B-36094 - START
        else if (vm.loginAssistModel.ErrorCode === '80000002') {
            LoginAssistantService.CallSiteCatService(LoginAssistantConstants.LA_O_RETRIEVEID, vm.RetrivePersonalIDStatics.LA_O_RETRIEVEPERSONALIDALREADYENROLLED);
        }
        else {
            LoginAssistantService.CallSiteCatService(LoginAssistantConstants.LA_O_RETRIEVEID, vm.RetrivePersonalIDStatics.LA_O_RETRIEVEID);
        }
        //CI July Release B-36094 - END
        // End : Omniture for retrieve id select personal or business 


        function userTypeSelection(userType) {
            $rootScope.$broadcast('busy.begin');
            LoginAssistantService.setUserType(userType);
            if(userType == LoginAssistantConstants.LA_SHARED_ACCESS_BANKING || userType == LoginAssistantConstants.LA_PERSONAL_BANKING || userType == LoginAssistantConstants.LA_BUSINESS_BANKING)
            {
                LoginAssistantService.setbbData(document.getElementById("bb_holder").innerText);
                LoginAssistantService.setAccountType(userType);
                LoginAssistantService.invokeForgotIdPolicy();
            }else if (userType == LoginAssistantConstants.LA_DONT_HAVE_ACCOUNT){
                var dontHaveAccountUrl = "";
                var dontHaveAccountUrlVal = document.getElementById("divDontHaveAccountUrl").value;                
                if (dontHaveAccountUrlVal && dontHaveAccountUrlVal.length > 0) {
                    dontHaveAccountUrl = dontHaveAccountUrlVal;
                }

                //Need to redirect to the given URL

                $rootScope.$broadcast('busy.end', { remaining: 0 });
            }else{		
			}
            
        }
        $scope.$on("RenderRetrieveMode", function (event, modes) {
           // console.log(modes);
            $rootScope.$broadcast('busy.end', { remaining: 0 });           
            if (LoginAssistantService.getAccountType() == LoginAssistantConstants.LA_SHARED_ACCESS_BANKING) {
                LoginAssistantService.setIdMethodType((modes.retrievalModes[LoginAssistantService.getAccountType()].options).toString());
                 $state.go(LoginAssistantConstants.LA_ENTERIDINFO);
            }
            else {
                LoginAssistantService.setRetrievalModes(modes.retrievalModes[LoginAssistantService.getAccountType()].options);
                $state.go(LoginAssistantConstants.LA_CHOOSEIDMETHOD);
                
                //console.log(LoginAssistantService.getRetrievalModes())
            }
            
        });
       
       

        function onTabKeyPress(evt) {
            if (evt.which == 9) {
                evt.preventDefault();
                angular.element(document.getElementsByClassName("padding-width"))[0].focus();
            }
        }
    };
})();;
(function () {
    'use strict';

    angular
        .module('LoginAssistantModule')
        .controller('ChooseIdMethodController', chooseIdMethodController);

    chooseIdMethodController.$inject = ['$scope', '$state', 'CommonService', 'CommonConstants', 'LoginAssistantConstants', 'LoginAssistantService', '$timeout'];

    function chooseIdMethodController($scope, $state, commonService, commonConstants, LoginAssistantConstants, LoginAssistantService, $timeout) {
        var vm = this;
        vm.ChooseIdMethodStatics = LoginAssistantConstants.ChooseIdMethodStatics;
        vm.CancelButton = LoginAssistantConstants.LA_CANCELBUTTON;
        vm.IsTouch = commonService.getIsTouch().toLowerCase() === commonConstants.TRUE;
        vm.IdMethodSelection = idMethodSelection;
        vm.UserType = LoginAssistantService.getUserType();
        vm.loginAssistModel = LoginAssistantService.getLoginAssistModel();

        document.getElementById("la_progress_bar").outerHTML = "<progress role='progressbar' aria-valuenow='25' aria-valuetext='Your progress : 25%' max='100' value='25' />";

        document.getElementById("headerBackLink").style.display = 'none';
        document.getElementById("headerstartLink").style.display = 'block';
        //document.getElementById("headerBackLink").replaceWith("<a data-ng-click='' aria-label='start over' role='link' tabindex='0' class='la__curson-pointer la__desktop-header-back-newStyle-link padding-width' id='headerBackLink'>");

        $scope.setMainpageJawsInAccessible();
        if ($scope.parentobj.isGenericLanding) {
            $scope.parentobj.isGenericLanding = false;
            $state.go(LoginAssistantConstants.LA_GENERICLANDING);
        }
        $timeout(function () {
            
            window.scrollTo(0, 0);
            if (document.getElementById("headerBackLink") != null)
                document.getElementById("headerBackLink").blur();

            LoginAssistantService.setHeaderFocus("headingMainText");
        }, 500);

        // Start : Omniture for retrieve personal id personal/business select id method
        LoginAssistantService.CallSiteCatService(LoginAssistantConstants.LAVerificationContext.LA_PERSONEL_ID, vm.ChooseIdMethodStatics.LA_O_SELECTIDMETHOD);
        // End : Omniture for retrieve personal id personal/business select id method

        $scope.modes = LoginAssistantService.getRetrievalModes();
        function idMethodSelection(idMethod) {
            LoginAssistantService.setIdMethodType(idMethod);
            
            if (idMethod === LoginAssistantConstants.LA_CARDORACCOUNT && LoginAssistantService.getAccountType() === LoginAssistantConstants.LA_BUSINESS_BANKING) {
                LoginAssistantService.setIdMethodType(LoginAssistantConstants.LA_BUSSINESS_CARDORACCOUNT);
                $state.go(LoginAssistantConstants.LA_ENTERBUSINESSIDINFO);
            }
            else {
                $state.go(LoginAssistantConstants.LA_ENTERIDINFO);
            }
        }
       
    };
})();;

(function () {
    'use strict';

    angular
        .module('LoginAssistantModule')
        .controller('EnterIdInfoController', enterIdInfoController);

    enterIdInfoController.$inject = ['$scope', '$rootScope', '$state', 'CommonService', 'CommonConstants', 'LoginAssistantConstants', '$stateParams', 'LoginAssistantService', '$sce', 'OpenModalService', '$timeout'];

    function enterIdInfoController($scope, $rootScope, $state, commonService, commonConstants, LoginAssistantConstants, $stateParams, LoginAssistantService, $sce, openModalService, $timeout) {
        var vm = this;
        vm.IsTouch = commonService.getIsTouch().toLowerCase() === commonConstants.TRUE;
        vm.idMethodType = LoginAssistantService.getIdMethodType();
        vm.EnterIdInfoStatics = LoginAssistantConstants.EnterIdInfoStatics;
        vm.NextButton = LoginAssistantConstants.LA_CONTINUEBUTTON;
        vm.ChooseIdMethodStatics = LoginAssistantConstants.ChooseIdMethodStatics;
        vm.CancelButton = LoginAssistantConstants.LA_CANCELBUTTON;
        vm.EmailPattern = LoginAssistantConstants.LA_EMAIL_PATTERN;
        vm.isThirdPartySharedAccess = LoginAssistantService.getUserType() == LoginAssistantConstants.LA_SHARED_ACCESS_BANKING ? true : false;
        vm.CardNumberPattern = LoginAssistantConstants.LA_CARDNUMBER_PATTERN;
        vm.ErrorMessage = '';
        vm.isFormSubmitted = false;
        vm.loading = false;
        vm.Admins = [];
        vm.Admin_Del_UID = {};
        var i = 0;
        var j = 0;
        var count;
        vm.loginAssistModel = LoginAssistantService.getLoginAssistModel();

        document.getElementById("la_progress_bar").outerHTML = "<progress role='progressbar' aria-valuenow='40' aria-valuetext='Your progress : 40%' max='100' value='40' />";
        document.getElementById("headerBackLink").style.display = 'none';
        document.getElementById("headerstartLink").style.display = 'block';
        $scope.setMainpageJawsInAccessible();
        $scope.initialize = function () {
            if (window.parent.document.getElementById('loginsLayout') != null)
                window.parent.document.getElementById('loginsLayout').setAttribute("aria-hidden", "true");
        }

        if ($scope.parentobj.isGenericLanding) {
            $scope.parentobj.isGenericLanding = false;
            $state.go(LoginAssistantConstants.LA_GENERICLANDING);
        }
        $timeout(function () {
            window.scrollTo(0, 0);
            if (document.getElementById("headerBackLink") != null)
                document.getElementById("headerBackLink").blur();

            LoginAssistantService.setHeaderFocus("headingMainText");
        }, 500);




        // Start : Omniture for retrieve personal/business id enter phone/email/account SSN screen
        if (vm.idMethodType === LoginAssistantConstants.LA_CARDORACCOUNT) {
            LoginAssistantService.CallSiteCatService(LoginAssistantConstants.LAVerificationContext.LA_PERSONEL_ID, vm.EnterIdInfoStatics.LA_O_ACCOUNT);
        } else if (vm.idMethodType === LoginAssistantConstants.LA_PHONE) {
            LoginAssistantService.CallSiteCatService(LoginAssistantConstants.LAVerificationContext.LA_PERSONEL_ID, vm.EnterIdInfoStatics.LA_O_PHONE);
        } else if (vm.idMethodType === LoginAssistantConstants.LA_EMAIL) {
            LoginAssistantService.CallSiteCatService(LoginAssistantConstants.LAVerificationContext.LA_PERSONEL_ID, vm.EnterIdInfoStatics.LA_O_EMAIL);
        }
        // End : Omniture for retrieve personal/business id enter phone/email/account SSN screen

        $scope.$on(LoginAssistantConstants.LA_COMMON_ERRORMESSAGE_ID, function (event, data) {
            vm.ErrorMessage = $sce.trustAsHtml(data);
            if (vm.ErrorMessage != '') {
                LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
            }
        });

        $scope.onBlur = function () {
            if (angular.isDefined(vm.CardOrAccountNumber)) {
                var trimCardNumber = vm.CardOrAccountNumber;
                vm.CardOrAccountNumber = trimCardNumber.replace(/[\s]/g, '');
            }
        };



        $scope.onNextClick = function () {
            
            if (!$scope.form.$valid) {
                vm.isFormSubmitted = true;
                vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_COMMON_ERROR_TEXT_VALIDATION_M881);
                LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                callSiteCatServiceForFieldErrorMessage();

                $timeout(function () {
                    if (vm.idMethodType === LoginAssistantConstants.LA_CARDORACCOUNT) {
                        $scope.form.CardOrAccountNumber.$error.isSubmitted = true;
                    } else if (vm.idMethodType === LoginAssistantConstants.LA_PHONE) {
                        $scope.form.Phone.$error.isSubmitted = true;
                    } else if (vm.idMethodType === LoginAssistantConstants.LA_EMAIL) {
                        $scope.form.Email.$error.isSubmitted = true;
                    }
                    $scope.form.Ssn.$error.isSubmitted = true;
                }, 50);
                callSiteCatServiceForFieldErrorMessage();
            }
            else {
                $rootScope.$broadcast('busy.begin');
                LoginAssistantService.setUserInputData(vm);
                vm.loading = true;
                document.getElementsByClassName("button")[0].click();
            }

        };
        $scope.$on("ExceptionhandlePolicyRedirect", function (event, errorData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            vm.loading = false;
            if (errorData != null) {
                if (errorData.policyId == "create_user_session" && errorData.redirectType == 1 && errorData.userId == "") {
                    vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M618);
                    LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                }
            }
        });
        $scope.$on("Exceptionhandle", function (event, errorData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            callSiteCatServiceForFieldErrorMessage();
            vm.loading = false;
            //console.log(errorData);
            if (errorData != null && errorData.reason != null && errorData.reason._data != null &&
                errorData.reason._data.server_error_data != null &&
                errorData.reason._data.server_error_data.failure_data != null &&
                errorData.reason._data.server_error_data.failure_data.reason != null &&
                errorData.reason._data.server_error_data.failure_data.reason.data != null) {
                var err_msg = errorData.reason._data.server_error_data.failure_data.reason.data;
                if (err_msg.action == "reject" && err_msg.code == 6 && err_msg.reason == "locked") {
                    $state.go(LoginAssistantConstants.LA_LOCKERROR);
                    LoginAssistantService.setErrorCode(err_msg.code);
                } else {
                    vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.VerifyIdentityStatics.LA_DOESNT_MATCH);
                    LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                }

            } else {
                vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M618);
                LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
            }

        });
        $scope.$on("ExceptionhandlePolicyRejection", function (event, errorData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            vm.loading = false;
            callSiteCatServiceForFieldErrorMessage();
            vm.isFormSubmitted = true;
            if (errorData != null && errorData.reason.data != null) {
                var err_msg = errorData.reason.data;
                if (err_msg.action == "reject" && err_msg.code == 9 || (errorData == undefined)) {
                    vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.VerifyIdentityStatics.LA_DOESNT_MATCH);
                    LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                } else if (err_msg.action == "reject" && err_msg.code == 5 && err_msg.reason == "locked") {
                    $state.go(LoginAssistantConstants.LA_LOCKERROR);
                    LoginAssistantService.setErrorCode(err_msg.code);
                } else if (err_msg.action == "reject" && err_msg.code == 6 && err_msg.reason == "locked") {
                    $state.go(LoginAssistantConstants.LA_LOCKERROR);
                    LoginAssistantService.setErrorCode(err_msg.code);
                }
            } else {
                vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M618);
                LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
            }
        });
        $scope.$on("ErrorMessageDisplay", function (event, responseData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            if (responseData != null && responseData.data != null) {
                count = responseData.count;
                if (responseData.data.success == false) {
                    vm.loading = false;
                    if (LoginAssistantConstants.LA_SHARED_ACCESS_BANKING == LoginAssistantService.getAccountType()) {
                        if (responseData.data.inactive == true) {
                            vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.VerifyIdentityStatics.LA_SHARED_ACCESS_ERROR_MSG_E60027_M1041);
                            LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                        } else {
                            vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.VerifyIdentityStatics.LA_SHARED_ACCESS_NO_MATCH_M1040);
                            LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                        }
                    } else {
                        if (count == 0 || count == 1) {
                            vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_ENTERINFO_ERROR_MESSAGE_M607);
                            LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                        } else if (count == 3 || count == 2) {
                            vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_ENTERINFO_ERROR_MESSAGE_M1010);
                            LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                        } else {
                            $state.go(LoginAssistantConstants.LA_LOCKERROR);
                        }
                    }
                }
            }else {
                vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M618);
                LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
            }
        });
        $scope.$on("AccountRetrievalvalidation", function (event, responseData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            if (responseData) {
               // console.log(responseData)
                vm.loading = false;
                vm.isFormSubmitted = true;
                LoginAssistantService.setAccountOption(responseData);
                LoginAssistantService.setMultipleAccountTypeforBack(false);
                LoginAssistantService.setMultipleAccountSharedAccessforBack(false);
                if (responseData.required) {
                    LoginAssistantService.setMultipleAccountTypeforBack(true);
                    $state.go(LoginAssistantConstants.LA_ENTERTAXID);
                }                     
                else if (responseData.list) {
                    LoginAssistantService.setMultipleAccountSharedAccessforBack(true);
                    LoginAssistantService.setMultipleSharedAccessAdmins(responseData);
                    $state.go(LoginAssistantConstants.LA_MULTIPLESHAREDACCESSADMINS);
                } else if (Object.keys(responseData).length == 0) {
                    vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M618);
                    LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                }else {
                    var data = LoginAssistantService.getAccountOption();
                    if (Object.keys(responseData).length == 1) {
                        LoginAssistantService.setIsUserRedirectToPin(false);
                        if (data.ResetWithPIN != undefined && (data.ResetWithPIN.accounts == null || data.ResetWithPIN.accounts == "")) {
                            LoginAssistantService.setMultipleAccountType(LoginAssistantConstants.LA_DDA_ACCOUNT);
                            LoginAssistantService.setheadingType(LoginAssistantConstants.LA_DDA_ACCOUNT);
                            $state.go(LoginAssistantConstants.LA_VERIFYIDENTITYVIAACCOUNTNUMBERORPIN);
                        } else if (data.ResetWithOTP != undefined && data.ResetWithOTP.accounts.length == 1) {
                            LoginAssistantService.setIsUserRedirectToPin(true);
                            $state.go(LoginAssistantConstants.LA_VERIFYIDENTITY);
                        } else if (data.ResetWithCCD != undefined && data.ResetWithCCD.accounts.length == 1) {
                            var obj = {};
                            obj['index'] = 0;
                            obj['accounttype'] = LoginAssistantConstants.LA_RESETWITHCCD;
                            obj['account'] = data.ResetWithCCD.accounts[0].displayName;
                            obj['accountnumber'] = data.ResetWithCCD.accounts[0].accountNumber;
                            LoginAssistantService.setSelectedAccount(obj);
                            LoginAssistantService.setheadingType("Credit Card");
                            LoginAssistantService.setMultipleAccountType(LoginAssistantConstants.LA_CCD_ACCOUNT);
                            $state.go(LoginAssistantConstants.LA_VERIFYIDENTITYVIAACCOUNTNUMBERORPIN);
                        } else if (data.ResetWithAccountZIP != undefined && data.ResetWithAccountZIP.accounts.length == 1) {
                            var obj = {};
                            obj['index'] = 0;
                            obj['accounttype'] = LoginAssistantConstants.LA_RESETWITHACCOUNTZIP;
                            obj['account'] = data.ResetWithAccountZIP.accounts[0].displayName;
                            obj['accountnumber'] = data.ResetWithAccountZIP.accounts[0].accountNumber;
                            LoginAssistantService.setSelectedAccount(obj);
                            LoginAssistantService.setheadingType("Loans, Lines, Leases, Mortgage, Brokerage");
                            LoginAssistantService.setMultipleAccountType(LoginAssistantConstants.LA_LLLMW_ACCOUNT);
                            $state.go(LoginAssistantConstants.LA_VERIFYIDENTITYVIAACCOUNTNUMBERORPIN);
                        } else {
                           // LoginAssistantService.setIsUserRedirectToPin(true);
                            $state.go(LoginAssistantConstants.LA_MULTIPLEACCOUNTS);
                        }
                    } else {
                        //console.log(responseData);
                        LoginAssistantService.setIsUserRedirectToPin(true);
                        if (data.ResetWithOTP.accounts.length == 1) {
                            var obj = {};
                            obj['index'] = 0;
                            obj['account'] = data.ResetWithOTP.accounts;
                            LoginAssistantService.setSelectedAccount(obj);
                        }
                         $state.go(LoginAssistantConstants.LA_VERIFYIDENTITY);
                    }
                    
                }

            }

        });
        $scope.$on('OpenTransmitOTP', function () {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            // console.log("inside");  
            $state.go(LoginAssistantConstants.LA_ENTERCODE);
        });
        function callSiteCatServiceForFieldErrorMessage() {
            switch (vm.idMethodType) {
                case LoginAssistantConstants.LA_CARDORACCOUNT:
                    if (LoginAssistantService.getUserType() === LoginAssistantConstants.LA_PERSONAL_BANKING) {
                        // Omniture for retrieve id personal account enter account ssn user entry validation error
                        LoginAssistantService.CallSiteCatService(vm.loginAssistModel.Vcontext, vm.EnterIdInfoStatics.LA_O_ACCOUNTSSNVALIDATIONERROR);
                    }
                    break;
                case LoginAssistantConstants.LA_PHONE:
                    // Omniture for retrieve id personal/business  enter phone SSN page for user entry validation error
                    LoginAssistantService.CallSiteCatService(vm.loginAssistModel.Vcontext, vm.EnterIdInfoStatics.LA_O_PHONESSNVALIDATIONERROR);
                    break;
                case LoginAssistantConstants.LA_EMAIL:
                    // Omniture for retrieve id personal/business  enter email SSN page for user entry validation error
                    LoginAssistantService.CallSiteCatService(vm.loginAssistModel.Vcontext, vm.EnterIdInfoStatics.LA_O_EMAILSSNVALIDATIONERROR);
                    break;
            }
        }

    };
})();
;

(function () {
    'use strict';

    angular
        .module('LoginAssistantModule')
        .controller('EnterBusinessIdInfoController', enterBusinessIdInfoController);

    enterBusinessIdInfoController.$inject = ['$scope', '$rootScope', '$state', 'CommonService', 'CommonConstants', 'LoginAssistantConstants', '$stateParams', 'LoginAssistantService', '$sce', 'OpenModalService', '$timeout'];

    function enterBusinessIdInfoController($scope, $rootScope, $state, commonService, commonConstants, LoginAssistantConstants, $stateParams, LoginAssistantService, $sce, openModalService, $timeout) {
        var vm = this;
        vm.IsTouch = commonService.getIsTouch().toLowerCase() === commonConstants.TRUE;
        vm.EnterBusinessInfoStatics = LoginAssistantConstants.EnterBusinessIdInfoStatics;
        vm.NextButton = LoginAssistantConstants.LA_CONTINUEBUTTON;
        vm.CancelButton = LoginAssistantConstants.LA_CANCELBUTTON;
        vm.ChooseIdMethodStatics = LoginAssistantConstants.ChooseIdMethodStatics;
        vm.CardNumberPattern = LoginAssistantConstants.LA_CARDNUMBER_PATTERN;
        vm.ErrorMessage = '';
        vm.loginAssistModel = LoginAssistantService.getLoginAssistModel();
        var count;
        //user type as business
        LoginAssistantService.setUserType(LoginAssistantConstants.LA_BUSINESS_BANKING);

        document.getElementById("la_progress_bar").outerHTML = "<progress role='progressbar' aria-valuenow='40' aria-valuetext='Your progress : 40%' max='100' value='40' />";
        document.getElementById("headerBackLink").style.display = 'none';
        document.getElementById("headerstartLink").style.display = 'block';
        $scope.setMainpageJawsInAccessible();
        if ($scope.parentobj.isGenericLanding) {
            $scope.parentobj.isGenericLanding = false;
            $state.go(LoginAssistantConstants.LA_GENERICLANDING);
        }
        $timeout(function () {
            window.scrollTo(0, 0);
            if (document.getElementById("headerBackLink") != null)
                document.getElementById("headerBackLink").blur();

            LoginAssistantService.setHeaderFocus("headingMainText");
        }, 500);

        // Start : Omniture for retrieve id business account enter Account,SSN and TIN screen
        LoginAssistantService.CallSiteCatService(LoginAssistantConstants.LAVerificationContext.LA_PERSONEL_ID, vm.EnterBusinessInfoStatics.LA_O_ACCOUNT);
        // End : Omniture for retrieve id business account enter Account,SSN and TIN screen

        $scope.$on(LoginAssistantConstants.LA_COMMON_ERRORMESSAGE_ID, function (event, data) {
            vm.ErrorMessage = $sce.trustAsHtml(data);
        });

        $scope.onBlur = function () {
            if (angular.isDefined(vm.CardOrAccountNumber)) {
                var trimCardNumber = vm.CardOrAccountNumber;
                vm.CardOrAccountNumber = trimCardNumber.replace(/[\s]/g, '');
            }
        }
       
        $scope.onNextClick = function () {
            
            vm.isFormSubmitted = true;
            vm.ErrorMessage = '';
            if (!$scope.form.$valid) {
                vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_COMMON_ERROR_TEXT_VALIDATION_M881);
                LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                $scope.form.CardOrAccountNumber.$error.isSubmitted = true;
                $scope.form.Tin.$error.isSubmitted = true;
                $scope.form.Ssn.$error.isSubmitted = true;
                callSiteCatServiceForFieldErrorMessage();
            } else {
                $rootScope.$broadcast('busy.begin');
                LoginAssistantService.setVoiceOverFocus("loading_progress");
                LoginAssistantService.setUserInputData(vm);
                document.getElementsByClassName("button")[0].click();
               
            }
        };

       
        $scope.$on("Exceptionhandle", function (event, errorData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            vm.loading = false;
            if (errorData) {
                var err_msg = errorData.reason._data.server_error_data.failure_data.reason.data;
                if (err_msg.action == "reject" && err_msg.code == 6 && err_msg.reason == "locked") {
                    $state.go(LoginAssistantConstants.LA_LOCKERROR);
                    LoginAssistantService.setErrorCode(err_msg.code);
                } else {
                    vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.VerifyIdentityStatics.LA_DOESNT_MATCH);
                    LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                }

            }
            
        });
        $scope.$on("ExceptionhandlePolicyRedirect", function (event, errorData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            vm.loading = false;
            if (errorData != null) {
                if (errorData.policyId == "create_user_session" && errorData.redirectType == 1 && errorData.userId == "") {
                    vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M618);
                    LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                }
            }
        });
        $scope.$on("ExceptionhandlePolicyRejection", function (event, errorData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            vm.loading = false;
            vm.isFormSubmitted = true;
            if (errorData != null) {
                var err_msg = errorData.reason.data;
                if (err_msg.action == "reject" && err_msg.code == 9 || (errorData == undefined)) {
                    vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.VerifyIdentityStatics.LA_DOESNT_MATCH);
                    LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                } else if (err_msg.action == "reject" && err_msg.code == 5 && err_msg.reason == "locked") {
                    $state.go(LoginAssistantConstants.LA_LOCKERROR);
                    LoginAssistantService.setErrorCode(err_msg.code);
                } else if (err_msg.action == "reject" && err_msg.code == 6 && err_msg.reason == "locked") {
                    $state.go(LoginAssistantConstants.LA_LOCKERROR);
                    LoginAssistantService.setErrorCode(err_msg.code);
                }
            }
        });
        $scope.$on("ErrorMessageDisplay", function (event, responseData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            if (responseData != null) {
                count = responseData.count;
                if (responseData.data.success == false) {
                    vm.loading = false;
                    if (count == 1 || count == 2) {
                        vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_ENTERINFO_ERROR_MESSAGE_M607);
                        LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                    } else if (count == 3 || count == 4) {
                        vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_ENTERINFO_ERROR_MESSAGE_M1010);
                        LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                    } else if (count == 5) {
                        $state.go(LoginAssistantConstants.LA_LOCKERROR);
                    }
                }
            }else if (responseData == null || responseData.data == null) {
                vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M618);
                LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
            }
        });
        $scope.$on("AccountRetrievalvalidation", function (event, responseData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            vm.isFormSubmitted = true;
            //console.log(responseData);
            LoginAssistantService.setAccountOption(responseData);
            if (responseData.required) {
                $state.go(LoginAssistantConstants.LA_ENTERTAXID);
            } else if (Object.keys(responseData).length == 0) {
                vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_COMMON_ERROR_TEXT_VALIDATION_M881);
                LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
            } else {
                var data = LoginAssistantService.getAccountOption();
                if (Object.keys(responseData).length == 1) {
                    LoginAssistantService.setIsUserRedirectToPin(false);
                    if (data.ResetWithPIN != undefined && (data.ResetWithPIN.accounts == null || data.ResetWithPIN.accounts == "")) {
                        LoginAssistantService.setMultipleAccountType(LoginAssistantConstants.LA_DDA_ACCOUNT);
                        LoginAssistantService.setheadingType(LoginAssistantConstants.LA_DDA_ACCOUNT);
                        $state.go(LoginAssistantConstants.LA_VERIFYIDENTITYVIAACCOUNTNUMBERORPIN);
                    } else if (data.ResetWithOTP != undefined && data.ResetWithOTP.accounts.length == 1) {
                        LoginAssistantService.setIsUserRedirectToPin(true);
                        $state.go(LoginAssistantConstants.LA_VERIFYIDENTITY);
                    } else if (data.ResetWithCCD != undefined && data.ResetWithCCD.accounts.length == 1) {
                        var obj = {};
                        obj['index'] = 0;
                        obj['accounttype'] = LoginAssistantConstants.LA_RESETWITHCCD;
                        obj['account'] = data.ResetWithCCD.accounts[0].cardType;
                        obj['accountnumber'] = data.ResetWithCCD.accounts[0].accountNumber;
                        LoginAssistantService.setSelectedAccount(obj);
                        LoginAssistantService.setheadingType("Credit Card");
                        LoginAssistantService.setMultipleAccountType(LoginAssistantConstants.LA_CCD_ACCOUNT);
                        $state.go(LoginAssistantConstants.LA_VERIFYIDENTITYVIAACCOUNTNUMBERORPIN);
                    } else if (data.ResetWithAccountZIP != undefined && data.ResetWithAccountZIP.accounts.length == 1) {
                        var obj = {};
                        obj['index'] = 0;
                        obj['accounttype'] = LoginAssistantConstants.LA_RESETWITHACCOUNTZIP;
                        obj['account'] = data.ResetWithAccountZIP.accounts[0].cardType;
                        obj['accountnumber'] = data.ResetWithAccountZIP.accounts[0].accountNumber;
                        LoginAssistantService.setSelectedAccount(obj);
                        LoginAssistantService.setheadingType("Loans, Lines, Leases, Mortgage, Brokerage");
                        LoginAssistantService.setMultipleAccountType(LoginAssistantConstants.LA_LLLMW_ACCOUNT);
                        $state.go(LoginAssistantConstants.LA_VERIFYIDENTITYVIAACCOUNTNUMBERORPIN);
                    } else {
                       // LoginAssistantService.setIsUserRedirectToPin(true);
                        $state.go(LoginAssistantConstants.LA_MULTIPLEACCOUNTS);
                    }
                } else {
                    //console.log(responseData);
                    LoginAssistantService.setIsUserRedirectToPin(true);
                    $state.go(LoginAssistantConstants.LA_VERIFYIDENTITY);
                }
            }

        });

        /*function callSiteCatServiceForSystemUnavailableMessage() {
            //Omniture for retrieve id business account enter account SSN TIN page when system is currently unavailable error message is displayed
            LoginAssistantService.CallSiteCatServiceForSystemUnavailableMessage(vm.ErrorMessage, vm.loginAssistModel.Vcontext,
            vm.EnterBusinessInfoStatics.LA_O_ACCOUNTSSNTINSYSTEMUNAVAILABLE);
        }
        */
        function callSiteCatServiceForFieldErrorMessage() {
            // Omniture for retrieve id business account enter account ssn tin user entry validation error
            LoginAssistantService.CallSiteCatService(vm.loginAssistModel.Vcontext, vm.EnterBusinessInfoStatics.LA_O_ACCOUNTSSNTINVALIDATIONERROR);
        }
    };
})();
;
(function () {
    'use strict';

    angular
        .module('LoginAssistantModule')
        .controller('PersonalIdController', personalIdController);

    personalIdController.$inject = ['$scope', '$rootScope', '$state', 'LoginAssistantConstants', '$compile', 'LoginAssistantService', 'CommonConstants', 'CommonService', '$sce', '$timeout', '$location'];

    function personalIdController($scope, $rootScope, $state, LoginAssistantConstants, $compile, LoginAssistantService, commonConstants, commonService, $sce, $timeout, $location) {
        var vm = this;
        $scope.parentobj.isBackDivDisplay = false;
        vm.PersonalIdStatics = LoginAssistantConstants.PersonalIdStatics;
        vm.ChooseIdMethodStatics = LoginAssistantConstants.ChooseIdMethodStatics;
        vm.CommonErrorMessage = LoginAssistantConstants.LA_COMMON_ERROR_TEXT_VALIDATION_M881;
        vm.VerifyCustomerModel = LoginAssistantService.getVerifyCustomerModel();
        vm.PersonalId = LoginAssistantService.getUserIdentifier();
        vm.loginAssistModel = LoginAssistantService.getLoginAssistModel();
        vm.IsFsvUser = LoginAssistantService.getFsvUser();
        vm.RedirectURL = LoginAssistantService.getFSVReturnUrl();
        vm.ErrorMessage = '';

        document.getElementById("la_progress_bar").outerHTML = "<progress role='progressbar' aria-valuenow='100' aria-valuetext='Your progress : 100%' max='100' value='100' />";

        if ($scope.parentobj.isGenericLanding) {
            $scope.parentobj.isGenericLanding = false;
            $state.go(LoginAssistantConstants.LA_GENERICLANDING);
        }
        $timeout(function () {
            window.scrollTo(0, 0);
            LoginAssistantService.setHeaderFocus("headingMainText");
        }, 500);
        document.getElementById("headerBackLink").style.display = 'none';
        document.getElementById("headerstartLink").style.display = 'block';
        $scope.setMainpageJawsInAccessible();

        // Start : Omniture for retrieve personal id id displayed enter password
        LoginAssistantService.CallSiteCatService(LoginAssistantConstants.LAVerificationContext.LA_PERSONEL_ID, vm.PersonalIdStatics.LA_O_PERSONALID);
        // End : Omniture for retrieve personal id id displayed enter password

        $scope.$on(LoginAssistantConstants.LA_SIGNON_ERRORMESSAGE_ID, function (event, data) {
            vm.ErrorMessage = $sce.trustAsHtml(data);
            //LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
        });

        vm.CancelButton = LoginAssistantConstants.LA_CANCELBUTTON;

        $scope.onLoginClick = function () {

            if (vm.IsFsvUser) {
                window.location.href = vm.RedirectURL;
            } else {
                vm.isFormSubmitted = true;
                vm.ErrorMessage = '';
                if (!$scope.form.$valid) {
                    $scope.form.Password.$error.isSubmitted = true;
                    callSiteCatServiceForFieldErrorMessage();
                }
                else {
                    $rootScope.$broadcast('busy.begin');
                    vm.isFormSubmitted = false;
                    vm.ErrorMessage = '';
                    $timeout(function () {
                        if (!$scope.parentobj.isBrowserBackButtonClicked) {
                            LoginAssistantService.setContinueWithPassword(true);

                            LoginAssistantService.invokeRetrieveIdPolicy();
                        }
                    }, 500);

                }
            }
        };

        $scope.onForgotPassword = function () {
            LoginAssistantService.invokeForgotPasswordPolicy();
        };

        $scope.$on("forgetPassworddata", function (event, ResponseData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            if (ResponseData) {
                var token = ResponseData._token.split('.')[1];
                var base64 = token.replace(/-/g, '+').replace(/_/g, '/');
                var decode = JSON.parse(window.atob(base64));
                if (LoginAssistantService.getUserIdentifier().toLowerCase() == decode.sub.toLowerCase() && LoginAssistantService.getUserFlow() == decode.flow) {
                    $scope.signOn(vm.Password);
                }

            }
        });
        $scope.$on("ResetpasswordFlow", function (event, ResponseData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            if (ResponseData) {

                $state.go(LoginAssistantConstants.LA_RESETPASSWORD);
            }
        });
        vm.userid = LoginAssistantService.getUserIdentifier();
        $scope.$on("serverPayload", function (event, response) {
            if (response) {
                LoginAssistantService.setContextData(response);
                var htmlElementSa = angular.element('<div sastepup ' +
                    'username= "{{vm.userid}}" ' +
                    'transmiturl= "/Proxy/TS/api/v2/web/" ' +
                    'idshieldbaseurl= "/api/auth/V1/EAS/" ' +
                    'transactionid= "idshield" ' +
                    'transmitappid= "web" ' +
                    'transmitpolicy= "login_assistant"></div>');
                var newElementSa = $compile(htmlElementSa)($scope);
                angular.element(document.querySelector("#sharedAuthStepUpId")).empty();
                angular.element(document.querySelector("#sharedAuthStepUpId")).append(newElementSa);

            }
        });

        $scope.$on("sessionID", function (event, response) {
            if (response) {
                LoginAssistantService.setSessionID(response);
            }
        });
        // $scope.$on("targetDesc", function (event, response) {
        //   var element = $('#sharedAuthStepUpId #sharedAuthstepUpContainer div.ng-scope').not('#customUI');
        //   $scope.$apply(function () {
        //       element.attr('ng-if', 'false');
        //   });

        //console.log(elevalue);

        // });

        /*$scope.$on("successPayload", function (event, response) {
            if (response) {
                $rootScope.$broadcast('busy.begin');
                LoginAssistantService.setUserDataToken(response.token);
                LoginAssistantService.setIsUserVerified(true);
                alert("calling ForgotPasswor policy");
                LoginAssistantService.invokeForgotPasswordPolicy();
            }
        });*/

        function callSiteCatServiceForFieldErrorMessage() {
            // Omniture for id displayed enter password error page when no value is entered by the user
            if (($scope.form.Password.$error.isDirty || $scope.form.Password.$error.isSubmitted) && $scope.form.Password.$error.required) {
                LoginAssistantService.CallSiteCatService(LoginAssistantConstants.LAVerificationContext.LA_PERSONEL_ID, vm.PersonalIdStatics.LA_O_PILOTUSERPERSONALIDNOTENTEREDERROR);
            }//Omniture for id displayed enter password error page when password entered by the user does not meet the password requirement
            else if (($scope.form.Password.$error.isInValid || $scope.form.Password.$error.isSubmitted) && $scope.form.Password.$error.minlength) {
                LoginAssistantService.CallSiteCatService(LoginAssistantConstants.LAVerificationContext.LA_PERSONEL_ID, vm.PersonalIdStatics.LA_O_PILOTUSERPERSONALIDFORMATERROR);
            }
        }
    };
})();;
(function () {
    'use strict';

    angular
        .module('LoginAssistantModule')
        .controller('ResetCommonController', resetCommonController);

    resetCommonController.$inject = ['$scope', '$rootScope', '$state', 'CommonService', 'CommonConstants', 'LoginAssistantConstants', 'LoginAssistantService', '$sce', 'OpenModalService', '$timeout'];

    function resetCommonController($scope, $rootScope, $state, commonService, commonConstants, LoginAssistantConstants, LoginAssistantService, $sce, openModalService, $timeout) {
        var vm = this;
        $scope.parentobj.isBackDivDisplay = true;
        var preview;
        var loginAssistModel = LoginAssistantService.getLoginAssistModel();
        vm.ResetCommonStatics = LoginAssistantConstants.ResetCommonStatics;
        vm.LAVerificationContext = LoginAssistantConstants.LAVerificationContext;
        vm.ChooseIdMethodStatics = LoginAssistantConstants.ChooseIdMethodStatics;
        vm.CommonErrorMessage = LoginAssistantConstants.LA_COMMON_ERROR_TEXT_VALIDATION_M881;
        vm.PersonalIdPattern = LoginAssistantConstants.LA_PERSONALID_PATTERN;
        vm.isThirdPartySharedAccess = false;//need to make service call to decide it.
        vm.NextButton = LoginAssistantConstants.LA_CONTINUEBUTTON;
        vm.CancelButton = LoginAssistantConstants.LA_CANCELBUTTON;
        vm.resetCommonValue = LoginAssistantService.getResetCommonValue();
        vm.ShowPersonalId = loginAssistModel.ShowPersonalId;
        vm.loginAssistModel = loginAssistModel;
        vm.DontHaveAccount = LoginAssistantConstants.LA_I_DONT_HAVE_AN_ACCOUNT;

        var count;
        if (document.getElementById("footer") != null)
            document.getElementById("footer").removeAttribute("style");

        if (document.getElementsByClassName("iframeholder") != null && document.getElementsByClassName("iframeholder")[0] != null)
            document.getElementsByClassName("iframeholder")[0].style.height = "auto";

        document.getElementById("la_progress_bar").outerHTML = "<progress role='progressbar' aria-valuenow='15' aria-valuetext='Your progress : 15%' max='100' value='15' />";

        if ($scope.parentobj.isGenericLanding) {
            $scope.parentobj.isGenericLanding = false;
            $state.go(LoginAssistantConstants.LA_GENERICLANDING);
        }

        $timeout(function () {
            document.getElementById("headerBackLink").style.display = 'block';
            document.getElementById("headerstartLink").style.display = 'none';
        }, 100);
        $timeout(function () {
            window.scrollTo(0, 0);
            if (document.getElementById("headerBackLink") != null)
                document.getElementById("headerBackLink").blur();

            LoginAssistantService.setHeaderFocus("headingMainText");

        }, 500);

        $scope.initialize = function ()
        {
            if (window.parent.document.getElementById('loginsLayout') != null)
                window.parent.document.getElementById('loginsLayout').setAttribute("aria-hidden", "true");
        }

        $scope.setMainpageJawsInAccessible();

        if ((vm.loginAssistModel.InValidVContext === 'WrongInFlowPwd' || vm.loginAssistModel.InValidVContext === 'WrongPassword' || vm.loginAssistModel.InValidVContext === 'WrongIdShield') && !vm.isFormSubmitted) {
            LoginAssistantService.setVoiceOverFocus("divSecurityError", 1500);
        }

        if ($scope.parentobj.isGenericLanding) {
            vm.MainText = LoginAssistantConstants.ResetCommonStatics.LA_RESETCOMMON_GENERIC_MAINTEXT;
            if (loginAssistModel.Vcontext === LoginAssistantConstants.LAVerificationContext.LA_ID_SHIELD) {
                vm.TitleText = LoginAssistantConstants.ResetCommonStatics.LA_RESETCOMMON_GENERIC_RESETIDSHILD_TITLE;
            } else if (loginAssistModel.Vcontext === LoginAssistantConstants.LAVerificationContext.LA_PASSWORD) {
                vm.TitleText = LoginAssistantConstants.ResetCommonStatics.LA_RESETCOMMON_GENERIC_RESETPASSWORD_TITLE;
            } else {
                vm.TitleText = LoginAssistantConstants.ResetCommonStatics.LA_RESETCOMMON_TITLE;
            }
        } else {
            vm.TitleText = LoginAssistantConstants.ResetCommonStatics.LA_RESETCOMMON_TITLE;
            vm.MainText = LoginAssistantConstants.ResetCommonStatics.LA_RESETCOMMON_MAINTEXT_REBRAND;
        }

        vm.loginAssistModel = LoginAssistantService.getLoginAssistModel();


        //Omniture for reset password/reset id Shield enter SSN page error message page when the user gets directed to this page after entering wrong password 5 times in Retrieve ID or Reset ID Shield pages
        if ((vm.loginAssistModel.InValidVContext === 'WrongInFlowPwd' || vm.loginAssistModel.InValidVContext === 'WrongPassword' || vm.loginAssistModel.InValidVContext === 'WrongIdShield') && !vm.isFormSubmitted) {
            LoginAssistantService.CallSiteCatService(vm.loginAssistModel.Vcontext, vm.ResetCommonStatics.LA_O_RESETCOMMONDIRECTEDLOCKEDOUT);
        } else {
            // Omniture for reset password/reset id Shield enter ssn screen
            LoginAssistantService.CallSiteCatService(vm.loginAssistModel.Vcontext, vm.ResetCommonStatics.LA_O_RESETCOMMON);
        }

        

        vm.ErrorMessage = '';
        $scope.$on(LoginAssistantConstants.LA_COMMON_ERRORMESSAGE_ID, function (event, data) {
            vm.ErrorMessage = $sce.trustAsHtml(data);
            if (vm.ErrorMessage != '') {
                LoginAssistantService.setVoiceOverFocus("divSecurityError", 1500);
            }
        });
        //Changes for State Farm Custom Error Message
        if (vm.ErrorMessage === '' && vm.loginAssistModel.PartnerErrorMessage && vm.loginAssistModel.PartnerErrorMessage != '') {
            vm.ErrorMessage = $sce.trustAsHtml(vm.loginAssistModel.PartnerErrorMessage);
            if (vm.ErrorMessage != '') {
                LoginAssistantService.setVoiceOverFocus("divSecurityError", 1500);
            }
        }
        //LoginAssistantService.setUserType(LoginAssistantConstants.LA_PERSONAL_BANKING);
        LoginAssistantService.setIdMethodType(LoginAssistantConstants.LA_CARDORACCOUNT);


        $scope.onNextClick = function () {

            vm.isFormSubmitted = true;
            vm.ErrorMessage = '';
            vm.loginAssistModel.InValidVContext = '';
            if (!$scope.form.$valid) {
                if ($scope.form.PersonalId)
                    $scope.form.PersonalId.$error.isSubmitted = true;
                $scope.form.Ssn.$error.isSubmitted = true;
                vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_COMMON_ERROR_TEXT_VALIDATION_M881);
                setTimeout(function () {
                    LoginAssistantService.setVoiceOverFocus("divSecurityError");
                }, 1500);

                callSiteCatServiceForFieldErrorMessage();
            }
            else {
                $rootScope.$broadcast('busy.begin');
                LoginAssistantService.setVoiceOverFocus("loading_progress");
                vm.isFormSubmitted = false;
                var userData = LoginAssistantService.getUserInputData();
                if (vm.ShowPersonalId) {
                    userData.PersonalId = vm.PersonalId;
                } else {
                    userData.PersonalId = LoginAssistantService.getUserIdentifier();
                }

                userData.PersonalId = userData.PersonalId ? userData.PersonalId : (vm.loginAssistModel ? vm.loginAssistModel.PersonalID : "");
                userData.pwdSSN = vm.Ssn;
                LoginAssistantService.setUserInputData(userData);
                LoginAssistantService.setUserIdentifier(userData.PersonalId);
                loginAssistModel.PersonalID = vm.PersonalId;
                document.getElementsByClassName("button")[0].click();
            }
        };

        $scope.onDontHaveAccountClick = function () {
            var dontHaveAccountUrl = "";
            var dontHaveAccountUrlVal = document.getElementById("divDontHaveAccountUrl").value;
            if (dontHaveAccountUrlVal && dontHaveAccountUrlVal.length > 0) {
                dontHaveAccountUrl = dontHaveAccountUrlVal;
            }
            //Need to redirect to the given URL
        }

        $scope.closePopup = function () {
            vm.error_display = false;
        }
        $scope.$on("ExceptionhandlePolicyRedirect", function (event, errorData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            vm.loading = false;
            if (errorData != null) {
                if (errorData.policyId == "create_user_session" && errorData.redirectType == 1 && errorData.userId == "") {
                    vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M618);
                    LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                }
            }
        });
        $scope.$on("ErrorMessageDisplay", function (event, responseData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            if (responseData != null && responseData.data != null) {
                count = responseData.count;
                if (responseData.data.success == false) {
                    vm.loading = false;
                    if (count == 0 || count == 1) {
                        vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_COMMON_ERROR_TEXT_VALIDATION_M103);
                        LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                    } else if (count == 2) {
                        vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_ENTERINFO_ERROR_MESSAGE_M1011);
                        LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                    } else if (count == 3) {
                        vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_ENTERINFO_ERROR_MESSAGE_M1011);
                        LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                        vm.error_display = true;

                    } else {
                        $state.go(LoginAssistantConstants.LA_LOCKERROR);
                    }

                }

            } else {
                vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M618);
                LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
            }


        });
        $scope.$on("ExceptionhandlePolicyRejection", function (event, errorData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            vm.loading = false;
            vm.isFormSubmitted = true;
            if (errorData != null) {
                var err_msg = errorData.reason.data;
                if (err_msg.action == "reject" && err_msg.code == 9 || (errorData == undefined)) {
                    vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.VerifyIdentityStatics.LA_DOESNT_MATCH);
                    LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                } else if (err_msg.action == "reject" && err_msg.code == 5 && err_msg.reason == "locked") {
                    $state.go(LoginAssistantConstants.LA_LOCKERROR);
                    LoginAssistantService.setErrorCode(err_msg.code);
                } else if (err_msg.action == "reject" && err_msg.code == 6 && err_msg.reason == "locked") {
                    $state.go(LoginAssistantConstants.LA_LOCKERROR);
                    LoginAssistantService.setErrorCode(err_msg.code);
                } else {
                    vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M618);
                    LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                }
            } else {
                vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M618);
                LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
            }
        });

        $scope.$on("Exceptionhandle", function (event, errorData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            vm.loading = false;
            if (errorData != null && errorData.reason != null && errorData.reason._data != null &&
                errorData.reason._data.server_error_data != null &&
                errorData.reason._data.server_error_data.failure_data != null &&
                errorData.reason._data.server_error_data.failure_data.reason != null &&
                errorData.reason._data.server_error_data.failure_data.reason.data != null) {
                var err_msg = errorData.reason._data.server_error_data.failure_data.reason.data;
                if (err_msg.action == "reject" && err_msg.code == 6 && err_msg.reason == "locked") {
                    $state.go(LoginAssistantConstants.LA_LOCKERROR);
                    LoginAssistantService.setErrorCode(err_msg.code);
                } else {
                    vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.VerifyIdentityStatics.LA_DOESNT_MATCH);
                    LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                }

            } else {
                vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M618);
                LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
            }

        });
        $scope.$on("AccountRetrievalvalidation", function (event, responseData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            if (responseData) {

                //console.log(responseData);
                vm.loading = false;
                vm.isFormSubmitted = true;
                LoginAssistantService.setAccountOption(responseData);
                var data = LoginAssistantService.getAccountOption();
                if (Object.keys(responseData).length == 1) {
                    LoginAssistantService.setIsUserRedirectToPin(false);
                    if (data.ResetWithPIN != undefined && (data.ResetWithPIN.accounts == null || data.ResetWithPIN.accounts == "")) {
                        LoginAssistantService.setMultipleAccountType(LoginAssistantConstants.LA_DDA_ACCOUNT);
                        LoginAssistantService.setheadingType(LoginAssistantConstants.LA_DDA_ACCOUNT);
                        $state.go(LoginAssistantConstants.LA_VERIFYIDENTITYVIAACCOUNTNUMBERORPIN);
                    } else if (data.ResetWithOTP != undefined && data.ResetWithOTP.accounts.length == 1) {
                        LoginAssistantService.setIsUserRedirectToPin(true);
                        $state.go(LoginAssistantConstants.LA_VERIFYIDENTITY);
                    } else if (data.ResetWithCCD != undefined && data.ResetWithCCD.accounts.length == 1) {
                        var obj = {};
                        obj['index'] = 0;
                        obj['accounttype'] = LoginAssistantConstants.LA_RESETWITHCCD;
                        obj['account'] = data.ResetWithCCD.accounts[0].cardType;
                        obj['accountnumber'] = data.ResetWithCCD.accounts[0].accountNumber;
                        LoginAssistantService.setSelectedAccount(obj);
                        LoginAssistantService.setMultipleAccountType(LoginAssistantConstants.LA_CCD_ACCOUNT);
                        $state.go(LoginAssistantConstants.LA_VERIFYIDENTITYVIAACCOUNTNUMBERORPIN);
                    } else if (data.ResetWithAccountZIP != undefined && data.ResetWithAccountZIP.accounts.length == 1) {
                        var obj = {};
                        obj['index'] = 0;
                        obj['accounttype'] = LoginAssistantConstants.LA_RESETWITHACCOUNTZIP;
                        obj['account'] = data.ResetWithAccountZIP.accounts[0].cardType;
                        obj['accountnumber'] = data.ResetWithAccountZIP.accounts[0].accountNumber;
                        LoginAssistantService.setSelectedAccount(obj);
                        LoginAssistantService.setMultipleAccountType(LoginAssistantConstants.LA_LLLMW_ACCOUNT);
                        $state.go(LoginAssistantConstants.LA_VERIFYIDENTITYVIAACCOUNTNUMBERORPIN);
                    } else {
                        // LoginAssistantService.setIsUserRedirectToPin(true);
                        $state.go(LoginAssistantConstants.LA_MULTIPLEACCOUNTS);
                    }
                } else if (Object.keys(responseData).length == 0) {
                    vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M618);
                    LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                } else {
                    //console.log(responseData);
                    LoginAssistantService.setIsUserRedirectToPin(true);
                    $state.go(LoginAssistantConstants.LA_VERIFYIDENTITY);
                }
            } else {
                vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M618);
                LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
            }

        });

        $scope.$on('OpenTransmitOTP', function () {
            // console.log("inside");  
            $state.go(LoginAssistantConstants.LA_ENTERCODE);
        });

        function callSiteCatServiceForFieldErrorMessage() {
            // Omniture for enter SSN page error message when SSN field not entered by the user
            if (($scope.form.Ssn.$error.isDirty || $scope.form.Ssn.$error.isSubmitted) && $scope.form.Ssn.$error.required) {
                LoginAssistantService.CallSiteCatService(loginAssistModel.Vcontext, vm.ResetCommonStatics.LA_O_RESETCOMMONSSNNOTENTEREDERROR);
            } //Omniture for enter SSN page error message when user enters non-numeric character in ssn field
            else if (($scope.form.Ssn.$error.isInValid || $scope.form.Ssn.$error.isSubmitted) && $scope.form.Ssn.$error.digitPatternValid) {
                LoginAssistantService.CallSiteCatService(loginAssistModel.Vcontext, vm.ResetCommonStatics.LA_O_RESETCOMMONSSNNONNUMERICERROR);
            } //Omniture for enter SSN page error message when user enters less than 4 characters in ssn field
            else if (($scope.form.Ssn.$error.isInValid || $scope.form.Ssn.$error.isSubmitted) && $scope.form.Ssn.$error.fourDigitPatternValid) {
                LoginAssistantService.CallSiteCatService(loginAssistModel.Vcontext, vm.ResetCommonStatics.LA_O_RESETCOMMONSSNFORMATERROR);
            }
        }
    };
})();
;
(function () {
    'use strict';

    angular
        .module('LoginAssistantModule')
        .controller('GenericLandingController', genericLandingController);

    genericLandingController.$inject = ['$scope', '$state', 'LoginAssistantConstants', 'LoginAssistantService', '$timeout'];

    function genericLandingController($scope, $state, LoginAssistantConstants, LoginAssistantService, $timeout) {
		var vm = this;
        $scope.parentobj.isBackDivDisplay = false;// B-58352,B-56238 Login Assistance Rebrand Landing Page (OLB & Mobile)
        vm.GenericLandingStatics = LoginAssistantConstants.GenericLandingStatics;
        vm.CancelButton = LoginAssistantConstants.LA_CANCELBUTTON;
        vm.userSelectionClick = userSelectionClick;
        vm.AppName = LoginAssistantService.getLoginAssistModel().AppName;
        $scope.parentobj.isGenericLanding = false;
        vm.blnDisplayIdShield = LoginAssistantService.getLoginAssistModel().blnDisplayIdShield;
        vm.ErrorMessage = LoginAssistantService.getLoginAssistModel().errorMessage;
        var loginAssistModel; 
        $timeout(function () {
            window.scrollTo(0, 0);
            if (document.getElementById("headerBackLink") != null)
                document.getElementById("headerBackLink").blur();

            LoginAssistantService.setHeaderFocus("headingMainText");
        }, 500);

        // Added SiteCat call on Generic landing page
        LoginAssistantService.CallSiteCatService(LoginAssistantConstants.LA_GENERIC_LANDING, vm.GenericLandingStatics.LA_GENERIC_LANDING);

        $scope.setMainpageJawsInAccessible();

        

        function userSelectionClick(userSelection) {
            loginAssistModel = LoginAssistantService.getLoginAssistModel();
            LoginAssistantService.setbbData(document.getElementById("bb_holder").innerText);           
             switch (userSelection) {
                case LoginAssistantConstants.LAVerificationContext.LA_PERSONEL_ID:
                    loginAssistModel.Vcontext = LoginAssistantConstants.LAVerificationContext.LA_PERSONEL_ID;
                    $state.go(LoginAssistantConstants.LA_RETRIEVEPERSONALID);
                    break;
                case LoginAssistantConstants.LAVerificationContext.LA_PASSWORD:
                    loginAssistModel.Vcontext = LoginAssistantConstants.LAVerificationContext.LA_PASSWORD;
                    LoginAssistantService.invokeResetPasswordPolicy("");
                    //$state.go(LoginAssistantConstants.LA_RESETCOMMON);
                    break;
                case LoginAssistantConstants.LAVerificationContext.LA_ID_SHIELD:
                    loginAssistModel.Vcontext = LoginAssistantConstants.LAVerificationContext.LA_ID_SHIELD;
                    LoginAssistantService.invokeResetAnswerPolicy("");
                    //$state.go(LoginAssistantConstants.LA_RESETCOMMON);
                    break;
                default:
                    loginAssistModel.Vcontext = LoginAssistantConstants.LAVerificationContext.LA_PERSONEL_ID;
                    $state.go(LoginAssistantConstants.LA_RETRIEVEPERSONALID);
                    break;
            }
            LoginAssistantService.setLoginAssistModel(loginAssistModel);
        }

        $scope.$on("ResetCommonValidation", function (event, responseData) {
            if (responseData.inputs) {
                if (responseData.inputs.ssn) {
                    LoginAssistantService.setResetCommonValue(responseData);
                    loginAssistModel.ShowPersonalId = responseData.inputs.uid
                    $state.go(LoginAssistantConstants.LA_RESETCOMMON);
                }
            }
        });
    };
})();;
(function () {
    'use strict';

    angular
        .module('LoginAssistantModule')
        .controller('VerifyIdentityController', verifyIdentityController);

    verifyIdentityController.$inject = ['$scope', '$rootScope', '$state', 'CommonService', 'CommonConstants', 'LoginAssistantConstants', 'LoginAssistantService', '$sce', 'SiteCatService', '$timeout'];

    function verifyIdentityController($scope, $rootScope, $state, commonService, commonConstants, LoginAssistantConstants, LoginAssistantService, $sce, siteCatService, $timeout) {
        var vm = this;
        vm.SecureOptionSelection = secureOptionSelection;
        vm.VerifyIdentityStatics = LoginAssistantConstants.VerifyIdentityStatics;
        vm.VerifyIdentityViaTextOrEmailStatics = LoginAssistantConstants.VerifyIdentityViaTextOrEmailStatics;
        vm.CancelButton = LoginAssistantConstants.LA_CANCELBUTTON;
        var rootUrl = document.querySelector(commonConstants.ROOT_URL_DIV_TEXT);
        var baseUrl = rootUrl.textContent || rootUrl.innerText;
        vm.VerifyCustomerModel = LoginAssistantService.getVerifyCustomerModel();
        vm.isThirdPartySharedAccess = LoginAssistantService.getUserType() == LoginAssistantConstants.LA_SHARED_ACCESS_BANKING ? true : false;
        var loginAssistModel = LoginAssistantService.getLoginAssistModel();
        vm.ChooseIdMethodStatics = LoginAssistantConstants.ChooseIdMethodStatics;
        vm.loginAssistModel = loginAssistModel;
        vm.EnterIdInfoDetails = LoginAssistantService.getEnterIdInfoDetails();
        //vm.sendOtpViaTextOrEmail = sendOtpViaTextOrEmail;
        vm.ErrorMessage = '';
        vm.IsError = false;
        vm.AccountOTP = false; 
        vm.AccountorPIN = false; 
        vm.disclaimer = false;
        vm.AccountOption = Object.keys(LoginAssistantService.getAccountOption());
        //console.log(vm.AccountOption.includes("ResetWithOTP"));
        document.getElementById("la_progress_bar").outerHTML = "<progress role='progressbar' aria-valuenow='55' aria-valuetext='Your progress : 55%' max='100' value='55' />";
        document.getElementById("headerBackLink").style.display = 'none';
        document.getElementById("headerstartLink").style.display = 'block';
        // Hide send code via text if the step up is OTP - B-46473 story changes
        vm.isOTPFlow = false;
        if (vm.AccountOption.includes("ResetWithOTP")) {
            vm.AccountOTP = true
            vm.disclaimer = true;
        }
        if (vm.AccountOption.includes("ResetWithCCD") || vm.AccountOption.includes("ResetWithPIN") || vm.AccountOption.includes("ResetWithAccountZIP")) {
            vm.AccountorPIN = true;
        }

        if (loginAssistModel.isOTPStepupFlow != null && loginAssistModel.isOTPStepupFlow != undefined) {
            vm.isOTPFlow = loginAssistModel.isOTPStepupFlow;
        }
        else {
            vm.isOTPFlow = false;
            vm.disclaimer = false;

        }
        if ($scope.parentobj.isGenericLanding) {
            $scope.parentobj.isGenericLanding = false;
            $state.go(LoginAssistantConstants.LA_GENERICLANDING);
        }
        $timeout(function () {
            window.scrollTo(0, 0);
            if (document.getElementById("headerBackLink") != null)
                document.getElementById("headerBackLink").blur();

            LoginAssistantService.setHeaderFocus("headingMainText");
        }, 500);

       // $scope.setMainpageJawsInAccessible();
        $scope.$on(LoginAssistantConstants.LA_COMMON_ERRORMESSAGE_ID, function (event, data) {
            vm.ErrorMessage = $sce.trustAsHtml(data);
            // Omniture for select code or card or account system currently is unavailable error page
            LoginAssistantService.CallSiteCatServiceForSystemUnavailableMessage(vm.ErrorMessage, loginAssistModel.Vcontext,
                vm.VerifyIdentityStatics.LA_O_VERIFYIDENTITYSYSTEMUNAVAILABLE);
        });

        // Start : Omniture for retrieve personal id/ reset password/ reset id shield select code or card or account screen 
        LoginAssistantService.CallSiteCatService(loginAssistModel.Vcontext, vm.VerifyIdentityStatics.LA_O_VERIFYIDENTITY);
        // End : Omniture for retrieve personal id/ reset password/ reset id shield select code or card or account screen

        if (loginAssistModel.Vcontext === LoginAssistantConstants.LAVerificationContext.LA_ID_SHIELD) {
            // To show Login Assistance content changes only for pilot user (B-56587 story changes)
            if (loginAssistModel.isPilotUser)
                vm.contextTitle = LoginAssistantConstants.VerifyIdentityStatics.LA_VERIFY_IDENTITY_CONTEXT_TITLE_REBRAND;
            else
            vm.contextTitle = LoginAssistantConstants.VerifyIdentityStatics.LA_VERIFY_IDENTITY_CONTEXT_TITLE_REBRAND;
            vm.isResetIdShieldPassword = true;
        }
        else if (loginAssistModel.Vcontext === LoginAssistantConstants.LAVerificationContext.LA_PASSWORD) {
            // To show Login Assistance content changes only for pilot user (B-56587 story changes)
            if (loginAssistModel.isPilotUser)
                vm.contextTitle = LoginAssistantConstants.VerifyIdentityStatics.LA_VERIFY_IDENTITY_RESET_PASSWORD + LoginAssistantConstants.VerifyIdentityStatics.LA_VERIFY_IDENTITY_CONTEXT_TITLE_REBRAND;
            else
            vm.contextTitle = LoginAssistantConstants.VerifyIdentityStatics.LA_VERIFY_IDENTITY_RESET_PASSWORD + LoginAssistantConstants.VerifyIdentityStatics.LA_VERIFY_IDENTITY_CONTEXT_TITLE_REBRAND;
            vm.isResetIdShieldPassword = true;
            
        } else {
            vm.contextTitle = "";
            vm.isResetIdShieldPassword = false;
        }
          
        function secureOptionSelection(secureOption) {
            $rootScope.$broadcast('busy.begin');
            var data = LoginAssistantService.getAccountOption();
            if (secureOption != LoginAssistantConstants.LA_RESETWITHOTP) {
                if (data.ResetWithPIN != undefined && (data.ResetWithPIN.accounts == null || data.ResetWithPIN.accounts == "")) {
                    LoginAssistantService.setMultipleAccountType(LoginAssistantConstants.LA_DDA_ACCOUNT);
                    LoginAssistantService.setheadingType(LoginAssistantConstants.LA_DDA_ACCOUNT);
                    $state.go(LoginAssistantConstants.LA_VERIFYIDENTITYVIAACCOUNTNUMBERORPIN);
                } else if (data.ResetWithCCD != undefined && data.ResetWithCCD.accounts.length == 1) {
                    var obj = {};
                    obj['index'] = 0;
                    obj['accounttype'] = LoginAssistantConstants.LA_RESETWITHCCD;
                    obj['account'] = data.ResetWithCCD.accounts[0].displayName;
                    obj['accountnumber'] = data.ResetWithCCD.accounts[0].accountNumber;
                    LoginAssistantService.setSelectedAccount(obj);
                    LoginAssistantService.setheadingType("Credit Card");
                    LoginAssistantService.setMultipleAccountType(LoginAssistantConstants.LA_CCD_ACCOUNT);
                    $state.go(LoginAssistantConstants.LA_VERIFYIDENTITYVIAACCOUNTNUMBERORPIN);
                } else if (data.ResetWithAccountZIP != undefined && data.ResetWithAccountZIP.accounts.length == 1) {
                    var obj = {};
                    obj['index'] = 0;
                    obj['accounttype'] = LoginAssistantConstants.LA_RESETWITHACCOUNTZIP;
                    obj['account'] = data.ResetWithAccountZIP.accounts[0].displayName;
                    obj['accountnumber'] = data.ResetWithAccountZIP.accounts[0].accountNumber;
                    LoginAssistantService.setSelectedAccount(obj);
                    LoginAssistantService.setheadingType("Loans, Lines, Leases, Mortgage, Brokerage");
                    LoginAssistantService.setMultipleAccountType(LoginAssistantConstants.LA_LLLMW_ACCOUNT);
                    $state.go(LoginAssistantConstants.LA_VERIFYIDENTITYVIAACCOUNTNUMBERORPIN);
                } else {
                    LoginAssistantService.setIsUserRedirectToPin(true);
                    $state.go(LoginAssistantConstants.LA_MULTIPLEACCOUNTS);
                }
                
            } else {
                    if (data.ResetWithOTP.accounts.length == 1) {
                        var obj = {};
                        obj['index'] = 0;
                        obj['account'] = data.ResetWithOTP.accounts;
                        LoginAssistantService.setSelectedAccount(obj);
                        document.getElementsByClassName("button")[0].click();

                    } else {
                        LoginAssistantService.setMultipleMobileNumber(true);
                        $state.go(LoginAssistantConstants.LA_MULTIPLEMOBILENUMBER);
                    }
                }
        }

        $scope.$on('OpenTransmitOTP', function () {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
           // console.log("inside");  
            $state.go(LoginAssistantConstants.LA_ENTERCODE);  
        });
        $scope.$on("ExceptionhandlePolicyRejection", function (event, errorData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            vm.loading = false;
            vm.isFormSubmitted = true;
            if (errorData != null && errorData.reason != null && errorData.reason.data != null) {
                var err_msg = errorData.reason.data;
                if (err_msg.action == "reject" && err_msg.code == 9 || (errorData == undefined)) {
                    vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.VerifyIdentityStatics.LA_DOESNT_MATCH);
                    LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                } else if (err_msg.action == "reject" && err_msg.code == 5 && err_msg.reason == "locked") {
                    $state.go(LoginAssistantConstants.LA_LOCKERROR);
                    LoginAssistantService.setErrorCode(err_msg.code);
                } else if (err_msg.action == "reject" && err_msg.code == 6 && err_msg.reason == "locked") {
                    $state.go(LoginAssistantConstants.LA_LOCKERROR);
                    LoginAssistantService.setErrorCode(err_msg.code);
                } else {
                    vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M618);
                    LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                }
            } else {
                vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M618);
                LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
            }
        });
        
    };
})();;
(function () {
    'use strict';

    angular
        .module('LoginAssistantModule')
        .controller('VerifyIdentityViaAccountNumberOrPinController', verifyIdentityViaAccountNumberOrPinController);

    verifyIdentityViaAccountNumberOrPinController.$inject = ['$scope', '$state', 'CommonService', 'CommonConstants', 'LoginAssistantConstants', 'LoginAssistantService', '$sce', '$rootScope', 'SiteCatService', 'OpenModalService', '$timeout', '$location'];

    function verifyIdentityViaAccountNumberOrPinController($scope, $state, commonService, commonConstants, LoginAssistantConstants, LoginAssistantService, $sce, $rootScope, siteCatService, openModalService, $timeout, $location) {
        var vm = this;
        vm.VerifyIdentityViaAccountNumberOrPinStatics = LoginAssistantConstants.VerifyIdentityViaAccountNumberOrPinStatics;
        vm.NextButton = LoginAssistantConstants.LA_CONTINUEBUTTON;
        vm.CancelButton = LoginAssistantConstants.LA_CANCELBUTTON;
        vm.CommonErrorMessage = LoginAssistantConstants.LA_COMMON_ERROR_TEXT_VALIDATION_M881;
        vm.ExpirationDatePatten = LoginAssistantConstants.LA_EXPIRATIONDATE_PATTERN;
        vm.ChooseIdMethodStatics = LoginAssistantConstants.ChooseIdMethodStatics;
        vm.FourDigitPattern = LoginAssistantConstants.LA_FOURDIGIT_PATTERN;
        vm.ThreeDigitPattern = LoginAssistantConstants.LA_THREEDIGIT_PATTERN;
        vm.FiveDigitPattern = LoginAssistantConstants.LA_FIVEDIGIT_PATTERN;
        vm.ErrorMessage = '';
        vm.MainText = '';
        vm.VerifyCustomerModel = LoginAssistantService.getVerifyCustomerModel();
        var loginAssistModel = LoginAssistantService.getLoginAssistModel();
        vm.loginAssistModel = loginAssistModel;
        var isTransmitApplicable = false;
        var isTransmitApplicableForAndroid = false;
        var isTransmitApplicableForIOS = false;
        var preview;
        var context_data = "";
        LoginAssistantService.setChangeMethodAfterFourAttempts(false);
        var isTouch = commonService.getIsTouch() === "True" ? true : false;
        var isMobileWeb = LoginAssistantService.isMobileWeb();
        var isIOSDevice = LoginAssistantService.isIOSDevice();
        var isAndroidDevice = false;
        vm.error_display = false;
        vm.last_attempt = false;
        vm.first_attempt = false;
        vm.accountType = LoginAssistantService.getMultipleAccountType();
        var OTP_count;
        var count;
        vm.heading = LoginAssistantService.getheadingType();
        if (isTouch && !isMobileWeb && !isIOSDevice) {
            isAndroidDevice = true;
        }
        
        LoginAssistantService.setRequestTypeCode(LoginAssistantConstants.LA_PIN);
        document.getElementById("headerBackLink").style.display = 'none';
        document.getElementById("headerstartLink").style.display = 'block';
        document.getElementById("la_progress_bar").outerHTML = "<progress role='progressbar' aria-valuenow='90' aria-valuetext='Your progress : 90%' max='100' value='90' />";
        if ($scope.parentobj.isGenericLanding) {
            $scope.parentobj.isGenericLanding = false;
            $state.go(LoginAssistantConstants.LA_GENERICLANDING);
        }
        $timeout(function () {
            window.scrollTo(0, 0);
            if (document.getElementById("headerBackLink") != null)
                document.getElementById("headerBackLink").blur();

            LoginAssistantService.setHeaderFocus("headingMainText");
        }, 500);

        $scope.setMainpageJawsInAccessible();
        if (LoginAssistantService.getSelectedAccount() != null) {

            //vm.DDAAccount = LoginAssistantConstants.LA_DDA_ACCOUNT;
          //  console.log(vm.accountType === "CCDAccount");
        }
        if (vm.accountType == LoginAssistantConstants.LA_DDA_ACCOUNT) {
            vm.MainText = $sce.trustAsHtml(vm.VerifyIdentityViaAccountNumberOrPinStatics.LA_VERIFY_IDENTITY_HEADING_TEXT);
            // Start : Omniture for retrieve personal id / reset password verify identity dda account
            LoginAssistantService.CallSiteCatService(loginAssistModel.Vcontext, vm.VerifyIdentityViaAccountNumberOrPinStatics.LA_O_DDAACCOUNT);
            // End : Omniture for retrieve personal id / reset password verify identity dda account
        } else if (vm.accountType == LoginAssistantConstants.LA_CCD_ACCOUNT) {
            vm.MainText = $sce.trustAsHtml(vm.VerifyIdentityViaAccountNumberOrPinStatics.LA_VERIFY_IDENTITY_CREDITCARD_WITH_ACCNO_MAINTEXT + LoginAssistantService.getSelectedAccount().accountnumber + '.');
            // Start : Omniture for retrieve personal id / reset password verify identity cc account 
            LoginAssistantService.CallSiteCatService(loginAssistModel.Vcontext, vm.VerifyIdentityViaAccountNumberOrPinStatics.LA_O_CCDACCOUNT);
            // End : Omniture for retrieve personal id / reset password verify identity cc account
        } else if (vm.accountType == LoginAssistantConstants.LA_LLLMW_ACCOUNT) {
            vm.MainText = $sce.trustAsHtml(vm.VerifyIdentityViaAccountNumberOrPinStatics.LA_VERIFY_IDENTITY_LLMW_ACCOUNT_WITH_ACCNO_MAINTEXT + LoginAssistantService.getSelectedAccount().accountnumber + '.');
            // Start : Omniture for retrieve personal id /reset password verify identity account zip
            LoginAssistantService.CallSiteCatService(loginAssistModel.Vcontext, vm.VerifyIdentityViaAccountNumberOrPinStatics.LA_O_LLLMWACCOUNT);
            // End : Omniture for retrieve personal id /reset password verify identity account zip
        }

        $scope.closePopup = function () {
            vm.error_display = false;
        }
        $scope.otpRedirect_Continue = function () {
            LoginAssistantService.setMultipleAccountType();
            var data = LoginAssistantService.getAccountOption();
            if (data.ResetWithOTP.accounts.length == 1) {
                var obj = {};
                obj['index'] = 0;
                obj['account'] = data.ResetWithOTP.accounts;
                LoginAssistantService.setSelectedAccount(obj);
                document.getElementsByClassName("button")[0].click();

            } else {
                LoginAssistantService.setMultipleMobileNumber(true);
                $state.go(LoginAssistantConstants.LA_MULTIPLEMOBILENUMBER);
            }
             
        }
        $scope.onNextClick = function () {
            vm.ErrorMessage = '';
            if (!$scope.form.$valid) {
                vm.isFormSubmitted = true;
                vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_COMMON_ERROR_TEXT_VALIDATION_M881);
                LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);

                $timeout(function () {
                    if (vm.accountType === LoginAssistantConstants.LA_DDA_ACCOUNT) {
                        $scope.form.PIN.$error.isSubmitted = true;
                    } //Loans, Lines, Leases, Mortgage, Wealth
                    else if (vm.accountType === LoginAssistantConstants.LA_LLLMW_ACCOUNT) {
                        $scope.form.ZIPCode.$error.isSubmitted = true;
                    } //CC
                    else if (vm.accountType === LoginAssistantConstants.LA_CCD_ACCOUNT) {
                        $scope.form.CVV.$error.isSubmitted = true;
                        $scope.form.ExpirationDate.$error.isSubmitted = true;
                        $scope.form.ZIPCode.$error.isSubmitted = true;
                    }
                  
                }, 50);

            } else {
                $rootScope.$broadcast('busy.begin');
                LoginAssistantService.setVoiceOverFocus("loading_progress");
                var userData = LoginAssistantService.getUserInputData();
                userData.PIN = vm.PIN;
                userData.CVV = vm.CVV;
                userData.ExpirationDate = vm.ExpirationDate;
                userData.ZIPCode = vm.ZIPCode;
                LoginAssistantService.setUserInputData(userData);
                document.getElementsByClassName("button")[0].click();

            }
        };
        $scope.$on("Exceptionhandle", function (event, errorData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            vm.loading = false;
            //console.log(errorData);
            if (errorData) {
                var err_msg = errorData.reason._data.server_error_data.failure_data.reason.data;
                if (err_msg.action == "reject" && err_msg.code == 6 && err_msg.reason == "locked") {
                    $state.go(LoginAssistantConstants.LA_LOCKERROR);
                    LoginAssistantService.setErrorCode(err_msg.code);
                } else {
                    vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.VerifyIdentityStatics.LA_DOESNT_MATCH);
                    LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                }
            }

        });

        $scope.$on("ExceptionhandlePolicyRedirect", function (event, errorData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            vm.loading = false;
            if (errorData != null) {
                if (errorData.policyId == "create_user_session" && errorData.redirectType == 1 && errorData.userId == "") {
                    vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M618);
                    LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                }
            }
            
        });
        $scope.$on("ExceptionhandlePolicyRejection", function (event, errorData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            vm.loading = false;
            vm.isFormSubmitted = true;
            if (errorData != null) {
                var err_msg = errorData.reason.data;
                if (err_msg.action == "reject" && err_msg.code == 9 || (errorData == undefined)) {
                    vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.VerifyIdentityStatics.LA_DOESNT_MATCH);
                    LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                } else if (err_msg.action == "reject" && err_msg.code == 5 && err_msg.reason == "locked") {
                    $state.go(LoginAssistantConstants.LA_LOCKERROR);
                    LoginAssistantService.setErrorCode(err_msg.code);
                } else if (err_msg.action == "reject" && err_msg.code == 6 && err_msg.reason == "locked") {
                    $state.go(LoginAssistantConstants.LA_LOCKERROR);
                    LoginAssistantService.setErrorCode(err_msg.code);
                }
            } else {
                vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M618);
                LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
            }
        });
        $scope.$on("ErrorMessageDisplay", function (event, responseData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            if (responseData != null && responseData.data != null) {
                LoginAssistantService.setPinValidationCount(responseData.count);
                count = responseData.count;
                if (responseData.data.success == false) {
                    $scope.$apply(function () {
                        if (count == 0 || count == 1) {
                            vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_ENTERINFO_ERROR_MESSAGE_M607);
                            LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                        } else if (count == 2) {
                            vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_ENTERPIN_ERROR_MESSAGE_M1012);
                            LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                        } else if (count == 3) {
                            var data = LoginAssistantService.getAccountOption();
                            vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_ENTERPIN_ERROR_MESSAGE_M1012);
                            LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                            OTP_count = LoginAssistantService.getOTPValidationCount();
                            LoginAssistantService.setChangeMethodAfterFourAttempts(true);
                            if ((OTP_count == undefined || OTP_count == null || OTP_count > 0) && data.ResetWithOTP != undefined) {
                                vm.error_display = true;
                                vm.last_attempt = false;
                                vm.first_attempt = true;
                            } else {
                                vm.error_display = true;
                                vm.first_attempt = true;
                                vm.last_attempt = false;
                            }
                        } else {
                            $state.go(LoginAssistantConstants.LA_LOCKERROR);
                        }

                    });
                }
            } else {
                vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M618);
                LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
            }
        });

        $scope.$on('OpenTransmitOTP', function () {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            // console.log("inside");  
            $state.go(LoginAssistantConstants.LA_ENTERCODE);
        });

        $scope.$on("forgetPasswordflowdata", function (event, ResponseData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            if (ResponseData) {
                $state.go(LoginAssistantConstants.LA_RESETPASSWORD);
            }
        });
        $scope.$on("AccountRetrievalvalidation", function (event, responseData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
           // console.log(responseData._token);
            vm.isFormSubmitted = true;
            if (responseData) {

                LoginAssistantService.setUserDataToken(responseData._token);
                if (loginAssistModel.Vcontext == LoginAssistantConstants.LAVerificationContext.LA_PERSONEL_ID) {
                    if (responseData._token) {
                        var token = responseData._token.split('.')[1];
                        var base64 = token.replace(/-/g, '+').replace(/_/g, '/');
                        var decode = JSON.parse(window.atob(base64));
                        LoginAssistantService.setUserIdentifier(decode.sub);
                        LoginAssistantService.setUserFlow(decode.flow);
                        loginAssistModel.PersonalID = decode.sub;
                        $state.go(LoginAssistantConstants.LA_PERSONALID);
                    }
                    else if (responseData.uid) {
                        LoginAssistantService.setUserIdentifier(responseData.uid);
                        $state.go(LoginAssistantConstants.LA_PERSONALID);
                    }
                    else {
                        vm.ErrorMessage = "invalid pin";
                    }

                } else if (loginAssistModel.Vcontext == LoginAssistantConstants.LAVerificationContext.LA_PASSWORD) {
                    LoginAssistantService.setIsUserVerified(false);
                    LoginAssistantService.setresetpasswordflow(true);
                    $state.go(LoginAssistantConstants.LA_RESETPASSWORD);
                } else if (loginAssistModel.Vcontext == LoginAssistantConstants.LAVerificationContext.LA_ID_SHIELD) {
                    $state.go(LoginAssistantConstants.LA_ENTERPASSWORD);
                }
                
            }
            LoginAssistantService.setLoginAssistModel(loginAssistModel);

        });
    };
})();
;
(function () {
    'use strict';

    angular
        .module('LoginAssistantModule')
        .controller('EnterCodeController', enterCodeController);

    enterCodeController.$inject = ['$scope', '$state', 'CommonService', 'CommonConstants', 'LoginAssistantConstants', 'LoginAssistantService', '$sce', 'SiteCatService', '$rootScope', 'OpenModalService', '$timeout'];

    function enterCodeController($scope, $state, commonService, commonConstants, LoginAssistantConstants, LoginAssistantService, $sce, siteCatService, $rootScope, openModalService, $timeout) {
        var vm = this;
        vm.EnterCodeStatics = LoginAssistantConstants.EnterCodeStatics;
        vm.VerifyIdentityViaTextOrEmailStatics = LoginAssistantConstants.VerifyIdentityViaTextOrEmailStatics;
        vm.RemoveResendCode = false;
        vm.ContinueButton = LoginAssistantConstants.LA_CONTINUEBUTTON;
        vm.ChooseIdMethodStatics = LoginAssistantConstants.ChooseIdMethodStatics;
        vm.ResendButton = LoginAssistantConstants.LA_RESENDOTPBUTTON;
        vm.CommonErrorMessage = LoginAssistantConstants.LA_COMMON_ERROR_TEXT_VALIDATION_M881;
        vm.EnterIdInfoDetails = LoginAssistantService.getEnterIdInfoDetails();
        vm.loginAssistModel = LoginAssistantService.getLoginAssistModel();
        vm.idMethodType = LoginAssistantService.getIdMethodType();
        vm.ErrorMessage = '';
        vm.CancelButton = LoginAssistantConstants.LA_CANCELBUTTON;
        vm.IsShowResendCodeMessage = false;
        vm.isTouch = commonService.getIsTouch() === "True" ? true : false;
        vm.isThirdPartySharedAccess = LoginAssistantService.getUserType() == LoginAssistantConstants.LA_SHARED_ACCESS_BANKING ? true : false;
        var preview;
        var loginAssistModel = LoginAssistantService.getLoginAssistModel();
        var isTransmitApplicable = false;
        var rootUrl = document.querySelector(commonConstants.ROOT_URL_DIV_TEXT);
        var baseUrl = rootUrl.textContent || rootUrl.innerText;
        var url = baseUrl + LoginAssistantConstants.LA_VERIFYCUSTOMER_ACTION_URL;
        var context_data = "";
        var isTransmitApplicableForAndroid = false;
        var isTransmitApplicableForIOS = false;
        var isTouch = commonService.getIsTouch() === "True" ? true : false;
        var isMobileWeb = LoginAssistantService.isMobileWeb();
        var isIOSDevice = LoginAssistantService.isIOSDevice();
        var isAndroidDevice = false;
        vm.error_display = false;
        vm.last_attempt = false;
        vm.first_attempt = false;
        var OTP_count;
        var PIN_count;
        LoginAssistantService.setChangeMethodAfterFourAttempts(false);
        if (isTouch && !isMobileWeb && !isIOSDevice) {
            isAndroidDevice = true;
        }

        // if (!vm.isThirdPartySharedAccess) { //Eligible account list call is not required for shared access users
        //     LoginAssistantService.populateEligibleAccountList(baseUrl, $scope);
        // }
        $timeout(function () {
            document.getElementById("headerBackLink").style.display = 'none';
            document.getElementById("headerstartLink").style.display = 'block';

        }, 100);
        document.getElementById("la_progress_bar").outerHTML = "<progress role='progressbar' aria-valuenow='90' aria-valuetext='Your progress : 90%' max='100' value='90' />";
        if ($scope.parentobj.isGenericLanding) {
            $scope.parentobj.isGenericLanding = false;
            $state.go(LoginAssistantConstants.LA_GENERICLANDING);
        }
        $timeout(function () {
            window.scrollTo(0, 0);
            if (document.getElementById("headerBackLink") != null)
                document.getElementById("headerBackLink").blur();

            LoginAssistantService.setHeaderFocus("headingMainText");
        }, 500);

        $scope.setMainpageJawsInAccessible();

        // Start : Omniture for retrieve personal id/reset password/reset id shield enter otp
        LoginAssistantService.CallSiteCatService(loginAssistModel.Vcontext, vm.EnterCodeStatics.LA_O_ENTERCODE);
        // End : Omniture for retrieve personal id/reset password/reset id enter otp
       
        var dummyCounter = 0;
        $scope.onContinueClick = function () {
            vm.isFormSubmitted = true;
            vm.IsShowResendCodeMessage = false;
            vm.ErrorMessage = '';
            if (!$scope.form.$valid) {
                $scope.form.Code.$error.isSubmitted = true;
                LoginAssistantService.setVoiceOverFocus("divEnterCodeErrorMsg", 1500);
                callSiteCatServiceForFieldErrorMessage();
            }
            else {
                $rootScope.$broadcast('busy.begin');
                vm.isFormSubmitted = false;
                LoginAssistantService.setVoiceOverFocus("loading_progress");
                var userData = LoginAssistantService.getUserInputData();
                userData.Code = vm.Code;
                LoginAssistantService.setUserInputData(userData);
                document.getElementsByClassName("button")[0].click();
            }
        }
        $scope.closePopup = function () {
            vm.error_display = false;
        }
        $scope.otpRedirect_Continue = function () {
            LoginAssistantService.setSelectedAccount('');
            var data = LoginAssistantService.getAccountOption();
             if (Object.keys(data).length > 1) {
                    LoginAssistantService.setIsUserRedirectToPin(false);
                    if (data.ResetWithPIN != undefined && (data.ResetWithPIN.accounts == null || data.ResetWithPIN.accounts == "")) {
                        LoginAssistantService.setMultipleAccountType(LoginAssistantConstants.LA_DDA_ACCOUNT);
                        LoginAssistantService.setheadingType(LoginAssistantConstants.LA_DDA_ACCOUNT);
                        $state.go(LoginAssistantConstants.LA_VERIFYIDENTITYVIAACCOUNTNUMBERORPIN);
                    } else if (data.ResetWithCCD != undefined && data.ResetWithCCD.accounts.length == 1) {
                        var obj = {};
                        obj['index'] = 0;
                        obj['accounttype'] = LoginAssistantConstants.LA_RESETWITHCCD;
                        obj['account'] = data.ResetWithCCD.accounts[0].cardType;
                        obj['accountnumber'] = data.ResetWithCCD.accounts[0].accountNumber;
                        LoginAssistantService.setSelectedAccount(obj);
                        LoginAssistantService.setheadingType("Credit Card");
                        LoginAssistantService.setMultipleAccountType(LoginAssistantConstants.LA_CCD_ACCOUNT);
                        $state.go(LoginAssistantConstants.LA_VERIFYIDENTITYVIAACCOUNTNUMBERORPIN);
                    } else if (data.ResetWithAccountZIP != undefined && data.ResetWithAccountZIP.accounts.length == 1) {
                        var obj = {};
                        obj['index'] = 0;
                        obj['accounttype'] = LoginAssistantConstants.LA_RESETWITHACCOUNTZIP;
                        obj['account'] = data.ResetWithAccountZIP.accounts[0].cardType;
                        obj['accountnumber'] = data.ResetWithAccountZIP.accounts[0].accountNumber;
                        LoginAssistantService.setSelectedAccount(obj);
                        LoginAssistantService.setheadingType("Loans, Lines, Leases, Mortgage, Brokerage");
                        LoginAssistantService.setMultipleAccountType(LoginAssistantConstants.LA_LLLMW_ACCOUNT);
                        $state.go(LoginAssistantConstants.LA_VERIFYIDENTITYVIAACCOUNTNUMBERORPIN);
                        
                    } else {
                        LoginAssistantService.setIsUserRedirectToPin(true);
                        $state.go(LoginAssistantConstants.LA_MULTIPLEACCOUNTS);
                    }
                }
            


           
        }
        
        $scope.$on("AccountRetrievalvalidation", function (event, responseData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            vm.isFormSubmitted = true;
            if (responseData) {
                
                LoginAssistantService.setUserDataToken(responseData._token);
                if (loginAssistModel.Vcontext == LoginAssistantConstants.LAVerificationContext.LA_PERSONEL_ID) {
                    if (responseData._token) {
                        LoginAssistantService.setUserDataToken(responseData._token);
                        var token = responseData._token.split('.')[1];
                        var base64 = token.replace(/-/g, '+').replace(/_/g, '/');
                        var decode = JSON.parse(window.atob(base64));
                        LoginAssistantService.setUserIdentifier(decode.sub);
                        LoginAssistantService.setUserFlow(decode.flow);
                        loginAssistModel.PersonalID = decode.sub;
                        $state.go(LoginAssistantConstants.LA_PERSONALID);
                    }
                    else if (responseData.uid) {
                        LoginAssistantService.setUserIdentifier(responseData.uid);
                        loginAssistModel.PersonalID = responseData.uid;
                        $state.go(LoginAssistantConstants.LA_PERSONALID);
                    }
                    else {
                        callSiteCatServiceForFieldErrorMessage();
                        vm.ErrorMessage = "invalid pin";
                    }

                } else if (loginAssistModel.Vcontext == LoginAssistantConstants.LAVerificationContext.LA_PASSWORD) {
                    LoginAssistantService.setIsUserVerified(true);
                    LoginAssistantService.invokeForgotPasswordPolicy();
                    $state.go(LoginAssistantConstants.LA_RESETPASSWORD);
                } else if (loginAssistModel.Vcontext == LoginAssistantConstants.LAVerificationContext.LA_ID_SHIELD) {
                    $state.go(LoginAssistantConstants.LA_ENTERPASSWORD);
                }

            }
            LoginAssistantService.setLoginAssistModel(loginAssistModel);


        });
        $scope.$on("ErrorMessageDisplay", function (event, responseData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            if (responseData != null) {
                if (responseData.data.success == false) {
                    callSiteCatServiceForFieldErrorMessage();
                    vm.loading = false;
                    vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.VerifyIdentityStatics.LA_DOESNT_MATCH);
                    LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);

                }
            }
            
        });
        $scope.$on("ResendOtpButton", function (event, response) {
            $scope.$apply(function () {
                vm.IsShowResendCodeMessage = true;
            });


            //console.log(document.getElementById());

        });
        $scope.$on("ExceptionhandlePolicyRedirect", function (event, errorData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            vm.loading = false;
            if (errorData != null) {
                if (errorData.policyId == "create_user_session" && errorData.redirectType == 1 && errorData.userId == "") {
                    vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M618);
                    LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                }
            }
            
        });
        $scope.$on("Exceptionhandle", function (event, errorData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            vm.loading = false;
            //console.log(errorData);
            if (errorData) {
                var err_msg = errorData.reason._data.server_error_data.failure_data.reason.data;
                if (err_msg.action == "reject" && err_msg.code == 6 && err_msg.reason == "locked") {
                    $state.go(LoginAssistantConstants.LA_LOCKERROR);
                    LoginAssistantService.setErrorCode(err_msg.code);
                } else if (err_msg.lock_reason == "internal" && err_msg.lock_type == "user" && err_msg.locked == true) {
                    $state.go(LoginAssistantConstants.LA_LOCKERROR);
                } else {
                    vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.VerifyIdentityStatics.LA_DOESNT_MATCH);
                    LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                }
            }

        });
        $scope.$on("TransmitError", function (event, responseData, count) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            OTP_count = count;
            LoginAssistantService.setOTPValidationCount(count);
            $scope.$apply(function () {
                if (count == 2) {
                    vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_SHAREED_ACCESS_ERROR_MESSAGE_M882);
                    LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                } else if (count == 1) {  
                    var data = LoginAssistantService.getAccountOption();
                    vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_ENTERCODE_ERROR_MESSAGE_M1013);
                    LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                    PIN_count = LoginAssistantService.getPinValidationCount();
                    LoginAssistantService.setChangeMethodAfterFourAttempts(true);
                    if ((PIN_count == undefined || PIN_count == null || PIN_count < 4) && (data.ResetWithPIN != undefined || data.ResetWithAccountZIP != undefined || data.ResetWithCCD != undefined)) {
                        vm.error_display = true;
                        vm.last_attempt = false;
                        vm.first_attempt = true;
                    } else {
                        vm.error_display = true;
                        vm.first_attempt = true;
                        vm.last_attempt = false;
                    }
                    
                } else {
                    $state.go(LoginAssistantConstants.LA_LOCKERROR);
                }
            });
          //  console.log(count);
        });
        $scope.$on("ExceptionhandlePolicyRejection", function (event, errorData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            vm.loading = false;
            vm.isFormSubmitted = true;
            if (errorData != null) {
                var err_msg = errorData.reason.data;
                if (err_msg.action == "reject" && err_msg.code == 9 || (errorData == undefined)) {
                    vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.VerifyIdentityStatics.LA_DOESNT_MATCH);
                    LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                } else if (err_msg.action == "reject" && err_msg.code == 5 && err_msg.reason == "locked") {
                    $state.go(LoginAssistantConstants.LA_LOCKERROR);
                } else if (err_msg.lock_reason == "internal" && err_msg.lock_type == "user" && err_msg.locked == true) {
                    $state.go(LoginAssistantConstants.LA_LOCKERROR);
                } 

            }
        });

        function callSiteCatServiceForFieldErrorMessage() {
            // Omniture for enter otp error page when user keeps the otp field blank
            if (($scope.form.Code.$error.isDirty || $scope.form.Code.$error.isSubmitted) && $scope.form.Code.$error.required) {
                LoginAssistantService.CallSiteCatService(loginAssistModel.Vcontext, vm.EnterCodeStatics.LA_O_ENTERCODEOTPNOTENTEREDERROR);
            } //Omniture for enter otp error page when user enters non numeric character for otp
            else if (($scope.form.Code.$error.isInValid || $scope.form.Code.$error.isSubmitted) && $scope.form.Code.$error.mask) {
                LoginAssistantService.CallSiteCatService(loginAssistModel.Vcontext, vm.EnterCodeStatics.LA_O_ENTERCODEOTPFORMATERROR);
            }
        }

        //handle from Native for setting context data
        window.getAuthenticatorNativeResponse = function getAuthenticatorNativeResponse(response) {
            console.log("getAuthenticatorNativeResponse Called");
            console.log(response);
            if (response.data) {
                context_data = response.data;
            }
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            var method = commonConstants.METHOD_TYPE_POST;
            var rootUrl = document.querySelector(commonConstants.ROOT_URL_DIV_TEXT).innerText || document.querySelector(commonConstants.ROOT_URL_DIV_TEXT).textContent;
            var url = rootUrl + LoginAssistantConstants.LA_GENERATETRANSMITTOKEN_ACTION_URL;
            var inputData = {};
            inputData.ContextData = context_data;
            inputData.AppId = "mbl";
            inputData.UserName = loginAssistModel.PersonalID;
            var headerData = commonConstants.HEADERDATA;
            commonService.result(method, url, inputData, headerData)
                .success(function (result) {
                    if (result) {
                        if (isTransmitApplicableForAndroid) {
                            if (typeof IDSheildConfigJSInterface !== "undefined") {
                                IDSheildConfigJSInterface.resumePlaceHolderFromNative(result.TransmitToken);
                            }
                        }
                        else if (isTransmitApplicableForIOS) {
                            if (typeof resumePlaceHolderFromNative !== "undefined") {
                                resumePlaceHolderFromNative(result.TransmitToken);
                            }
                        }

                        //Moving to Next screen after token validation in App
                        if (loginAssistModel.Vcontext == LoginAssistantConstants.LAVerificationContext.LA_PASSWORD) {
                            $state.go(LoginAssistantConstants.LA_RESETPASSWORD);
                        }
                        else if (loginAssistModel.Vcontext == LoginAssistantConstants.LAVerificationContext.LA_ID_SHIELD) {
                            $state.go(LoginAssistantConstants.LA_ENTERPASSWORD);
                        } else {
                            $state.go(LoginAssistantConstants.LA_PERSONALID);
                        }

                    }
                }).error(function () {
                    LoginAssistantService.removeVoiceOverFocus("loading_progress");
                    vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M618);
                    callSiteCatServiceForSystemUnavailableMessage();
                });
        }
       
      
    };
})();;
(function () {
    'use strict';

    angular
        .module('LoginAssistantModule')
        .controller('EnterTaxIdController', enterTaxIdController);

    enterTaxIdController.$inject = ['$scope', '$rootScope', '$state', 'CommonService', 'CommonConstants', 'LoginAssistantConstants', 'LoginAssistantService', '$sce', '$timeout'];

    function enterTaxIdController($scope, $rootScope, $state, commonService, commonConstants, LoginAssistantConstants, LoginAssistantService, $sce, $timeout) {
        var vm = this;
        $scope.parentobj.isBackDivDisplay = true;
        vm.EnterTaxIdStatics = LoginAssistantConstants.EnterTaxIdStatics;
        vm.NextButton = LoginAssistantConstants.LA_CONTINUEBUTTON; //CI:Jan-2018, B-58349
        vm.CommonErrorMessage = LoginAssistantConstants.LA_COMMON_ERROR_TEXT_VALIDATION_M881;
        vm.CancelButton = LoginAssistantConstants.LA_CANCELBUTTON;
        vm.FourDigitPattern = LoginAssistantConstants.LA_FOURDIGIT_PATTERN;
        vm.isFormSubmitted = false;
        vm.ErrorMessage = '';
        

        document.getElementById("la_progress_bar").outerHTML = "<progress role='progressbar' aria-valuenow='55' aria-valuetext='Your progress : 55%' max='100' value='55' />";
        if ($scope.parentobj.isGenericLanding) {
            $scope.parentobj.isGenericLanding = false;
            $state.go(LoginAssistantConstants.LA_GENERICLANDING);
        }
        $timeout(function () {

            window.scrollTo(0, 0);
            if (document.getElementById("headerBackLink") != null)
                document.getElementById("headerBackLink").blur();
            if (window.innerWidth >= 320 && window.innerWidth < 415) {
                document.getElementsByClassName("la__touchnav-container")[0].scrollIntoView();
            }

            LoginAssistantService.setHeaderFocus("headingMainText");
        }, 500);

        $scope.setMainpageJawsInAccessible();
        document.getElementById("headerBackLink").style.display = 'none';
        document.getElementById("headerstartLink").style.display = 'block';

        $scope.onNextClick = function () {
            
            vm.isFormSubmitted = true;
            if ($scope.form.$invalid)
                $scope.form.TaxId.$error.isSubmitted = true;
            else {
                $rootScope.$broadcast('busy.begin');
                LoginAssistantService.setVoiceOverFocus("loading_progress");
                var userData = LoginAssistantService.getUserInputData();
                userData.TaxId = vm.TaxId;
                LoginAssistantService.setUserInputData(userData);
                document.getElementsByClassName("button")[0].click();
            }
        }
        $scope.$on("ErrorMessageDisplay", function (event, responseData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            if (responseData != null) {
                if (responseData.data.success == false) {
                    vm.loading = false;
                    vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_TAXID_ERROR_TEXT_VALIDATION_M883);
                    LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                }
            }
        });
        $scope.$on("ExceptionhandlePolicyRedirect", function (event, errorData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            vm.loading = false;
            if (errorData != null) {
                if (errorData.policyId == "create_user_session" && errorData.redirectType == 1 && errorData.userId == "") {
                    vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M618);
                    LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                }
            }
            
        });
        $scope.$on("Exceptionhandle", function (event, errorData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            vm.loading = false;
            //console.log(errorData);
            if (errorData) {
                var err_msg = errorData.reason._data.server_error_data.failure_data.reason.data;
                if (err_msg.action == "reject" && err_msg.code == 6 && err_msg.reason == "locked") {
                    $state.go(LoginAssistantConstants.LA_LOCKERROR);
                    LoginAssistantService.setErrorCode(err_msg.code);
                } else {
                    vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.VerifyIdentityStatics.LA_DOESNT_MATCH);
                    LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                }
            }

        });
        $scope.$on('OpenTransmitOTP', function () {
            // console.log("inside");  
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            $state.go(LoginAssistantConstants.LA_ENTERCODE);
        });

        $scope.$on("ExceptionhandlePolicyRejection", function (event, errorData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            vm.loading = false;
            vm.isFormSubmitted = true;
            if (errorData != null) {
                var err_msg = errorData.reason.data;
                if (err_msg.action == "reject" && err_msg.code == 9 || (errorData == undefined)) {
                    vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.VerifyIdentityStatics.LA_DOESNT_MATCH);
                    LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                } else if (err_msg.action == "reject" && err_msg.code == 5 && err_msg.reason == "locked") {
                    $state.go(LoginAssistantConstants.LA_LOCKERROR);
                    LoginAssistantService.setErrorCode(err_msg.code);
                } else if (err_msg.action == "reject" && err_msg.code == 6 && err_msg.reason == "locked") {
                    $state.go(LoginAssistantConstants.LA_LOCKERROR);
                    LoginAssistantService.setErrorCode(err_msg.code);
                }
            }
        });

        $scope.$on("AccountRetrievalvalidation", function (event, responseData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            if (responseData) {
                // console.log(responseData)
                vm.loading = false;
                vm.isFormSubmitted = true;
                LoginAssistantService.setAccountOption(responseData);
                LoginAssistantService.setMultipleAccountTypeforBack(false);
                LoginAssistantService.setMultipleAccountSharedAccessforBack(false);
                if (responseData.required) {
                    LoginAssistantService.setMultipleAccountTypeforBack(true);
                    $state.go(LoginAssistantConstants.LA_ENTERTAXID);
                }
                else if (responseData.list) {
                    LoginAssistantService.setMultipleAccountSharedAccessforBack(true);
                    LoginAssistantService.setMultipleSharedAccessAdmins(responseData);
                    $state.go(LoginAssistantConstants.LA_MULTIPLESHAREDACCESSADMINS);
                } else if (Object.keys(responseData).length == 0) {
                    vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_COMMON_ERROR_TEXT_VALIDATION_M881);
                    LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                } else {
                    var data = LoginAssistantService.getAccountOption();
                    if (Object.keys(responseData).length == 1) {
                        LoginAssistantService.setIsUserRedirectToPin(false);
                        if (data.ResetWithPIN != undefined && (data.ResetWithPIN.accounts == null || data.ResetWithPIN.accounts == "")) {
                            LoginAssistantService.setMultipleAccountType(LoginAssistantConstants.LA_DDA_ACCOUNT);
                            LoginAssistantService.setheadingType(LoginAssistantConstants.LA_DDA_ACCOUNT);
                            $state.go(LoginAssistantConstants.LA_VERIFYIDENTITYVIAACCOUNTNUMBERORPIN);
                        } else if (data.ResetWithOTP != undefined && data.ResetWithOTP.accounts.length == 1) {
                            LoginAssistantService.setIsUserRedirectToPin(true);
                            $state.go(LoginAssistantConstants.LA_VERIFYIDENTITY);
                        } else if (data.ResetWithCCD != undefined && data.ResetWithCCD.accounts.length == 1) {
                            var obj = {};
                            obj['index'] = 0;
                            obj['accounttype'] = LoginAssistantConstants.LA_RESETWITHCCD;
                            obj['account'] = data.ResetWithCCD.accounts[0].displayName;
                            obj['accountnumber'] = data.ResetWithCCD.accounts[0].accountNumber;
                            LoginAssistantService.setSelectedAccount(obj);
                            LoginAssistantService.setheadingType("Credit Card");
                            LoginAssistantService.setMultipleAccountType(LoginAssistantConstants.LA_CCD_ACCOUNT);
                            $state.go(LoginAssistantConstants.LA_VERIFYIDENTITYVIAACCOUNTNUMBERORPIN);
                        } else if (data.ResetWithAccountZIP != undefined && data.ResetWithAccountZIP.accounts.length == 1) {
                            var obj = {};
                            obj['index'] = 0;
                            obj['accounttype'] = LoginAssistantConstants.LA_RESETWITHACCOUNTZIP;
                            obj['account'] = data.ResetWithAccountZIP.accounts[0].displayName;
                            obj['accountnumber'] = data.ResetWithAccountZIP.accounts[0].accountNumber;
                            LoginAssistantService.setSelectedAccount(obj);
                            LoginAssistantService.setheadingType("Loans, Lines, Leases, Mortgage, Brokerage");
                            LoginAssistantService.setMultipleAccountType(LoginAssistantConstants.LA_LLLMW_ACCOUNT);
                            $state.go(LoginAssistantConstants.LA_VERIFYIDENTITYVIAACCOUNTNUMBERORPIN);
                        } else {
                            // LoginAssistantService.setIsUserRedirectToPin(true);
                            $state.go(LoginAssistantConstants.LA_MULTIPLEACCOUNTS);
                        }
                    } else {
                        //console.log(responseData);
                        LoginAssistantService.setIsUserRedirectToPin(true);
                        if (data.ResetWithOTP.accounts.length == 1) {
                            var obj = {};
                            obj['index'] = 0;
                            obj['account'] = data.ResetWithOTP.accounts;
                            LoginAssistantService.setSelectedAccount(obj);
                        }
                        $state.go(LoginAssistantConstants.LA_VERIFYIDENTITY);
                    }

                }

            }

        });
    };
})();;
(function () {
    'use strict';

    angular
        .module('LoginAssistantModule')
        .controller('MultipleSharedAccessAdminsController', multipleSharedAccessAdminsController);

    multipleSharedAccessAdminsController.$inject = ['$scope', '$rootScope', '$state', 'CommonService', 'CommonConstants', '$sce', 'LoginAssistantConstants', 'LoginAssistantService', 'SiteCatService', '$timeout'];

    function multipleSharedAccessAdminsController($scope, $rootScope, $state, commonService, commonConstants, $sce, LoginAssistantConstants, LoginAssistantService, siteCatService, $timeout) {
        var vm = this;
        vm.VerifyIdentityViaTextOrEmailStatics = LoginAssistantConstants.VerifyIdentityViaTextOrEmailStatics;
        vm.VerifyCustomerModel = LoginAssistantService.getVerifyCustomerModel();
        vm.ChooseIdMethodStatics = LoginAssistantConstants.ChooseIdMethodStatics;
        vm.EnterIdInfoDetails = LoginAssistantService.getEnterIdInfoDetails();
        vm.idMethodType = LoginAssistantService.getIdMethodType();
        vm.isThirdPartySharedAccess = LoginAssistantService.getUserType() == LoginAssistantConstants.LA_SHARED_ACCESS_BANKING ? true : false;
        vm.ErrorMessage = '';
        vm.CancelButton = LoginAssistantConstants.LA_CANCELBUTTON;
        var loginAssistModel = LoginAssistantService.getLoginAssistModel();
        vm.hasMultipleAdmins = LoginAssistantService.getIsSharedAccessMultipleAdmin();
        vm.loginAssistModel = loginAssistModel;
        vm.onAdminSelected = OnAdminSelected;
        vm.isError = false;
        vm.ErrorMessage = "";
        vm.Admins = [];
        vm.Admin_Del_UID = {};
        var Admin_Del_UID_length = 0;
        var i = 0;
        var data = LoginAssistantService.getMultipleSharedAccessAdmins();
       
        data.list.forEach(function (account) {
            var obj = {};
            obj['idx'] = i;
            obj['name'] = account;
            i++;
            vm.Admins.push(obj);
            console.log(obj);
        });


        $timeout(function () {
            document.getElementById("headerBackLink").style.display = 'none';
            document.getElementById("headerstartLink").style.display = 'block';
        }, 100);
        document.getElementById("la_progress_bar").outerHTML = "<progress role='progressbar' aria-valuenow='55' aria-valuetext='Your progress : 55%' max='100' value='55' />";

        $timeout(function () {
            window.scrollTo(0, 0);
            if (document.getElementById("headerBackLink") != null)
                document.getElementById("headerBackLink").blur();

            LoginAssistantService.setHeaderFocus("headingMainText");
        }, 500);
       
        function OnAdminSelected(selectedAdmin) {
            $rootScope.$broadcast('busy.begin');
            LoginAssistantService.setSelectedSharedAccessAdmin(selectedAdmin);
            document.getElementsByClassName("button")[0].click();

        }

        $scope.$on("AccountRetrievalvalidation", function (event, responseData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            LoginAssistantService.setAccountOption(responseData);
            $state.go(LoginAssistantConstants.LA_VERIFYIDENTITY);
        });
        $scope.$on('OpenTransmitOTP', function () {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            // console.log("inside");  
            $state.go(LoginAssistantConstants.LA_ENTERCODE);
        });

        $scope.setMainpageJawsInAccessible();
    };
})();;
(function () {
    'use strict';

    angular
        .module('LoginAssistantModule')
        .controller('MultipleAccountsController', multipleSharedAccessAdminsController);

    multipleSharedAccessAdminsController.$inject = ['$scope', '$rootScope', '$state', 'CommonService', 'CommonConstants', '$sce', 'LoginAssistantConstants', 'LoginAssistantService', 'SiteCatService', '$timeout'];

    function multipleSharedAccessAdminsController($scope, $rootScope, $state, commonService, commonConstants, $sce, LoginAssistantConstants, LoginAssistantService, siteCatService, $timeout) {
        var vm = this;
        vm.VerifyIdentityViaTextOrEmailStatics = LoginAssistantConstants.VerifyIdentityViaTextOrEmailStatics;
        vm.VerifyCustomerModel = LoginAssistantService.getVerifyCustomerModel();
        vm.ChooseIdMethodStatics = LoginAssistantConstants.ChooseIdMethodStatics;
        vm.EnterIdInfoDetails = LoginAssistantService.getEnterIdInfoDetails();
        vm.idMethodType = LoginAssistantService.getIdMethodType();
        vm.isThirdPartySharedAccess = LoginAssistantService.getUserType() == LoginAssistantConstants.LA_SHARED_ACCESS_BANKING ? true : false;
        vm.ErrorMessage = '';
        vm.CancelButton = LoginAssistantConstants.LA_CANCELBUTTON;
        var loginAssistModel = LoginAssistantService.getLoginAssistModel();
        vm.hasMultipleAdmins = LoginAssistantService.getIsSharedAccessMultipleAdmin();
        vm.loginAssistModel = loginAssistModel;
        vm.onAdminSelected = OnAdminSelected;
        vm.isError = false;
        vm.ErrorMessage = "";
        vm.Admins = [];
        vm.Admin_Del_UID = {};
        var i = 0;
        var j = 0;
        var Admin_Del_UID_length = 0;

        if ($scope.parentobj.isGenericLanding) {
            $scope.parentobj.isGenericLanding = false;
            $state.go(LoginAssistantConstants.LA_GENERICLANDING);
        }
        $timeout(function () {
            document.getElementById("headerBackLink").style.display = 'none';
            document.getElementById("headerstartLink").style.display = 'block';
        }, 100);

        Object.keys(LoginAssistantService.getAccountOption()).forEach(function (admin) {
            var data = LoginAssistantService.getAccountOption();

            if (admin == LoginAssistantConstants.LA_RESETWITHCCD && data.ResetWithCCD) {
                data.ResetWithCCD.accounts.forEach(function (account) {
                    var obj = {};
                    obj['index'] = i;
                    obj['accounttype'] = LoginAssistantConstants.LA_RESETWITHCCD;
                    obj['account'] = account.displayName;
                    obj['accountnumber'] = account.accountNumber;
                    obj['lastFour'] = account.accountNumber.replace(/\d(?=\d{4})/g, "*");
                    i++;
                    vm.Admins.push(obj);
                });
            }
            if (admin == LoginAssistantConstants.LA_RESETWITHACCOUNTZIP && data.ResetWithAccountZIP) {
                data.ResetWithAccountZIP.accounts.forEach(function (account) {
                    var obj = {};
                    obj['index'] = j;
                    obj['accounttype'] = LoginAssistantConstants.LA_RESETWITHACCOUNTZIP;
                    obj['account'] = account.displayName;
                    obj['accountnumber'] = account.accountNumber;
                    obj['lastFour'] = account.accountNumber.replace(/\d(?=\d{4})/g, "*");
                    j++;
                    vm.Admins.push(obj);
                });
            }
             });

        document.getElementById("la_progress_bar").outerHTML = "<progress role='progressbar' aria-valuenow='75' aria-valuetext='Your progress : 75%' max='100' value='75' />";

        $timeout(function () {
            window.scrollTo(0, 0);
            if (document.getElementById("headerBackLink") != null)
                document.getElementById("headerBackLink").blur();

            LoginAssistantService.setHeaderFocus("headingMainText");
        }, 500);
        // Start : Omniture for multiple accounts
        LoginAssistantService.CallSiteCatService(loginAssistModel.Vcontext, LoginAssistantConstants.LA_O_MultipleAccounts);
        // End : Omniture for multiple accountsr 

        function OnAdminSelected(selectedAdmin) {
            //$rootScope.$broadcast('busy.begin');
            LoginAssistantService.setSelectedAccount(selectedAdmin);
            var data = LoginAssistantService.getAccountOption();
            var flag = false;
           // console.log(data.ResetWithPIN);
           
            if (!flag && data.ResetWithCCD) {
                
                data.ResetWithCCD.accounts.forEach(function (account) {
                    if (account.accountNumber === selectedAdmin.accountnumber) {
                        flag = true;
                        LoginAssistantService.setheadingType("Credit Card");
                        LoginAssistantService.setMultipleAccountType(LoginAssistantConstants.LA_CCD_ACCOUNT);
                    }
                });
            }
            if (!flag && data.ResetWithAccountZIP) {
                data.ResetWithAccountZIP.accounts.forEach(function (account) {
                    if (account.accountNumber === selectedAdmin.accountnumber) {
                        flag = true;
                        LoginAssistantService.setMultipleAccountType(LoginAssistantConstants.LA_LLLMW_ACCOUNT);
                        LoginAssistantService.setheadingType("Loans, Lines, Leases, Mortgage, Brokerage");
                    }
                });
            }
          
           $state.go(LoginAssistantConstants.LA_VERIFYIDENTITYVIAACCOUNTNUMBERORPIN);
        }

        $scope.setMainpageJawsInAccessible();
    };
})();;
(function () {
    'use strict';

    angular
        .module('LoginAssistantModule')
        .controller('MultipleMobileNumberController', MultipleMobileNumberController);

    MultipleMobileNumberController.$inject = ['$scope', '$rootScope', '$state', 'CommonService', 'CommonConstants', '$sce', 'LoginAssistantConstants', 'LoginAssistantService', 'SiteCatService', '$timeout'];

    function MultipleMobileNumberController($scope, $rootScope, $state, commonService, commonConstants, $sce, LoginAssistantConstants, LoginAssistantService, siteCatService, $timeout) {
        var vm = this;
        vm.VerifyIdentityViaTextOrEmailStatics = LoginAssistantConstants.VerifyIdentityViaTextOrEmailStatics;
        vm.VerifyCustomerModel = LoginAssistantService.getVerifyCustomerModel();
        vm.ChooseIdMethodStatics = LoginAssistantConstants.ChooseIdMethodStatics;
        vm.EnterIdInfoDetails = LoginAssistantService.getEnterIdInfoDetails();
        vm.idMethodType = LoginAssistantService.getIdMethodType();
        vm.isThirdPartySharedAccess = LoginAssistantService.getUserType() == LoginAssistantConstants.LA_SHARED_ACCESS_BANKING ? true : false;
        vm.ErrorMessage = '';
        vm.CancelButton = LoginAssistantConstants.LA_CANCELBUTTON;
        var loginAssistModel = LoginAssistantService.getLoginAssistModel();
        vm.hasMultipleAdmins = LoginAssistantService.getIsSharedAccessMultipleAdmin();
        vm.loginAssistModel = loginAssistModel;
        vm.onAdminSelected = OnAdminSelected;
        vm.Redirect = LoginAssistantService.getFsvUser();
        vm.FsvRedirectionFails = LoginAssistantService.getFsvRedirectionFails();
        vm.IsEmail = false;

        vm.isError = false;
        vm.NoInfoFound = false;
        vm.ErrorMessage = "";
        vm.Admins = [];
        vm.showFsvError = false;
        if (vm.FsvRedirectionFails) {
            vm.showFsvError = true;
        } else {
            vm.showFsvError = false;
        }
        if (vm.Redirect && !vm.FsvRedirectionFails) {
            var j = 0;
            vm.Admins = [];
            var dataPhone = LoginAssistantService.getFsvResponsePhoneNumber();

            if (dataPhone) {
                if (dataPhone.length > 0) {
                    dataPhone.forEach(function (account) {
                        var obj = {};
                        obj['index'] = j;
                        obj['account'] = account._description;
                        j++;
                        vm.Admins.push(obj);
                    });
                    if ((vm.Admins).length == 0) {
                        vm.NoInfoFound = true;
                    } else {
                        if (((vm.Admins)[0].account).includes('usbank.com')) {
                            vm.IsEmail = true;
                        } else {
                            vm.IsEmail = false;
                        }
                    }
                } else {
                    vm.NoInfoFound = true;
                }
            } else {
                vm.NoInfoFound = true;
            }
        }
        vm.Admin_Del_UID = {};
        var i = 0;
        var Admin_Del_UID_length = 0;
        $timeout(function () {
            document.getElementById("headerBackLink").style.display = 'none';
            document.getElementById("headerstartLink").style.display = 'block';

        }, 100);
        Object.keys(LoginAssistantService.getAccountOption()).forEach(function (admin) {
            var data = LoginAssistantService.getAccountOption();

            if (admin == LoginAssistantConstants.LA_RESETWITHOTP && data.ResetWithOTP) {
                if (data.ResetWithOTP.accounts.length > 1) {
                    data.ResetWithOTP.accounts.forEach(function (account) {
                        var obj = {};
                        obj['index'] = i;
                        obj['account'] = account;
                        i++;
                        vm.Admins.push(obj);
                    });
                }

            }
            else {
                LoginAssistantService.CallSiteCatService(loginAssistModel.Vcontext, LoginAssistantConstants.LA_O_MULTIPLEMOBILEERROR);
            }
        });
        document.getElementById("la_progress_bar").outerHTML = "<progress role='progressbar' aria-valuenow='75' aria-valuetext='Your progress : 75%' max='100' value='75' />";
        if ($scope.parentobj.isGenericLanding) {
            $scope.parentobj.isGenericLanding = false;
            $state.go(LoginAssistantConstants.LA_GENERICLANDING);
        }
        $timeout(function () {
            window.scrollTo(0, 0);
            if (document.getElementById("headerBackLink") != null)
                document.getElementById("headerBackLink").blur();

            LoginAssistantService.setHeaderFocus("headingMainText");
        }, 500);

        // Start : Omniture for multiple mobile number
        LoginAssistantService.CallSiteCatService(loginAssistModel.Vcontext, LoginAssistantConstants.LA_O_MultipleMobileNumber);
        // End : Omniture for multiple mobile number

        function OnAdminSelected(selectedAdmin) {
            $rootScope.$broadcast('busy.begin');
            if (vm.Redirect) {
                var data = LoginAssistantService.getFsvResponsePhoneNumber();
                if (data) {
                    data.forEach(function (account) {
                        if (account._description === selectedAdmin.account) {
                            var obj = {};
                            obj['index'] = selectedAdmin.index;
                            obj['account'] = [selectedAdmin.account];
                            LoginAssistantService.setSelectedAccount(obj);
                            $rootScope.$broadcast('FSvMobileNumberClick', selectedAdmin.index);
                            $state.go(LoginAssistantConstants.LA_ENTERCODE);
                            // document.getElementsByClassName("button")[0].click();

                        }
                    });
                } else {
                    LoginAssistantService.CallSiteCatService(loginAssistModel.Vcontext, LoginAssistantConstants.LA_O_MULTIPLEMOBILEERROR);
                }
            } else {
                var data = LoginAssistantService.getAccountOption();
                if (data.ResetWithOTP && data.ResetWithOTP.accounts) {
                    data.ResetWithOTP.accounts.forEach(function (account) {
                        if (account === selectedAdmin.account) {
                            var obj = {};
                            obj['index'] = selectedAdmin.index;
                            obj['account'] = [selectedAdmin.account];
                            LoginAssistantService.setSelectedAccount(obj);
                            document.getElementsByClassName("button")[0].click();
                        }
                    });
                } else {
                    LoginAssistantService.CallSiteCatService(loginAssistModel.Vcontext, LoginAssistantConstants.LA_O_MULTIPLEMOBILEERROR);
                }
            }
        }

        $scope.$on('OpenTransmitOTP', function () {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            // console.log("inside");  
            $state.go(LoginAssistantConstants.LA_ENTERCODE);
        });

        function callSiteCatServiceForSystemUnavailableMessage() {
            LoginAssistantService.CallSiteCatServiceForSystemUnavailableMessage(vm.ErrorMessage, vm.loginAssistModel.Vcontext,
                vm.EnterIdInfoStatics.LA_O_ACCOUNTSSNSYSTEMUNAVAILABLE);
        }

        $scope.setMainpageJawsInAccessible();
    };
})();;
(function () {
    'use strict';

    angular
        .module('LoginAssistantModule')
        .controller('LockErrorController', lockErrorController);

    lockErrorController.$inject = ['$scope', '$state', 'LoginAssistantConstants', '$sce', '$timeout', 'LoginAssistantService'];

    function lockErrorController($scope, $state, LoginAssistantConstants, $sce, $timeout, LoginAssistantService) {
        var vm = this;
        $scope.parentobj.isBackDivDisplay = false;
        if (LoginAssistantService.getUserType() === LoginAssistantConstants.LA_SHARED_ACCESS_BANKING) {
            vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_SHAREED_ACCESS_INACTIVE_ERROR_MSG);
        }
        else {
            if (LoginAssistantService.getErrorCode() == 6) {
                vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_ACCOUNT_LOCKEDBY_FRAUD);
            } else {
                vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_COMMON_LOCK_ERROR_MESSAGE_REBRAND);
            }
            
        }
        vm.CancelButton = LoginAssistantConstants.LA_CANCELBUTTON;
        if ($scope.parentobj.isGenericLanding) {
            $scope.parentobj.isGenericLanding = false;
            $state.go(LoginAssistantConstants.LA_GENERICLANDING);
        }
        $timeout(function () {

            window.scrollTo(0, 0);
            document.getElementById("headerBackLink").blur();

            LoginAssistantService.setHeaderFocus("headingMainText");
        }, 500);

        $scope.setMainpageJawsInAccessible();
            
    };
})();;
(function () {
    'use strict';

    angular
        .module('LoginAssistantModule')
        .controller('ResetPasswordController', resetPasswordController);

    resetPasswordController.$inject = ['$scope', 'CommonService', 'CommonConstants', 'LoginAssistantConstants', 'LoginAssistantService', '$sce', '$rootScope', '$state', '$timeout', 'CommonHelper', '$compile'];

    function resetPasswordController($scope, commonService, commonConstants, LoginAssistantConstants, LoginAssistantService, $sce, $rootScope, $state, $timeout, commonHelper, $compile) {
        var vm = this;
        vm.ResetPasswordStatics = LoginAssistantConstants.ResetPasswordStatics;
        vm.CommonErrorMessage = LoginAssistantConstants.LA_COMMON_ERROR_TEXT_VALIDATION_M881;
        vm.NextButton = LoginAssistantConstants.LA_CONTINUEBUTTON;
        vm.CancelButton = LoginAssistantConstants.LA_CANCELBUTTON;
        vm.isPasswordResetSuccessfully = false;
        vm.isAlreadyVerified = false;
        $scope.parentobj.isBackDivDisplay = true;
        vm.ErrorMessage = '';
        var rootUrl = document.querySelector(commonConstants.ROOT_URL_DIV_TEXT);
        var baseUrl = rootUrl.textContent || rootUrl.innerText;
        var loginAssistModel = LoginAssistantService.getLoginAssistModel();
        vm.loginAssistModel = loginAssistModel;
        vm.VerifyCustomerModel = LoginAssistantService.getVerifyCustomerModel();
        vm.LASTransmitToken = LoginAssistantService.getLASTransmitToken();
        vm.ChooseIdMethodStatics = LoginAssistantConstants.ChooseIdMethodStatics;
        
        vm.PersonalId = vm.loginAssistModel.PwdExpired ? vm.loginAssistModel.PersonalID : LoginAssistantService.getUserIdentifier();
       
        $scope.OnForgotAnswer = onForgotAnswer;

        $timeout(function () {
            document.getElementById("headerBackLink").style.display = 'none';
            document.getElementById("headerstartLink").style.display = 'block';
        }, 100);
    
        if (LoginAssistantService.getresetpasswordflow()) {
            LoginAssistantService.invokeForgotPasswordPolicy();
        }

        if (LoginAssistantService.getErrorMessage() != null || LoginAssistantService.getErrorMessage() != undefined) {
            vm.isFormSubmitted = true;
            vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantService.getErrorMessage());
            LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
        } else {
            vm.isFormSubmitted = false;
            vm.ErrorMessage = '';

        }
        document.getElementById("la_progress_bar").outerHTML = "<progress role='progressbar' aria-valuenow='99' aria-valuetext='Your progress : 99%' max='100' value='99' />";

        // Code for sitecat defect MOB2-44977 fix starts 
        LoginAssistantService.CallSiteCatService(loginAssistModel.Vcontext, LoginAssistantConstants.LA_RESETPASSWORD);

		// Code for sitecat defect fix ends

        $timeout(function () {
            window.scrollTo(0, 0);
            if (document.getElementById("headerBackLink") != null)
                document.getElementById("headerBackLink").blur();

            LoginAssistantService.setHeaderFocus("headingMainText");
        }, 500);

        $scope.setMainpageJawsInAccessible();

        if (LoginAssistantService.getIsUserVerified())
            vm.isAlreadyVerified = true;

        getMainText();

        $scope.onNextClick = function () {
            
            vm.isFormSubmitted = true;
            vm.ErrorMessage = '';
            if (!$scope.form.$valid) {
                $scope.form.Password.$error.isSubmitted = true;
                $scope.form.NewPassword.$error.isSubmitted = true;
                //callSiteCatServiceForFieldErrorMessage();
            }
            else {
                $rootScope.$broadcast('busy.begin');
                LoginAssistantService.setVoiceOverFocus("loading_progress");
                var userData = LoginAssistantService.getUserInputData();
                userData.newPassword = vm.Password;
                userData.confirmPassword = vm.confirmPassword;
                LoginAssistantService.setUserInputData(userData);
                LoginAssistantService.setresetPassword(true);
                document.getElementsByClassName("button")[0].click();
                
            }
        };
        $scope.$on("ExceptionhandlePolicyRedirect", function (event, errorData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            vm.loading = false;
            if (errorData != null) {
                if (errorData.policyId == "create_user_session" && errorData.redirectType == 1 && errorData.userId == "") {
                    vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M618);
                    LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                }
            }
            
        });
        $scope.$on("Exceptionhandle", function (event, errorData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            vm.loading = false;
            //console.log(errorData);
            if (errorData) {
                var err_msg = errorData.reason._data.server_error_data.failure_data.reason.data;
                if (err_msg.action == "reject" && err_msg.code == 6 && err_msg.reason == "locked") {
                    $state.go(LoginAssistantConstants.LA_LOCKERROR);
                    LoginAssistantService.setErrorCode(err_msg.code);
                } else {
                    vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.VerifyIdentityStatics.LA_DOESNT_MATCH);
                    LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                }

            }
            
        });
        $scope.$on("ErrorMessageDisplay", function (event, responseData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            if (responseData) {
                if (responseData.data) {
                    if (responseData.data.success == false) {
                        vm.loading = false;
                        if (responseData.data.errorCode == 5005) {
                            vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M459);
                            LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                        } else {
                            vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M618);
                            LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                        }


                    } else if (responseData.data.success == true){
                        $state.go(LoginAssistantConstants.LA_RESETPASSWORD_CONFIRMATION);
                    }
                }
            } else {
                vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M618);
                LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
            }
            
        });
        $scope.$on("forgetPasswordflowdata", function (event, responseData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            vm.loading = false;
            vm.isFormSubmitted = true;
            
            if (responseData) {
                
                if (responseData._token) {
                    LoginAssistantService.setUserDataToken(responseData._token);
                    var token = responseData._token.split('.')[1];
                    var base64 = token.replace(/-/g, '+').replace(/_/g, '/');
                    var decode = JSON.parse(window.atob(base64));
                    if (decode.sub == LoginAssistantService.getUserIdentifier().toLowerCase() && decode.success == true) {
                        //if (loginAssistModel.Vcontext == LoginAssistantConstants.LAVerificationContext.LA_PASSWORD) {
                            $state.go(LoginAssistantConstants.LA_RESETPASSWORD_CONFIRMATION);
                        //} else if (loginAssistModel.Vcontext == LoginAssistantConstants.LAVerificationContext.LA_ID_SHIELD) {
                          //  console.log(responseData._token);
                        //}
                        
                    }
                    
                }
            }
           
        });

        function getMainText() {
            vm.MainText = vm.isPasswordResetSuccessfully ? $sce.trustAsHtml(vm.ResetPasswordStatics.LA_PASSWORD_RESET_MAINTEXT) :
            (vm.isAlreadyVerified ? $sce.trustAsHtml(vm.ResetPasswordStatics.LA_RESETPASSWORD_ALREADYVERIFIED_MAINTEXT_REBRAND) :
                $sce.trustAsHtml(vm.ResetPasswordStatics.LA_RESETPASSWORD_MAINTEXT));
        }
        function onForgotAnswer() {
            $state.go(LoginAssistantConstants.LA_LOCKERROR);
        }
       // vm.userid = LoginAssistantService.getUserIdentifier();
       
    };
})();;
(function () {
    'use strict';

    angular
        .module('LoginAssistantModule')
        .controller('ResetPasswordConfirmationController', resetPasswordConfirmationController);

    resetPasswordConfirmationController.$inject = ['$scope', 'CommonService', 'CommonConstants', 'LoginAssistantConstants', 'LoginAssistantService', '$sce', '$timeout', '$window'];
    
    function resetPasswordConfirmationController($scope, commonService, commonConstants, LoginAssistantConstants, LoginAssistantService, $sce, $timeout, $window) {
        var vm = this;
        vm.ResetPasswordStatics = LoginAssistantConstants.ResetPasswordStatics;
        vm.ChooseIdMethodStatics = LoginAssistantConstants.ChooseIdMethodStatics;
        var loginAssistModel = LoginAssistantService.getLoginAssistModel();
        vm.loginAssistModel = loginAssistModel;
        vm.CancelButton = LoginAssistantConstants.LA_CANCELBUTTON;
        $scope.parentobj.isBackDivDisplay = false;
        vm.userdata = LoginAssistantService.getUserInputData();
        console.log('userdata', vm.userdata);
        vm.IsFsvUser = LoginAssistantService.getFsvUser();
        vm.RedirectURL = LoginAssistantService.getFSVReturnUrl();

        document.getElementById("la_progress_bar").outerHTML = "<progress role='progressbar' aria-valuenow='100' aria-valuetext='Your progress : 100%' max='100' value='100' />";        
        
        $timeout(function () {
            window.scrollTo(0, 0);
            if (document.getElementById("headerBackLink") != null)
                document.getElementById("headerBackLink").blur();

            LoginAssistantService.setHeaderFocus("headingMainText");
        }, 500);

        $scope.setMainpageJawsInAccessible();

        vm.MainText = $sce.trustAsHtml(vm.ResetPasswordStatics.LA_PASSWORD_RESET_MAINTEXT);
        // Code for sitecat defect MOB2-44977 fix starts
        LoginAssistantService.CallSiteCatService(loginAssistModel.Vcontext, vm.ResetPasswordStatics.LA_O_RESETPASSWORDCOMPLETE);
        // Code for sitecat defect fix ends

        $scope.onContinueClick = function () {
            LoginAssistantService.setVoiceOverFocus("loading_progress");
            LoginAssistantService.removeVoiceOverFocus("loading_progress", 2000);
            vm.ErrorMessage = '';

            if (vm.IsFsvUser) {
                $scope.signOn(vm.userdata.newPassword);
                window.location.href = vm.RedirectURL;
            } else {
                try {
                    $scope.signOn(vm.userdata.newPassword);
                }
                catch (err) {
                    if (console && console.log) console.log(err);
                }
            }

           // $scope.signOn(LoginAssistantService.getPassword());
        }
       
       
    };
})();;
(function () {
    'use strict';

    angular
        .module('LoginAssistantModule')
        .controller('EnterPasswordController', enterPasswordController);

    enterPasswordController.$inject = ['$scope', '$rootScope', '$state', 'LoginAssistantConstants', 'LoginAssistantService', '$sce', '$timeout'];

    function enterPasswordController($scope, $rootScope, $state, LoginAssistantConstants, LoginAssistantService, $sce, $timeout) {
        var vm = this;
        $scope.parentobj.isBackDivDisplay = false;
        vm.EnterPasswordStatics = LoginAssistantConstants.EnterPasswordStatics;
        vm.CommonErrorMessage = LoginAssistantConstants.LA_COMMON_ERROR_TEXT_VALIDATION_M881;
        vm.NextButton = LoginAssistantConstants.LA_NEXTBUTTON;
        vm.CancelButton = LoginAssistantConstants.LA_CANCELBUTTON;
        vm.VerifyCustomerModel = LoginAssistantService.getVerifyCustomerModel();
        vm.ChooseIdMethodStatics = LoginAssistantConstants.ChooseIdMethodStatics;
        vm.loginAssistModel = LoginAssistantService.getLoginAssistModel();

        document.getElementById("la_progress_bar").outerHTML = "<progress role='progressbar' aria-valuenow='100' aria-valuetext='Your progress : 100%' max='100' value='100' />";

        $timeout(function () {
            window.scrollTo(0, 0);
            if (document.getElementById("headerBackLink") != null)
                document.getElementById("headerBackLink").blur();

            LoginAssistantService.setHeaderFocus("enterPasswordText");
        }, 500);

        $scope.setMainpageJawsInAccessible();
        document.getElementById("headerBackLink").style.display = 'none';
        document.getElementById("headerstartLink").style.display = 'block';
        vm.PasswordPattern = LoginAssistantConstants.LA_PASSWORD_PATTERN_STRING;
        vm.ErrorMessage = '';
        vm.CancelButton = LoginAssistantConstants.LA_CANCELBUTTON;
        vm.PersonalId = LoginAssistantService.getUserIdentifier();
        // Start : Omniture for reset id shield  verify identity enter password screen
        LoginAssistantService.CallSiteCatService(LoginAssistantConstants.LAVerificationContext.LA_ID_SHIELD, vm.EnterPasswordStatics.LA_O_ENTERPASSWORD);
       // End : Omniture for reset id shield  verify identity enter password screen

        $scope.$on(LoginAssistantConstants.LA_SIGNON_ERRORMESSAGE_ID, function (event, data) {
            vm.ErrorMessage = $sce.trustAsHtml(data);
            // Omniture for verify identity enter password system is currently unavailable error message page
            LoginAssistantService.CallSiteCatServiceForSystemUnavailableMessage(vm.ErrorMessage, LoginAssistantConstants.LAVerificationContext.LA_ID_SHIELD,
                vm.EnterPasswordStatics.LA_O_ENTERPASSWORDSYSTEMUNAVAILABLE, { "prop8": vm.VerifyCustomerModel.HashedLpid, "eVar8": vm.VerifyCustomerModel.HashedLpid });
        });

        $scope.onLoginClick = function () {
            
            vm.isFormSubmitted = true;
            vm.ErrorMessage = '';
            if (!$scope.form.$valid) {
                $scope.form.Password.$error.isSubmitted = true;
                callSiteCatServiceForFieldErrorMessage();
            }
            else {
                $rootScope.$broadcast('busy.begin');
                LoginAssistantService.setVoiceOverFocus("loading_progress");
                LoginAssistantService.removeVoiceOverFocus("loading_progress", 2000);
                vm.isFormSubmitted = false;
                LoginAssistantService.setContinueWithPassword(true);
                LoginAssistantService.invokeResetChallengePolicy();
               // document.getElementsByClassName("button")[0].click();
                //  $scope.signOn(vm.Password);
            }
        };

        $scope.onForgotPassword = function () {
            $rootScope.$broadcast('busy.begin');
            LoginAssistantService.setIsUserVerified(true);
            LoginAssistantService.invokeForgotPasswordPolicy();
            
        };

        $scope.$on("forgetPassworddata", function (event, ResponseData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            if (ResponseData) {
                var token = ResponseData._token.split('.')[1];
                var base64 = token.replace(/-/g, '+').replace(/_/g, '/');
                var decode = JSON.parse(window.atob(base64));
                if (LoginAssistantService.getUserIdentifier().toLowerCase() == decode.sub.toLowerCase()) {
                    $scope.signOn(vm.Password);
                }
                    
            }
        });
        $scope.$on("ExceptionhandlePolicyRedirect", function (event, errorData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            vm.loading = false;
            if (errorData != null) {
                if (errorData.policyId == "create_user_session" && errorData.redirectType == 1 && errorData.userId == "") {
                    vm.ErrorMessage = $sce.trustAsHtml(LoginAssistantConstants.LA_COMMON_ERROR_MESSAGE_M618);
                    LoginAssistantService.setVoiceOverFocus("divErrormessage", 1500);
                }
            }
            
        });
        $scope.$on("AccountRetrievalvalidation", function (event, ResponseData) {
            $rootScope.$broadcast('busy.end', { remaining: 0 });
            if (ResponseData) {

                $state.go(LoginAssistantConstants.LA_RESETPASSWORD);
            }
        });
       
        function callSiteCatServiceForFieldErrorMessage() {
            // Omniture for enter SSN page error message when SSN field not entered by the user
            if (($scope.form.Password.$error.isDirty || $scope.form.Password.$error.isSubmitted) && $scope.form.Password.$error.required) {
                LoginAssistantService.CallSiteCatService(LoginAssistantConstants.LAVerificationContext.LA_ID_SHIELD, vm.EnterPasswordStatics.LA_O_PILOTENTERPASSWORDNOTENTEREDERROR,
                { "prop8": vm.VerifyCustomerModel.HashedLpid, "eVar8": vm.VerifyCustomerModel.HashedLpid });
            } //Omniture for enter SSN page error message when user enters non-numeric character in ssn field
            else if (($scope.form.Password.$error.isInValid || $scope.form.Password.$error.isSubmitted) && $scope.form.Password.$error.pattern) {
                LoginAssistantService.CallSiteCatService(LoginAssistantConstants.LAVerificationContext.LA_ID_SHIELD, vm.EnterPasswordStatics.LA_O_PILOTENTERPASSWORDFORMATERROR,
                { "prop8": vm.VerifyCustomerModel.HashedLpid, "eVar8": vm.VerifyCustomerModel.HashedLpid });
            }
        }
        
    };
})();;
(function () {
    'use strict';

    angular
        .module('LoginAssistantModule')
        .directive('ssnValidation', ['LoginAssistantConstants', ssnValidation]);

    function ssnValidation(LoginAssistantConstants) {

        return {
            require: 'ngModel',
            link: function (scope, element, attrs, ctrl) {
               function ssnValidator(inputValue) {
                    var isFourDigitPatternValid = true;
                    var isDigitPatternValid = true;

                    if (!angular.isDefined(inputValue) || inputValue=='') {
                        ctrl.$setValidity(LoginAssistantConstants.LA_FOURDIGITPATTERNVALID, isFourDigitPatternValid);
                        ctrl.$setValidity(LoginAssistantConstants.LA_DIGITPATTERNVALID, isDigitPatternValid);
                        return inputValue;
                   }

                   var transformedInput = inputValue.replace(/[^0-9]/g, '');

                   if (transformedInput !== inputValue) {
                       ctrl.$setViewValue(transformedInput);
                       ctrl.$render();
                   }


                    var digitPattern = LoginAssistantConstants.LA_DIGIT_PATTERN;
                   if (!digitPattern.test(transformedInput))
                        isDigitPatternValid = false;

                    if (isDigitPatternValid) {
                        var fourDigitPattern = LoginAssistantConstants.LA_FOURDIGIT_PATTERN;
                        if (!fourDigitPattern.test(transformedInput))
                            isFourDigitPatternValid = false;
                   }
                   if (transformedInput == "") {
                       isFourDigitPatternValid = true;
                   }
                    ctrl.$setValidity(LoginAssistantConstants.LA_FOURDIGITPATTERNVALID, isFourDigitPatternValid);
                    ctrl.$setValidity(LoginAssistantConstants.LA_DIGITPATTERNVALID, isDigitPatternValid);
                   return transformedInput;
                }
                // parsers fire when the model changes via input 
                ctrl.$parsers.push(ssnValidator);
                // formatters fire when the model directly changes
                ctrl.$formatters.push(ssnValidator);
            }
        }
    };
})();;
(function () {
    'use strict';

    angular
        .module('LoginAssistantModule')
        .directive('fieldValidation', ['LoginAssistantConstants', fieldValidation]);

    function fieldValidation(LoginAssistantConstants) {
        return {
            require: 'ngModel',
            link: function (scope, elm, attrs, ctrl) {
                if (!ctrl) {
                    return;
                }

                elm.on('focus', function () {
                    if (scope.vm && scope.vm.isFormSubmitted)
                        ctrl.$setValidity(LoginAssistantConstants.LA_ISSUBMITTED, true);
                    ctrl.$setValidity(LoginAssistantConstants.LA_ISDIRTY, true);
                    ctrl.$setValidity(LoginAssistantConstants.LA_ISINVALID, true);
                    scope.$apply();
                });
                
                elm.on('blur', function () {
                    var isDirty = true;
                    var isInValid = true;
                    

                    //field is empty but interacted by the user
                    if (!(/\d/.test(ctrl.$viewValue))) {
                        if ((/\_/.test(ctrl.$viewValue))) {
                           ctrl.$viewValue = '';
                        }

                    }
                    
                    if (angular.isDefined(ctrl.$viewValue) && ctrl.$viewValue=='' && ctrl.$dirty)
                        isDirty = false;
                    //field is not empty but invalid
                    if (angular.isDefined(ctrl.$viewValue) && ctrl.$viewValue!='' && ctrl.$invalid) {
                        isInValid = false;
                    }
                    
                    ctrl.$setValidity(LoginAssistantConstants.LA_ISDIRTY, isDirty);
                    ctrl.$setValidity(LoginAssistantConstants.LA_ISINVALID, isInValid);
                    scope.$apply();
                });
            }
        }
    };
})();;
(function () {
    'use strict';

    angular
        .module('LoginAssistantModule')
        .directive('passwordValidation', ['LoginAssistantConstants', passwordValidation]);

    function passwordValidation(LoginAssistantConstants) {

        return {
            require: 'ngModel',
            scope: { userId: "=passwordValidation" },
            link: function (scope, element, attrs, ctrl) {
                function passwordValidator(inputValue) {
                    var isPasswordNotEqualsToPassword = true;
                    var isPasswordNotEqualsToUserId = true;
                    var isInValidPassword = true;

                    if (!angular.isDefined(inputValue))
                        return inputValue;

                    if (inputValue.toString().toLowerCase() === LoginAssistantConstants.ResetPasswordStatics.LA_WORDPASSWORD) {
                        isPasswordNotEqualsToPassword = false;
                    }
                    else if (inputValue.toString().toLowerCase() === scope.userId.toLowerCase()) {
                        isPasswordNotEqualsToUserId = false;
                    } else {
                        var passwordPattern = LoginAssistantConstants.LA_PASSWORD_PATTERN;
                        if (!passwordPattern.test(inputValue))
                            isInValidPassword = false;
                    }
                    ctrl.$setValidity(LoginAssistantConstants.ResetPasswordStatics.LA_EQUALSTOPASSWORD, isPasswordNotEqualsToPassword);
                    ctrl.$setValidity(LoginAssistantConstants.ResetPasswordStatics.LA_EQUALSTOUSERID, isPasswordNotEqualsToUserId);
                    ctrl.$setValidity(LoginAssistantConstants.ResetPasswordStatics.LA_VALIDPASSWORD, isInValidPassword);
                    return inputValue;
                }
                // parsers fire when the model changes via input 
                ctrl.$parsers.push(passwordValidator);
                // formatters fire when the model directly changes
                ctrl.$formatters.push(passwordValidator);
            }
        }
    };
})();;
(function() {

    'use strict';

    function bb_callback(bb) {
        var span;
        span = document.getElementById("bb_holder");
        span.innerHTML = bb;
    }

    window.io_global_object_name = "IGLOO";
    window.IGLOO = window.IGLOO || {
        "enable_flash": false,
        "bb_callback": bb_callback,
        "loader": {
            "subkey": "",
            "version": "general5",
            "uri_hook": "/Proxy/iojs"
        }
    };
})();



;
/*
 Copyright(c) 2017, iovation, inc. All rights reserved.
*/
(function A(){function u(a,b){var d={},c;for(c=a.length-1;-1<c;c--)0<c?d[c]=function(){var g=c;return function(){return v(a[g],d[g+1],b)}}():v(a[c],d[c+1],b)}function v(f,m,d){var c=document.createElement("script"),g=f[0].split("?")[0].split("/"),e;e=g[g.length-1].split(".")[0];g=a[d]&&a[d].staticVer&&a[d].staticVer+"/"||f[1];/([0-9]+\.){2}[0-9]+\//.test(f[1])&&g!==f[1]&&h("loader: Overriding configured version with staticVer.");f[0]=f[0].replace("##version##",g);c.setAttribute("src",f[0]);c&&c.addEventListener?
c.addEventListener("error",function(){b[d+"_"+e+"_load_failure"]="true"}):c.attachEvent&&c.attachEvent("onerror",function(){b[d+"_"+e+"_load_failure"]="true"});m&&(c.onload=m);document.getElementsByTagName("head")[0].appendChild(c)}function h(b){if("function"===typeof a.trace_handler)try{a.trace_handler(b)}catch(e){}}function e(a,b){var d=null!==a&&void 0!==a;return!d||"1"!==a.toString()&&"true"!==a.toString().toLowerCase()?!d||"0"!==a.toString()&&"false"!==a.toString().toLowerCase()?"boolean"===
typeof b?b:!1:!1:!0}var t=window,w=t.io_global_object_name||"IGLOO",a=t[w]=t[w]||{},b=a.loader=a.loader||{},x=[],y=[];if(b.loaderMain)return h("loader: Loader script has already run, try reducing the number of places it's being included."),!1;b.loaderMain=A;b.loaderVer="5.1.0";(function(){var f=e(b.tp,!0),m=e(b.fp_static,!0),d=e(b.fp_dyn,!0),c=e(b.enable_legacy_compatibility),g=e(b.tp_split),u=b.tp_host&&b.tp_host.replace(/\/+$/,"")||"https://mpsnare.iesnare.com",z=b.fp_static_override_uri,l=void 0!==
b.uri_hook?b.uri_hook+"/":"/iojs/",n=(b.version||"versionOrAliasIsRequired")+"/",v=b.subkey?t.encodeURIComponent(b.subkey)+"/":"",w=b.tp_resource||"wdp.js",p=b.tp_host?"&tp_host="+t.encodeURIComponent(b.tp_host):"",B=z?"&fp_static_uri="+t.encodeURIComponent(z):"",q,r,k;b.tp_host=u;q=e(a.enable_flash,!0);r=a.io&&a.io.enable_flash;k=a.fp&&a.fp.enable_flash;r=void 0!==r&&null!==r?e(r,!0):q;void 0!==k&&null!==k?k=e(k,!0):r=q;q=r?"&flash=true":"&flash=false";k=k?"&flash=true":"&flash=false";p="?loaderVer="+
b.loaderVer+"&compat="+c+"&tp="+f+"&tp_split="+g+p+"&fp_static="+m+"&fp_dyn="+d+B;f||m||h("loader: Not currently configured to load fp_static or tp script(s).");a.fp&&a.fp.staticVer&&a.fp.staticVer+"/"!==n&&(n=a.fp.staticVer+"/",h("loader: Configured version replaced with that from pre-loaded static script."));m||a.fp&&a.fp.staticMain?(l=(l+"##version##"+v).replace(/\/\//g,"/"),m&&(a.fp&&a.fp.staticMain?c&&!a.fp.preCompatMain&&h("loader: enable_legacy_compatibility on, but included static does not have the compat wrapper."):
z?x.push([z,""]):x.push([l+"static_wdp.js"+p+k,n])),!d||a.fp&&a.fp.dynMain?a.fp&&a.fp.dynMain&&h("loader: First party dynamic script has already been loaded, disable fp_dyn or make sure you're not manually including the dynamic file separately."):x.push([l+"dyn_wdp.js"+p+k,n])):e(b.fp_dyn)&&h("loader: Invalid Config, first party dynamic script set to load without static.");f&&(a.io&&a.io.staticMain?h("loader: Third party script has already been loaded."):(l=u+"/##version##"+v,g?(y.push([l+"static_wdp.js"+
p+q,n]),y.push([l+"dyn_wdp.js"+p+q,n]),b.tp_resource&&h("loader: Invalid Config: both tp_resource and tp_split set. Ignoring tp_resource.")):y.push([l+w+p+q,n])))})();u(x,"fp");u(y,"io")})();;
/**
 * @license AngularJS v1.4.0
 * (c) 2010-2015 Google, Inc. http://angularjs.org
 * License: MIT
 */
(function (window, angular, undefined) {
    'use strict';

    /* jshint ignore:start */
    var noop = angular.noop;
    var extend = angular.extend;
    var jqLite = angular.element;
    var forEach = angular.forEach;
    var isArray = angular.isArray;
    var isString = angular.isString;
    var isObject = angular.isObject;
    var isUndefined = angular.isUndefined;
    var isDefined = angular.isDefined;
    var isFunction = angular.isFunction;
    var isElement = angular.isElement;

    var ELEMENT_NODE = 1;
    var COMMENT_NODE = 8;

    var NG_ANIMATE_CLASSNAME = 'ng-animate';
    var NG_ANIMATE_CHILDREN_DATA = '$$ngAnimateChildren';

    var isPromiseLike = function (p) {
        return p && p.then ? true : false;
    }

    function assertArg(arg, name, reason) {
        if (!arg) {
            throw ngMinErr('areq', "Argument '{0}' is {1}", (name || '?'), (reason || "required"));
        }
        return arg;
    }

    function mergeClasses(a, b) {
        if (!a && !b) return '';
        if (!a) return b;
        if (!b) return a;
        if (isArray(a)) a = a.join(' ');
        if (isArray(b)) b = b.join(' ');
        return a + ' ' + b;
    }

    function packageStyles(options) {
        var styles = {};
        if (options && (options.to || options.from)) {
            styles.to = options.to;
            styles.from = options.from;
        }
        return styles;
    }

    function pendClasses(classes, fix, isPrefix) {
        var className = '';
        classes = isArray(classes)
            ? classes
            : classes && isString(classes) && classes.length
                ? classes.split(/\s+/)
                : [];
        forEach(classes, function (klass, i) {
            if (klass && klass.length > 0) {
                className += (i > 0) ? ' ' : '';
                className += isPrefix ? fix + klass
                                      : klass + fix;
            }
        });
        return className;
    }

    function removeFromArray(arr, val) {
        var index = arr.indexOf(val);
        if (val >= 0) {
            arr.splice(index, 1);
        }
    }

    function stripCommentsFromElement(element) {
        if (element instanceof jqLite) {
            switch (element.length) {
                case 0:
                    return [];
                    break;

                case 1:
                    // there is no point of stripping anything if the element
                    // is the only element within the jqLite wrapper.
                    // (it's important that we retain the element instance.)
                    if (element[0].nodeType === ELEMENT_NODE) {
                        return element;
                    }
                    break;

                default:
                    return jqLite(extractElementNode(element));
                    break;
            }
        }

        if (element.nodeType === ELEMENT_NODE) {
            return jqLite(element);
        }
    }

    function extractElementNode(element) {
        if (!element[0]) return element;
        for (var i = 0; i < element.length; i++) {
            var elm = element[i];
            if (elm.nodeType == ELEMENT_NODE) {
                return elm;
            }
        }
    }

    function $$addClass($$jqLite, element, className) {
        forEach(element, function (elm) {
            $$jqLite.addClass(elm, className);
        });
    }

    function $$removeClass($$jqLite, element, className) {
        forEach(element, function (elm) {
            $$jqLite.removeClass(elm, className);
        });
    }

    function applyAnimationClassesFactory($$jqLite) {
        return function (element, options) {
            if (options.addClass) {
                $$addClass($$jqLite, element, options.addClass);
                options.addClass = null;
            }
            if (options.removeClass) {
                $$removeClass($$jqLite, element, options.removeClass);
                options.removeClass = null;
            }
        }
    }

    function prepareAnimationOptions(options) {
        options = options || {};
        if (!options.$$prepared) {
            var domOperation = options.domOperation || noop;
            options.domOperation = function () {
                options.$$domOperationFired = true;
                domOperation();
                domOperation = noop;
            };
            options.$$prepared = true;
        }
        return options;
    }

    function applyAnimationStyles(element, options) {
        applyAnimationFromStyles(element, options);
        applyAnimationToStyles(element, options);
    }

    function applyAnimationFromStyles(element, options) {
        if (options.from) {
            element.css(options.from);
            options.from = null;
        }
    }

    function applyAnimationToStyles(element, options) {
        if (options.to) {
            element.css(options.to);
            options.to = null;
        }
    }

    function mergeAnimationOptions(element, target, newOptions) {
        var toAdd = (target.addClass || '') + ' ' + (newOptions.addClass || '');
        var toRemove = (target.removeClass || '') + ' ' + (newOptions.removeClass || '');
        var classes = resolveElementClasses(element.attr('class'), toAdd, toRemove);

        extend(target, newOptions);

        if (classes.addClass) {
            target.addClass = classes.addClass;
        } else {
            target.addClass = null;
        }

        if (classes.removeClass) {
            target.removeClass = classes.removeClass;
        } else {
            target.removeClass = null;
        }

        return target;
    }

    function resolveElementClasses(existing, toAdd, toRemove) {
        var ADD_CLASS = 1;
        var REMOVE_CLASS = -1;

        var flags = {};
        existing = splitClassesToLookup(existing);

        toAdd = splitClassesToLookup(toAdd);
        forEach(toAdd, function (value, key) {
            flags[key] = ADD_CLASS;
        });

        toRemove = splitClassesToLookup(toRemove);
        forEach(toRemove, function (value, key) {
            flags[key] = flags[key] === ADD_CLASS ? null : REMOVE_CLASS;
        });

        var classes = {
            addClass: '',
            removeClass: ''
        };

        forEach(flags, function (val, klass) {
            var prop, allow;
            if (val === ADD_CLASS) {
                prop = 'addClass';
                allow = !existing[klass];
            } else if (val === REMOVE_CLASS) {
                prop = 'removeClass';
                allow = existing[klass];
            }
            if (allow) {
                if (classes[prop].length) {
                    classes[prop] += ' ';
                }
                classes[prop] += klass;
            }
        });

        function splitClassesToLookup(classes) {
            if (isString(classes)) {
                classes = classes.split(' ');
            }

            var obj = {};
            forEach(classes, function (klass) {
                // sometimes the split leaves empty string values
                // incase extra spaces were applied to the options
                if (klass.length) {
                    obj[klass] = true;
                }
            });
            return obj;
        }

        return classes;
    }

    function getDomNode(element) {
        return (element instanceof angular.element) ? element[0] : element;
    }

    var $$rAFSchedulerFactory = ['$$rAF', function ($$rAF) {
        var tickQueue = [];
        var cancelFn;

        function scheduler(tasks) {
            // we make a copy since RAFScheduler mutates the state
            // of the passed in array variable and this would be difficult
            // to track down on the outside code
            tickQueue.push([].concat(tasks));
            nextTick();
        }

        /* waitUntilQuiet does two things:
         * 1. It will run the FINAL `fn` value only when an uncancelled RAF has passed through
         * 2. It will delay the next wave of tasks from running until the quiet `fn` has run.
         *
         * The motivation here is that animation code can request more time from the scheduler
         * before the next wave runs. This allows for certain DOM properties such as classes to
         * be resolved in time for the next animation to run.
         */
        scheduler.waitUntilQuiet = function (fn) {
            if (cancelFn) cancelFn();

            cancelFn = $$rAF(function () {
                cancelFn = null;
                fn();
                nextTick();
            });
        };

        return scheduler;

        function nextTick() {
            if (!tickQueue.length) return;

            var updatedQueue = [];
            for (var i = 0; i < tickQueue.length; i++) {
                var innerQueue = tickQueue[i];
                runNextTask(innerQueue);
                if (innerQueue.length) {
                    updatedQueue.push(innerQueue);
                }
            }
            tickQueue = updatedQueue;

            if (!cancelFn) {
                $$rAF(function () {
                    if (!cancelFn) nextTick();
                });
            }
        }

        function runNextTask(tasks) {
            var nextTask = tasks.shift();
            nextTask();
        }
    }];

    var $$AnimateChildrenDirective = [function () {
        return function (scope, element, attrs) {
            var val = attrs.ngAnimateChildren;
            if (angular.isString(val) && val.length === 0) { //empty attribute
                element.data(NG_ANIMATE_CHILDREN_DATA, true);
            } else {
                attrs.$observe('ngAnimateChildren', function (value) {
                    value = value === 'on' || value === 'true';
                    element.data(NG_ANIMATE_CHILDREN_DATA, value);
                });
            }
        };
    }];

    /**
     * @ngdoc service
     * @name $animateCss
     * @kind object
     *
     * @description
     * The `$animateCss` service is a useful utility to trigger customized CSS-based transitions/keyframes
     * from a JavaScript-based animation or directly from a directive. The purpose of `$animateCss` is NOT
     * to side-step how `$animate` and ngAnimate work, but the goal is to allow pre-existing animations or
     * directives to create more complex animations that can be purely driven using CSS code.
     *
     * Note that only browsers that support CSS transitions and/or keyframe animations are capable of
     * rendering animations triggered via `$animateCss` (bad news for IE9 and lower).
     *
     * ## Usage
     * Once again, `$animateCss` is designed to be used inside of a registered JavaScript animation that
     * is powered by ngAnimate. It is possible to use `$animateCss` directly inside of a directive, however,
     * any automatic control over cancelling animations and/or preventing animations from being run on
     * child elements will not be handled by Angular. For this to work as expected, please use `$animate` to
     * trigger the animation and then setup a JavaScript animation that injects `$animateCss` to trigger
     * the CSS animation.
     *
     * The example below shows how we can create a folding animation on an element using `ng-if`:
     *
     * ```html
     * <!-- notice the `fold-animation` CSS class -->
     * <div ng-if="onOff" class="fold-animation">
     *   This element will go BOOM
     * </div>
     * <button ng-click="onOff=true">Fold In</button>
     * ```
     *
     * Now we create the **JavaScript animation** that will trigger the CSS transition:
     *
     * ```js
     * ngModule.animation('.fold-animation', ['$animateCss', function($animateCss) {
     *   return {
     *     enter: function(element, doneFn) {
     *       var height = element[0].offsetHeight;
     *       return $animateCss(element, {
     *         from: { height:'0px' },
     *         to: { height:height + 'px' },
     *         duration: 1 // one second
     *       });
     *     }
     *   }
     * }]);
     * ```
     *
     * ## More Advanced Uses
     *
     * `$animateCss` is the underlying code that ngAnimate uses to power **CSS-based animations** behind the scenes. Therefore CSS hooks
     * like `.ng-EVENT`, `.ng-EVENT-active`, `.ng-EVENT-stagger` are all features that can be triggered using `$animateCss` via JavaScript code.
     *
     * This also means that just about any combination of adding classes, removing classes, setting styles, dynamically setting a keyframe animation,
     * applying a hardcoded duration or delay value, changing the animation easing or applying a stagger animation are all options that work with
     * `$animateCss`. The service itself is smart enough to figure out the combination of options and examine the element styling properties in order
     * to provide a working animation that will run in CSS.
     *
     * The example below showcases a more advanced version of the `.fold-animation` from the example above:
     *
     * ```js
     * ngModule.animation('.fold-animation', ['$animateCss', function($animateCss) {
     *   return {
     *     enter: function(element, doneFn) {
     *       var height = element[0].offsetHeight;
     *       return $animateCss(element, {
     *         addClass: 'red large-text pulse-twice',
     *         easing: 'ease-out',
     *         from: { height:'0px' },
     *         to: { height:height + 'px' },
     *         duration: 1 // one second
     *       });
     *     }
     *   }
     * }]);
     * ```
     *
     * Since we're adding/removing CSS classes then the CSS transition will also pick those up:
     *
     * ```css
     * /&#42; since a hardcoded duration value of 1 was provided in the JavaScript animation code,
     * the CSS classes below will be transitioned despite them being defined as regular CSS classes &#42;/
     * .red { background:red; }
     * .large-text { font-size:20px; }
     *
     * /&#42; we can also use a keyframe animation and $animateCss will make it work alongside the transition &#42;/
     * .pulse-twice {
     *   animation: 0.5s pulse linear 2;
     *   -webkit-animation: 0.5s pulse linear 2;
     * }
     *
     * @keyframes pulse {
     *   from { transform: scale(0.5); }
     *   to { transform: scale(1.5); }
     * }
     *
     * @-webkit-keyframes pulse {
     *   from { -webkit-transform: scale(0.5); }
     *   to { -webkit-transform: scale(1.5); }
     * }
     * ```
     *
     * Given this complex combination of CSS classes, styles and options, `$animateCss` will figure everything out and make the animation happen.
     *
     * ## How the Options are handled
     *
     * `$animateCss` is very versatile and intelligent when it comes to figuring out what configurations to apply to the element to ensure the animation
     * works with the options provided. Say for example we were adding a class that contained a keyframe value and we wanted to also animate some inline
     * styles using the `from` and `to` properties.
     *
     * ```js
     * var animator = $animateCss(element, {
     *   from: { background:'red' },
     *   to: { background:'blue' }
     * });
     * animator.start();
     * ```
     *
     * ```css
     * .rotating-animation {
     *   animation:0.5s rotate linear;
     *   -webkit-animation:0.5s rotate linear;
     * }
     *
     * @keyframes rotate {
     *   from { transform: rotate(0deg); }
     *   to { transform: rotate(360deg); }
     * }
     *
     * @-webkit-keyframes rotate {
     *   from { -webkit-transform: rotate(0deg); }
     *   to { -webkit-transform: rotate(360deg); }
     * }
     * ```
     *
     * The missing pieces here are that we do not have a transition set (within the CSS code nor within the `$animateCss` options) and the duration of the animation is
     * going to be detected from what the keyframe styles on the CSS class are. In this event, `$animateCss` will automatically create an inline transition
     * style matching the duration detected from the keyframe style (which is present in the CSS class that is being added) and then prepare both the transition
     * and keyframe animations to run in parallel on the element. Then when the animation is underway the provided `from` and `to` CSS styles will be applied
     * and spread across the transition and keyframe animation.
     *
     * ## What is returned
     *
     * `$animateCss` works in two stages: a preparation phase and an animation phase. Therefore when `$animateCss` is first called it will NOT actually
     * start the animation. All that is going on here is that the element is being prepared for the animation (which means that the generated CSS classes are
     * added and removed on the element). Once `$animateCss` is called it will return an object with the following properties:
     *
     * ```js
     * var animator = $animateCss(element, { ... });
     * ```
     *
     * Now what do the contents of our `animator` variable look like:
     *
     * ```js
     * {
     *   // starts the animation
     *   start: Function,
     *
     *   // ends (aborts) the animation
     *   end: Function
     * }
     * ```
     *
     * To actually start the animation we need to run `animation.start()` which will then return a promise that we can hook into to detect when the animation ends.
     * If we choose not to run the animation then we MUST run `animation.end()` to perform a cleanup on the element (since some CSS classes and stlyes may have been
     * applied to the element during the preparation phase). Note that all other properties such as duration, delay, transitions and keyframes are just properties
     * and that changing them will not reconfigure the parameters of the animation.
     *
     * ### runner.done() vs runner.then()
     * It is documented that `animation.start()` will return a promise object and this is true, however, there is also an additional method available on the
     * runner called `.done(callbackFn)`. The done method works the same as `.finally(callbackFn)`, however, it does **not trigger a digest to occur**.
     * Therefore, for performance reasons, it's always best to use `runner.done(callback)` instead of `runner.then()`, `runner.catch()` or `runner.finally()`
     * unless you really need a digest to kick off afterwards.
     *
     * Keep in mind that, to make this easier, ngAnimate has tweaked the JS animations API to recognize when a runner instance is returned from $animateCss
     * (so there is no need to call `runner.done(doneFn)` inside of your JavaScript animation code). Check the [animation code above](#usage) to see how this works.
     *
     * @param {DOMElement} element the element that will be animated
     * @param {object} options the animation-related options that will be applied during the animation
     *
     * * `event` - The DOM event (e.g. enter, leave, move). When used, a generated CSS class of `ng-EVENT` and `ng-EVENT-active` will be applied
     * to the element during the animation. Multiple events can be provided when spaces are used as a separator. (Note that this will not perform any DOM operation.)
     * * `easing` - The CSS easing value that will be applied to the transition or keyframe animation (or both).
     * * `transition` - The raw CSS transition style that will be used (e.g. `1s linear all`).
     * * `keyframe` - The raw CSS keyframe animation style that will be used (e.g. `1s my_animation linear`).
     * * `from` - The starting CSS styles (a key/value object) that will be applied at the start of the animation.
     * * `to` - The ending CSS styles (a key/value object) that will be applied across the animation via a CSS transition.
     * * `addClass` - A space separated list of CSS classes that will be added to the element and spread across the animation.
     * * `removeClass` - A space separated list of CSS classes that will be removed from the element and spread across the animation.
     * * `duration` - A number value representing the total duration of the transition and/or keyframe (note that a value of 1 is 1000ms). If a value of `0`
     * is provided then the animation will be skipped entirely.
     * * `delay` - A number value representing the total delay of the transition and/or keyframe (note that a value of 1 is 1000ms). If a value of `true` is
     * used then whatever delay value is detected from the CSS classes will be mirrored on the elements styles (e.g. by setting delay true then the style value
     * of the element will be `transition-delay: DETECTED_VALUE`). Using `true` is useful when you want the CSS classes and inline styles to all share the same
     * CSS delay value.
     * * `stagger` - A numeric time value representing the delay between successively animated elements
     * ({@link ngAnimate#css-staggering-animations Click here to learn how CSS-based staggering works in ngAnimate.})
     * * `staggerIndex` - The numeric index representing the stagger item (e.g. a value of 5 is equal to the sixth item in the stagger; therefore when a
     * `stagger` option value of `0.1` is used then there will be a stagger delay of `600ms`)
     * `applyClassesEarly` - Whether or not the classes being added or removed will be used when detecting the animation. This is set by `$animate` when enter/leave/move animations are fired to ensure that the CSS classes are resolved in time. (Note that this will prevent any transitions from occuring on the classes being added and removed.)
     *
     * @return {object} an object with start and end methods and details about the animation.
     *
     * * `start` - The method to start the animation. This will return a `Promise` when called.
     * * `end` - This method will cancel the animation and remove all applied CSS classes and styles.
     */

    // Detect proper transitionend/animationend event names.
    var CSS_PREFIX = '', TRANSITION_PROP, TRANSITIONEND_EVENT, ANIMATION_PROP, ANIMATIONEND_EVENT;

    // If unprefixed events are not supported but webkit-prefixed are, use the latter.
    // Otherwise, just use W3C names, browsers not supporting them at all will just ignore them.
    // Note: Chrome implements `window.onwebkitanimationend` and doesn't implement `window.onanimationend`
    // but at the same time dispatches the `animationend` event and not `webkitAnimationEnd`.
    // Register both events in case `window.onanimationend` is not supported because of that,
    // do the same for `transitionend` as Safari is likely to exhibit similar behavior.
    // Also, the only modern browser that uses vendor prefixes for transitions/keyframes is webkit
    // therefore there is no reason to test anymore for other vendor prefixes:
    // http://caniuse.com/#search=transition
    if (window.ontransitionend === undefined && window.onwebkittransitionend !== undefined) {
        CSS_PREFIX = '-webkit-';
        TRANSITION_PROP = 'WebkitTransition';
        TRANSITIONEND_EVENT = 'webkitTransitionEnd transitionend';
    } else {
        TRANSITION_PROP = 'transition';
        TRANSITIONEND_EVENT = 'transitionend';
    }

    if (window.onanimationend === undefined && window.onwebkitanimationend !== undefined) {
        CSS_PREFIX = '-webkit-';
        ANIMATION_PROP = 'WebkitAnimation';
        ANIMATIONEND_EVENT = 'webkitAnimationEnd animationend';
    } else {
        ANIMATION_PROP = 'animation';
        ANIMATIONEND_EVENT = 'animationend';
    }

    var DURATION_KEY = 'Duration';
    var PROPERTY_KEY = 'Property';
    var DELAY_KEY = 'Delay';
    var TIMING_KEY = 'TimingFunction';
    var ANIMATION_ITERATION_COUNT_KEY = 'IterationCount';
    var ANIMATION_PLAYSTATE_KEY = 'PlayState';
    var ELAPSED_TIME_MAX_DECIMAL_PLACES = 3;
    var CLOSING_TIME_BUFFER = 1.5;
    var ONE_SECOND = 1000;
    var BASE_TEN = 10;

    var SAFE_FAST_FORWARD_DURATION_VALUE = 9999;

    var ANIMATION_DELAY_PROP = ANIMATION_PROP + DELAY_KEY;
    var ANIMATION_DURATION_PROP = ANIMATION_PROP + DURATION_KEY;

    var TRANSITION_DELAY_PROP = TRANSITION_PROP + DELAY_KEY;
    var TRANSITION_DURATION_PROP = TRANSITION_PROP + DURATION_KEY;

    var DETECT_CSS_PROPERTIES = {
        transitionDuration: TRANSITION_DURATION_PROP,
        transitionDelay: TRANSITION_DELAY_PROP,
        transitionProperty: TRANSITION_PROP + PROPERTY_KEY,
        animationDuration: ANIMATION_DURATION_PROP,
        animationDelay: ANIMATION_DELAY_PROP,
        animationIterationCount: ANIMATION_PROP + ANIMATION_ITERATION_COUNT_KEY
    };

    var DETECT_STAGGER_CSS_PROPERTIES = {
        transitionDuration: TRANSITION_DURATION_PROP,
        transitionDelay: TRANSITION_DELAY_PROP,
        animationDuration: ANIMATION_DURATION_PROP,
        animationDelay: ANIMATION_DELAY_PROP
    };

    function computeCssStyles($window, element, properties) {
        var styles = Object.create(null);
        var detectedStyles = $window.getComputedStyle(element) || {};
        forEach(properties, function (formalStyleName, actualStyleName) {
            var val = detectedStyles[formalStyleName];
            if (val) {
                var c = val.charAt(0);

                // only numerical-based values have a negative sign or digit as the first value
                if (c === '-' || c === '+' || c >= 0) {
                    val = parseMaxTime(val);
                }

                // by setting this to null in the event that the delay is not set or is set directly as 0
                // then we can still allow for zegative values to be used later on and not mistake this
                // value for being greater than any other negative value.
                if (val === 0) {
                    val = null;
                }
                styles[actualStyleName] = val;
            }
        });

        return styles;
    }

    function parseMaxTime(str) {
        var maxValue = 0;
        var values = str.split(/\s*,\s*/);
        forEach(values, function (value) {
            // it's always safe to consider only second values and omit `ms` values since
            // getComputedStyle will always handle the conversion for us
            if (value.charAt(value.length - 1) == 's') {
                value = value.substring(0, value.length - 1);
            }
            value = parseFloat(value) || 0;
            maxValue = maxValue ? Math.max(value, maxValue) : value;
        });
        return maxValue;
    }

    function truthyTimingValue(val) {
        return val === 0 || val != null;
    }

    function getCssTransitionDurationStyle(duration, applyOnlyDuration) {
        var style = TRANSITION_PROP;
        var value = duration + 's';
        if (applyOnlyDuration) {
            style += DURATION_KEY;
        } else {
            value += ' linear all';
        }
        return [style, value];
    }

    function getCssKeyframeDurationStyle(duration) {
        return [ANIMATION_DURATION_PROP, duration + 's'];
    }

    function getCssDelayStyle(delay, isKeyframeAnimation) {
        var prop = isKeyframeAnimation ? ANIMATION_DELAY_PROP : TRANSITION_DELAY_PROP;
        return [prop, delay + 's'];
    }

    function blockTransitions(node, duration) {
        // we use a negative delay value since it performs blocking
        // yet it doesn't kill any existing transitions running on the
        // same element which makes this safe for class-based animations
        var value = duration ? '-' + duration + 's' : '';
        applyInlineStyle(node, [TRANSITION_DELAY_PROP, value]);
        return [TRANSITION_DELAY_PROP, value];
    }

    function blockKeyframeAnimations(node, applyBlock) {
        var value = applyBlock ? 'paused' : '';
        var key = ANIMATION_PROP + ANIMATION_PLAYSTATE_KEY;
        applyInlineStyle(node, [key, value]);
        return [key, value];
    }

    function applyInlineStyle(node, styleTuple) {
        var prop = styleTuple[0];
        var value = styleTuple[1];
        node.style[prop] = value;
    }

    function createLocalCacheLookup() {
        var cache = Object.create(null);
        return {
            flush: function () {
                cache = Object.create(null);
            },

            count: function (key) {
                var entry = cache[key];
                return entry ? entry.total : 0;
            },

            get: function (key) {
                var entry = cache[key];
                return entry && entry.value;
            },

            put: function (key, value) {
                if (!cache[key]) {
                    cache[key] = { total: 1, value: value };
                } else {
                    cache[key].total++;
                }
            }
        };
    }

    var $AnimateCssProvider = ['$animateProvider', function ($animateProvider) {
        var gcsLookup = createLocalCacheLookup();
        var gcsStaggerLookup = createLocalCacheLookup();

        this.$get = ['$window', '$$jqLite', '$$AnimateRunner', '$timeout',
                     '$document', '$sniffer', '$$rAFScheduler',
             function ($window, $$jqLite, $$AnimateRunner, $timeout,
                      $document, $sniffer, $$rAFScheduler) {

                 var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);

                 var parentCounter = 0;
                 function gcsHashFn(node, extraClasses) {
                     var KEY = "$$ngAnimateParentKey";
                     var parentNode = node.parentNode;
                     var parentID = parentNode[KEY] || (parentNode[KEY] = ++parentCounter);
                     return parentID + '-' + node.getAttribute('class') + '-' + extraClasses;
                 }

                 function computeCachedCssStyles(node, className, cacheKey, properties) {
                     var timings = gcsLookup.get(cacheKey);

                     if (!timings) {
                         timings = computeCssStyles($window, node, properties);
                         if (timings.animationIterationCount === 'infinite') {
                             timings.animationIterationCount = 1;
                         }
                     }

                     // we keep putting this in multiple times even though the value and the cacheKey are the same
                     // because we're keeping an interal tally of how many duplicate animations are detected.
                     gcsLookup.put(cacheKey, timings);
                     return timings;
                 }

                 function computeCachedCssStaggerStyles(node, className, cacheKey, properties) {
                     var stagger;

                     // if we have one or more existing matches of matching elements
                     // containing the same parent + CSS styles (which is how cacheKey works)
                     // then staggering is possible
                     if (gcsLookup.count(cacheKey) > 0) {
                         stagger = gcsStaggerLookup.get(cacheKey);

                         if (!stagger) {
                             var staggerClassName = pendClasses(className, '-stagger');

                             $$jqLite.addClass(node, staggerClassName);

                             stagger = computeCssStyles($window, node, properties);

                             // force the conversion of a null value to zero incase not set
                             stagger.animationDuration = Math.max(stagger.animationDuration, 0);
                             stagger.transitionDuration = Math.max(stagger.transitionDuration, 0);

                             $$jqLite.removeClass(node, staggerClassName);

                             gcsStaggerLookup.put(cacheKey, stagger);
                         }
                     }

                     return stagger || {};
                 }

                 var bod = getDomNode($document).body;
                 var rafWaitQueue = [];
                 function waitUntilQuiet(callback) {
                     rafWaitQueue.push(callback);
                     $$rAFScheduler.waitUntilQuiet(function () {
                         gcsLookup.flush();
                         gcsStaggerLookup.flush();

                         //the line below will force the browser to perform a repaint so
                         //that all the animated elements within the animation frame will
                         //be properly updated and drawn on screen. This is required to
                         //ensure that the preparation animation is properly flushed so that
                         //the active state picks up from there. DO NOT REMOVE THIS LINE.
                         //DO NOT OPTIMIZE THIS LINE. THE MINIFIER WILL REMOVE IT OTHERWISE WHICH
                         //WILL RESULT IN AN UNPREDICTABLE BUG THAT IS VERY HARD TO TRACK DOWN AND
                         //WILL TAKE YEARS AWAY FROM YOUR LIFE.
                         var width = bod.offsetWidth + 1;

                         // we use a for loop to ensure that if the queue is changed
                         // during this looping then it will consider new requests
                         for (var i = 0; i < rafWaitQueue.length; i++) {
                             rafWaitQueue[i](width);
                         }
                         rafWaitQueue.length = 0;
                     });
                 }

                 return init;

                 function computeTimings(node, className, cacheKey) {
                     var timings = computeCachedCssStyles(node, className, cacheKey, DETECT_CSS_PROPERTIES);
                     var aD = timings.animationDelay;
                     var tD = timings.transitionDelay;
                     timings.maxDelay = aD && tD
                         ? Math.max(aD, tD)
                         : (aD || tD);
                     timings.maxDuration = Math.max(
                         timings.animationDuration * timings.animationIterationCount,
                         timings.transitionDuration);

                     return timings;
                 }

                 function init(element, options) {
                     var node = getDomNode(element);
                     options = prepareAnimationOptions(options);

                     var temporaryStyles = [];
                     var classes = element.attr('class');
                     var styles = packageStyles(options);
                     var animationClosed;
                     var animationPaused;
                     var animationCompleted;
                     var runner;
                     var runnerHost;
                     var maxDelay;
                     var maxDelayTime;
                     var maxDuration;
                     var maxDurationTime;

                     if (options.duration === 0 || (!$sniffer.animations && !$sniffer.transitions)) {
                         return closeAndReturnNoopAnimator();
                     }

                     var method = options.event && isArray(options.event)
                           ? options.event.join(' ')
                           : options.event;

                     var isStructural = method && options.structural;
                     var structuralClassName = '';
                     var addRemoveClassName = '';

                     if (isStructural) {
                         structuralClassName = pendClasses(method, 'ng-', true);
                     } else if (method) {
                         structuralClassName = method;
                     }

                     if (options.addClass) {
                         addRemoveClassName += pendClasses(options.addClass, '-add');
                     }

                     if (options.removeClass) {
                         if (addRemoveClassName.length) {
                             addRemoveClassName += ' ';
                         }
                         addRemoveClassName += pendClasses(options.removeClass, '-remove');
                     }

                     // there may be a situation where a structural animation is combined together
                     // with CSS classes that need to resolve before the animation is computed.
                     // However this means that there is no explicit CSS code to block the animation
                     // from happening (by setting 0s none in the class name). If this is the case
                     // we need to apply the classes before the first rAF so we know to continue if
                     // there actually is a detected transition or keyframe animation
                     if (options.applyClassesEarly && addRemoveClassName.length) {
                         applyAnimationClasses(element, options);
                         addRemoveClassName = '';
                     }

                     var setupClasses = [structuralClassName, addRemoveClassName].join(' ').trim();
                     var fullClassName = classes + ' ' + setupClasses;
                     var activeClasses = pendClasses(setupClasses, '-active');
                     var hasToStyles = styles.to && Object.keys(styles.to).length > 0;

                     // there is no way we can trigger an animation since no styles and
                     // no classes are being applied which would then trigger a transition
                     if (!hasToStyles && !setupClasses) {
                         return closeAndReturnNoopAnimator();
                     }

                     var cacheKey, stagger;
                     if (options.stagger > 0) {
                         var staggerVal = parseFloat(options.stagger);
                         stagger = {
                             transitionDelay: staggerVal,
                             animationDelay: staggerVal,
                             transitionDuration: 0,
                             animationDuration: 0
                         };
                     } else {
                         cacheKey = gcsHashFn(node, fullClassName);
                         stagger = computeCachedCssStaggerStyles(node, setupClasses, cacheKey, DETECT_STAGGER_CSS_PROPERTIES);
                     }

                     $$jqLite.addClass(element, setupClasses);

                     var applyOnlyDuration;

                     if (options.transitionStyle) {
                         var transitionStyle = [TRANSITION_PROP, options.transitionStyle];
                         applyInlineStyle(node, transitionStyle);
                         temporaryStyles.push(transitionStyle);
                     }

                     if (options.duration >= 0) {
                         applyOnlyDuration = node.style[TRANSITION_PROP].length > 0;
                         var durationStyle = getCssTransitionDurationStyle(options.duration, applyOnlyDuration);

                         // we set the duration so that it will be picked up by getComputedStyle later
                         applyInlineStyle(node, durationStyle);
                         temporaryStyles.push(durationStyle);
                     }

                     if (options.keyframeStyle) {
                         var keyframeStyle = [ANIMATION_PROP, options.keyframeStyle];
                         applyInlineStyle(node, keyframeStyle);
                         temporaryStyles.push(keyframeStyle);
                     }

                     var itemIndex = stagger
                         ? options.staggerIndex >= 0
                             ? options.staggerIndex
                             : gcsLookup.count(cacheKey)
                         : 0;

                     var isFirst = itemIndex === 0;

                     // this is a pre-emptive way of forcing the setup classes to be added and applied INSTANTLY
                     // without causing any combination of transitions to kick in. By adding a negative delay value
                     // it forces the setup class' transition to end immediately. We later then remove the negative
                     // transition delay to allow for the transition to naturally do it's thing. The beauty here is
                     // that if there is no transition defined then nothing will happen and this will also allow
                     // other transitions to be stacked on top of each other without any chopping them out.
                     if (isFirst) {
                         blockTransitions(node, SAFE_FAST_FORWARD_DURATION_VALUE);
                     }

                     var timings = computeTimings(node, fullClassName, cacheKey);
                     var relativeDelay = timings.maxDelay;
                     maxDelay = Math.max(relativeDelay, 0);
                     maxDuration = timings.maxDuration;

                     var flags = {};
                     flags.hasTransitions = timings.transitionDuration > 0;
                     flags.hasAnimations = timings.animationDuration > 0;
                     flags.hasTransitionAll = flags.hasTransitions && timings.transitionProperty == 'all';
                     flags.applyTransitionDuration = hasToStyles && (
                                                       (flags.hasTransitions && !flags.hasTransitionAll)
                                                        || (flags.hasAnimations && !flags.hasTransitions));
                     flags.applyAnimationDuration = options.duration && flags.hasAnimations;
                     flags.applyTransitionDelay = truthyTimingValue(options.delay) && (flags.applyTransitionDuration || flags.hasTransitions);
                     flags.applyAnimationDelay = truthyTimingValue(options.delay) && flags.hasAnimations;
                     flags.recalculateTimingStyles = addRemoveClassName.length > 0;

                     if (flags.applyTransitionDuration || flags.applyAnimationDuration) {
                         maxDuration = options.duration ? parseFloat(options.duration) : maxDuration;

                         if (flags.applyTransitionDuration) {
                             flags.hasTransitions = true;
                             timings.transitionDuration = maxDuration;
                             applyOnlyDuration = node.style[TRANSITION_PROP + PROPERTY_KEY].length > 0;
                             temporaryStyles.push(getCssTransitionDurationStyle(maxDuration, applyOnlyDuration));
                         }

                         if (flags.applyAnimationDuration) {
                             flags.hasAnimations = true;
                             timings.animationDuration = maxDuration;
                             temporaryStyles.push(getCssKeyframeDurationStyle(maxDuration));
                         }
                     }

                     if (maxDuration === 0 && !flags.recalculateTimingStyles) {
                         return closeAndReturnNoopAnimator();
                     }

                     // we need to recalculate the delay value since we used a pre-emptive negative
                     // delay value and the delay value is required for the final event checking. This
                     // property will ensure that this will happen after the RAF phase has passed.
                     if (options.duration == null && timings.transitionDuration > 0) {
                         flags.recalculateTimingStyles = flags.recalculateTimingStyles || isFirst;
                     }

                     maxDelayTime = maxDelay * ONE_SECOND;
                     maxDurationTime = maxDuration * ONE_SECOND;
                     if (!options.skipBlocking) {
                         flags.blockTransition = timings.transitionDuration > 0;
                         flags.blockKeyframeAnimation = timings.animationDuration > 0 &&
                                                        stagger.animationDelay > 0 &&
                                                        stagger.animationDuration === 0;
                     }

                     applyAnimationFromStyles(element, options);
                     if (!flags.blockTransition) {
                         blockTransitions(node, false);
                     }

                     applyBlocking(maxDuration);

                     // TODO(matsko): for 1.5 change this code to have an animator object for better debugging
                     return {
                         $$willAnimate: true,
                         end: endFn,
                         start: function () {
                             if (animationClosed) return;

                             runnerHost = {
                                 end: endFn,
                                 cancel: cancelFn,
                                 resume: null, //this will be set during the start() phase
                                 pause: null
                             };

                             runner = new $$AnimateRunner(runnerHost);

                             waitUntilQuiet(start);

                             // we don't have access to pause/resume the animation
                             // since it hasn't run yet. AnimateRunner will therefore
                             // set noop functions for resume and pause and they will
                             // later be overridden once the animation is triggered
                             return runner;
                         }
                     };

                     function endFn() {
                         close();
                     }

                     function cancelFn() {
                         close(true);
                     }

                     function close(rejected) { // jshint ignore:line
                         // if the promise has been called already then we shouldn't close
                         // the animation again
                         if (animationClosed || (animationCompleted && animationPaused)) return;
                         animationClosed = true;
                         animationPaused = false;

                         $$jqLite.removeClass(element, setupClasses);
                         $$jqLite.removeClass(element, activeClasses);

                         blockKeyframeAnimations(node, false);
                         blockTransitions(node, false);

                         forEach(temporaryStyles, function (entry) {
                             // There is only one way to remove inline style properties entirely from elements.
                             // By using `removeProperty` this works, but we need to convert camel-cased CSS
                             // styles down to hyphenated values.
                             node.style[entry[0]] = '';
                         });

                         applyAnimationClasses(element, options);
                         applyAnimationStyles(element, options);

                         // the reason why we have this option is to allow a synchronous closing callback
                         // that is fired as SOON as the animation ends (when the CSS is removed) or if
                         // the animation never takes off at all. A good example is a leave animation since
                         // the element must be removed just after the animation is over or else the element
                         // will appear on screen for one animation frame causing an overbearing flicker.
                         if (options.onDone) {
                             options.onDone();
                         }

                         // if the preparation function fails then the promise is not setup
                         if (runner) {
                             runner.complete(!rejected);
                         }
                     }

                     function applyBlocking(duration) {
                         if (flags.blockTransition) {
                             blockTransitions(node, duration);
                         }

                         if (flags.blockKeyframeAnimation) {
                             blockKeyframeAnimations(node, !!duration);
                         }
                     }

                     function closeAndReturnNoopAnimator() {
                         runner = new $$AnimateRunner({
                             end: endFn,
                             cancel: cancelFn
                         });

                         close();

                         return {
                             $$willAnimate: false,
                             start: function () {
                                 return runner;
                             },
                             end: endFn
                         };
                     }

                     function start() {
                         if (animationClosed) return;

                         var startTime, events = [];

                         // even though we only pause keyframe animations here the pause flag
                         // will still happen when transitions are used. Only the transition will
                         // not be paused since that is not possible. If the animation ends when
                         // paused then it will not complete until unpaused or cancelled.
                         var playPause = function (playAnimation) {
                             if (!animationCompleted) {
                                 animationPaused = !playAnimation;
                                 if (timings.animationDuration) {
                                     var value = blockKeyframeAnimations(node, animationPaused);
                                     animationPaused
                                         ? temporaryStyles.push(value)
                                         : removeFromArray(temporaryStyles, value);
                                 }
                             } else if (animationPaused && playAnimation) {
                                 animationPaused = false;
                                 close();
                             }
                         };

                         // checking the stagger duration prevents an accidently cascade of the CSS delay style
                         // being inherited from the parent. If the transition duration is zero then we can safely
                         // rely that the delay value is an intential stagger delay style.
                         var maxStagger = itemIndex > 0
                                          && ((timings.transitionDuration && stagger.transitionDuration === 0) ||
                                             (timings.animationDuration && stagger.animationDuration === 0))
                                          && Math.max(stagger.animationDelay, stagger.transitionDelay);
                         if (maxStagger) {
                             $timeout(triggerAnimationStart,
                                      Math.floor(maxStagger * itemIndex * ONE_SECOND),
                                      false);
                         } else {
                             triggerAnimationStart();
                         }

                         // this will decorate the existing promise runner with pause/resume methods
                         runnerHost.resume = function () {
                             playPause(true);
                         };

                         runnerHost.pause = function () {
                             playPause(false);
                         };

                         function triggerAnimationStart() {
                             // just incase a stagger animation kicks in when the animation
                             // itself was cancelled entirely
                             if (animationClosed) return;

                             applyBlocking(false);

                             forEach(temporaryStyles, function (entry) {
                                 var key = entry[0];
                                 var value = entry[1];
                                 node.style[key] = value;
                             });

                             applyAnimationClasses(element, options);
                             $$jqLite.addClass(element, activeClasses);

                             if (flags.recalculateTimingStyles) {
                                 fullClassName = node.className + ' ' + setupClasses;
                                 cacheKey = gcsHashFn(node, fullClassName);

                                 timings = computeTimings(node, fullClassName, cacheKey);
                                 relativeDelay = timings.maxDelay;
                                 maxDelay = Math.max(relativeDelay, 0);
                                 maxDuration = timings.maxDuration;

                                 if (maxDuration === 0) {
                                     close();
                                     return;
                                 }

                                 flags.hasTransitions = timings.transitionDuration > 0;
                                 flags.hasAnimations = timings.animationDuration > 0;
                             }

                             if (flags.applyTransitionDelay || flags.applyAnimationDelay) {
                                 relativeDelay = typeof options.delay !== "boolean" && truthyTimingValue(options.delay)
                                       ? parseFloat(options.delay)
                                       : relativeDelay;

                                 maxDelay = Math.max(relativeDelay, 0);

                                 var delayStyle;
                                 if (flags.applyTransitionDelay) {
                                     timings.transitionDelay = relativeDelay;
                                     delayStyle = getCssDelayStyle(relativeDelay);
                                     temporaryStyles.push(delayStyle);
                                     node.style[delayStyle[0]] = delayStyle[1];
                                 }

                                 if (flags.applyAnimationDelay) {
                                     timings.animationDelay = relativeDelay;
                                     delayStyle = getCssDelayStyle(relativeDelay, true);
                                     temporaryStyles.push(delayStyle);
                                     node.style[delayStyle[0]] = delayStyle[1];
                                 }
                             }

                             maxDelayTime = maxDelay * ONE_SECOND;
                             maxDurationTime = maxDuration * ONE_SECOND;

                             if (options.easing) {
                                 var easeProp, easeVal = options.easing;
                                 if (flags.hasTransitions) {
                                     easeProp = TRANSITION_PROP + TIMING_KEY;
                                     temporaryStyles.push([easeProp, easeVal]);
                                     node.style[easeProp] = easeVal;
                                 }
                                 if (flags.hasAnimations) {
                                     easeProp = ANIMATION_PROP + TIMING_KEY;
                                     temporaryStyles.push([easeProp, easeVal]);
                                     node.style[easeProp] = easeVal;
                                 }
                             }

                             if (timings.transitionDuration) {
                                 events.push(TRANSITIONEND_EVENT);
                             }

                             if (timings.animationDuration) {
                                 events.push(ANIMATIONEND_EVENT);
                             }

                             startTime = Date.now();
                             element.on(events.join(' '), onAnimationProgress);
                             $timeout(onAnimationExpired, maxDelayTime + CLOSING_TIME_BUFFER * maxDurationTime);

                             applyAnimationToStyles(element, options);
                         }

                         function onAnimationExpired() {
                             // although an expired animation is a failed animation, getting to
                             // this outcome is very easy if the CSS code screws up. Therefore we
                             // should still continue normally as if the animation completed correctly.
                             close();
                         }

                         function onAnimationProgress(event) {
                             event.stopPropagation();
                             var ev = event.originalEvent || event;
                             var timeStamp = ev.$manualTimeStamp || ev.timeStamp || Date.now();

                             /* Firefox (or possibly just Gecko) likes to not round values up
                              * when a ms measurement is used for the animation */
                             var elapsedTime = parseFloat(ev.elapsedTime.toFixed(ELAPSED_TIME_MAX_DECIMAL_PLACES));

                             /* $manualTimeStamp is a mocked timeStamp value which is set
                              * within browserTrigger(). This is only here so that tests can
                              * mock animations properly. Real events fallback to event.timeStamp,
                              * or, if they don't, then a timeStamp is automatically created for them.
                              * We're checking to see if the timeStamp surpasses the expected delay,
                              * but we're using elapsedTime instead of the timeStamp on the 2nd
                              * pre-condition since animations sometimes close off early */
                             if (Math.max(timeStamp - startTime, 0) >= maxDelayTime && elapsedTime >= maxDuration) {
                                 // we set this flag to ensure that if the transition is paused then, when resumed,
                                 // the animation will automatically close itself since transitions cannot be paused.
                                 animationCompleted = true;
                                 close();
                             }
                         }
                     }
                 }
             }];
    }];

    var $$AnimateCssDriverProvider = ['$$animationProvider', function ($$animationProvider) {
        $$animationProvider.drivers.push('$$animateCssDriver');

        var NG_ANIMATE_SHIM_CLASS_NAME = 'ng-animate-shim';
        var NG_ANIMATE_ANCHOR_CLASS_NAME = 'ng-anchor';

        var NG_OUT_ANCHOR_CLASS_NAME = 'ng-anchor-out';
        var NG_IN_ANCHOR_CLASS_NAME = 'ng-anchor-in';

        this.$get = ['$animateCss', '$rootScope', '$$AnimateRunner', '$rootElement', '$document', '$sniffer',
             function ($animateCss, $rootScope, $$AnimateRunner, $rootElement, $document, $sniffer) {

                 // only browsers that support these properties can render animations
                 if (!$sniffer.animations && !$sniffer.transitions) return noop;

                 var bodyNode = getDomNode($document).body;
                 var rootNode = getDomNode($rootElement);

                 var rootBodyElement = jqLite(bodyNode.parentNode === rootNode ? bodyNode : rootNode);

                 return function initDriverFn(animationDetails) {
                     return animationDetails.from && animationDetails.to
                         ? prepareFromToAnchorAnimation(animationDetails.from,
                                                        animationDetails.to,
                                                        animationDetails.classes,
                                                        animationDetails.anchors)
                         : prepareRegularAnimation(animationDetails);
                 };

                 function filterCssClasses(classes) {
                     //remove all the `ng-` stuff
                     return classes.replace(/\bng-\S+\b/g, '');
                 }

                 function getUniqueValues(a, b) {
                     if (isString(a)) a = a.split(' ');
                     if (isString(b)) b = b.split(' ');
                     return a.filter(function (val) {
                         return b.indexOf(val) === -1;
                     }).join(' ');
                 }

                 function prepareAnchoredAnimation(classes, outAnchor, inAnchor) {
                     var clone = jqLite(getDomNode(outAnchor).cloneNode(true));
                     var startingClasses = filterCssClasses(getClassVal(clone));

                     outAnchor.addClass(NG_ANIMATE_SHIM_CLASS_NAME);
                     inAnchor.addClass(NG_ANIMATE_SHIM_CLASS_NAME);

                     clone.addClass(NG_ANIMATE_ANCHOR_CLASS_NAME);

                     rootBodyElement.append(clone);

                     var animatorIn, animatorOut = prepareOutAnimation();

                     // the user may not end up using the `out` animation and
                     // only making use of the `in` animation or vice-versa.
                     // In either case we should allow this and not assume the
                     // animation is over unless both animations are not used.
                     if (!animatorOut) {
                         animatorIn = prepareInAnimation();
                         if (!animatorIn) {
                             return end();
                         }
                     }

                     var startingAnimator = animatorOut || animatorIn;

                     return {
                         start: function () {
                             var runner;

                             var currentAnimation = startingAnimator.start();
                             currentAnimation.done(function () {
                                 currentAnimation = null;
                                 if (!animatorIn) {
                                     animatorIn = prepareInAnimation();
                                     if (animatorIn) {
                                         currentAnimation = animatorIn.start();
                                         currentAnimation.done(function () {
                                             currentAnimation = null;
                                             end();
                                             runner.complete();
                                         });
                                         return currentAnimation;
                                     }
                                 }
                                 // in the event that there is no `in` animation
                                 end();
                                 runner.complete();
                             });

                             runner = new $$AnimateRunner({
                                 end: endFn,
                                 cancel: endFn
                             });

                             return runner;

                             function endFn() {
                                 if (currentAnimation) {
                                     currentAnimation.end();
                                 }
                             }
                         }
                     };

                     function calculateAnchorStyles(anchor) {
                         var styles = {};

                         var coords = getDomNode(anchor).getBoundingClientRect();

                         // we iterate directly since safari messes up and doesn't return
                         // all the keys for the coods object when iterated
                         forEach(['width', 'height', 'top', 'left'], function (key) {
                             var value = coords[key];
                             switch (key) {
                                 case 'top':
                                     value += bodyNode.scrollTop;
                                     break;
                                 case 'left':
                                     value += bodyNode.scrollLeft;
                                     break;
                             }
                             styles[key] = Math.floor(value) + 'px';
                         });
                         return styles;
                     }

                     function prepareOutAnimation() {
                         var animator = $animateCss(clone, {
                             addClass: NG_OUT_ANCHOR_CLASS_NAME,
                             delay: true,
                             from: calculateAnchorStyles(outAnchor)
                         });

                         // read the comment within `prepareRegularAnimation` to understand
                         // why this check is necessary
                         return animator.$$willAnimate ? animator : null;
                     }

                     function getClassVal(element) {
                         return element.attr('class') || '';
                     }

                     function prepareInAnimation() {
                         var endingClasses = filterCssClasses(getClassVal(inAnchor));
                         var toAdd = getUniqueValues(endingClasses, startingClasses);
                         var toRemove = getUniqueValues(startingClasses, endingClasses);

                         var animator = $animateCss(clone, {
                             to: calculateAnchorStyles(inAnchor),
                             addClass: NG_IN_ANCHOR_CLASS_NAME + ' ' + toAdd,
                             removeClass: NG_OUT_ANCHOR_CLASS_NAME + ' ' + toRemove,
                             delay: true
                         });

                         // read the comment within `prepareRegularAnimation` to understand
                         // why this check is necessary
                         return animator.$$willAnimate ? animator : null;
                     }

                     function end() {
                         clone.remove();
                         outAnchor.removeClass(NG_ANIMATE_SHIM_CLASS_NAME);
                         inAnchor.removeClass(NG_ANIMATE_SHIM_CLASS_NAME);
                     }
                 }

                 function prepareFromToAnchorAnimation(from, to, classes, anchors) {
                     var fromAnimation = prepareRegularAnimation(from);
                     var toAnimation = prepareRegularAnimation(to);

                     var anchorAnimations = [];
                     forEach(anchors, function (anchor) {
                         var outElement = anchor['out'];
                         var inElement = anchor['in'];
                         var animator = prepareAnchoredAnimation(classes, outElement, inElement);
                         if (animator) {
                             anchorAnimations.push(animator);
                         }
                     });

                     // no point in doing anything when there are no elements to animate
                     if (!fromAnimation && !toAnimation && anchorAnimations.length === 0) return;

                     return {
                         start: function () {
                             var animationRunners = [];

                             if (fromAnimation) {
                                 animationRunners.push(fromAnimation.start());
                             }

                             if (toAnimation) {
                                 animationRunners.push(toAnimation.start());
                             }

                             forEach(anchorAnimations, function (animation) {
                                 animationRunners.push(animation.start());
                             });

                             var runner = new $$AnimateRunner({
                                 end: endFn,
                                 cancel: endFn // CSS-driven animations cannot be cancelled, only ended
                             });

                             $$AnimateRunner.all(animationRunners, function (status) {
                                 runner.complete(status);
                             });

                             return runner;

                             function endFn() {
                                 forEach(animationRunners, function (runner) {
                                     runner.end();
                                 });
                             }
                         }
                     };
                 }

                 function prepareRegularAnimation(animationDetails) {
                     var element = animationDetails.element;
                     var options = animationDetails.options || {};

                     if (animationDetails.structural) {
                         // structural animations ensure that the CSS classes are always applied
                         // before the detection starts.
                         options.structural = options.applyClassesEarly = true;

                         // we special case the leave animation since we want to ensure that
                         // the element is removed as soon as the animation is over. Otherwise
                         // a flicker might appear or the element may not be removed at all
                         options.event = animationDetails.event;
                         if (options.event === 'leave') {
                             options.onDone = options.domOperation;
                         }
                     } else {
                         options.event = null;
                     }

                     var animator = $animateCss(element, options);

                     // the driver lookup code inside of $$animation attempts to spawn a
                     // driver one by one until a driver returns a.$$willAnimate animator object.
                     // $animateCss will always return an object, however, it will pass in
                     // a flag as a hint as to whether an animation was detected or not
                     return animator.$$willAnimate ? animator : null;
                 }
             }];
    }];

    // TODO(matsko): use caching here to speed things up for detection
    // TODO(matsko): add documentation
    //  by the time...

    var $$AnimateJsProvider = ['$animateProvider', function ($animateProvider) {
        this.$get = ['$injector', '$$AnimateRunner', '$$rAFMutex', '$$jqLite',
             function ($injector, $$AnimateRunner, $$rAFMutex, $$jqLite) {

                 var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);
                 // $animateJs(element, 'enter');
                 return function (element, event, classes, options) {
                     // the `classes` argument is optional and if it is not used
                     // then the classes will be resolved from the element's className
                     // property as well as options.addClass/options.removeClass.
                     if (arguments.length === 3 && isObject(classes)) {
                         options = classes;
                         classes = null;
                     }

                     options = prepareAnimationOptions(options);
                     if (!classes) {
                         classes = element.attr('class') || '';
                         if (options.addClass) {
                             classes += ' ' + options.addClass;
                         }
                         if (options.removeClass) {
                             classes += ' ' + options.removeClass;
                         }
                     }

                     var classesToAdd = options.addClass;
                     var classesToRemove = options.removeClass;

                     // the lookupAnimations function returns a series of animation objects that are
                     // matched up with one or more of the CSS classes. These animation objects are
                     // defined via the module.animation factory function. If nothing is detected then
                     // we don't return anything which then makes $animation query the next driver.
                     var animations = lookupAnimations(classes);
                     var before, after;
                     if (animations.length) {
                         var afterFn, beforeFn;
                         if (event == 'leave') {
                             beforeFn = 'leave';
                             afterFn = 'afterLeave'; // TODO(matsko): get rid of this
                         } else {
                             beforeFn = 'before' + event.charAt(0).toUpperCase() + event.substr(1);
                             afterFn = event;
                         }

                         if (event !== 'enter' && event !== 'move') {
                             before = packageAnimations(element, event, options, animations, beforeFn);
                         }
                         after = packageAnimations(element, event, options, animations, afterFn);
                     }

                     // no matching animations
                     if (!before && !after) return;

                     function applyOptions() {
                         options.domOperation();
                         applyAnimationClasses(element, options);
                     }

                     return {
                         start: function () {
                             var closeActiveAnimations;
                             var chain = [];

                             if (before) {
                                 chain.push(function (fn) {
                                     closeActiveAnimations = before(fn);
                                 });
                             }

                             if (chain.length) {
                                 chain.push(function (fn) {
                                     applyOptions();
                                     fn(true);
                                 });
                             } else {
                                 applyOptions();
                             }

                             if (after) {
                                 chain.push(function (fn) {
                                     closeActiveAnimations = after(fn);
                                 });
                             }

                             var animationClosed = false;
                             var runner = new $$AnimateRunner({
                                 end: function () {
                                     endAnimations();
                                 },
                                 cancel: function () {
                                     endAnimations(true);
                                 }
                             });

                             $$AnimateRunner.chain(chain, onComplete);
                             return runner;

                             function onComplete(success) {
                                 animationClosed = true;
                                 applyOptions();
                                 applyAnimationStyles(element, options);
                                 runner.complete(success);
                             }

                             function endAnimations(cancelled) {
                                 if (!animationClosed) {
                                     (closeActiveAnimations || noop)(cancelled);
                                     onComplete(cancelled);
                                 }
                             }
                         }
                     };

                     function executeAnimationFn(fn, element, event, options, onDone) {
                         var args;
                         switch (event) {
                             case 'animate':
                                 args = [element, options.from, options.to, onDone];
                                 break;

                             case 'setClass':
                                 args = [element, classesToAdd, classesToRemove, onDone];
                                 break;

                             case 'addClass':
                                 args = [element, classesToAdd, onDone];
                                 break;

                             case 'removeClass':
                                 args = [element, classesToRemove, onDone];
                                 break;

                             default:
                                 args = [element, onDone];
                                 break;
                         }

                         args.push(options);

                         var value = fn.apply(fn, args);
                         if (value) {
                             if (isFunction(value.start)) {
                                 value = value.start();
                             }

                             if (value instanceof $$AnimateRunner) {
                                 value.done(onDone);
                             } else if (isFunction(value)) {
                                 // optional onEnd / onCancel callback
                                 return value;
                             }
                         }

                         return noop;
                     }

                     function groupEventedAnimations(element, event, options, animations, fnName) {
                         var operations = [];
                         forEach(animations, function (ani) {
                             var animation = ani[fnName];
                             if (!animation) return;

                             // note that all of these animations will run in parallel
                             operations.push(function () {
                                 var runner;
                                 var endProgressCb;

                                 var resolved = false;
                                 var onAnimationComplete = function (rejected) {
                                     if (!resolved) {
                                         resolved = true;
                                         (endProgressCb || noop)(rejected);
                                         runner.complete(!rejected);
                                     }
                                 };

                                 runner = new $$AnimateRunner({
                                     end: function () {
                                         onAnimationComplete();
                                     },
                                     cancel: function () {
                                         onAnimationComplete(true);
                                     }
                                 });

                                 endProgressCb = executeAnimationFn(animation, element, event, options, function (result) {
                                     var cancelled = result === false;
                                     onAnimationComplete(cancelled);
                                 });

                                 return runner;
                             });
                         });

                         return operations;
                     }

                     function packageAnimations(element, event, options, animations, fnName) {
                         var operations = groupEventedAnimations(element, event, options, animations, fnName);
                         if (operations.length === 0) {
                             var a, b;
                             if (fnName === 'beforeSetClass') {
                                 a = groupEventedAnimations(element, 'removeClass', options, animations, 'beforeRemoveClass');
                                 b = groupEventedAnimations(element, 'addClass', options, animations, 'beforeAddClass');
                             } else if (fnName === 'setClass') {
                                 a = groupEventedAnimations(element, 'removeClass', options, animations, 'removeClass');
                                 b = groupEventedAnimations(element, 'addClass', options, animations, 'addClass');
                             }

                             if (a) {
                                 operations = operations.concat(a);
                             }
                             if (b) {
                                 operations = operations.concat(b);
                             }
                         }

                         if (operations.length === 0) return;

                         // TODO(matsko): add documentation
                         return function startAnimation(callback) {
                             var runners = [];
                             if (operations.length) {
                                 forEach(operations, function (animateFn) {
                                     runners.push(animateFn());
                                 });
                             }

                             runners.length ? $$AnimateRunner.all(runners, callback) : callback();

                             return function endFn(reject) {
                                 forEach(runners, function (runner) {
                                     reject ? runner.cancel() : runner.end();
                                 });
                             };
                         };
                     }
                 };

                 function lookupAnimations(classes) {
                     classes = isArray(classes) ? classes : classes.split(' ');
                     var matches = [], flagMap = {};
                     for (var i = 0; i < classes.length; i++) {
                         var klass = classes[i],
                             animationFactory = $animateProvider.$$registeredAnimations[klass];
                         if (animationFactory && !flagMap[klass]) {
                             matches.push($injector.get(animationFactory));
                             flagMap[klass] = true;
                         }
                     }
                     return matches;
                 }
             }];
    }];

    var $$AnimateJsDriverProvider = ['$$animationProvider', function ($$animationProvider) {
        $$animationProvider.drivers.push('$$animateJsDriver');
        this.$get = ['$$animateJs', '$$AnimateRunner', function ($$animateJs, $$AnimateRunner) {
            return function initDriverFn(animationDetails) {
                if (animationDetails.from && animationDetails.to) {
                    var fromAnimation = prepareAnimation(animationDetails.from);
                    var toAnimation = prepareAnimation(animationDetails.to);
                    if (!fromAnimation && !toAnimation) return;

                    return {
                        start: function () {
                            var animationRunners = [];

                            if (fromAnimation) {
                                animationRunners.push(fromAnimation.start());
                            }

                            if (toAnimation) {
                                animationRunners.push(toAnimation.start());
                            }

                            $$AnimateRunner.all(animationRunners, done);

                            var runner = new $$AnimateRunner({
                                end: endFnFactory(),
                                cancel: endFnFactory()
                            });

                            return runner;

                            function endFnFactory() {
                                return function () {
                                    forEach(animationRunners, function (runner) {
                                        // at this point we cannot cancel animations for groups just yet. 1.5+
                                        runner.end();
                                    });
                                };
                            }

                            function done(status) {
                                runner.complete(status);
                            }
                        }
                    };
                } else {
                    return prepareAnimation(animationDetails);
                }
            };

            function prepareAnimation(animationDetails) {
                // TODO(matsko): make sure to check for grouped animations and delegate down to normal animations
                var element = animationDetails.element;
                var event = animationDetails.event;
                var options = animationDetails.options;
                var classes = animationDetails.classes;
                return $$animateJs(element, event, classes, options);
            }
        }];
    }];

    var NG_ANIMATE_ATTR_NAME = 'data-ng-animate';
    var NG_ANIMATE_PIN_DATA = '$ngAnimatePin';
    var $$AnimateQueueProvider = ['$animateProvider', function ($animateProvider) {
        var PRE_DIGEST_STATE = 1;
        var RUNNING_STATE = 2;

        var rules = this.rules = {
            skip: [],
            cancel: [],
            join: []
        };

        function isAllowed(ruleType, element, currentAnimation, previousAnimation) {
            return rules[ruleType].some(function (fn) {
                return fn(element, currentAnimation, previousAnimation);
            });
        }

        function hasAnimationClasses(options, and) {
            options = options || {};
            var a = (options.addClass || '').length > 0;
            var b = (options.removeClass || '').length > 0;
            return and ? a && b : a || b;
        }

        rules.join.push(function (element, newAnimation, currentAnimation) {
            // if the new animation is class-based then we can just tack that on
            return !newAnimation.structural && hasAnimationClasses(newAnimation.options);
        });

        rules.skip.push(function (element, newAnimation, currentAnimation) {
            // there is no need to animate anything if no classes are being added and
            // there is no structural animation that will be triggered
            return !newAnimation.structural && !hasAnimationClasses(newAnimation.options);
        });

        rules.skip.push(function (element, newAnimation, currentAnimation) {
            // why should we trigger a new structural animation if the element will
            // be removed from the DOM anyway?
            return currentAnimation.event == 'leave' && newAnimation.structural;
        });

        rules.skip.push(function (element, newAnimation, currentAnimation) {
            // if there is a current animation then skip the class-based animation
            return currentAnimation.structural && !newAnimation.structural;
        });

        rules.cancel.push(function (element, newAnimation, currentAnimation) {
            // there can never be two structural animations running at the same time
            return currentAnimation.structural && newAnimation.structural;
        });

        rules.cancel.push(function (element, newAnimation, currentAnimation) {
            // if the previous animation is already running, but the new animation will
            // be triggered, but the new animation is structural
            return currentAnimation.state === RUNNING_STATE && newAnimation.structural;
        });

        rules.cancel.push(function (element, newAnimation, currentAnimation) {
            var nO = newAnimation.options;
            var cO = currentAnimation.options;

            // if the exact same CSS class is added/removed then it's safe to cancel it
            return (nO.addClass && nO.addClass === cO.removeClass) || (nO.removeClass && nO.removeClass === cO.addClass);
        });

        this.$get = ['$$rAF', '$rootScope', '$rootElement', '$document', '$$HashMap',
                     '$$animation', '$$AnimateRunner', '$templateRequest', '$$jqLite',
             function ($$rAF, $rootScope, $rootElement, $document, $$HashMap,
                      $$animation, $$AnimateRunner, $templateRequest, $$jqLite) {

                 var activeAnimationsLookup = new $$HashMap();
                 var disabledElementsLookup = new $$HashMap();

                 var animationsEnabled = null;

                 // Wait until all directive and route-related templates are downloaded and
                 // compiled. The $templateRequest.totalPendingRequests variable keeps track of
                 // all of the remote templates being currently downloaded. If there are no
                 // templates currently downloading then the watcher will still fire anyway.
                 var deregisterWatch = $rootScope.$watch(
                   function () { return $templateRequest.totalPendingRequests === 0; },
                   function (isEmpty) {
                       if (!isEmpty) return;
                       deregisterWatch();

                       // Now that all templates have been downloaded, $animate will wait until
                       // the post digest queue is empty before enabling animations. By having two
                       // calls to $postDigest calls we can ensure that the flag is enabled at the
                       // very end of the post digest queue. Since all of the animations in $animate
                       // use $postDigest, it's important that the code below executes at the end.
                       // This basically means that the page is fully downloaded and compiled before
                       // any animations are triggered.
                       $rootScope.$$postDigest(function () {
                           $rootScope.$$postDigest(function () {
                               // we check for null directly in the event that the application already called
                               // .enabled() with whatever arguments that it provided it with
                               if (animationsEnabled === null) {
                                   animationsEnabled = true;
                               }
                           });
                       });
                   }
                 );

                 var bodyElement = jqLite($document[0].body);

                 var callbackRegistry = {};

                 // remember that the classNameFilter is set during the provider/config
                 // stage therefore we can optimize here and setup a helper function
                 var classNameFilter = $animateProvider.classNameFilter();
                 var isAnimatableClassName = !classNameFilter
                           ? function () { return true; }
                           : function (className) {
                               return classNameFilter.test(className);
                           };

                 var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);

                 function normalizeAnimationOptions(element, options) {
                     return mergeAnimationOptions(element, options, {});
                 }

                 function findCallbacks(element, event) {
                     var targetNode = getDomNode(element);

                     var matches = [];
                     var entries = callbackRegistry[event];
                     if (entries) {
                         forEach(entries, function (entry) {
                             if (entry.node.contains(targetNode)) {
                                 matches.push(entry.callback);
                             }
                         });
                     }

                     return matches;
                 }

                 function triggerCallback(event, element, phase, data) {
                     $$rAF(function () {
                         forEach(findCallbacks(element, event), function (callback) {
                             callback(element, phase, data);
                         });
                     });
                 }

                 return {
                     on: function (event, container, callback) {
                         var node = extractElementNode(container);
                         callbackRegistry[event] = callbackRegistry[event] || [];
                         callbackRegistry[event].push({
                             node: node,
                             callback: callback
                         });
                     },

                     off: function (event, container, callback) {
                         var entries = callbackRegistry[event];
                         if (!entries) return;

                         callbackRegistry[event] = arguments.length === 1
                             ? null
                             : filterFromRegistry(entries, container, callback);

                         function filterFromRegistry(list, matchContainer, matchCallback) {
                             var containerNode = extractElementNode(matchContainer);
                             return list.filter(function (entry) {
                                 var isMatch = entry.node === containerNode &&
                                                 (!matchCallback || entry.callback === matchCallback);
                                 return !isMatch;
                             });
                         }
                     },

                     pin: function (element, parentElement) {
                         assertArg(isElement(element), 'element', 'not an element');
                         assertArg(isElement(parentElement), 'parentElement', 'not an element');
                         element.data(NG_ANIMATE_PIN_DATA, parentElement);
                     },

                     push: function (element, event, options, domOperation) {
                         options = options || {};
                         options.domOperation = domOperation;
                         return queueAnimation(element, event, options);
                     },

                     // this method has four signatures:
                     //  () - global getter
                     //  (bool) - global setter
                     //  (element) - element getter
                     //  (element, bool) - element setter<F37>
                     enabled: function (element, bool) {
                         var argCount = arguments.length;

                         if (argCount === 0) {
                             // () - Global getter
                             bool = !!animationsEnabled;
                         } else {
                             var hasElement = isElement(element);

                             if (!hasElement) {
                                 // (bool) - Global setter
                                 bool = animationsEnabled = !!element;
                             } else {
                                 var node = getDomNode(element);
                                 var recordExists = disabledElementsLookup.get(node);

                                 if (argCount === 1) {
                                     // (element) - Element getter
                                     bool = !recordExists;
                                 } else {
                                     // (element, bool) - Element setter
                                     bool = !!bool;
                                     if (!bool) {
                                         disabledElementsLookup.put(node, true);
                                     } else if (recordExists) {
                                         disabledElementsLookup.remove(node);
                                     }
                                 }
                             }
                         }

                         return bool;
                     }
                 };

                 function queueAnimation(element, event, options) {
                     var node, parent;
                     element = stripCommentsFromElement(element);
                     if (element) {
                         node = getDomNode(element);
                         parent = element.parent();
                     }

                     options = prepareAnimationOptions(options);

                     // we create a fake runner with a working promise.
                     // These methods will become available after the digest has passed
                     var runner = new $$AnimateRunner();

                     // there are situations where a directive issues an animation for
                     // a jqLite wrapper that contains only comment nodes... If this
                     // happens then there is no way we can perform an animation
                     if (!node) {
                         close();
                         return runner;
                     }

                     if (isArray(options.addClass)) {
                         options.addClass = options.addClass.join(' ');
                     }

                     if (isArray(options.removeClass)) {
                         options.removeClass = options.removeClass.join(' ');
                     }

                     if (options.from && !isObject(options.from)) {
                         options.from = null;
                     }

                     if (options.to && !isObject(options.to)) {
                         options.to = null;
                     }

                     var className = [node.className, options.addClass, options.removeClass].join(' ');
                     if (!isAnimatableClassName(className)) {
                         close();
                         return runner;
                     }

                     var isStructural = ['enter', 'move', 'leave'].indexOf(event) >= 0;

                     // this is a hard disable of all animations for the application or on
                     // the element itself, therefore  there is no need to continue further
                     // past this point if not enabled
                     var skipAnimations = !animationsEnabled || disabledElementsLookup.get(node);
                     var existingAnimation = (!skipAnimations && activeAnimationsLookup.get(node)) || {};
                     var hasExistingAnimation = !!existingAnimation.state;

                     // there is no point in traversing the same collection of parent ancestors if a followup
                     // animation will be run on the same element that already did all that checking work
                     if (!skipAnimations && (!hasExistingAnimation || existingAnimation.state != PRE_DIGEST_STATE)) {
                         skipAnimations = !areAnimationsAllowed(element, parent, event);
                     }

                     if (skipAnimations) {
                         close();
                         return runner;
                     }

                     if (isStructural) {
                         closeChildAnimations(element);
                     }

                     var newAnimation = {
                         structural: isStructural,
                         element: element,
                         event: event,
                         close: close,
                         options: options,
                         runner: runner
                     };

                     if (hasExistingAnimation) {
                         var skipAnimationFlag = isAllowed('skip', element, newAnimation, existingAnimation);
                         if (skipAnimationFlag) {
                             if (existingAnimation.state === RUNNING_STATE) {
                                 close();
                                 return runner;
                             } else {
                                 mergeAnimationOptions(element, existingAnimation.options, options);
                                 return existingAnimation.runner;
                             }
                         }

                         var cancelAnimationFlag = isAllowed('cancel', element, newAnimation, existingAnimation);
                         if (cancelAnimationFlag) {
                             if (existingAnimation.state === RUNNING_STATE) {
                                 // this will end the animation right away and it is safe
                                 // to do so since the animation is already running and the
                                 // runner callback code will run in async
                                 existingAnimation.runner.end();
                             } else if (existingAnimation.structural) {
                                 // this means that the animation is queued into a digest, but
                                 // hasn't started yet. Therefore it is safe to run the close
                                 // method which will call the runner methods in async.
                                 existingAnimation.close();
                             } else {
                                 // this will merge the existing animation options into this new follow-up animation
                                 mergeAnimationOptions(element, newAnimation.options, existingAnimation.options);
                             }
                         } else {
                             // a joined animation means that this animation will take over the existing one
                             // so an example would involve a leave animation taking over an enter. Then when
                             // the postDigest kicks in the enter will be ignored.
                             var joinAnimationFlag = isAllowed('join', element, newAnimation, existingAnimation);
                             if (joinAnimationFlag) {
                                 if (existingAnimation.state === RUNNING_STATE) {
                                     normalizeAnimationOptions(element, options);
                                 } else {
                                     event = newAnimation.event = existingAnimation.event;
                                     options = mergeAnimationOptions(element, existingAnimation.options, newAnimation.options);
                                     return runner;
                                 }
                             }
                         }
                     } else {
                         // normalization in this case means that it removes redundant CSS classes that
                         // already exist (addClass) or do not exist (removeClass) on the element
                         normalizeAnimationOptions(element, options);
                     }

                     // when the options are merged and cleaned up we may end up not having to do
                     // an animation at all, therefore we should check this before issuing a post
                     // digest callback. Structural animations will always run no matter what.
                     var isValidAnimation = newAnimation.structural;
                     if (!isValidAnimation) {
                         // animate (from/to) can be quickly checked first, otherwise we check if any classes are present
                         isValidAnimation = (newAnimation.event === 'animate' && Object.keys(newAnimation.options.to || {}).length > 0)
                                             || hasAnimationClasses(newAnimation.options);
                     }

                     if (!isValidAnimation) {
                         close();
                         clearElementAnimationState(element);
                         return runner;
                     }

                     if (isStructural) {
                         closeParentClassBasedAnimations(parent);
                     }

                     // the counter keeps track of cancelled animations
                     var counter = (existingAnimation.counter || 0) + 1;
                     newAnimation.counter = counter;

                     markElementAnimationState(element, PRE_DIGEST_STATE, newAnimation);

                     $rootScope.$$postDigest(function () {
                         var animationDetails = activeAnimationsLookup.get(node);
                         var animationCancelled = !animationDetails;
                         animationDetails = animationDetails || {};

                         // if addClass/removeClass is called before something like enter then the
                         // registered parent element may not be present. The code below will ensure
                         // that a final value for parent element is obtained
                         var parentElement = element.parent() || [];

                         // animate/structural/class-based animations all have requirements. Otherwise there
                         // is no point in performing an animation. The parent node must also be set.
                         var isValidAnimation = parentElement.length > 0
                                                 && (animationDetails.event === 'animate'
                                                     || animationDetails.structural
                                                     || hasAnimationClasses(animationDetails.options));

                         // this means that the previous animation was cancelled
                         // even if the follow-up animation is the same event
                         if (animationCancelled || animationDetails.counter !== counter || !isValidAnimation) {
                             // if another animation did not take over then we need
                             // to make sure that the domOperation and options are
                             // handled accordingly
                             if (animationCancelled) {
                                 applyAnimationClasses(element, options);
                                 applyAnimationStyles(element, options);
                             }

                             // if the event changed from something like enter to leave then we do
                             // it, otherwise if it's the same then the end result will be the same too
                             if (animationCancelled || (isStructural && animationDetails.event !== event)) {
                                 options.domOperation();
                                 runner.end();
                             }

                             // in the event that the element animation was not cancelled or a follow-up animation
                             // isn't allowed to animate from here then we need to clear the state of the element
                             // so that any future animations won't read the expired animation data.
                             if (!isValidAnimation) {
                                 clearElementAnimationState(element);
                             }

                             return;
                         }

                         // this combined multiple class to addClass / removeClass into a setClass event
                         // so long as a structural event did not take over the animation
                         event = !animationDetails.structural && hasAnimationClasses(animationDetails.options, true)
                             ? 'setClass'
                             : animationDetails.event;

                         if (animationDetails.structural) {
                             closeParentClassBasedAnimations(parentElement);
                         }

                         markElementAnimationState(element, RUNNING_STATE);
                         var realRunner = $$animation(element, event, animationDetails.options);
                         realRunner.done(function (status) {
                             close(!status);
                             var animationDetails = activeAnimationsLookup.get(node);
                             if (animationDetails && animationDetails.counter === counter) {
                                 clearElementAnimationState(getDomNode(element));
                             }
                             notifyProgress(runner, event, 'close', {});
                         });

                         // this will update the runner's flow-control events based on
                         // the `realRunner` object.
                         runner.setHost(realRunner);
                         notifyProgress(runner, event, 'start', {});
                     });

                     return runner;

                     function notifyProgress(runner, event, phase, data) {
                         triggerCallback(event, element, phase, data);
                         runner.progress(event, phase, data);
                     }

                     function close(reject) { // jshint ignore:line
                         applyAnimationClasses(element, options);
                         applyAnimationStyles(element, options);
                         options.domOperation();
                         runner.complete(!reject);
                     }
                 }

                 function closeChildAnimations(element) {
                     var node = getDomNode(element);
                     var children = node.querySelectorAll('[' + NG_ANIMATE_ATTR_NAME + ']');
                     forEach(children, function (child) {
                         var state = parseInt(child.getAttribute(NG_ANIMATE_ATTR_NAME));
                         var animationDetails = activeAnimationsLookup.get(child);
                         switch (state) {
                             case RUNNING_STATE:
                                 animationDetails.runner.end();
                                 /* falls through */
                             case PRE_DIGEST_STATE:
                                 if (animationDetails) {
                                     activeAnimationsLookup.remove(child);
                                 }
                                 break;
                         }
                     });
                 }

                 function clearElementAnimationState(element) {
                     var node = getDomNode(element);
                     node.removeAttribute(NG_ANIMATE_ATTR_NAME);
                     activeAnimationsLookup.remove(node);
                 }

                 function isMatchingElement(nodeOrElmA, nodeOrElmB) {
                     return getDomNode(nodeOrElmA) === getDomNode(nodeOrElmB);
                 }

                 function closeParentClassBasedAnimations(startingElement) {
                     var parentNode = getDomNode(startingElement);
                     do {
                         if (!parentNode || parentNode.nodeType !== ELEMENT_NODE) break;

                         var animationDetails = activeAnimationsLookup.get(parentNode);
                         if (animationDetails) {
                             examineParentAnimation(parentNode, animationDetails);
                         }

                         parentNode = parentNode.parentNode;
                     } while (true);

                     // since animations are detected from CSS classes, we need to flush all parent
                     // class-based animations so that the parent classes are all present for child
                     // animations to properly function (otherwise any CSS selectors may not work)
                     function examineParentAnimation(node, animationDetails) {
                         // enter/leave/move always have priority
                         if (animationDetails.structural || !hasAnimationClasses(animationDetails.options)) return;

                         if (animationDetails.state === RUNNING_STATE) {
                             animationDetails.runner.end();
                         }
                         clearElementAnimationState(node);
                     }
                 }

                 function areAnimationsAllowed(element, parentElement, event) {
                     var bodyElementDetected = false;
                     var rootElementDetected = false;
                     var parentAnimationDetected = false;
                     var animateChildren;

                     var parentHost = element.data(NG_ANIMATE_PIN_DATA);
                     if (parentHost) {
                         parentElement = parentHost;
                     }

                     while (parentElement && parentElement.length) {
                         if (!rootElementDetected) {
                             // angular doesn't want to attempt to animate elements outside of the application
                             // therefore we need to ensure that the rootElement is an ancestor of the current element
                             rootElementDetected = isMatchingElement(parentElement, $rootElement);
                         }

                         var parentNode = parentElement[0];
                         if (parentNode.nodeType !== ELEMENT_NODE) {
                             // no point in inspecting the #document element
                             break;
                         }

                         var details = activeAnimationsLookup.get(parentNode) || {};
                         // either an enter, leave or move animation will commence
                         // therefore we can't allow any animations to take place
                         // but if a parent animation is class-based then that's ok
                         if (!parentAnimationDetected) {
                             parentAnimationDetected = details.structural || disabledElementsLookup.get(parentNode);
                         }

                         if (isUndefined(animateChildren) || animateChildren === true) {
                             var value = parentElement.data(NG_ANIMATE_CHILDREN_DATA);
                             if (isDefined(value)) {
                                 animateChildren = value;
                             }
                         }

                         // there is no need to continue traversing at this point
                         if (parentAnimationDetected && animateChildren === false) break;

                         if (!rootElementDetected) {
                             // angular doesn't want to attempt to animate elements outside of the application
                             // therefore we need to ensure that the rootElement is an ancestor of the current element
                             rootElementDetected = isMatchingElement(parentElement, $rootElement);
                             if (!rootElementDetected) {
                                 parentHost = parentElement.data(NG_ANIMATE_PIN_DATA);
                                 if (parentHost) {
                                     parentElement = parentHost;
                                 }
                             }
                         }

                         if (!bodyElementDetected) {
                             // we also need to ensure that the element is or will be apart of the body element
                             // otherwise it is pointless to even issue an animation to be rendered
                             bodyElementDetected = isMatchingElement(parentElement, bodyElement);
                         }

                         parentElement = parentElement.parent();
                     }

                     var allowAnimation = !parentAnimationDetected || animateChildren;
                     return allowAnimation && rootElementDetected && bodyElementDetected;
                 }

                 function markElementAnimationState(element, state, details) {
                     details = details || {};
                     details.state = state;

                     var node = getDomNode(element);
                     node.setAttribute(NG_ANIMATE_ATTR_NAME, state);

                     var oldValue = activeAnimationsLookup.get(node);
                     var newValue = oldValue
                         ? extend(oldValue, details)
                         : details;
                     activeAnimationsLookup.put(node, newValue);
                 }
             }];
    }];

    var $$rAFMutexFactory = ['$$rAF', function ($$rAF) {
        return function () {
            var passed = false;
            $$rAF(function () {
                passed = true;
            });
            return function (fn) {
                passed ? fn() : $$rAF(fn);
            };
        };
    }];

    var $$AnimateRunnerFactory = ['$q', '$$rAFMutex', function ($q, $$rAFMutex) {
        var INITIAL_STATE = 0;
        var DONE_PENDING_STATE = 1;
        var DONE_COMPLETE_STATE = 2;

        AnimateRunner.chain = function (chain, callback) {
            var index = 0;

            next();
            function next() {
                if (index === chain.length) {
                    callback(true);
                    return;
                }

                chain[index](function (response) {
                    if (response === false) {
                        callback(false);
                        return;
                    }
                    index++;
                    next();
                });
            }
        };

        AnimateRunner.all = function (runners, callback) {
            var count = 0;
            var status = true;
            forEach(runners, function (runner) {
                runner.done(onProgress);
            });

            function onProgress(response) {
                status = status && response;
                if (++count === runners.length) {
                    callback(status);
                }
            }
        };

        function AnimateRunner(host) {
            this.setHost(host);

            this._doneCallbacks = [];
            this._runInAnimationFrame = $$rAFMutex();
            this._state = 0;
        }

        AnimateRunner.prototype = {
            setHost: function (host) {
                this.host = host || {};
            },

            done: function (fn) {
                if (this._state === DONE_COMPLETE_STATE) {
                    fn();
                } else {
                    this._doneCallbacks.push(fn);
                }
            },

            progress: noop,

            getPromise: function () {
                if (!this.promise) {
                    var self = this;
                    this.promise = $q(function (resolve, reject) {
                        self.done(function (status) {
                            status === false ? reject() : resolve();
                        });
                    });
                }
                return this.promise;
            },

            then: function (resolveHandler, rejectHandler) {
                return this.getPromise().then(resolveHandler, rejectHandler);
            },

            'catch': function (handler) {
                return this.getPromise()['catch'](handler);
            },

            'finally': function (handler) {
                return this.getPromise()['finally'](handler);
            },

            pause: function () {
                if (this.host.pause) {
                    this.host.pause();
                }
            },

            resume: function () {
                if (this.host.resume) {
                    this.host.resume();
                }
            },

            end: function () {
                if (this.host.end) {
                    this.host.end();
                }
                this._resolve(true);
            },

            cancel: function () {
                if (this.host.cancel) {
                    this.host.cancel();
                }
                this._resolve(false);
            },

            complete: function (response) {
                var self = this;
                if (self._state === INITIAL_STATE) {
                    self._state = DONE_PENDING_STATE;
                    self._runInAnimationFrame(function () {
                        self._resolve(response);
                    });
                }
            },

            _resolve: function (response) {
                if (this._state !== DONE_COMPLETE_STATE) {
                    forEach(this._doneCallbacks, function (fn) {
                        fn(response);
                    });
                    this._doneCallbacks.length = 0;
                    this._state = DONE_COMPLETE_STATE;
                }
            }
        };

        return AnimateRunner;
    }];

    var $$AnimationProvider = ['$animateProvider', function ($animateProvider) {
        var NG_ANIMATE_REF_ATTR = 'ng-animate-ref';

        var drivers = this.drivers = [];

        var RUNNER_STORAGE_KEY = '$$animationRunner';

        function setRunner(element, runner) {
            element.data(RUNNER_STORAGE_KEY, runner);
        }

        function removeRunner(element) {
            element.removeData(RUNNER_STORAGE_KEY);
        }

        function getRunner(element) {
            return element.data(RUNNER_STORAGE_KEY);
        }

        this.$get = ['$$jqLite', '$rootScope', '$injector', '$$AnimateRunner', '$$rAFScheduler',
             function ($$jqLite, $rootScope, $injector, $$AnimateRunner, $$rAFScheduler) {

                 var animationQueue = [];
                 var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);

                 var totalPendingClassBasedAnimations = 0;
                 var totalActiveClassBasedAnimations = 0;
                 var classBasedAnimationsQueue = [];

                 // TODO(matsko): document the signature in a better way
                 return function (element, event, options) {
                     options = prepareAnimationOptions(options);
                     var isStructural = ['enter', 'move', 'leave'].indexOf(event) >= 0;

                     // there is no animation at the current moment, however
                     // these runner methods will get later updated with the
                     // methods leading into the driver's end/cancel methods
                     // for now they just stop the animation from starting
                     var runner = new $$AnimateRunner({
                         end: function () { close(); },
                         cancel: function () { close(true); }
                     });

                     if (!drivers.length) {
                         close();
                         return runner;
                     }

                     setRunner(element, runner);

                     var classes = mergeClasses(element.attr('class'), mergeClasses(options.addClass, options.removeClass));
                     var tempClasses = options.tempClasses;
                     if (tempClasses) {
                         classes += ' ' + tempClasses;
                         options.tempClasses = null;
                     }

                     var classBasedIndex;
                     if (!isStructural) {
                         classBasedIndex = totalPendingClassBasedAnimations;
                         totalPendingClassBasedAnimations += 1;
                     }

                     animationQueue.push({
                         // this data is used by the postDigest code and passed into
                         // the driver step function
                         element: element,
                         classes: classes,
                         event: event,
                         classBasedIndex: classBasedIndex,
                         structural: isStructural,
                         options: options,
                         beforeStart: beforeStart,
                         close: close
                     });

                     element.on('$destroy', handleDestroyedElement);

                     // we only want there to be one function called within the post digest
                     // block. This way we can group animations for all the animations that
                     // were apart of the same postDigest flush call.
                     if (animationQueue.length > 1) return runner;

                     $rootScope.$$postDigest(function () {
                         totalActiveClassBasedAnimations = totalPendingClassBasedAnimations;
                         totalPendingClassBasedAnimations = 0;
                         classBasedAnimationsQueue.length = 0;

                         var animations = [];
                         forEach(animationQueue, function (entry) {
                             // the element was destroyed early on which removed the runner
                             // form its storage. This means we can't animate this element
                             // at all and it already has been closed due to destruction.
                             if (getRunner(entry.element)) {
                                 animations.push(entry);
                             }
                         });

                         // now any future animations will be in another postDigest
                         animationQueue.length = 0;

                         forEach(groupAnimations(animations), function (animationEntry) {
                             if (animationEntry.structural) {
                                 triggerAnimationStart();
                             } else {
                                 classBasedAnimationsQueue.push({
                                     node: getDomNode(animationEntry.element),
                                     fn: triggerAnimationStart
                                 });

                                 if (animationEntry.classBasedIndex === totalActiveClassBasedAnimations - 1) {
                                     // we need to sort each of the animations in order of parent to child
                                     // relationships. This ensures that the child classes are applied at the
                                     // right time.
                                     classBasedAnimationsQueue = classBasedAnimationsQueue.sort(function (a, b) {
                                         return b.node.contains(a.node);
                                     }).map(function (entry) {
                                         return entry.fn;
                                     });

                                     $$rAFScheduler(classBasedAnimationsQueue);
                                 }
                             }

                             function triggerAnimationStart() {
                                 // it's important that we apply the `ng-animate` CSS class and the
                                 // temporary classes before we do any driver invoking since these
                                 // CSS classes may be required for proper CSS detection.
                                 animationEntry.beforeStart();

                                 var startAnimationFn, closeFn = animationEntry.close;

                                 // in the event that the element was removed before the digest runs or
                                 // during the RAF sequencing then we should not trigger the animation.
                                 var targetElement = animationEntry.anchors
                                     ? (animationEntry.from.element || animationEntry.to.element)
                                     : animationEntry.element;

                                 if (getRunner(targetElement)) {
                                     var operation = invokeFirstDriver(animationEntry);
                                     if (operation) {
                                         startAnimationFn = operation.start;
                                     }
                                 }

                                 if (!startAnimationFn) {
                                     closeFn();
                                 } else {
                                     var animationRunner = startAnimationFn();
                                     animationRunner.done(function (status) {
                                         closeFn(!status);
                                     });
                                     updateAnimationRunners(animationEntry, animationRunner);
                                 }
                             }
                         });
                     });

                     return runner;

                     // TODO(matsko): change to reference nodes
                     function getAnchorNodes(node) {
                         var SELECTOR = '[' + NG_ANIMATE_REF_ATTR + ']';
                         var items = node.hasAttribute(NG_ANIMATE_REF_ATTR)
                               ? [node]
                               : node.querySelectorAll(SELECTOR);
                         var anchors = [];
                         forEach(items, function (node) {
                             var attr = node.getAttribute(NG_ANIMATE_REF_ATTR);
                             if (attr && attr.length) {
                                 anchors.push(node);
                             }
                         });
                         return anchors;
                     }

                     function groupAnimations(animations) {
                         var preparedAnimations = [];
                         var refLookup = {};
                         forEach(animations, function (animation, index) {
                             var element = animation.element;
                             var node = getDomNode(element);
                             var event = animation.event;
                             var enterOrMove = ['enter', 'move'].indexOf(event) >= 0;
                             var anchorNodes = animation.structural ? getAnchorNodes(node) : [];

                             if (anchorNodes.length) {
                                 var direction = enterOrMove ? 'to' : 'from';

                                 forEach(anchorNodes, function (anchor) {
                                     var key = anchor.getAttribute(NG_ANIMATE_REF_ATTR);
                                     refLookup[key] = refLookup[key] || {};
                                     refLookup[key][direction] = {
                                         animationID: index,
                                         element: jqLite(anchor)
                                     };
                                 });
                             } else {
                                 preparedAnimations.push(animation);
                             }
                         });

                         var usedIndicesLookup = {};
                         var anchorGroups = {};
                         forEach(refLookup, function (operations, key) {
                             var from = operations.from;
                             var to = operations.to;

                             if (!from || !to) {
                                 // only one of these is set therefore we can't have an
                                 // anchor animation since all three pieces are required
                                 var index = from ? from.animationID : to.animationID;
                                 var indexKey = index.toString();
                                 if (!usedIndicesLookup[indexKey]) {
                                     usedIndicesLookup[indexKey] = true;
                                     preparedAnimations.push(animations[index]);
                                 }
                                 return;
                             }

                             var fromAnimation = animations[from.animationID];
                             var toAnimation = animations[to.animationID];
                             var lookupKey = from.animationID.toString();
                             if (!anchorGroups[lookupKey]) {
                                 var group = anchorGroups[lookupKey] = {
                                     structural: true,
                                     beforeStart: function () {
                                         fromAnimation.beforeStart();
                                         toAnimation.beforeStart();
                                     },
                                     close: function () {
                                         fromAnimation.close();
                                         toAnimation.close();
                                     },
                                     classes: cssClassesIntersection(fromAnimation.classes, toAnimation.classes),
                                     from: fromAnimation,
                                     to: toAnimation,
                                     anchors: [] // TODO(matsko): change to reference nodes
                                 };

                                 // the anchor animations require that the from and to elements both have at least
                                 // one shared CSS class which effictively marries the two elements together to use
                                 // the same animation driver and to properly sequence the anchor animation.
                                 if (group.classes.length) {
                                     preparedAnimations.push(group);
                                 } else {
                                     preparedAnimations.push(fromAnimation);
                                     preparedAnimations.push(toAnimation);
                                 }
                             }

                             anchorGroups[lookupKey].anchors.push({
                                 'out': from.element, 'in': to.element
                             });
                         });

                         return preparedAnimations;
                     }

                     function cssClassesIntersection(a, b) {
                         a = a.split(' ');
                         b = b.split(' ');
                         var matches = [];

                         for (var i = 0; i < a.length; i++) {
                             var aa = a[i];
                             if (aa.substring(0, 3) === 'ng-') continue;

                             for (var j = 0; j < b.length; j++) {
                                 if (aa === b[j]) {
                                     matches.push(aa);
                                     break;
                                 }
                             }
                         }

                         return matches.join(' ');
                     }

                     function invokeFirstDriver(animationDetails) {
                         // we loop in reverse order since the more general drivers (like CSS and JS)
                         // may attempt more elements, but custom drivers are more particular
                         for (var i = drivers.length - 1; i >= 0; i--) {
                             var driverName = drivers[i];
                             if (!$injector.has(driverName)) continue; // TODO(matsko): remove this check

                             var factory = $injector.get(driverName);
                             var driver = factory(animationDetails);
                             if (driver) {
                                 return driver;
                             }
                         }
                     }

                     function beforeStart() {
                         element.addClass(NG_ANIMATE_CLASSNAME);
                         if (tempClasses) {
                             $$jqLite.addClass(element, tempClasses);
                         }
                     }

                     function updateAnimationRunners(animation, newRunner) {
                         if (animation.from && animation.to) {
                             update(animation.from.element);
                             update(animation.to.element);
                         } else {
                             update(animation.element);
                         }

                         function update(element) {
                             getRunner(element).setHost(newRunner);
                         }
                     }

                     function handleDestroyedElement() {
                         var runner = getRunner(element);
                         if (runner && (event !== 'leave' || !options.$$domOperationFired)) {
                             runner.end();
                         }
                     }

                     function close(rejected) { // jshint ignore:line
                         element.off('$destroy', handleDestroyedElement);
                         removeRunner(element);

                         applyAnimationClasses(element, options);
                         applyAnimationStyles(element, options);
                         options.domOperation();

                         if (tempClasses) {
                             $$jqLite.removeClass(element, tempClasses);
                         }

                         element.removeClass(NG_ANIMATE_CLASSNAME);
                         runner.complete(!rejected);
                     }
                 };
             }];
    }];

    /* global angularAnimateModule: true,
    
       $$rAFMutexFactory,
       $$rAFSchedulerFactory,
       $$AnimateChildrenDirective,
       $$AnimateRunnerFactory,
       $$AnimateQueueProvider,
       $$AnimationProvider,
       $AnimateCssProvider,
       $$AnimateCssDriverProvider,
       $$AnimateJsProvider,
       $$AnimateJsDriverProvider,
    */

    /**
     * @ngdoc module
     * @name ngAnimate
     * @description
     *
     * The `ngAnimate` module provides support for CSS-based animations (keyframes and transitions) as well as JavaScript-based animations via
     * callback hooks. Animations are not enabled by default, however, by including `ngAnimate` then the animation hooks are enabled for an Angular app.
     *
     * <div doc-module-components="ngAnimate"></div>
     *
     * # Usage
     * Simply put, there are two ways to make use of animations when ngAnimate is used: by using **CSS** and **JavaScript**. The former works purely based
     * using CSS (by using matching CSS selectors/styles) and the latter triggers animations that are registered via `module.animation()`. For
     * both CSS and JS animations the sole requirement is to have a matching `CSS class` that exists both in the registered animation and within
     * the HTML element that the animation will be triggered on.
     *
     * ## Directive Support
     * The following directives are "animation aware":
     *
     * | Directive                                                                                                | Supported Animations                                                     |
     * |----------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------|
     * | {@link ng.directive:ngRepeat#animations ngRepeat}                                                        | enter, leave and move                                                    |
     * | {@link ngRoute.directive:ngView#animations ngView}                                                       | enter and leave                                                          |
     * | {@link ng.directive:ngInclude#animations ngInclude}                                                      | enter and leave                                                          |
     * | {@link ng.directive:ngSwitch#animations ngSwitch}                                                        | enter and leave                                                          |
     * | {@link ng.directive:ngIf#animations ngIf}                                                                | enter and leave                                                          |
     * | {@link ng.directive:ngClass#animations ngClass}                                                          | add and remove (the CSS class(es) present)                               |
     * | {@link ng.directive:ngShow#animations ngShow} & {@link ng.directive:ngHide#animations ngHide}            | add and remove (the ng-hide class value)                                 |
     * | {@link ng.directive:form#animation-hooks form} & {@link ng.directive:ngModel#animation-hooks ngModel}    | add and remove (dirty, pristine, valid, invalid & all other validations) |
     * | {@link module:ngMessages#animations ngMessages}                                                          | add and remove (ng-active & ng-inactive)                                 |
     * | {@link module:ngMessages#animations ngMessage}                                                           | enter and leave                                                          |
     *
     * (More information can be found by visiting each the documentation associated with each directive.)
     *
     * ## CSS-based Animations
     *
     * CSS-based animations with ngAnimate are unique since they require no JavaScript code at all. By using a CSS class that we reference between our HTML
     * and CSS code we can create an animation that will be picked up by Angular when an the underlying directive performs an operation.
     *
     * The example below shows how an `enter` animation can be made possible on a element using `ng-if`:
     *
     * ```html
     * <div ng-if="bool" class="fade">
     *    Fade me in out
     * </div>
     * <button ng-click="bool=true">Fade In!</button>
     * <button ng-click="bool=false">Fade Out!</button>
     * ```
     *
     * Notice the CSS class **fade**? We can now create the CSS transition code that references this class:
     *
     * ```css
     * /&#42; The starting CSS styles for the enter animation &#42;/
     * .fade.ng-enter {
     *   transition:0.5s linear all;
     *   opacity:0;
     * }
     *
     * /&#42; The starting CSS styles for the enter animation &#42;/
     * .fade.ng-enter.ng-enter-active {
     *   opacity:1;
     * }
     * ```
     *
     * The key thing to remember here is that, depending on the animation event (which each of the directives above trigger depending on what's going on) two
     * generated CSS classes will be applied to the element; in the example above we have `.ng-enter` and `.ng-enter-active`. For CSS transitions, the transition
     * code **must** be defined within the starting CSS class (in this case `.ng-enter`). The destination class is what the transition will animate towards.
     *
     * If for example we wanted to create animations for `leave` and `move` (ngRepeat triggers move) then we can do so using the same CSS naming conventions:
     *
     * ```css
     * /&#42; now the element will fade out before it is removed from the DOM &#42;/
     * .fade.ng-leave {
     *   transition:0.5s linear all;
     *   opacity:1;
     * }
     * .fade.ng-leave.ng-leave-active {
     *   opacity:0;
     * }
     * ```
     *
     * We can also make use of **CSS Keyframes** by referencing the keyframe animation within the starting CSS class:
     *
     * ```css
     * /&#42; there is no need to define anything inside of the destination
     * CSS class since the keyframe will take charge of the animation &#42;/
     * .fade.ng-leave {
     *   animation: my_fade_animation 0.5s linear;
     *   -webkit-animation: my_fade_animation 0.5s linear;
     * }
     *
     * @keyframes my_fade_animation {
     *   from { opacity:1; }
     *   to { opacity:0; }
     * }
     *
     * @-webkit-keyframes my_fade_animation {
     *   from { opacity:1; }
     *   to { opacity:0; }
     * }
     * ```
     *
     * Feel free also mix transitions and keyframes together as well as any other CSS classes on the same element.
     *
     * ### CSS Class-based Animations
     *
     * Class-based animations (animations that are triggered via `ngClass`, `ngShow`, `ngHide` and some other directives) have a slightly different
     * naming convention. Class-based animations are basic enough that a standard transition or keyframe can be referenced on the class being added
     * and removed.
     *
     * For example if we wanted to do a CSS animation for `ngHide` then we place an animation on the `.ng-hide` CSS class:
     *
     * ```html
     * <div ng-show="bool" class="fade">
     *   Show and hide me
     * </div>
     * <button ng-click="bool=true">Toggle</button>
     *
     * <style>
     * .fade.ng-hide {
     *   transition:0.5s linear all;
     *   opacity:0;
     * }
     * </style>
     * ```
     *
     * All that is going on here with ngShow/ngHide behind the scenes is the `.ng-hide` class is added/removed (when the hidden state is valid). Since
     * ngShow and ngHide are animation aware then we can match up a transition and ngAnimate handles the rest.
     *
     * In addition the addition and removal of the CSS class, ngAnimate also provides two helper methods that we can use to further decorate the animation
     * with CSS styles.
     *
     * ```html
     * <div ng-class="{on:onOff}" class="highlight">
     *   Highlight this box
     * </div>
     * <button ng-click="onOff=!onOff">Toggle</button>
     *
     * <style>
     * .highlight {
     *   transition:0.5s linear all;
     * }
     * .highlight.on-add {
     *   background:white;
     * }
     * .highlight.on {
     *   background:yellow;
     * }
     * .highlight.on-remove {
     *   background:black;
     * }
     * </style>
     * ```
     *
     * We can also make use of CSS keyframes by placing them within the CSS classes.
     *
     *
     * ### CSS Staggering Animations
     * A Staggering animation is a collection of animations that are issued with a slight delay in between each successive operation resulting in a
     * curtain-like effect. The ngAnimate module (versions >=1.2) supports staggering animations and the stagger effect can be
     * performed by creating a **ng-EVENT-stagger** CSS class and attaching that class to the base CSS class used for
     * the animation. The style property expected within the stagger class can either be a **transition-delay** or an
     * **animation-delay** property (or both if your animation contains both transitions and keyframe animations).
     *
     * ```css
     * .my-animation.ng-enter {
     *   /&#42; standard transition code &#42;/
     *   transition: 1s linear all;
     *   opacity:0;
     * }
     * .my-animation.ng-enter-stagger {
     *   /&#42; this will have a 100ms delay between each successive leave animation &#42;/
     *   transition-delay: 0.1s;
     *
     *   /&#42; in case the stagger doesn't work then the duration value
     *    must be set to 0 to avoid an accidental CSS inheritance &#42;/
     *   transition-duration: 0s;
     * }
     * .my-animation.ng-enter.ng-enter-active {
     *   /&#42; standard transition styles &#42;/
     *   opacity:1;
     * }
     * ```
     *
     * Staggering animations work by default in ngRepeat (so long as the CSS class is defined). Outside of ngRepeat, to use staggering animations
     * on your own, they can be triggered by firing multiple calls to the same event on $animate. However, the restrictions surrounding this
     * are that each of the elements must have the same CSS className value as well as the same parent element. A stagger operation
     * will also be reset if one or more animation frames have passed since the multiple calls to `$animate` were fired.
     *
     * The following code will issue the **ng-leave-stagger** event on the element provided:
     *
     * ```js
     * var kids = parent.children();
     *
     * $animate.leave(kids[0]); //stagger index=0
     * $animate.leave(kids[1]); //stagger index=1
     * $animate.leave(kids[2]); //stagger index=2
     * $animate.leave(kids[3]); //stagger index=3
     * $animate.leave(kids[4]); //stagger index=4
     *
     * window.requestAnimationFrame(function() {
     *   //stagger has reset itself
     *   $animate.leave(kids[5]); //stagger index=0
     *   $animate.leave(kids[6]); //stagger index=1
     *
     *   $scope.$digest();
     * });
     * ```
     *
     * Stagger animations are currently only supported within CSS-defined animations.
     *
     * ### The `ng-animate` CSS class
     *
     * When ngAnimate is animating an element it will apply the `ng-animate` CSS class to the element for the duration of the animation.
     * This is a temporary CSS class and it will be removed once the animation is over (for both JavaScript and CSS-based animations).
     *
     * Therefore, animations can be applied to an element using this temporary class directly via CSS.
     *
     * ```css
     * .zipper.ng-animate {
     *   transition:0.5s linear all;
     * }
     * .zipper.ng-enter {
     *   opacity:0;
     * }
     * .zipper.ng-enter.ng-enter-active {
     *   opacity:1;
     * }
     * .zipper.ng-leave {
     *   opacity:1;
     * }
     * .zipper.ng-leave.ng-leave-active {
     *   opacity:0;
     * }
     * ```
     *
     * (Note that the `ng-animate` CSS class is reserved and it cannot be applied on an element directly since ngAnimate will always remove
     * the CSS class once an animation has completed.)
     *
     *
     * ## JavaScript-based Animations
     *
     * ngAnimate also allows for animations to be consumed by JavaScript code. The approach is similar to CSS-based animations (where there is a shared
     * CSS class that is referenced in our HTML code) but in addition we need to register the JavaScript animation on the module. By making use of the
     * `module.animation()` module function we can register the ainmation.
     *
     * Let's see an example of a enter/leave animation using `ngRepeat`:
     *
     * ```html
     * <div ng-repeat="item in items" class="slide">
     *   {{ item }}
     * </div>
     * ```
     *
     * See the **slide** CSS class? Let's use that class to define an animation that we'll structure in our module code by using `module.animation`:
     *
     * ```js
     * myModule.animation('.slide', [function() {
     *   return {
     *     // make note that other events (like addClass/removeClass)
     *     // have different function input parameters
     *     enter: function(element, doneFn) {
     *       jQuery(element).fadeIn(1000, doneFn);
     *
     *       // remember to call doneFn so that angular
     *       // knows that the animation has concluded
     *     },
     *
     *     move: function(element, doneFn) {
     *       jQuery(element).fadeIn(1000, doneFn);
     *     },
     *
     *     leave: function(element, doneFn) {
     *       jQuery(element).fadeOut(1000, doneFn);
     *     }
     *   }
     * }]
     * ```
     *
     * The nice thing about JS-based animations is that we can inject other services and make use of advanced animation libraries such as
     * greensock.js and velocity.js.
     *
     * If our animation code class-based (meaning that something like `ngClass`, `ngHide` and `ngShow` triggers it) then we can still define
     * our animations inside of the same registered animation, however, the function input arguments are a bit different:
     *
     * ```html
     * <div ng-class="color" class="colorful">
     *   this box is moody
     * </div>
     * <button ng-click="color='red'">Change to red</button>
     * <button ng-click="color='blue'">Change to blue</button>
     * <button ng-click="color='green'">Change to green</button>
     * ```
     *
     * ```js
     * myModule.animation('.colorful', [function() {
     *   return {
     *     addClass: function(element, className, doneFn) {
     *       // do some cool animation and call the doneFn
     *     },
     *     removeClass: function(element, className, doneFn) {
     *       // do some cool animation and call the doneFn
     *     },
     *     setClass: function(element, addedClass, removedClass, doneFn) {
     *       // do some cool animation and call the doneFn
     *     }
     *   }
     * }]
     * ```
     *
     * ## CSS + JS Animations Together
     *
     * AngularJS 1.4 and higher has taken steps to make the amalgamation of CSS and JS animations more flexible. However, unlike earlier versions of Angular,
     * defining CSS and JS animations to work off of the same CSS class will not work anymore. Therefore example below will only result in **JS animations taking
     * charge of the animation**:
     *
     * ```html
     * <div ng-if="bool" class="slide">
     *   Slide in and out
     * </div>
     * ```
     *
     * ```js
     * myModule.animation('.slide', [function() {
     *   return {
     *     enter: function(element, doneFn) {
     *       jQuery(element).slideIn(1000, doneFn);
     *     }
     *   }
     * }]
     * ```
     *
     * ```css
     * .slide.ng-enter {
     *   transition:0.5s linear all;
     *   transform:translateY(-100px);
     * }
     * .slide.ng-enter.ng-enter-active {
     *   transform:translateY(0);
     * }
     * ```
     *
     * Does this mean that CSS and JS animations cannot be used together? Do JS-based animations always have higher priority? We can suppliment for the
     * lack of CSS animations by making use of the `$animateCss` service to trigger our own tweaked-out, CSS-based animations directly from
     * our own JS-based animation code:
     *
     * ```js
     * myModule.animation('.slide', ['$animateCss', function($animateCss) {
     *   return {
     *     enter: function(element, doneFn) {
    *        // this will trigger `.slide.ng-enter` and `.slide.ng-enter-active`.
     *       var runner = $animateCss(element, {
     *         event: 'enter',
     *         structural: true
     *       }).start();
    *        runner.done(doneFn);
     *     }
     *   }
     * }]
     * ```
     *
     * The nice thing here is that we can save bandwidth by sticking to our CSS-based animation code and we don't need to rely on a 3rd-party animation framework.
     *
     * The `$animateCss` service is very powerful since we can feed in all kinds of extra properties that will be evaluated and fed into a CSS transition or
     * keyframe animation. For example if we wanted to animate the height of an element while adding and removing classes then we can do so by providing that
     * data into `$animateCss` directly:
     *
     * ```js
     * myModule.animation('.slide', ['$animateCss', function($animateCss) {
     *   return {
     *     enter: function(element, doneFn) {
     *       var runner = $animateCss(element, {
     *         event: 'enter',
     *         addClass: 'maroon-setting',
     *         from: { height:0 },
     *         to: { height: 200 }
     *       }).start();
     *
     *       runner.done(doneFn);
     *     }
     *   }
     * }]
     * ```
     *
     * Now we can fill in the rest via our transition CSS code:
     *
     * ```css
     * /&#42; the transition tells ngAnimate to make the animation happen &#42;/
     * .slide.ng-enter { transition:0.5s linear all; }
     *
     * /&#42; this extra CSS class will be absorbed into the transition
     * since the $animateCss code is adding the class &#42;/
     * .maroon-setting { background:red; }
     * ```
     *
     * And `$animateCss` will figure out the rest. Just make sure to have the `done()` callback fire the `doneFn` function to signal when the animation is over.
     *
     * To learn more about what's possible be sure to visit the {@link ngAnimate.$animateCss $animateCss service}.
     *
     * ## Animation Anchoring (via `ng-animate-ref`)
     *
     * ngAnimate in AngularJS 1.4 comes packed with the ability to cross-animate elements between
     * structural areas of an application (like views) by pairing up elements using an attribute
     * called `ng-animate-ref`.
     *
     * Let's say for example we have two views that are managed by `ng-view` and we want to show
     * that there is a relationship between two components situated in within these views. By using the
     * `ng-animate-ref` attribute we can identify that the two components are paired together and we
     * can then attach an animation, which is triggered when the view changes.
     *
     * Say for example we have the following template code:
     *
     * ```html
     * <!-- index.html -->
     * <div ng-view class="view-animation">
     * </div>
     *
     * <!-- home.html -->
     * <a href="#/banner-page">
     *   <img src="./banner.jpg" class="banner" ng-animate-ref="banner">
     * </a>
     *
     * <!-- banner-page.html -->
     * <img src="./banner.jpg" class="banner" ng-animate-ref="banner">
     * ```
     *
     * Now, when the view changes (once the link is clicked), ngAnimate will examine the
     * HTML contents to see if there is a match reference between any components in the view
     * that is leaving and the view that is entering. It will scan both the view which is being
     * removed (leave) and inserted (enter) to see if there are any paired DOM elements that
     * contain a matching ref value.
     *
     * The two images match since they share the same ref value. ngAnimate will now create a
     * transport element (which is a clone of the first image element) and it will then attempt
     * to animate to the position of the second image element in the next view. For the animation to
     * work a special CSS class called `ng-anchor` will be added to the transported element.
     *
     * We can now attach a transition onto the `.banner.ng-anchor` CSS class and then
     * ngAnimate will handle the entire transition for us as well as the addition and removal of
     * any changes of CSS classes between the elements:
     *
     * ```css
     * .banner.ng-anchor {
     *   /&#42; this animation will last for 1 second since there are
     *          two phases to the animation (an `in` and an `out` phase) &#42;/
     *   transition:0.5s linear all;
     * }
     * ```
     *
     * We also **must** include animations for the views that are being entered and removed
     * (otherwise anchoring wouldn't be possible since the new view would be inserted right away).
     *
     * ```css
     * .view-animation.ng-enter, .view-animation.ng-leave {
     *   transition:0.5s linear all;
     *   position:fixed;
     *   left:0;
     *   top:0;
     *   width:100%;
     * }
     * .view-animation.ng-enter {
     *   transform:translateX(100%);
     * }
     * .view-animation.ng-leave,
     * .view-animation.ng-enter.ng-enter-active {
     *   transform:translateX(0%);
     * }
     * .view-animation.ng-leave.ng-leave-active {
     *   transform:translateX(-100%);
     * }
     * ```
     *
     * Now we can jump back to the anchor animation. When the animation happens, there are two stages that occur:
     * an `out` and an `in` stage. The `out` stage happens first and that is when the element is animated away
     * from its origin. Once that animation is over then the `in` stage occurs which animates the
     * element to its destination. The reason why there are two animations is to give enough time
     * for the enter animation on the new element to be ready.
     *
     * The example above sets up a transition for both the in and out phases, but we can also target the out or
     * in phases directly via `ng-anchor-out` and `ng-anchor-in`.
     *
     * ```css
     * .banner.ng-anchor-out {
     *   transition: 0.5s linear all;
     *
     *   /&#42; the scale will be applied during the out animation,
     *          but will be animated away when the in animation runs &#42;/
     *   transform: scale(1.2);
     * }
     *
     * .banner.ng-anchor-in {
     *   transition: 1s linear all;
     * }
     * ```
     *
     *
     *
     *
     * ### Anchoring Demo
     *
      <example module="anchoringExample"
               name="anchoringExample"
               id="anchoringExample"
               deps="angular-animate.js;angular-route.js"
               animations="true">
        <file name="index.html">
          <a href="#/">Home</a>
          <hr />
          <div class="view-container">
            <div ng-view class="view"></div>
          </div>
        </file>
        <file name="script.js">
          angular.module('anchoringExample', ['ngAnimate', 'ngRoute'])
            .config(['$routeProvider', function($routeProvider) {
              $routeProvider.when('/', {
                templateUrl: 'home.html',
                controller: 'HomeController as home'
              });
              $routeProvider.when('/profile/:id', {
                templateUrl: 'profile.html',
                controller: 'ProfileController as profile'
              });
            }])
            .run(['$rootScope', function($rootScope) {
              $rootScope.records = [
                { id:1, title: "Miss Beulah Roob" },
                { id:2, title: "Trent Morissette" },
                { id:3, title: "Miss Ava Pouros" },
                { id:4, title: "Rod Pouros" },
                { id:5, title: "Abdul Rice" },
                { id:6, title: "Laurie Rutherford Sr." },
                { id:7, title: "Nakia McLaughlin" },
                { id:8, title: "Jordon Blanda DVM" },
                { id:9, title: "Rhoda Hand" },
                { id:10, title: "Alexandrea Sauer" }
              ];
            }])
            .controller('HomeController', [function() {
              //empty
            }])
            .controller('ProfileController', ['$rootScope', '$routeParams', function($rootScope, $routeParams) {
              var index = parseInt($routeParams.id, 10);
              var record = $rootScope.records[index - 1];
    
              this.title = record.title;
              this.id = record.id;
            }]);
        </file>
        <file name="home.html">
          <h2>Welcome to the home page</h1>
          <p>Please click on an element</p>
          <a class="record"
             ng-href="#/profile/{{ record.id }}"
             ng-animate-ref="{{ record.id }}"
             ng-repeat="record in records">
            {{ record.title }}
          </a>
        </file>
        <file name="profile.html">
          <div class="profile record" ng-animate-ref="{{ profile.id }}">
            {{ profile.title }}
          </div>
        </file>
        <file name="animations.css">
          .record {
            display:block;
            font-size:20px;
          }
          .profile {
            background:black;
            color:white;
            font-size:100px;
          }
          .view-container {
            position:relative;
          }
          .view-container > .view.ng-animate {
            position:absolute;
            top:0;
            left:0;
            width:100%;
            min-height:500px;
          }
          .view.ng-enter, .view.ng-leave,
          .record.ng-anchor {
            transition:0.5s linear all;
          }
          .view.ng-enter {
            transform:translateX(100%);
          }
          .view.ng-enter.ng-enter-active, .view.ng-leave {
            transform:translateX(0%);
          }
          .view.ng-leave.ng-leave-active {
            transform:translateX(-100%);
          }
          .record.ng-anchor-out {
            background:red;
          }
        </file>
      </example>
     *
     * ### How is the element transported?
     *
     * When an anchor animation occurs, ngAnimate will clone the starting element and position it exactly where the starting
     * element is located on screen via absolute positioning. The cloned element will be placed inside of the root element
     * of the application (where ng-app was defined) and all of the CSS classes of the starting element will be applied. The
     * element will then animate into the `out` and `in` animations and will eventually reach the coordinates and match
     * the dimensions of the destination element. During the entire animation a CSS class of `.ng-animate-shim` will be applied
     * to both the starting and destination elements in order to hide them from being visible (the CSS styling for the class
     * is: `visibility:hidden`). Once the anchor reaches its destination then it will be removed and the destination element
     * will become visible since the shim class will be removed.
     *
     * ### How is the morphing handled?
     *
     * CSS Anchoring relies on transitions and keyframes and the internal code is intelligent enough to figure out
     * what CSS classes differ between the starting element and the destination element. These different CSS classes
     * will be added/removed on the anchor element and a transition will be applied (the transition that is provided
     * in the anchor class). Long story short, ngAnimate will figure out what classes to add and remove which will
     * make the transition of the element as smooth and automatic as possible. Be sure to use simple CSS classes that
     * do not rely on DOM nesting structure so that the anchor element appears the same as the starting element (since
     * the cloned element is placed inside of root element which is likely close to the body element).
     *
     * Note that if the root element is on the `<html>` element then the cloned node will be placed inside of body.
     *
     *
     * ## Using $animate in your directive code
     *
     * So far we've explored how to feed in animations into an Angular application, but how do we trigger animations within our own directives in our application?
     * By injecting the `$animate` service into our directive code, we can trigger structural and class-based hooks which can then be consumed by animations. Let's
     * imagine we have a greeting box that shows and hides itself when the data changes
     *
     * ```html
     * <greeting-box active="onOrOff">Hi there</greeting-box>
     * ```
     *
     * ```js
     * ngModule.directive('greetingBox', ['$animate', function($animate) {
     *   return function(scope, element, attrs) {
     *     attrs.$observe('active', function(value) {
     *       value ? $animate.addClass(element, 'on') ? $animate.removeClass(element, 'on');
     *     });
     *   });
     * }]);
     * ```
     *
     * Now the `on` CSS class is added and removed on the greeting box component. Now if we add a CSS class on top of the greeting box element
     * in our HTML code then we can trigger a CSS or JS animation to happen.
     *
     * ```css
     * /&#42; normally we would create a CSS class to reference on the element &#42;/
     * [greeting-box].on { transition:0.5s linear all; background:green; color:white; }
     * ```
     *
     * The `$animate` service contains a variety of other methods like `enter`, `leave`, `animate` and `setClass`. To learn more about what's
     * possible be sure to visit the {@link ng.$animate $animate service API page}.
     *
     *
     * ### Preventing Collisions With Third Party Libraries
     *
     * Some third-party frameworks place animation duration defaults across many element or className
     * selectors in order to make their code small and reuseable. This can lead to issues with ngAnimate, which
     * is expecting actual animations on these elements and has to wait for their completion.
     *
     * You can prevent this unwanted behavior by using a prefix on all your animation classes:
     *
     * ```css
     * /&#42; prefixed with animate- &#42;/
     * .animate-fade-add.animate-fade-add-active {
     *   transition:1s linear all;
     *   opacity:0;
     * }
     * ```
     *
     * You then configure `$animate` to enforce this prefix:
     *
     * ```js
     * $animateProvider.classNameFilter(/animate-/);
     * ```
     *
     * This also may provide your application with a speed boost since only specific elements containing CSS class prefix
     * will be evaluated for animation when any DOM changes occur in the application.
     *
     * ## Callbacks and Promises
     *
     * When `$animate` is called it returns a promise that can be used to capture when the animation has ended. Therefore if we were to trigger
     * an animation (within our directive code) then we can continue performing directive and scope related activities after the animation has
     * ended by chaining onto the returned promise that animation method returns.
     *
     * ```js
     * // somewhere within the depths of the directive
     * $animate.enter(element, parent).then(function() {
     *   //the animation has completed
     * });
     * ```
     *
     * (Note that earlier versions of Angular prior to v1.4 required the promise code to be wrapped using `$scope.$apply(...)`. This is not the case
     * anymore.)
     *
     * In addition to the animation promise, we can also make use of animation-related callbacks within our directives and controller code by registering
     * an event listener using the `$animate` service. Let's say for example that an animation was triggered on our view
     * routing controller to hook into that:
     *
     * ```js
     * ngModule.controller('HomePageController', ['$animate', function($animate) {
     *   $animate.on('enter', ngViewElement, function(element) {
     *     // the animation for this route has completed
     *   }]);
     * }])
     * ```
     *
     * (Note that you will need to trigger a digest within the callback to get angular to notice any scope-related changes.)
     */

    /**
     * @ngdoc service
     * @name $animate
     * @kind object
     *
     * @description
     * The ngAnimate `$animate` service documentation is the same for the core `$animate` service.
     *
     * Click here {@link ng.$animate $animate to learn more about animations with `$animate`}.
     */
    angular.module('ngAnimate', [])
      .directive('ngAnimateChildren', $$AnimateChildrenDirective)

      .factory('$$rAFMutex', $$rAFMutexFactory)
      .factory('$$rAFScheduler', $$rAFSchedulerFactory)

      .factory('$$AnimateRunner', $$AnimateRunnerFactory)

      .provider('$$animateQueue', $$AnimateQueueProvider)
      .provider('$$animation', $$AnimationProvider)

      .provider('$animateCss', $AnimateCssProvider)
      .provider('$$animateCssDriver', $$AnimateCssDriverProvider)

      .provider('$$animateJs', $$AnimateJsProvider)
      .provider('$$animateJsDriver', $$AnimateJsDriverProvider);


})(window, window.angular);
;

(function (window, angular, undefined) {
    'use strict';

    angular.module('ngBusy.interceptor', [])
        .provider('busyInterceptor', function () {

            this.$get = ['$rootScope', '$q', function ($rootScope, $q) {
                var _total = 0, _completed = 0;

                function complete() {
                    _total = _completed = 0;
                }

                function handleResponse(r) {
                    if (r.config.notBusy) return;

                    $rootScope.$broadcast('busy.end', { url: r.config.url, name: r.config.name, remaining: _total - ++_completed });
                    if (_completed >= _total) complete();
                }

                return {
                    outstanding: function () {
                        return _total - _completed;
                    },
                    'request': function (config) {
                        if (!config.notBusy) {
                            $rootScope.$broadcast('busy.begin', { url: config.url, name: config.name });
                            _total++;
                        }
                        return config || $q.when(config);
                    },
                    'response': function (response) {
                        handleResponse(response);
                        return response;
                    },
                    'responseError': function (rejection) {
                        handleResponse(rejection);
                        return $q.reject(rejection);
                    }
                };
            }];
        })
        .config(['$httpProvider', function ($httpProvider) {
            $httpProvider.interceptors.push('busyInterceptor');
        }]);

    // minimal: <button busy="Loading..." />
    // complete: <button busy="Loading..." busy-when-url="string" busy-when-name="string" busy-add-classes="string" busy-remove-classes="string" busy-disabled="bool" not-busy-when-url="string" not-busy-when-name="string" not-busy-add-classes="string" not-busy-remove-classes="string" not-busy-disabled="bool" />

    angular.module('ngBusy.busy', [])
        .directive('busy', ['$parse', '$timeout', function ($parse, $timeout) {
            return {
                restrict: 'A',
                tranclude: true,
                scope: {},
                controller: ['$scope', function ($scope) {
                    this.setBusyMessageElement = function (element) {
                        $scope.busyMessageElement = element;
                    }
                }],
                link: function (scope, element, attrs) {
                    var cookieSpinnerstatus;
                    attrs.$observe('busy', function (val) {
                        scope.busyMessage = val;
                    });

                    attrs.$observe('busyWhenUrl', function (val) {
                        scope.busyWhenUrl = val;
                    });
                    attrs.$observe('busyWhenName', function (val) {
                        scope.busyWhenName = val;
                    });
                    attrs.$observe('busyAddClasses', function (val) {
                        scope.busyAddClasses = val;
                    });
                    attrs.$observe('busyRemoveClasses', function (val) {
                        scope.busyRemoveClasses = val;
                    });
                    attrs.$observe('busyDisabled', function (val) {
                        var parsed = $parse(val)(scope);
                        scope.busyDisabled = angular.isDefined(parsed) ? parsed : true;
                    });

                    attrs.$observe('notBusyWhenUrl', function (val) {
                        scope.notBusyWhenUrl = val;
                    });
                    attrs.$observe('notBusyWhenName', function (val) {
                        scope.notBusyWhenName = val;
                    });
                    attrs.$observe('notBusyAddClasses', function (val) {
                        scope.notBusyAddClasses = val;
                    });
                    attrs.$observe('notBusyRemoveClasses', function (val) {
                        scope.notBusyRemoveClasses = val;
                    });
                    attrs.$observe('notBusyDisabled', function (val) {
                        var parsed = $parse(val)(scope);
                        scope.notBusyDisabled = angular.isDefined(parsed) ? parsed : false;
                    });

                    var setCookie = function (cname, cvalue) {
                        var d = new Date();
                        d.setTime(d.getTime() + (24 * 60 * 60 * 1000));
                        var expires = "expires=" + d.toUTCString();
                        document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
                    };

                    var getCookie = function (name) {
                        var value = "; " + document.cookie;
                        var parts = value.split("; " + name + "=");
                        if (parts.length == 2) return parts.pop().split(";").shift();
                    };

                    var getSupressSpinnerStatus = function () {
                        try {
                            cookieSpinnerstatus = getCookie('SuppressSpinner');
                        } catch (e) {
                            setCookie("SuppressSpinner", 'false');
                            //console.log("timeoutExtender exception : " + e);
                        }
                        return cookieSpinnerstatus;
                    };

                    scope.isBusyFor = function (config, begin) {
                        var key;
                        if (scope[(key = begin ? 'busyWhenName' : 'notBusyWhenName')]) return !!config.name && !!config.name.match(scope[key]);
                        else if (scope[(key = begin ? 'busyWhenUrl' : 'notBusyWhenUrl')]) return !!config.url && !!config.url.match(scope[key]);
                        else return begin === true || config.remaining <= 0;
                    };

                    scope.$on('busy.begin', function (evt, config) {
                        if (!scope.busy && scope.isBusyFor(config, true)) {
                            scope.originalContent = element.html();
                            if (scope.busyDisabled) $timeout(function () { element.attr('disabled', true); });
                            var msgElement = scope.busyMessageElement ? scope.busyMessageElement.clone() : null;
                            if (msgElement || scope.busyMessage) element.html('').append(msgElement || scope.busyMessage);


                            var shouldNotSpin = getSupressSpinnerStatus();
                            if (shouldNotSpin === undefined || shouldNotSpin === null
                              || shouldNotSpin == "" || shouldNotSpin == 'false') {
                                element.removeClass(scope.busyRemoveClasses).addClass(scope.busyAddClasses);
                                var loadSpinner = document.getElementById('spinnerLoader');
                                if (loadSpinner) {
                                    loadSpinner.setAttribute('tabindex', '0');
                                    loadSpinner.focus();
                                }
                            }

                            scope.busy = true;
                        }
                    });

                    scope.$on('busy.end', function (evt, config) {
                        if (scope.busy && scope.isBusyFor(config)) {
                            if (scope.originalContent) element.html(scope.originalContent);
                            element.attr('disabled', scope.notBusyDisabled === true);
                            var shouldNotSpin = getSupressSpinnerStatus();
                            if (shouldNotSpin === undefined || shouldNotSpin === null
                              || shouldNotSpin == "" || shouldNotSpin == 'false') {

                                element.removeClass(scope.notBusyRemoveClasses).addClass(scope.notBusyAddClasses);
                            }
                            else {
                                try {
                                    setCookie("SuppressSpinner", 'false');
                                } catch (e) {                                   
                                    //console.log("timeoutExtender exception : " + e);
                                }
                            }

                            scope.busy = false;
                        }
                    });
                }
            }
        }])
         .directive('busyMessage', function () {
             return {
                 restrict: 'AE',
                 transclude: true,
                 require: '^busy',
                 template: '',
                 replace: true,
                 compile: function (element, attr, transclude) {
                     // we're basically going to transclude the content, strip it, and set the busy message as the resulting transcluded HTML via the controller setBusyMessageElement function
                     return function link(scope, element, attr, busyCtrl) {
                         busyCtrl.setBusyMessageElement(transclude(scope, function () { }));
                     }
                 }
             }
         });

    angular.module('ngBusy', ['ngBusy.interceptor', 'ngBusy.busy']);
})(window, window.angular);;
/*!
 * angular-ui-mask
 * https://github.com/angular-ui/ui-mask
 * Version: 1.8.3 - 2016-03-30T21:12:43.955Z
 * License: MIT
 */


(function () { 
'use strict';
/*
 Attaches input mask onto input element
 */
angular.module('ui.mask', [])
        .value('uiMaskConfig', {
            maskDefinitions: {
                '9': /\d/,
                'A': /[a-zA-Z]/,
                '*': /[a-zA-Z0-9]/
            },
            clearOnBlur: true,
            clearOnBlurPlaceholder: false,
            escChar: '\\',
            eventsToHandle: ['input', 'keyup', 'click', 'focus'],
            addDefaultPlaceholder: true
        })
        .provider('uiMask.Config', function() {
            var options = {};

            this.maskDefinitions = function(maskDefinitions) {
                return options.maskDefinitions = maskDefinitions;
            };
            this.clearOnBlur = function(clearOnBlur) {
                return options.clearOnBlur = clearOnBlur;
            };
            this.clearOnBlurPlaceholder = function(clearOnBlurPlaceholder) {
                return options.clearOnBlurPlaceholder = clearOnBlurPlaceholder;
            };
            this.eventsToHandle = function(eventsToHandle) {
                return options.eventsToHandle = eventsToHandle;
            };
            this.addDefaultPlaceholder = function(addDefaultPlaceholder) {
                return options.addDefaultPlaceholder = addDefaultPlaceholder;
            };
            this.$get = ['uiMaskConfig', function(uiMaskConfig) {
                var tempOptions = uiMaskConfig;
                for(var prop in options) {
                    if (angular.isObject(options[prop]) && !angular.isArray(options[prop])) {
                        angular.extend(tempOptions[prop], options[prop]);
                    } else {
                        tempOptions[prop] = options[prop];
                    }
                }

                return tempOptions;
            }];
        })
        .directive('uiMask', ['uiMask.Config', function(maskConfig) {
                function isFocused (elem) {
                  return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
                }

                return {
                    priority: 100,
                    require: 'ngModel',
                    restrict: 'A',
                    compile: function uiMaskCompilingFunction() {
                        var options = maskConfig;

                        return function uiMaskLinkingFunction(scope, iElement, iAttrs, controller) {
                            var maskProcessed = false, eventsBound = false,
                                    maskCaretMap, maskPatterns, maskPlaceholder, maskComponents,
                                    // Minimum required length of the value to be considered valid
                                    minRequiredLength,
                                    value, valueMasked, isValid,
                                    // Vars for initializing/uninitializing
                                    originalPlaceholder = iAttrs.placeholder,
                                    originalMaxlength = iAttrs.maxlength,
                                    // Vars used exclusively in eventHandler()
                                    oldValue, oldValueUnmasked, oldCaretPosition, oldSelectionLength,
                                    // Used for communicating if a backspace operation should be allowed between
                                    // keydownHandler and eventHandler
                                    preventBackspace;

                            var originalIsEmpty = controller.$isEmpty;
	                        controller.$isEmpty = function(value) {
		                        if (maskProcessed) {
			                        return originalIsEmpty(unmaskValue(value || ''));
		                        } else {
			                        return originalIsEmpty(value);
		                        }
	                        };

                            function initialize(maskAttr) {
                                if (!angular.isDefined(maskAttr)) {
                                    return uninitialize();
                                }
                                processRawMask(maskAttr);
                                if (!maskProcessed) {
                                    return uninitialize();
                                }
                                initializeElement();
                                bindEventListeners();
                                return true;
                            }

                            function initPlaceholder(placeholderAttr) {
                                if ( ! placeholderAttr) {
                                    return;
                                }

                                maskPlaceholder = placeholderAttr;

                                // If the mask is processed, then we need to update the value
                                // but don't set the value if there is nothing entered into the element
                                // and there is a placeholder attribute on the element because that
                                // will only set the value as the blank maskPlaceholder
                                // and override the placeholder on the element
                                if (maskProcessed && !(iElement.val().length === 0 && angular.isDefined(iAttrs.placeholder))) {
                                    iElement.val(maskValue(unmaskValue(iElement.val())));
                                }
                            }

                            function initPlaceholderChar() {
                                return initialize(iAttrs.uiMask);
                            }

                            var modelViewValue = false;
                            iAttrs.$observe('modelViewValue', function(val) {
                                if (val === 'true') {
                                    modelViewValue = true;
                                }
                            });

                            function formatter(fromModelValue) {
                                if (!maskProcessed) {
                                    return fromModelValue;
                                }
                                value = unmaskValue(fromModelValue || '');
                                isValid = validateValue(value);
                                controller.$setValidity('mask', isValid);
                                return isValid && value.length ? maskValue(value) : undefined;
                            }

                            function parser(fromViewValue) {
                                if (!maskProcessed) {
                                    return fromViewValue;
                                }
                                value = unmaskValue(fromViewValue || '');
                                isValid = validateValue(value);
                                // We have to set viewValue manually as the reformatting of the input
                                // value performed by eventHandler() doesn't happen until after
                                // this parser is called, which causes what the user sees in the input
                                // to be out-of-sync with what the controller's $viewValue is set to.
                                controller.$viewValue = value.length ? maskValue(value) : '';
                                controller.$setValidity('mask', isValid);
                                if (isValid) {
                                    return modelViewValue ? controller.$viewValue : value;
                                } else {
                                    return undefined;
                                }
                            }

                            var linkOptions = {};

                            if (iAttrs.uiOptions) {
                                linkOptions = scope.$eval('[' + iAttrs.uiOptions + ']');
                                if (angular.isObject(linkOptions[0])) {
                                    // we can't use angular.copy nor angular.extend, they lack the power to do a deep merge
                                    linkOptions = (function(original, current) {
                                        for (var i in original) {
                                            if (Object.prototype.hasOwnProperty.call(original, i)) {
                                                if (current[i] === undefined) {
                                                    current[i] = angular.copy(original[i]);
                                                } else {
                                                    if (angular.isObject(current[i]) && !angular.isArray(current[i])) {
                                                        current[i] = angular.extend({}, original[i], current[i]);
                                                    }
                                                }
                                            }
                                        }
                                        return current;
                                    })(options, linkOptions[0]);
                                } else {
                                    linkOptions = options;  //gotta be a better way to do this..
                                }
                            } else {
                                linkOptions = options;
                            }

                            iAttrs.$observe('uiMask', initialize);
                            if (angular.isDefined(iAttrs.uiMaskPlaceholder)) {
                                iAttrs.$observe('uiMaskPlaceholder', initPlaceholder);
                            }
                            else {
                                iAttrs.$observe('placeholder', initPlaceholder);
                            }
                            if (angular.isDefined(iAttrs.uiMaskPlaceholderChar)) {
                                iAttrs.$observe('uiMaskPlaceholderChar', initPlaceholderChar);
                            }

                            controller.$formatters.unshift(formatter);
                            controller.$parsers.unshift(parser);

                            function uninitialize() {
                                maskProcessed = false;
                                unbindEventListeners();

                                if (angular.isDefined(originalPlaceholder)) {
                                    iElement.attr('placeholder', originalPlaceholder);
                                } else {
                                    iElement.removeAttr('placeholder');
                                }

                                if (angular.isDefined(originalMaxlength)) {
                                    iElement.attr('maxlength', originalMaxlength);
                                } else {
                                    iElement.removeAttr('maxlength');
                                }

                                iElement.val(controller.$modelValue);
                                controller.$viewValue = controller.$modelValue;
                                return false;
                            }

                            function initializeElement() {
                                value = oldValueUnmasked = unmaskValue(controller.$modelValue || '');
                                valueMasked = oldValue = maskValue(value);
                                isValid = validateValue(value);
                                if (iAttrs.maxlength) { // Double maxlength to allow pasting new val at end of mask
                                    iElement.attr('maxlength', maskCaretMap[maskCaretMap.length - 1] * 2);
                                }
                                if ( ! originalPlaceholder && linkOptions.addDefaultPlaceholder) {
                                    iElement.attr('placeholder', maskPlaceholder);
                                }
                                var viewValue = controller.$modelValue;
                                var idx = controller.$formatters.length;
                                while(idx--) {
                                    viewValue = controller.$formatters[idx](viewValue);
                                }
                                controller.$viewValue = viewValue || '';
                                controller.$render();
                                // Not using $setViewValue so we don't clobber the model value and dirty the form
                                // without any kind of user interaction.
                            }

                            function bindEventListeners() {
                                if (eventsBound) {
                                    return;
                                }
                                iElement.bind('blur', blurHandler);
                                iElement.bind('mousedown mouseup', mouseDownUpHandler);
                                iElement.bind('keydown', keydownHandler);
                                iElement.bind(linkOptions.eventsToHandle.join(' '), eventHandler);
                                eventsBound = true;
                            }

                            function unbindEventListeners() {
                                if (!eventsBound) {
                                    return;
                                }
                                iElement.unbind('blur', blurHandler);
                                iElement.unbind('mousedown', mouseDownUpHandler);
                                iElement.unbind('mouseup', mouseDownUpHandler);
                                iElement.unbind('keydown', keydownHandler);
                                iElement.unbind('input', eventHandler);
                                iElement.unbind('keyup', eventHandler);
                                iElement.unbind('click', eventHandler);
                                iElement.unbind('focus', eventHandler);
                                eventsBound = false;
                            }

                            function validateValue(value) {
                                // Zero-length value validity is ngRequired's determination
                                return value.length ? value.length >= minRequiredLength : true;
                            }

                            function unmaskValue(value) {
                                var valueUnmasked = '',
                                    input = iElement[0],
                                    maskPatternsCopy = maskPatterns.slice(),
                                    selectionStart = oldCaretPosition,
                                    selectionEnd = selectionStart + getSelectionLength(input),
                                    valueOffset, valueDelta, tempValue = '';
                                // Preprocess by stripping mask components from value
                                value = value.toString();
                                valueOffset = 0;
                                valueDelta = value.length - maskPlaceholder.length;
                                angular.forEach(maskComponents, function(component) {
                                    var position = component.position;
                                    //Only try and replace the component if the component position is not within the selected range
                                    //If component was in selected range then it was removed with the user input so no need to try and remove that component
                                    if (!(position >= selectionStart && position < selectionEnd)) {
                                        if (position >= selectionStart) {
                                            position += valueDelta;
                                        }
                                        if (value.substring(position, position + component.value.length) === component.value) {
                                            tempValue += value.slice(valueOffset, position);// + value.slice(position + component.value.length);
                                            valueOffset = position + component.value.length;
                                        }
                                    }
                                });
                                value = tempValue + value.slice(valueOffset);
                                angular.forEach(value.split(''), function(chr) {
                                    if (maskPatternsCopy.length && maskPatternsCopy[0].test(chr)) {
                                        valueUnmasked += chr;
                                        maskPatternsCopy.shift();
                                    }
                                });

                                return valueUnmasked;
                            }

                            function maskValue(unmaskedValue) {
                                var valueMasked = '',
                                        maskCaretMapCopy = maskCaretMap.slice();

                                angular.forEach(maskPlaceholder.split(''), function(chr, i) {
                                    if (unmaskedValue.length && i === maskCaretMapCopy[0]) {
                                        valueMasked += unmaskedValue.charAt(0) || '_';
                                        unmaskedValue = unmaskedValue.substr(1);
                                        maskCaretMapCopy.shift();
                                    }
                                    else {
                                        valueMasked += chr;
                                    }
                                });
                                return valueMasked;
                            }

                            function getPlaceholderChar(i) {
                                var placeholder = angular.isDefined(iAttrs.uiMaskPlaceholder) ? iAttrs.uiMaskPlaceholder : iAttrs.placeholder,
                                    defaultPlaceholderChar;

                                if (angular.isDefined(placeholder) && placeholder[i]) {
                                    return placeholder[i];
                                } else {
                                    defaultPlaceholderChar = angular.isDefined(iAttrs.uiMaskPlaceholderChar) && iAttrs.uiMaskPlaceholderChar ? iAttrs.uiMaskPlaceholderChar : '_';
                                    return (defaultPlaceholderChar.toLowerCase() === 'space') ? ' ' : defaultPlaceholderChar[0];
                                }
                            }

                            // Generate array of mask components that will be stripped from a masked value
                            // before processing to prevent mask components from being added to the unmasked value.
                            // E.g., a mask pattern of '+7 9999' won't have the 7 bleed into the unmasked value.
                            function getMaskComponents() {
                                var maskPlaceholderChars = maskPlaceholder.split(''),
                                        maskPlaceholderCopy, components;

                                //maskCaretMap can have bad values if the input has the ui-mask attribute implemented as an obversable property, e.g. the demo page
                                if (maskCaretMap && !isNaN(maskCaretMap[0])) {
                                    //Instead of trying to manipulate the RegEx based on the placeholder characters
                                    //we can simply replace the placeholder characters based on the already built
                                    //maskCaretMap to underscores and leave the original working RegEx to get the proper
                                    //mask components
                                    angular.forEach(maskCaretMap, function(value) {
                                        maskPlaceholderChars[value] = '_';
                                    });
                                }
                                maskPlaceholderCopy = maskPlaceholderChars.join('');
                                components = maskPlaceholderCopy.replace(/[_]+/g, '_').split('_');
                                components = components.filter(function(s) {
                                    return s !== '';
                                });

                                // need a string search offset in cases where the mask contains multiple identical components
                                // E.g., a mask of 99.99.99-999.99
                                var offset = 0;
                                return components.map(function(c) {
                                    var componentPosition = maskPlaceholderCopy.indexOf(c, offset);
                                    offset = componentPosition + 1;
                                    return {
                                        value: c,
                                        position: componentPosition
                                    };
                                });
                            }

                            function processRawMask(mask) {
                                var characterCount = 0;

                                maskCaretMap = [];
                                maskPatterns = [];
                                maskPlaceholder = '';

                                if (angular.isString(mask)) {
                                    minRequiredLength = 0;

                                    var isOptional = false,
                                            numberOfOptionalCharacters = 0,
                                            splitMask = mask.split('');

                                    var inEscape = false;
                                    angular.forEach(splitMask, function(chr, i) {
                                        if (inEscape) {
                                            inEscape = false;
                                            maskPlaceholder += chr;
                                            characterCount++;
                                        }
                                        else if (linkOptions.escChar === chr) {
                                            inEscape = true;
                                        }
                                        else if (linkOptions.maskDefinitions[chr]) {
                                            maskCaretMap.push(characterCount);

                                            maskPlaceholder += getPlaceholderChar(i - numberOfOptionalCharacters);
                                            maskPatterns.push(linkOptions.maskDefinitions[chr]);

                                            characterCount++;
                                            if (!isOptional) {
                                                minRequiredLength++;
                                            }

                                            isOptional = false;
                                        }
                                        else if (chr === '?') {
                                            isOptional = true;
                                            numberOfOptionalCharacters++;
                                        }
                                        else {
                                            maskPlaceholder += chr;
                                            characterCount++;
                                        }
                                    });
                                }
                                // Caret position immediately following last position is valid.
                                maskCaretMap.push(maskCaretMap.slice().pop() + 1);

                                maskComponents = getMaskComponents();
                                maskProcessed = maskCaretMap.length > 1 ? true : false;
                            }

                            var prevValue = iElement.val();
                            function blurHandler() {
                                if (linkOptions.clearOnBlur || ((linkOptions.clearOnBlurPlaceholder) && (value.length === 0) && iAttrs.placeholder)) {
                                    oldCaretPosition = 0;
                                    oldSelectionLength = 0;
                                    if (!isValid || value.length === 0) {
                                        valueMasked = '';
                                        //iElement.val('');/*D-19925- commenting as part of defect as it is clearing value in case of any field error*/
                                        scope.$apply(function() {
                                            //only $setViewValue when not $pristine to avoid changing $pristine state.
                                            if (!controller.$pristine) {
                                                controller.$setViewValue('');
                                            }
                                        });
                                    }
                                }
                                //Check for different value and trigger change.
                                if (value !== prevValue) {
                                    triggerChangeEvent(iElement[0]);
                                }
                                prevValue = value;
                            }

                            function triggerChangeEvent(element) {
                                var change;
                                if (angular.isFunction(window.Event) && !element.fireEvent) {
                                    // modern browsers and Edge
                                    change = new Event('change', {
                                        view: window,
                                        bubbles: true,
                                        cancelable: false
                                    });
                                    element.dispatchEvent(change);
                                } else if ('createEvent' in document) {
                                    // older browsers
                                    change = document.createEvent('HTMLEvents');
                                    change.initEvent('change', false, true);
                                    element.dispatchEvent(change);
                                }
                                else if (element.fireEvent) {
                                    // IE <= 11
                                    element.fireEvent('onchange');
                                }
                            }

                            function mouseDownUpHandler(e) {
                                if (e.type === 'mousedown') {
                                    iElement.bind('mouseout', mouseoutHandler);
                                } else {
                                    iElement.unbind('mouseout', mouseoutHandler);
                                }
                            }

                            iElement.bind('mousedown mouseup', mouseDownUpHandler);

                            function mouseoutHandler() {
                                /*jshint validthis: true */
                                oldSelectionLength = getSelectionLength(this);
                                iElement.unbind('mouseout', mouseoutHandler);
                            }

                            function keydownHandler(e) {
                                /*jshint validthis: true */
                                var isKeyBackspace = e.which === 8,
                                    caretPos = getCaretPosition(this) - 1 || 0; //value in keydown is pre change so bump caret position back to simulate post change

                                if (isKeyBackspace) {
                                    while(caretPos >= 0) {
                                        if (isValidCaretPosition(caretPos)) {
                                            //re-adjust the caret position.
                                            //Increment to account for the initial decrement to simulate post change caret position
                                            setCaretPosition(this, caretPos + 1);
                                            break;
                                        }
                                        caretPos--;
                                    }
                                    preventBackspace = caretPos === -1;
                                }
                            }

                            function eventHandler(e) {
                                /*jshint validthis: true */
                                e = e || {};
                                // Allows more efficient minification
                                var eventWhich = e.which,
                                        eventType = e.type;

                                // Prevent shift and ctrl from mucking with old values
                                if (eventWhich === 16 || eventWhich === 91) {
                                    return;
                                }

                                var val = iElement.val(),
                                        valOld = oldValue,
                                        valMasked,
                                        valAltered = false,
                                        valUnmasked = unmaskValue(val),
                                        valUnmaskedOld = oldValueUnmasked,
                                        caretPos = getCaretPosition(this) || 0,
                                        caretPosOld = oldCaretPosition || 0,
                                        caretPosDelta = caretPos - caretPosOld,
                                        caretPosMin = maskCaretMap[0],
                                        caretPosMax = maskCaretMap[valUnmasked.length] || maskCaretMap.slice().shift(),
                                        selectionLenOld = oldSelectionLength || 0,
                                        isSelected = getSelectionLength(this) > 0,
                                        wasSelected = selectionLenOld > 0,
                                        // Case: Typing a character to overwrite a selection
                                        isAddition = (val.length > valOld.length) || (selectionLenOld && val.length > valOld.length - selectionLenOld),
                                        // Case: Delete and backspace behave identically on a selection
                                        isDeletion = (val.length < valOld.length) || (selectionLenOld && val.length === valOld.length - selectionLenOld),
                                        isSelection = (eventWhich >= 37 && eventWhich <= 40) && e.shiftKey, // Arrow key codes

                                        isKeyLeftArrow = eventWhich === 37,
                                        // Necessary due to "input" event not providing a key code
                                        isKeyBackspace = eventWhich === 8 || (eventType !== 'keyup' && isDeletion && (caretPosDelta === -1)),
                                        isKeyDelete = eventWhich === 46 || (eventType !== 'keyup' && isDeletion && (caretPosDelta === 0) && !wasSelected),
                                        // Handles cases where caret is moved and placed in front of invalid maskCaretMap position. Logic below
                                        // ensures that, on click or leftward caret placement, caret is moved leftward until directly right of
                                        // non-mask character. Also applied to click since users are (arguably) more likely to backspace
                                        // a character when clicking within a filled input.
                                        caretBumpBack = (isKeyLeftArrow || isKeyBackspace || eventType === 'click') && caretPos > caretPosMin;

                                oldSelectionLength = getSelectionLength(this);

                                // These events don't require any action
                                if (isSelection || (isSelected && (eventType === 'click' || eventType === 'keyup' || eventType === 'focus'))) {
                                    return;
                                }

                                if (isKeyBackspace && preventBackspace) {
                                    iElement.val(maskPlaceholder);
                                    // This shouldn't be needed but for some reason after aggressive backspacing the controller $viewValue is incorrect.
                                    // This keeps the $viewValue updated and correct.
                                    scope.$apply(function () {
                                        controller.$setViewValue(''); // $setViewValue should be run in angular context, otherwise the changes will be invisible to angular and user code.
                                    });
                                    setCaretPosition(this, caretPosOld);
                                    return;
                                }

                                // Value Handling
                                // ==============

                                // User attempted to delete but raw value was unaffected--correct this grievous offense
                                if ((eventType === 'input') && isDeletion && !wasSelected && valUnmasked === valUnmaskedOld) {
                                    while (isKeyBackspace && caretPos > caretPosMin && !isValidCaretPosition(caretPos)) {
                                        caretPos--;
                                    }
                                    while (isKeyDelete && caretPos < caretPosMax && maskCaretMap.indexOf(caretPos) === -1) {
                                        caretPos++;
                                    }
                                    var charIndex = maskCaretMap.indexOf(caretPos);
                                    // Strip out non-mask character that user would have deleted if mask hadn't been in the way.
                                    valUnmasked = valUnmasked.substring(0, charIndex) + valUnmasked.substring(charIndex + 1);

                                    // If value has not changed, don't want to call $setViewValue, may be caused by IE raising input event due to placeholder
                                    if (valUnmasked !== valUnmaskedOld)
                                    	valAltered = true;
                                }

                                // Update values
                                valMasked = maskValue(valUnmasked);

                                oldValue = valMasked;
                                oldValueUnmasked = valUnmasked;

                                //additional check to fix the problem where the viewValue is out of sync with the value of the element.
                                //better fix for commit 2a83b5fb8312e71d220a497545f999fc82503bd9 (I think)
                                if (!valAltered && val.length > valMasked.length)
                                    valAltered = true;

                                iElement.val(valMasked);

                                //we need this check.  What could happen if you don't have it is that you'll set the model value without the user
                                //actually doing anything.  Meaning, things like pristine and touched will be set.
                                if (valAltered) {
                                    scope.$apply(function () {
                                        controller.$setViewValue(valMasked); // $setViewValue should be run in angular context, otherwise the changes will be invisible to angular and user code.
                                    });
                                }

                                // Caret Repositioning
                                // ===================

                                // Ensure that typing always places caret ahead of typed character in cases where the first char of
                                // the input is a mask char and the caret is placed at the 0 position.
                                if (isAddition && (caretPos <= caretPosMin)) {
                                    caretPos = caretPosMin + 1;
                                }

                                if (caretBumpBack) {
                                    caretPos--;
                                }

                                // Make sure caret is within min and max position limits
                                caretPos = caretPos > caretPosMax ? caretPosMax : caretPos < caretPosMin ? caretPosMin : caretPos;

                                // Scoot the caret back or forth until it's in a non-mask position and within min/max position limits
                                while (!isValidCaretPosition(caretPos) && caretPos > caretPosMin && caretPos < caretPosMax) {
                                    caretPos += caretBumpBack ? -1 : 1;
                                }

                                if ((caretBumpBack && caretPos < caretPosMax) || (isAddition && !isValidCaretPosition(caretPosOld))) {
                                    caretPos++;
                                }
                                oldCaretPosition = caretPos;
                                setCaretPosition(this, caretPos);
                            }

                            function isValidCaretPosition(pos) {
                                return maskCaretMap.indexOf(pos) > -1;
                            }

                            function getCaretPosition(input) {
                                if (!input)
                                    return 0;
                                if (input.selectionStart !== undefined) {
                                    return input.selectionStart;
                                } else if (document.selection) {
                                    if (isFocused(iElement[0])) {
                                        // Curse you IE
                                        input.focus();
                                        var selection = document.selection.createRange();
                                        selection.moveStart('character', input.value ? -input.value.length : 0);
                                        return selection.text.length;
                                    }
                                }
                                return 0;
                            }

                            function setCaretPosition(input, pos) {
                                if (!input)
                                    return 0;
                                if (input.offsetWidth === 0 || input.offsetHeight === 0) {
                                    return; // Input's hidden
                                }
                                if (input.setSelectionRange) {
                                    if (isFocused(iElement[0])) {
                                        input.focus();
                                        input.setSelectionRange(pos, pos);
                                    }
                                }
                                else if (input.createTextRange) {
                                    // Curse you IE
                                    var range = input.createTextRange();
                                    range.collapse(true);
                                    range.moveEnd('character', pos);
                                    range.moveStart('character', pos);
                                    range.select();
                                }
                            }

                            function getSelectionLength(input) {
                                if (!input)
                                    return 0;
                                if (input.selectionStart !== undefined) {
                                    return (input.selectionEnd - input.selectionStart);
                                }
                                if (document.selection) {
                                    return (document.selection.createRange().text.length);
                                }
                                return 0;
                            }

                            // https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/indexOf
                            if (!Array.prototype.indexOf) {
                                Array.prototype.indexOf = function(searchElement /*, fromIndex */) {
                                    if (this === null) {
                                        throw new TypeError();
                                    }
                                    var t = Object(this);
                                    var len = t.length >>> 0;
                                    if (len === 0) {
                                        return -1;
                                    }
                                    var n = 0;
                                    if (arguments.length > 1) {
                                        n = Number(arguments[1]);
                                        if (n !== n) { // shortcut for verifying if it's NaN
                                            n = 0;
                                        } else if (n !== 0 && n !== Infinity && n !== -Infinity) {
                                            n = (n > 0 || -1) * Math.floor(Math.abs(n));
                                        }
                                    }
                                    if (n >= len) {
                                        return -1;
                                    }
                                    var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0);
                                    for (; k < len; k++) {
                                        if (k in t && t[k] === searchElement) {
                                            return k;
                                        }
                                    }
                                    return -1;
                                };
                            }

                        };
                    }
                };
            }
        ]);

}());;
if(typeof JSON!=="object"){JSON={};}(function(){var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;function f(n){return n<10?"0"+n:n;}function this_value(){return this.valueOf();}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null;};Boolean.prototype.toJSON=this_value;Number.prototype.toJSON=this_value;String.prototype.toJSON=this_value;}var gap,indent,meta,rep;function quote(string){rx_escapable.lastIndex=0;return rx_escapable.test(string)?'"'+string.replace(rx_escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key);}if(typeof rep==="function"){value=rep.call(holder,key,value);}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null";}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null";}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v;}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){if(typeof rep[i]==="string"){k=rep[i];v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v);}}}}else{for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v);}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v;}}if(typeof JSON.stringify!=="function"){meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" ";}}else{if(typeof space==="string"){indent=space;}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify");}return str("",{"":value});};}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v;}else{delete value[k];}}}}return reviver.call(holder,key,value);}text=String(text);rx_dangerous.lastIndex=0;if(rx_dangerous.test(text)){text=text.replace(rx_dangerous,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4);});}if(rx_one.test(text.replace(rx_two,"@").replace(rx_three,"]").replace(rx_four,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j;}throw new SyntaxError("JSON.parse");};}}());/*!	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
*/
var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0;}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)];}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac};}(),k=function(){if(!M.w3){return;}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f();}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false);}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f();}});if(O==top){(function(){if(J){return;}try{j.documentElement.doScroll("left");}catch(X){setTimeout(arguments.callee,0);return;}f();})();}}if(M.wk){(function(){if(J){return;}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return;}f();})();}s(f);}}();function f(){if(J){return;}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z);}catch(aa){return;}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]();}}function K(X){if(J){X();}else{U[U.length]=X;}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false);}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false);}else{if(typeof O.attachEvent!=D){i(O,"onload",Y);}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y();};}else{O.onload=Y;}}}}}function h(){if(T){V();}else{H();}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)];}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return;}}X.removeChild(aa);Z=null;H();})();}else{H();}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa);}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class");}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align");}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value");}}P(ai,ah,Y,ab);}else{p(ae);if(ab){ab(aa);}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z;}ab(aa);}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y;}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z;}}}return X;}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312);}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null;}else{l=ae;Q=X;}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310";}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137";}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac;}else{ab.flashvars=ac;}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae);}else{setTimeout(arguments.callee,10);}})();}u(aa,ab,X);}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y);}else{setTimeout(arguments.callee,10);}})();}else{Y.parentNode.replaceChild(g(Y),Y);}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML;}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true));}}}}}return aa;}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X;}if(aa){if(typeof ai.id==D){ai.id=Y;}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae];}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"';}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"';}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />';}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id);}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac]);}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac]);}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab]);}}aa.parentNode.replaceChild(Z,aa);X=Z;}}return X;}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa);}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y);}else{setTimeout(arguments.callee,10);}})();}else{X.parentNode.removeChild(X);}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null;}}Y.parentNode.removeChild(Y);}}function c(Z){var X=null;try{X=j.getElementById(Z);}catch(Y){}return X;}function C(X){return j.createElement(X);}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y];}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false;}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return;}var aa=j.getElementsByTagName("head")[0];if(!aa){return;}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null;}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1];}G=X;}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y);}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"));}}}function w(Z,X){if(!m){return;}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y;}else{v("#"+Z,"visibility:"+Y);}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y;}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2]);}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa]);}for(var Y in M){M[Y]=null;}M=null;for(var X in swfobject){swfobject[X]=null;}swfobject=null;});}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false);}else{if(Z){Z({success:false,id:ab});}}},getObjectById:function(X){if(M.w3){return z(X);}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al];}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak];}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai];}else{am.flashvars=ai+"="+Z[ai];}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true);}X.success=true;X.ref=an;}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return;}else{w(ah,true);}}if(ac){ac(X);}});}else{if(ac){ac(X);}}},switchOffAutoHideShow:function(){m=false;},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]};},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X);}else{return undefined;}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y);}},removeSWF:function(X){if(M.w3){y(X);}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X);}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1];}if(aa==null){return L(Z);}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)));}}}return"";},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block";}}if(E){E(B);}}a=false;}}};}();(function(m,g){var A="0.7.8",C="",B="?",t="function",i="undefined",e="object",r="string",f="major",v="model",h="name",p="type",l="vendor",x="version",a="architecture",j="console",s="mobile",y="tablet",o="smarttv",z="wearable",u="embedded";var b={extend:function(D,F){for(var E in F){if("browser cpu device engine os".indexOf(E)!==-1&&F[E].length%2===0){D[E]=F[E].concat(D[E]);}}return D;},has:function(E,D){if(typeof E==="string"){return D.toLowerCase().indexOf(E.toLowerCase())!==-1;}else{return false;}},lowerize:function(D){return D.toLowerCase();},major:function(D){return typeof(D)===r?D.split(".")[0]:g;}};var w={rgx:function(){var N,H=0,G,F,E,D,I,J,K=arguments;while(H<K.length&&!I){var M=K[H],L=K[H+1];if(typeof N===i){N={};for(E in L){D=L[E];if(typeof D===e){N[D[0]]=g;}else{N[D]=g;}}}G=F=0;while(G<M.length&&!I){I=M[G++].exec(this.getUA());if(!!I){for(E=0;E<L.length;E++){J=I[++F];D=L[E];if(typeof D===e&&D.length>0){if(D.length==2){if(typeof D[1]==t){N[D[0]]=D[1].call(this,J);}else{N[D[0]]=D[1];}}else{if(D.length==3){if(typeof D[1]===t&&!(D[1].exec&&D[1].test)){N[D[0]]=J?D[1].call(this,J,D[2]):g;}else{N[D[0]]=J?J.replace(D[1],D[2]):g;}}else{if(D.length==4){N[D[0]]=J?D[3].call(this,J.replace(D[1],D[2])):g;}}}}else{N[D]=J?J:g;}}}}H+=2;}return N;},str:function(G,F){for(var E in F){if(typeof F[E]===e&&F[E].length>0){for(var D=0;D<F[E].length;D++){if(b.has(F[E][D],G)){return(E===B)?g:E;}}}else{if(b.has(F[E],G)){return(E===B)?g:E;}}}return G;}};var q={browser:{oldsafari:{version:{"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0","2000":"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0","7":"NT 6.1","8":"NT 6.2","8.1":"NT 6.3","10":["NT 6.4","NT 10.0"],RT:"ARM"}}}};var n={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[h,x],[/\s(opr)\/([\w\.]+)/i],[[h,"Opera"],x],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]+)*/i,/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]+)*/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi)\/([\w\.-]+)/i],[h,x],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[h,"IE"],x],[/(edge)\/((\d+)?[\w\.]+)/i],[h,x],[/(yabrowser)\/([\w\.]+)/i],[[h,"Yandex"],x],[/(comodo_dragon)\/([\w\.]+)/i],[[h,/_/g," "],x],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i,/(uc\s?browser|qqbrowser)[\/\s]?([\w\.]+)/i],[h,x],[/(dolfin)\/([\w\.]+)/i],[[h,"Dolphin"],x],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[h,"Chrome"],x],[/XiaoMi\/MiuiBrowser\/([\w\.]+)/i],[x,[h,"MIUI Browser"]],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)/i],[x,[h,"Android Browser"]],[/FBAV\/([\w\.]+);/i],[x,[h,"Facebook"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[x,[h,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[x,h],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[h,[x,w.str,q.browser.oldsafari.version]],[/(konqueror)\/([\w\.]+)/i,/(webkit|khtml)\/([\w\.]+)/i],[h,x],[/(navigator|netscape)\/([\w\.-]+)/i],[[h,"Netscape"],x],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/([\w\.-]+)/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]+)*/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[h,x]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[[a,"amd64"]],[/(ia32(?=;))/i],[[a,b.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[a,"ia32"]],[/windows\s(ce|mobile);\sppc;/i],[[a,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[a,/ower/,"",b.lowerize]],[/(sun4\w)[;\)]/i],[[a,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+;))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[[a,b.lowerize]]],device:[[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],[v,l,[p,y]],[/applecoremedia\/[\w\.]+ \((ipad)/],[v,[l,"Apple"],[p,y]],[/(apple\s{0,1}tv)/i],[[v,"Apple TV"],[l,"Apple"]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],[l,v,[p,y]],[/(kf[A-z]+)\sbuild\/[\w\.]+.*silk\//i],[v,[l,"Amazon"],[p,y]],[/(sd|kf)[0349hijorstuw]+\sbuild\/[\w\.]+.*silk\//i],[[v,w.str,q.device.amazon.model],[l,"Amazon"],[p,s]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[v,l,[p,s]],[/\((ip[honed|\s\w*]+);/i],[v,[l,"Apple"],[p,s]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola|polytron)[\s_-]?([\w-]+)*/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[l,v,[p,s]],[/\(bb10;\s(\w+)/i],[v,[l,"BlackBerry"],[p,s]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7)/i],[v,[l,"Asus"],[p,y]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[l,"Sony"],[v,"Xperia Tablet"],[p,y]],[/(?:sony)?(?:(?:(?:c|d)\d{4})|(?:so[-l].+))\sbuild\//i],[[l,"Sony"],[v,"Xperia Phone"],[p,s]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[l,v,[p,j]],[/android.+;\s(shield)\sbuild/i],[v,[l,"Nvidia"],[p,j]],[/(playstation\s[3portablevi]+)/i],[v,[l,"Sony"],[p,j]],[/(sprint\s(\w+))/i],[[l,w.str,q.device.sprint.vendor],[v,w.str,q.device.sprint.model],[p,s]],[/(lenovo)\s?(S(?:5000|6000)+(?:[-][\w+]))/i],[l,v,[p,y]],[/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i,/(zte)-(\w+)*/i,/(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i],[l,[v,/_/g," "],[p,s]],[/(nexus\s9)/i],[v,[l,"HTC"],[p,y]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[v,[l,"Microsoft"],[p,j]],[/(kin\.[onetw]{3})/i],[[v,/\./g," "],[l,"Microsoft"],[p,s]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?)[\w\s]+build\//i,/mot[\s-]?(\w+)*/i,/(XT\d{3,4}) build\//i],[v,[l,"Motorola"],[p,s]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[v,[l,"Motorola"],[p,y]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[[l,"Samsung"],v,[p,y]],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-n900))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i,/sec-((sgh\w+))/i],[[l,"Samsung"],v,[p,s]],[/(samsung);smarttv/i],[l,v,[p,o]],[/\(dtv[\);].+(aquos)/i],[v,[l,"Sharp"],[p,o]],[/sie-(\w+)*/i],[v,[l,"Siemens"],[p,s]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]+)*/i],[[l,"Nokia"],v,[p,s]],[/android\s3\.[\s\w;-]{10}(a\d{3})/i],[v,[l,"Acer"],[p,y]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[l,"LG"],v,[p,y]],[/(lg) netcast\.tv/i],[l,v,[p,o]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w+)*/i],[v,[l,"LG"],[p,s]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[v,[l,"Lenovo"],[p,y]],[/linux;.+((jolla));/i],[l,v,[p,s]],[/((pebble))app\/[\d\.]+\s/i],[l,v,[p,z]],[/android.+;\s(glass)\s\d/i],[v,[l,"Google"],[p,z]],[/android.+(\w+)\s+build\/hm\1/i,/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i,/android.+(mi[\s\-_]*(?:one|one[\s_]plus)?[\s_]*(?:\d\w)?)\s+build/i],[[v,/_/g," "],[l,"Xiaomi"],[p,s]],[/(mobile|tablet);.+rv\:.+gecko\//i],[[p,b.lowerize],l,v]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[x,[h,"EdgeHTML"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[h,x],[/rv\:([\w\.]+).*(gecko)/i],[x,h]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[h,x],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[h,[x,w.str,q.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[h,"Windows"],[x,w.str,q.os.windows.version]],[/\((bb)(10);/i],[[h,"BlackBerry"],x],[/(blackberry)\w*\/?([\w\.]+)*/i,/(tizen)[\/\s]([\w\.]+)/i,/(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]+)*/i,/linux;.+(sailfish);/i],[h,x],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],[[h,"Symbian"],x],[/\((series40);/i],[h],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[h,"Firefox OS"],x],[/(nintendo|playstation)\s([wids3portablevu]+)/i,/(mint)[\/\s\(]?(\w+)*/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?([\w\.-]+)*/i,/(hurd|linux)\s?([\w\.]+)*/i,/(gnu)\s?([\w\.]+)*/i],[h,x],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[h,"Chromium OS"],x],[/(sunos)\s?([\w\.]+\d)*/i],[[h,"Solaris"],x],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i],[h,x],[/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i],[[h,"iOS"],[x,/_/g,"."]],[/(mac\sos\sx)\s?([\w\s\.]+\w)*/i,/(macintosh|mac(?=_powerpc)\s)/i],[[h,"Mac OS"],[x,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]+)*/i,/(haiku)\s(\w+)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i,/(unix)\s?([\w\.]+)*/i],[h,x]]};var k=function(E,G){if(!(this instanceof k)){return new k(E,G).getResult();}var F=E||((m&&m.navigator&&m.navigator.userAgent)?m.navigator.userAgent:C);var D=G?b.extend(n,G):n;this.getBrowser=function(){var H=w.rgx.apply(this,D.browser);H.major=b.major(H.version);return H;};this.getCPU=function(){return w.rgx.apply(this,D.cpu);};this.getDevice=function(){return w.rgx.apply(this,D.device);};this.getEngine=function(){return w.rgx.apply(this,D.engine);};this.getOS=function(){return w.rgx.apply(this,D.os);};this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()};};this.getUA=function(){return F;};this.setUA=function(H){F=H;return this;};this.setUA(F);return this;};k.VERSION=A;k.BROWSER={NAME:h,MAJOR:f,VERSION:x};k.CPU={ARCHITECTURE:a};k.DEVICE={MODEL:v,VENDOR:l,TYPE:p,CONSOLE:j,MOBILE:s,SMARTTV:o,TABLET:y,WEARABLE:z,EMBEDDED:u};k.ENGINE={NAME:h,VERSION:x};k.OS={NAME:h,VERSION:x};if(typeof(exports)!==i){if(typeof module!==i&&module.exports){exports=module.exports=k;}exports.UAParser=k;}else{if(typeof(define)===t&&define.amd){define("ua-parser",function(){return k;});}else{m.UAParser=k;}}var d=m.jQuery||m.Zepto;if(typeof d!==i){var c=new k();d.ua=c.getResult();d.ua.get=function(){return c.getUA();};d.ua.set=function(E){c.setUA(E);var D=c.getResult();for(var F in D){d.ua[F]=D[F];}};}})(this);var CryptoJS=CryptoJS||function(o,d){var u={},c=u.lib={},n=c.Base=function(){function b(){}return{extend:function(e){b.prototype=this;var g=new b;e&&g.mixIn(e);g.$super=this;return g;},create:function(){var e=this.extend();e.init.apply(e,arguments);return e;},init:function(){},mixIn:function(e){for(var g in e){e.hasOwnProperty(g)&&(this[g]=e[g]);}e.hasOwnProperty("toString")&&(this.toString=e.toString);},clone:function(){return this.$super.extend(this);}};}(),l=c.WordArray=n.extend({init:function(b,e){b=this.words=b||[];this.sigBytes=e!=d?e:4*b.length;},toString:function(b){return(b||f).stringify(this);},concat:function(g){var h=this.words,i=g.words,j=this.sigBytes,g=g.sigBytes;this.clamp();if(j%4){for(var e=0;e<g;e++){h[j+e>>>2]|=(i[e>>>2]>>>24-8*(e%4)&255)<<24-8*((j+e)%4);}}else{h.push.apply(h,i);}this.sigBytes+=g;return this;},clamp:function(){var b=this.words,e=this.sigBytes;b[e>>>2]&=4294967295<<32-8*(e%4);b.length=o.ceil(e/4);},clone:function(){var b=n.clone.call(this);b.words=this.words.slice(0);return b;},random:function(b){for(var e=[],g=0;g<b;g+=4){e.push(4294967296*o.random()|0);}return l.create(e,b);}}),a=u.enc={},f=a.Hex={stringify:function(g){for(var h=g.words,g=g.sigBytes,i=[],j=0;j<g;j++){var e=h[j>>>2]>>>24-8*(j%4)&255;i.push((e>>>4).toString(16));i.push((e&15).toString(16));}return i.join("");},parse:function(g){for(var e=g.length,h=[],i=0;i<e;i+=2){h[i>>>3]|=parseInt(g.substr(i,2),16)<<24-4*(i%8);}return l.create(h,e/2);}},x=a.Latin1={stringify:function(g){for(var e=g.words,g=g.sigBytes,h=[],i=0;i<g;i++){h.push(String.fromCharCode(e[i>>>2]>>>24-8*(i%4)&255));}return h.join("");},parse:function(g){for(var e=g.length,h=[],i=0;i<e;i++){h[i>>>2]|=(g.charCodeAt(i)&255)<<24-8*(i%4);}return l.create(h,e);}},t=a.Utf8={stringify:function(g){try{return decodeURIComponent(escape(x.stringify(g)));}catch(e){throw Error("Malformed UTF-8 data");}},parse:function(b){return x.parse(unescape(encodeURIComponent(b)));}},w=c.BufferedBlockAlgorithm=n.extend({reset:function(){this._data=l.create();this._nDataBytes=0;},_append:function(b){"string"==typeof b&&(b=t.parse(b));this._data.concat(b);this._nDataBytes+=b.sigBytes;},_process:function(j){var i=this._data,q=i.words,r=i.sigBytes,p=this.blockSize,m=r/(4*p),m=j?o.ceil(m):o.max((m|0)-this._minBufferSize,0),j=m*p,r=o.min(4*j,r);if(j){for(var k=0;k<j;k+=p){this._doProcessBlock(q,k);}k=q.splice(0,j);i.sigBytes-=r;}return l.create(k,r);},clone:function(){var b=n.clone.call(this);b._data=this._data.clone();return b;},_minBufferSize:0});c.Hasher=w.extend({init:function(){this.reset();},reset:function(){w.reset.call(this);this._doReset();},update:function(b){this._append(b);this._process();return this;},finalize:function(b){b&&this._append(b);this._doFinalize();return this._hash;},clone:function(){var b=w.clone.call(this);b._hash=this._hash.clone();return b;},blockSize:16,_createHelper:function(b){return function(e,g){return b.create(g).finalize(e);};},_createHmacHelper:function(b){return function(e,g){return v.HMAC.create(b,g).finalize(e);};}});var v=u.algo={};return u;}(Math);(function(d){var l=CryptoJS,f=l.lib,h=f.WordArray,f=f.Hasher,c=l.algo,b=[],e=[];(function(){function k(n){for(var g=d.sqrt(n),o=2;o<=g;o++){if(!(n%o)){return !1;}}return !0;}function j(g){return 4294967296*(g-(g|0))|0;}for(var i=2,m=0;64>m;){k(i)&&(8>m&&(b[m]=j(d.pow(i,0.5))),e[m]=j(d.pow(i,1/3)),m++),i++;}})();var a=[],c=c.SHA256=f.extend({_doReset:function(){this._hash=h.create(b.slice(0));},_doProcessBlock:function(v,u){for(var A=this._hash.words,x=A[0],B=A[1],w=A[2],y=A[3],z=A[4],t=A[5],s=A[6],r=A[7],q=0;64>q;q++){if(16>q){a[q]=v[u+q]|0;}else{var p=a[q-15],m=a[q-2];a[q]=((p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3)+a[q-7]+((m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10)+a[q-16];}p=r+((z<<26|z>>>6)^(z<<21|z>>>11)^(z<<7|z>>>25))+(z&t^~z&s)+e[q]+a[q];m=((x<<30|x>>>2)^(x<<19|x>>>13)^(x<<10|x>>>22))+(x&B^x&w^B&w);r=s;s=t;t=z;z=y+p|0;y=w;w=B;B=x;x=p+m|0;}A[0]=A[0]+x|0;A[1]=A[1]+B|0;A[2]=A[2]+w|0;A[3]=A[3]+y|0;A[4]=A[4]+z|0;A[5]=A[5]+t|0;A[6]=A[6]+s|0;A[7]=A[7]+r|0;},_doFinalize:function(){var k=this._data,j=k.words,i=8*this._nDataBytes,m=8*k.sigBytes;j[m>>>5]|=128<<24-m%32;j[(m+64>>>9<<4)+15]=i;k.sigBytes=4*j.length;this._process();}});l.SHA256=f._createHelper(c);l.HmacSHA256=f._createHmacHelper(c);})(Math);var __JS_VERSION=1;function machineSecretExtendAttributes(b){var l=b;var h=new Date();var f=[{func:m,contribution:0.2},{func:c,contribution:0.3},{func:o,contribution:0.3},{func:g,contribution:0.2}];var n={Chrome:0.1,Chromium:0.1,Firefox:0.1,Mozilla:0.1,IE:0.1,Safari:0.1,"Android Browser":0.3,Camino:0.3,"IE Mobile":0.3,Kindle:0.3,Opera:0.3,Netscape:0.3,"Mobile Safari":0.1,obscure:0.7};var e={Windows:0.1,Linux:0.1,iOS:0.1,"Mac OS":0.2,"Chromium OS":0.2,Android:0.2,RedHat:0.2,Playstation:0.3,Nintendo:0.3,Ubuntu:0.3,AIX:0.3,CentOS:0.3,Solaris:0.3,BlackBerry:0.4,"Firefox OS":0.4,"Windows Phone":0.4,"Windows Mobile":0.4,obscure:0.7};function a(p){if(navigator.geolocation===null){l.asynchronousAttributeFail(p,"GEO location functionality is not avaialble on this browser");return;}var q=function(s){var u=s.coords.latitude;var t=s.coords.longitude;l.asynchronousAttributeSet(p,""+u+","+t);};var r=function(s){l.asynchronousAttributeFail(p,"GEO location callback failed [code="+s.code+"] [message="+s.message+"]");};navigator.geolocation.getCurrentPosition(q,r);}function k(){return h.toLocaleString();}function d(){return h.toGMTString();}function j(){var v=[{attribute:"language",value:"Javascript"},{attribute:"type",value:"application/javascript;version="}];var s=1;var r=1;var y=0;var x=9;for(var p=0;p<v.length;p++){var q=v[p];var t=q.attribute;var A=q.value;for(var u=s;u<=r;u++){for(var B=y;B<=x;B++){var w=""+u+"."+B;var z=document.createElement("script");z.setAttribute(t,A+w);z.innerHTML="if (__JS_VERSION < @version@) __JS_VERSION = @version@;".replace(/@version@/g,w);document.documentElement.firstChild.appendChild(z);}}}return __JS_VERSION;}function m(r){var q=0;var p=r.attributes;if("canvas" in p&&!!p.canvas){q+=0.5;}if("webGL" in p&&!!p.webGL){q+=0.5;}return q;}function c(r){var q=0;var p=r.attributes;if("plugins" in p&&!!p.plugins){var s=p.plugins.length;if(s>=4){q+=0.1;s-=4;}if(s>=4){q+=0.2;s-=4;}if(s>0){var t=Math.ceil(s/4);q+=t*0.2;}}return(q>1)?1:q;}function o(r){var q=0;var p=r.attributes;if("fonts" in p&&!!p.fonts){var t=p.fonts.length;if(t>=50){q+=0.1;t-=50;}if(t>=50){q+=0.2;t-=50;}if(t>=100){q+=0.2;t-=100;}if(t>0){var s=Math.ceil(t/50);q+=s*0.1;}}return(q>1)?1:q;}function g(s){var r=0;var p=s.attributes;if("browserName" in p){var q=p.browserName;r+=0.5*((q in n)?n[q]:n.obscure);}if("osName" in p){var q=p.osName;r+=0.5*((q in e)?e[q]:e.obscure);}return(r>1)?1:r;}function i(s){var r=0;var q=0;for(var t=0;t<f.length;t++){var u=f[t];var v=u.func;var p=u.contribution;q+=p;var w=v(s);if(typeof w!="number"){s.webDeviceCollectionResponseCd.push("contributor returned a non-number [ret="+w+"]");}else{if(w<0||w>1){s.webDeviceCollectionResponseCd.push("contributor returned a value not between 0 and 1 [ret="+w+"]");}else{r+=w*p;}}}if(q!=1){s.webDeviceCollectionResponseCd.push("contributing attributes exceed 100%");}s.deviceIdConfidence=r;}l.setErrorAttributeName("webDeviceCollectionResponseCd").addDeviceAttribute("javascriptEnabled",function(){return true;}).addDeviceAttribute("webDeviceLocalDateTime",function(){return k();}).addDeviceAttribute("webDeviceNormalizedDateTime",function(){return d();}).addDeviceAttribute("jsVersion",function(){return String(j());}).addDeviceAsynchronousAttribute("geoLocation",a).addPostProcessor(i);}(function(F){var i="machineSecret";var g="1.0.2";var w;if(typeof requirejs!="undefined"){require(["ua-parser"],function(L){w=new L();});}else{w=new UAParser();}var A={browserName:function(){return p(w.getBrowser(),"name");},browserVersion:function(){return p(w.getBrowser(),"version");},osName:function(){return p(w.getOS(),"name");},osVersion:function(){return p(w.getOS(),"version");},plugins:function(){return m();},platform:function(){return navigator.platform;},appVersion:function(){return navigator.appVersion;},cpu:function(){return j();},cssVendorPrefix:function(){return K();},cookiesEnabled:function(){return navigator.cookieEnabled;},javaEnabled:function(){return navigator.javaEnabled();},flashEnabled:function(){return o();},flashVersion:function(){return J();},language:function(){return navigator.language;},doNotTrack:function(){return n();},timezoneOffset:function(){return -(new Date().getTimezoneOffset());},width:function(){return screen.width;},height:function(){return screen.height;},availWidth:function(){return screen.availWidth;},availHeight:function(){return screen.availHeight;},colorDepth:function(){return screen.colorDepth;},localStorage:function(){return f();},sessionStorage:function(){return h();},indexedDB:function(){return !!F.indexedDB;},fonts:function(){return E();},canvas:function(){return B();},webGL:function(){return r();}};var d=null;var D={};var H=[];var a=null;var v=null;var C={cookie:{EPOCH:"Thu, 01-Jan-1970 00:00:01 GMT",OPTIONS:["expires","path","domain"],enabled:undefined,isEnabled:function(){if(this.enabled===undefined){if(navigator.cookieEnabled){var L="__EntrustDatacard__";var M=new Date().toUTCString();this.set(L,M);this.enabled=(this.remove(L)===M);}else{this.enabled=false;}q("Cookie storage is"+(!this.enabled?" NOT":"")+" enabled.");}return this.enabled;},set:function(P,R){var L=[];var S=function(){var T=new Date();T.setFullYear(T.getFullYear()+1);L.push("expires="+T.toUTCString());};L.push(encodeURIComponent(P)+"="+encodeURIComponent(R));if(l){for(var O=0,M=this.OPTIONS.length;O<M;O++){var Q=l[this.OPTIONS[O]];if(Q){L.push(this.OPTIONS[O]+"="+Q);}else{if(O==0){S();}}}if(!!l.secure){L.push("secure");}}else{S();}var N=L.join("; ");document.cookie=N;q("Set cookie as follows: "+N);return N;},get:function(M){M=encodeURIComponent(M);var N=document.cookie,P=N.indexOf(M+"=");if(P<0){return null;}P=P+M.length+1;var L=N.indexOf(";",P);if(L<0){L=N.length;}var O=decodeURIComponent(N.substring(P,L));q("Existing value for cookie "+M+" is: "+O);return O;},remove:function(M){var N=this.get(M);if(N){q("Request to delete cookie "+M);var L=l;l={expires:this.EPOCH};this.set(M,"");l=L;}return N;}},localStorage:{enabled:undefined,isEnabled:function(){if(this.enabled===undefined){try{if(F.localStorage){var L="__EntrustDatacard__";var M=new Date().toUTCString();this.set(L,M);this.enabled=(this.remove(L)===M);}else{this.enabled=false;}}catch(N){this.enabled=false;}q("HTML5 Local Storage is"+(!this.enabled?" NOT":"")+" enabled.");}return this.enabled;},set:function(L,M){F.localStorage.setItem(L,M);q("Setting local storage key "+L+" to value: "+M);return M;},get:function(L){var M=F.localStorage.getItem(L);q("Existing value for local storage key "+L+" is: "+M);return M;},remove:function(L){var M=this.get(L);if(M){F.localStorage.removeItem(L);q("Removed local storage entry with key "+L+" whose previous value was: "+M);}return M;}},flash:{SWF_URL_OPT:"swfUrl",SWF_URL_DEF:"FlashLocalStore.swf",WAIT_DEF:10000,MIN_VERSION:9,initialized:false,callback:undefined,timeoutid:undefined,flash:undefined,enabled:undefined,init:function(Q,N){if(!this.initialized){this.initialized=true;if(!swfobject){this.enabled=false;Q(false);}else{this.enabled=swfobject.getFlashPlayerVersion().major>=this.MIN_VERSION;if(this.enabled){this.enabled=false;var M=null;if(l){M=l[this.SWF_URL_OPT];}if(!M){M=this.SWF_URL_DEF;}q("Attempting to initialize Flash storage.");var P=document.createElement("div");P.id="_flash_";document.body.appendChild(P);var L={data:M,width:"0",height:"0"};var O={allowScriptAccess:"sameDomain"};this.flash=swfobject.createSWF(L,O,P.id);if(this.flash){this.callback=Q;if(!N){N=this.WAIT_DEF;}this.timeoutid=setTimeout(function(){Q(false);},N);}else{s("Problems creating Flash storage.");Q(false);}}else{Q(false);}}}},isEnabled:function(){if(this.enabled===undefined){s("Flash storage has neither been excluded nor properly initialized. It will now be disabled.");this.enabled=false;}q("Flash Storage is"+(!this.enabled?" NOT":"")+" enabled.");return this.enabled;},set:function(L,M){if(this.flash.setStoredData){this.flash.setStoredData(L,M);q("Setting Flash storage key "+L+" to value: "+M);return M;}q("Operation set: Flash did not load correctly!");return undefined;},get:function(L){if(this.flash.getStoredData){var M=this.flash.getStoredData(L);q("Existing value for Flash storage key "+L+" is: "+M);return M;}q("Operation get: Flash did not load correctly!");return undefined;},remove:function(L){if(this.flash.removeStoredData){var M=this.flash.removeStoredData(L);q("Removed Flash entry with key "+L+" whose previous value was: "+M);return M;}q("Operation remove: Flash did not load correctly!");return undefined;}}};var y=false;var G=false;var x=null,l=null;var t="machineNonce",c="sequenceNonce";function o(){if(F.ActiveXObject){try{var L=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");return !!L;}catch(M){return false;}}return !!(navigator.mimeTypes&&navigator.mimeTypes["application/x-shockwave-flash"]!==undefined&&navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin);}function J(){var L=swfobject.getFlashPlayerVersion();return L.major+"."+L.minor+"."+L.release;}function m(){var L=[];var N=navigator.plugins;if(N){for(var O=0,M=N.length;O<M;O++){var P=N.item(O);L.push(P.name+";"+P.filename+";"+P.description);}}return L.sort();}function j(){var L=navigator.oscpu;if(L===undefined){L=navigator.cpuClass;}return L;}function K(){if(!F.getComputedStyle){if(document.documentElement.currentStyle){return"ms";}else{return"o";}}var L=F.getComputedStyle(document.documentElement,"");return(Array.prototype.slice.call(L).join("").match(/-(moz|webkit|ms|khtml)-/)||(L.OLink===""&&["","o"]))[1];}function f(){try{return !!F.localStorage;}catch(L){return true;}}function h(){try{return !!F.sessionStorage;}catch(L){return true;}}function p(N,M){var L=N[M];if(typeof L!=="string"){L="unknown";}return L;}function n(){return navigator.doNotTrack?navigator.doNotTrack:"unknown";}function E(){var U=["monospace","sans-serif","serif"];var N="mmmmmmmmmmlli";var R="72px";var Q=document.getElementsByTagName("body")[0];if(!Q){return"undefined";}var X=document.createElement("span");X.style.fontSize=R;X.innerHTML=N;Q.appendChild(X);var W={},L={};for(var S=0;S<U.length;S++){X.style.fontFamily=U[S];W[U[S]]=X.offsetWidth;L[U[S]]=X.offsetHeight;}var M=function(Z){for(var aa=0;aa<U.length;aa++){X.style.fontFamily=Z+","+U[aa];var Y=(X.offsetWidth!==W[U[aa]]||X.offsetHeight!==L[U[aa]]);if(Y){return true;}}return false;};var T=["Abadi MT Condensed Light","Academy Engraved LET","ADOBE CASLON PRO","Adobe Garamond","ADOBE GARAMOND PRO","Agency FB","Aharoni","Albertus Extra Bold","Albertus Medium","Algerian","Amazone BT","American Typewriter","American Typewriter Condensed","AmerType Md BT","Andale Mono","Andalus","Angsana New","AngsanaUPC","Antique Olive","Aparajita","Apple Chancery","Apple Color Emoji","Apple SD Gothic Neo","Arabic Typesetting","ARCHER","Arial","Arial Black","Arial Hebrew","Arial MT","Arial Narrow","Arial Rounded MT Bold","Arial Unicode MS","ARNO PRO","Arrus BT","Aurora Cn BT","AvantGarde Bk BT","AvantGarde Md BT","AVENIR","Ayuthaya","Bandy","Bangla Sangam MN","Bank Gothic","BankGothic Md BT","Baskerville","Baskerville Old Face","Batang","BatangChe","Bauer Bodoni","Bauhaus 93","Bazooka","Bell MT","Bembo","Benguiat Bk BT","Berlin Sans FB","Berlin Sans FB Demi","Bernard MT Condensed","BernhardFashion BT","BernhardMod BT","Big Caslon","BinnerD","Bitstream Vera Sans Mono","Blackadder ITC","BlairMdITC TT","Bodoni 72","Bodoni 72 Oldstyle","Bodoni 72 Smallcaps","Bodoni MT","Bodoni MT Black","Bodoni MT Condensed","Bodoni MT Poster Compressed","Book Antiqua","Bookman Old Style","Bookshelf Symbol 7","Boulder","Bradley Hand","Bradley Hand ITC","Bremen Bd BT","Britannic Bold","Broadway","Browallia New","BrowalliaUPC","Brush Script MT","Calibri","Californian FB","Calisto MT","Calligrapher","Cambria","Cambria Math","Candara","CaslonOpnface BT","Castellar","Centaur","Century","Century Gothic","Century Schoolbook","Cezanne","CG Omega","CG Times","Chalkboard","Chalkboard SE","Chalkduster","Charlesworth","Charter Bd BT","Charter BT","Chaucer","ChelthmITC Bk BT","Chiller","Clarendon","Clarendon Condensed","CloisterBlack BT","Cochin","Colonna MT","Comic Sans","Comic Sans MS","Consolas","Constantia","Cooper Black","Copperplate","Copperplate Gothic","Copperplate Gothic Bold","Copperplate Gothic Light","CopperplGoth Bd BT","Corbel","Cordia New","CordiaUPC","Cornerstone","Coronet","Courier","Courier New","Cuckoo","Curlz MT","DaunPenh","Dauphin","David","DB LCD Temp","DELICIOUS","Denmark","Devanagari Sangam MN","DFKai-SB","Didot","DilleniaUPC","DIN","DokChampa","Dotum","DotumChe","Ebrima","Edwardian Script ITC","Elephant","English 111 Vivace BT","Engravers MT","EngraversGothic BT","Eras Bold ITC","Eras Demi ITC","Eras Light ITC","Eras Medium ITC","Estrangelo Edessa","EucrosiaUPC","Euphemia","Euphemia UCAS","EUROSTILE","Exotc350 Bd BT","FangSong","Felix Titling","Fixedsys","FONTIN","Footlight MT Light","Forte","Franklin Gothic","Franklin Gothic Book","Franklin Gothic Demi","Franklin Gothic Demi Cond","Franklin Gothic Heavy","Franklin Gothic Medium","Franklin Gothic Medium Cond","FrankRuehl","Fransiscan","Freefrm721 Blk BT","FreesiaUPC","Freestyle Script","French Script MT","FrnkGothITC Bk BT","Fruitger","FRUTIGER","Futura","Futura Bk BT","Futura Lt BT","Futura Md BT","Futura ZBlk BT","FuturaBlack BT","Gabriola","Galliard BT","Garamond","Gautami","Geeza Pro","Geneva","Geometr231 BT","Geometr231 Hv BT","Geometr231 Lt BT","Georgia","GeoSlab 703 Lt BT","GeoSlab 703 XBd BT","Gigi","Gill Sans","Gill Sans MT","Gill Sans MT Condensed","Gill Sans MT Ext Condensed Bold","Gill Sans Ultra Bold","Gill Sans Ultra Bold Condensed","Gisha","Gloucester MT Extra Condensed","GOTHAM","GOTHAM BOLD","Goudy Old Style","Goudy Stout","GoudyHandtooled BT","GoudyOLSt BT","Gujarati Sangam MN","Gulim","GulimChe","Gungsuh","GungsuhChe","Gurmukhi MN","Haettenschweiler","Harlow Solid Italic","Harrington","Heather","Heiti SC","Heiti TC","HELV","Helvetica","Helvetica Neue","Herald","High Tower Text","Hiragino Kaku Gothic ProN","Hiragino Mincho ProN","Hoefler Text","Humanst 521 Cn BT","Humanst521 BT","Humanst521 Lt BT","Impact","Imprint MT Shadow","Incised901 Bd BT","Incised901 BT","Incised901 Lt BT","INCONSOLATA","Informal Roman","Informal011 BT","INTERSTATE","IrisUPC","Iskoola Pota","JasmineUPC","Jazz LET","Jenson","Jester","Jokerman","Juice ITC","Kabel Bk BT","Kabel Ult BT","Kailasa","KaiTi","Kalinga","Kannada Sangam MN","Kartika","Kaufmann Bd BT","Kaufmann BT","Khmer UI","KodchiangUPC","Kokila","Korinna BT","Kristen ITC","Krungthep","Kunstler Script","Lao UI","Latha","Leelawadee","Letter Gothic","Levenim MT","LilyUPC","Lithograph","Lithograph Light","Long Island","Lucida Bright","Lucida Calligraphy","Lucida Console","Lucida Fax","LUCIDA GRANDE","Lucida Handwriting","Lucida Sans","Lucida Sans Typewriter","Lucida Sans Unicode","Lydian BT","Magneto","Maiandra GD","Malayalam Sangam MN","Malgun Gothic","Mangal","Marigold","Marion","Marker Felt","Market","Marlett","Matisse ITC","Matura MT Script Capitals","Meiryo","Meiryo UI","Microsoft Himalaya","Microsoft JhengHei","Microsoft New Tai Lue","Microsoft PhagsPa","Microsoft Sans Serif","Microsoft Tai Le","Microsoft Uighur","Microsoft YaHei","Microsoft Yi Baiti","MingLiU","MingLiU_HKSCS","MingLiU_HKSCS-ExtB","MingLiU-ExtB","Minion","Minion Pro","Miriam","Miriam Fixed","Mistral","Modern","Modern No. 20","Mona Lisa Solid ITC TT","Monaco","Mongolian Baiti","MONO","Monotype Corsiva","MoolBoran","Mrs Eaves","MS Gothic","MS LineDraw","MS Mincho","MS Outlook","MS PGothic","MS PMincho","MS Reference Sans Serif","MS Reference Specialty","MS Sans Serif","MS Serif","MS UI Gothic","MT Extra","MUSEO","MV Boli","MYRIAD","MYRIAD PRO","Nadeem","Narkisim","NEVIS","News Gothic","News GothicMT","NewsGoth BT","Niagara Engraved","Niagara Solid","Noteworthy","NSimSun","Nyala","OCR A Extended","Old Century","Old English Text MT","Onyx","Onyx BT","OPTIMA","Oriya Sangam MN","OSAKA","OzHandicraft BT","Palace Script MT","Palatino","Palatino Linotype","Papyrus","Parchment","Party LET","Pegasus","Perpetua","Perpetua Titling MT","PetitaBold","Pickwick","Plantagenet Cherokee","Playbill","PMingLiU","PMingLiU-ExtB","Poor Richard","Poster","PosterBodoni BT","PRINCETOWN LET","Pristina","PTBarnum BT","Pythagoras","Raavi","Rage Italic","Ravie","Ribbon131 Bd BT","Rockwell","Rockwell Condensed","Rockwell Extra Bold","Rod","Roman","Sakkal Majalla","Santa Fe LET","Savoye LET","Sceptre","Script","Script MT Bold","SCRIPTINA","Segoe Print","Segoe Script","Segoe UI","Segoe UI Light","Segoe UI Semibold","Segoe UI Symbol","Serifa","Serifa BT","Serifa Th BT","ShelleyVolante BT","Sherwood","Shonar Bangla","Showcard Gothic","Shruti","Signboard","SILKSCREEN","SimHei","Simplified Arabic","Simplified Arabic Fixed","SimSun","SimSun-ExtB","Sinhala Sangam MN","Sketch Rockwell","Skia","Small Fonts","Snap ITC","Snell Roundhand","Socket","Souvenir Lt BT","Staccato222 BT","Steamer","Stencil","Storybook","Styllo","Subway","Swis721 BlkEx BT","Swiss911 XCm BT","Sylfaen","Symbol","Synchro LET","System","Tahoma","Tamil Sangam MN","Technical","Teletype","Telugu Sangam MN","Tempus Sans ITC","Terminal","Thonburi","Times","Times New Roman","Times New Roman PS","Traditional Arabic","Trajan","TRAJAN PRO","Trebuchet MS","Tristan","Tubular","Tunga","Tw Cen MT","Tw Cen MT Condensed","Tw Cen MT Condensed Extra Bold","TypoUpright BT","Unicorn","Univers","Univers CE 55 Medium","Univers Condensed","Utsaah","Vagabond","Vani","Verdana","Vijaya","Viner Hand ITC","VisualUI","Vivaldi","Vladimir Script","Vrinda","Webdings","Westminster","WHITNEY","Wide Latin","Wingdings","Wingdings 2","Wingdings 3","ZapfEllipt BT","ZapfHumnst BT","ZapfHumnst Dm BT","Zapfino","Zurich BlkEx BT","Zurich Ex BT","ZWAdobeF"];var V=[];for(var P=0,O=T.length;P<O;P++){if(M(T[P])){V.push(P);}}Q.removeChild(X);return V;}function B(){var N=document.createElement("canvas");if(!!(N.getContext&&N.getContext("2d"))){N.width=1600;N.height=100;var M=N.getContext("2d");var L="http://www.entrustdatacard.com/This Is The <Canvas> FP 1.0";M.textBaseline="top";M.font="72px 'DamascusLight'";M.fillStyle="#f60";M.fillRect(2,0,1000,70);M.fillStyle="#069";M.fillText(L,2,0);M.font="72px 'Roboto Condensed'";M.fillStyle="rgba(102, 204, 0, 0.7)";M.fillText(L,4,2);M.strokeStyle="rgba(202, 104, 0, 0.9)";M.font="72px 'Menlo'";M.strokeText(L,8,4);return I(N.toDataURL());}return"undefined";}function r(){var N=function(){var X=document.createElement("canvas");var Z=null;try{Z=X.getContext("webgl")||X.getContext("experimental-webgl");}catch(Y){}if(!Z){Z=null;}return Z;};var L=function(X){P.clearColor(0,0,0,1);P.enable(P.DEPTH_TEST);P.depthFunc(P.LEQUAL);P.clear(P.COLOR_BUFFER_BIT|P.DEPTH_BUFFER_BIT);return"("+X[0]+" x "+X[1]+")";};var U=function(Z){var Y,X=Z.getExtension("EXT_texture_filter_anisotropic")||Z.getExtension("WEBKIT_EXT_texture_filter_anisotropic")||Z.getExtension("MOZ_EXT_texture_filter_anisotropic");return X?(Y=Z.getParameter(X.MAX_TEXTURE_MAX_ANISOTROPY_EXT),0===Y&&(Y=2),Y):null;};var W=[];var P=N();if(P){var M="attribute vec2 attrVertex;varying vec2 varyinTexCoordinate;uniform vec2 uniformOffset;void main(){varyinTexCoordinate=attrVertex+uniformOffset;gl_Position=vec4(attrVertex,0,1);}";var Q="precision mediump float;varying vec2 varyinTexCoordinate;void main() {gl_FragColor=vec4(varyinTexCoordinate,0,1);}";var T=P.createBuffer();P.bindBuffer(P.ARRAY_BUFFER,T);var R=new Float32Array([-0.2,-0.9,0,0.4,-0.26,0,0,0.732134444,0]);P.bufferData(P.ARRAY_BUFFER,R,P.STATIC_DRAW);T.itemSize=3;T.numItems=3;var O=P.createProgram(),S=P.createShader(P.VERTEX_SHADER);P.shaderSource(S,M);P.compileShader(S);var V=P.createShader(P.FRAGMENT_SHADER);P.shaderSource(V,Q);P.compileShader(V);P.attachShader(O,S);P.attachShader(O,V);P.linkProgram(O);P.useProgram(O);O.vertexPosAttrib=P.getAttribLocation(O,"attrVertex");O.offsetUniform=P.getUniformLocation(O,"uniformOffset");P.enableVertexAttribArray(O.vertexPosArray);P.vertexAttribPointer(O.vertexPosAttrib,T.itemSize,P.FLOAT,!1,0,0);P.uniform2f(O.offsetUniform,1,1);P.drawArrays(P.TRIANGLE_STRIP,0,T.numItems);if(P.canvas!=null){W.push(I(P.canvas.toDataURL()));}W.push(P.getSupportedExtensions().join(";"));W.push(L(P.getParameter(P.ALIASED_LINE_WIDTH_RANGE)));W.push(L(P.getParameter(P.ALIASED_POINT_SIZE_RANGE)));W.push(P.getParameter(P.ALPHA_BITS));W.push(P.getContextAttributes().antialias);W.push(P.getParameter(P.BLUE_BITS));W.push(P.getParameter(P.DEPTH_BITS));W.push(P.getParameter(P.GREEN_BITS));W.push(U(P));W.push(P.getParameter(P.MAX_COMBINED_TEXTURE_IMAGE_UNITS));W.push(P.getParameter(P.MAX_CUBE_MAP_TEXTURE_SIZE));W.push(P.getParameter(P.MAX_FRAGMENT_UNIFORM_VECTORS));W.push(P.getParameter(P.MAX_RENDERBUFFER_SIZE));W.push(P.getParameter(P.MAX_TEXTURE_IMAGE_UNITS));W.push(P.getParameter(P.MAX_TEXTURE_SIZE));W.push(P.getParameter(P.MAX_VARYING_VECTORS));W.push(P.getParameter(P.MAX_VERTEX_ATTRIBS));W.push(P.getParameter(P.MAX_VERTEX_TEXTURE_IMAGE_UNITS));W.push(P.getParameter(P.MAX_VERTEX_UNIFORM_VECTORS));W.push(L(P.getParameter(P.MAX_VIEWPORT_DIMS)));W.push(P.getParameter(P.RED_BITS));W.push(P.getParameter(P.RENDERER));W.push(P.getParameter(P.SHADING_LANGUAGE_VERSION));W.push(P.getParameter(P.STENCIL_BITS));W.push(P.getParameter(P.VENDOR));W.push(P.getParameter(P.VERSION));}return W;}function u(N,M){if(!N){return false;}var L=N.length;while(L--){if(N[L]===M){return true;}}return false;}function I(L){return CryptoJS.SHA256(L).toString(CryptoJS.enc.Hex);}function q(L){if(y){console.log("DEBUG("+i+"): "+L);}}function s(L){L="ERROR("+i+"): "+L;if(F.console&&F.console.log){console.log(L);}else{if(G){alert(L);}}}function b(L,O){var N=new Date().toUTCString();for(var M in C){if(!u(x,M)&&C[M].isEnabled()){C[M].set(L,JSON.stringify({timestamp:N,nonce:O}));}}}function e(M){var V=[];var W=[];for(var Q in C){if(!u(x,Q)&&C[Q].isEnabled()){var N=C[Q].get(M);if(N){var X=JSON.parse(N);X.storageType=Q;V.push(X);q("For nonce "+M+", fetched nonce value "+N+" from storage type "+Q);}else{W.push(Q);}}}if(V.length===0){q("Could not find a nonce value for "+M);return undefined;}var O=0;if(V.length>1){var U=Date.parse(V[O].timestamp);var P=1,T=false;do{var L=Date.parse(V[P].timestamp);if(L!==U){q("Mismatch between nonce timestamps!");T=true;if(L>U){q("Timestamp for nonce value in storage type "+V[P].storageType+" is newer than for storage type "+V[O].storageType);O=P;U=L;}}}while(++P<V.length);if(T){q("Fixing nonce timestamp inconsistencies.");var S=V[O].timestamp;var R=V[O].nonce;N=JSON.stringify({timestamp:S,nonce:R});for(P=0;P<V.length;P++){if(V[P].timestamp!==S){Q=V[P].storageType;q("Storage type "+Q+" is being updated with the latest timestamp and nonce values: "+N);C[Q].set(M,N);}}}}for(P=0;P<W.length;P++){N=JSON.stringify({timestamp:V[O].timestamp,nonce:V[O].nonce});Q=W[P];C[Q].set(M,N);q("Restoring nonce "+M+" with value "+N+" to storage type "+Q);}return V[O].nonce;}function k(L){for(var M in C){if(!u(x,M)&&C[M].isEnabled()){C[M].remove(L);}}}function z(){var R="__DeviceFPInUse__";var Q={};var P=[];var M=null;var L=null;Q.setAttributeExclusions=function(T){var U=Object.keys(A).concat(Object.keys(D));if(T instanceof Array){if(T.length>=U.length){s("Ignoring attempt to set device attribute exclusions as the value provided would have excludedall attributes.");}else{var W=true;for(var V=0;V<T.length;V++){if(!u(U,T[V])){W=false;break;}}if(W){v=T;}else{s("Ignoring attempt to set device attribute exclusions as an unknown attribute '"+T[V]+"' was found.");}}}else{if(typeof T==="string"){if(u(U,T)){v=[T];}else{s("Ignoring attempt to set device attribute exclusions as an unknown attribute '"+T+"' was provided.");}}else{s("Ignoring attempt to set device attribute exclusions as the value provided was neither an Array nor a String.");}}return Q;};Q.setStorageTypeExclusions=function(T){if(T===null){x=null;return Q;}var V=Object.keys(C);if(T instanceof Array){if(T.length>=V.length){s("Ignoring attempt to set storage type exclusions as the value provided would have excluded all storage types.");}else{var W=true;for(var U=0;U<T.length;U++){if(!u(V,T[U])){W=false;break;}}if(W){x=T;}else{s("Ignoring attempt to set storage type exclusions as an unknown storage type '"+T[U]+"' was found.");}}}else{if(typeof T==="string"){if(u(V,T)){x=[T];}else{s("Ignoring attempt to set storage type exclusions as an unknown storage type '"+T+"' was provided.");}}else{s("Ignoring attempt to set storage type exclusions as the value provided was neither an Array nor a String.");}}return Q;};Q.addPostProcessor=function(T){if(typeof T!=="function"){s("Post-processor specified is not a function");}else{q("Adding post-processor");H.push(T);}return Q;};Q.removeAllPostProcessors=function(){q("Removing all post-processors");H=[];return Q;};Q.getDeviceFingerprint=function(W,V){if(W&&typeof W!=="function"){s("When callback is provided, it must be a function.");return false;}d={};d.platform="web";d.version=g;d.attributes={};if(!!a){d[a]={};}for(var T in A){if(!u(v,T)){try{d.attributes[T]=A[T]();}catch(U){s("Attribute error for "+T+": "+U);if(!!a){d[a][T]=U;}}}}L=W;P=[];for(var T in D){if(!u(v,T)){if(typeof W==="undefined"){if(!!a){d[a][T]="requires a callback function";}}else{P.push(T);try{D[T](T);}catch(U){s("Attribute error for "+T+": "+U);if(!!a){d[a][T]=U;}}}}}b(R,true);if(typeof W==="undefined"){N();return y?JSON.stringify(d,null,4):JSON.stringify(d);}else{if(typeof V==="undefined"||typeof V!=="number"){V=4000;}if(!Q.asynchronousAttributesCheckDone()){M=setTimeout(S,V);}return true;}};function S(){while(P.length){var T=P.pop();q("timed out waiting for [attribute="+T+"]");if(!!a){d[a][T]="timed out waiting for response";}}N();L(y?JSON.stringify(d,null,4):JSON.stringify(d));}function N(){for(var T=0;T<H.length;T++){q("executing post-processor #"+(T+1));H[T](d);}}function O(U){for(var T=0;T<P.length;T++){if(P[T]===U){P.splice(T,1);break;}}}Q.asynchronousAttributeSet=function(T,U){q("setting asynchronous attribute [attribute="+T+"] [value="+U+"]");d.attributes[T]=U;O(T);Q.asynchronousAttributesCheckDone();};Q.asynchronousAttributeFail=function(U,T){q("failed asynchronous attribute [attribute="+U+"] [message="+T+"]");if(!!a){d[a][U]=T;}O(U);Q.asynchronousAttributesCheckDone();};Q.asynchronousAttributesCheckDone=function(){if(!P.length){if(!!M){clearTimeout(M);M=null;}N();L(y?JSON.stringify(d,null,4):JSON.stringify(d));return true;}else{return false;}};Q.isDeviceFingerprintInUse=function(){return !!e(R);};Q.getDeviceId=function(){var V=[];for(var X in A){if(!u(v,X)){V.push(X);}}V.sort();var T="";for(var W=0,U=V.length;W<U;W++){var X=V[W];try{var Z=A[X]();T+=X+"="+Z+"\n";}catch(Y){s("Attribute error for "+X+": "+Y);if(!!a){d[a][X]=Y;}}}q("Device Fingerprint String For Hashing:\n"+T);return I(T);};Q.setMachineNonceName=function(T){if(T&&T!==c){t=T;}else{s("Ignoring attempt to set the machine nonce name since no value was provided, or it is the same as the sequence nonce name.");}return Q;};Q.setSequenceNonceName=function(T){if(T&&T!==t){c=T;}else{s("Ignoring attempt to set the sequence nonce name since no value was provided, or it is the same as the machine nonce name.");}return Q;};Q.setStorageTypeOptions=function(T){if(T&&typeof T==="object"){l=T;}else{s("Ignoring attempt to set storage types options as the value provided was not an Object.");}return Q;};Q.setErrorAttributeName=function(T){if(T&&typeof T==="string"){if(T in A||T in D){s("The parameter you provided shares a name with a fingerprint attribute.");}else{a=T;}}else{s("The parameter you provided to setErrorAttributeName was not a string.");}return Q;};Q.setDebugOn=function(T){if(typeof T==="boolean"){if(F.console&&F.console.log){y=T;}else{y=false;if(T){alert("Ignoring attempt to turn on debugging as there is no console available. Error logs will still be reported in an alert dialog.");G=true;}else{G=false;}}}return Q;};Q.storeMachineNonce=function(T){b(t,T);return Q;};Q.storeSequenceNonce=function(T){b(c,T);return Q;};Q.fetchMachineNonce=function(){return e(t);};Q.fetchSequenceNonce=function(){return e(c);};Q.doNotRemember=function(){k(t);k(c);k(R);return Q;};Q.initializeFlash=function(U,T){q("Asking to initialize Flash");if(typeof U!=="function"){s("The first argument to initializeFlash must be a callback function.");}else{if(T&&typeof T!=="number"){s("The optional second argument to initializeFlash must be a wait time in milliseconds.");}else{C.flash.init(U,T);}}return Q;};Q.addExtensions=function(T){if(typeof T==="function"){T(Q);}else{s("Ignoring attempt to add extend the functionality because the initializer function provided is not a function.");}return Q;};Q.addDeviceAttribute=function(T,U){if(A[T]===undefined&&/[\/ ]/.exec(T)===null&&typeof U==="function"){A[T]=U;}else{s("Ignoring attempt to add a new device attribute as its name is already in use, contains illegal characters, and/or the evaluator provided is not a function.");}return Q;};Q.addDeviceAsynchronousAttribute=function(T,U){if(D[T]===undefined&&/[\/ ]/.exec(T)===null&&typeof U==="function"){D[T]=U;}else{s("Ignoring attempt to add a new device asynchronous attribute as its name is already in use, contains illegal characters, and/or the evaluator provided is not a function.");}return Q;};Q.setFlashIsReady=function(){if(C.flash.timeoutid!==undefined){clearTimeout(C.flash.timeoutid);C.flash.timeoutid=undefined;}q("Flash told us that its ready. Testing that claim ...");var T="__EntrustDatacard__";var U=new Date().toUTCString();C.flash.set(T,U);C.flash.enabled=(C.flash.remove(T)===U);q("Flash is enabled: "+C.flash.enabled);if(C.flash.callback!==undefined){C.flash.callback(C.flash.enabled);C.flash.callback=undefined;}};Q.isPageReady=function(){var T=document.readyState==="complete";q("Flash is asking whether we're ready: "+T);return T;};Q.flashInitError=function(){C.flash.enabled=false;};Q.flashDebug=function(T){q("Flash -> "+T);};Q.flashError=function(T){s("Flash -> "+T);};return Q;}if(!Object.keys){Object.keys=function(N){var M=[];for(var L in N){if(N.hasOwnProperty(L)){M.push(L);}}return M;};}if(typeof machineSecret==="undefined"){F.machineSecret=z();}})(window);;
(function () {
    'use strict';

    angular.module('ActimizeModule', []);    
})();;
(function () {
    'use strict';

    angular.module('ActimizeModule').service("ActimizeService", actimizeService);

    function actimizeService() {
        this.DeviceData = function () {
            // Do not include time sensitive attributes in the device ID.
            // US Bank asked for two time sensitive attributes to be added
            // to the extended attributes category, webDeviceLocalDateTime and
            // webDeviceNormalizedDateTime. The values of both of these attributes
            // change every millisecond. Thus, they cannot be included in the device
            // ID calculation or the device ID value itself will change every
            // millisecond. Thus, it is imperative that the device ID be calculated
            // *before* adding the extended attributes and requesting the device
            // fingerprint value.
            machineSecret.setStorageTypeExclusions('flash');
            var deviceId = machineSecret.getDeviceId();
            var fingerprint = machineSecret.addExtensions(machineSecretExtendAttributes)
                                            .setAttributeExclusions('geoLocation')
                                            .getDeviceFingerprint();
            var actimizestring = '{"DeviceID":"' + deviceId + '","DeviceData":' + fingerprint + ',"Browser UserAgent":"' + navigator.userAgent + '"}';
            var finalActimizestring = encodeURIComponent(actimizestring);
            return finalActimizestring;
        }
    }
})();;
(function () {
    'use strict';

    angular
        .module('CommonModule')
        .directive('compareTo', function () {
                return {
                    require: "ngModel",
                    scope: {
                        otherModelValue: "=compareTo"
                    },
                    link: function (scope, element, attributes, ctrl) {
                            ctrl.$parsers.unshift(function (viewValue, $scope) {
                                var compareTo = viewValue != scope.otherModelValue;
                                ctrl.$setValidity('compareTo', !compareTo);
                                return compareTo;
                            });
                    }
                }
        });
})();;
(function () {

    'use strict';

    angular.module('sharedAuthStepUp', ['ui.bootstrap', 'ui.router', 'ngBusy', 'ngAria', 'sharedAuthOmniTemplateModule'])
        .config(['$stateProvider', '$urlRouterProvider', function ($stateProvider, $urlRouterProvider) {

            $stateProvider
                .state('init', {
                    name: 'init',
                    //                    url: '/',
                    template: ''
                })
                .state('authOptions', {
                    name: 'authOptions',
                    //                    url: '/authOptions',
                    params: {
                        transmitParams: null
                    },
                    templateUrl: 'ChildAuthOptionPage.html',
                    controller: "AuthOptionController"

                })
                .state('ErrorPage', {
                    name: 'error',
                    params: {
                        transmitParams: null
                    },
                    templateUrl: 'ErrorPage.html',
                    controller: "ErrorPageController"

                })
                .state('otpTarget', {
                    name: 'otpTarget',
                    //                    url: '/otpTarget',
                    params: {
                        transmitParams: null
                    },
                    templateUrl: 'ChildOTPSelectTarget.html',
                    controller: "OTPTargetController"

                }).state('inputOTPCode', {
                    name: 'inputOTPCode',
                    //                    url: '/inputOTPCode',
                    params: {
                        transmitParams: null
                    },
                    templateUrl: 'ChildOTPInputCode.html',
                    controller: "InputOTPController"
                }).state('mobApprove', {
                    name: 'mobApprove',
                    //                    url: '/mobApprove',
                    params: {
                        transmitParams: null
                    },
                    templateUrl: 'ChildMobileApprove.html',
                    controller: "MobileApproveController"
                }).state('pendingApproval', {
                    name: 'pendingApproval',
                    //                    url: '/pendingApproval',
                    params: {
                        transmitParams: null
                    },
                    templateUrl: 'PendingApproval.html',
                    controller: "PendingApprovalController"
                }).state('idshield', {
                    name: 'idshield',
                    //                    url: '/idshield',
                    params: {
                        transmitParams: null
                    },
                    templateUrl: 'ChildIDShield.html',
                    controller: "IDShieldController"
                }).state('password', {
                    name: 'password',
                    //                    url: '/password',
                    params: {
                        transmitParams: null
                    },
                    templateUrl: 'Password.html',
                    controller: "PasswordController"
                }).state('cancelauth', {
                    name: 'cancelauth',
                    //                    url: '/cancelauth',
                    params: {
                        transmitParams: null
                    },
                    templateUrl: 'StepupCancellation.html',
                    controller: "ConfirmPopController"
                }).state('inputOTPCodeMNC', {
                    name: 'inputOTPCodeMNC',
                    //                    url: '/inputOTPCode',
                    params: {
                        transmitParams: null
                    },
                    templateUrl: 'ChildOTPInputCodeMNC.html',
                    controller: "InputOTPController"
                })


        }]);

    //End Routing
    // This Controller is specifically added for Login scenario in TUX.
    angular.module("sharedAuthStepUp")
        .controller("TransmitLoginStepupController", transmitLoginStepupController);

    transmitLoginStepupController.$inject = ['$rootScope', '$scope', 'dataContainer', 'idShieldService', '$state', 'transmitService'];

    function transmitLoginStepupController($rootScope, $scope, dataContainer, idShieldService, $state, transmitService) {
        var transmitLoginParams = OmniDataUtil.getOmniData('transmitLoginParams');
        $scope.Username = transmitLoginParams.Username;
        dataContainer.TransactionID = transmitLoginParams.TransactionId;
        dataContainer.IDShieldBaseURL = transmitLoginParams.IdshieldBaseUrl;
        dataContainer.PasswordBaseURL = transmitLoginParams.PasswordBaseUrl;
        dataContainer.TransmitAppID = transmitLoginParams.TransmitAppid;
        dataContainer.ImageBaseURL = transmitLoginParams.ImageBaseURL;
        dataContainer.SoundBaseURL = transmitLoginParams.SoundBaseURL;
        dataContainer.TransmitPolicy = transmitLoginParams.TransmitPolicy;
        dataContainer.TransmitURL = transmitLoginParams.TransmitUrl;
        dataContainer.RedirectToLogin = transmitLoginParams.RedirectToLogin;
        dataContainer.RedirectToLoginWithError = transmitLoginParams.RedirectToLoginWithError;
        dataContainer.IsOAMEnabled = transmitLoginParams.isOAMEnabled;
        dataContainer.OAMPostUrl = transmitLoginParams.OAMPostUrl;
        dataContainer.ActimizeData = transmitLoginParams.ActimizeData;

        dataContainer.RedirectToResetOrChangePassword = function (isChangePassword, existingPassword) {
            var isResetPassword = true;
            if (isChangePassword) {
                isResetPassword = false;
            }
            idShieldService.loginAssit(true, false, true, "", "", isResetPassword, isChangePassword, existingPassword);
        }

        dataContainer.SuccessHandler = function (response) {
            transmitLoginParams.TransmitCall(response);
        };

        dataContainer.ErrorHandler = function (response) {

            if (response.userLockedQA) {
                idShieldService.loginAssit(true, false, true, "");
                return;
            }
            if (response.isDeviceNotAvailable) {
                transmitLoginParams.ErrorCallBack();
                return;
            }
            transmitLoginParams.ErrorCallBack(response);
        };

        $scope.saSuccessHandler = function (response) {
            transmitLoginParams.TransmitCall(response);
        };

        $scope.saErrorHandler = function (response) {

            if (response.userLockedQA) {
                idShieldService.loginAssit(true, false, true, "");
                return;
            }
            if (response.isDeviceNotAvailable) {
                transmitLoginParams.ErrorCallBack();
                return;
            }
            // When user denies the push notification
            if (response.isMobileApprovalDenied) {
                transmitLoginParams.RedirectToLoginWithError("DenyErrorMessage");
                return;
            }
            transmitLoginParams.ErrorCallBack(response);
        };
    }

    angular.module("sharedAuthStepUp")
        .controller("SharedAuthModalCtrl", sharedAuthStepUpCtrl);

    sharedAuthStepUpCtrl.$inject = ['$rootScope', '$injector', '$state', '$scope', '$modal', '$location', 'SASiteCatService', 'idShieldService', '$compile', 'MMScrollService', 'transmitService'];

    function sharedAuthStepUpCtrl($rootScope, $injector, $state, $scope, $modal, $location, SASiteCatService, idShieldService, $compile, MMScrollService, transmitService) {

        var _onMBQASuccessHandler;
        var vm = $scope;
        var modalInstance;
        var isLinkCustomizationFor24HB = false;
        var openOverlay = true;
        //defect fix for screen reader reading behind screens
        vm.dialogOpen = false;
        vm.showPlaceHolder = showPlaceHolder;
        vm.navigatePage = navigatePage;
        vm.showServiceModal = showServiceModal;
        vm.showLogInAssistance = showLogInAssistance;
        //vm.transmitLogout = transmitLogout;

        vm.opts = {
            backdrop: true,
            keyboard: true,
            templateUrl: 'StepUpContainer.html',
            controller: AuthModalInstanceCtrl,
            //windowClass: 'sharedauth-modal-open',
            resolve: {} // empty storage
        };

        $rootScope.$on('MBQASuccess', function (event, response) {
            if (_onMBQASuccessHandler) _onMBQASuccessHandler(event, response);
        });

        //Show QA place hodler screen for Mobile
        function showPlaceHolder(params) {
            //Defect#20729
            $scope.isKitkat = false;
            if (navigator.userAgent.match(/Android/i)) {
                var deviceOs = parseFloat(navigator.appVersion.split("Android ")[1].split(';')[0]);
                if (deviceOs >= 4.4 && deviceOs < 5) {
                    $scope.isKitkat = true;
                    //$('.modal-content').css('top','50%');
                }
            }
            //vm.ContextData = params.ContextData;
            vm.username = params.username;
            //vm.TransmitURL = params.TransmitURL;
            params.hasResumePlaceholder = params.resumePlaceholder ? true : false;

            //Open a modal dialog
            openModal(params);

            _onMBQASuccessHandler = function (event, response) {
                params.resumePlaceholder(response);
                modalInstance.dismiss();
            };

            $rootScope.$on('LoginAssistance', function (event, response) {
                params.failed({ "error": "LoginAssitanceClicked", "code": "1001" });
                modalInstance.dismiss();
            });
            $rootScope.$on('NotifySiteCat', function (event, response) {
                params.notifySiteCat(response);
            });
            //Navigate to ID Shield
            vm.navigatePage(params.defaultauth, params);
        }

        function showLogInAssistance(params) {
            var baseURL = params.BaseURL;
            var urlSplit = baseURL.split('/');
            var protocol = urlSplit[0];
            var domain = urlSplit[2];
            var sub_url = protocol + '//' + domain;
            idShieldService.loginAssit($scope.accountLocked, false, false, sub_url);
        }

        //transmit websdk logout
        function transmitLogout(params) {

            require(['xm/xmui', 'xm/xm_api'], function (xmui, xm) {

                var uiConf = {
                    "loginConf": {
                        "aid": params.TransmitAppID,
                        "policy": params.TransmitPolicy
                    }
                };
                var authResultPromise;
                if (xmui)
                    xmui.configure(uiConf);
                if (xm)
                    xm.setWebloginUrl(params.TransmitURL);

                if (xmui && xmui.logout) {
                    for (var k in window.sessionStorage) {
                        if (window.sessionStorage.hasOwnProperty(k)) {
                            var i = k.indexOf('ts:sessionId:');
                            if (i > -1) {
                                var uid = k.substring(13);
                                if (window.sessionStorage.getItem('ts:provisionalSession:' + uid) == true) { console.log('session is provisional'); }
                                else {
                                    authResultPromise = xmui.logout(uid);
                                }
                            }
                        }
                    }

                    if (authResultPromise) {
                        authResultPromise.then(
                            function (response) {
                                if (params.success)
                                    params.success(response);
                            },
                            function (error) {
                                //TODO:- need to send the proper error message
                                if (params.failed)
                                    params.failed(error);
                            }
                        );
                    } else {
                        if (params.failed)
                            params.failed({ "status": "error", "code": "-1" });
                    }
                } else {
                    if (params.failed)
                        params.failed({ "status": "error", "code": "-2" });
                }
            });
        }

        //Navigate through different screens
        function navigatePage(pageName, params) {
            $state.go(pageName, { transmitParams: params });
        }

        //Adding null check
        document.addEventListener("focus", function (event) {
            var d = document.getElementById("sharedAuthstepUpContainer");
            if (d != null) {
                if (vm.dialogOpen && !d.contains(event.target)) {
                    event.stopPropagation();
                    d.focus();
                }
            }

        }, true);
        // To Open Stepup Modal
        function openModal(params) {
            vm.dialogOpen = true;
            modalInstance = $modal.open(vm.opts);

            angular.element(document.getElementsByTagName('body')).toggleClass("sharedauth-modal-open");

            setTimeout(function () {
                if (params.TransmitAppID == "mbl") {
                    var dom = document.getElementsByClassName("modal fade ng-isolate-scope in")[0];
                    if (dom != undefined && dom != "") {
                        dom.setAttribute("role", "dialog");
                        dom.setAttribute("aria-live", "assertive");
                        dom.removeAttribute("ng-click"); // fix for VO reading as clickable
                    }
                }
                //defect fix for scroll issue and page ui issue in lower end android #20013 #22080
                var domModalContent = document.getElementsByClassName("modal-content")[0];
                if (domModalContent != undefined && domModalContent != "") {
                    if ($scope.isKitkat == true) {
                        domModalContent.setAttribute("style", "overflow:auto !important; max-height:100% !important; top:50% !important");
                    } else {
                        domModalContent.setAttribute("style", "overflow:auto !important; max-height:100% !important;");
                    }
                    domModalContent.setAttribute("role", "document");
                }

            }, 1000);

            modalInstance.result.then(function () {
                //on ok button press 
            }, function (event) {

                //Clear listeners to use again.
                $rootScope.$$listeners.MBQASuccess = []; //Multiple events issue fix
                angular.element(document.getElementsByTagName('body')).toggleClass("sharedauth-modal-open");

                if (event === "closedOnError") {
                    vm.dialogOpen = false;
                }
            });

            return modalInstance;
        }

        //Funcion to loop tabfocus within modal dialog
        function trapTabfocus(e) {
            if (document.querySelector('div[saloginwidget]') == null || document.querySelector('div[saloginwidget]') == 'undefined') {
                var Dialog = document.getElementById("sharedAuthstepUpContainer");
                if (!Dialog) return;

                var focusableElsall = Dialog.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]');
                if (!focusableElsall || focusableElsall.length == 0) return;

                var focusableEls = [];
                for (var i = 0; i < focusableElsall.length; i++) {
                    var el = focusableElsall[i];
                    var pel = focusableElsall[i].parentElement;
                    var style, style1;
                    if (el != null || el != undefined) {
                        style = window.getComputedStyle(el);
                    }
                    else {
                        style = null;
                    }
                    if (pel != null || pel != undefined) {
                        style1 = window.getComputedStyle(pel);
                    }
                    else {
                        style1 = null;
                    }
                    if (style != null && style1 != null) {
                        if (style.display != 'none' && style.visibility != 'hidden') {
                            if (style1.display != 'none' && style1.visibility != 'hidden') {
                                focusableEls.push(focusableElsall[i]);
                            }
                        }
                    }
                }
                focusableEls = Array.prototype.slice.call(focusableEls);
                var firstFocusableEl = focusableEls[0];
                var lastFocusableEl = focusableEls[focusableEls.length - 1];
                var KEY_TAB = 9;
                var KEY_ESC = 27;

                function handleBackwardTab() {
                    if (document.activeElement === firstFocusableEl) {
                        e.preventDefault();
                        lastFocusableEl.focus();
                    }
                }
                function handleForwardTab() {
                    if (document.activeElement === lastFocusableEl) {
                        e.preventDefault();
                        firstFocusableEl.focus();
                    }
                }

                switch (e.keyCode) {
                    case KEY_TAB:
                        if (focusableEls.length === 1) {
                            e.preventDefault();
                            break;
                        }
                        if (e.shiftKey) {
                            handleBackwardTab();
                        } else {
                            handleForwardTab();
                        }
                        break;
                    default:
                        break;
                }
            }
        }

        //Show All Authenticators
        function showServiceModal(params) {

            vm.successHandler = params.success;
            vm.failureHandler = params.failed;
            vm.TransmitURL = getServiceURL(params.TransmitURL, $location);
            vm.username = params.username.toLowerCase();
            vm.TransmitAppID = params.TransmitAppID;
            vm.TransmitPolicy = params.TransmitPolicy;
            vm.requestParameter = {
                resumePlaceHolder: params.resumePlaceHolder ? true : false,
                username: params.username,
                TransactionID: params.TransactionID,
                IDShieldBaseURL: getServiceURL(params.IDShieldBaseURL, $location),
                PasswordBaseURL: getServiceURL(params.PasswordBaseURL, $location),
                ContextData: params.ContextData ? params.ContextData : "",
                TransmitAppID: params.TransmitAppID ? params.TransmitAppID : "web",
                stepupQuestion: params.stepupQuestion,
                policyID: params.TransmitPolicy,
                actimizeData: params.ActimizeData ? params.ActimizeData : "",
                modelDialogOnClose: params.closeHandler || params.modalClose,
                showModalDialog: !params.StepupWithoutOverlay
            };

            if (params.additionalParams) {
                vm.additionalParams = params.additionalParams;
            }
            //defect fix 19742
            if (params.closeHandler) {
                vm.closeHandler = params.closeHandler;
                //defect fix 20458
                $rootScope.authcncl = params.closeHandler;
            }

            // To differentiate the Stepup Overlay and Stepup screen
            if (params.StepupWithoutOverlay) {
                openOverlay = false;
            }

            // To remove Need Help? link and add Change Auth link in 24 HB Screen (Stepup Without Overlay)
            if (params.LinksCustomizationFor24HBScreen) {
                isLinkCustomizationFor24HB = true;
            }
            //CEI content change #3
            // To know if initiated from CEI
            if (params.isCEI) {
                $scope.isCEI = true;
            }
            // To remove close button by default
            if (params.HideCloseButton) {
                $scope.HideCloseButton = true;
            }
            else {
                $scope.HideCloseButton = false;
            }
            $scope.$on('lockoutUser', function (event, data) {
                $rootScope.isUserLocked = true;
            });
            $scope.$on('authCancel', function (event, data) {
                modalInstance.dismiss("cancel");
            });
            $scope.$on('ShowHideLinks', function (event, data) {
                if (isLinkCustomizationFor24HB) {
                    $scope.is24HBScreen = true;
                }
                else {
                    $scope.is24HBScreen = false;
                }
            });

            //defect fix #21534
            $rootScope.dialogHeading = "";
            $rootScope.transmitOTPParams = vm.requestParameter;

            //Clear previous state
            vm.navigatePage('init');
            //check for mbl
            if (vm.TransmitAppID != "mbl" && ((window.currentPageID != null) || (typeof (window.currentPageID) != "undefined"))) {
                var focusable = 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]';
                var currentpageID = window.currentPageID;
                var domCurrentPg = document.getElementById(currentpageID);
                domCurrentPg.setAttribute("aria-hidden", "true");
                $("#" + currentpageID).find(focusable).attr('tabindex', '-1');
                //passing value to another controller
                $rootScope.toAuthCncl = vm.TransmitAppID;
            }
            else if (vm.TransmitAppID != "mbl") {
                var focusable = 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]';
                var domContainerOLB = document.getElementsByClassName("container")[0];
                if (domContainerOLB != undefined && domContainerOLB != "") {
                    domContainerOLB.setAttribute("aria-hidden", "true");
                    $(".container").find(focusable).attr('tabindex', '-1');
                }
                var domFooterOLB = document.getElementById("footer"); //fix 22987
                if (domFooterOLB != undefined && domFooterOLB != "") {
                    domFooterOLB.setAttribute("aria-hidden", "true");
                    $("#footer").find(focusable).attr('tabindex', '-1');
                }
                var domGssUIWrapper = document.getElementById("gssUIWrapper");
                if (domGssUIWrapper != undefined && domGssUIWrapper != "") {
                    domGssUIWrapper.setAttribute("aria-hidden", "true");
                    $("#gssUIWrapper").find(focusable).attr('tabindex', '-1');
                }
                sessionStorage.setItem("isDialogOpen", true);
                $(document).keydown(function (e) {
                    var dialogToken = sessionStorage.getItem("isDialogOpen");
                    if (dialogToken == "true") {
                        trapTabfocus(e);
                    }
                });
            }

            var modalInstance;

            transmitService.clearEventHandlers();

            transmitService.onAuthenticatorsChanged(function (eventArgs) {
                if (openOverlay && !vm.dialogOpen) {
                    modalInstance = openModal(params);
                    transmitService.setModalInstance(modalInstance);
                }
            });

            transmitService.onAuthenticatorFailure(function (eventArgs) {
                if (openOverlay && !vm.dialogOpen) {
                    modalInstance = openModal(params);
                    transmitService.setModalInstance(modalInstance);
                }
            });

            transmitService.onAuthenticatorCancelled(function () {
                if (modalInstance) modalInstance.dismiss("cancel");
                vm.dialogOpen = false;

                if ($state.params.transmitParams && $state.params.transmitParams.TransmitAppID !== 'mbl') { //null check added for failure scenario.
                    if ($state.params.transmitParams && $state.params.transmitParams.type == 'otp') {
                        SASiteCatService.onTrackSharedStepUpClickEvent("StepUpAuthentication", "AuthenticationOTPCloseLink");
                    } else {
                        SASiteCatService.onTrackSharedStepUpClickEvent("StepUpAuthentication", "AuthenticationCloseLink");
                    }
                }

                $rootScope.mainClose = true;

                if ($rootScope.systemError) {
                    $rootScope.$broadcast('authCancel', null);
                }

                if ($state.params.transmitParams && $state.params.transmitParams.hasResumePlaceholder && $state.params.transmitParams.failed) {
                    $state.params.transmitParams.failed({ "error": "cancelled", "code": "105" });
                }
            });

            transmitService.onAuthenticatorSuccess(function () {
                if (modalInstance) modalInstance.dismiss("cancel");
                vm.dialogOpen = false;
            });

            $rootScope.systemError = false;
            //Call Transmit for available authenticators for this policy/user
            showTransmitAuthOptions(modalInstance, null, vm.username, vm.successHandler, vm.failureHandler, vm.TransmitAppID, vm.TransmitPolicy, vm.TransmitURL, vm.requestParameter, vm, vm.additionalParams, SASiteCatService, $rootScope, {}, transmitService);
            //fix for 20941
            if (vm.TransmitAppID != "mbl" && ((window.currentPageID != null) || (typeof (window.currentPageID) != "undefined"))) {
                $scope.updatePageScroll("MAscroller", "#wrapperId", "#scrollerId", 10, null, 100, false, null);
            }
        }

        //fix for 20941
        $scope.updatePageScroll = function (scrollObj, wrapperId, scrollerId, individualHeight, dataArray, additionalHeight, staticPage, staticHeight) {

            var adjustedHeight = 0;

            if (staticPage) { // Is page already rendered
                if (staticHeight) //manual calculation
                    adjustedHeight = staticHeight;
                else if (angular.element(scrollerId)) // Auto calculations with scroller
                    adjustedHeight = angular.element(scrollerId).outerHeight();
            } else if (dataArray) { // For ajax calls
                adjustedHeight = adjustedHeight + (dataArray * individualHeight);
            }

            //this is for top label and bottom CMS content height.
            if (additionalHeight)
                adjustedHeight += additionalHeight;

            // //This method destroys the previously calculated height of the container.
            MMScrollService.destroyParamterizedScroll(scrollObj);

            setTimeout(function () {
                // //This method needs custom parameters to be passed to differentiate the multiple wrapper and scrollers.
                MMScrollService.updatePageWithScrollOmni(scrollObj, wrapperId, scrollerId, adjustedHeight);
                var wrprht = document.getElementById("wrapperId");
                wrprht.setAttribute("style", "height:400px;");
                var scrlrht = document.getElementById("scrollerId");
                scrlrht.style.height = "700px";
            }, 500);
        }
    }

    angular.module("sharedAuthStepUp")
        .controller('AuthModalInstanceCtrl', AuthModalInstanceCtrl);

    AuthModalInstanceCtrl.$inject = ['$scope', '$rootScope', '$modalInstance', '$modal', '$state', 'SASiteCatService', 'transmitService', 'transmitEventsService'];

    function AuthModalInstanceCtrl($scope, $rootScope, $modalInstance, $modal, $state, SASiteCatService, transmitService, transmitEventsService) {

        $scope.cancel = function (event) {

            if ($state && $state.params &&
                $state.params.transmitParams &&
                $state.params.transmitParams.hasResumePlaceholder &&
                $state.params.transmitParams.failed) {
                $state.params.transmitParams.failed({ "error": "cancelled", "code": "105" });
            }

            if ($state &&
                $state.params &&
                $state.params.transmitParams &&
                $state.params.transmitParams.TransmitAppID == "mbl")
                return;

            if (transmitService.iAuthenticationErrored()) {
                if ($modalInstance) $modalInstance.dismiss("closedOnError");
                return;
            }

            if (transmitEventsService) transmitEventsService.showAuthCancelConfirmation();
            if (event) event.preventDefault();
        };
    }

    var getServiceURL = function (serviceurl, location) {

        var port = location.port() ? ':' + location.port() : '';
        return location.protocol() + '://' + location.host() + port + serviceurl;

    }

    var getErrorMessage = function (cflowcontext, SASiteCatService) {

        if (cflowcontext) {

            // D23716: Lockout is happening in OTP step up after 4 incorrect attempts
            // Even though the user is getting locked in the 3rd attempt, the error_code which receive from Transmit says 5 and taking the user through woring code flow
            // This has been fixed no checking the locked before getting into the switch...case statement
            if (cflowcontext.data.data != null && cflowcontext.data.data.locked == true) {
                SASiteCatService.onTrackSharedStepUpClickEvent("StepUpAuthentication", "AuthenticationOTPLockedError");
                return "locked";
            }
            switch (cflowcontext.data.assertion_error_code) {
                case 5: //Authentication failed - secret/credentials passed as part of the assertion are incorrect.
                    SASiteCatService.onTrackCustomSharedStepUp("StepUpAuthentication", "AuthenticationOTPIncorrectError");
                    return "That seems to be the wrong code. Please try again.";
                    break;
                case 9: //Internal error
                    return "We're sorry. We are having problems on our end. It shouldn't be too long, so please try again shortly.";
                    break;
                case 6: //User is locked.
                    SASiteCatService.onTrackSharedStepUpClickEvent("StepUpAuthentication", "AuthenticationOTPLockedError");
                    return "locked";
                    break;
                case 12: //User is locked.
                    $rootScope.isUserLocked = true;
                    SASiteCatService.onTrackSharedStepUpClickEvent("StepUpAuthentication", "AuthenticationOTPLockedError");
                    return "locked";
                    break;
                case 13: //Used by “Mobile Approve” method only - indicates that approval is still pending.
                    return "Your approval is still pending.";
                    break;
                case 21: //Approval is expired.
                    return "Approval is expired.";
                    break;
                default:
                    return "We're sorry. We are having problems on our end. It shouldn't be too long, so please try again shortly.";

            }


        }

    }

    function showTransmitAuthOptions(modalInstance, pathToRedirect, username, successHandler, failureHandler, TransmitAppID, TransmitPolicy, TransmitURL, requestParameter, $scope, additionalParams, SASiteCatService, $rootScope, dataContainer, transmitService) {
        /* Using the call from Transmit Service. Transmit Service is updated with the calls defined in this method.
        * This is done to avoid duplicate coding and to fix the defects casued by duplicate binding to events on scope */

        /* transmitService.showOptions(
             modalInstance,
             pathToRedirect,
             username,
             successHandler,
             failureHandler,
             TransmitAppID,
             TransmitPolicy,
             TransmitURL,
             requestParameter,
             $scope,
             additionalParams,
             SASiteCatService,
             $rootScope,
             dataContainer);*/
    }

    //Expose to use in directive
    window.showTransmitAuthOptions = showTransmitAuthOptions;
})();

(function () {

    'use strict';

    angular.module('sharedAuthStepUp')
        .factory('transmitService', ['idShieldService', 'transmitEventsService', 'saLoggingService', 'saBusyService', '$modal', '$timeout', function (idShieldService, transmitEventsService, logger, saBusyService, $modal, $timeout) {
            var unHandledRejectionHandler;
            var authChangeCallbacks = [];
            var authCancelCallbacks = [];
            var authSuccessCallbacks = [];
            var authFailureCallbacks = [];
            var authenticationCancelled = false;
            var authenticationErrored = false;
            var tsModalInstance;

            window.addEventListener("unhandledrejection", function (err, promise) {
                if (unHandledRejectionHandler) unHandledRejectionHandler(err);
            });

            function setaspnetCookie(additionalParams) {
                var sessionId = '';
                var name = 'ASP.NET_SessionId';
                var value = "; " + document.cookie;
                var parts = value.split("; " + name + "=");
                if (parts.length == 2)
                    sessionId = parts.pop().split(";").shift();

                if (sessionId != '') {
                    if (additionalParams != null) {
                        additionalParams.sessionid = sessionId;
                    }
                    else {
                        additionalParams = { "sessionid": sessionId };
                    }
                }
            };

            function checkIsSessionExpired(errorResponse, errorReason) {
                if (errorReason && errorReason.toLowerCase() === "sessionexpired")
                    return true;
                if (errorResponse.error_code === 4005) return true;
                return (errorResponse.error_message && errorResponse.error_message.toLowerCase().indexOf("session not found for device") >= 0);
            };

            function parseError(error) {
                if (!error) return {};

                var errorObject = {};
                if (typeof (error) === "string") {
                    try {
                        var jsonString = error.match(new RegExp("\{.*\}"));
                        if (jsonString && jsonString.length > 0) {
                            errorObject = JSON.parse(jsonString[0]);
                        }

                    } catch (e) { }
                }
                else
                    errorObject = error;

                return errorObject;
            };

            function processError(errorResponse) {
                if (!errorResponse) return {};

                var errorObject = {};
                errorObject.IsValidUID = true;
                errorObject.isDeviceNotAvailable = false;
                errorObject.userLockedQA = false;
                errorObject.isMobileApprovalDenied = false;
                if (errorResponse && errorResponse.failure_data && errorResponse.failure_data.code == 9 && errorResponse.failure_data.action == "reject") {
                    errorObject.IsValidUID = false;
                    errorObject.Reason = errorResponse.failure_data.reason;
                    errorObject.ErrorMessage = "Hmm. We don't recognize that ID. Please try again.";
                } else if (errorResponse && errorResponse.failure_data && errorResponse.failure_data.code == 3 && errorResponse.failure_data.action == "reject") {
                    errorObject.userLockedQA = true;
                    errorObject.Reason = errorResponse.failure_data.reason;
                }
                else if (errorResponse.data && errorResponse.data.assertion_error_code && errorResponse.data.assertion_error_code == "10" && errorResponse.data.assertion_error_message.indexOf("MobileApprove") > 0) {
                    errorObject.Reason = errorResponse && errorResponse.xmapiError ? errorResponse.xmapiError.name : null;
                    errorObject.isDeviceNotAvailable = true;
                }
                // Handling the Mobile Approval reject scenario
                // This will be executed on 3rd invalid attempt of Push Approval and user is locked as well.
                else if (errorResponse != null && errorResponse.indexOf && errorResponse.indexOf("failed to authenticate") > -1) {
                    errorObject.isMobileApprovalDenied = true;
                    errorObject.userLockedQA = false;
                }
                else {
                    errorObject.Reason = errorResponse && errorResponse.xmapiError ? errorResponse.xmapiError.name : null;
                    if (errorResponse == "locked") {
                        errorObject.Reason = "allauthenticatorslocked";
                    }
                    errorObject.userLockedQA = errorResponse && errorResponse.state ? "rejected" == errorResponse.state.toLowerCase() :
                        (errorObject && errorObject.Reason ? "allauthenticatorslocked" == errorObject.Reason.toLowerCase() : false);
                }

                errorObject.SessionExpired = checkIsSessionExpired(errorResponse, errorObject.Reason);


                logger.error(errorObject.Reason);
                logger.error("Locked: " + errorObject.userLockedQA);

                errorObject.transmitErrorResponse = errorResponse;
                return errorObject;
            };

            function setInnerHTML(domElementID, message) {
                if (!domElementID) return;

                var domElement = document.getElementById(domElementID);
                if (domElement) domElement.innerHTML = message;
            }

            function clearAreaHidden(domElementSelector, removeTabIndex) {
                var focusable = 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]';
                if (!domElementSelector) return;

                var domElement = $(domElementSelector);
                if (!domElement) return;

                domElement.removeAttr("aria-hidden");
                if (removeTabIndex)
                    $(domElementSelector).find(focusable).removeAttr('tabindex', '-1');
            }

            function resetUIElements(transmitAppId) {
                if (transmitAppId != "mbl" && ((window.currentPageID != null) || (typeof (window.currentPageID) != "undefined"))) {
                    clearAreaHidden("#" + window.currentPageID);
                }
                else if (transmitAppId != "mbl") {
                    clearAreaHidden(".container", true);
                    clearAreaHidden("#footer", true);
                    clearAreaHidden("#gssUIWrapper", true);

                    sessionStorage.setItem("isDialogOpen", false);
                    setInnerHTML('stepupLiveAnnouncement', '');
                }
            }

            function showErrorMessageInUI(err, $rootScope) {

                $rootScope.systemError = err.data && err.data.assertion_error_code && err.data.assertion_error_code == "13";

                if (err.data && err.data.assertion_error_code && err.data.assertion_error_code == "10" && err.data.assertion_error_message.indexOf("MobileApprove") > 0) {
                    setInnerHTML('authenticatorheader', '');
                    setInnerHTML('customUI', "<div class='omni-modal-body'><p class='error general' role='alert' aria-live='assertive'>To use these features, you must have Push enabled on your device. You can manage Push Notifications in the Device Manager or in the My Profile section of the app.</p></div>");

                    $rootScope.systemError = true;
                }
                else if (err.type && err.type == "mobile_approve") {
                    setInnerHTML('authenticatorheader', '');
                    setInnerHTML('customUI', "<div class='omni-modal-body'><p class='error general' role='alert' aria-live='assertive'>To use these features, you must have Push enabled on your device. You can manage Push Notifications in the Device Manager or in the My Profile section of the app.</p></div>");

                    $rootScope.systemError = true;
                }
                else if (err.failure_data && err.failure_data.locked == "true") {
                    setInnerHTML('customUI', "<div class='omni-modal-body'><p class='error general' role='alert' aria-live='assertive'>Hmm. Something you've entered isn't quite right, so we've locked your account to ensure your security. Login Assist can help.</p></div>");
                    setInnerHTML('authenticatorheader', '');

                    $rootScope.systemError = true;
                }
                // Defect #27241 - User locked after 3rd OTP error 
                else if (err.failure_data && err.failure_data.locked == true) {
                    if (idShieldService.isTuxLogin()) {
                        idShieldService.loginAssit(true, false, true, "");
                    } else {
                        $rootScope.$broadcast('UserLocked');
                        document.getElementById('otpLockError').removeAttribute("style");
                        document.getElementById("changeAuth").setAttribute("disabled", "true");
                        document.getElementById("changeAuth").style.visibility = "hidden";
                        $rootScope.$broadcast('lockoutUser', null);
                    }
                }
                else if (err.data && err.data.assertion_error_code && err.data.assertion_error_code == 6 && err.data.assertion_error_message && err.data.assertion_error_message.indexOf("MobileApprove") > 0) {
                    setInnerHTML('customUI', "<div class='omni-modal-body'><p class='error general' role='alert' aria-live='assertive'>Hmm. Something you've entered isn't quite right, so we've locked your account to ensure your security. Login Assist can help.</p></div>");
                    setInnerHTML('authenticatorheader', '');

                    $rootScope.systemError = true;
                }
                //Fix for TUX defect D-27354. Incorrect error msg displayed when user enters wrong UID
                else if (err.failure_data && err.failure_data.code == 9 && err.failure_data.action == "reject" && err.failure_data.reason == "invalid uid") {
                    setInnerHTML('customUI', "<div class='omni-modal-body'><p class='error general' role='alert' aria-live='assertive'>Hmm. We don't recognize that ID. Please try again.</p></div>");
                    setInnerHTML('authenticatorheader', '');

                    $rootScope.systemError = true;
                }
                else if ((err.failure_data && err.failure_data.action == "reject" && err.failure_data.code == 3) ||
                    (err.xmapiError && err.xmapiError.name && err.xmapiError.name == "allAuthenticatorsLocked")) {
                    setInnerHTML('customUI', "<div class='omni-modal-body'><p class='error general' role='alert' aria-live='assertive'>Hmm. Something you've entered isn't quite right, so we've locked your account to ensure your security. Login Assist can help.</p></div>");
                    setInnerHTML('authenticatorheader', '');

                    $rootScope.systemError = true;
                } else if (err.name && err.name == "Cancel") {
                    $rootScope.systemError = true;
                }
                // Handling the Mobile Approval reject scenario
                // This will be executed on 3rd invalid attempt of Push Approval and user is locked as well.
                else if (err && err.indexOf && err.indexOf("failed to authenticate") > -1) {
                    setInnerHTML('customUI', "<div class='omni-modal-body'><p class='error' role='alert' aria-live='assertive'>Authorization on mobile device was denied.</p></div>");
                    setInnerHTML('authenticatorheader', '');

                    $rootScope.systemError = true;
                }
                else if (err.failure_data && err.failure_data.action == "reject" && err.failure_data.code == 900 && err.failure_data.reason == "VOIP") {
                    // Hides the Overlay. But the user will see the overlay kind of blinking.					
                    // TODO
                    if (tsModalInstance) tsModalInstance.dismiss();

                    $rootScope.systemError = true;
                    return;
                }
                else {
                    setInnerHTML('customUI', "<div class='omni-modal-body'><p class='error' role='alert' aria-live='assertive'>We're sorry. We are having problems on our end. It shouldn't be too long, so please try again shortly.</p></div>");
                    setInnerHTML('authenticatorheader', '');

                    $rootScope.systemError = true;
                }
            }

            function authPromiseOnSuccess(username, requestParameter, auth, successHandler, $scope, $rootScope, modalInstance, TransmitAppID, SASiteCatService, xm) {
                saBusyService.busyEnd('transmitAuthentication');
                resetUIElements();
                onAuthSuccess();

                var response = {};
                response.Success = true; // For OLB
                response.result = "success"; // Matching with mobile
                response.token = auth.token;
                response.resData = auth.jsonData; // For MNO
                if ($scope.isQa) response.isQa = $scope.isQa;
                response.DeviceID = xm.SessionStorage.getItem(xm.SessionStorage.deviceIdKey(username));

                successHandler(response);
            };

            function authPromiseOnError(username, requestParameter, err, failureHandler, $scope, $rootScope, modalInstance, TransmitAppID, SASiteCatService) {// Respond here to unsuccessful authentication
                saBusyService.busyEnd('transmitAuthentication');

                logger.error('TS Error');
                logger.error(err);

                $rootScope.$broadcast('busy.end', { remaining: 0 });
                $rootScope.loading = false;

                var disablingDiv = document.getElementById('disablingDiv');
                if (disablingDiv) disablingDiv.style.display = 'none'; //defect fix 22590

                // When User Cancelled the challenge
                if (err && err.name && err.name.toLowerCase() === "cancel") {
                    authenticationCancelled = true;
                    authenticationErrored = false;

                    resetUIElements();
                    if (requestParameter.modelDialogOnClose) {
                        saBusyService.busyBegin('cancelAction');
                        requestParameter.modelDialogOnClose();
                    }
                    onAuthCancel();
                    return;
                }

                onAuthFailure(err);

                if (err && err.indexOf && err.indexOf("failed to authenticate") > -1) {
                    failureHandler(processError(err));
                } else { failureHandler(processError(parseError(err))); }

                if (TransmitAppID != "mbl") {
                    SASiteCatService.onTrackSATransmitLogin("LoginWidget", "StepupAuthFailed", null, true);
                }
                else
                    SASiteCatService.onTrackSATransmitMobileLogin("Mobile", "StepupAuthFailed", null);

                authenticationCancelled = false;
                authenticationErrored = true;

                resetUIElements(TransmitAppID);
                $timeout(function () { showErrorMessageInUI(err, $rootScope) }, 0);
            };

            function invokeCallbaks(callbackLists, eventArgs) {
                if (!callbackLists || callbackLists.length == 0) return;

                callbackLists.forEach(function (callback) {
                    callback(eventArgs);
                });
            }

            function onAuthChange(eventArgs) {
                invokeCallbaks(authChangeCallbacks, eventArgs);
            }

            function onAuthCancel(eventArgs) {
                invokeCallbaks(authCancelCallbacks, eventArgs);
            }

            function onAuthSuccess(eventArgs) {
                invokeCallbaks(authSuccessCallbacks, eventArgs);
            }

            function onAuthFailure(eventArgs) {
                invokeCallbaks(authFailureCallbacks, eventArgs);
            }

            var showOptions = function (modalInstance, pathToRedirect, username, successHandler, failureHandler, TransmitAppID, TransmitPolicy, TransmitURL, requestParameter, $scope, additionalParams, SASiteCatService, $rootScope, dataContainer) {
                saBusyService.initiateBusy('transmitAuthentication',
                    {
                        busyElement: requestParameter.busyElement,
                        busyClass: requestParameter.busyClass
                    });

                authenticationCancelled = false;
                authenticationErrored = false;

                unHandledRejectionHandler = function (err) {
                    var reason = (err && err.reason) ? err.reason : err;
                    //PRB0043914 -if its Safari "RTCPeerConnection.createOffer must be a dictionary" - skip the error ( TEMP FIX )
                    var reasonMessage = (reason && reason.message) ? reason.message : "";
                    var errorReason = "RTCPeerConnection";
                    if ((typeof reasonMessage === 'string' || reasonMessage instanceof String) && reasonMessage.includes(errorReason)) {
                        return;
                    }
                    authPromiseOnError(username, requestParameter, reason, failureHandler, $scope, $rootScope, modalInstance, TransmitAppID, SASiteCatService);
                };

                transmitEventsService.init($scope, $rootScope);

                if (TransmitPolicy == "mno_zelle" || TransmitPolicy == "shared_access_invitation_third_party_delegate") {
                    $rootScope.$broadcast('busy.begin');
                }

                if (TransmitPolicy == "shared_access_invitation_third_party_delegate") {
                    document.querySelector("#sharedAuthID").children[0].setAttribute("style", "display:none");
                }

                setaspnetCookie(additionalParams);

                require(['xm/xmui', 'xm/xm_api'], function (xmui, xm) {

                    if (additionalParams) {
                        additionalParams.ActimizeData = requestParameter.actimizeData;
                    }
                    else {
                        additionalParams = {
                            ActimizeData: requestParameter.actimizeData
                        };
                    }

                    var uiConf = {
                        "loginConf": {
                            "aid": TransmitAppID,
                            "policy": TransmitPolicy,
                            "additionalParams": additionalParams
                        },

                        "authenticationMethodPromiseOverrides": {
                            otp: {
                                "input.numeric": promiseCustomOTPInput, // Callback for authenticator 'otp', callback type 'input'
                                recover: otpRecoverCallback,
                                targetSelection: promiseAuthOtpTargetSelectionInput
                            },
                            mobileApprove: {
                                input: promiseCustomMobileApproveInput,
                                recover: mobileRecoverCallback,
                                deviceSelection: promiseCustomMobileApproveInput
                            },
                            otpSelect: promiseAuthOtpTargetSelectionInput,
                            question: {
                                input: promiseAuthQuestionInput,
                                recover: qaRecoverCallback
                            },
                            methodMenu2: promiseMethodMenuInput,
                            mobileApproveSelect: promiseAuthMobileAuthSelectDeviceInput,
                            placeholder_qa: {
                                input: promiseAuthPlaceholderIDSheild
                            },
                            placeholder_password_pld: {
                                input: promiseAuthPlaceholderPassword
                            }
                        }

                    };

                    //Configure transmit
                    xmui.configure(uiConf);
                    //set transmit server url
                    xm.setWebloginUrl(TransmitURL);
                    // Kickstart precollection of device attributes
                    xm.preCollect();

                    xm.setJsonDataCallback(function (jsonData, uiContext) {
                        if (dataContainer) dataContainer.stepupData = jsonData;
                    });

                    (function (routeHandlers) {
                        var uiContainer = document.all('uiContainer');
                        $('#customUI').html('');
                        $("#customUI").focus();

                        var authResultPromise = xmui.startAuthUi(username, uiContainer);

                        //defect fix 20097
                        setTimeout(function () {
                            var dom = document.getElementsByClassName("modal fade ng-isolate-scope in")[0];
                            if (dom != undefined && dom != "") {
                                dom.setAttribute("role", "dialog");
                                dom.removeAttribute("ng-click"); // fix for VO reading as clickable
                                dom.setAttribute("id", "overlayModalContainer");
                                dom.setAttribute("aria-labelledby", "authenticatorheader");
                            }
                        }, 1000);

                        authResultPromise.then(
                            function (response) {
                                authPromiseOnSuccess(username, requestParameter, response, successHandler, $scope, $rootScope, modalInstance, TransmitAppID, SASiteCatService, xm);
                            },
                            function (response) {
                                authPromiseOnError(username, requestParameter, response, failureHandler, $scope, $rootScope, modalInstance, TransmitAppID, SASiteCatService);
                            });
                    })();

                    function promiseMethodMenuInput(methods, uiContext) {

                        return new Promise(function (accept, reject) {
                            transmitEventsService.stashContext(xm, accept, reject, null, requestParameter, "METHODMENU");

                            if (!transmitEventsService.userChangingAuthenticator()) {
                                var selectedMethod = transmitEventsService.getMethodForCurrentFlow(methods);
                                if (selectedMethod) accept(selectedMethod);
                                return;
                            }

                            $scope.methods = methods;
                            onAuthChange(transmitEventsService.getCurrentEventDetails());
                            $scope.navigatePage('authOptions', methods);
                            saBusyService.busyEnd('transmitAuthentication', $scope, {}, {});
                        });
                    }

                    function promiseAuthPlaceholderIDSheild(methodConfig, uiContext) {
                        $scope.isQa = true;

                        return new Promise(function (accept, reject) {
                            var context = methodConfig.placeholderContextData;
                            requestParameter.ContextData = context;
                            transmitEventsService.stashContext(xm, accept, reject, methodConfig, requestParameter, "IDSHIELD");
                            onAuthChange(transmitEventsService.getCurrentEventDetails());
                            $scope.navigatePage("idshield", requestParameter);
                            $rootScope.$broadcast('loadCompleted');
                        });
                    }

                    function promiseAuthPlaceholderPassword(methodConfig, uiContext) {

                        return new Promise(function (accept, reject) {
                            var context = methodConfig.placeholderContextData;
                            requestParameter.ContextData = context;
                            transmitEventsService.stashContext(xm, accept, reject, methodConfig, requestParameter, "PWD");
                            onAuthChange(transmitEventsService.getCurrentEventDetails());
                            $scope.navigatePage("password", requestParameter);
                            saBusyService.busyEnd('transmitAuthentication', $scope, {}, {});
                        });
                    }

                    function promiseCustomMobileApproveInput(methodConfig, uiContext) {

                        return new Promise(function (accept, reject) {
                            transmitEventsService.stashContext(xm, accept, reject, methodConfig, requestParameter, "PUSH");
                            onAuthChange(transmitEventsService.getCurrentEventDetails());
                            return JSON.stringify({});
                        });
                    }

                    function promiseAuthOtpTargetSelectionInput(methodConfig, uiContext) {

                        return new Promise(function (accept, reject) {
                            transmitEventsService.stashContext(xm, accept, reject, methodConfig, requestParameter, "OTPTARGET");
                            $rootScope.$broadcast('loadCompleted');
                            onAuthChange(transmitEventsService.getCurrentEventDetails());
                            $scope.navigatePage('otpTarget', methodConfig);
                            saBusyService.busyEnd('transmitAuthentication', $scope, {}, {});
                        });
                    }

                    function mobileRecoverCallback(cflowContext, methodData, assertionResponse, context) {

                        saBusyService.busyEnd('transmitAuthentication', $scope, {}, {});
                        var errorMessage = getErrorMessage(cflowContext, SASiteCatService);
                        setInnerHTML('mobError', errorMessage);

                        if (errorMessage == "locked") {
                            var changeAuthElement = document.getElementById("changeAuth");

                            if (changeAuthElement) {
                                changeAuthElement.setAttribute("disabled", "true");
                                changeAuthElement.style.visibility = "hidden";
                            }
                            $rootScope.$broadcast('lockoutUser', null);

                        }

                        return Promise.resolve(xm.AssertionErrorHandlerResponse.RetryMethod);
                    }

                    function qaRecoverCallback(cflowContext, methodData, assertionResponse, context) {

                        setInnerHTML('qaError', getErrorMessage(cflowContext, SASiteCatService));
                        return Promise.resolve(xm.AssertionErrorHandlerResponse.RetryMethod);
                    }

                    function promiseAuthQuestionInput(methodConfig, uiContext) {
                        console.log('promiseAuthQuestionInput');
                    }

                    function promiseAuthMobileAuthSelectDeviceInput(methodConfig, uiContext) {

                        return new Promise(function (accept, reject) {
                            transmitEventsService.stashContext(xm, accept, reject, methodConfig, requestParameter, "PUSHTARGET");
                            onAuthChange(transmitEventsService.getCurrentEventDetails());
                            $scope.navigatePage('mobApprove', methodConfig);
                            saBusyService.busyEnd('transmitAuthentication', $scope, {}, {});
                        });
                    }

                    function otpRecoverCallback(cflowContext, methodData, assertionResponse, context) {
                        // Here we need to show a cancel dilog and inform user that entred otp is wrong. and prompt
                        // for cancel,retry or change auth method. based ont he response from user
                        // resolve the promise with Retry / Cancel / Change method.
                        saBusyService.busyEnd('transmitAuthentication', $scope, {}, {});
                        var errMsg = getErrorMessage(cflowContext, SASiteCatService); // "Please enter correct OTP";
                        if (errMsg == "locked") {
                            //Added for Tux Login User Lock  Defect # 24849
                            if (idShieldService.isTuxLogin()) {
                                idShieldService.loginAssit(true, false, true, "");
                            } else {

                                $rootScope.$broadcast('UserLocked');

                                document.getElementById('otpLockError').removeAttribute("style");
                                document.getElementById("changeAuth").setAttribute("disabled", "true");
                                document.getElementById("changeAuth").style.visibility = "hidden";
                                $rootScope.$broadcast('lockoutUser', null);
                            }
                        }
                        else {
                            if ($scope.transmitpolicy === "mno_confidence") {
                                document.getElementById("otpCode").classList.toggle("la__error-field");
                            }
                            setInnerHTML('otpError', errMsg);
                            document.getElementById("otpCode").value = ""; //defect fix 20739
                            document.getElementById("otpCode").focus();
                        }

                        return Promise.resolve(xm.AssertionErrorHandlerResponse.RetryMethod);
                    }

                    function promiseCustomOTPInput(methodConfig, uiContext) {

                        return new Promise(function (accept, reject) {
                            transmitEventsService.stashContext(xm, accept, reject, methodConfig, requestParameter, "OTP");

                            methodConfig.hideChangeAuth = requestParameter.hideChangeAuth;
                            methodConfig.showCancel = requestParameter.showCancel;
                            methodConfig.showOTPHeader = requestParameter.showOTPHeader;
                            methodConfig.hideRule = requestParameter.hideRule;

                            $rootScope.$broadcast('loadCompleted');
                            onAuthChange(transmitEventsService.getCurrentEventDetails());
                            if (requestParameter.TransactionID == "MobileCapture") { $scope.navigatePage('inputOTPCodeMNC', methodConfig); }
                            else { $scope.navigatePage('inputOTPCode', methodConfig); }
                            saBusyService.busyEnd('transmitAuthentication', $scope, {}, {});
                        });
                    }

                });

                function getErrorMessage(cflowcontext, SASiteCatService) {
                    if (cflowcontext) {
                        var isMobile = (TransmitAppID == "mbl");
                        switch (cflowcontext.data.assertion_error_code) {
                            case 5: //Authentication failed - secret/credentials passed as part of the assertion are incorrect.
                                if (isMobile)
                                    SASiteCatService.onTrackSATransmitMobileLogin("Mobile", "StepupEnterOTPUserError", null);
                                else if ($scope.iswidget !== undefined)
                                    SASiteCatService.onTrackSATransmitLogin("LoginWidget", "StepupEnterOTPUserError", null, true);
                                else
                                    SASiteCatService.onTrackCustomSharedStepUp("StepUpAuthentication", "AuthenticationOTPIncorrectError");

                                if (cflowcontext.data.data !== undefined &&
                                    cflowcontext.data.data.locked !== undefined &&
                                    cflowcontext.data.data.locked == true) {
                                    return "locked";
                                    break;
                                }
                                if ($rootScope.IsTempAccessFlow) {
                                    return "Hmm. That code doesn't match our records. Please try again.";
                                } else {
                                    return "That seems to be the wrong code. Please try again.";
                                }
                                break;
                            case 9: //Internal error
                                if (isMobile)
                                    SASiteCatService.onTrackSATransmitMobileLogin("Mobile", "StepupAuthSystemError", null);
                                else
                                    SASiteCatService.onTrackSATransmitLogin("LoginWidget", "StepupAuthSystemError", null, true);
                                return "We're sorry. We are having problems on our end. It shouldn't be too long, so please try again shortly.";
                                break;
                            case 6: //User is locked.
                                if (isMobile)
                                    SASiteCatService.onTrackSATransmitMobileLogin("Mobile", "StepupEnterOTPUserLockedError", null);
                                else
                                    SASiteCatService.onTrackSATransmitLogin("LoginWidget", "StepupEnterOTPUserLockedError", null, true);
                                //SASiteCatService.onTrackSharedStepUpClickEvent("StepUpAuthentication", "AuthenticationOTPLockedError");
                                return "locked";
                                break;
                            case 12: //User is locked.
                                $rootScope.isUserLocked = true;
                                if (isMobile)
                                    SASiteCatService.onTrackSATransmitMobileLogin("Mobile", "StepupEnterOTPUserLockedError", null);
                                else
                                    SASiteCatService.onTrackSATransmitLogin("LoginWidget", "StepupEnterOTPUserLockedError", null, true);
                                //SASiteCatService.onTrackSharedStepUpClickEvent("StepUpAuthentication", "AuthenticationOTPLockedError");
                                return "locked";
                                break;
                            case 13: //Used by ''Mobile Approve'' method only - indicates that approval is still pending.
                                if (isMobile)
                                    SASiteCatService.onTrackSATransmitMobileLogin("Mobile", "StepupMobileApprovePendingError", null);
                                else
                                    SASiteCatService.onTrackSATransmitLogin("LoginWidget", "StepupMobileApprovePendingError", null, true);
                                return "Your approval is still pending.";
                                break;
                            case 21: //Approval is expired.
                                if (isMobile)
                                    SASiteCatService.onTrackSATransmitMobileLogin("Mobile", "StepupMobileApproveExpiredError", null);
                                else
                                    SASiteCatService.onTrackSATransmitLogin("LoginWidget", "StepupMobileApproveExpiredError", null, true);
                                return "Approval is expired.";
                                break;
                            default:
                                if (isMobile)
                                    SASiteCatService.onTrackSATransmitMobileLogin("Mobile", "StepupAuthSystemError", null);
                                else
                                    SASiteCatService.onTrackSATransmitLogin("LoginWidget", "StepupAuthSystemError", null, true);
                                return "We're sorry. We are having problems on our end. It shouldn't be too long, so please try again shortly.";
                        }
                    }
                }

                $scope.$on('redirectToTuxLogin', function (event, data) {
                    if (!data.isError) {
                        dataContainer.RedirectToLogin();
                    }
                    else {
                        dataContainer.RedirectToLoginWithError();
                    }
                });

                $scope.$on('redirectToResetPassword', function (event, data) {
                    var isChangePassword = false;
                    var existingPassword = "";
                    if (data != null && data.isChangePassword != undefined && data.isChangePassword) {
                        isChangePassword = true;
                        existingPassword = data.existingPassword;
                    }
                    dataContainer.RedirectToResetOrChangePassword(isChangePassword, existingPassword);
                });
            };

            var extendSession = function () {
                var additionalParams = {};
                setaspnetCookie(additionalParams);

                require(['xm/xmui', 'xm/xm_api'], function (xmui, xm) {
                    var uiConf = {
                        "loginConf": {
                            "aid": TransmitAppID,
                            "policy": 'heartbeat',
                            "additionalParams": additionalParams
                        }
                    };

                    xmui.configure(uiConf);
                    var uiContainer = document.all('customUI');
                    var authResultPromise = xmui.startAuthUi(username, uiContainer);
                    authResultPromise.then(
                        function (response) { },
                        function (response) { });
                });
            };

            var onAuthenticatorsChanged = function (callback) {
                authChangeCallbacks.push(callback);
            };

            var onAuthenticatorsCancelled = function (callback) {
                authCancelCallbacks.push(callback);
            };

            var onAuthenticatorSuccess = function (callback) {
                authSuccessCallbacks.push(callback);
            };

            var onAuthenticatorFailure = function (callback) {
                authFailureCallbacks.push(callback);
            };

            return {
                //  showOptions: showOptions,
                extendSession: extendSession,
                onAuthenticatorsChanged: onAuthenticatorsChanged,
                onAuthenticatorCancelled: onAuthenticatorsCancelled,
                onAuthenticatorSuccess: onAuthenticatorSuccess,
                onAuthenticatorFailure: onAuthenticatorFailure,
                isAuthenticationCancelled: function () { return authenticationCancelled; },
                iAuthenticationErrored: function () { return authenticationErrored; },
                setModalInstance: function (modalInstance) { tsModalInstance = modalInstance },
                clearEventHandlers: function () {
                    authChangeCallbacks = [];
                    authCancelCallbacks = [];
                    authSuccessCallbacks = [];
                    authFailureCallbacks = [];
                }
            };
        }]);
})();

(function () {
    'use strict';

    angular.module('sharedAuthStepUp')
        .factory('transmitEventsService', ['$rootScope', 'SASiteCatService', '$state', 'saLoggingService', 'idShieldService', 'LoginAssistantService', 'LoginAssistantConstants', function ($rootScope, SASiteCatService, $state, logger, idShieldService, LoginAssistantService, LoginAssistantConstants) {

            var acceptCallback;
            var rejectCallback;
            var tsSDK;
            var currentMethodConfig;
            var currentRequestParameter;
            var currentControlFlowHasMultipleAuthenticators = false;
            var isTryingToChangeAuthenticator = false;
            var authenticatorsForCurrentFlow = null;
            var _currentAuthenticator = null;
            var _previousAuthenticator = null;
            var _containerScope;
            var _containerRootScope;

            var _navigatePage = function (pageName, params) {
                if (_containerScope.navigatePage) {
                    _containerScope.navigatePage(pageName, params);
                    return;
                }

                $state.go(pageName, { transmitParams: params });
            };

            var _getSelectedMethod = function (methods, authType) {
                var result = null;
                methods.map(function (method) {
                    if (method.type == authType) {
                        result = method;
                    }
                })
                return result;
            };

            var _hasDevices = function (methods) {
                for (var i = 0; i < methods.length; i++) {
                    if (methods[i] && methods[i].type == "mobile_approve") {
                        if (methods[i].selectable_devices && methods[i].selectable_devices.length > 0) {
                            return true;
                        }
                        else {
                            return false;
                        }
                    }
                };
            };

            var _selectedTargetForOTP = function (data) {

                var channel = currentMethodConfig.channels[0];
                for (var target in channel.targets) {
                    if (channel.targets[target] == data) {
                        acceptCallback(target);
                    }
                }
            };

            var _selectedTargetForPUSH = function (data) {

                var deviceIds = Array.isArray(data) ? data : [data];
                acceptCallback(deviceIds);
                _navigatePage('pendingApproval', currentMethodConfig);

            };

            var stashContext = function (xm, accept, reject, methodConfig, requestParameter, currentAuthenticator) {
                acceptCallback = accept;
                rejectCallback = reject;
                tsSDK = xm;
                currentMethodConfig = methodConfig;
                requestParameter.hideChangeAuth = !hasMultipleAuthenticators();
                currentRequestParameter = requestParameter;
                _previousAuthenticator = _currentAuthenticator;
                _currentAuthenticator = currentAuthenticator;

                if (_currentAuthenticator === 'METHODMENU')
                    $('.close').hide();
                else
                    $('.close').show();

                logger.debug('Selected authenticator: ' + _currentAuthenticator);
            };

            var changeAuthenticator = function () {

                $rootScope.$broadcast("changeAuth", "");

                /*isTryingToChangeAuthenticator = true;


                if (acceptCallback)
                    acceptCallback({ "cancelAction": tsSDK.CancelFlowActions.ChangeMethod });

                logger.debug('Changing from authenticator: ' + _currentAuthenticator);*/
            };

            var retryAuthenticator = function () {
                if (acceptCallback)
                    acceptCallback({ "cancelAction": tsSDK.CancelFlowActions.Retry });

                if (_currentAuthenticator === "PUSH")
                    _navigatePage('mobApprove', currentMethodConfig);

                $('.close').show();
                logger.debug('Retrying authenticator: ' + _currentAuthenticator);
            };

            var cancelAuthenticator = function () {
                var loginAssistModel = LoginAssistantService.getLoginAssistModel();
                $state.go(LoginAssistantConstants.LA_PERSONALID);

                /*if (LoginAssistantService.getChangePwd()) {
                    LoginAssistantService.handleReturnUrl(LoginAssistantService.getCancelURL());
                } else if (loginAssistModel.Vcontext = LoginAssistantConstants.LAVerificationContext.LA_PERSONEL_ID) {
                    $state.go(LoginAssistantConstants.LA_PERSONALID);
                } else if (LoginAssistantConstants.LAVerificationContext.LA_PASSWORD){
                    if (LoginAssistantService.getIdMethodType() === LoginAssistantConstants.LA_PHONE || LoginAssistantService.getIdMethodType() === LoginAssistantConstants.LA_EMAIL)
                        $state.go(LoginAssistantConstants.LA_ENTERCODE);
                    else if (LoginAssistantService.getSecureOptionType() === LoginAssistantConstants.LA_SENDCODE) {
                        $state.go(LoginAssistantConstants.LA_ENTERCODE);
                    } else
                        $state.go(LoginAssistantConstants.LA_VERIFYIDENTITYVIAACCOUNTNUMBERORPIN);
                } else if (LoginAssistantConstants.LAVerificationContext.LA_ID_SHIELD){
                    $state.go(LoginAssistantConstants.LA_ENTERPASSWORD);
                }*/

                /* if (_currentAuthenticator === 'METHODMENU') return;
 
                 if (acceptCallback)
                     acceptCallback({ "cancelAction": tsSDK.CancelFlowActions.Cancel });
 
                 logger.debug('Cancelling authenticator: ' + _currentAuthenticator);*/
            };

            var verifyOTP = function (otpCode) {
                logger.debug('Verifying OTP');

                if (acceptCallback)
                    acceptCallback({ "otp": otpCode });
            };

            var resendOTP = function () {
                logger.debug('Resending OTP');

                var data = '{"command": "resend" }';
                var str = JSON.parse(data);
                if (acceptCallback)
                    acceptCallback(str);
            };

            var selectedTarget = function (data) {

                if (_currentAuthenticator === 'PUSHTARGET') {
                    _selectedTargetForPUSH(data);
                } else {
                    _selectedTargetForOTP(data);
                }

                logger.debug('Selected target for authenticator: ' + _currentAuthenticator);
            };

            var setMethodsForCurrentFlow = function (methods) {
                authenticatorsForCurrentFlow = methods;
            };

            var getMethodForCurrentFlow = function (methods) {
                if (!methods) return null;
                authenticatorsForCurrentFlow = methods;
                currentControlFlowHasMultipleAuthenticators = (methods.length > 1);

                var selected = null;
                var lastUsed = 0;
                methods.forEach(function (currentMethod) {
                    if (!currentMethod.locked && !currentMethod.expired && (currentMethod.last_used > lastUsed)) {
                        selected = currentMethod;
                        lastUsed = currentMethod.last_used;
                    }
                });

                return selected;
            };

            var displayAuthOptions = function ($scope, methods, data) {
                var selectedMethod = _getSelectedMethod(methods, data);
                var allowMobileApprove = _hasDevices(methods);

                // Resetting the flag used to identify the user was trying to change the authenticator
                isTryingToChangeAuthenticator = false;

                if (_containerScope.trackedMethod != selectedMethod.type) {
                    switch (selectedMethod.type) {
                        case 'otp':
                            if (typeof _containerScope.transmitappid !== 'undefined' && _containerScope.transmitappid == "mbl") {
                                SASiteCatService.onTrackSATransmitMobileLoginClickEvent("Mobile", "ChangeAuthOTPLink");
                            }
                            else {
                                if (typeof _containerScope.iswidget !== 'undefined') {
                                    SASiteCatService.onTrackSATransmitLoginClickEvent("LoginWidget", "ChangeAuthOTPLink", _containerScope.iswidget);
                                }
                                else
                                    SASiteCatService.onTrackSharedStepUpClickEvent("StepUpAuthentication", "AuthenticationOTPLink");
                            }
                            _containerScope.trackedMethod = 'otp';
                            break;
                        case 'placeholder_qa':
                            if (typeof _containerScope.transmitappid !== 'undefined' && _containerScope.transmitappid == "mbl") {
                                SASiteCatService.onTrackSATransmitMobileLoginClickEvent("Mobile", "ChangeAuthQALink");
                            }
                            else {
                                if (typeof _containerScope.iswidget !== 'undefined') {
                                    SASiteCatService.onTrackSATransmitLoginClickEvent("LoginWidget", "ChangeAuthQALink", _containerScope.iswidget);
                                } else
                                    SASiteCatService.onTrackSharedStepUpClickEvent("StepUpAuthentication", "AuthenticationQALink");
                            }

                            _containerScope.trackedMethod = 'placeholder_qa';
                            break;
                        case 'mobile_approve':
                            if (typeof _containerScope.transmitappid !== 'undefined' && _containerScope.transmitappid == "mbl") {
                                SASiteCatService.onTrackSATransmitMobileLoginClickEvent("Mobile", "ChangeAuthMobApproveLink");
                            }
                            else {
                                if (typeof _containerScope.iswidget !== 'undefined') {
                                    SASiteCatService.onTrackSATransmitLoginClickEvent("LoginWidget", "ChangeAuthMobApproveLink", _containerScope.iswidget);
                                }
                                else
                                    SASiteCatService.onTrackSharedStepUpClickEvent("StepUpAuthentication", "AuthenticationApproveLink");
                            }
                            _containerScope.trackedMethod = 'mobile_approve';
                            break;
                        case 'placeholder_password_pld':
                            SASiteCatService.onTrackSharedStepUpClickEvent("StepUpAuthentication", "AuthenticationPasswordLink");
                            _containerScope.trackedMethod = 'placeholder_password_pld';
                            break;
                    }
                }

                if (selectedMethod.type != 'mobile_approve') {
                    acceptCallback(selectedMethod);
                }
                else {
                    if (allowMobileApprove) {
                        acceptCallback(selectedMethod);
                    }
                    else {
                        rejectCallback(selectedMethod);
                    }
                }

                logger.debug('Displaying Auth Options');
            };

            var invokeSuccessHandler = function (data) {
                if (true)
                    $rootScope.$broadcast("transmitTokenRecieved", data);
                //acceptCallback(data);
            };

            var invokeRejectHandler = function (data) {
                if (rejectCallback)
                    rejectCallback(data);
            };

            var hasMultipleAuthenticators = function (hasMultiple) {
                if (hasMultiple === true || hasMultiple === false)
                    currentControlFlowHasMultipleAuthenticators = hasMultiple;

                return currentControlFlowHasMultipleAuthenticators;
            };

            var userChangingAuthenticator = function () {
                return isTryingToChangeAuthenticator;
            };

            var showAuthCancelConfirmation = function () {
                $('.close').hide();
                _navigatePage("cancelauth", currentRequestParameter);
            };

            var init = function (scope, rootScope) {
                currentControlFlowHasMultipleAuthenticators = false;
                isTryingToChangeAuthenticator = false;

                _containerScope = scope;
                _containerRootScope = rootScope;
            };

            return {
                init: init,
                stashContext: stashContext,
                changeAuthenticator: changeAuthenticator,
                retryAuthenticator: retryAuthenticator,
                cancelAuthenticator: cancelAuthenticator,
                hasMultipleAuthenticators: hasMultipleAuthenticators,
                userChangingAuthenticator: userChangingAuthenticator,
                setMethodsForCurrentFlow: setMethodsForCurrentFlow,
                getMethodForCurrentFlow: getMethodForCurrentFlow,
                selectedTarget: selectedTarget,
                displayAuthOptions: displayAuthOptions,
                invokeSuccessHandler: invokeSuccessHandler,
                invokeRejectHandler: invokeRejectHandler,
                verifyOTP: verifyOTP,
                resendOTP: resendOTP,
                showAuthCancelConfirmation: showAuthCancelConfirmation,
                getCurrentEventDetails: function () {
                    return {
                        requestParameter: currentRequestParameter,
                        previousAuthenticator: _previousAuthenticator,
                        currentAuthenticator: _currentAuthenticator
                    };
                }
            };
        }]);
})();

(function () {
    'use strict';
    angular.module('sharedAuthStepUp')
        .factory('saLoggingService', function () {

            var error = function (message) {
                try {
                    if (window.console) {
                        window.console.error(message);
                    }
                }
                catch (ex) { }
            };

            var debug = function (message) {
                try {
                    if (window.console) {
                        window.console.debug(message);
                    }
                }
                catch (ex) { }
            };


            return {
                error: error,
                debug: debug
            };
        });
})();

(function (window, angular, undefined) {
    'use strict';

    angular.module('sharedAuthStepUp')
        .provider('sabusyInterceptor', function () {

            this.$get = ['$rootScope', '$q', 'saBusyService', function ($rootScope, $q, saBusyService) {
                var _total = 0, _completed = 0;

                function complete() {
                    _total = _completed = 0;
                }

                function handleResponse(r) {
                    saBusyService.busyEnd();
                    if (_completed >= _total) complete();
                }

                return {
                    outstanding: function () {
                        return _total - _completed;
                    },
                    'request': function (config) {
                        saBusyService.busyBegin();
                        return config || $q.when(config);
                    },
                    'response': function (response) {
                        handleResponse(response);
                        return response;
                    },
                    'responseError': function (rejection) {
                        handleResponse(rejection);
                        return $q.reject(rejection);
                    }
                };
            }];
        })
        .config(['$httpProvider', function ($httpProvider) {
            $httpProvider.interceptors.push('sabusyInterceptor');
        }]);

    angular.module('sharedAuthStepUp')
        .directive('saBusy', ['$parse', '$timeout', 'saBusyService', function ($parse, $timeout, saBusyService) {
            return {
                restrict: 'A',
                tranclude: true,
                scope: {},
                controller: ['$scope', function ($scope) {
                    this.setBusyMessageElement = function (element) {
                        $scope.busyMessageElement = element;
                    }
                }],
                link: function (scope, element, attrs) {

                    scope.busyElementID = attrs['busyElement'];
                    scope.busyElementClassName = attrs['busyClass'];
                    scope.startAsBusy = attrs['startAsBusy'];

                    scope.isWidget = false;
                    saBusyService.addLoadingTemplate(
                        scope.busyElementID,
                        scope.busyElementClassName,
                        scope.startAsBusy);
                }
            }
        }]);

    angular.module('sharedAuthStepUp')
        .factory('saBusyService', function () {

            var isBusy;
            var busyElementId = 'divLoading';
            var busyElementClass = 'sa__loader';

            var currentTrx;
            var isBusyFor = function (name, isBusyBegin) {
                if (!isBusyBegin) {
                    if (currentTrx) {
                        var result = (name === currentTrx);
                        if (result) currentTrx = undefined;

                        return result;
                    }
                    else
                        return true;
                }

                if (currentTrx && name) {
                    return name === currentTrx;
                }
                else if (name) {
                    currentTrx = name;
                    return true;
                }
                return true;
            };

            var busyBegin = function (name, config, evt) {
                config = config || {};

                var element = angular.element($('#' + busyElementId));
                if (!isBusy && isBusyFor(name, true)) {

                    if (config.busyDisabled) $timeout(function () {
                        element.attr('disabled', true);
                    });

                    var msgElement = config.busyMessageElement ? config.busyMessageElement.clone() : null;
                    if (msgElement || config.busyMessage) element.html('').append(msgElement || scope.busyMessage);

                    element.addClass(busyElementClass);

                    if (config.isWidget === true) {
                        angular.forEach(document.querySelectorAll('.tabDisableOnBusy'), function (v) {
                            angular.element(v).removeAttr('tabindex');
                            angular.element(v).attr('tabindex', '-1');
                        });
                    }
                    $('body').css('user-select', 'none');
                    angular.forEach(document.querySelectorAll('input'), function (v) {
                        angular.element(v).removeAttr('tabindex');
                        angular.element(v).attr('tabindex', '-1');
                    });
                    angular.forEach(document.querySelectorAll('a'), function (v) {
                        angular.element(v).removeAttr('tabindex');
                        angular.element(v).attr('tabindex', '-1');
                    });
                    angular.forEach(document.querySelectorAll('button'), function (v) {
                        angular.element(v).removeAttr('tabindex');
                        angular.element(v).attr('tabindex', '-1');
                    });
                    $("#spinerSpan").text('Loading please wait.');
                    $(".contentHolder").removeClass('hide');
                    $(".loadingSpinner").attr('aria-busy', 'true');

                    isBusy = true;
                }
            };

            var busyEnd = function (name, config, evt) {
                config = config || {};

                var element = angular.element($('#' + busyElementId));
                if (isBusy && isBusyFor(name, false)) {
                    element.attr('disabled', config.notBusyDisabled === true);
                    element.removeClass(busyElementClass);

                    if (config.isWidget === true) {
                        angular.forEach(document.querySelectorAll('.tabDisableOnBusy'), function (v) {
                            angular.element(v).removeAttr('tabindex');
                            angular.element(v).attr('tabindex', '0');
                        });
                    }

                    $('body').css('user-select', 'auto');
                    angular.forEach(document.querySelectorAll('input'), function (v) {
                        angular.element(v).removeAttr('tabindex');
                        angular.element(v).attr('tabindex', '0');
                    });
                    angular.forEach(document.querySelectorAll('a'), function (v) {
                        angular.element(v).removeAttr('tabindex');
                        angular.element(v).attr('tabindex', '0');
                    });
                    angular.forEach(document.querySelectorAll('button'), function (v) {
                        angular.element(v).removeAttr('tabindex');
                        angular.element(v).attr('tabindex', '0');
                    });


                    $("#spinerSpan").text('');
                    $(".loadingSpinner").attr('aria-busy', 'false');
                    isBusy = false;
                }
            };

            function bindLoadingTemplate(element, startAsBusy) {
                if (!element) return;
                if ($("#" + busyElementId).length) return;

                // -- This change is to handle dotCom UXRefreshWidget scenario.
                // The code checks whether the current page uses ng-busy 
                // (by checking elements with the attribute 'busy-add-classes'. 
                // If the page has any element with this attribute, then we'll piggy back to that element 
                // to display the busyIcon.

                var ngBusyElement = $("div[busy-add-classes]");
                if (ngBusyElement.length) {
                    ngBusyElement.attr('id', busyElementId);
                    return;
                }

                var ieVersion = getIEVersion();
                var loader = (ieVersion == 8 || ieVersion == 9) ? $('<div></div >') :
                    $('<div><div class="loadingSpinner"><div class="holder"><div class="bar1"></div><div class="bar2"></div><div class="bar3"></div><div class="bar4"></div><div class="bar5"></div><div class="bar6"></div><div class="bar7"></div><div class="bar8"></div><div class="bar9"></div><div class="bar10"></div><div class="bar11"></div><div class="bar12"></div></div></div></div>');

                if (!loader) return;
                loader.attr('id', busyElementId);
                if (startAsBusy) loader.addClass(busyElementClass);

                element.prepend(loader);
            }

            function getIEVersion() {
                var rv = -1;
                var ua = navigator.userAgent;
                var re = ua.indexOf("MSIE") > -1 ? new RegExp("MSIE\\s([0-9]{1,}[\\.0-9]{0,})") : new RegExp("Trident/.*?rv:([0-9]{1,}[\\.0-9]{0,})");
                var result = re.exec(ua);
                if (result != null && result[1] != null) rv = parseFloat(result[1]);
                return rv;
            };

            return {
                busyBegin: busyBegin,
                busyEnd: busyEnd,
                initiateBusy: function (name, config, evt) {
                    config = config || {};
                    busyElementId = config.busyElement || busyElementId;
                    busyElementClass = config.busyClass || busyElementClass;
                    bindLoadingTemplate($("body"), true);
                    busyBegin(name, config, evt);
                },
                addLoadingTemplate: function (elementID, busyClassName, startAsBusy) {
                    busyElementId = elementID || busyElementId;
                    busyElementClass = busyClassName || busyElementClass;
                    bindLoadingTemplate($("body"), startAsBusy);
                }
            };
        });

})(window, window.angular);
;
(function () {
    'use strict';

    angular
        .module("sharedAuthStepUp")
        .controller('IDShieldController', IDShieldController);

    IDShieldController.$inject = ['$scope', '$rootScope', '$state', '$location', '$http', 'idShieldService', 'SASiteCatService', 'transmitEventsService', 'saBusyService', 'LoginAssistantService'];

    function IDShieldController($scope, $rootScope, $state, $location, $http, idShieldService, SASiteCatService, transmitEventsService, saBusyService, LoginAssistantService) {

        var callInProgress = false;

        var tParams = $state.params.transmitParams;

        $rootScope.dialogHeading = null;
        $rootScope.dialogHeading = "ID Shield Questions";
        if (document.getElementById('stepupLiveAnnouncement') !== null) {
            document.getElementById('stepupLiveAnnouncement').innerHTML = 'ID Shield Questions, view loaded';
        }
        if (document.getElementById('sharedAuthID')) {
            document.getElementById('sharedAuthID').removeAttribute("style");
        }
        //setTimeout(function () { $("#overlayModalContainer").first().focus(); }, 600);
        //If Params null then don't execute.'
        //  if (!tParams) return;

        // var transactionID = tParams.TransactionID;
        var transactionID = "idshield";
        //var BaseUrl = tParams.IDShieldBaseURL;
        var BaseUrl = "/api/auth/V1/EAS/";
        //var contextData = tParams.ContextData;
        var contextData = LoginAssistantService.getContextData();
        //var hasResumePlaceholder = tParams.hasResumePlaceholder;
        var appid = "web";
        //var signonid = tParams.username;
        var signonid = LoginAssistantService.getUserIdentifier();
        var policyid = "login_assistant";
        var actimizedata = "";
        var SessionGUID = LoginAssistantService.getSessionID();

        $scope.isMobileWeb = (appid == "mbl") ? false : true;
        //  $scope.hideChangeAuth = tParams.hideChangeAuth;

        //$scope.CancelUrl = tParams.CancelURL;

        $('.sharedauth-loading').toggleClass('sharedauth-complete');
        $(".sharedauth-loading").attr('aria-busy', true);
        $(".sharedauth-loading").attr('aria-hidden', false);

        var idShieldObject = idShieldService.getIdshieldQuestions(BaseUrl, transactionID, signonid, SessionGUID).then(function (response) {
            //screen reader heading fix
            /* if (!$scope.isMobileWeb) {
                 setTimeout(function() {
                     document.getElementById("sharedAuthstepUpContainer").setAttribute("role", "dialog");
                     document.getElementById("authenticatorheader").focus();
                 }, 300);
             } else {
                 if (!((window.currentPageID != null) || (typeof (window.currentPageID) != "undefined"))) {
                     $(".sharedauth-loading").focus();
                 }
                 setTimeout(function() {
                     if (((window.currentPageID != null) || (typeof (window.currentPageID) != "undefined")) && !idShieldService.isTuxLogin()) {
                         document.getElementById("authenticatorheader").setAttribute("tabindex", "-1");
                         document.getElementById("authenticatorheader").focus();
                     } else if (idShieldService.isTuxLogin() || (document.getElementsByClassName("contain-stepup sharedauth authlogin")[0] != null && document.getElementsByClassName("contain-stepup sharedauth authlogin")[0] != undefined)) {
                         document.getElementById("stepUpHeader").setAttribute("tabindex", "-1");
                         document.getElementById("stepUpHeader").focus();
                     } else {
                         $("#goback").first().focus();
                     }
                 }, 400);
             }*/


            var disablingDiv = document.getElementById('disablingDiv');
            if (disablingDiv) disablingDiv.style.display = 'none'; //defect fix 22590

            if (!response || !response.data || response.data.ErrorCode !== 0 || !response.data.QestionText) {

                if (response && response.data && response.data.ErrorCode == 203) {
                    $rootScope.isUserLocked = true; //change for lock scenario.
                    $scope.lockErrorMessage = true;
                    if (!$('.sharedauth-loading').hasClass('sharedauth-complete')) {
                        $('.sharedauth-loading').toggleClass('sharedauth-complete');
                    }

                    if (appid != "mbl") {
                        $scope.isApp = false;
                        SASiteCatService.onTrackCustomSharedStepUp("StepUpAuthentication", "AuthenticationQALockout");
                    } else if (appid == "mbl") {
                        $scope.isApp = true;
                        $rootScope.$broadcast('NotifySiteCat', "100");
                        if (!$('.sharedauth-loading').hasClass('sharedauth-complete')) {
                            $('.sharedauth-loading').toggleClass('sharedauth-complete');
                        }
                    }

                    return;
                }

                if (appid != "mbl") {
                    if (typeof $scope.iswidget !== 'undefined') {
                        var dynamicValue = { "challengePolicy": $scope.transmitpolicy };
                        SASiteCatService.onTrackSATransmitLogin("LoginWidget", "TransmitEmptyQA", dynamicValue, $scope.iswidget);
                    }
                }

                $rootScope.$broadcast('ResetLogin', { showError: true });
                return;
            }

            $scope.idShieldQuestion = response.data.QestionText;
            $scope.placeHolderText = idShieldService.getPlaceholderText(response.data.AnswerFormat);
            $scope.AnswerFormat = response.data.AnswerFormat;
            if (!$('.sharedauth-loading').hasClass('sharedauth-complete')) {
                $('.sharedauth-loading').toggleClass('sharedauth-complete');
            }
            $rootScope.$broadcast("StepUp", null);
            $rootScope.loading = false;
            saBusyService.busyEnd('transmitAuthentication', $scope, {}, {});
        }, function (response) {
            var disablingDiv = document.getElementById('disablingDiv');
            if (disablingDiv) disablingDiv.style.display = 'none'; //defect fix 22590
            saBusyService.busyEnd('transmitAuthentication', $scope, {}, {});
            transmitEventsService.invokeRejectHandler("Error: ID Questions retrieval failed.");
        });

        if (appid != "mbl") {

            if (typeof $scope.iswidget !== 'undefined') {
                var dynamicValue = { "challengePolicy": $scope.transmitpolicy };
                SASiteCatService.onTrackSATransmitLogin("LoginWidget", "StepupQuestion", dynamicValue, $scope.iswidget);
            }
            else
                SASiteCatService.onTrackCustomSharedStepUp("StepUpAuthentication", "AuthenticationIDShield", policyid || $scope.transmitpolicy);

            //$(".omni-overlay.sharedauth").focus();
        }
        else {
            var dynamicValue = { "challengePolicy": $scope.transmitpolicy };
            SASiteCatService.onTrackSATransmitMobileLogin("Mobile", "StepupQuestion", dynamicValue);
        }

        var urlSplit = BaseUrl.split('/');
        var protocol = urlSplit[0];
        var domain = urlSplit[2];
        var sub_url = protocol + '//' + domain;

        //$scope.changeAuth = function () {
        //    $rootScope.$broadcast('authChangeMethod', null);
        //}
        $scope.submitAns = function (answer) {
            if (callInProgress) return;
            callInProgress = true;

            idShieldService.answerValidation(answer, $scope);
            if ($scope.showerror || $scope.lockErrorMessage) {
                if (appid != "mbl") {
                    if (typeof $scope.iswidget !== 'undefined') {
                        SASiteCatService.onTrackSATransmitLogin("LoginWidget", "StepupQAFormatError", null, $scope.iswidget);
                    }
                }
                else
                    SASiteCatService.onTrackSATransmitMobileLogin("Mobile", "StepupQAFormatError", null);
                callInProgress = false;
                return;
            }
            else {
                $scope.showerror = false;
                $scope.lockErrorMessage = false;
                $scope.errorMessage = "";
                //document.getElementById("qaError").innerHTML = '';
            }

            var idShieldObject = idShieldService.validateAnswer(BaseUrl, transactionID, answer, contextData, appid, signonid, policyid, actimizedata, SessionGUID).then(function (response) {
                $rootScope.loading = false;
                if (response.data.IsSuccess == false) {
                    $scope.showerror = true;
                    if (response.data.ErrorCode == 0) {
                        $scope.errorMessage = "Hmm. That answer doesn’t match our records. Please try again.";
                        if (appid != "mbl") {
                            if (typeof $scope.iswidget !== 'undefined') {
                                SASiteCatService.onTrackSATransmitLogin("LoginWidget", "StepupQAFailure", null, $scope.iswidget);
                            }
                            else
                                SASiteCatService.onTrackCustomSharedStepUp("StepUpAuthentication", "AuthenticationQAFailedError");
                        } else if (appid == "mbl") {
                            SASiteCatService.onTrackSATransmitMobileLogin("Mobile", "StepupQAFailure", null);
                            $rootScope.$broadcast('NotifySiteCat', "100");
                        }
                    }
                    if (response.data.ErrorCode == 203) {
                        // Redirect to Login Assistance while login (if the answer is wrong and user is locked out)
                        if (idShieldService.isLoginStepup()) {
                            $scope.accountLocked = true;
                            $scope.RedirectToLoginAssist(signonid);
                            return;
                        }
                        $rootScope.isUserLocked = true; //change for lock scenario.
                        $scope.lockErrorMessage = true;
                        document.getElementById("changeAuth").setAttribute("disabled", "true");
                        if (appid != "mbl") {
                            $scope.isApp = false;
                            SASiteCatService.onTrackCustomSharedStepUp("StepUpAuthentication", "AuthenticationQALockout");
                        } else if (appid == "mbl") {
                            $scope.isApp = true;
                            $rootScope.$broadcast('NotifySiteCat', "100");
                        }
                    }
                    if (response.data.ErrorCode == 503 || response.data.ErrorCode == -1) {
                        document.getElementById("qaError").innerHTML = "Sorry, our system is currently unavailable. Please try again later.";
                        if (appid != "mbl") {
                            if (typeof $scope.iswidget !== 'undefined') {
                                SASiteCatService.onTrackSATransmitLogin("LoginWidget", "StepupQASystemError", null, $scope.iswidget);
                            }
                        }
                        else
                            SASiteCatService.onTrackSATransmitMobileLogin("Mobile", "StepupQASystemError", null);
                    }

                    $scope.answer = "";
                    document.getElementById("ans").value = "";
                    document.getElementById("ans").focus();
                }
                else {

                    if (response.data.IsSuccess) {
                        //$rootScope.$broadcast('busy.begin', {});
                        if (response && response.data && response.data.Token)
                            //$scope.$parent.OnSharedAuthSuccess(response);
                            transmitEventsService.invokeSuccessHandler({ "token": response.data.Token });
                        else
                            transmitEventsService.invokeRejectHandler("Error: ID Shield placeholder token is empty");
                    }
                    // Success Scenario for Mobile App
                    // if (hasResumePlaceholder) {
                    //  $rootScope.$broadcast('MBQASuccess', response);
                    // }
                    else {
                        if (response && response.data && response.data.Token)
                            transmitEventsService.invokeSuccessHandler({ "token": response.data.Token });
                        else
                            transmitEventsService.invokeRejectHandler("Error: ID Shield placeholder token is empty");
                    }

                    //                    if (hasResumePlaceholder)
                    //                        $rootScope.$broadcast('MBQASuccess', response);
                    //                    else
                    //                        $rootScope.$broadcast('QASuccess', response);
                }

                callInProgress = false;
            });
        }

        $scope.changeAuth = function () {
            if (appid != "mbl") {
                if (typeof $scope.iswidget !== 'undefined') {
                    SASiteCatService.onTrackSATransmitLoginClickEvent("LoginWidget", "StepupQAChangeAuth", $scope.iswidget);
                }
                else
                    SASiteCatService.onTrackSharedStepUpClickEvent("StepUpAuthentication", "AuthenticationQAChangeAuthLink");
            }
            else
                SASiteCatService.onTrackSATransmitMobileLoginClickEvent("Mobile", "StepupQAChangeAuth");

            transmitEventsService.changeAuthenticator();
            $rootScope.$broadcast('authChangeMethod', null);
        }

        $scope.revealAnswer = function (id) {
            // pass in the ID of the input that needs to be displayed; default is 3 seconds
            var id = document.getElementById(id);
            var typeOrig = id.type;

            id.type = 'text';

            setTimeout(function () {
                id.type = typeOrig;
            }, 3000);
        }

        $scope.RedirectToLoginAssist = function (personId) {
            if (appid != "mbl") {
                if (personId) {
                    if (typeof $scope.iswidget !== 'undefined') {
                        SASiteCatService.onTrackSATransmitLoginClickEvent("LoginWidget", "StepupForgotAnswer", $scope.iswidget);
                    }
                    else
                        SASiteCatService.onTrackSharedStepUpClickEvent("StepUpAuthentication", "AuthenticationForgotLink");

                } else {
                    SASiteCatService.onTrackSharedStepUpClickEvent("StepUpAuthentication", "AuthenticationQAHelpLink");
                }
                $rootScope.$broadcast('accountLocked', $scope.accountLocked);
                idShieldService.loginAssit($scope.accountLocked, false, $scope.isMobileWeb, sub_url, $scope.CancelUrl);
            } else {
                if (personId) {
                    SASiteCatService.onTrackSATransmitMobileLoginClickEvent("Mobile", "StepupForgotAnswer");
                }
                $rootScope.$broadcast('LoginAssistance', 1001);
            }
        };
        $scope.cancelbuttonClick = function () {
            transmitEventsService.cancelAuthenticator();
            // changes has been done to fix the Tux start over option in step up screen 
            if (idShieldService.isTuxLogin()) {
                $rootScope.$broadcast('redirectToTuxLogin', { isError: false });
            } else { $rootScope.$broadcast('ResetLogin', { showError: false }); }
        };
        $scope.$on('ResetLogin', function () {
            $scope.idShieldQuestion = "";
            $scope.placeHolderText = "";
            $scope.AnswerFormat = "";
        });
        $scope.onBlur = function ($event) {
            if (appid == "mbl") {
                setTimeout(function () {
                    document.getElementById("SubmitAns").focus();
                }, 300);
            }
        }
        // To hide Need help? link for 24 HB screen
        $rootScope.$broadcast('ShowHideLinks', null);
    }
})();
;
(function() {
    'use strict';

    angular
        .module("sharedAuthStepUp")
        .controller('AuthOptionController', AuthOptionController);

    AuthOptionController.$inject = ['$scope', '$rootScope', '$state', '$location', '$compile', 'SASiteCatService', 'idShieldService', 'transmitEventsService'];

    function AuthOptionController($scope, $rootScope, $state, $location, $compile, SASiteCatService, idShieldService, transmitEventsService) {

        // Hiding the Spinner after screen load completion
        if (!$('.sharedauth-loading').hasClass('sharedauth-complete')) {
            $(".sharedauth-loading").attr('aria-busy', false);
            $(".sharedauth-loading").attr('aria-hidden', true);
            $('.sharedauth-loading').toggleClass('sharedauth-complete');
        }

        if (typeof $scope.transmitappid !== 'undefined' && $scope.transmitappid == "mbl") {
            SASiteCatService.onTrackSATransmitMobileLogin("Mobile", "StepupChangeAuthSuccess", null);
        }
        else {
            if (typeof $scope.iswidget !== 'undefined') {
                SASiteCatService.onTrackSATransmitLogin("LoginWidget", "StepupChangeAuthSuccess", null, $scope.iswidget);
            }
            else {
                var pid;
                if ($state && $state.params && $state.params.transmitParams) {
                    pid = $state.params.transmitParams.policyID || $state.params.transmitParams.TransmitPolicy;
                }
                if (!pid && $rootScope && $rootScope.transmitOTPParams) {
                    pid = $rootScope.transmitOTPParams.policyID;
                }
                if (!pid)
                    pid = $scope.transmitpolicy;
                SASiteCatService.onTrackCustomSharedStepUp("StepUpAuthentication", "AuthenticationType", pid);
            }
        }
        var authenticationType = {
            'otp': 'One-time passcode',
            'placeholder_qa': 'ID Shield questions',
            'placeholder_password_pld': 'Password',
            'mobile_approve': ' Visual pattern, fingerprint scan or Face ID (iPhone X only)'
        };

        var errorTag = document.getElementById("errortag");
        if (errorTag) errorTag.innerHTML = "";

        //$("#sharedAuthstepUpContainer input, #sharedAuthstepUpContainer button, #sharedAuthstepUpContainer a, #sharedAuthstepUpContainer h1").first().focus();
        //$(".omni-overlay.sharedauth").focus();
        //to focus in overlay heading

        $rootScope.dialogHeading = null;
        $rootScope.dialogHeading = "Please select authentication method";
        if (document.getElementById('stepupLiveAnnouncement') !== null) {
            document.getElementById('stepupLiveAnnouncement').innerHTML = "Please select authentication method, view loaded";
        }
        setTimeout(function() {
            if (((window.currentPageID != null) || (typeof (window.currentPageID) != "undefined")) && !idShieldService.isTuxLogin()) {
                document.getElementById("authenticatorheader").setAttribute("tabindex", "-1");
                document.getElementById("authenticatorheader").focus();
            } else if (idShieldService.isTuxLogin() || (document.getElementsByClassName("contain-stepup sharedauth authlogin")[0] != null && document.getElementsByClassName("contain-stepup sharedauth authlogin")[0] != undefined)) {
                document.getElementById("stepUpHeader").setAttribute("tabindex", "-1");
                document.getElementById("stepUpHeader").focus();
            } else if (document.getElementById("authenticatorheader") != null || document.getElementById("authenticatorheader") != "undefined") {
                document.getElementById("authenticatorheader").setAttribute("tabindex", "-1");
                document.getElementById("authenticatorheader").focus();
            } else {
                $("#goback").first().focus();
            }
        }, 100);
        if ($state.params.transmitParams) {

            $scope.methods = $state.params.transmitParams;

            if ($scope.methods) {
                for (i = 0; i < $scope.methods.length; i++) {
                    if ($scope.methods[i] && $scope.methods[i].type == "mobile_approve") {
                        if ($scope.methods[i].selectable_devices.length == 0) {
                            delete $scope.methods[i];
                            break;
                        }
                    }
                }
            }

            $scope.getAuthenticationTypeText = function(type) {
                return authenticationType[type];

            }

            $scope.authenticationMethodClicked = function(type) {
                //$rootScope.$broadcast('rootScope:AuthOption', type);
                transmitEventsService.displayAuthOptions($scope, $scope.methods, type)
            }
        }
        $scope.cancelbuttonClick = function() {
            transmitEventsService.cancelAuthenticator();
            if (idShieldService.isTuxLogin()) {
                $rootScope.$broadcast('redirectToTuxLogin', { isError: false });
            }
            else {
                $rootScope.$broadcast('ResetLogin', { showError: false });
            }
        };
    }
})();;
var Base64 = { _keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", encode: function(r) { var t, e, o, a, h, n, c, d = "", C = 0; for (r = Base64._utf8_encode(r); C < r.length; ) t = r.charCodeAt(C++), e = r.charCodeAt(C++), o = r.charCodeAt(C++), a = t >> 2, h = (3 & t) << 4 | e >> 4, n = (15 & e) << 2 | o >> 6, c = 63 & o, isNaN(e) ? n = c = 64 : isNaN(o) && (c = 64), d = d + this._keyStr.charAt(a) + this._keyStr.charAt(h) + this._keyStr.charAt(n) + this._keyStr.charAt(c); return d }, decode: function(r) { var t, e, o, a, h, n, c, d = "", C = 0; for (r = r.replace(/[^A-Za-z0-9\+\/\=]/g, ""); C < r.length; ) a = this._keyStr.indexOf(r.charAt(C++)), h = this._keyStr.indexOf(r.charAt(C++)), n = this._keyStr.indexOf(r.charAt(C++)), c = this._keyStr.indexOf(r.charAt(C++)), t = a << 2 | h >> 4, e = (15 & h) << 4 | n >> 2, o = (3 & n) << 6 | c, d += String.fromCharCode(t), 64 != n && (d += String.fromCharCode(e)), 64 != c && (d += String.fromCharCode(o)); return d = Base64._utf8_decode(d) }, _utf8_encode: function(r) { r = r.replace(/\r\n/g, "\n"); for (var t = "", e = 0; e < r.length; e++) { var o = r.charCodeAt(e); 128 > o ? t += String.fromCharCode(o) : o > 127 && 2048 > o ? (t += String.fromCharCode(o >> 6 | 192), t += String.fromCharCode(63 & o | 128)) : (t += String.fromCharCode(o >> 12 | 224), t += String.fromCharCode(o >> 6 & 63 | 128), t += String.fromCharCode(63 & o | 128)) } return t }, _utf8_decode: function(r) { for (var t = "", e = 0, o = c1 = c2 = 0; e < r.length; ) o = r.charCodeAt(e), 128 > o ? (t += String.fromCharCode(o), e++) : o > 191 && 224 > o ? (c2 = r.charCodeAt(e + 1), t += String.fromCharCode((31 & o) << 6 | 63 & c2), e += 2) : (c2 = r.charCodeAt(e + 1), c3 = r.charCodeAt(e + 2), t += String.fromCharCode((15 & o) << 12 | (63 & c2) << 6 | 63 & c3), e += 3); return t } };;
(function () {
    'use strict';

    angular
        .module("sharedAuthStepUp")
        .controller('MobileApproveController', MobileApproveController);

    MobileApproveController.$inject = ['$scope', '$rootScope', '$state', '$location', 'idShieldService', 'SASiteCatService', 'transmitEventsService', 'LoginAssistantService'];

    function MobileApproveController($scope, $rootScope, $state, $location, idShieldService, SASiteCatService, transmitEventsService, LoginAssistantService) {
        //var tParams = $state.params.transmitParams;
        // $scope.hideChangeAuth = tParams.hideChangeAuth;
        //var appid = tParams.TransmitAppID;
        if (document.getElementById('sharedAuthID')) {
            document.getElementById('sharedAuthID').removeAttribute("style");
        }
        if (typeof $scope.transmitappid !== 'undefined' && $scope.transmitappid == "mbl") {
            SASiteCatService.onTrackSATransmitMobileLogin("Mobile", "StepupMobApprove", null);
        }
        else {
            if (typeof $scope.iswidget !== 'undefined') {
                SASiteCatService.onTrackSATransmitLogin("LoginWidget", "StepupMobApprove", null, $scope.iswidget);
            }
            else {
                var pid;
                if ($state && $state.params && $state.params.transmitParams) {
                    pid = $state.params.transmitParams.policyID || $state.params.transmitParams.TransmitPolicy;
                }
                if (!pid && $rootScope && $rootScope.transmitOTPParams) {
                    pid = $rootScope.transmitOTPParams.policyID;
                }
                if (!pid)
                    pid = $scope.transmitpolicy;
                SASiteCatService.onTrackCustomSharedStepUp("StepUpAuthentication", "AuthenticationTypeMobileApprove", pid);
            }
        }

        $scope.devices = [LoginAssistantService.getDevices()._description.split(' ')[0]];
        $scope.targetClick = function (device) {
            var targetData = LoginAssistantService.getDevices();
            angular.forEach(targetData, function (target) {
                if (targetData._description.includes(device)) {
                    $rootScope.$broadcast('selectedDevice', targetData);
                }

            });
            //targetData.forEach(function (target) {
            //  console.log(targetData._description.includes(device));
            //});
            //    transmitEventsService.selectedTarget(device.device_id);
            //  $rootScope.$broadcast('selectedDevice', device.device_id);
        }
        //$("#sharedAuthstepUpContainer input, #sharedAuthstepUpContainer button, #sharedAuthstepUpContainer a,#sharedAuthstepUpContainer h1").first().focus();
        //$(".omni-overlay.sharedauth").focus();
        //to focus in overlay heading
        $rootScope.dialogHeading = null;
        $rootScope.dialogHeading = "Please select how you want us to deliver a push notification to authenticate you";
        if (document.getElementById('stepupLiveAnnouncement') !== null) {
            document.getElementById('stepupLiveAnnouncement').innerHTML = 'Please select how you want us to deliver a push notification to authenticate you, view loaded';
        }
        if (!((window.currentPageID != null) || (typeof (window.currentPageID) != "undefined"))) {
            $(".sharedauth-loading").focus();
        }
        setTimeout(function () {
            if (((window.currentPageID != null) || (typeof (window.currentPageID) != "undefined")) && !idShieldService.isTuxLogin()) {
                document.getElementById("authenticatorheader").setAttribute("tabindex", "-1");
                document.getElementById("authenticatorheader").focus();
            } else if (idShieldService.isTuxLogin() || (document.getElementsByClassName("contain-stepup sharedauth authlogin")[0] != null && document.getElementsByClassName("contain-stepup sharedauth authlogin")[0] != undefined)) {
                document.getElementById("stepUpHeader").setAttribute("tabindex", "-1");
                document.getElementById("stepUpHeader").focus();
            } else {
                $("#goback").first().focus();
            }
        }, 400);
        if ($state.params.transmitParams) {

            //$scope.devices = $state.params.transmitParams.selectable_devices;
            //changes done to show the device list if device number is one - defect fix 19744
            if ($state.params.transmitParams.selectable_devices.constructor === Array) {
                $scope.devices = $state.params.transmitParams.selectable_devices;
            }
            else {
                var list = $state.params.transmitParams.selectable_devices;
                $scope.devices = [list];
            }
            $scope.targetClick = function (device) {
                transmitEventsService.selectedTarget(device.device_id);
                $rootScope.$broadcast('selectedDevice', device.device_id);
            }

        }

        $scope.hasDevices = $scope.devices.length > 0;

        // To Show Change Authentication link in Device Select Page (only for 24 HB screen)
        $rootScope.$broadcast('ShowHideLinks', null);

        $scope.changeAuth = function () {
            SASiteCatService.onTrackSharedStepUpClickEvent("StepUpAuthentication", "AuthenticationQAChangeAuthLink");
            transmitEventsService.changeAuthenticator();
            $rootScope.$broadcast('authChangeMethod', null);
        }
        $scope.cancelbuttonClick = function () {
            transmitEventsService.cancelAuthenticator();
            // changes has been done to fix the Tux start over option in step up screen 
            if (idShieldService.isTuxLogin()) {
                $rootScope.$broadcast('redirectToTuxLogin', { isError: false });
            } else { $rootScope.$broadcast('ResetLogin', { showError: false }); }
        };
    }

    angular
        .module("sharedAuthStepUp")
        .controller('ErrorPageController', ErrorPageController);

    ErrorPageController.$inject = ['$scope', '$rootScope', '$state', '$location', 'idShieldService', 'SASiteCatService'];

    function ErrorPageController($scope, $rootScope, $state, $location, idShieldService, SASiteCatService) {

        $scope.cancelbuttonClick = function () {
            // changes has been done to fix the Tux start over option in step up screen 
            if (idShieldService.isTuxLogin()) {
                $rootScope.$broadcast('redirectToTuxLogin', { isError: false });
            } else { $rootScope.$broadcast('ResetLogin', { showError: false }); }
        };
    }

})();;
(function() {
    'use strict';

    angular
        .module("sharedAuthStepUp")
        .controller('InputOTPController', InputOTPController);

    InputOTPController.$inject = ['$scope', '$rootScope', '$state', '$location', 'idShieldService', 'SASiteCatService', 'transmitEventsService', '$window'];

    function InputOTPController($scope, $rootScope, $state, $location, idShieldService, SASiteCatService, transmitEventsService, $window) {
        var tParams = $state.params.transmitParams;
        $scope.hideChangeAuth = tParams.hideChangeAuth;
        var appid = tParams.TransmitAppID;
        $scope.IsTempAccessFlow = $state.params.transmitParams.otp_format.length == 7 ? true : false; //Temp Access Code will be 7 digit
        $scope.Year = new Date().getFullYear();
        // Used by Mobile Preference Page during Enrollment
        //$scope.hideChangeAuth = $state.params && $state.params.transmitParams && $state.params.transmitParams.hideChangeAuth || $rootScope.isUserLocked;
        $scope.showCancel = $state.params && $state.params.transmitParams && $state.params.transmitParams.showCancel;
        $scope.showOTPHeader = $state.params && $state.params.transmitParams && $state.params.transmitParams.showOTPHeader;
        $scope.hideRule = $state.params && $state.params.transmitParams && $state.params.transmitParams.hideRule;
  
        $scope.ReturnResponsetoCEI = function (e) {
           if (e === 'enterotpcodescreen') {
                s.linkTrackVars = s.linkTrackVars + ',prop53';
                s.prop53 = 'omni:system:step up verify mobile enter otp return to cei link';
                s.tl(this, 'o', 'omni:system:step up verify mobile enter otp return to cei link', null, 'navigate');
            }
            s.tl();
            $window.open('http://event/?EventName=ReturnFromOTPToCustomerProfile&parm1=');
        }
        $scope.loginWigetDirective = $rootScope.loginWigetDirective;
        $rootScope.AccessFlowMessage = $scope.IsTempAccessFlow;
        if ($scope.IsTempAccessFlow) {
            $scope.otplength = 7;
            $scope.otpsubheading = "Temporary access code";
            $scope.otpheadingmessage = "After using your Temporary Access Code, we recommend you go to your profile and manage your authenticators, ex. Choose new ID Shield questions.";
        }
        else {
            $scope.otplength = 6;
            $scope.otpheadingmessage = "Please enter the code we sent to you. It will expire in 15 minutes.";
            if ($scope.isCEI || $scope.is24HBScreen) {
                var selectedTarget = $rootScope.number;
                $scope.otpheadingmessagefor24HB = "Please enter the one-time passcode we sent to the phone number ending in " + selectedTarget.substring(6, 10) + ". It will expire in 15 minutes.";
            }
            $scope.otpheadingmessage_thirdparty = "Please enter the code we sent to your mobile phone. It will expire in 15 minutes.";
            $scope.otpsubheading = "6-digit code";
        }
        if (typeof $scope.transmitappid !== 'undefined' && $scope.transmitappid == "mbl") {
            SASiteCatService.onTrackSATransmitMobileLogin("Mobile", "StepupEnterOTPCode", null);
        }
        else {
            if (typeof $scope.iswidget !== 'undefined') {
                SASiteCatService.onTrackSATransmitLogin("LoginWidget", "StepupEnterOTPCode", null, $scope.iswidget);
            }
            else {
                var pid;
                if ($state && $state.params && $state.params.transmitParams) {
                    pid = $state.params.transmitParams.policyID || $state.params.transmitParams.TransmitPolicy;
                }
                if (!pid && $rootScope && $rootScope.transmitOTPParams) {
                    pid = $rootScope.transmitOTPParams.policyID;
                }
                if (!pid)
                    pid = $scope.transmitpolicy;
                SASiteCatService.onTrackCustomSharedStepUp("StepUpAuthentication", "AuthenticationTypeOTPVerify", pid);
            } 
        }

        var otpRegex = /^[0-9]$/;
        $rootScope.dialogHeading = null;
        $rootScope.dialogHeading = "One-Time Passcode";
        $rootScope.dialogHeading24hbCEI = "One-Time Passcode";
        if (document.getElementById('stepupLiveAnnouncement') !== null) {
            document.getElementById('stepupLiveAnnouncement').innerHTML = 'One-Time Passcode, view loaded';
        }
        if (!((window.currentPageID != null) || (typeof (window.currentPageID) != "undefined"))) {
            $(".sharedauth-loading").focus();
        }
        setTimeout(function() {
            if (((window.currentPageID != null) || (typeof (window.currentPageID) != "undefined")) && !idShieldService.isTuxLogin()) {
                document.getElementById("authenticatorheader").setAttribute("tabindex", "-1");
                document.getElementById("authenticatorheader").focus();
            } else if (idShieldService.isTuxLogin() || (document.getElementsByClassName("contain-stepup sharedauth authlogin")[0] != null && document.getElementsByClassName("contain-stepup sharedauth authlogin")[0] != undefined)) {
                document.getElementById("stepUpHeader").setAttribute("tabindex", "-1");
                document.getElementById("stepUpHeader").focus();
            } else {
                $("#goback").first().focus();
            }
        }, 400);
        $scope.otpCode = '';

        var appid = $rootScope.transmitOTPParams ? $rootScope.transmitOTPParams.TransmitAppID : '';
        var BaseUrl = $rootScope.transmitOTPParams ? $rootScope.transmitOTPParams.IDShieldBaseURL : '';
        $scope.isMobileWeb = (appid == "mbl") ? false : true;
        var urlSplit = BaseUrl.split('/');
        var protocol = urlSplit[0];
        var domain = urlSplit[2];
        var sub_url = protocol + '//' + domain;

        $scope.otpLogin = function() {
            if (document.getElementById("otpCode").value == '') {
                if ($scope.transmitpolicy === "mno_confidence") {
                    document.getElementById("otpCode").classList.toggle("la__error-field");
                }

                document.getElementById('otpError').innerHTML = "Please enter the code.";
                document.getElementById("otpCode").value = ""; //defect fix 20739
                document.getElementById("otpCode").focus();
                if (appid == "mbl") {
                    SASiteCatService.onTrackSATransmitMobileLogin("Mobile", "StepupEnterOTPFormatError", null);
                }
                else {
                    if (typeof $scope.iswidget !== 'undefined') {
                        SASiteCatService.onTrackSATransmitLogin("LoginWidget", "StepupEnterOTPFormatError", null, $scope.iswidget);
                    }
                }
            } else if (isNaN(document.getElementById("otpCode").value)) {
                if ($scope.transmitpolicy === "mno_confidence") {
                    document.getElementById("otpCode").classList.toggle("la__error-field");
                }
                if ($scope.IsTempAccessFlow) {
                    document.getElementById('otpError').innerHTML = "Please enter your 7-digit Temporary Access Code using numbers only.";
                } else {
                    document.getElementById('otpError').innerHTML = "Enter numbers only please, and no more than six digits.";
                }
                document.getElementById("otpCode").value = "";
                document.getElementById("otpCode").focus();
                if (appid == "mbl") {
                    SASiteCatService.onTrackSATransmitMobileLogin("Mobile", "StepupEnterOTPFormatError", null);
                }
                else {
                    if (typeof $scope.iswidget !== 'undefined') {
                        SASiteCatService.onTrackSATransmitLogin("LoginWidget", "StepupEnterOTPFormatError", null, $scope.iswidget);
                    }
                }
            }
            else {
                //$scope.errorMessage = "Please enter correct OTP"; //defect fix 19056
                if ($scope.transmitpolicy === "mno_confidence") {
                    document.getElementById("otpCode").classList.remove("la__error-field");
                }
                document.getElementById('otpError').innerHTML = "";
                transmitEventsService.verifyOTP($scope.otpCode);
                $rootScope.$broadcast('otpLogin', $scope.otpCode);
            }
        }
        //$("#sharedAuthstepUpContainer input, #sharedAuthstepUpContainer button, #sharedAuthstepUpContainer a,#sharedAuthstepUpContainer h1").first().focus();
        //$(".omni-overlay.sharedauth").focus();      
        $scope.otpResend = function() {
            SASiteCatService.onTrackSharedStepUpClickEvent("StepUpAuthentication", "AuthenticationResendLink");
            transmitEventsService.resendOTP();
            $rootScope.$broadcast('otpResend', null);
        }

        $scope.changeAuth = function() {
            SASiteCatService.onTrackSharedStepUpClickEvent("StepUpAuthentication", "AuthenticationQAChangeAuthLink");
            transmitEventsService.changeAuthenticator();
            $rootScope.$broadcast('authChangeMethod', null);
        }
        $scope.RedirectToLoginAssist = function(personId) {
            SASiteCatService.onTrackSharedStepUpClickEvent("StepUpAuthentication", "AuthenticationOTPHelpLink");
            idShieldService.loginAssit($scope.accountLocked, true, $scope.isMobileWeb, sub_url);
        };
        $scope.validateinput = function(evt) {
            if (evt.charCode == 0) {
                return true;
            } else if (evt.charCode >= 48 && evt.charCode <= 57) {
                return true;
            } else {
                return false;
            }
        };
        $scope.cancelbuttonClick = function() {
            transmitEventsService.cancelAuthenticator();
            // changes has been done to fix the Tux start over option in step up screen 
            if (idShieldService.isTuxLogin()) {
                $rootScope.$broadcast('redirectToTuxLogin', { isError: false });
            } else { $rootScope.$broadcast('ResetLogin', { showError: false }); }
        };

        // To hide Need help? link for 24 HB screen
        $rootScope.$broadcast('ShowHideLinks', null);

    }
})();;
(function() {
    'use strict';

    angular
        .module("sharedAuthStepUp")
        .controller('OTPTargetController', OTPTargetController)
        .filter('formatetarget', function() {

            return function(input) {

                var output = input.substring(6, 10);
                return output;

            }

        });

    OTPTargetController.$inject = ['$scope', '$rootScope', '$state', '$location', 'idShieldService', 'SASiteCatService', 'transmitEventsService', '$window'];

    function OTPTargetController($scope, $rootScope, $state, $location, idShieldService, SASiteCatService, transmitEventsService, $window) {
        var tParams = $state.params.transmitParams;
        $scope.hideChangeAuth = tParams.hideChangeAuth;
        var appid = tParams.TransmitAppID;
        if (document.getElementById('sharedAuthID')) {
            document.getElementById('sharedAuthID').removeAttribute("style");
        }
        if (typeof $scope.transmitappid !== 'undefined' && $scope.transmitappid == "mbl") {
            SASiteCatService.onTrackSATransmitMobileLogin("Mobile", "StepupSelectOTPDevice", null);
        }
        else {
            if (typeof $scope.iswidget !== 'undefined') {
                SASiteCatService.onTrackSATransmitLogin("LoginWidget", "StepupSelectOTPDevice", null, $scope.iswidget);
            }
            else {
                var pid;
                if ($state && $state.params && $state.params.transmitParams) {
                    pid = $state.params.transmitParams.policyID || $state.params.transmitParams.TransmitPolicy;
                }
                if (!pid && $rootScope && $rootScope.transmitOTPParams) {
                    pid = $rootScope.transmitOTPParams.policyID;
                }
                if (!pid)
                    pid = $scope.transmitpolicy;
                SASiteCatService.onTrackCustomSharedStepUp("StepUpAuthentication", "AuthenticationTypeOTP", pid);
            }
        }
        //$("#sharedAuthstepUpContainer input, #sharedAuthstepUpContainer button, #sharedAuthstepUpContainer a, #sharedAuthstepUpContainer h1").first().focus();
        //$(".omni-overlay.sharedauth").focus();
        //to focus in overlay heading
        $rootScope.dialogHeading = null;
        $rootScope.dialogHeading = "Please select how you want us to deliver a one-time passcode to you";
        $rootScope.dialogHeading24hbCEI = "Please select how the customer wants to receive their one-time passcode.";
        $rootScope.disclosureseconddialog24hbCEI = "May we text you a one-time passcode? It's to help verify your identity.";
        $rootScope.disclosurefirstdialog24hbCEI = "Ask the customer the following, before sending them a one-time passcode:";
        if (document.getElementById('stepupLiveAnnouncement') !== null) {
            document.getElementById('stepupLiveAnnouncement').innerHTML = 'Please select how you want us to deliver a one-time passcode to you, view loaded';
        }
        if (!((window.currentPageID != null) || (typeof (window.currentPageID) != "undefined"))) {
            $(".sharedauth-loading").focus();
        }

        setTimeout(function() {
            if (((window.currentPageID != null) || (typeof (window.currentPageID) != "undefined")) && !idShieldService.isTuxLogin()) {
                document.getElementById("authenticatorheader").setAttribute("tabindex", "-1");
                document.getElementById("authenticatorheader").focus();
            } else if (idShieldService.isTuxLogin() || (document.getElementsByClassName("contain-stepup sharedauth authlogin")[0] != null && document.getElementsByClassName("contain-stepup sharedauth authlogin")[0] != undefined)) {
                document.getElementById("stepUpHeader").setAttribute("tabindex", "-1");
                document.getElementById("stepUpHeader").focus();
            } else {
                $("#goback").first().focus();
            }
        }, 400);


        if ($state.params.transmitParams) {

            $scope.targets = $state.params.transmitParams.channels[0].targets;

            $scope.targetClick = function(number) {
                transmitEventsService.selectedTarget(number);
                $rootScope.number = number;
                $rootScope.$broadcast('selectedTarget', number);
            }

            $scope.sendSMS = function(number) {
                transmitEventsService.selectedTarget(number);
                $rootScope.$broadcast('selectedTarget', number);
            }
        }


        // To Show Change Authentication link in OTP Select Page (only for 24 HB screen)
        $rootScope.$broadcast('ShowHideLinks', null);

        $scope.ReturnResponsetoCEI = function (e) {
            if (e === 'selectotpenterscreen') {
                s.linkTrackVars = s.linkTrackVars + ',prop53';
                s.prop53 = 'omni:system:select mobile token for otp return to cei link';
                s.tl(this, 'o', 'omni:system:select mobile token for otp return to cei link', null, 'navigate');

            }
            s.tl();
            $window.open('http://event/?EventName=ReturnFromOTPToCustomerProfile&parm1=');
        }
        $scope.changeAuth = function() {
            SASiteCatService.onTrackSharedStepUpClickEvent("StepUpAuthentication", "AuthenticationQAChangeAuthLink");
            transmitEventsService.changeAuthenticator();
            $rootScope.$broadcast('authChangeMethod', null);
        }
        $scope.cancelbuttonClick = function() {
            transmitEventsService.cancelAuthenticator();
            // changes has been done to fix the Tux start over option in step up screen 
            if (idShieldService.isTuxLogin()) {
                $rootScope.$broadcast('redirectToTuxLogin', { isError: false });
            } else { $rootScope.$broadcast('ResetLogin', { showError: false }); }
        };
    }

})();;
(function () {
    'use strict';

    angular
        .module("sharedAuthStepUp")
        .controller('PendingApprovalController', PendingApprovalController);

    PendingApprovalController.$inject = ['$scope', '$rootScope', '$state', '$location', 'idShieldService', 'SASiteCatService', 'transmitEventsService'];

    function PendingApprovalController($scope, $rootScope, $state, $location, idShieldService, SASiteCatService, transmitEventsService) {
        if (typeof $scope.transmitappid !== 'undefined' && $scope.transmitappid == "mbl") {
            SASiteCatService.onTrackSATransmitMobileLogin("Mobile", "StepupMobApprovePending", null);
        }
        else {
            if (typeof $scope.iswidget !== 'undefined') {
                SASiteCatService.onTrackSATransmitLogin("LoginWidget", "StepupMobApprovePending", null, $scope.iswidget);
            }
            else {
                var pid;
                if ($state && $state.params && $state.params.transmitParams) {
                    pid = $state.params.transmitParams.policyID || $state.params.transmitParams.TransmitPolicy;
                }
                if (!pid && $rootScope && $rootScope.transmitOTPParams) {
                    pid = $rootScope.transmitOTPParams.policyID;
                }
                if (!pid)
                    pid = $scope.transmitpolicy;
                SASiteCatService.onTrackCustomSharedStepUp("StepUpAuthentication", "AuthenticationTypeMobileApprovePending", pid);
            }
        }
        // var appid = $rootScope.transmitOTPParams ? $rootScope.transmitOTPParams.TransmitAppID : '';
        // var BaseUrl = $rootScope.transmitOTPParams ? $rootScope.transmitOTPParams.IDShieldBaseURL : '';
        // $scope.isMobileWeb = (appid == "mbl") ? false : true;
        // var urlSplit = BaseUrl.split('/');
        // var protocol = urlSplit[0];
        // var domain = urlSplit[2];
        // var sub_url = protocol + '//' + domain;
        $scope.errorMessage = "";
        //$("#sharedAuthstepUpContainer input, #sharedAuthstepUpContainer button, #sharedAuthstepUpContainer a, #sharedAuthstepUpContainer h1").first().focus();
        //$(".omni-overlay.sharedauth").focus();
        //to focus in overlay heading        
        $rootScope.dialogHeading = null;
        $rootScope.dialogHeading = "Authorization Pending";
        if (document.getElementById('stepupLiveAnnouncement') !== null) {
            document.getElementById('stepupLiveAnnouncement').innerHTML = 'Authorization Pending, View loaded';
        }
        if (!((window.currentPageID != null) || (typeof (window.currentPageID) != "undefined"))) {
            $(".sharedauth-loading").focus();
        }
        setTimeout(function () {
            if (((window.currentPageID != null) || (typeof (window.currentPageID) != "undefined")) && !idShieldService.isTuxLogin()) {
                document.getElementById("authenticatorheader").setAttribute("tabindex", "-1");
                document.getElementById("authenticatorheader").focus();
            } else if (idShieldService.isTuxLogin() || (document.getElementsByClassName("contain-stepup sharedauth authlogin")[0] != null && document.getElementsByClassName("contain-stepup sharedauth authlogin")[0] != undefined)) {
                document.getElementById("stepUpHeader").setAttribute("tabindex", "-1");
                document.getElementById("stepUpHeader").focus();
            } else {
                $("#goback").first().focus();
            }
        }, 400);
        $scope.changeAuth = function () {
            SASiteCatService.onTrackSharedStepUpClickEvent("StepUpAuthentication", "AuthenticationPushChangeAuthLink");
            transmitEventsService.changeAuthenticator();
            $rootScope.$broadcast('authChangeMethod', null);
        }
        $scope.tryOnce = function () {
            SASiteCatService.onTrackSharedStepUpClickEvent("StepUpAuthentication", "AuthenticationChangeDeviceLink");
            transmitEventsService.retryAuthenticator();
            $rootScope.$broadcast('authRetry', null);
        }
        $scope.RedirectToLoginAssist = function (personId) {
            SASiteCatService.onTrackSharedStepUpClickEvent("StepUpAuthentication", "AuthenticationPushHelpLink");
            idShieldService.loginAssit($scope.accountLocked, false, $scope.isMobileWeb, sub_url);
        };

        $scope.cancelbuttonClick = function () {
            transmitEventsService.cancelAuthenticator();
            // changes has been done to fix the Tux start over option in step up screen 
            if (idShieldService.isTuxLogin()) {
                $rootScope.$broadcast('redirectToTuxLogin', { isError: false });
            } else { $rootScope.$broadcast('ResetLogin', { showError: false }); }
        };
        $scope.navigateArrowKeys = function (event) {
            if (event.keyCode == 40) {
                if (document.activeElement.parentElement.nextElementSibling != null && document.activeElement.parentElement.nextElementSibling.children.length > 0) {
                    angular.element(document.activeElement.parentElement.nextElementSibling.children[0].focus());
                }
                else {
                    angular.element(document.querySelector("#authenticatorheader").parentNode.focus());
                }
            }
            if (event.keyCode == 38) {
                if (document.activeElement.parentElement.previousElementSibling != null && document.activeElement.parentElement.previousElementSibling.children.length > 0) {
                    angular.element(document.activeElement.parentElement.previousElementSibling.children[0].focus());
                }
                else {
                    angular.element(document.querySelector("#authenticatorheader").parentNode.focus());
                }
            }
        };
        //code to hide the change device link for single device - defect fix 19744
        $scope.deviceList = [];
        /* if ($state.params.transmitParams.selectable_devices.constructor === Array) {
             $scope.deviceList = $state.params.transmitParams.selectable_devices;
         }
         else {
             var list = $state.params.transmitParams.selectable_devices;
             $scope.deviceList = [list];
         }
         if ($scope.deviceList.length < 2) {
             $('#linkdiable').hide();
         }
         else {
             $('#linkdiable').show();
         }*/

        $rootScope.$broadcast('ShowHideLinks', null);
    }
})();;
(function() {
    'use strict';

    angular
        .module("sharedAuthStepUp")
        .controller('ConfirmPopController', ConfirmPopController);

    ConfirmPopController.$inject = ['$scope', '$state', '$rootScope', 'SASiteCatService', 'transmitEventsService', 'LoginAssistantService'];

    function ConfirmPopController($scope, $state, $rootScope, SASiteCatService, transmitEventsService, LoginAssistantService) {
        if ($rootScope.systemError) {
            transmitEventsService.cancel();
            $rootScope.$broadcast('authCancel', null);
        }
        if ($rootScope.mainClose != true) {
            SASiteCatService.onTrackCustomSharedStepUp("StepUpAuthentication", "AuthenticationAYS");
        }
        $rootScope.dialogHeading = null;
        $rootScope.dialogHeading = "Are you sure you want to cancel?";
        if (document.getElementById('stepupLiveAnnouncement') !== null) {
            document.getElementById('stepupLiveAnnouncement').innerHTML = 'Are you sure you want to cancel?, view loaded';
        }


        // Used by Mobile Preference Page during Enrollment
        $scope.hideChangeAuth = $state && $state.params && $state.params.transmitParams && $state.params.transmitParams.hideChangeAuth || $rootScope.isUserLocked;
        $scope.showCancel = $state && $state.params && $state.params.transmitParams && $state.params.transmitParams.showCancel;

        if (((window.currentPageID != null) || (typeof (window.currentPageID) != "undefined"))) {
            document.getElementById("authenticatorheader").setAttribute("tabindex", "-1"); //setting focus to header in AYS screen for TUX
            document.getElementById("authenticatorheader").focus();
        }

        //setTimeout(function() {
        //    $("#overlayModalContainer").first().focus();
        //    if (((window.currentPageID != null) || (typeof (window.currentPageID) != "undefined"))) {
        //        document.getElementById("authenticatorheader").setAttribute("tabindex", "-1"); //setting focus to header in AYS screen for TUX
        //        document.getElementById("authenticatorheader").focus();
        //    }
        //}, 400);
        //if (((window.currentPageID != null) || (typeof (window.currentPageID) != "undefined"))) {
        //    setTimeout(function() {
        //        document.getElementById("confirmCancel").focus(); //focusing on yes link in AYS screen
        //    }, 300)
        //} 
        // require(['xm/xmui', 'xm/xm_api'], function (xmui, xm) {
        $scope.confirmCancel = function() {
            transmitEventsService.cancelAuthenticator();
            SASiteCatService.onTrackSharedStepUpClickEvent("StepUpAuthentication", "AuthenticationAYSYesLink");
            $rootScope.$broadcast('authCancel', null);
        }
        $scope.tryOnce = function() {
            transmitEventsService.retryAuthenticator();
            SASiteCatService.onTrackSharedStepUpClickEvent("StepUpAuthentication", "AuthenticationAYSNoLink");
            $rootScope.$broadcast('authRetry', null);
        }
        $scope.changeAuth = function() {
            transmitEventsService.changeAuthenticator();
            SASiteCatService.onTrackSharedStepUpClickEvent("StepUpAuthentication", "AuthenticationAYSChagneAuthLink");
            /*if (LoginAssistantService.getCancelMobileApprove()) {
                $rootScope.$broadcast('authChangeMethod', null);
            }*/

        }
        // });
        //$("#sharedAuthstepUpContainer a,#sharedAuthstepUpContainer h1").first().focus();
        //$(".omni-overlay.sharedauth").focus();
        //to focus in overlay heading        
        $scope.navigateArrowKeys = function(event) {
            if (event.keyCode == 40) {
                if (document.activeElement.parentElement.nextElementSibling != null && document.activeElement.parentElement.nextElementSibling.children.length > 0) {
                    angular.element(document.activeElement.parentElement.nextElementSibling.children[0].focus());
                }
                else {
                    angular.element(document.querySelector("#authenticatorheader").parentNode.focus());
                }
            }
            if (event.keyCode == 38) {
                if (document.activeElement.parentElement.previousElementSibling != null && document.activeElement.parentElement.previousElementSibling.children.length > 0) {
                    angular.element(document.activeElement.parentElement.previousElementSibling.children[0].focus());
                }
                else {
                    angular.element(document.querySelector("#authenticatorheader").parentNode.focus());
                }
            }
        };
    }
})();;
(function () {
    //IDShield Service
    angular.module('sharedAuthStepUp')
        .factory('idShieldService', ['$http', '$state', '$rootScope', function ($http, $state, $rootScope) {

            var getIdshieldQuestions = function (getBaseUrl, transactionid, signonid, sessionGUID) {
                questionParams = {
                    "TransactionId": transactionid,
                    "SignOnId": signonid,
                    "TransactionGUID": sessionGUID
                }
                Object.toparams = function ObjecttoParams(questionParams) {
                    var parameters = [];
                    for (var key in questionParams) {
                        parameters.push(key + '=' + encodeURIComponent(questionParams[key]));
                    }
                    return parameters.join('&');
                };
                $rootScope.loading = true;

                var disablingDiv = document.getElementById('disablingDiv');
                if (disablingDiv) disablingDiv.style.display = 'block'; //defect fix 22590

                return $http({
                    method: 'POST',
                    headers: {
                        'Content-Type': 'application/x-www-form-urlencoded'
                    },
                    url: getBaseUrl + "getstepupquestion",
                    data: Object.toparams(questionParams)
                });

            }
            var answerValidation = function (answer, $scope) {

                if (!answer) {
                    $scope.showerror = true;
                    $scope.errorMessage = "Please enter an answer.";
                    return;
                }
                else {
                    $scope.showerror = false;
                    $scope.errorMessage = "";
                }
                if ($scope.placeHolderText) {

                    switch ($scope.AnswerFormat) {
                        case "MMYY":
                            $scope.regFormat = /^(0?[1-9]|1[012])[\/]\d\d$/;
                            $scope.errorText = "Please enter the date in this format: MM/YY";
                            break;
                        case "DATE6":
                            $scope.regFormat = /^(0?[1-9]|1[012])[\/](0?[1-9]|[12][0-9]|3[01])[\/]\d\d$/;
                            $scope.errorText = "Please enter the date in this format: MM/DD/YY";
                            break;
                        case "MMDD":
                            $scope.regFormat = /^(0?[1-9]|1[012])[\/](0?[1-9]|[12][0-9]|3[01])$/;
                            $scope.errorText = "Please enter the date in this format: MM/DD";
                            break;

                    }

                    if (!$scope.regFormat.test(answer)) {
                        $scope.showerror = true;
                        $scope.errorMessage = $scope.errorText;
                        return;
                    }
                    $scope.showerror = false;
                    $scope.errorMessage = "";
                }
            }
            var getPlaceholderText = function (formate) {

                switch (formate) {
                    case "MMYY":
                        return "MM/YY";
                        break;
                    case "DATE6":
                        return "MM/DD/YY";
                        break;
                    case "MMDD":
                        return "MM/DD";
                        break;
                }
            }
            var validateAnswer = function (getBaseUrl, transactionid, answer, contextData, appid, signonid, policyid, actimizedata, sessionGUID) {
                answerParams = {
                    "Answer": answer,
                    "ContextData": contextData ? contextData : "",
                    "TransmitApplicationId": appid,
                    "SignOnId": signonid,
                    "PolicyID": policyid,
                    "ActimizeData": actimizedata ? actimizedata : "",
                    "TransactionGUID": sessionGUID,
                    "BlackBoxData": "BlackBoxData",
                    "VersionNumber": "19.3.66"
                }
                Object.toparams = function ObjecttoParams(validationParams) {
                    var parameters = [];
                    for (var key in validationParams) {
                        parameters.push(key + '=' + encodeURIComponent(validationParams[key]));
                    }
                    return parameters.join('&');
                };
                $rootScope.loading = true;
                return $http({
                    method: 'POST',
                    url: getBaseUrl + "validatestepupquestion",

                    headers: {
                        'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8'
                    },
                    data: Object.toparams(answerParams)

                });

            }

            var isLoginStepup = function () {
                var returnVal = false;
                if ($("div[saloginwidget]") != null && $("div[saloginwidget]") != undefined) {
                    if ($("div[saloginwidget]").length > 0) {
                        returnVal = true;
                    }
                }
                return returnVal;
            }


            var isTuxLogin = function () {
                var returnFlag = false;
                if ($("#tuxloginwidget") != null && $("#tuxloginwidget") != undefined) {
                    if ($("#tuxloginwidget").length > 0) {
                        returnFlag = true;
                    }
                }
                return returnFlag;
            }
            // To check whether the stepup is loaded via SharedAuthDirective.js
            var isStepUpViaSharedAuthDirective = function () {
                var returnFlag = false;
                if (document.querySelector("div[sastepup]") != null && document.querySelector("div[sastepup]") != undefined) {
                    if (angular.element(document.querySelector("div[sastepup]")).length > 0) {
                        returnFlag = true;
                    }
                }
                return returnFlag;
            }

            var loginAssistance = function LoginAssistance(isAccountLocked, isOTP, isMobileWeb, BaseUrl,CancelUrl, isResetPassword, isChangePassword, existingPassword) {
                var isOTPFlow = false;
                if (isOTP != undefined && isOTP != null && isOTP) {
                    isOTPFlow = true;
                }
                try {

                    // Check Mobile/OLB
                    if (typeof (OmniDataUtil) != "undefined") {
                        $rootScope.$broadcast('authCancel', null); //defect fix 18057
                        require(['login_util', 'login_model'], function (LoginUtil, LoginModel) {
                            var inSession = 'true';
                            // To identify insession or out session for TUX
                            if ($("#tuxloginwidget") != null && $("#tuxloginwidget") != undefined) {
                                if ($("#tuxloginwidget").length > 0) {
                                    inSession = 'false';
                                }
                            }
                            if (isResetPassword != undefined && isResetPassword != null && isResetPassword) {
                                LoginUtil.LoginAssistanceUtil('URL_SUFFIX_LOGIN_ASSIST_RESET_PASSWORD', inSession, 'True', 'resetPassword', isOTPFlow);
                            }
                            else if (isChangePassword != undefined && isChangePassword != null && isChangePassword) {
                                LoginUtil.LoginAssistanceUtil('URL_SUFFIX_LOGIN_ASSIST_CHANGE_PASSWORD', inSession, 'false', 'changePassword', isOTPFlow, false, "", existingPassword);
                            }
                            else {
                                if (isAccountLocked)
                                    LoginUtil.LoginAssistanceUtil('URL_SUFFIX_LOGIN_ASSIST_RESET_ANSWERS', inSession, 'true', 'resetQuestions', isOTPFlow);
                                else
                                    LoginUtil.LoginAssistanceUtil('URL_SUFFIX_LOGIN_ASSIST_RESET_ANSWERS', inSession, 'false', 'forgotAns', isOTPFlow);
                            }

                            LoginModel.model.set("LoginAssistanceFlow", false);
                        });
                    }
                    else {

                        $rootScope.$broadcast('authCancel', null);
                        var laForm = document.createElement('form');
                        laForm.id = "LAForm";
                        laForm.method = 'post';

                        var directiveWidgetBaseURL = "";
                        var directiveWidget = document.getElementById('dvLoginWidgetDir');
                        if (directiveWidget != null && directiveWidget != undefined) {
                            directiveWidgetBaseURL = directiveWidget.getAttribute("baseurl");
                        }
                        if (directiveWidgetBaseURL!=null && directiveWidgetBaseURL!=undefined && directiveWidgetBaseURL!="") {
                            laForm.action = directiveWidgetBaseURL + "/OLS/LoginAssistant/ResetAnswers";
                        }
                        else {
                            laForm.action = "/OLS/LoginAssistant/ResetAnswers";
                        }

                        if (window.parent) {
                            laForm.target = '_parent';
                        }

                        // Added for passing inSession value as false during login
                        var inSession = "True";
                        if ($("div[saloginwidget]") != null && $("div[saloginwidget]") != undefined) {
                            if ($("div[saloginwidget]").length > 0) {
                                inSession = "False";
                            }
                        }

                        var redirectUrlLocation = "";
                        if (inSession == "True") {
                            if (s.contextData.appName_PERS == "OLB" && (window.location.pathname.indexOf("MobileNumberCapture") != -1 || window.location.pathname.indexOf("KycRefresh") != -1)) {
                                redirectUrlLocation = window.parent.location.pathname;//if mobile number capture or KYC refresh redirect to Customer dashboard
                            }
                            else {
                                redirectUrlLocation = window.location.pathname;
                            }
                            var elemReturnUrl = document.createElement('INPUT');
                            elemReturnUrl.type = "HIDDEN";
                            elemReturnUrl.value = redirectUrlLocation;
                            elemReturnUrl.name = "ReturnURL";
                            laForm.appendChild(elemReturnUrl);
                            if (s.contextData.appName_PERS == "OLB" && (window.location.pathname.indexOf("MobileNumberCapture") != -1 || window.location.pathname.indexOf("KycRefresh") != -1)) {
                                redirectUrlLocation = window.parent.location.pathname;//if mobile number capture or KYC refresh redirect to Customer dashboard
                            }
                            else {
                                redirectUrlLocation = window.location.pathname;
                            }
                        }
                        else {
                            redirectUrlLocation = CancelUrl ? CancelUrl : "/Auth/Login";
                        }

                        var elemCancelUrl = document.createElement('INPUT');
                        var elemAppName = document.createElement('INPUT');
                        var elemIsOTP = document.createElement('INPUT');
                        var elemIsLock = document.createElement('INPUT');

                        elemIsOTP.type = 'HIDDEN';
                        elemIsOTP.value = 'true';
                        elemIsOTP.name = 'IsOTP';

                        elemCancelUrl.type = 'HIDDEN';
                        elemCancelUrl.value = redirectUrlLocation;
                        elemCancelUrl.name = 'CancelURL';

                        elemAppName.type = "HIDDEN";
                        elemAppName.value = "OLB";
                        elemAppName.name = "AppName";

                        var lockIndicator = 'False';
                        if (isAccountLocked) {
                            lockIndicator = 'True';
                        }

                        elemIsLock.type = "HIDDEN";
                        elemIsLock.value = lockIndicator;
                        elemIsLock.name = "LockIndicator";

                        laForm.appendChild(elemCancelUrl);
                        laForm.appendChild(elemAppName);
                        laForm.appendChild(elemIsLock);
                        // Hide Send text row during OTp Flow
                        if (isOTPFlow) {
                            laForm.appendChild(elemIsOTP);
                        }

                        var elemInSession = document.createElement('INPUT');
                        elemInSession.type = "HIDDEN";
                        elemInSession.value = inSession;
                        elemInSession.name = "InSession";
                        laForm.appendChild(elemInSession);

                        document.body.appendChild(laForm);
                        laForm.submit();
                        // End CI-LoginAssistance : Changed ForgotAnswer link urls to new LA ResetIdShield

                    }
                }
                catch (ex) { }
            }
            return {
                getIdshieldQuestions: getIdshieldQuestions,
                validateAnswer: validateAnswer,
                loginAssit: loginAssistance,
                answerValidation: answerValidation,
                getPlaceholderText: getPlaceholderText,
                isLoginStepup: isLoginStepup,
                isTuxLogin: isTuxLogin,
                isStepUpViaSharedAuthDirective: isStepUpViaSharedAuthDirective
            };

        }]).factory('SASiteCatService', ['$http', '$state', '$rootScope', function ($http, $state, $rootScope) {
            var commonTracking = function () {

                /* User Agent Checking for Mobile-based logic */
                var ua = navigator.userAgent;
                if (!ua) { ua = "device unknown"; }
                var device_name = "";
                var device_type = "";
                var device_auth_type = "";
                var checker = {
                    iphone: ua.match(/iPhone/),
                    ipad: ua.match(/iPad/),
                    android: ua.match(/Android/),
                    windowsPhone: ua.match(/Windows Phone/),
                    blackBerry: ua.match(/BlackBerry|BB|playbook/i)
                };
                if (checker.android) {
                    device_name = "wap:android";
                } else if (checker.ipad) {
                    device_name = "wap:ipad";
                } else if (checker.iphone) {
                    device_name = "wap:iphone";
                } else if (checker.windowsPhone) {
                    device_name = "wap:windowsPhone";
                } else if (checker.blackBerry) {
                    device_name = "wap:blackBerry";
                } else { device_name = "wap:other"; }

                s.eVar71 = s.prop30 = device_name;
                if (s.contextData['appName_PERS'] == "MBL") { s.prop40 = "mobile"; }

            };
            var setChallengeContextData = function (pid) {
                cd.challengePolicy = pid;
                switch (pid) {
                    case "full_number":
                        cd.challengeStatus = "full account number view";
                        break;
                    default:
                        cd.challengeStatus = pid ? pid.replace(/_/g, " ") : "";
                        break;
                }
            };
            var isTuxLogin = function () {
                var returnFlag = false;
                if ($("#tuxloginwidget") != null && $("#tuxloginwidget") != undefined) {
                    if ($("#tuxloginwidget").length > 0) {
                        returnFlag = true;
                    }
                }
                return returnFlag;
            }
            var siteCatTUXLoginParameters= function(pageType,pageSection) {
                var prefix = "omni";
                var siteCatParams = {};
                siteCatParams.subSiteSection ='';
                siteCatParams.currentPageName ='';
                if (isTuxLogin && isTuxLogin === true) {
                    siteCatParams.subSiteSection =Omniture.constants[pageType]["subSiteSectionLoginTUX"];
                    siteCatParams.currentPageName ="usb:mobile:wap:waptouch:login" +":" + Omniture.constants[pageType][pageSection];
                }else{
                    siteCatParams.subSiteSection =Omniture.constants[pageType]["subSiteSection"];
                    siteCatParams.currentPageName =prefix + ":" + Omniture.constants[pageType]["pageType"] + ":" + Omniture.constants[pageType][pageSection];
                }
                return siteCatParams;
            }
            var onTrackCustomSharedStepUp = function (pageType, pageSection, policyId) {
                if (Omniture.constants[pageType] && Omniture.constants[pageType]["pageType"]) {
                    var prefix = "omni";
                    var subSiteSection ="";
                    var currentPageName="";
                    s.clearContext();
                    s.clearVars();
                    if (s.contextData['appName_PERS'] == "MBL") { commonTracking(); }
                    var siteCatParams = siteCatTUXLoginParameters(pageType,pageSection);

                    cd.currentPage = siteCatParams.currentPageName;
                    cd.siteSection = Omniture.constants[pageType]["siteSection"];
                    cd.subSiteSection = siteCatParams.subSiteSection;;
                    if (policyId)
                        setChallengeContextData(policyId);
                    if (pageSection.indexOf("Error") > 1) {
                        cd.transactionerror = Omniture.constants[pageType][pageSection];
                    }

                    s.pageName = "";
                    s.prop53 = cd.currentPage;

                    s.t();
                }
                else {
                    /// DE: BB-57-Remove console.log
                }
            };
            var onTrackSharedStepUpClickEvent = function (pageType, pageSection) {
                if (Omniture.constants[pageType] && Omniture.constants[pageType][pageSection]) {
                    var prefix = "omni";
                    s.clearVars();
                    if (s.contextData['appName_PERS'] == "MBL") { commonTracking(); }
                    s.linkTrackVars = s.linkTrackVars + ',prop53';
                    //s.linkTrackVars = s.linkTrackVars + ',prop53,contextData.cd.challengePolicy,contextData.cd.challengeStatus';
                    //setChallengeContextData();
                    var siteCatParams = siteCatTUXLoginParameters(pageType,pageSection);

                    
                    //var track53 = prefix + ":" + Omniture.constants[pageType]["pageType"] + ":" + Omniture.constants[pageType][pageSection];
                    var track53 = siteCatParams.currentPageName;
                    s.prop53 = track53;
                    s.tl(this, 'o', track53, null, 'navigate');

                }
                else {
                    /// DE: BB-57-Remove console.log
                }
            };
            var SiteCatSwitchCode = function (pageName, eventName, dynamicVars, SiteCatProperties) {
                for (var key in SiteCatProperties) {
                    if (!SiteCatProperties.hasOwnProperty(key)) {
                        //The current property is not a direct property of SiteCatProperties
                        continue;
                    }
                    switch (key) {
                        case "mobileEvent":
                            cd.currentPage = Omniture.constants["MobilePrefix"] + ":" + s.prop30.replace("wap:", "") + ":" + SiteCatProperties[key];
                            break;
                        case "mblprop53":
                            s.prop53 = Omniture.constants["MobilePrefix"] + ":" + s.prop30.replace("wap:", "") + ":" + SiteCatProperties[key];
                            break;
                        case "eventname":
                            cd.currentPage = Omniture.constants["OmniSitePrefix"] + ":" + cd.siteSection + ":" + SiteCatProperties[key];
                            break;
                        case "loginMethod":
                            cd.loginMethod = SiteCatProperties[key];
                            break;
                        case "challengeStatus":
                            cd.challengeStatus = SiteCatProperties[key];
                            break;
                        case "errorStatus":
                            cd.errorStatus = SiteCatProperties[key];
                            break;
                        case "prop53":
                            s.prop53 = Omniture.constants["OmniSitePrefix"] + ":" + cd.siteSection + ":" + SiteCatProperties[key];
                            break;
                        case "prop67":
                            s.prop67 = SiteCatProperties[key];
                            break;
                        case "eVar67":
                            s.eVar67 = SiteCatProperties[key];
                            break;
                    }
                }

                if (dynamicVars != null) {
                    for (var key in dynamicVars) {
                        if (!dynamicVars.hasOwnProperty(key)) {
                            //The current property is not a direct property of DynamicVars
                            continue;
                        }
                        switch (key) {
                            case "challengePolicy":
                                cd.challengePolicy = dynamicVars[key];
                                break;

                            case "responseStatusCode":
                                if (cd.currentPage && dynamicVars[key]) {
                                    cd.currentPage = cd.currentPage + ' response status ' + dynamicVars[key];
                                }
                                break;

                            case "requestName":
                                if (cd.currentPage && dynamicVars[key]) {
                                    cd.currentPage = cd.currentPage + ' for req ' + dynamicVars[key];
                                }
                                break;
                        }
                    }
                }
            };
            var onTrackSATransmitLogin = function (pageName, eventName, dynamicVars, isWidget) {
                if (Omniture.constants[pageName] && Omniture.constants[pageName][eventName]) {
                    s.clearContext();
                    s.clearVars();

                    var SiteCatProperties;

                    cd.siteSection = Omniture.constants[pageName]["siteSection"];
                    cd.subSiteSection = Omniture.constants[pageName]["subSiteSection"];
                    if (isWidget) {
                        SiteCatProperties = Omniture.constants[pageName][eventName];
                    }
                    else
                        SiteCatProperties = Omniture.constants[pageName]["Standalone" + eventName];
                    SiteCatSwitchCode(pageName, eventName, dynamicVars, SiteCatProperties);

                    s.t();
                }
                else {
                    /// DE: BB-57-Remove console.log
                }
            };
            var onTrackSATransmitLoginClickEvent = function (pageName, eventName, isWidget) {
                if (Omniture.constants[pageName] && Omniture.constants[pageName][eventName]) {
                    s.clearVars();

                    var SiteCatProperties;
                    if (isWidget) {
                        s.linkTrackVars = s.linkTrackVars + ',prop53,contextData.cd.loginMethod,prop67,eVar67';
                        SiteCatProperties = Omniture.constants[pageName][eventName];
                    }
                    else {
                        s.linkTrackVars = s.linkTrackVars + ',prop53,contextData.cd.loginMethod';
                        SiteCatProperties = Omniture.constants[pageName]["Standalone" + eventName];
                    }
                    SiteCatSwitchCode(pageName, eventName, null, SiteCatProperties);

                    s.tl(this, 'o', s.prop53, null, 'navigate');
                }
                else {
                    /// DE: BB-57-Remove console.log
                }
            };
            var onTrackSATransmitMobileLogin = function (pageName, eventName, dynamicVars) {
                if (Omniture.constants[pageName] && Omniture.constants[pageName][eventName]) {
                    s.clearContext();
                    s.clearVars();
                    //if (s.contextData['appName_PERS'] == "MBL") {
                    commonTracking();
                    //}

                    var SiteCatProperties = Omniture.constants[pageName][eventName];
                    SiteCatSwitchCode(pageName, eventName, dynamicVars, SiteCatProperties);

                    s.t();
                }
                else {
                    /// DE: BB-57-Remove console.log
                }
            };
            var onTrackSATransmitMobileLoginClickEvent = function (pageName, eventName) {
                if (Omniture.constants[pageName] && Omniture.constants[pageName][eventName]) {
                    s.clearVars();
                    //if (s.contextData['appName_PERS'] == "MBL") {
                    commonTracking();
                    //}

                    var SiteCatProperties = Omniture.constants[pageName][eventName];
                    s.linkTrackVars = s.linkTrackVars + ',prop53,contextData.cd.loginMethod';
                    SiteCatSwitchCode(pageName, eventName, null, SiteCatProperties);

                    s.tl(this, 'o', s.prop53, null, 'navigate');
                }
                else {
                    /// DE: BB-57-Remove console.log
                }
            };
            return {
                onTrackCustomSharedStepUp: onTrackCustomSharedStepUp,
                onTrackSharedStepUpClickEvent: onTrackSharedStepUpClickEvent,
                onTrackSATransmitLogin: onTrackSATransmitLogin,
                onTrackSATransmitLoginClickEvent: onTrackSATransmitLoginClickEvent,
                onTrackSATransmitMobileLogin: onTrackSATransmitMobileLogin,
                onTrackSATransmitMobileLoginClickEvent: onTrackSATransmitMobileLoginClickEvent
            }
        }]).factory('MMScrollService', [MMScrollService]); //fix for 20941
    function MMScrollService() {
        //return {
        var MMScrollService = {};

        // This is used to manage special adjustment during orientation
        // change.
        MMScrollService.specialAdjustment = 0;


        function _createScroll(wrapperDiv, scrollerDiv, scrollKey,
                        specialAdjustment, isScrollStay, scrollvalue) {
            
            if (wrapperDiv.length == 1) {

                
                var windowHeight = 0;

                // The way content ID is taken varies from type of
                // screens.
                // Content ID is used to check whether there is a footer
                // button inside or not, to manipulate scroll height.
                var contentID = null;

                if (scrollKey == "inspectorScroll") {

                    if ($(wrapperDiv)[0].id
                            .indexOf("-usboverlaywrapper") > -1) {

                        contentID = $("#"
                                + $(wrapperDiv)[0].id.replace(
                                        "-usboverlaywrapper", ""))[0];

                        // This is an Overlay Inspector
                        windowHeight = $(
                                "#"
                                        + $(wrapperDiv)[0].id.replace(
                                                "-usboverlaywrapper",
                                                "")).outerHeight();

                    } else {
                        /*
                        * This is introduced to manage situations,
                        * where the wrapper is known and content is
                        * added run time. In such cases it is not
                        * possible to get the wrapper height. USed only
                        * for calendar in inspector - can be used for
                        * other cases also, after doing sufficient
                        * testing -- arun
                        */

                        contentID = $("#" + window.currentInspector)
                                .find('[data-id="page_content"]')[0];

                        windowHeight = $("#" + window.currentInspector)
                                .outerHeight();
                        var customScrollHeight = $(wrapperDiv).data(
                                "heightabovescroller");

                        if (customScrollHeight != null
                                || customScrollHeight != undefined) {
                            windowHeight = windowHeight
                                    - customScrollHeight;
                        }
                        // This is a page Inspector
                    }
                } else {

                    /*
                    * This is introduced to manage situations, where
                    * the wrapper is known and content is added run
                    * time. In such cases it is not possible to get the
                    * wrapper height. USed only for calendar in
                    * inspector - can be used for other cases also,
                    * after doing sufficient testing -- arun
                    */
                    var customScrollHeight = $(wrapperDiv).data(
                            "heightabovescroller");
                    windowHeight = $(window).outerHeight();

                    // TOUCH - for Android web, only window height needs to be considered,
                    // TOUCH - using screen height is not letting the content to scroll
                    if (ApplicationContext.getContext().getChannel() === ApplicationContext
                        .getContext().ANDROID && !ApplicationContext.getContext().ISMOBILEWEB) {
                        moreThanWH = windowHeight * 1.5;
                        // because sometimes screen height is too much
                        // than actual window height. typically happens
                        // in jellybean devices
                        if (moreThanWH > screen.height) {
                            windowHeight = screen.height;
                        }
                        if (scrollKey == "overlayScroll") {
                            // this is to accomodate the padding in the
                            // top for overlays
                            windowHeight -= 35;
                        }
                    }

                    if (customScrollHeight != null
                            || customScrollHeight != undefined) {

                        // Below logic would discount the height
                        // considering its calculated.
                        windowHeight = windowHeight
                                - customScrollHeight;
                    }
                }
                var contentHeight = scrollerDiv[0].scrollHeight;


                if (scrollKey == "overlayScroll") {

                    contentID = $("#"
                            + $(wrapperDiv)[0].id.replace(
                                    "-usboverlaywrapper", ""))[0];

                    // Typically a full screen overlay
                    contentHeight += 60;

                    if (ApplicationContext.getContext().getChannel() === ApplicationContext
                        .getContext().IPAD && !ApplicationContext.getContext().ISMOBILEWEB) {
                        // FIXME ARUN -- not sure whether this is needed
                        // only for ipad Need to test and fix, once
                        // iPhone testing starts

                        var calculatedHeight = Math
                                .round(windowHeight * .27);
                        contentHeight += Math
                                .round(calculatedHeight / 2);
                        windowHeight -= calculatedHeight;
                    }
                } else if (scrollKey == "myScroll") {
                    /*to handle the scroll height for devices with notification bar.*/
                    if (ApplicationContext.getContext().getChannel() === ApplicationContext.getContext().ANDROID ||
                        ApplicationContext.getContext().getChannel() === ApplicationContext.getContext().IPAD) {
                        specialAdjustment = 40;
                    }
                    else if (ApplicationContext.getContext().getChannel() === ApplicationContext.getContext().IPHONE) {
                        specialAdjustment = 30;
                    }
                    /*to handle the scroll height for devices with notification bar.*/
                    contentID = $("#" + window.currentPageID).find(
                            '[data-id="page_content"]')[0];
                }

                // Height of headers needs to be accomodated for page
                // scrolling

                if (scrollKey == "inspectorScroll") {// if inspector
                    // Scroll
                    if ($(window.currentInspector).find(
                            ".header-layout").length == 1) {
                        // Page inspector and has header
                        contentHeight += 50;
                        windowHeight -= 40;
                    } else {
                        // Overlay inspector and has header
                        // Inconsistency in using headers in overlay
                        // inspectors
                        windowHeight -= 40;
                        contentHeight += 45;
                    }

                } else {
                    contentHeight += 50;
                    windowHeight -= 40;
                }

                
                if ($(contentID).find(".footer-buttons").length == 1) {
                    // If there is a footer, add the height to it.
                    // header is always present
                    // header = 66px; footer=60px;
                    console
                            .log("Now there is a footer in this content, adding buffer");
                    contentHeight += 50;

                    // The scroll happens within the frame where footer
                    // is not a part of it
                    windowHeight -= 80;
                }

                if (specialAdjustment != null) {
                    // There are situations like myaccounts, payments
                    // history where there are animations possible. in
                    // such cases this special extention of container
                    // height is required
                    contentHeight += specialAdjustment;

                    MMScrollService.specialAdjustment = specialAdjustment;
                } else {
                    MMScrollService.specialAdjustment = 0;
                }

                if (scrollKey.indexOf("customScroll") > -1) {// FIXME
                    // IPAD
                    // HAS
                    // ASSIGNED THE
                    // WRAPPER HEIGHT TO
                    // ITS PARENT HEIGHT
                    // IN CASE OF CUSTOM
                    // SCROLL SCENARIO.
                    if (ApplicationContext.getContext().getChannel() === ApplicationContext
                            .getContext().IPAD) {
                        windowHeight = $(wrapperDiv).parent()
                                .outerHeight();
                        contentHeight = $(scrollerDiv).css('height',
                                'auto').outerHeight();
                    }
                }
                

                wrapperDiv.height(windowHeight);
                scrollerDiv.height(contentHeight);
                

                if (window[scrollKey]) {
                    setTimeout(function () {
                        // Add and remove a dumb style to take
                        // care of occasional patches
                        // on gradient background.
                        $('<style></style>').appendTo($(document.body))
                                .remove();
                        if (window[scrollKey] != null) {
                            window[scrollKey].refresh();

                            // checking if the page scroll to top
                            if (!isScrollStay) {
                                window[scrollKey].scrollTo(0, 0, 100);
                            } else if (scrollvalue) {
                                window[scrollKey].scrollTo(0, scrollvalue, 100);
                            }
                        }
                    }, 250);

                } else {
                    window[scrollKey] = new IScroll('#'
                            + wrapperDiv.prop("id"), {
                                bounce: false,
                                preventDefault: false,
                                onBeforeScrollStart: function (e) {
                                    var target = e.target;
                                    while (target.nodeType != 1)
                                        target = target.parentNode;
                                    if (target.tagName != 'SELECT'
											&& target.tagName != 'INPUT'
											&& target.tagName != 'TEXTAREA')
                                        e.preventDefault();
                                }
                            });
                    setTimeout(function () {
                        if (window[scrollKey]) {
                            // Add and remove a dumb style to take
                            // care of occasional patches on
                            // gradient background.
                            $('<style></style>').appendTo(
                                    $(document.body)).remove();
                            window[scrollKey].refresh();
                            // checking if the page scroll to top
                            if (!isScrollStay) {
                                window[scrollKey].scrollTo(0, 0, 100);
                            }
                            else if (scrollvalue) {
                                window[scrollKey].scrollTo(0, scrollvalue, 100);
                            }
                        }
                    }, 250);
                }
            } else {
                if ($('#wrapper').length == 1) {
                    new IScroll('#wrapper');
                }
            }
        }




        function _createScrollOmni(wrapperDiv, scrollerDiv, scrollKey,
                specialAdjustment, dynamicContainerHeight, isScrollStay, scrollvalue) {
            
            if (wrapperDiv.length == 1) {



                var windowHeight = 0;

                // The way content ID is taken varies from type of
                // screens.
                // Content ID is used to check whether there is a footer
                // button inside or not, to manipulate scroll height.
                var contentID = null;

                if (scrollKey == "inspectorScroll") {

                    if ($(wrapperDiv)[0].id
                            .indexOf("-usboverlaywrapper") > -1) {

                        contentID = $("#"
                                + $(wrapperDiv)[0].id.replace(
                                        "-usboverlaywrapper", ""))[0];

                        // This is an Overlay Inspector
                        windowHeight = $(
                                "#"
                                        + $(wrapperDiv)[0].id.replace(
                                                "-usboverlaywrapper",
                                                "")).outerHeight();

                    } else {
                        /*
                        * This is introduced to manage situations,
                        * where the wrapper is known and content is
                        * added run time. In such cases it is not
                        * possible to get the wrapper height. USed only
                        * for calendar in inspector - can be used for
                        * other cases also, after doing sufficient
                        * testing -- arun
                        */

                        contentID = $("#" + window.currentInspector)
                                .find('[data-id="page_content"]')[0];

                        windowHeight = $("#" + window.currentInspector)
                                .outerHeight();
                        var customScrollHeight = $(wrapperDiv).data(
                                "heightabovescroller");

                        if (customScrollHeight != null
                                || customScrollHeight != undefined) {
                            windowHeight = windowHeight
                                    - customScrollHeight;
                        }
                        // This is a page Inspector
                    }
                } else {

                    /*
                    * This is introduced to manage situations, where
                    * the wrapper is known and content is added run
                    * time. In such cases it is not possible to get the
                    * wrapper height. USed only for calendar in
                    * inspector - can be used for other cases also,
                    * after doing sufficient testing -- arun
                    */
                    var customScrollHeight = $(wrapperDiv).data(
                            "heightabovescroller");
                    windowHeight = $(window).outerHeight();

                    // TOUCH - for Android web, only window height needs to be considered,
                    // TOUCH - using screen height is not letting the content to scroll
                    if (ApplicationContext.getContext().getChannel() === ApplicationContext
                        .getContext().ANDROID && !ApplicationContext.getContext().ISMOBILEWEB) {
                        moreThanWH = windowHeight * 1.5;
                        // because sometimes screen height is too much
                        // than actual window height. typically happens
                        // in jellybean devices
                        if (moreThanWH > screen.height) {
                            windowHeight = screen.height;
                        }
                        if (scrollKey == "overlayScroll") {
                            // this is to accomodate the padding in the
                            // top for overlays
                            windowHeight -= 35;
                        }
                    }

                    if (customScrollHeight != null
                            || customScrollHeight != undefined) {

                        // Below logic would discount the height
                        // considering its calculated.
                        windowHeight = windowHeight
                                - customScrollHeight;
                    }
                }

                var contentHeight = scrollerDiv[0].scrollHeight;

                if (scrollKey === "manageDelegatemyscroll" || scrollKey === "myScrollAddUser" || scrollKey === "myScrollAccountDetail") {
                    //Temp fix
                    //contentHeight += 128;
                    windowHeight = windowHeight - $(wrapperDiv).offset().top;
                    if (dynamicContainerHeight != null
                                || dynamicContainerHeight != undefined) {
                        contentHeight = dynamicContainerHeight;
                    }
                    /*if ($(wrapperDiv).parents('[data-role=main]').first().find('.footer-buttons').length) {
                    wrap_height = wrap_height - $(wrapperDiv).parents('[data-role=main]').first().find('.footer-buttons').outerHeight();
                    }*/
                } else if (dynamicContainerHeight != null
                            || dynamicContainerHeight != undefined) {
                    contentHeight = dynamicContainerHeight;
                }



                if (scrollKey == "overlayScroll") {

                    contentID = $("#"
                            + $(wrapperDiv)[0].id.replace(
                                    "-usboverlaywrapper", ""))[0];

                    // Typically a full screen overlay
                    contentHeight += 60;

                    if (ApplicationContext.getContext().getChannel() === ApplicationContext
                        .getContext().IPAD && !ApplicationContext.getContext().ISMOBILEWEB) {
                        // FIXME ARUN -- not sure whether this is needed
                        // only for ipad Need to test and fix, once
                        // iPhone testing starts

                        var calculatedHeight = Math
                                .round(windowHeight * .27);
                        contentHeight += Math
                                .round(calculatedHeight / 2);
                        windowHeight -= calculatedHeight;
                    }
                } else if (scrollKey == "myScroll") {
                    /*to handle the scroll height for devices with notification bar.*/
                    if (ApplicationContext.getContext().getChannel() === ApplicationContext.getContext().ANDROID ||
                        ApplicationContext.getContext().getChannel() === ApplicationContext.getContext().IPAD) {
                        specialAdjustment = 40;
                    }
                    else if (ApplicationContext.getContext().getChannel() === ApplicationContext.getContext().IPHONE) {
                        specialAdjustment = 30;
                    }
                    /*to handle the scroll height for devices with notification bar.*/
                    contentID = $("#" + window.currentPageID).find(
                            '[data-id="page_content"]')[0];
                }

                // Height of headers needs to be accomodated for page
                // scrolling

                if (scrollKey == "inspectorScroll") {// if inspector
                    // Scroll
                    if ($(window.currentInspector).find(
                            ".header-layout").length == 1) {
                        // Page inspector and has header
                        contentHeight += 50;
                        windowHeight -= 40;
                    } else {
                        // Overlay inspector and has header
                        // Inconsistency in using headers in overlay
                        // inspectors
                        windowHeight -= 40;
                        contentHeight += 45;
                    }

                } else {
                    contentHeight += 50;
                    windowHeight -= 40;
                }


                if ($(contentID).find(".footer-buttons").length == 1) {
                    // If there is a footer, add the height to it.
                    // header is always present
                    // header = 66px; footer=60px;
                    console
                            .log("Now there is a footer in this content, adding buffer");
                    contentHeight += 50;

                    // The scroll happens within the frame where footer
                    // is not a part of it
                    windowHeight -= 80;
                }

                if (specialAdjustment != null) {
                    // There are situations like myaccounts, payments
                    // history where there are animations possible. in
                    // such cases this special extention of container
                    // height is required
                    contentHeight += specialAdjustment;

                    MMScrollService.specialAdjustment = specialAdjustment;
                } else {
                    MMScrollService.specialAdjustment = 0;
                }

                if (scrollKey.indexOf("customScroll") > -1) {// FIXME
                    // IPAD
                    // HAS
                    // ASSIGNED THE
                    // WRAPPER HEIGHT TO
                    // ITS PARENT HEIGHT
                    // IN CASE OF CUSTOM
                    // SCROLL SCENARIO.
                    if (ApplicationContext.getContext().getChannel() === ApplicationContext
                            .getContext().IPAD) {
                        windowHeight = $(wrapperDiv).parent()
                                .outerHeight();
                        contentHeight = $(scrollerDiv).css('height',
                                'auto').outerHeight();
                    }
                }


                wrapperDiv.height(windowHeight);
                scrollerDiv.height(contentHeight);

                if (window[scrollKey]) {
                    setTimeout(function () {
                        // Add and remove a dumb style to take
                        // care of occasional patches
                        // on gradient background.
                        $('<style></style>').appendTo($(document.body))
                                .remove();
                        window[scrollKey].refresh();
                        // checking if the page scroll to top
                        if (!isScrollStay) {
                            window[scrollKey].scrollTo(0, 0, 100);
                        }
                        else if (scrollvalue) {
                            window[scrollKey].scrollTo(0, scrollvalue, 100);
                        }
                    }, 250);

                } else {
                    // Added this condition to check for entitlement enroll t&c div
                    // ADA - when voiceover is ON in IOS, iscroll was not compatible so added css style of scrolling
                    var channel = OmniDataUtil.getOmniData("mobileChannel");
                    if ((channel == "iPhone" || channel == "ipad") && scrollKey == "ent_tc_enroll") {
                        $(wrapperDiv).css({
                            "-webkit-overflow-scrolling": "touch",
                            "overflow-y": "scroll"
                        });

                    } else {
                        
                        window[scrollKey] = new IScroll('#'
                                                        + wrapperDiv.prop("id"), {
                                                            bounce: false,
                                                            preventDefault: false,
                                                            onBeforeScrollStart: function (e) {
                                                                var target = e.target;
                                                                while (target.nodeType != 1)
                                                                    target = target.parentNode;
                                                                if (target.tagName != 'SELECT'
                                                                    && target.tagName != 'INPUT'
                                                                    && target.tagName != 'TEXTAREA')
                                                                    e.preventDefault();
                                                            }
                                                        });
                        setTimeout(function () {
                            if (window[scrollKey]) {
                                // Add and remove a dumb style to take
                                // care of occasional patches on
                                // gradient background.
                                $('<style></style>').appendTo(
                                                              $(document.body)).remove();
                                window[scrollKey].refresh();
                                // checking if the page scroll to top
                                if (!isScrollStay) {
                                    window[scrollKey].scrollTo(0, 0, 100);
                                }
                                else if (scrollvalue) {
                                    window[scrollKey].scrollTo(0, scrollvalue, 100);
                                }
                            }
                        }, 250);
                    }
                }
            } else {
                if ($('#wrapper').length == 1) {
                    new IScroll('#wrapper');
                }
            }
        }

        // Exposed Interfaces goes below. All calls the private method
        // above.

        MMScrollService.reInitPageWhenKeyboardComesUp = function () {

            window.orgPageWrapperHeight = $("#usbwrapper").height();
            window.orgPageScrollerHeight = $("#usbscroller").height();

            if ($("#" + window.currentPageID).hasClass('overlayInAction')) {
                return;
            }

            var customScrollHeight = $("#usbwrapper").data(
                    "heightabovescroller");

            if (customScrollHeight == null
                    || customScrollHeight == undefined) {
                customScrollHeight = 0;
            } else {
                customScrollHeight = customScrollHeight - 70;
            }
            var roundedHeight = $(window).innerHeight() - 70
                    - customScrollHeight;
            $("#usbwrapper").height(roundedHeight);
            $("#usbscroller").height(
                    window.orgPageScrollerHeight + roundedHeight - 50);

            if (window.focussedItem != undefined
                    || window.focussedItem != null) {
                var offset = window.focussedItem.offset().top;
                var scrollto = -(offset - window['myScroll'].y - 100);

                window['myScroll'].scrollTo(0, scrollto, 100)
                window.focussedItem = undefined;
            }
            window['myScroll'].refresh();
        };

        MMScrollService.reInitPageWhenKeyboardGoesDown = function () {

            $("#usbwrapper").height(window.orgPageWrapperHeight);
            $("#usbscroller").height(window.orgPageScrollerHeight);

            window['myScroll'].refresh();
        };

        MMScrollService.reInitOverlayWhenKeyboardComesUp = function (
                overlayDivId) {


            window.orgOverlayWrapperHeight = $(
                    "#" + overlayDivId + "-usboverlaywrapper").height();
            window.orgOverlayScrollerHeight = $(
                    "#" + overlayDivId + "-usboverlayscrollee")
                    .height();

            var customScrollHeight = $("#" + overlayDivId + "-usboverlaywrapper").data(
                    "heightabovescroller");

            if (customScrollHeight == null
                    || customScrollHeight == undefined) {
                customScrollHeight = 0;
            } else {
                customScrollHeight = customScrollHeight - 70;
            }

            var roundedHeight;
            if (ApplicationContext.getContext().ISMOBILEWEB) {/*added for stepupcheck keyboard scroll issue*/
                window.myScroll.disable();
                roundedHeight = $(window).innerHeight();
            }
            else {
                roundedHeight = $(window).innerHeight() - 70 - customScrollHeight;
            }

            $("#" + overlayDivId + "-usboverlaywrapper").height(
                    roundedHeight);
            $("#" + overlayDivId + "-usboverlayscrollee").height(
                    window.orgOverlayScrollerHeight + roundedHeight - 50);

            if (window.focussedItem != undefined
                    || window.focussedItem != null) {
                var hght = 100;

                //IF the overlay has already a header, then the calculation is different
                //especially for Android.
                var contentID = $("#"
                        + $('#' + overlayDivId)[0].id.replace(
                                "-usboverlaywrapper", ""))[0];

                if ($(contentID).find(".overlay-header").length == 1) {
                    hght = 200;
                }
                var offset = window.focussedItem.offset().top;
                var scrollto = -(offset - window['overlayScroll'].y - hght);

                window['overlayScroll'].scrollTo(0, scrollto, 100)
                window.focussedItem = undefined;
            }
            window['overlayScroll'].refresh();
            window.overlayScroll.enable(); /*added for stepupcheck keyboard scroll issue*/
        };

        MMScrollService.reInitOverlayWhenKeyboardGoesDown = function (
                overlayDivId) {

            $("#" + overlayDivId + "-usboverlaywrapper").height(
                    window.orgOverlayWrapperHeight);
            $("#" + overlayDivId + "-usboverlayscrollee").height(
                    window.orgOverlayScrollerHeight);

            window['overlayScroll'].refresh();

        };
        MMScrollService.disableScrolls = function () {

            var scrollKey = ['myScroll', 'overlayScroll',
                    'allBlockScroll', 'payPersonBlockScroll',
                    'payBillsScroll', 'transferBlockScroll',
                    'allBlockHistoryScroll', 'depositHistoryScroll',
                    'pendingHistoryScroll', 'rejectedHistoryScroll'];
            for (var key in scrollKey) {
                if (window[scrollKey[key]]) {
                    window[scrollKey[key]].disable();
                }
            }
        };

        MMScrollService.enableScrolls = function () {
            var scrollKey = ['myScroll', 'overlayScroll',
                    'allBlockScroll', 'payPersonBlockScroll',
                    'payBillsScroll', 'transferBlockScroll',
                    'allBlockHistoryScroll', 'depositHistoryScroll',
                    'pendingHistoryScroll', 'rejectedHistoryScroll'];
            for (var key in scrollKey) {
                if (window[scrollKey[key]]) {
                    window[scrollKey[key]].enable();
                }
            }
        };

        MMScrollService.destroyScroll = function () {
            MMScrollService.destroyParamterizedScroll('myScroll');
            MMScrollService.destroyParamterizedScroll('overlayScroll');
        };

        MMScrollService.destroyParamterizedScroll = function (scrollKey) {

            if (window[scrollKey]) {
                $(window[scrollKey].scroller).removeAttr('style');
                $(window[scrollKey].wrapper).removeAttr('style');
                window[scrollKey].destroy();
                window[scrollKey] = null;
            }
        };

        MMScrollService.scrollMyAccounts = function (wrapperDiv, scrollerDiv,
                scrollKey, specialAdjustment) {
            _createScroll(wrapperDiv, scrollerDiv, scrollKey,
                    specialAdjustment, false);
        };

        MMScrollService.updatePageWithScrollOmni = function (scrollObj, wrapperDiv, scrollerDiv, dynamicContainerHeight, adjustedHeight) {
            _createScrollOmni($(wrapperDiv), $(scrollerDiv),
                    scrollObj, adjustedHeight, dynamicContainerHeight, false);
        };

        MMScrollService.updatePageWithScroll = function (adjustedHeight) {
            _createScroll($("#usbwrapper"), $("#usbscroller"),
                    "myScroll", adjustedHeight, false);
        };

        // USe this function, when you want to entirely re-init a page
        // with scroll to avoid adding the older height to the new one
        MMScrollService.reinitializePageWithScroll = function (adjustedHeight) {
            MMScrollService.destroyParamterizedScroll('myScroll');
            setTimeout(function () {
                _createScroll($("#usbwrapper"), $("#usbscroller"),
                        "myScroll", adjustedHeight, false);
            }, 200);
        };

        MMScrollService.reinitializePageWithScrollOmni = function (adjustedHeight) {
            MMScrollService.destroyParamterizedScroll("myScrollOmni");
            setTimeout(function () {
                _createScroll($("#usbwrapperOmni"), $("#usbscrollerOmni"),
                        "myScrollOmni", 100, false);
            }, 200);
        };

        MMScrollService.updatePageWithScrollAndStay = function (isScrollStay) {
            _createScroll($("#usbwrapper"), $("#usbscroller"),
                    "myScroll", null, isScrollStay);
        };

        MMScrollService.updatePageWithScrollWithKeyboard = function () {
            MMScrollService.destroyParamterizedScroll('myScroll');
            setTimeout(function () {
                _createScroll($("#usbwrapper"), $("#usbscroller"),
                "myScroll", $(window).outerHeight(), true);
            }, 200);
        };

        MMScrollService.updateOverlayWithScroll = function (overlayDivId,
                adjustedHeight) {
            _createScroll($("#" + overlayDivId + "-usboverlaywrapper"),
                    $("#" + overlayDivId + "-usboverlayscrollee"),
                    "overlayScroll", adjustedHeight, false);
        };

        // USe this function, when you want to entirely re-init a page
        // with scroll to avoid adding the older height to the new one
        MMScrollService.reinitializeOverlayWithScroll = function (
                overlayDivId, adjustedHeight) {
            MMScrollService.destroyParamterizedScroll('overlayScroll');
            setTimeout(function () {
                _createScroll($("#" + overlayDivId
                        + "-usboverlaywrapper"), $("#" + overlayDivId
                        + "-usboverlayscrollee"), "overlayScroll",
                        adjustedHeight, false);
            }, 200);
        };

        MMScrollService.updateOverlayWithScrollWithKeyboard = function (overlayDivId, adjustedHeight) {
            MMScrollService.destroyParamterizedScroll('overlayScroll');
            setTimeout(function () {
                _createScroll($("#" + overlayDivId
                + "-usboverlaywrapper"), $("#" + overlayDivId
                + "-usboverlayscrollee"), "overlayScroll", $(window).outerHeight(), false);
            }, 200);
        };

        MMScrollService.updateContentWithScrollAndAdjustedHeight = function (
            scroller, scrollee, scrollName, adjustedHeight) {
            _createScroll($("#" + scroller), $("#" + scrollee),
                    scrollName, adjustedHeight, false);
        };

        MMScrollService.updatePageWithScrollAndStay = function (
                adjustedHeight) {
            _createScroll($("#usbwrapper"), $("#usbscroller"),
                    "myScroll", adjustedHeight, true);
        };

        MMScrollService.updateOverlayWithScrollAndStay = function (
                overlayDivId, adjustedHeight) {
            _createScroll($("#" + overlayDivId + "-usboverlaywrapper"),
                    $("#" + overlayDivId + "-usboverlayscrollee"),
                    "overlayScroll", adjustedHeight, true);
        };

        MMScrollService.updateInspectorWithScroll = function (overlayDivId,
                adjustedHeight) {

            MMScrollService.disableScrolls();

            if ($("#" + overlayDivId + " #usbwrapper").length) {

                $("#" + overlayDivId + " #usbwrapper").attr("id",
                        "usbwrapper-inspector");
                $("#" + overlayDivId + " #usbscroller").attr("id",
                        "usbscroller-inspector");

                _createScroll($("#" + overlayDivId
                        + " #usbwrapper-inspector"), $("#"
                        + overlayDivId + " #usbscroller-inspector"),
                        "inspectorScroll", adjustedHeight, false);
                return;
            }

            if ($("#" + overlayDivId + "-usboverlaywrapper").length) {
                

                _createScroll($("#" + overlayDivId
                        + "-usboverlaywrapper"), $("#" + overlayDivId
                        + "-usboverlayscrollee"), "inspectorScroll",
                        adjustedHeight, false);
                return;
            }

            MMScrollService.updateCalendarCustom(0);
        };

        // USe only for re-initializing scroll, where you need to upate
        // scroll content runtime
        MMScrollService.reinitializeInspectorWithScroll = function () {

            MMScrollService.disableScrolls();

            if ($("#usbwrapper-inspector").length) {
                
                _createScroll($('#usbwrapper-inspector'),
                        $("#usbscroller-inspector"), "inspectorScroll",
                        null, false);
                return;
            }

            if ($("#" + overlayDivId + "-usboverlaywrapper").length) {
                

                _createScroll($("#" + overlayDivId
                        + "-usboverlaywrapper"), $("#" + overlayDivId
                        + "-usboverlayscrollee"), "inspectorScroll",
                        adjustedHeight, false);
                return;
            }
        };
        MMScrollService.createCustomScroll = function (instance) {
            var customscroll = "customScroll";
            MMScrollService.destroyParamterizedScroll(customscroll
                    + instance);
            _createScroll($("#customusbwrapper" + instance),
                    $("#customusbscroller" + instance), "customScroll"
                            + instance, 0, true);

        };
        MMScrollService.updateCustomScroll = function (instance) {
            if ($("#customusbwrapper" + instance).length == 1) {
                $("#customusbscroller" + instance)
                        .css('height', 'auto');
                window["customScroll" + instance].refresh();
            }
        };

        MMScrollService.updateCalendarCustom = function (adjustedHeight) {
            MMScrollService.destroyParamterizedScroll("dateScroll");
            _createScroll($("#datepicker-usbwrapper"),
                    $("#datepicker-usbscroller"), "dateScroll",
                    adjustedHeight, false);
        };

        MMScrollService.reinitializeTimelineScroll = function (wrapperDiv,
                scrollerDiv, scrollKey, adjustedHeight) {// FIXME
            // Android
            // -- to fix
            // infinity
            // scroll in
            // timeline.
            window.timelineWrapper = wrapperDiv;
            window.timelineScroller = scrollerDiv;
            window.timelineScrollkey = scrollKey;
            window.timelineScrollAdjustedHeight = adjustedHeight;
            MMScrollService.destroyParamterizedScroll(scrollKey);
            _createScroll($('#' + wrapperDiv), $('#' + scrollerDiv),
                    scrollKey, adjustedHeight, false);
        };
        MMScrollService.updateTimelineScroll = function (wrapperDiv,
                scrollerDiv, scrollKey, adjustedHeight, scrollvalue) {// FIXME
            // Android
            // -- to fix
            // infinity
            // scroll in
            // timeline.
            window.timelineWrapper = wrapperDiv;
            window.timelineScroller = scrollerDiv;
            window.timelineScrollkey = scrollKey;
            window.timelineScrollAdjustedHeight = adjustedHeight;
            var calculatedWrapperHeight = $(window).height() - $("header").height();
            $("#" + wrapperDiv).height(calculatedWrapperHeight);
            $("#" + scrollerDiv).css("height", "auto");
            if (ApplicationContext.getContext().getChannel() === ApplicationContext
                            .getContext().IPAD) {
                $("#" + scrollerDiv).height($("#" + scrollerDiv).height() + 140);
            }
            else {
                $("#" + scrollerDiv).height($("#" + scrollerDiv).height() + 80);
            }
            if (scrollKey)
                window[scrollKey].refresh();
        };
        MMScrollService.updatePageScroll = function () {//224884 fix
            var calculatedWrapperHeight = $(window).height() - $("header").height();
            $("#usbwrapper").height(calculatedWrapperHeight);
            $("#usbscroller").css("height", "auto");
            if (ApplicationContext.getContext().getChannel() === ApplicationContext
                            .getContext().IPAD) {
                $("#usbscroller").height($("#usbscroller").height() + 140);
            }
            else {
                $("#usbscroller").height($("#usbscroller").height() + 80);
            }
            if (window.myScroll)
                window.myScroll.refresh();
        };

        return MMScrollService;
    }
})();
;
(function () {
    'use strict';

    angular.module("sharedAuthStepUp")
        .directive('sastepup', ['SASiteCatService', 'transmitService', 'LoginAssistantService', 'transmitEventsService', function (SASiteCatService, transmitService, LoginAssistantService, transmitEventsService) {

            var directive =
            {
                restrict: 'A',
                transclude: true,
                replace: false,
                templateUrl: 'StepUpContainerOmni.html',
                scope: {
                    username: '@',
                    transmiturl: '@',
                    idshieldbaseurl: '@',
                    transactionid: '@',
                    transmitappid: '@',
                    transmitpolicy: '@'
                },
                link: link,
                controller: ['$scope', '$state', '$element', '$rootScope', function sharedAuthStepUpCtrl($scope, $state, $element, $rootScope) {

                    function onCancel() {
                        $rootScope.mainClose = true;
                        $scope.showAuthModal = false;
                        $element.html('');

                        if ($scope.$parent.onStepUpClose) {
                            if ($scope.$parent.parentObj) {
                                $scope.$parent.parentObj.IsOTPSuccess = false;
                                if ($rootScope.isUserLocked) {
                                    $scope.$parent.parentObj.IsOTPCanceled = false;
                                }
                                else {
                                    $scope.$parent.parentObj.IsOTPCanceled = true;
                                }
                            }
                            $scope.$parent.onStepUpClose();
                        }
                    }

                    var usernameInLowerCase = $scope.username ? $scope.username.toLowerCase() : $scope.username;
                    var requestParameter = {
                        username: usernameInLowerCase,
                        TransactionID: $scope.transactionid,
                        IDShieldBaseURL: $scope.idshieldbaseurl,
                        ContextData: "",
                        TransmitAppID: $scope.transmitappid ? $scope.transmitappid : 'web'
                    }
                    $scope.transmitOTPParams = requestParameter;
                    $scope.qACxcObj = { isQaSet: false };

                    //$scope.name = 'theNameHasBeenPassed';
                    //check for directive flow
                    $scope.isFromDirective = true;
                    $scope.dlgInstance = null;
                    $scope.cancel = function () {
                        if (transmitService.iAuthenticationErrored()) {
                            onCancel();
                        }

                        $scope.navigatePage("cancelauth", null);
                    };
                    $scope.$on("targetDesc", function (event, response) {
                        if (response) {
                            LoginAssistantService.setDevices(response);
                            $scope.navigatePage("mobApprove", null);
                        }

                    });
                    $scope.$on("mobileApprovesent", function (event, response) {
                        $scope.navigatePage("pendingApproval", null);
                    });

                    transmitService.clearEventHandlers();

                    transmitService.onAuthenticatorCancelled(function () {

                        if ($state.params.transmitParams && $state.params.transmitParams.TransmitAppID !== 'mbl') { //null check added for failure scenario.
                            if ($state.params.transmitParams && $state.params.transmitParams.type == 'otp') {
                                SASiteCatService.onTrackSharedStepUpClickEvent("StepUpAuthentication", "AuthenticationOTPCloseLink");
                            } else {
                                SASiteCatService.onTrackSharedStepUpClickEvent("StepUpAuthentication", "AuthenticationCloseLink");
                            }
                        }

                        if ($rootScope.systemError) {
                            $rootScope.$broadcast('authCancel', null);
                        }

                        if ($state.params.transmitParams && $state.params.transmitParams.hasResumePlaceholder && $state.params.transmitParams.failed) {
                            $state.params.transmitParams.failed({ "error": "cancelled", "code": "105" });
                        }

                        onCancel();
                    });

                    $scope.failed = function (data) { //changes done for defect fix 21649
                        $rootScope.systemError = true;
                        $scope.authOptions = false;
                        $scope.ChildIDShield = false;
                        $scope.ChildOTPInputCodeMNC = false;
                        $scope.ChildMobileApprove = false;
                        $scope.ChildOTPInputCode = false;
                        $scope.ChildOTPSelectTarget = false;
                        $scope.PendingApproval = false;
                        $scope.transmitCallInProgress = false;
                        $scope.CancelAuth = false;

                        var transmitError = data ? data.transmitErrorResponse : {};
                        if (transmitError && transmitError.data && transmitError.data.assertion_error_code && transmitError.data.assertion_error_code == "10" && transmitError.data.assertion_error_message.indexOf("MobileApprove") > 0) {
                            $scope.showAuthModal = true;
                            $scope.authOptions = true;
                            $(".authenticator-body").hide();
                            setInnerHTML("authenticatorheader", "<div class='omni-modal-body'><p class='error' role='alert' aria-live='assertive'>To use these features, you must have Push enabled on your device. You can manage Push Notifications in the Device Manager or in the My Profile section of the app.</p></div>");
                        } else if (transmitError && transmitError.type && transmitError.type == "mobile_approve") {
                            $scope.showAuthModal = true;
                            $scope.authOptions = true;
                            $(".authenticator-body").hide();
                            setInnerHTML("authenticatorheader", "<div class='omni-modal-body'><p class='error' role='alert' aria-live='assertive'>To use these features, you must have Push enabled on your device. You can manage Push Notifications in the Device Manager or in the My Profile section of the app.</p></div>");
                        } else if (transmitError && transmitError.failure_data && transmitError.failure_data.locked == "true") {
                            $scope.showAuthModal = true;
                            $scope.authOptions = true;
                            $(".authenticator-body").hide();
                            setInnerHTML("authenticatorheader", "<div class='omni-modal-body'><p class='error' role='alert' aria-live='assertive'>Hmm. Something you've entered isn't quite right, so we've locked your account to ensure your security. Login Assist can help.</p></div>");
                        } else if (transmitError && transmitError.failure_data && transmitError.failure_data.action == "reject" && transmitError.failure_data.code == 3) {
                            $scope.showAuthModal = true;
                            $scope.authOptions = true;
                            $(".authenticator-body").hide();
                            setInnerHTML("authenticatorheader", "<div class='omni-modal-body'><p class='error' role='alert' aria-live='assertive'>Hmm. Something you've entered isn't quite right, so we've locked your account to ensure your security. Login Assist can help.</p></div>");
                        } else if (transmitError && transmitError.name && transmitError.name == "Cancel") {
                            $scope.showAuthModal = true;
                            $scope.authOptions = true;
                            $(".authenticator-body").hide();
                        } else if ($scope.$parent.OnSharedAuthFailure != undefined) {
                            $scope.showAuthModal = false;
                            $element.html('');
                            $scope.$parent.OnSharedAuthFailure(data);
                        } else {
                            $scope.showAuthModal = true;
                            $scope.authOptions = true;
                            $(".authenticator-body").hide();
                            setInnerHTML("authenticatorheader", "<div class='omni-modal-body'><p class='error' role='alert' aria-live='assertive'>We're sorry. We are having problems on our end. It shouldn't be too long, so please try again shortly.</p></div>");
                        }

                    }

                    $scope.authOptions = false;
                    $scope.ChildIDShield = true;
                    $scope.ChildMobileApprove = false;
                    $scope.ChildOTPInputCode = false;
                    $scope.ChildOTPSelectTarget = false;
                    $scope.PendingApproval = false;
                    $scope.transmitCallInProgress = true;
                    $scope.CancelAuth = false;
                    $scope.SystemError = false;
                    $scope.ChildOTPInputCodeMNC = false;

                    $scope.navigatePage = function (pageName, params) {
                        $scope.authOptions = false;
                        $scope.ChildIDShield = true;
                        $scope.ChildOTPInputCodeMNC = false;
                        $scope.ChildMobileApprove = false;
                        $scope.ChildOTPInputCode = false;
                        $scope.ChildOTPSelectTarget = false;
                        $scope.PendingApproval = false;
                        $scope.transmitCallInProgress = false;
                        $scope.CancelAuth = false;
                        $scope.SystemError = false;
                        //Hide transmit spinner once we got auth options
                        //QC 18455

                        $('.xmuiProgressForm').hide();

                        if (pageName === "authOptions") {
                            $scope.authOptions = true;
                        }
                        if (pageName === "otpTarget") {
                            $scope.ChildOTPSelectTarget = true;
                            $scope.ChildIDShield = false;
                        }
                        if (pageName === "inputOTPCode") {
                            $scope.ChildOTPInputCode = true;
                            $scope.ChildIDShield = false;
                        }
                        if (pageName === "mobApprove") {
                            $scope.ChildMobileApprove = true;
                            $scope.ChildIDShield = false;
                        }
                        if (pageName === "idshield")
                            $scope.ChildIDShield = true;
                        if (pageName === "pendingApproval") {
                            $scope.PendingApproval = true;
                            $scope.ChildIDShield = false;
                        }
                        if (pageName === "cancelauth") {
                            $scope.CancelAuth = true;
                            $scope.ChildIDShield = false;
                            transmitEventsService.cancelAuthenticator();
                            //LoginAssistantService.setCancelMobileApprove(true);
                            $rootScope.$broadcast("commonCancelButton", null);

                        }
                        if (pageName === "inputOTPCodeMNC") {
                            $scope.ChildOTPInputCodeMNC = true;
                            $('.sharedauth-omni').css({ 'height': '100%' });
                            $('.authenticator-header-buttons').css("display", "none");
                        }
                        if (pageName === "cancelauth" || pageName === "authOptions") {
                            $('.close').hide();
                            $scope.ChildIDShield = false;
                        } else {
                            $('.close').show();
                        }

                        // angular.extend($state.params.transmitParams, params)
                        $state.params.transmitParams = params;
                        setTimeout(function () {
                            $scope.$apply();
                        }, 10);
                    }

                    // $scope.$on('transmitTokenRecieved', function (event, data) {
                    //close modal
                    // $scope.$parent.getStepUpQuesSuccessHandler(data);
                    //  $scope.showAuthModal = false;
                    //  });
                    $scope.dirSuccessHandler = function (response) {
                        if (!$scope.ChildOTPInputCodeMNC) {
                            $scope.showAuthModal = false;
                            $element.html('');
                        }
                        if ($scope.$parent.isQaObj && response.isQa)
                            $scope.$parent.isQaObj.isFromQa = true;
                        $scope.$parent.OnSharedAuthSuccess(response);
                        if ($scope.ChildOTPInputCodeMNC) {
                            $scope.showAuthModal = false;
                            $element.html('');
                        }
                    }
                    // Service example. Using commonservice's openModalService
                    $scope.showServiceModal = function () {
                        var usernameInLowerCase = $scope.username ? $scope.username.toLowerCase() : $scope.username;
                        /*transmitService.showOptions(
                            null,//modal instance
                            null,//pathToDirect
                            usernameInLowerCase,
                            $scope.dirSuccessHandler,
                            $scope.failed,
                            $scope.transmitappid,
                            $scope.transmitpolicy,
                            $scope.transmiturl,
                            requestParameter,
                            $scope,
                            ($scope != null && $scope.$parent != null && $scope.$parent.additionalTransmitParams != null) ? $scope.$parent.additionalTransmitParams : null,
                            SASiteCatService,
                            $rootScope
                        );*/
                    }

                    function setInnerHTML(domElementID, message) {
                        if (!domElementID) return;

                        var domElement = document.getElementById(domElementID);
                        if (domElement) domElement.innerHTML = message;
                    }

                    //function to cancel the change auth model
                    $scope.$on('authCancel', function (event, data) {
                        $scope.ChildIDShield = false;
                        $scope.CancelAuth = false;
                        angular.element(document.querySelector("#sharedAuthStepUpId")).empty();
                    });

                    $scope.$on('authRetry', function (event, data) {
                        $scope.CancelAuth = false;
                        $scope.ChildIDShield = true;
                    });

                    $rootScope.$on('goToQuestions', function (event, data) {
                        LoginAssistantService.setCancelMobileApprove(false);
                        $scope.$apply(function () {
                            $scope.CancelAuth = false;
                            $scope.ChildIDShield = true;
                            $scope.ChildMobileApprove = false;
                            $scope.PendingApproval = false;
                            $('#goback').show();
                        });
                    });

                    $rootScope.$on('goToMobileApprove', function (event, data) {
                        LoginAssistantService.setCancelMobileApprove(false);
                        $scope.$apply(function () {
                            $scope.CancelAuth = false;
                            $scope.ChildIDShield = false;
                            $scope.ChildMobileApprove = true;
                            $scope.PendingApproval = false;
                            $('#goback').show();
                        });
                    });

                    $rootScope.$on('goToPendingApproval', function (event, data) {
                        $scope.$apply(function () {
                            $scope.CancelAuth = false;
                            $scope.ChildIDShield = false;
                            $scope.ChildMobileApprove = false;
                            $scope.PendingApproval = true;
                            $('#goback').show();
                        });
                    });

                }]
            };

            return directive;

            function link(scope, element, attrs) {
                scope.showServiceModal();
                scope.showAuthModal = true;
            }
        }]);
})();;
(function (app) {
    try { app = angular.module('sharedAuthOmniTemplateModule'); }
    catch (err) { app = angular.module('sharedAuthOmniTemplateModule', []); }
    app.run(['$templateCache', function ($templateCache) {
        'use strict';

        $templateCache.put('StepUpContainerOmni.html',
            // Container Only
            '<div style="z-index: 100000;position:fixed;top:0;bottom:0;left:0;right:0; display: block;" class="modal fade ng-isolate-scope in" tabindex="-1">' +
            '<div class="sr-only" id="stepupLiveAnnouncement" aria-live="assertive"></div>' +

            '<div class="sharedauth-omni modal-dialog modal-dialog-thirdpartyOTP" role="modal">' +
            '<div class="modal-content modal-content-thirdpartyOTP" style="top: 0; z-index: 1000; height: 100% !important; " ng-class="{\'modalAuto\': !ChildOTPInputCodeMNC, \'modalHidden\': ChildOTPInputCodeMNC}">' +
            '<div class="contain-stepup sharedauth" id="sharedAuthstepUpContainer" ng-if="showAuthModal" aria-labelledby="authenticatorheader" tabindex="-1">' +
            '<div class="authenticator-header-buttons">' +
            '<button type="button" class="close" aria-label="close" data-dismiss="modal" id="goback" ng-click="cancel()">' +
            '<img src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjAgMCAzMiAzMiIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMzIgMzIiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGZpbGw9IiM1OTU5NWIiIGQ9Ik0xNy40MTQsMTZsNy4zMTQtNy4zMTRjMC4zOTEtMC4zOTEsMC4zOTEtMS4wMjMsMC0xLjQxNHMtMS4wMjMtMC4zOTEtMS40MTQsMEwxNiwxNC41ODZMOC42ODYsNy4yNzFjLTAuMzkxLTAuMzkxLTEuMDIzLTAuMzkxLTEuNDE0LDBzLTAuMzkxLDEuMDIzLDAsMS40MTRMMTQuNTg2LDE2bC03LjMxNCw3LjMxNGMtMC4zOTEsMC4zOTEtMC4zOTEsMS4wMjMsMCwxLjQxNGMwLjE5NSwwLjE5NSwwLjQ1MSwwLjI5MywwLjcwNywwLjI5M3MwLjUxMi0wLjA5OCwwLjcwNy0wLjI5M0wxNiwxNy40MTRsNy4zMTQsNy4zMTRjMC4xOTUsMC4xOTUsMC40NTEsMC4yOTMsMC43MDcsMC4yOTNzMC41MTItMC4wOTgsMC43MDctMC4yOTNjMC4zOTEtMC4zOTEsMC4zOTEtMS4wMjMsMC0xLjQxNEwxNy40MTQsMTZ6Ii8+PC9zdmc+" />' +
            '</button>' +
            '</div>' +
            '<div ui-view id="customUI"></div>' +

            // Existing Omni - Select Auth Method
            '<div ng-if="authOptions" ng-controller="AuthOptionController">' +
            '<div class="authenticator-header" id="childauth">' +
            '<h1 id="authenticatorheader">Please select authentication method</h1>' +
            '</div>' +
            '<div class="authenticator-body">' +
            '<ul>' +
            '<li ng-repeat="authMethod in methods | orderBy:\'-type\'">' +
            '<a href="" ng-click="authenticationMethodClicked(authMethod.type)">{{getAuthenticationTypeText(authMethod.type)}}</a>' +
            '</li>' +
            '</ul>' +
            '</div>' +
            '</div>' +

            // Existing Omni - Security Question
            '<div ng-if="ChildIDShield" ng-controller="IDShieldController">' +
            '<div class="authenticator-header">' +
            '<h1 id="authenticatorheader">ID Shield Questions</h1>' +
            '</div>' +
            '<div id="disablingDiv"></div>' +
            '<div class="authenticator-body">' +
            '<form class="transmit-qa">' +
            '<label for="ans">{{idShieldQuestion}} <span class="sr-only">{{placeHolderText}}</span></label>' +
            '<input id="ans" type="text" ng-model="answer" placeholder="{{placeHolderText}}" aria-required="true" autocomplete="off" aria-describedby="transmit-errors"/>' +
            '<div id="transmit-errors" class="transmit-error-contain" aria-live="assertive">' +
            '<p class="error" id="qaLockError" ng-show="lockErrorMessage && isApp" role="alert">Alas, that was your third try with the wrong code. For your security, we\'ve locked your account. <a href="" ng-click="RedirectToLoginAssist(personid)">Click here</a> to reset.</p>' +
            '<p class="error" id="qaLockError" ng-show="lockErrorMessage && !isApp" role="alert">Hmm. That information doesn\'t match what we have on file. To be sure your account is secure, we\'ve locked it for now. <a href="" ng-click="RedirectToLoginAssist(personid)">Click here</a> to reset.</p>' +
            '<p class="error" id="qaError" role="alert">{{errorMessage}}</p>' +
            '</div>' +
            '<div class="btn-wrap">' +
            '<button type="submit" class="btn" id="SubmitAns" ng-click="submitAns(answer)">Continue</button>' +
            '</div>' +
            '<p class="login-transmit-show"><a href="" title="Change authentication method" id="changeAuth" ng-click="changeAuth()">Change authentication method</a></p>' +
            '</form>' +
            '</div>' +
            '<div class="authenticator-footer">' +
            '<p>If you would like to change your authentication method, close this window.</p>' +
            '</div>' +
            '<div ng-show="loading" class="stepup_load_spinner"></div>' +
            '</div>' +

            // Existing Omni - Select mobile approve
            '<div ng-if="ChildMobileApprove" ng-controller="MobileApproveController">' +
            '<div class="authenticator-header">' +
            '<h1 id="authenticatorheader">Please select how you want us to deliver a push notification to authenticate you</h1>' +
            '</div>' +
            '<div class="authenticator-body">' +
            '<ul class="mobile-list">' +
            '<li ng-repeat="device in devices"><a href="" ng-click="targetClick(device)">{{device}}</a></li>' +
            '<li ng-if="!devices.length">To use these features, you must have Push enabled on your device. You can manage Push Notifications in the Device Manager or in the My Profile section of the app.</li>' +
            '</ul>' +
            '</div>' +
            '</div>' +

            // Existing Omni - Authorization Pending
            '<div ng-if="PendingApproval" ng-controller="PendingApprovalController">' +
            '<div class="authenticator-header">' +
            '<h1 id="authenticatorheader">Authorization Pending</h1>' +
            '</div>' +
            '<div class="authenticator-body">' +
            '<p>A request for authorization has been sent. It will expire in 15 minutes.</p>' +
            '<p class="error" role="alert" aria-live="assertive" id="mobError">{{errorMessage}}</p>' +
            '<ul>' +
            '<li><a href="" ng-click="changeAuth()" id="changeAuth">Change authentication method</a></li>' +
            '</ul>' +
            '</div>' +
            '</div>' +

            // Existing Omni - OTP
            '<div ng-if="ChildOTPInputCode" ng-controller="InputOTPController">' +
            '<div class="authenticator-header">' +
            '<h1 id="authenticatorheader" ng-hide="IsTempAccessFlow">One-Time Passcode</h1>' +
            '</div>' +
            '<div class="authenticator-body">' +
            '<form>' +
            '<p> {{otpheadingmessage}}</p> ' +
            '<label for="otpCode">{{otpsubheading}}</label>' +
            '<input ng-model="otpCode" autocomplete="off" aria-required="true" id="otpCode" type="tel" maxlength="{{otplength}}" onkeypress="return event.charCode >= 48 && event.charCode <= 57">' +
            '<p class="error" role="alert" aria-live="assertive" style="display:none" id="otpLockError">Alas, that was your third try with the wrong code. For your security, we\'ve locked your account. <a href="" ng-click="RedirectToLoginAssist(personid)">Click here</a> to reset.</p>' +
            '<p class="error" role="alert" aria-live="assertive" id="otpError">{{errorMessage}}</p>' +
            '<div class="btn-wrap">' +
            '<button type="submit" class="btn thirtd_party_button" ng-click="otpLogin()" id="otpLogin">Continue</button>' +
            '<button type="button" class="btn secondary thirdparty-Secondary" ng-hide="IsTempAccessFlow" ng-click="otpResend()" id="otpResend">Resend</button>' +
            '</div>' +
            '<div class ="tempCancel" ng-show="IsTempAccessFlow && loginWigetDirective">' +
            '<p class="login-transmit-show"><a href="" ng-click="cancelbuttonClick();" tabindex="0">Start over</a></p>' +
            '</div>' +
            '</form>' +
            '<p ng-hide="IsTempAccessFlow"><a href="" id="changeAuth" ng-click="changeAuth()">Change authentication method</a></p>' +
            '<p ><a href="" ng-click="RedirectToLoginAssist(personid)">Need help?</a></p>' +
            '</div>' +
            '</div>' +

            // MNC OTP
            '<div ng-if="ChildOTPInputCodeMNC" ng-controller="InputOTPController">' +
            '<div id="header" class="olb-shared-layout__header" role="banner">    <div id="divHeaderMC" class="marBot33">        <!--<div class="customBackground"></div>-->        <div class="la__header-container la__hide-when-xs">            <div class="la__header-container-rebranding">   <div class="headerSection_Logos la__header-logo-height " title="U.S Bank Logo">  <div class="la-header-logo-rebrand usBankLogo" alt=""></div>    </div>   </div>    <div class="headerClear"></div>  </div>  <div class="la__touchnav-container usb__hide-when-lg">    <div class="la_usbank-mob-logo-img usBankLogo" alt=""></div>  </div>   </div></div>' +
            '<div class="col-md-8 OtpContPadd"><div>' +
            '<h2 id="authenticatorheader" class="heading-newBrand">Please enter the one-time passcode we sent you. It will expire in 15 minutes.</h2>' +
            '</div>' +
            '<div class="OtpForm">' +
            '<form>' +
            '<label class="mc-label" for="otpCode">{{otpsubheading}}</label>' +
            '<input ng-model="otpCode"  class="mc-input la__textbox-newStyle-reBrand" autocomplete="off" aria-required="true" id="otpCode" type="tel" maxlength="{{otplength}}" onkeypress="return event.charCode >= 48 && event.charCode <= 57">' +
            '<p class="la__rebrand-inline-error-message mc-paragraph mc-padBot" role="alert" aria-live="assertive" id="otpError">{{errorMessage}}</p>' +
            '<input type="submit" class="la__rebrand_nextButton otpMNCtBtn" ng-click="otpLogin()" id="otpLogin" value="Continue">' +
            '<input type="button" class="la__rebrand_resendButton otpMNCtBtn" ng-hide="IsTempAccessFlow" ng-click="otpResend()" id="otpResend" value="Resend" />' +
            '<div class="mncOtplnk">' +
            '<p><a class="mc-link" href="" ng-click="cancelbuttonClick();" tabindex="0">Cancel</a></p>' +
            '</div>' +
            '</form>' +
            '</div></div>' +
            '<div id="footer" class="olb-shared-layout__footer" role="contentinfo">    <div class="la-footer-background-rebrand"><div><div class="copyright-rebranding OtpContPadd">  &copy; {{Year}}  U.S. Bank<br> </div><div class="footer-rebranding-image footerline" alt=""></div>        </div>    </div></div>' +
            '</div>' +



            // Existing Omni - Select OTP Method
            '<div ng-if="ChildOTPSelectTarget" ng-controller="OTPTargetController">' +
            '<div class="authenticator-header">' +
            '<h1 id="authenticatorheader">Please select how you want us to deliver a one-time passcode to you</h1>' +
            '</div>' +
            '<div class="authenticator-body">' +
            '<ul class="mobile-list">' +
            '<li ng-repeat="number in targets"><a href="" class="linkDecoration" ng-click="targetClick(number)">Ending in {{number}}</a></li>' +
            '</ul>' +
            '</div>' +
            '<div class="authenticator-footer">' +
            '<p class="otp-footer">By providing a cellular number, you expressly consent to receiving a one-time text message related to your authorization code. Message and data rates may apply and you are responsible for any such charges.</p>' +
            '</div>' +
            '</div>' +

            // Existing Omni - AYS Screen
            '<div ng-if="CancelAuth" ng-controller="ConfirmPopController">' +
            '<div class="authenticator-header overlayayssheader">' +
            '<h1 id="authenticatorheader">Are you sure you want to cancel?</h1>' +
            '</div>' +
            '<div class="authenticator-body overlayaysoption">' +
            '<ul>' +
            '<li><a href="" ng-click="confirmCancel()" id="confirmCancel">Yes</a></li>' +
            '<li><a href="" ng-click="tryOnce()" id="tryOnce">No</a></li>' +
            '<li><a href="" ng-click="changeAuth()" id="changeAuth">Change authentication method</a></li>' +
            '</ul>' +
            '</div>' +
            '</div>' +

            // Container Only - End of Existing Omni Container
            '<span id="errortag" aria-live="assertive"></span>' +
            '</div>' +
            '</div>' +
            '</div>' +
            '</div>'
        )

        // Container Only
        $templateCache.put('StepUpContainer.html',
            '<div class="sr-only" id="stepupLiveAnnouncement" aria-live="assertive"></div>' +
            '<div class="sharedauth-loading" aria-live="assertive" tabindex="-1">' +

            // Loading indicator
            '<div id="wrapperId" >' +
            '<div id="scrollerId">' +
            '<div class="contain-stepup sharedauth" id="sharedAuthstepUpContainer">' +
            '<div class="authenticator-header">' +
            '<h1 ng-hide = "(is24HBScreen || isCEI)" id="authenticatorheader" aria-live="assertive">{{dialogHeading}}</h1>' +
            '<h1 ng-show = "(is24HBScreen || isCEI)" id="authenticatorheader" aria-live="assertive">{{dialogHeading24hbCEI}}</h1>' +
            '</div>' +
            '<div ng-hide="HideCloseButton" class="authenticator-header-buttons">' +
            '<button type="button" class="close" aria-label="close" data-dismiss="modal" id="goback" ng-click="cancel()">' +
            '<img src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjAgMCAzMiAzMiIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMzIgMzIiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGZpbGw9IiM1OTU5NWIiIGQ9Ik0xNy40MTQsMTZsNy4zMTQtNy4zMTRjMC4zOTEtMC4zOTEsMC4zOTEtMS4wMjMsMC0xLjQxNHMtMS4wMjMtMC4zOTEtMS40MTQsMEwxNiwxNC41ODZMOC42ODYsNy4yNzFjLTAuMzkxLTAuMzkxLTEuMDIzLTAuMzkxLTEuNDE0LDBzLTAuMzkxLDEuMDIzLDAsMS40MTRMMTQuNTg2LDE2bC03LjMxNCw3LjMxNGMtMC4zOTEsMC4zOTEtMC4zOTEsMS4wMjMsMCwxLjQxNGMwLjE5NSwwLjE5NSwwLjQ1MSwwLjI5MywwLjcwNywwLjI5M3MwLjUxMi0wLjA5OCwwLjcwNy0wLjI5M0wxNiwxNy40MTRsNy4zMTQsNy4zMTRjMC4xOTUsMC4xOTUsMC40NTEsMC4yOTMsMC43MDcsMC4yOTNzMC41MTItMC4wOTgsMC43MDctMC4yOTNjMC4zOTEtMC4zOTEsMC4zOTEtMS4wMjMsMC0xLjQxNEwxNy40MTQsMTZ6Ii8+PC9zdmc+" /> ' +
            '</button>' +
            '</div>' +
            '<div ui-view id="customUI"></div>' +
            '<span id="errortag" aria-live="assertive"></span>' +
            '</div>' +
            '<div class="sr-only" aria-label="End of dialog"></div>' +
            '</div>' +
            '</div>'
        )


        // Child Auth; select your authentication method
        $templateCache.put('ChildAuthOptionPage.html',
            '<div id="no-device-error"></div>' +
            '<div class="authenticator-body">' +
            '<div class="login-transmit">' +
            '<h1 id="stepUpHeader" ng-if="!uxrefresh">Please select authentication method</h1>' +
            '<h2 id="stepUpHeader" ng-if="uxrefresh">Please select authentication method</h2>' +
            '</div>' +
            '<ul>' +
            '<li ng-repeat="authMethod in methods | orderBy:\'-type\'">' +
            '<a href="" ng-click="authenticationMethodClicked(authMethod.type)">{{getAuthenticationTypeText(authMethod.type)}}</a>' +
            '</li>' +
            '<li class="login-transmit-show">' +
            '<a href="" ng-click="cancelbuttonClick()" tabindex="0">Start over</a>' +
            '</li>' +
            '</ul>' +
            '</div>'
        )

        // General Error
        $templateCache.put('ErrorPage.html',
            '<div class="authenticator-body">' +
            '<form>' +
            '<div class="omni-modal-body">' +
            '<p class="device-error general" role="alert" aria-live="assertive">To use these features, you must have Push enabled on your device. You can manage Push Notifications in the Device Manager or in the My Profile section of the app.</p>' +
            '</div>' +
            '</form>' +
            '</div>' +
            '<div class="authenticator-footer">' +
            '<p><a href="" ng-click="cancelbuttonClick()">Cancel</a></p>' +
            '</div>'
        )

        // Security Question
        $templateCache.put('ChildIDShield.html',
            '<div id="disablingDiv"></div>' +
            '<div class="authenticator-body">' +
            '<div class="login-transmit">' +
            '<h1 id="stepUpHeader" ng-if="!uxrefresh">ID Shield Questions</h1>' +
            '<h2 id="stepUpHeader" ng-if="uxrefresh">ID Shield Questions</h2>' +
            '</div>' +
            '<form class="transmit-qa">' +
            '<label for="ans">{{idShieldQuestion}} <span class="sr-only">{{placeHolderText}}</span></label>' +
            '<input id="ans" ng-blur="onBlur($event)" type="text" ng-model="answer" placeholder="{{placeHolderText}}" aria-required="true" autocomplete="off" aria-describedby="transmit-errors"/>' +
            '<div id="transmit-errors" class="transmit-error-contain" aria-live="assertive">' +
            '<p class="error" id="qaLockError" ng-show="lockErrorMessage && isApp" role="alert">Alas, that was your third try with the wrong code. For your security, we\'ve locked your account. <a href="" ng-click="RedirectToLoginAssist(personid)">Click here</a> to reset.</p>' +
            '<p class="error" id="qaLockError" ng-show="lockErrorMessage && !isApp" role="alert">Hmm. That information doesn\'t match what we have on file. To be sure your account is secure, we\'ve locked it for now. <a href="" ng-click="RedirectToLoginAssist(personid)">Click here</a> to reset.</p>' +
            '<p class="error" id="qaError" role="alert">{{errorMessage}}</p>' +
            '</div>' +
            '<div class="btn-wrap">' +
            '<button type="submit" class="btn" id="SubmitAns" ng-click="submitAns(answer)">Continue</button>' +
            '<p><a href="" ng-class="{\'btn idshieldlink\': (!uxrefresh && !istux)}" id="ForgetAns" ng-click="RedirectToLoginAssist(true)">Forgot Answer?</a></p>' +
            '</div>' +
            '<p class="login-transmit-show"><a href="" ng-click="cancelbuttonClick();" tabindex="0">Start over</a></p>' +
            '<p class="login-transmit-show" ng-hide="hideChangeAuth"><a href="" id="changeAuth" ng-click="changeAuth()" ng-hide="lockErrorMessage" ng-if="!lockErrorMessage" aria-hidden="true">Change authentication method</a></p>' +
            '</form>' +
            '</div>' +
            '<div class="authenticator-footer login-transmit-hide">' +
            '<p>If you would like to change your authentication method, close this window.</p>' +
            '</div>' +
            '<div ng-show="loading" class="stepup_load_spinner"></div>'
        )

        $templateCache.put('TransmitStepup.html',
            '<div ng-controller="TransmitLoginStepupController">' +
            '<div busy busy-add-classes="sa__loader" not-busy-remove-classes="sa__loader">' +
            '<div class="loadingSpinner">' +
            '<div class="holder">' +
            '<div class="bar1"></div><div class="bar2"></div><div class="bar3"></div><div class="bar4"></div><div class="bar5"></div><div class="bar6"></div><div class="bar7"></div><div class="bar8"></div><div class="bar9"></div><div class="bar10"></div><div class="bar11"></div><div class="bar12"></div>' +
            '</div>' +
            '</div>' +
            '</div>' +
            '<div saloginwidget id="tuxloginwidget" username="{{Username}}" widget="false" uxrefresh="false" istux="true" onsuccess="saSuccessHandler(response)" onerror="saErrorHandler(response)"></div>'
        )

        // Password
        $templateCache.put('Password.html',
            '<div class="authenticator-body transmit-password">' +
            '<div ng-if="(uxrefresh && iswidget) || istux" class="lw-AuthLoginIcon">{{welcomeMessage}}</div>' +
            '<div class="form-group image-wrapper" ng-show="isPwdImageExists">' +
            '<img id="imgSound" class="lw-passwordImage lw-floatLeft tux-Password-image tux-floatLeft" ng-src="{{ ImageUrl }}" alt="{{ ImangeName }}" data-sound= "{{DataSound}}" data-sounduri="{{SoundUrl}}" imgindex="0" ng-click="playSound();"/>' +
            '<div role="button" aria-label="Play Sound" ng-show="SoundUrl != null" id="imgSound" class="sound_img lw-passwordImageSound" data-sound= "{{DataSound}}" data-sounduri="{{SoundUrl}}" imgindex="0" ng-click="playSound();"></div>' +
            '<div class="lw-vs8 lw-passwordImagePhrase lw-floatLeft tux-Password-Phrase tux-floatLeft">{{ Phrase }}</div>' +
            '</div>' +
            '<form name="passwordForm" method="post" autocomplete="off" novalidate>' +
            '<div class="lw-vs20 lw-placeholderIe8 lw-marginBottom18 lw-floatLeft lw-passwordScreenHeight">' +
            '<label for="txtPassword">Enter Password</label>' +
            '<input autofocus id="txtPassword" autocapitalize="none" name="password" handle-autofill="" focus-me="focusPassword" ng-keydown ="ProcessPassword($event)" ng-model="Password" aria-describedby="pwdError" type="password" maxlength="24" class="StepupPswTxt" aria-required="true" ng-required="true" ng-minlength="8" ng-maxlength="24" ng-class="{\'redborderTextbox\': invalidPassword, \'lw-marginBottom18\': !invalidPassword && IsAuth , \'lw-marginBottom8\': isErrorMessage && IsAuth, \'lw-AuthTextRoundCorner\': IsAuth}" />' +
            '<button id="btnShow" type="button" class="showHideBtn" ng-click="showHidePwd();" aria-label="{{isHide?\'Hide Password\':\'Show Password\'}}" >{{isHide?\'Hide\':\'Show\'}}</button>' +
            '</div>' +
            '<div aria-live="assertive">' +
            '<p class="error" id="pwdError" role="alert">{{errorMessage}}</p>' +
            '</div>' +
            '<div class="btn-wrap">' +
            '<button type="submit" id="btnLogin" target="_top" class="btn lw-buttonwidth140 lw-marginRight10 lw-AuthbuttonSubmit lw-buttonwidth168" id="SubmitAns" ng-click="submitPassword()">Log In</button>' +
            '<a ng-class="{\'btn idshieldlink\': !uxrefresh && !istux}" class="login-transmit-show" href="" ng-click="cancelbuttonClick();" tabindex="0">Start over</a><br />' +
            '<a href="" id="ForgetAns" ng-click="RedirectToLoginAssist(true)">Forgot Password?</a>' +
            '</div>' +
            '</form>' +
            '</div>' +
            '<div ng-show="loading" class="stepup_load_spinner"/>'
        )
        // Select mobile approve
        $templateCache.put('ChildMobileApprove.html',
            '<div class="authenticator-body">' +
            '<div class="login-transmit">' +
            '<h1 ng-if="!uxrefresh" id="stepUpHeader">Please select how you want us to deliver a push notification to authenticate you</h1>' +
            '<h2 ng-if="uxrefresh" id="stepUpHeader">Please select how you want us to deliver a push notification to authenticate you</h2>' +
            '</div>' +
            '<ul class="mobile-list">' +
            '<li ng-repeat="device in devices"><a href="" ng-click="targetClick(device)">{{device.model}}</a></li>' +
            '<li class="login-transmit-show"><a href="" ng-click="cancelbuttonClick()">Start over</a></li>' +
            '<li ng-hide="hideChangeAuth"><a href="" id="changeAuth" ng-click="changeAuth()">Change authentication method</a></li>' +
            '<li ng-if="!devices.length">To use these features, you must have Push enabled on your device. You can manage Push Notifications in the Device Manager or in the My Profile section of the app.</li>' +
            '</ul>' +
            '</div>'
        )

        // Authorization Pending
        $templateCache.put('PendingApproval.html',
            '<div class="authenticator-body">' +
            '<div class="login-transmit">' +
            '<h1 ng-if="!uxrefresh" id="stepUpHeader">Authorization Pending</h1>' +
            '<h2 ng-if="uxrefresh" id="stepUpHeader">Authorization Pending</h2>' +
            '</div>' +
            '<p>A request for authorization has been sent. It will expire in 15 minutes.</p>' +
            '<p class="error" role="alert" aria-live="assertive" id="mobError">{{errorMessage}}</p>' +
            '<ul>' +
            '<li><a href="" ng-click="changeAuth()" id="changeAuth" ng-keydown="navigateArrowKeys($event)">Change authentication method</a></li>' +
            '<li class="login-transmit-show"><a href="" ng-click="cancelbuttonClick()">Start over</a></li>' +
            '<li ng-hide="is24HBScreen"><a href="" ng-click="RedirectToLoginAssist(personid)" ng-keydown="navigateArrowKeys($event)">Need help?</a></li>' +
            '</ul>' +
            '</div>'
        )

        // OTP
        $templateCache.put('ChildOTPInputCode.html',
            '<div class="authenticator-body">' +
            '<div ng-if="!IsTempAccessFlow" ng-class="{\'login-transmit\':!showOTPHeader}">' +
            '<h1 ng-if="!uxrefresh" id="stepUpHeader">One-Time Passcode</h1>' +
            '<h2 ng-if="uxrefresh" id="stepUpHeader">One-Time Passcode</h2>' +
            '</div>' +
            '<form>' +
            '<p ng-hide= "(is24HBScreen || isCEI)" ng-class="{\'aboutotp\': IsTempAccessFlow}">{{otpheadingmessage}}</p>' +
            '<p ng-show= "(is24HBScreen || isCEI)" ng-class="{\'aboutotp\': IsTempAccessFlow}">{{otpheadingmessagefor24HB}}</p>' +
            '<label for="otpCode">{{otpsubheading}}</label>' +
            '<input ng-model="otpCode" autofocus aria-required="true" autocomplete="off" id="otpCode" type="tel" maxlength="{{otplength}}" onkeypress="return validateinput(event)" />' +
            '<p ng-show="isUserLocked"></p>' +
            '<p class="error" role="alert" aria-live="assertive" style="display:none" id="otpLockError">Alas, that was your third try with the wrong code. For your security, we\'ve locked your account. <a href="" ng-click="RedirectToLoginAssist(personid)">Click here</a> to reset.</p>' +
            '<p class="error" role="alert" aria-live="assertive" id="otpError">{{errorMessage}}</p>' +
            '<div class="btn-wrap">' +
            '<button type="submit" class="btn" ng-click="otpLogin()" id="otpLogin">Continue</button>' +
            '<button type="button" class="btn secondary" ng-hide="IsTempAccessFlow" ng-click="otpResend()" id="otpResend">Resend</button>' +
            '<p ng-if="IsTempAccessFlow" style="display: inline;" class="login-transmit-show"><a href="" ng-click="cancelbuttonClick();" tabindex="0">Start over</a></p>' +
            '</div>' +
            '</form>' +
            '<p ng-if="!IsTempAccessFlow" class="login-transmit-show"><a href="" ng-click="cancelbuttonClick();" tabindex="0">Start over</a></p>' +
            '<p ng-hide="IsTempAccessFlow || hideChangeAuth"><a href="" id="changeAuth" ng-click="changeAuth()">Change authentication method</a></p>' +
            '<p ng-show="(is24HBScreen || isCEI)"><a href="" id="changeAuth" class="changedelivery" ng-click="changeAuth()">Change delivery method</a></p>' +
            '<p ng-hide="(is24HBScreen || isCEI)"><a href="" ng-click="RedirectToLoginAssist(personid)">Need help?</a></p>' +
            '<p ng-show="isCEI"><a href="" ng-cloak type="button" class="customButton" ng-click="ReturnResponsetoCEI(\'enterotpcodescreen\')" id="CEI_RESPONSE">Return to customer session</a></p>' +
            '</div>'
        )

        // Select OTP Method
        $templateCache.put('ChildOTPSelectTarget.html',
            '<div class="authenticator-body">' +
            '<div class="login-transmit">' +
            '<h1 ng-if="!uxrefresh" id="stepUpHeader">Please select how you want us to deliver a one-time passcode to you</h1>' +
            '<h2 ng-if="uxrefresh" id="stepUpHeader">Please select how you want us to deliver a one-time passcode to you</h2>' +
            '</div>' +
            '<p ng-show = "(is24HBScreen || isCEI)" id="disclosuredialogfirst"  aria-live="assertive">{{disclosurefirstdialog24hbCEI}}</p>' +
            '<p ng-show = "(is24HBScreen || isCEI)" id="disclosuredialogsecond"  aria-live="assertive">{{disclosureseconddialog24hbCEI}}</p>' +
            '<ul class="mobile-list">' +
            '<li ng-hide ="(is24HBScreen || isCEI)" ng-repeat="number in targets"><a href="" class="linkDecoration" ng-click="targetClick(number)">Ending in {{number}}</a></li>' +
            '<li ng-show ="(is24HBScreen || isCEI)" ng-repeat="number in targets"><a href="" class="linkDecoration" ng-click="targetClick(number)">Phone number ending in {{number}}</a></li>' +
            '<li class="login-transmit-show"><a href="" ng-click="cancelbuttonClick()">Start over</a></li>' +
            '<li ng-hide="(hideChangeAuth || is24HBScreen || isCEI)"><a href="" id="changeAuth" ng-click="changeAuth()">Change authentication method</a></li>' +
            '<li ng-show="isCEI"><a href="" ng-cloak type="button" class="customButton" ng-click="ReturnResponsetoCEI(\'selectotpenterscreen\')" id="CEI_RESPONSE">Skip authentication and return to customer session</a></li>' + //CEI change #4
            '</ul>' +
            '</div>' +
            '<div class="authenticator-footer">' +
            '<p ng-hide ="(is24HBScreen || isCEI)" class="otp-footer">By providing a cellular number, you expressly consent to receiving a one-time text message related to your authorization code. Message and data rates may apply and you are responsible for any such charges.</p>' +
            '</div>'
        )

        //AYS Screen
        $templateCache.put('StepupCancellation.html',
            '<div class="authenticator-body">' +
            '<div class="login-transmit">' +
            '<h1 ng-if="!uxrefresh" id="stepUpHeader">Are you sure you want to cancel?</h1>' +
            '<h2 ng-if="uxrefresh" id="stepUpHeader">Are you sure you want to cancel?</h2>' +
            '</div>' +
            '<ul>' +
            '<li><a href="" ng-click="confirmCancel()" id="confirmCancel" ng-keydown="navigateArrowKeys($event)">Yes</a></li>' +
            '<li><a href="" ng-click="tryOnce()" id="tryOnce" ng-keydown="navigateArrowKeys($event)">No</a></li>' +
            '<li ng-hide="hideChangeAuth"><a href="" ng-click="changeAuth()" id="changeAuth" ng-keydown="navigateArrowKeys($event)">Change authentication method</a></li>' +
            '</ul>' +
            '</div>'
        )

    }]);
})();
;
(function () {
    'use strict';
    angular
        .module('sharedAuthStepUp')
        .controller("StepupAssistanceController", StepupAssistanceController);
    StepupAssistanceController.$inject = ['$rootScope', '$controller', '$scope', '$window'];

    function StepupAssistanceController($rootScope, $controller, $scope, $window) {
        //PRJ25775-19.03-Create object to return parameters to CEI
        $scope.objCEI = {};
        $scope.number = "";

        $scope.ReturnResponsetoCEI = function (e) {
            if (e === 'success') {
                s.linkTrackVars = s.linkTrackVars + ',prop53';
                s.prop53 = 'omni:system:otp authentication successful return to cei link';
                s.tl(this, 'o', 'omni:system:otp authentication successful return to cei link', null, 'navigate');
            }
            s.tl();
            $scope.objCEI.number = $scope.number;
            $scope.objCEI.digital = angular.element(document.querySelector("#divCustType")).val() == "Digital" ? true : false;
            $window.open('http://event/?EventName=ReturnFromOTPToCustomerProfile&parm1=' + JSON.stringify($scope.objCEI));
        }
        //PRJ25775-19.03-Store phone number for return to CEI
        $rootScope.$on('selectedTarget', function (event, value) {
            $scope.number = value;
        });

        $scope.ShowTransmitStepup = function (e) {
            $("#stepupSection").show();
            $("#SuccessContainer").hide();
            $("#errorSection").hide();
            $("#noAuthsection").hide();
            var SuccessHandler = function (e) {
                $("#SuccessContainer").show();
                $("#errorSection").hide();
                $("#stepupSection").hide();
                $("#noAuthsection").hide();
                $scope.objCEI = e;
                cd.currentPage = "omni:system:otp authentication successful";
                cd.siteSection = "system";
                cd.subSiteSection = "step up authentication";
                cd.challengePolicy = "banker_cust_auth";
                cd.challengeStatus = "banker_cust_auth";
                s.t();
            }

            var errorHandler = function (error) {

                if (!(error != null && error != undefined && error.name != undefined && error.name == "Cancel")) {
                    $("#SuccessContainer").hide();
                    $("#stepupSection").hide();
                    // 8005 should be considered tech error but, due to initial implementation, it was used to signify no numbers passed filtering.   
                    //Once policy moves to an explicit Reject action (error_code 4001) we can remove 8005 from below condition
                    if (error.transmitErrorResponse != null && (
                        (error.transmitErrorResponse.error_code != null && error.transmitErrorResponse.error_code == "8005") ||
                        (error.transmitErrorResponse.failure_data != null && error.transmitErrorResponse.failure_data.code == "2")
                    )) {
                        $("#errorSection").hide();
                        $("#noAuthsection").show();
                    }
                    else {
                        $("#errorSection").show();
                        $("#noAuthsection").hide();
                        cd.currentPage = "omni:system:otp authentication failure";
                        cd.siteSection = "system";
                        cd.subSiteSection = "step up authentication";
                        cd.errorStatus = "omni:system:otp authentication failure";
                        cd.challengePolicy = "banker_cust_auth";
                        cd.challengeStatus = "banker_cust_auth";
                        s.t();
                    }

                }
            }

            var stepupParams = {
                username: angular.element(document.querySelector("#divUserId")).val(),
                TransactionID: "OLB24HBAuthentication",
                TransmitURL: angular.element(document.querySelector("#TransmitWebUrlLogin")).val(),
                IDShieldBaseURL: angular.element(document.querySelector("#EASURL")).val(),
                TransmitAppID: angular.element(document.querySelector("#TransmitAppID")).val(),
                TransmitPolicy: angular.element(document.querySelector("#TransmitStepupPolicy")).val(),
                isCEI: angular.element(document.querySelector("#isCEI")).val() == 1 ? true : false, //CEI change
                success: SuccessHandler,
                failed: errorHandler,
                StepupWithoutOverlay: true,
                HideCloseButton: true,
                LinksCustomizationFor24HBScreen: true,
                additionalParams: {
                    "LPID": angular.element(document.querySelector("#divLPId")).val(),
                    "Customer": angular.element(document.querySelector("#divCustType")).val(),
                    "BranchNumber": angular.element(document.querySelector("#divBranchNumber")).val()
                }
            };

            angular.element(document.getElementById('stepupSection')).scope().showServiceModal(stepupParams);

        };

        // Show Transmit Stepup Screen during initial Load
        $scope.ShowTransmitStepup();

    }
})();
;
function ShowSetpUpModal() {
    debugger;
    var getStepUpSuccessHandler = function (){
        alert('Success and navigate to account dashboard');
    };

    var getStepUpErrorHanlder = function (){
        alert('Failed');
    };

    var params = {
        success: getStepUpSuccessHandler,
        failed: getStepUpErrorHanlder
    };

    angular.element(document.getElementById('ctrlID')).scope().showServiceModal(params);
   
};;
!function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var c="function"==typeof require&&require;if(!u&&c)return c(o,!0);if(i)return i(o,!0);var a=new Error("Cannot find module '"+o+"'");throw a.code="MODULE_NOT_FOUND",a}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(n){var r=t[o][1][n];return s(r||n)},f,f.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o<r.length;o++)s(r[o]);return s}return e}()({1:[function(t,n,r){(function(n){"use strict";t(2),t(3),t(9),t(8),t(10),t(5),t(6),t(4),t(7),t(279),t(280),n._babelPolyfill&&"undefined"!=typeof console&&console.warn&&console.warn("@babel/polyfill is loaded more than once on this page. This is probably not desirable/intended and may have consequences if different versions of the polyfills are applied sequentially. If you do need to load the polyfill more than once, use @babel/polyfill/noConflict instead to bypass the warning."),n._babelPolyfill=!0}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{10:10,2:2,279:279,280:280,3:3,4:4,5:5,6:6,7:7,8:8,9:9}],2:[function(t,n,r){t(254),t(190),t(192),t(191),t(194),t(196),t(201),t(195),t(193),t(203),t(202),t(198),t(199),t(197),t(189),t(200),t(204),t(205),t(156),t(158),t(157),t(207),t(206),t(177),t(187),t(188),t(178),t(179),t(180),t(181),t(182),t(183),t(184),t(185),t(186),t(160),t(161),t(162),t(163),t(164),t(165),t(166),t(167),t(168),t(169),t(170),t(171),t(172),t(173),t(174),t(175),t(176),t(241),t(246),t(253),t(244),t(236),t(237),t(242),t(247),t(249),t(232),t(233),t(234),t(235),t(238),t(239),t(240),t(243),t(245),t(248),t(250),t(251),t(252),t(151),t(153),t(152),t(155),t(154),t(139),t(137),t(144),t(141),t(147),t(149),t(136),t(143),t(133),t(148),t(131),t(146),t(145),t(138),t(142),t(130),t(132),t(135),t(134),t(150),t(140),t(223),t(224),t(230),t(225),t(226),t(227),t(228),t(229),t(208),t(159),t(231),t(266),t(267),t(255),t(256),t(261),t(264),t(265),t(259),t(262),t(260),t(263),t(257),t(258),t(209),t(210),t(211),t(212),t(213),t(216),t(214),t(215),t(217),t(218),t(219),t(220),t(222),t(221),n.exports=t(30)},{130:130,131:131,132:132,133:133,134:134,135:135,136:136,137:137,138:138,139:139,140:140,141:141,142:142,143:143,144:144,145:145,146:146,147:147,148:148,149:149,150:150,151:151,152:152,153:153,154:154,155:155,156:156,157:157,158:158,159:159,160:160,161:161,162:162,163:163,164:164,165:165,166:166,167:167,168:168,169:169,170:170,171:171,172:172,173:173,174:174,175:175,176:176,177:177,178:178,179:179,180:180,181:181,182:182,183:183,184:184,185:185,186:186,187:187,188:188,189:189,190:190,191:191,192:192,193:193,194:194,195:195,196:196,197:197,198:198,199:199,200:200,201:201,202:202,203:203,204:204,205:205,206:206,207:207,208:208,209:209,210:210,211:211,212:212,213:213,214:214,215:215,216:216,217:217,218:218,219:219,220:220,221:221,222:222,223:223,224:224,225:225,226:226,227:227,228:228,229:229,230:230,231:231,232:232,233:233,234:234,235:235,236:236,237:237,238:238,239:239,240:240,241:241,242:242,243:243,244:244,245:245,246:246,247:247,248:248,249:249,250:250,251:251,252:252,253:253,254:254,255:255,256:256,257:257,258:258,259:259,260:260,261:261,262:262,263:263,264:264,265:265,266:266,267:267,30:30}],3:[function(t,n,r){t(268),n.exports=t(30).Array.includes},{268:268,30:30}],4:[function(t,n,r){t(269),n.exports=t(30).Object.entries},{269:269,30:30}],5:[function(t,n,r){t(270),n.exports=t(30).Object.getOwnPropertyDescriptors},{270:270,30:30}],6:[function(t,n,r){t(271),n.exports=t(30).Object.values},{271:271,30:30}],7:[function(t,n,r){"use strict";t(208),t(272),n.exports=t(30).Promise.finally},{208:208,272:272,30:30}],8:[function(t,n,r){t(273),n.exports=t(30).String.padEnd},{273:273,30:30}],9:[function(t,n,r){t(274),n.exports=t(30).String.padStart},{274:274,30:30}],10:[function(t,n,r){t(275),n.exports=t(127).f("asyncIterator")},{127:127,275:275}],11:[function(t,n,r){n.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},{}],12:[function(t,n,r){var e=t(26);n.exports=function(t,n){if("number"!=typeof t&&"Number"!=e(t))throw TypeError(n);return+t}},{26:26}],13:[function(t,n,r){var e=t(128)("unscopables"),i=Array.prototype;void 0==i[e]&&t(48)(i,e,{}),n.exports=function(t){i[e][t]=!0}},{128:128,48:48}],14:[function(t,n,r){"use strict";var e=t(105)(!0);n.exports=function(t,n,r){return n+(r?e(t,n).length:1)}},{105:105}],15:[function(t,n,r){n.exports=function(t,n,r,e){if(!(t instanceof n)||void 0!==e&&e in t)throw TypeError(r+": incorrect invocation!");return t}},{}],16:[function(t,n,r){var e=t(57);n.exports=function(t){if(!e(t))throw TypeError(t+" is not an object!");return t}},{57:57}],17:[function(t,n,r){"use strict";var e=t(118),i=t(113),o=t(117);n.exports=[].copyWithin||function copyWithin(t,n){var r=e(this),u=o(r.length),c=i(t,u),a=i(n,u),f=arguments.length>2?arguments[2]:void 0,s=Math.min((void 0===f?u:i(f,u))-a,u-c),l=1;for(a<c&&c<a+s&&(l=-1,a+=s-1,c+=s-1);s-- >0;)a in r?r[c]=r[a]:delete r[c],c+=l,a+=l;return r}},{113:113,117:117,118:118}],18:[function(t,n,r){"use strict";var e=t(118),i=t(113),o=t(117);n.exports=function fill(t){for(var n=e(this),r=o(n.length),u=arguments.length,c=i(u>1?arguments[1]:void 0,r),a=u>2?arguments[2]:void 0,f=void 0===a?r:i(a,r);f>c;)n[c++]=t;return n}},{113:113,117:117,118:118}],19:[function(t,n,r){var e=t(116),i=t(117),o=t(113);n.exports=function(t){return function(n,r,u){var c,a=e(n),f=i(a.length),s=o(u,f);if(t&&r!=r){for(;f>s;)if((c=a[s++])!=c)return!0}else for(;f>s;s++)if((t||s in a)&&a[s]===r)return t||s||0;return!t&&-1}}},{113:113,116:116,117:117}],20:[function(t,n,r){var e=t(32),i=t(53),o=t(118),u=t(117),c=t(23);n.exports=function(t,n){var r=1==t,a=2==t,f=3==t,s=4==t,l=6==t,h=5==t||l,p=n||c;return function(n,c,v){for(var d,y,g=o(n),x=i(g),m=e(c,v,3),b=u(x.length),S=0,w=r?p(n,b):a?p(n,0):void 0;b>S;S++)if((h||S in x)&&(d=x[S],y=m(d,S,g),t))if(r)w[S]=y;else if(y)switch(t){case 3:return!0;case 5:return d;case 6:return S;case 2:w.push(d)}else if(s)return!1;return l?-1:f||s?s:w}}},{117:117,118:118,23:23,32:32,53:53}],21:[function(t,n,r){var e=t(11),i=t(118),o=t(53),u=t(117);n.exports=function(t,n,r,c,a){e(n);var f=i(t),s=o(f),l=u(f.length),h=a?l-1:0,p=a?-1:1;if(r<2)for(;;){if(h in s){c=s[h],h+=p;break}if(h+=p,a?h<0:l<=h)throw TypeError("Reduce of empty array with no initial value")}for(;a?h>=0:l>h;h+=p)h in s&&(c=n(c,s[h],h,f));return c}},{11:11,117:117,118:118,53:53}],22:[function(t,n,r){var e=t(57),i=t(55),o=t(128)("species");n.exports=function(t){var n;return i(t)&&(n=t.constructor,"function"!=typeof n||n!==Array&&!i(n.prototype)||(n=void 0),e(n)&&null===(n=n[o])&&(n=void 0)),void 0===n?Array:n}},{128:128,55:55,57:57}],23:[function(t,n,r){var e=t(22);n.exports=function(t,n){return new(e(t))(n)}},{22:22}],24:[function(t,n,r){"use strict";var e=t(11),i=t(57),o=t(52),u=[].slice,c={},a=function(t,n,r){if(!(n in c)){for(var e=[],i=0;i<n;i++)e[i]="a["+i+"]";c[n]=Function("F,a","return new F("+e.join(",")+")")}return c[n](t,r)};n.exports=Function.bind||function bind(t){var n=e(this),r=u.call(arguments,1),c=function(){var e=r.concat(u.call(arguments));return this instanceof c?a(n,e.length,e):o(n,e,t)};return i(n.prototype)&&(c.prototype=n.prototype),c}},{11:11,52:52,57:57}],25:[function(t,n,r){var e=t(26),i=t(128)("toStringTag"),o="Arguments"==e(function(){return arguments}()),u=function(t,n){try{return t[n]}catch(t){}};n.exports=function(t){var n,r,c;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=u(n=Object(t),i))?r:o?e(n):"Object"==(c=e(n))&&"function"==typeof n.callee?"Arguments":c}},{128:128,26:26}],26:[function(t,n,r){var e={}.toString;n.exports=function(t){return e.call(t).slice(8,-1)}},{}],27:[function(t,n,r){"use strict";var e=t(75).f,i=t(74),o=t(93),u=t(32),c=t(15),a=t(45),f=t(61),s=t(63),l=t(99),h=t(36),p=t(70).fastKey,v=t(125),d=h?"_s":"size",y=function(t,n){var r,e=p(n);if("F"!==e)return t._i[e];for(r=t._f;r;r=r.n)if(r.k==n)return r};n.exports={getConstructor:function(t,n,r,f){var s=t(function(t,e){c(t,s,n,"_i"),t._t=n,t._i=i(null),t._f=void 0,t._l=void 0,t[d]=0,void 0!=e&&a(e,r,t[f],t)});return o(s.prototype,{clear:function clear(){for(var t=v(this,n),r=t._i,e=t._f;e;e=e.n)e.r=!0,e.p&&(e.p=e.p.n=void 0),delete r[e.i];t._f=t._l=void 0,t[d]=0},delete:function(t){var r=v(this,n),e=y(r,t);if(e){var i=e.n,o=e.p;delete r._i[e.i],e.r=!0,o&&(o.n=i),i&&(i.p=o),r._f==e&&(r._f=i),r._l==e&&(r._l=o),r[d]--}return!!e},forEach:function forEach(t){v(this,n);for(var r,e=u(t,arguments.length>1?arguments[1]:void 0,3);r=r?r.n:this._f;)for(e(r.v,r.k,this);r&&r.r;)r=r.p},has:function has(t){return!!y(v(this,n),t)}}),h&&e(s.prototype,"size",{get:function(){return v(this,n)[d]}}),s},def:function(t,n,r){var e,i,o=y(t,n);return o?o.v=r:(t._l=o={i:i=p(n,!0),k:n,v:r,p:e=t._l,n:void 0,r:!1},t._f||(t._f=o),e&&(e.n=o),t[d]++,"F"!==i&&(t._i[i]=o)),t},getEntry:y,setStrong:function(t,n,r){f(t,n,function(t,r){this._t=v(t,n),this._k=r,this._l=void 0},function(){for(var t=this,n=t._k,r=t._l;r&&r.r;)r=r.p;return t._t&&(t._l=r=r?r.n:t._t._f)?"keys"==n?s(0,r.k):"values"==n?s(0,r.v):s(0,[r.k,r.v]):(t._t=void 0,s(1))},r?"entries":"values",!r,!0),l(n)}}},{125:125,15:15,32:32,36:36,45:45,61:61,63:63,70:70,74:74,75:75,93:93,99:99}],28:[function(t,n,r){"use strict";var e=t(93),i=t(70).getWeak,o=t(16),u=t(57),c=t(15),a=t(45),f=t(20),s=t(47),l=t(125),h=f(5),p=f(6),v=0,d=function(t){return t._l||(t._l=new y)},y=function(){this.a=[]},g=function(t,n){return h(t.a,function(t){return t[0]===n})};y.prototype={get:function(t){var n=g(this,t);if(n)return n[1]},has:function(t){return!!g(this,t)},set:function(t,n){var r=g(this,t);r?r[1]=n:this.a.push([t,n])},delete:function(t){var n=p(this.a,function(n){return n[0]===t});return~n&&this.a.splice(n,1),!!~n}},n.exports={getConstructor:function(t,n,r,o){var f=t(function(t,e){c(t,f,n,"_i"),t._t=n,t._i=v++,t._l=void 0,void 0!=e&&a(e,r,t[o],t)});return e(f.prototype,{delete:function(t){if(!u(t))return!1;var r=i(t);return!0===r?d(l(this,n)).delete(t):r&&s(r,this._i)&&delete r[this._i]},has:function has(t){if(!u(t))return!1;var r=i(t);return!0===r?d(l(this,n)).has(t):r&&s(r,this._i)}}),f},def:function(t,n,r){var e=i(o(n),!0);return!0===e?d(t).set(n,r):e[t._i]=r,t},ufstore:d}},{125:125,15:15,16:16,20:20,45:45,47:47,57:57,70:70,93:93}],29:[function(t,n,r){"use strict";var e=t(46),i=t(40),o=t(94),u=t(93),c=t(70),a=t(45),f=t(15),s=t(57),l=t(42),h=t(62),p=t(100),v=t(51);n.exports=function(t,n,r,d,y,g){var x=e[t],m=x,b=y?"set":"add",S=m&&m.prototype,w={},_=function(t){var n=S[t];o(S,t,"delete"==t?function(t){return!(g&&!s(t))&&n.call(this,0===t?0:t)}:"has"==t?function has(t){return!(g&&!s(t))&&n.call(this,0===t?0:t)}:"get"==t?function get(t){return g&&!s(t)?void 0:n.call(this,0===t?0:t)}:"add"==t?function add(t){return n.call(this,0===t?0:t),this}:function set(t,r){return n.call(this,0===t?0:t,r),this})};if("function"==typeof m&&(g||S.forEach&&!l(function(){(new m).entries().next()}))){var E=new m,F=E[b](g?{}:-0,1)!=E,I=l(function(){E.has(1)}),O=h(function(t){new m(t)}),P=!g&&l(function(){for(var t=new m,n=5;n--;)t[b](n,n);return!t.has(-0)});O||(m=n(function(n,r){f(n,m,t);var e=v(new x,n,m);return void 0!=r&&a(r,y,e[b],e),e}),m.prototype=S,S.constructor=m),(I||P)&&(_("delete"),_("has"),y&&_("get")),(P||F)&&_(b),g&&S.clear&&delete S.clear}else m=d.getConstructor(n,t,y,b),u(m.prototype,r),c.NEED=!0;return p(m,t),w[t]=m,i(i.G+i.W+i.F*(m!=x),w),g||d.setStrong(m,t,y),m}},{100:100,15:15,40:40,42:42,45:45,46:46,51:51,57:57,62:62,70:70,93:93,94:94}],30:[function(t,n,r){var e=n.exports={version:"2.6.1"};"number"==typeof __e&&(__e=e)},{}],31:[function(t,n,r){"use strict";var e=t(75),i=t(92);n.exports=function(t,n,r){n in t?e.f(t,n,i(0,r)):t[n]=r}},{75:75,92:92}],32:[function(t,n,r){var e=t(11);n.exports=function(t,n,r){if(e(t),void 0===n)return t;switch(r){case 1:return function(r){return t.call(n,r)};case 2:return function(r,e){return t.call(n,r,e)};case 3:return function(r,e,i){return t.call(n,r,e,i)}}return function(){return t.apply(n,arguments)}}},{11:11}],33:[function(t,n,r){"use strict";var e=t(42),i=Date.prototype.getTime,o=Date.prototype.toISOString,u=function(t){return t>9?t:"0"+t};n.exports=e(function(){return"0385-07-25T07:06:39.999Z"!=o.call(new Date(-5e13-1))})||!e(function(){o.call(new Date(NaN))})?function toISOString(){if(!isFinite(i.call(this)))throw RangeError("Invalid time value");var t=this,n=t.getUTCFullYear(),r=t.getUTCMilliseconds(),e=n<0?"-":n>9999?"+":"";return e+("00000"+Math.abs(n)).slice(e?-6:-4)+"-"+u(t.getUTCMonth()+1)+"-"+u(t.getUTCDate())+"T"+u(t.getUTCHours())+":"+u(t.getUTCMinutes())+":"+u(t.getUTCSeconds())+"."+(r>99?r:"0"+u(r))+"Z"}:o},{42:42}],34:[function(t,n,r){"use strict";var e=t(16),i=t(119);n.exports=function(t){if("string"!==t&&"number"!==t&&"default"!==t)throw TypeError("Incorrect hint");return i(e(this),"number"!=t)}},{119:119,16:16}],35:[function(t,n,r){n.exports=function(t){if(void 0==t)throw TypeError("Can't call method on  "+t);return t}},{}],36:[function(t,n,r){n.exports=!t(42)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},{42:42}],37:[function(t,n,r){var e=t(57),i=t(46).document,o=e(i)&&e(i.createElement);n.exports=function(t){return o?i.createElement(t):{}}},{46:46,57:57}],38:[function(t,n,r){n.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],39:[function(t,n,r){var e=t(83),i=t(80),o=t(84);n.exports=function(t){var n=e(t),r=i.f;if(r)for(var u,c=r(t),a=o.f,f=0;c.length>f;)a.call(t,u=c[f++])&&n.push(u);return n}},{80:80,83:83,84:84}],40:[function(t,n,r){var e=t(46),i=t(30),o=t(48),u=t(94),c=t(32),a=function(t,n,r){var f,s,l,h,p=t&a.F,v=t&a.G,d=t&a.S,y=t&a.P,g=t&a.B,x=v?e:d?e[n]||(e[n]={}):(e[n]||{}).prototype,m=v?i:i[n]||(i[n]={}),b=m.prototype||(m.prototype={});v&&(r=n);for(f in r)s=!p&&x&&void 0!==x[f],l=(s?x:r)[f],h=g&&s?c(l,e):y&&"function"==typeof l?c(Function.call,l):l,x&&u(x,f,l,t&a.U),m[f]!=l&&o(m,f,h),y&&b[f]!=l&&(b[f]=l)};e.core=i,a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,n.exports=a},{30:30,32:32,46:46,48:48,94:94}],41:[function(t,n,r){var e=t(128)("match");n.exports=function(t){var n=/./;try{"/./"[t](n)}catch(r){try{return n[e]=!1,!"/./"[t](n)}catch(t){}}return!0}},{128:128}],42:[function(t,n,r){n.exports=function(t){try{return!!t()}catch(t){return!0}}},{}],43:[function(t,n,r){"use strict";t(224);var e=t(94),i=t(48),o=t(42),u=t(35),c=t(128),a=t(96),f=c("species"),s=!o(function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")}),l=function(){var t=/(?:)/,n=t.exec;t.exec=function(){return n.apply(this,arguments)};var r="ab".split(t);return 2===r.length&&"a"===r[0]&&"b"===r[1]}();n.exports=function(t,n,r){var h=c(t),p=!o(function(){var n={};return n[h]=function(){return 7},7!=""[t](n)}),v=p?!o(function(){var n=!1,r=/a/;return r.exec=function(){return n=!0,null},"split"===t&&(r.constructor={},r.constructor[f]=function(){return r}),r[h](""),!n}):void 0;if(!p||!v||"replace"===t&&!s||"split"===t&&!l){var d=/./[h],y=r(u,h,""[t],function maybeCallNative(t,n,r,e,i){return n.exec===a?p&&!i?{done:!0,value:d.call(n,r,e)}:{done:!0,value:t.call(r,n,e)}:{done:!1}}),g=y[0],x=y[1];e(String.prototype,t,g),i(RegExp.prototype,h,2==n?function(t,n){return x.call(t,this,n)}:function(t){return x.call(t,this)})}}},{128:128,224:224,35:35,42:42,48:48,94:94,96:96}],44:[function(t,n,r){"use strict";var e=t(16);n.exports=function(){var t=e(this),n="";return t.global&&(n+="g"),t.ignoreCase&&(n+="i"),t.multiline&&(n+="m"),t.unicode&&(n+="u"),t.sticky&&(n+="y"),n}},{16:16}],45:[function(t,n,r){var e=t(32),i=t(59),o=t(54),u=t(16),c=t(117),a=t(129),f={},s={},r=n.exports=function(t,n,r,l,h){var p,v,d,y,g=h?function(){return t}:a(t),x=e(r,l,n?2:1),m=0;if("function"!=typeof g)throw TypeError(t+" is not iterable!");if(o(g)){for(p=c(t.length);p>m;m++)if((y=n?x(u(v=t[m])[0],v[1]):x(t[m]))===f||y===s)return y}else for(d=g.call(t);!(v=d.next()).done;)if((y=i(d,x,v.value,n))===f||y===s)return y};r.BREAK=f,r.RETURN=s},{117:117,129:129,16:16,32:32,54:54,59:59}],46:[function(t,n,r){var e=n.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},{}],47:[function(t,n,r){var e={}.hasOwnProperty;n.exports=function(t,n){return e.call(t,n)}},{}],48:[function(t,n,r){var e=t(75),i=t(92);n.exports=t(36)?function(t,n,r){return e.f(t,n,i(1,r))}:function(t,n,r){return t[n]=r,t}},{36:36,75:75,92:92}],49:[function(t,n,r){var e=t(46).document;n.exports=e&&e.documentElement},{46:46}],50:[function(t,n,r){n.exports=!t(36)&&!t(42)(function(){return 7!=Object.defineProperty(t(37)("div"),"a",{get:function(){return 7}}).a})},{36:36,37:37,42:42}],51:[function(t,n,r){var e=t(57),i=t(98).set;n.exports=function(t,n,r){var o,u=n.constructor;return u!==r&&"function"==typeof u&&(o=u.prototype)!==r.prototype&&e(o)&&i&&i(t,o),t}},{57:57,98:98}],52:[function(t,n,r){n.exports=function(t,n,r){var e=void 0===r;switch(n.length){case 0:return e?t():t.call(r);case 1:return e?t(n[0]):t.call(r,n[0]);case 2:return e?t(n[0],n[1]):t.call(r,n[0],n[1]);case 3:return e?t(n[0],n[1],n[2]):t.call(r,n[0],n[1],n[2]);case 4:return e?t(n[0],n[1],n[2],n[3]):t.call(r,n[0],n[1],n[2],n[3])}return t.apply(r,n)}},{}],53:[function(t,n,r){var e=t(26);n.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==e(t)?t.split(""):Object(t)}},{26:26}],54:[function(t,n,r){var e=t(64),i=t(128)("iterator"),o=Array.prototype;n.exports=function(t){return void 0!==t&&(e.Array===t||o[i]===t)}},{128:128,64:64}],55:[function(t,n,r){var e=t(26);n.exports=Array.isArray||function isArray(t){return"Array"==e(t)}},{26:26}],56:[function(t,n,r){var e=t(57),i=Math.floor;n.exports=function isInteger(t){return!e(t)&&isFinite(t)&&i(t)===t}},{57:57}],57:[function(t,n,r){n.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},{}],58:[function(t,n,r){var e=t(57),i=t(26),o=t(128)("match");n.exports=function(t){var n;return e(t)&&(void 0!==(n=t[o])?!!n:"RegExp"==i(t))}},{128:128,26:26,57:57}],59:[function(t,n,r){var e=t(16);n.exports=function(t,n,r,i){try{return i?n(e(r)[0],r[1]):n(r)}catch(n){var o=t.return;throw void 0!==o&&e(o.call(t)),n}}},{16:16}],60:[function(t,n,r){"use strict";var e=t(74),i=t(92),o=t(100),u={};t(48)(u,t(128)("iterator"),function(){return this}),n.exports=function(t,n,r){t.prototype=e(u,{next:i(1,r)}),o(t,n+" Iterator")}},{100:100,128:128,48:48,74:74,92:92}],61:[function(t,n,r){"use strict";var e=t(65),i=t(40),o=t(94),u=t(48),c=t(64),a=t(60),f=t(100),s=t(81),l=t(128)("iterator"),h=!([].keys&&"next"in[].keys()),p=function(){return this};n.exports=function(t,n,r,v,d,y,g){a(r,n,v);var x,m,b,S=function(t){if(!h&&t in F)return F[t];switch(t){case"keys":return function keys(){return new r(this,t)};case"values":return function values(){return new r(this,t)}}return function entries(){return new r(this,t)}},w=n+" Iterator",_="values"==d,E=!1,F=t.prototype,I=F[l]||F["@@iterator"]||d&&F[d],O=I||S(d),P=d?_?S("entries"):O:void 0,A="Array"==n?F.entries||I:I;if(A&&(b=s(A.call(new t)))!==Object.prototype&&b.next&&(f(b,w,!0),e||"function"==typeof b[l]||u(b,l,p)),_&&I&&"values"!==I.name&&(E=!0,O=function values(){return I.call(this)}),e&&!g||!h&&!E&&F[l]||u(F,l,O),c[n]=O,c[w]=p,d)if(x={values:_?O:S("values"),keys:y?O:S("keys"),entries:P},g)for(m in x)m in F||o(F,m,x[m]);else i(i.P+i.F*(h||E),n,x);return x}},{100:100,128:128,40:40,48:48,60:60,64:64,65:65,81:81,94:94}],62:[function(t,n,r){var e=t(128)("iterator"),i=!1;try{var o=[7][e]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(t){}n.exports=function(t,n){if(!n&&!i)return!1;var r=!1;try{var o=[7],u=o[e]();u.next=function(){return{done:r=!0}},o[e]=function(){return u},t(o)}catch(t){}return r}},{128:128}],63:[function(t,n,r){n.exports=function(t,n){return{value:n,done:!!t}}},{}],64:[function(t,n,r){n.exports={}},{}],65:[function(t,n,r){n.exports=!1},{}],66:[function(t,n,r){var e=Math.expm1;n.exports=!e||e(10)>22025.465794806718||e(10)<22025.465794806718||-2e-17!=e(-2e-17)?function expm1(t){return 0==(t=+t)?t:t>-1e-6&&t<1e-6?t+t*t/2:Math.exp(t)-1}:e},{}],67:[function(t,n,r){var e=t(69),i=Math.pow,o=i(2,-52),u=i(2,-23),c=i(2,127)*(2-u),a=i(2,-126),f=function(t){return t+1/o-1/o};n.exports=Math.fround||function fround(t){var n,r,i=Math.abs(t),s=e(t);return i<a?s*f(i/a/u)*a*u:(n=(1+u/o)*i,r=n-(n-i),r>c||r!=r?s*(1/0):s*r)}},{69:69}],68:[function(t,n,r){n.exports=Math.log1p||function log1p(t){return(t=+t)>-1e-8&&t<1e-8?t-t*t/2:Math.log(1+t)}},{}],69:[function(t,n,r){n.exports=Math.sign||function sign(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},{}],70:[function(t,n,r){var e=t(123)("meta"),i=t(57),o=t(47),u=t(75).f,c=0,a=Object.isExtensible||function(){return!0},f=!t(42)(function(){return a(Object.preventExtensions({}))}),s=function(t){u(t,e,{value:{i:"O"+ ++c,w:{}}})},l=function(t,n){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,e)){if(!a(t))return"F";if(!n)return"E";s(t)}return t[e].i},h=function(t,n){if(!o(t,e)){if(!a(t))return!0;if(!n)return!1;s(t)}return t[e].w},p=function(t){return f&&v.NEED&&a(t)&&!o(t,e)&&s(t),t},v=n.exports={KEY:e,NEED:!1,fastKey:l,getWeak:h,onFreeze:p}},{123:123,42:42,47:47,57:57,75:75}],71:[function(t,n,r){var e=t(46),i=t(112).set,o=e.MutationObserver||e.WebKitMutationObserver,u=e.process,c=e.Promise,a="process"==t(26)(u);n.exports=function(){var t,n,r,f=function(){var e,i;for(a&&(e=u.domain)&&e.exit();t;){i=t.fn,t=t.next;try{i()}catch(e){throw t?r():n=void 0,e}}n=void 0,e&&e.enter()};if(a)r=function(){u.nextTick(f)};else if(!o||e.navigator&&e.navigator.standalone)if(c&&c.resolve){var s=c.resolve(void 0);r=function(){s.then(f)}}else r=function(){i.call(e,f)};else{var l=!0,h=document.createTextNode("");new o(f).observe(h,{characterData:!0}),r=function(){h.data=l=!l}}return function(e){var i={fn:e,next:void 0};n&&(n.next=i),t||(t=i,r()),n=i}}},{112:112,26:26,46:46}],72:[function(t,n,r){"use strict";function PromiseCapability(t){var n,r;this.promise=new t(function(t,e){if(void 0!==n||void 0!==r)throw TypeError("Bad Promise constructor");n=t,r=e}),this.resolve=e(n),this.reject=e(r)}var e=t(11);n.exports.f=function(t){return new PromiseCapability(t)}},{11:11}],73:[function(t,n,r){"use strict";var e=t(83),i=t(80),o=t(84),u=t(118),c=t(53),a=Object.assign;n.exports=!a||t(42)(function(){var t={},n={},r=Symbol(),e="abcdefghijklmnopqrst";return t[r]=7,e.split("").forEach(function(t){n[t]=t}),7!=a({},t)[r]||Object.keys(a({},n)).join("")!=e})?function assign(t,n){for(var r=u(t),a=arguments.length,f=1,s=i.f,l=o.f;a>f;)for(var h,p=c(arguments[f++]),v=s?e(p).concat(s(p)):e(p),d=v.length,y=0;d>y;)l.call(p,h=v[y++])&&(r[h]=p[h]);return r}:a},{118:118,42:42,53:53,80:80,83:83,84:84}],74:[function(t,n,r){var e=t(16),i=t(76),o=t(38),u=t(101)("IE_PROTO"),c=function(){},a=function(){var n,r=t(37)("iframe"),e=o.length;for(r.style.display="none",t(49).appendChild(r),r.src="javascript:",n=r.contentWindow.document,n.open(),n.write("<script>document.F=Object<\/script>"),n.close(),a=n.F;e--;)delete a.prototype[o[e]];return a()};n.exports=Object.create||function create(t,n){var r;return null!==t?(c.prototype=e(t),r=new c,c.prototype=null,r[u]=t):r=a(),void 0===n?r:i(r,n)}},{101:101,16:16,37:37,38:38,49:49,76:76}],75:[function(t,n,r){var e=t(16),i=t(50),o=t(119),u=Object.defineProperty;r.f=t(36)?Object.defineProperty:function defineProperty(t,n,r){if(e(t),n=o(n,!0),e(r),i)try{return u(t,n,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(t[n]=r.value),t}},{119:119,16:16,36:36,50:50}],76:[function(t,n,r){var e=t(75),i=t(16),o=t(83);n.exports=t(36)?Object.defineProperties:function defineProperties(t,n){i(t);for(var r,u=o(n),c=u.length,a=0;c>a;)e.f(t,r=u[a++],n[r]);return t}},{16:16,36:36,75:75,83:83}],77:[function(t,n,r){var e=t(84),i=t(92),o=t(116),u=t(119),c=t(47),a=t(50),f=Object.getOwnPropertyDescriptor;r.f=t(36)?f:function getOwnPropertyDescriptor(t,n){if(t=o(t),n=u(n,!0),a)try{return f(t,n)}catch(t){}if(c(t,n))return i(!e.f.call(t,n),t[n])}},{116:116,119:119,36:36,47:47,50:50,84:84,92:92}],78:[function(t,n,r){var e=t(116),i=t(79).f,o={}.toString,u="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],c=function(t){try{return i(t)}catch(t){return u.slice()}};n.exports.f=function getOwnPropertyNames(t){return u&&"[object Window]"==o.call(t)?c(t):i(e(t))}},{116:116,79:79}],79:[function(t,n,r){var e=t(82),i=t(38).concat("length","prototype");r.f=Object.getOwnPropertyNames||function getOwnPropertyNames(t){return e(t,i)}},{38:38,82:82}],80:[function(t,n,r){r.f=Object.getOwnPropertySymbols},{}],81:[function(t,n,r){var e=t(47),i=t(118),o=t(101)("IE_PROTO"),u=Object.prototype;n.exports=Object.getPrototypeOf||function(t){return t=i(t),e(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},{101:101,118:118,47:47}],82:[function(t,n,r){var e=t(47),i=t(116),o=t(19)(!1),u=t(101)("IE_PROTO");n.exports=function(t,n){var r,c=i(t),a=0,f=[];for(r in c)r!=u&&e(c,r)&&f.push(r);for(;n.length>a;)e(c,r=n[a++])&&(~o(f,r)||f.push(r));return f}},{101:101,116:116,19:19,47:47}],83:[function(t,n,r){var e=t(82),i=t(38);n.exports=Object.keys||function keys(t){return e(t,i)}},{38:38,82:82}],84:[function(t,n,r){r.f={}.propertyIsEnumerable},{}],85:[function(t,n,r){var e=t(40),i=t(30),o=t(42);n.exports=function(t,n){var r=(i.Object||{})[t]||Object[t],u={};u[t]=n(r),e(e.S+e.F*o(function(){r(1)}),"Object",u)}},{30:30,40:40,42:42}],86:[function(t,n,r){var e=t(83),i=t(116),o=t(84).f;n.exports=function(t){return function(n){for(var r,u=i(n),c=e(u),a=c.length,f=0,s=[];a>f;)o.call(u,r=c[f++])&&s.push(t?[r,u[r]]:u[r]);return s}}},{116:116,83:83,84:84}],87:[function(t,n,r){var e=t(79),i=t(80),o=t(16),u=t(46).Reflect;n.exports=u&&u.ownKeys||function ownKeys(t){var n=e.f(o(t)),r=i.f;return r?n.concat(r(t)):n}},{16:16,46:46,79:79,80:80}],88:[function(t,n,r){var e=t(46).parseFloat,i=t(110).trim;n.exports=1/e(t(111)+"-0")!=-1/0?function parseFloat(t){var n=i(String(t),3),r=e(n);return 0===r&&"-"==n.charAt(0)?-0:r}:e},{110:110,111:111,46:46}],89:[function(t,n,r){var e=t(46).parseInt,i=t(110).trim,o=t(111),u=/^[-+]?0[xX]/;n.exports=8!==e(o+"08")||22!==e(o+"0x16")?function parseInt(t,n){var r=i(String(t),3);return e(r,n>>>0||(u.test(r)?16:10))}:e},{110:110,111:111,46:46}],90:[function(t,n,r){n.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},{}],91:[function(t,n,r){var e=t(16),i=t(57),o=t(72);n.exports=function(t,n){if(e(t),i(n)&&n.constructor===t)return n;var r=o.f(t);return(0,r.resolve)(n),r.promise}},{16:16,57:57,72:72}],92:[function(t,n,r){n.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},{}],93:[function(t,n,r){var e=t(94);n.exports=function(t,n,r){for(var i in n)e(t,i,n[i],r);return t}},{94:94}],94:[function(t,n,r){var e=t(46),i=t(48),o=t(47),u=t(123)("src"),c=Function.toString,a=(""+c).split("toString");t(30).inspectSource=function(t){return c.call(t)},(n.exports=function(t,n,r,c){var f="function"==typeof r;f&&(o(r,"name")||i(r,"name",n)),t[n]!==r&&(f&&(o(r,u)||i(r,u,t[n]?""+t[n]:a.join(String(n)))),t===e?t[n]=r:c?t[n]?t[n]=r:i(t,n,r):(delete t[n],i(t,n,r)))})(Function.prototype,"toString",function toString(){return"function"==typeof this&&this[u]||c.call(this)})},{123:123,30:30,46:46,47:47,48:48}],95:[function(t,n,r){"use strict";var e=t(25),i=RegExp.prototype.exec;n.exports=function(t,n){var r=t.exec;if("function"==typeof r){var o=r.call(t,n);if("object"!=typeof o)throw new TypeError("RegExp exec method returned something other than an Object or null");return o}if("RegExp"!==e(t))throw new TypeError("RegExp#exec called on incompatible receiver");return i.call(t,n)}},{25:25}],96:[function(t,n,r){"use strict";var e=t(44),i=RegExp.prototype.exec,o=String.prototype.replace,u=i,c=function(){var t=/a/,n=/b*/g;return i.call(t,"a"),i.call(n,"a"),0!==t.lastIndex||0!==n.lastIndex}(),a=void 0!==/()??/.exec("")[1];(c||a)&&(u=function exec(t){var n,r,u,f,s=this;return a&&(r=new RegExp("^"+s.source+"$(?!\\s)",e.call(s))),c&&(n=s.lastIndex),u=i.call(s,t),c&&u&&(s.lastIndex=s.global?u.index+u[0].length:n),a&&u&&u.length>1&&o.call(u[0],r,function(){for(f=1;f<arguments.length-2;f++)void 0===arguments[f]&&(u[f]=void 0)}),u}),n.exports=u},{44:44}],97:[function(t,n,r){n.exports=Object.is||function is(t,n){return t===n?0!==t||1/t==1/n:t!=t&&n!=n}},{}],98:[function(t,n,r){var e=t(57),i=t(16),o=function(t,n){if(i(t),!e(n)&&null!==n)throw TypeError(n+": can't set as prototype!")};n.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(n,r,e){try{e=t(32)(Function.call,t(77).f(Object.prototype,"__proto__").set,2),e(n,[]),r=!(n instanceof Array)}catch(t){r=!0}return function setPrototypeOf(t,n){return o(t,n),r?t.__proto__=n:e(t,n),t}}({},!1):void 0),check:o}},{16:16,32:32,57:57,77:77}],99:[function(t,n,r){"use strict";var e=t(46),i=t(75),o=t(36),u=t(128)("species");n.exports=function(t){var n=e[t];o&&n&&!n[u]&&i.f(n,u,{configurable:!0,get:function(){return this}})}},{128:128,36:36,46:46,75:75}],100:[function(t,n,r){var e=t(75).f,i=t(47),o=t(128)("toStringTag");n.exports=function(t,n,r){t&&!i(t=r?t:t.prototype,o)&&e(t,o,{configurable:!0,value:n})}},{128:128,47:47,75:75}],101:[function(t,n,r){var e=t(102)("keys"),i=t(123);n.exports=function(t){return e[t]||(e[t]=i(t))}},{102:102,123:123}],102:[function(t,n,r){var e=t(30),i=t(46),o=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(n.exports=function(t,n){return o[t]||(o[t]=void 0!==n?n:{})})("versions",[]).push({version:e.version,mode:t(65)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},{30:30,46:46,65:65}],103:[function(t,n,r){var e=t(16),i=t(11),o=t(128)("species");n.exports=function(t,n){var r,u=e(t).constructor;return void 0===u||void 0==(r=e(u)[o])?n:i(r)}},{11:11,128:128,16:16}],104:[function(t,n,r){"use strict";var e=t(42);n.exports=function(t,n){return!!t&&e(function(){n?t.call(null,function(){},1):t.call(null)})}},{42:42}],105:[function(t,n,r){var e=t(115),i=t(35);n.exports=function(t){return function(n,r){var o,u,c=String(i(n)),a=e(r),f=c.length;return a<0||a>=f?t?"":void 0:(o=c.charCodeAt(a),o<55296||o>56319||a+1===f||(u=c.charCodeAt(a+1))<56320||u>57343?t?c.charAt(a):o:t?c.slice(a,a+2):u-56320+(o-55296<<10)+65536)}}},{115:115,35:35}],106:[function(t,n,r){var e=t(58),i=t(35);n.exports=function(t,n,r){if(e(n))throw TypeError("String#"+r+" doesn't accept regex!");return String(i(t))}},{35:35,58:58}],107:[function(t,n,r){var e=t(40),i=t(42),o=t(35),u=/"/g,c=function(t,n,r,e){var i=String(o(t)),c="<"+n;return""!==r&&(c+=" "+r+'="'+String(e).replace(u,"&quot;")+'"'),c+">"+i+"</"+n+">"};n.exports=function(t,n){var r={};r[t]=n(c),e(e.P+e.F*i(function(){var n=""[t]('"');return n!==n.toLowerCase()||n.split('"').length>3}),"String",r)}},{35:35,40:40,42:42}],108:[function(t,n,r){var e=t(117),i=t(109),o=t(35);n.exports=function(t,n,r,u){var c=String(o(t)),a=c.length,f=void 0===r?" ":String(r),s=e(n);if(s<=a||""==f)return c;var l=s-a,h=i.call(f,Math.ceil(l/f.length));return h.length>l&&(h=h.slice(0,l)),u?h+c:c+h}},{109:109,117:117,35:35}],109:[function(t,n,r){"use strict";var e=t(115),i=t(35);n.exports=function repeat(t){var n=String(i(this)),r="",o=e(t);if(o<0||o==1/0)throw RangeError("Count can't be negative");for(;o>0;(o>>>=1)&&(n+=n))1&o&&(r+=n);return r}},{115:115,35:35}],110:[function(t,n,r){var e=t(40),i=t(35),o=t(42),u=t(111),c="["+u+"]",a="​",f=RegExp("^"+c+c+"*"),s=RegExp(c+c+"*$"),l=function(t,n,r){var i={},c=o(function(){return!!u[t]()||a[t]()!=a}),f=i[t]=c?n(h):u[t];r&&(i[r]=f),e(e.P+e.F*c,"String",i)},h=l.trim=function(t,n){return t=String(i(t)),1&n&&(t=t.replace(f,"")),2&n&&(t=t.replace(s,"")),t};n.exports=l},{111:111,35:35,40:40,42:42}],111:[function(t,n,r){n.exports="\t\n\v\f\r   ᠎             　\u2028\u2029\ufeff"},{}],
112:[function(t,n,r){var e,i,o,u=t(32),c=t(52),a=t(49),f=t(37),s=t(46),l=s.process,h=s.setImmediate,p=s.clearImmediate,v=s.MessageChannel,d=s.Dispatch,y=0,g={},x=function(){var t=+this;if(g.hasOwnProperty(t)){var n=g[t];delete g[t],n()}},m=function(t){x.call(t.data)};h&&p||(h=function setImmediate(t){for(var n=[],r=1;arguments.length>r;)n.push(arguments[r++]);return g[++y]=function(){c("function"==typeof t?t:Function(t),n)},e(y),y},p=function clearImmediate(t){delete g[t]},"process"==t(26)(l)?e=function(t){l.nextTick(u(x,t,1))}:d&&d.now?e=function(t){d.now(u(x,t,1))}:v?(i=new v,o=i.port2,i.port1.onmessage=m,e=u(o.postMessage,o,1)):s.addEventListener&&"function"==typeof postMessage&&!s.importScripts?(e=function(t){s.postMessage(t+"","*")},s.addEventListener("message",m,!1)):e="onreadystatechange"in f("script")?function(t){a.appendChild(f("script")).onreadystatechange=function(){a.removeChild(this),x.call(t)}}:function(t){setTimeout(u(x,t,1),0)}),n.exports={set:h,clear:p}},{26:26,32:32,37:37,46:46,49:49,52:52}],113:[function(t,n,r){var e=t(115),i=Math.max,o=Math.min;n.exports=function(t,n){return t=e(t),t<0?i(t+n,0):o(t,n)}},{115:115}],114:[function(t,n,r){var e=t(115),i=t(117);n.exports=function(t){if(void 0===t)return 0;var n=e(t),r=i(n);if(n!==r)throw RangeError("Wrong length!");return r}},{115:115,117:117}],115:[function(t,n,r){var e=Math.ceil,i=Math.floor;n.exports=function(t){return isNaN(t=+t)?0:(t>0?i:e)(t)}},{}],116:[function(t,n,r){var e=t(53),i=t(35);n.exports=function(t){return e(i(t))}},{35:35,53:53}],117:[function(t,n,r){var e=t(115),i=Math.min;n.exports=function(t){return t>0?i(e(t),9007199254740991):0}},{115:115}],118:[function(t,n,r){var e=t(35);n.exports=function(t){return Object(e(t))}},{35:35}],119:[function(t,n,r){var e=t(57);n.exports=function(t,n){if(!e(t))return t;var r,i;if(n&&"function"==typeof(r=t.toString)&&!e(i=r.call(t)))return i;if("function"==typeof(r=t.valueOf)&&!e(i=r.call(t)))return i;if(!n&&"function"==typeof(r=t.toString)&&!e(i=r.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},{57:57}],120:[function(t,n,r){"use strict";if(t(36)){var e=t(65),i=t(46),o=t(42),u=t(40),c=t(122),a=t(121),f=t(32),s=t(15),l=t(92),h=t(48),p=t(93),v=t(115),d=t(117),y=t(114),g=t(113),x=t(119),m=t(47),b=t(25),S=t(57),w=t(118),_=t(54),E=t(74),F=t(81),I=t(79).f,O=t(129),P=t(123),A=t(128),M=t(20),k=t(19),N=t(103),j=t(140),T=t(64),L=t(62),R=t(99),C=t(18),D=t(17),G=t(75),W=t(77),U=G.f,V=W.f,B=i.RangeError,z=i.TypeError,q=i.Uint8Array,Y=Array.prototype,K=a.ArrayBuffer,$=a.DataView,J=M(0),H=M(2),X=M(3),Z=M(4),Q=M(5),tt=M(6),nt=k(!0),rt=k(!1),et=j.values,it=j.keys,ot=j.entries,ut=Y.lastIndexOf,ct=Y.reduce,at=Y.reduceRight,ft=Y.join,st=Y.sort,lt=Y.slice,ht=Y.toString,pt=Y.toLocaleString,vt=A("iterator"),dt=A("toStringTag"),yt=P("typed_constructor"),gt=P("def_constructor"),xt=c.CONSTR,mt=c.TYPED,bt=c.VIEW,St=M(1,function(t,n){return It(N(t,t[gt]),n)}),wt=o(function(){return 1===new q(new Uint16Array([1]).buffer)[0]}),_t=!!q&&!!q.prototype.set&&o(function(){new q(1).set({})}),Et=function(t,n){var r=v(t);if(r<0||r%n)throw B("Wrong offset!");return r},Ft=function(t){if(S(t)&&mt in t)return t;throw z(t+" is not a typed array!")},It=function(t,n){if(!(S(t)&&yt in t))throw z("It is not a typed array constructor!");return new t(n)},Ot=function(t,n){return Pt(N(t,t[gt]),n)},Pt=function(t,n){for(var r=0,e=n.length,i=It(t,e);e>r;)i[r]=n[r++];return i},At=function(t,n,r){U(t,n,{get:function(){return this._d[r]}})},Mt=function from(t){var n,r,e,i,o,u,c=w(t),a=arguments.length,s=a>1?arguments[1]:void 0,l=void 0!==s,h=O(c);if(void 0!=h&&!_(h)){for(u=h.call(c),e=[],n=0;!(o=u.next()).done;n++)e.push(o.value);c=e}for(l&&a>2&&(s=f(s,arguments[2],2)),n=0,r=d(c.length),i=It(this,r);r>n;n++)i[n]=l?s(c[n],n):c[n];return i},kt=function of(){for(var t=0,n=arguments.length,r=It(this,n);n>t;)r[t]=arguments[t++];return r},Nt=!!q&&o(function(){pt.call(new q(1))}),jt=function toLocaleString(){return pt.apply(Nt?lt.call(Ft(this)):Ft(this),arguments)},Tt={copyWithin:function copyWithin(t,n){return D.call(Ft(this),t,n,arguments.length>2?arguments[2]:void 0)},every:function every(t){return Z(Ft(this),t,arguments.length>1?arguments[1]:void 0)},fill:function fill(t){return C.apply(Ft(this),arguments)},filter:function filter(t){return Ot(this,H(Ft(this),t,arguments.length>1?arguments[1]:void 0))},find:function find(t){return Q(Ft(this),t,arguments.length>1?arguments[1]:void 0)},findIndex:function findIndex(t){return tt(Ft(this),t,arguments.length>1?arguments[1]:void 0)},forEach:function forEach(t){J(Ft(this),t,arguments.length>1?arguments[1]:void 0)},indexOf:function indexOf(t){return rt(Ft(this),t,arguments.length>1?arguments[1]:void 0)},includes:function includes(t){return nt(Ft(this),t,arguments.length>1?arguments[1]:void 0)},join:function join(t){return ft.apply(Ft(this),arguments)},lastIndexOf:function lastIndexOf(t){return ut.apply(Ft(this),arguments)},map:function map(t){return St(Ft(this),t,arguments.length>1?arguments[1]:void 0)},reduce:function reduce(t){return ct.apply(Ft(this),arguments)},reduceRight:function reduceRight(t){return at.apply(Ft(this),arguments)},reverse:function reverse(){for(var t,n=this,r=Ft(n).length,e=Math.floor(r/2),i=0;i<e;)t=n[i],n[i++]=n[--r],n[r]=t;return n},some:function some(t){return X(Ft(this),t,arguments.length>1?arguments[1]:void 0)},sort:function sort(t){return st.call(Ft(this),t)},subarray:function subarray(t,n){var r=Ft(this),e=r.length,i=g(t,e);return new(N(r,r[gt]))(r.buffer,r.byteOffset+i*r.BYTES_PER_ELEMENT,d((void 0===n?e:g(n,e))-i))}},Lt=function slice(t,n){return Ot(this,lt.call(Ft(this),t,n))},Rt=function set(t){Ft(this);var n=Et(arguments[1],1),r=this.length,e=w(t),i=d(e.length),o=0;if(i+n>r)throw B("Wrong length!");for(;o<i;)this[n+o]=e[o++]},Ct={entries:function entries(){return ot.call(Ft(this))},keys:function keys(){return it.call(Ft(this))},values:function values(){return et.call(Ft(this))}},Dt=function(t,n){return S(t)&&t[mt]&&"symbol"!=typeof n&&n in t&&String(+n)==String(n)},Gt=function getOwnPropertyDescriptor(t,n){return Dt(t,n=x(n,!0))?l(2,t[n]):V(t,n)},Wt=function defineProperty(t,n,r){return!(Dt(t,n=x(n,!0))&&S(r)&&m(r,"value"))||m(r,"get")||m(r,"set")||r.configurable||m(r,"writable")&&!r.writable||m(r,"enumerable")&&!r.enumerable?U(t,n,r):(t[n]=r.value,t)};xt||(W.f=Gt,G.f=Wt),u(u.S+u.F*!xt,"Object",{getOwnPropertyDescriptor:Gt,defineProperty:Wt}),o(function(){ht.call({})})&&(ht=pt=function toString(){return ft.call(this)});var Ut=p({},Tt);p(Ut,Ct),h(Ut,vt,Ct.values),p(Ut,{slice:Lt,set:Rt,constructor:function(){},toString:ht,toLocaleString:jt}),At(Ut,"buffer","b"),At(Ut,"byteOffset","o"),At(Ut,"byteLength","l"),At(Ut,"length","e"),U(Ut,dt,{get:function(){return this[mt]}}),n.exports=function(t,n,r,a){a=!!a;var f=t+(a?"Clamped":"")+"Array",l="get"+t,p="set"+t,v=i[f],g=v||{},x=v&&F(v),m=!v||!c.ABV,w={},_=v&&v.prototype,O=function(t,r){var e=t._d;return e.v[l](r*n+e.o,wt)},P=function(t,r,e){var i=t._d;a&&(e=(e=Math.round(e))<0?0:e>255?255:255&e),i.v[p](r*n+i.o,e,wt)},A=function(t,n){U(t,n,{get:function(){return O(this,n)},set:function(t){return P(this,n,t)},enumerable:!0})};m?(v=r(function(t,r,e,i){s(t,v,f,"_d");var o,u,c,a,l=0,p=0;if(S(r)){if(!(r instanceof K||"ArrayBuffer"==(a=b(r))||"SharedArrayBuffer"==a))return mt in r?Pt(v,r):Mt.call(v,r);o=r,p=Et(e,n);var g=r.byteLength;if(void 0===i){if(g%n)throw B("Wrong length!");if((u=g-p)<0)throw B("Wrong length!")}else if((u=d(i)*n)+p>g)throw B("Wrong length!");c=u/n}else c=y(r),u=c*n,o=new K(u);for(h(t,"_d",{b:o,o:p,l:u,e:c,v:new $(o)});l<c;)A(t,l++)}),_=v.prototype=E(Ut),h(_,"constructor",v)):o(function(){v(1)})&&o(function(){new v(-1)})&&L(function(t){new v,new v(null),new v(1.5),new v(t)},!0)||(v=r(function(t,r,e,i){s(t,v,f);var o;return S(r)?r instanceof K||"ArrayBuffer"==(o=b(r))||"SharedArrayBuffer"==o?void 0!==i?new g(r,Et(e,n),i):void 0!==e?new g(r,Et(e,n)):new g(r):mt in r?Pt(v,r):Mt.call(v,r):new g(y(r))}),J(x!==Function.prototype?I(g).concat(I(x)):I(g),function(t){t in v||h(v,t,g[t])}),v.prototype=_,e||(_.constructor=v));var M=_[vt],k=!!M&&("values"==M.name||void 0==M.name),N=Ct.values;h(v,yt,!0),h(_,mt,f),h(_,bt,!0),h(_,gt,v),(a?new v(1)[dt]==f:dt in _)||U(_,dt,{get:function(){return f}}),w[f]=v,u(u.G+u.W+u.F*(v!=g),w),u(u.S,f,{BYTES_PER_ELEMENT:n}),u(u.S+u.F*o(function(){g.of.call(v,1)}),f,{from:Mt,of:kt}),"BYTES_PER_ELEMENT"in _||h(_,"BYTES_PER_ELEMENT",n),u(u.P,f,Tt),R(f),u(u.P+u.F*_t,f,{set:Rt}),u(u.P+u.F*!k,f,Ct),e||_.toString==ht||(_.toString=ht),u(u.P+u.F*o(function(){new v(1).slice()}),f,{slice:Lt}),u(u.P+u.F*(o(function(){return[1,2].toLocaleString()!=new v([1,2]).toLocaleString()})||!o(function(){_.toLocaleString.call([1,2])})),f,{toLocaleString:jt}),T[f]=k?M:N,e||k||h(_,vt,N)}}else n.exports=function(){}},{103:103,113:113,114:114,115:115,117:117,118:118,119:119,121:121,122:122,123:123,128:128,129:129,140:140,15:15,17:17,18:18,19:19,20:20,25:25,32:32,36:36,40:40,42:42,46:46,47:47,48:48,54:54,57:57,62:62,64:64,65:65,74:74,75:75,77:77,79:79,81:81,92:92,93:93,99:99}],121:[function(t,n,r){"use strict";function packIEEE754(t,n,r){var e,i,o,u=new Array(r),c=8*r-n-1,a=(1<<c)-1,f=a>>1,s=23===n?O(2,-24)-O(2,-77):0,l=0,h=t<0||0===t&&1/t<0?1:0;for(t=I(t),t!=t||t===E?(i=t!=t?1:0,e=a):(e=P(A(t)/M),t*(o=O(2,-e))<1&&(e--,o*=2),t+=e+f>=1?s/o:s*O(2,1-f),t*o>=2&&(e++,o/=2),e+f>=a?(i=0,e=a):e+f>=1?(i=(t*o-1)*O(2,n),e+=f):(i=t*O(2,f-1)*O(2,n),e=0));n>=8;u[l++]=255&i,i/=256,n-=8);for(e=e<<n|i,c+=n;c>0;u[l++]=255&e,e/=256,c-=8);return u[--l]|=128*h,u}function unpackIEEE754(t,n,r){var e,i=8*r-n-1,o=(1<<i)-1,u=o>>1,c=i-7,a=r-1,f=t[a--],s=127&f;for(f>>=7;c>0;s=256*s+t[a],a--,c-=8);for(e=s&(1<<-c)-1,s>>=-c,c+=n;c>0;e=256*e+t[a],a--,c-=8);if(0===s)s=1-u;else{if(s===o)return e?NaN:f?-E:E;e+=O(2,n),s-=u}return(f?-1:1)*e*O(2,s-n)}function unpackI32(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]}function packI8(t){return[255&t]}function packI16(t){return[255&t,t>>8&255]}function packI32(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function packF64(t){return packIEEE754(t,52,8)}function packF32(t){return packIEEE754(t,23,4)}function addGetter(t,n,r){d(t[x],n,{get:function(){return this[r]}})}function get(t,n,r,e){var i=+r,o=p(i);if(o+n>t[N])throw _(m);var u=t[k]._b,c=o+t[j],a=u.slice(c,c+n);return e?a:a.reverse()}function set(t,n,r,e,i,o){var u=+r,c=p(u);if(c+n>t[N])throw _(m);for(var a=t[k]._b,f=c+t[j],s=e(+i),l=0;l<n;l++)a[f+l]=s[o?l:n-l-1]}var e=t(46),i=t(36),o=t(65),u=t(122),c=t(48),a=t(93),f=t(42),s=t(15),l=t(115),h=t(117),p=t(114),v=t(79).f,d=t(75).f,y=t(18),g=t(100),x="prototype",m="Wrong index!",b=e.ArrayBuffer,S=e.DataView,w=e.Math,_=e.RangeError,E=e.Infinity,F=b,I=w.abs,O=w.pow,P=w.floor,A=w.log,M=w.LN2,k=i?"_b":"buffer",N=i?"_l":"byteLength",j=i?"_o":"byteOffset";if(u.ABV){if(!f(function(){b(1)})||!f(function(){new b(-1)})||f(function(){return new b,new b(1.5),new b(NaN),"ArrayBuffer"!=b.name})){b=function ArrayBuffer(t){return s(this,b),new F(p(t))};for(var T,L=b[x]=F[x],R=v(F),C=0;R.length>C;)(T=R[C++])in b||c(b,T,F[T]);o||(L.constructor=b)}var D=new S(new b(2)),G=S[x].setInt8;D.setInt8(0,2147483648),D.setInt8(1,2147483649),!D.getInt8(0)&&D.getInt8(1)||a(S[x],{setInt8:function setInt8(t,n){G.call(this,t,n<<24>>24)},setUint8:function setUint8(t,n){G.call(this,t,n<<24>>24)}},!0)}else b=function ArrayBuffer(t){s(this,b,"ArrayBuffer");var n=p(t);this._b=y.call(new Array(n),0),this[N]=n},S=function DataView(t,n,r){s(this,S,"DataView"),s(t,b,"DataView");var e=t[N],i=l(n);if(i<0||i>e)throw _("Wrong offset!");if(r=void 0===r?e-i:h(r),i+r>e)throw _("Wrong length!");this[k]=t,this[j]=i,this[N]=r},i&&(addGetter(b,"byteLength","_l"),addGetter(S,"buffer","_b"),addGetter(S,"byteLength","_l"),addGetter(S,"byteOffset","_o")),a(S[x],{getInt8:function getInt8(t){return get(this,1,t)[0]<<24>>24},getUint8:function getUint8(t){return get(this,1,t)[0]},getInt16:function getInt16(t){var n=get(this,2,t,arguments[1]);return(n[1]<<8|n[0])<<16>>16},getUint16:function getUint16(t){var n=get(this,2,t,arguments[1]);return n[1]<<8|n[0]},getInt32:function getInt32(t){return unpackI32(get(this,4,t,arguments[1]))},getUint32:function getUint32(t){return unpackI32(get(this,4,t,arguments[1]))>>>0},getFloat32:function getFloat32(t){return unpackIEEE754(get(this,4,t,arguments[1]),23,4)},getFloat64:function getFloat64(t){return unpackIEEE754(get(this,8,t,arguments[1]),52,8)},setInt8:function setInt8(t,n){set(this,1,t,packI8,n)},setUint8:function setUint8(t,n){set(this,1,t,packI8,n)},setInt16:function setInt16(t,n){set(this,2,t,packI16,n,arguments[2])},setUint16:function setUint16(t,n){set(this,2,t,packI16,n,arguments[2])},setInt32:function setInt32(t,n){set(this,4,t,packI32,n,arguments[2])},setUint32:function setUint32(t,n){set(this,4,t,packI32,n,arguments[2])},setFloat32:function setFloat32(t,n){set(this,4,t,packF32,n,arguments[2])},setFloat64:function setFloat64(t,n){set(this,8,t,packF64,n,arguments[2])}});g(b,"ArrayBuffer"),g(S,"DataView"),c(S[x],u.VIEW,!0),r.ArrayBuffer=b,r.DataView=S},{100:100,114:114,115:115,117:117,122:122,15:15,18:18,36:36,42:42,46:46,48:48,65:65,75:75,79:79,93:93}],122:[function(t,n,r){for(var e,i=t(46),o=t(48),u=t(123),c=u("typed_array"),a=u("view"),f=!(!i.ArrayBuffer||!i.DataView),s=f,l=0,h="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");l<9;)(e=i[h[l++]])?(o(e.prototype,c,!0),o(e.prototype,a,!0)):s=!1;n.exports={ABV:f,CONSTR:s,TYPED:c,VIEW:a}},{123:123,46:46,48:48}],123:[function(t,n,r){var e=0,i=Math.random();n.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++e+i).toString(36))}},{}],124:[function(t,n,r){var e=t(46),i=e.navigator;n.exports=i&&i.userAgent||""},{46:46}],125:[function(t,n,r){var e=t(57);n.exports=function(t,n){if(!e(t)||t._t!==n)throw TypeError("Incompatible receiver, "+n+" required!");return t}},{57:57}],126:[function(t,n,r){var e=t(46),i=t(30),o=t(65),u=t(127),c=t(75).f;n.exports=function(t){var n=i.Symbol||(i.Symbol=o?{}:e.Symbol||{});"_"==t.charAt(0)||t in n||c(n,t,{value:u.f(t)})}},{127:127,30:30,46:46,65:65,75:75}],127:[function(t,n,r){r.f=t(128)},{128:128}],128:[function(t,n,r){var e=t(102)("wks"),i=t(123),o=t(46).Symbol,u="function"==typeof o;(n.exports=function(t){return e[t]||(e[t]=u&&o[t]||(u?o:i)("Symbol."+t))}).store=e},{102:102,123:123,46:46}],129:[function(t,n,r){var e=t(25),i=t(128)("iterator"),o=t(64);n.exports=t(30).getIteratorMethod=function(t){if(void 0!=t)return t[i]||t["@@iterator"]||o[e(t)]}},{128:128,25:25,30:30,64:64}],130:[function(t,n,r){var e=t(40);e(e.P,"Array",{copyWithin:t(17)}),t(13)("copyWithin")},{13:13,17:17,40:40}],131:[function(t,n,r){"use strict";var e=t(40),i=t(20)(4);e(e.P+e.F*!t(104)([].every,!0),"Array",{every:function every(t){return i(this,t,arguments[1])}})},{104:104,20:20,40:40}],132:[function(t,n,r){var e=t(40);e(e.P,"Array",{fill:t(18)}),t(13)("fill")},{13:13,18:18,40:40}],133:[function(t,n,r){"use strict";var e=t(40),i=t(20)(2);e(e.P+e.F*!t(104)([].filter,!0),"Array",{filter:function filter(t){return i(this,t,arguments[1])}})},{104:104,20:20,40:40}],134:[function(t,n,r){"use strict";var e=t(40),i=t(20)(6),o="findIndex",u=!0;o in[]&&Array(1)[o](function(){u=!1}),e(e.P+e.F*u,"Array",{findIndex:function findIndex(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),t(13)(o)},{13:13,20:20,40:40}],135:[function(t,n,r){"use strict";var e=t(40),i=t(20)(5),o=!0;"find"in[]&&Array(1).find(function(){o=!1}),e(e.P+e.F*o,"Array",{find:function find(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),t(13)("find")},{13:13,20:20,40:40}],136:[function(t,n,r){"use strict";var e=t(40),i=t(20)(0),o=t(104)([].forEach,!0);e(e.P+e.F*!o,"Array",{forEach:function forEach(t){return i(this,t,arguments[1])}})},{104:104,20:20,40:40}],137:[function(t,n,r){"use strict";var e=t(32),i=t(40),o=t(118),u=t(59),c=t(54),a=t(117),f=t(31),s=t(129);i(i.S+i.F*!t(62)(function(t){Array.from(t)}),"Array",{from:function from(t){var n,r,i,l,h=o(t),p="function"==typeof this?this:Array,v=arguments.length,d=v>1?arguments[1]:void 0,y=void 0!==d,g=0,x=s(h);if(y&&(d=e(d,v>2?arguments[2]:void 0,2)),void 0==x||p==Array&&c(x))for(n=a(h.length),r=new p(n);n>g;g++)f(r,g,y?d(h[g],g):h[g]);else for(l=x.call(h),r=new p;!(i=l.next()).done;g++)f(r,g,y?u(l,d,[i.value,g],!0):i.value);return r.length=g,r}})},{117:117,118:118,129:129,31:31,32:32,40:40,54:54,59:59,62:62}],138:[function(t,n,r){"use strict";var e=t(40),i=t(19)(!1),o=[].indexOf,u=!!o&&1/[1].indexOf(1,-0)<0;e(e.P+e.F*(u||!t(104)(o)),"Array",{indexOf:function indexOf(t){return u?o.apply(this,arguments)||0:i(this,t,arguments[1])}})},{104:104,19:19,40:40}],139:[function(t,n,r){var e=t(40);e(e.S,"Array",{isArray:t(55)})},{40:40,55:55}],140:[function(t,n,r){"use strict";var e=t(13),i=t(63),o=t(64),u=t(116);n.exports=t(61)(Array,"Array",function(t,n){this._t=u(t),this._i=0,this._k=n},function(){var t=this._t,n=this._k,r=this._i++;return!t||r>=t.length?(this._t=void 0,i(1)):"keys"==n?i(0,r):"values"==n?i(0,t[r]):i(0,[r,t[r]])},"values"),o.Arguments=o.Array,e("keys"),e("values"),e("entries")},{116:116,13:13,61:61,63:63,64:64}],141:[function(t,n,r){"use strict";var e=t(40),i=t(116),o=[].join;e(e.P+e.F*(t(53)!=Object||!t(104)(o)),"Array",{join:function join(t){return o.call(i(this),void 0===t?",":t)}})},{104:104,116:116,40:40,53:53}],142:[function(t,n,r){"use strict";var e=t(40),i=t(116),o=t(115),u=t(117),c=[].lastIndexOf,a=!!c&&1/[1].lastIndexOf(1,-0)<0;e(e.P+e.F*(a||!t(104)(c)),"Array",{lastIndexOf:function lastIndexOf(t){if(a)return c.apply(this,arguments)||0;var n=i(this),r=u(n.length),e=r-1;for(arguments.length>1&&(e=Math.min(e,o(arguments[1]))),e<0&&(e=r+e);e>=0;e--)if(e in n&&n[e]===t)return e||0;return-1}})},{104:104,115:115,116:116,117:117,40:40}],143:[function(t,n,r){"use strict";var e=t(40),i=t(20)(1);e(e.P+e.F*!t(104)([].map,!0),"Array",{map:function map(t){return i(this,t,arguments[1])}})},{104:104,20:20,40:40}],144:[function(t,n,r){"use strict";var e=t(40),i=t(31);e(e.S+e.F*t(42)(function(){function F(){}return!(Array.of.call(F)instanceof F)}),"Array",{of:function of(){for(var t=0,n=arguments.length,r=new("function"==typeof this?this:Array)(n);n>t;)i(r,t,arguments[t++]);return r.length=n,r}})},{31:31,40:40,42:42}],145:[function(t,n,r){"use strict";var e=t(40),i=t(21);e(e.P+e.F*!t(104)([].reduceRight,!0),"Array",{reduceRight:function reduceRight(t){return i(this,t,arguments.length,arguments[1],!0)}})},{104:104,21:21,40:40}],146:[function(t,n,r){"use strict";var e=t(40),i=t(21);e(e.P+e.F*!t(104)([].reduce,!0),"Array",{reduce:function reduce(t){return i(this,t,arguments.length,arguments[1],!1)}})},{104:104,21:21,40:40}],147:[function(t,n,r){"use strict";var e=t(40),i=t(49),o=t(26),u=t(113),c=t(117),a=[].slice;e(e.P+e.F*t(42)(function(){i&&a.call(i)}),"Array",{slice:function slice(t,n){var r=c(this.length),e=o(this);if(n=void 0===n?r:n,"Array"==e)return a.call(this,t,n);for(var i=u(t,r),f=u(n,r),s=c(f-i),l=new Array(s),h=0;h<s;h++)l[h]="String"==e?this.charAt(i+h):this[i+h];return l}})},{113:113,117:117,26:26,40:40,42:42,49:49}],148:[function(t,n,r){"use strict";var e=t(40),i=t(20)(3);e(e.P+e.F*!t(104)([].some,!0),"Array",{some:function some(t){return i(this,t,arguments[1])}})},{104:104,20:20,40:40}],149:[function(t,n,r){"use strict";var e=t(40),i=t(11),o=t(118),u=t(42),c=[].sort,a=[1,2,3];e(e.P+e.F*(u(function(){a.sort(void 0)})||!u(function(){a.sort(null)})||!t(104)(c)),"Array",{sort:function sort(t){return void 0===t?c.call(o(this)):c.call(o(this),i(t))}})},{104:104,11:11,118:118,40:40,42:42}],150:[function(t,n,r){t(99)("Array")},{99:99}],151:[function(t,n,r){var e=t(40);e(e.S,"Date",{now:function(){return(new Date).getTime()}})},{40:40}],152:[function(t,n,r){var e=t(40),i=t(33);e(e.P+e.F*(Date.prototype.toISOString!==i),"Date",{toISOString:i})},{33:33,40:40}],153:[function(t,n,r){"use strict";var e=t(40),i=t(118),o=t(119);e(e.P+e.F*t(42)(function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}),"Date",{toJSON:function toJSON(t){var n=i(this),r=o(n);return"number"!=typeof r||isFinite(r)?n.toISOString():null}})},{118:118,119:119,40:40,42:42}],154:[function(t,n,r){var e=t(128)("toPrimitive"),i=Date.prototype;e in i||t(48)(i,e,t(34))},{128:128,34:34,48:48}],155:[function(t,n,r){var e=Date.prototype,i=e.toString,o=e.getTime;new Date(NaN)+""!="Invalid Date"&&t(94)(e,"toString",function toString(){var t=o.call(this);return t===t?i.call(this):"Invalid Date"})},{94:94}],156:[function(t,n,r){var e=t(40);e(e.P,"Function",{bind:t(24)})},{24:24,40:40}],157:[function(t,n,r){"use strict";var e=t(57),i=t(81),o=t(128)("hasInstance"),u=Function.prototype;o in u||t(75).f(u,o,{value:function(t){if("function"!=typeof this||!e(t))return!1;if(!e(this.prototype))return t instanceof this;for(;t=i(t);)if(this.prototype===t)return!0;return!1}})},{128:128,57:57,75:75,81:81}],158:[function(t,n,r){var e=t(75).f,i=Function.prototype,o=/^\s*function ([^ (]*)/;"name"in i||t(36)&&e(i,"name",{configurable:!0,get:function(){try{return(""+this).match(o)[1]}catch(t){return""}}})},{36:36,75:75}],159:[function(t,n,r){"use strict";var e=t(27),i=t(125);n.exports=t(29)("Map",function(t){return function Map(){return t(this,arguments.length>0?arguments[0]:void 0)}},{get:function get(t){var n=e.getEntry(i(this,"Map"),t);return n&&n.v},set:function set(t,n){return e.def(i(this,"Map"),0===t?0:t,n)}},e,!0)},{125:125,27:27,29:29}],160:[function(t,n,r){var e=t(40),i=t(68),o=Math.sqrt,u=Math.acosh;e(e.S+e.F*!(u&&710==Math.floor(u(Number.MAX_VALUE))&&u(1/0)==1/0),"Math",{acosh:function acosh(t){return(t=+t)<1?NaN:t>94906265.62425156?Math.log(t)+Math.LN2:i(t-1+o(t-1)*o(t+1))}})},{40:40,68:68}],161:[function(t,n,r){function asinh(t){return isFinite(t=+t)&&0!=t?t<0?-asinh(-t):Math.log(t+Math.sqrt(t*t+1)):t}var e=t(40),i=Math.asinh;e(e.S+e.F*!(i&&1/i(0)>0),"Math",{asinh:asinh})},{40:40}],162:[function(t,n,r){var e=t(40),i=Math.atanh;e(e.S+e.F*!(i&&1/i(-0)<0),"Math",{atanh:function atanh(t){return 0==(t=+t)?t:Math.log((1+t)/(1-t))/2}})},{40:40}],163:[function(t,n,r){var e=t(40),i=t(69);e(e.S,"Math",{cbrt:function cbrt(t){return i(t=+t)*Math.pow(Math.abs(t),1/3)}})},{40:40,69:69}],164:[function(t,n,r){var e=t(40);e(e.S,"Math",{clz32:function clz32(t){return(t>>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},{40:40}],165:[function(t,n,r){var e=t(40),i=Math.exp;e(e.S,"Math",{cosh:function cosh(t){return(i(t=+t)+i(-t))/2}})},{40:40}],166:[function(t,n,r){var e=t(40),i=t(66);e(e.S+e.F*(i!=Math.expm1),"Math",{expm1:i})},{40:40,66:66}],167:[function(t,n,r){var e=t(40);e(e.S,"Math",{fround:t(67)})},{40:40,67:67}],168:[function(t,n,r){var e=t(40),i=Math.abs;e(e.S,"Math",{hypot:function hypot(t,n){for(var r,e,o=0,u=0,c=arguments.length,a=0;u<c;)r=i(arguments[u++]),a<r?(e=a/r,o=o*e*e+1,a=r):r>0?(e=r/a,o+=e*e):o+=r;return a===1/0?1/0:a*Math.sqrt(o)}})},{40:40}],169:[function(t,n,r){var e=t(40),i=Math.imul;e(e.S+e.F*t(42)(function(){return-5!=i(4294967295,5)||2!=i.length}),"Math",{imul:function imul(t,n){var r=+t,e=+n,i=65535&r,o=65535&e;return 0|i*o+((65535&r>>>16)*o+i*(65535&e>>>16)<<16>>>0)}})},{40:40,42:42}],170:[function(t,n,r){var e=t(40);e(e.S,"Math",{log10:function log10(t){return Math.log(t)*Math.LOG10E}})},{40:40}],171:[function(t,n,r){var e=t(40);e(e.S,"Math",{log1p:t(68)})},{40:40,68:68}],172:[function(t,n,r){var e=t(40);e(e.S,"Math",{log2:function log2(t){return Math.log(t)/Math.LN2}})},{40:40}],173:[function(t,n,r){var e=t(40);e(e.S,"Math",{sign:t(69)})},{40:40,69:69}],174:[function(t,n,r){var e=t(40),i=t(66),o=Math.exp;e(e.S+e.F*t(42)(function(){return-2e-17!=!Math.sinh(-2e-17)}),"Math",{sinh:function sinh(t){return Math.abs(t=+t)<1?(i(t)-i(-t))/2:(o(t-1)-o(-t-1))*(Math.E/2)}})},{40:40,42:42,66:66}],175:[function(t,n,r){var e=t(40),i=t(66),o=Math.exp;e(e.S,"Math",{tanh:function tanh(t){var n=i(t=+t),r=i(-t);return n==1/0?1:r==1/0?-1:(n-r)/(o(t)+o(-t))}})},{40:40,66:66}],176:[function(t,n,r){var e=t(40);e(e.S,"Math",{trunc:function trunc(t){return(t>0?Math.floor:Math.ceil)(t)}})},{40:40}],177:[function(t,n,r){"use strict";var e=t(46),i=t(47),o=t(26),u=t(51),c=t(119),a=t(42),f=t(79).f,s=t(77).f,l=t(75).f,h=t(110).trim,p=e.Number,v=p,d=p.prototype,y="Number"==o(t(74)(d)),g="trim"in String.prototype,x=function(t){var n=c(t,!1);if("string"==typeof n&&n.length>2){n=g?n.trim():h(n,3);var r,e,i,o=n.charCodeAt(0);if(43===o||45===o){if(88===(r=n.charCodeAt(2))||120===r)return NaN}else if(48===o){switch(n.charCodeAt(1)){case 66:case 98:e=2,i=49;break;case 79:case 111:e=8,i=55;break;default:return+n}for(var u,a=n.slice(2),f=0,s=a.length;f<s;f++)if((u=a.charCodeAt(f))<48||u>i)return NaN;return parseInt(a,e)}}return+n};if(!p(" 0o1")||!p("0b1")||p("+0x1")){p=function Number(t){var n=arguments.length<1?0:t,r=this;return r instanceof p&&(y?a(function(){d.valueOf.call(r)}):"Number"!=o(r))?u(new v(x(n)),r,p):x(n)};for(var m,b=t(36)?f(v):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),S=0;b.length>S;S++)i(v,m=b[S])&&!i(p,m)&&l(p,m,s(v,m));p.prototype=d,d.constructor=p,t(94)(e,"Number",p)}},{110:110,119:119,26:26,36:36,42:42,46:46,47:47,51:51,74:74,75:75,77:77,79:79,94:94}],178:[function(t,n,r){var e=t(40);e(e.S,"Number",{EPSILON:Math.pow(2,-52)})},{40:40}],179:[function(t,n,r){var e=t(40),i=t(46).isFinite;e(e.S,"Number",{isFinite:function isFinite(t){return"number"==typeof t&&i(t)}})},{40:40,46:46}],180:[function(t,n,r){var e=t(40);e(e.S,"Number",{isInteger:t(56)})},{40:40,56:56}],181:[function(t,n,r){var e=t(40);e(e.S,"Number",{isNaN:function isNaN(t){return t!=t}})},{40:40}],182:[function(t,n,r){var e=t(40),i=t(56),o=Math.abs;e(e.S,"Number",{isSafeInteger:function isSafeInteger(t){return i(t)&&o(t)<=9007199254740991}})},{40:40,56:56}],183:[function(t,n,r){var e=t(40);e(e.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},{40:40}],184:[function(t,n,r){var e=t(40);e(e.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},{40:40}],185:[function(t,n,r){var e=t(40),i=t(88);e(e.S+e.F*(Number.parseFloat!=i),"Number",{parseFloat:i})},{40:40,88:88}],186:[function(t,n,r){var e=t(40),i=t(89);e(e.S+e.F*(Number.parseInt!=i),"Number",{parseInt:i})},{40:40,89:89}],187:[function(t,n,r){"use strict";var e=t(40),i=t(115),o=t(12),u=t(109),c=1..toFixed,a=Math.floor,f=[0,0,0,0,0,0],s="Number.toFixed: incorrect invocation!",l=function(t,n){for(var r=-1,e=n;++r<6;)e+=t*f[r],f[r]=e%1e7,e=a(e/1e7)},h=function(t){for(var n=6,r=0;--n>=0;)r+=f[n],f[n]=a(r/t),r=r%t*1e7},p=function(){for(var t=6,n="";--t>=0;)if(""!==n||0===t||0!==f[t]){var r=String(f[t]);n=""===n?r:n+u.call("0",7-r.length)+r}return n},v=function(t,n,r){return 0===n?r:n%2==1?v(t,n-1,r*t):v(t*t,n/2,r)},d=function(t){for(var n=0,r=t;r>=4096;)n+=12,r/=4096;for(;r>=2;)n+=1,r/=2;return n};e(e.P+e.F*(!!c&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!t(42)(function(){c.call({})})),"Number",{toFixed:function toFixed(t){var n,r,e,c,a=o(this,s),f=i(t),y="",g="0";if(f<0||f>20)throw RangeError(s);if(a!=a)return"NaN";if(a<=-1e21||a>=1e21)return String(a);if(a<0&&(y="-",a=-a),a>1e-21)if(n=d(a*v(2,69,1))-69,r=n<0?a*v(2,-n,1):a/v(2,n,1),r*=4503599627370496,(n=52-n)>0){for(l(0,r),e=f;e>=7;)l(1e7,0),e-=7;for(l(v(10,e,1),0),e=n-1;e>=23;)h(1<<23),e-=23;h(1<<e),l(1,1),h(2),g=p()}else l(0,r),l(1<<-n,0),g=p()+u.call("0",f);return f>0?(c=g.length,g=y+(c<=f?"0."+u.call("0",f-c)+g:g.slice(0,c-f)+"."+g.slice(c-f))):g=y+g,g}})},{109:109,115:115,12:12,40:40,42:42}],188:[function(t,n,r){"use strict";var e=t(40),i=t(42),o=t(12),u=1..toPrecision;e(e.P+e.F*(i(function(){return"1"!==u.call(1,void 0)})||!i(function(){u.call({})})),"Number",{toPrecision:function toPrecision(t){var n=o(this,"Number#toPrecision: incorrect invocation!");return void 0===t?u.call(n):u.call(n,t)}})},{12:12,40:40,42:42}],189:[function(t,n,r){var e=t(40);e(e.S+e.F,"Object",{assign:t(73)})},{40:40,73:73}],190:[function(t,n,r){var e=t(40);e(e.S,"Object",{create:t(74)})},{40:40,74:74}],191:[function(t,n,r){var e=t(40);e(e.S+e.F*!t(36),"Object",{defineProperties:t(76)})},{36:36,40:40,76:76}],192:[function(t,n,r){var e=t(40);e(e.S+e.F*!t(36),"Object",{defineProperty:t(75).f})},{36:36,40:40,75:75}],193:[function(t,n,r){var e=t(57),i=t(70).onFreeze;t(85)("freeze",function(t){return function freeze(n){return t&&e(n)?t(i(n)):n}})},{57:57,70:70,85:85}],194:[function(t,n,r){var e=t(116),i=t(77).f;t(85)("getOwnPropertyDescriptor",function(){return function getOwnPropertyDescriptor(t,n){return i(e(t),n)}})},{116:116,77:77,85:85}],195:[function(t,n,r){t(85)("getOwnPropertyNames",function(){return t(78).f})},{78:78,85:85}],196:[function(t,n,r){var e=t(118),i=t(81);t(85)("getPrototypeOf",function(){return function getPrototypeOf(t){return i(e(t))}})},{118:118,81:81,85:85}],197:[function(t,n,r){var e=t(57);t(85)("isExtensible",function(t){return function isExtensible(n){return!!e(n)&&(!t||t(n))}})},{57:57,85:85}],198:[function(t,n,r){var e=t(57);t(85)("isFrozen",function(t){return function isFrozen(n){return!e(n)||!!t&&t(n)}})},{57:57,85:85}],199:[function(t,n,r){var e=t(57);t(85)("isSealed",function(t){return function isSealed(n){return!e(n)||!!t&&t(n)}})},{57:57,85:85}],200:[function(t,n,r){var e=t(40);e(e.S,"Object",{is:t(97)})},{40:40,97:97}],201:[function(t,n,r){var e=t(118),i=t(83);t(85)("keys",function(){return function keys(t){return i(e(t))}})},{118:118,83:83,85:85}],202:[function(t,n,r){var e=t(57),i=t(70).onFreeze;t(85)("preventExtensions",function(t){return function preventExtensions(n){return t&&e(n)?t(i(n)):n}})},{57:57,70:70,85:85}],203:[function(t,n,r){var e=t(57),i=t(70).onFreeze;t(85)("seal",function(t){return function seal(n){return t&&e(n)?t(i(n)):n}})},{57:57,70:70,85:85}],204:[function(t,n,r){var e=t(40);e(e.S,"Object",{setPrototypeOf:t(98).set})},{40:40,98:98}],205:[function(t,n,r){"use strict";var e=t(25),i={};i[t(128)("toStringTag")]="z",i+""!="[object z]"&&t(94)(Object.prototype,"toString",function toString(){return"[object "+e(this)+"]"},!0)},{128:128,25:25,94:94}],206:[function(t,n,r){var e=t(40),i=t(88);e(e.G+e.F*(parseFloat!=i),{parseFloat:i})},{40:40,88:88}],207:[function(t,n,r){var e=t(40),i=t(89);e(e.G+e.F*(parseInt!=i),{parseInt:i})},{40:40,89:89}],208:[function(t,n,r){"use strict";var e,i,o,u,c=t(65),a=t(46),f=t(32),s=t(25),l=t(40),h=t(57),p=t(11),v=t(15),d=t(45),y=t(103),g=t(112).set,x=t(71)(),m=t(72),b=t(90),S=t(124),w=t(91),_=a.TypeError,E=a.process,F=E&&E.versions,I=F&&F.v8||"",O=a.Promise,P="process"==s(E),A=function(){},M=i=m.f,k=!!function(){try{var n=O.resolve(1),r=(n.constructor={})[t(128)("species")]=function(t){t(A,A)};return(P||"function"==typeof PromiseRejectionEvent)&&n.then(A)instanceof r&&0!==I.indexOf("6.6")&&-1===S.indexOf("Chrome/66")}catch(t){}}(),N=function(t){var n;return!(!h(t)||"function"!=typeof(n=t.then))&&n},j=function(t,n){if(!t._n){t._n=!0;var r=t._c;x(function(){for(var e=t._v,i=1==t._s,o=0;r.length>o;)!function(n){var r,o,u,c=i?n.ok:n.fail,a=n.resolve,f=n.reject,s=n.domain;try{c?(i||(2==t._h&&R(t),t._h=1),!0===c?r=e:(s&&s.enter(),r=c(e),s&&(s.exit(),u=!0)),r===n.promise?f(_("Promise-chain cycle")):(o=N(r))?o.call(r,a,f):a(r)):f(e)}catch(t){s&&!u&&s.exit(),f(t)}}(r[o++]);t._c=[],t._n=!1,n&&!t._h&&T(t)})}},T=function(t){g.call(a,function(){var n,r,e,i=t._v,o=L(t);if(o&&(n=b(function(){P?E.emit("unhandledRejection",i,t):(r=a.onunhandledrejection)?r({promise:t,reason:i}):(e=a.console)&&e.error&&e.error("Unhandled promise rejection",i)}),t._h=P||L(t)?2:1),t._a=void 0,o&&n.e)throw n.v})},L=function(t){return 1!==t._h&&0===(t._a||t._c).length},R=function(t){g.call(a,function(){var n;P?E.emit("rejectionHandled",t):(n=a.onrejectionhandled)&&n({promise:t,reason:t._v})})},C=function(t){var n=this;n._d||(n._d=!0,n=n._w||n,n._v=t,n._s=2,n._a||(n._a=n._c.slice()),j(n,!0))},D=function(t){var n,r=this;if(!r._d){r._d=!0,r=r._w||r;try{if(r===t)throw _("Promise can't be resolved itself")
;(n=N(t))?x(function(){var e={_w:r,_d:!1};try{n.call(t,f(D,e,1),f(C,e,1))}catch(t){C.call(e,t)}}):(r._v=t,r._s=1,j(r,!1))}catch(t){C.call({_w:r,_d:!1},t)}}};k||(O=function Promise(t){v(this,O,"Promise","_h"),p(t),e.call(this);try{t(f(D,this,1),f(C,this,1))}catch(t){C.call(this,t)}},e=function Promise(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},e.prototype=t(93)(O.prototype,{then:function then(t,n){var r=M(y(this,O));return r.ok="function"!=typeof t||t,r.fail="function"==typeof n&&n,r.domain=P?E.domain:void 0,this._c.push(r),this._a&&this._a.push(r),this._s&&j(this,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new e;this.promise=t,this.resolve=f(D,t,1),this.reject=f(C,t,1)},m.f=M=function(t){return t===O||t===u?new o(t):i(t)}),l(l.G+l.W+l.F*!k,{Promise:O}),t(100)(O,"Promise"),t(99)("Promise"),u=t(30).Promise,l(l.S+l.F*!k,"Promise",{reject:function reject(t){var n=M(this);return(0,n.reject)(t),n.promise}}),l(l.S+l.F*(c||!k),"Promise",{resolve:function resolve(t){return w(c&&this===u?O:this,t)}}),l(l.S+l.F*!(k&&t(62)(function(t){O.all(t).catch(A)})),"Promise",{all:function all(t){var n=this,r=M(n),e=r.resolve,i=r.reject,o=b(function(){var r=[],o=0,u=1;d(t,!1,function(t){var c=o++,a=!1;r.push(void 0),u++,n.resolve(t).then(function(t){a||(a=!0,r[c]=t,--u||e(r))},i)}),--u||e(r)});return o.e&&i(o.v),r.promise},race:function race(t){var n=this,r=M(n),e=r.reject,i=b(function(){d(t,!1,function(t){n.resolve(t).then(r.resolve,e)})});return i.e&&e(i.v),r.promise}})},{100:100,103:103,11:11,112:112,124:124,128:128,15:15,25:25,30:30,32:32,40:40,45:45,46:46,57:57,62:62,65:65,71:71,72:72,90:90,91:91,93:93,99:99}],209:[function(t,n,r){var e=t(40),i=t(11),o=t(16),u=(t(46).Reflect||{}).apply,c=Function.apply;e(e.S+e.F*!t(42)(function(){u(function(){})}),"Reflect",{apply:function apply(t,n,r){var e=i(t),a=o(r);return u?u(e,n,a):c.call(e,n,a)}})},{11:11,16:16,40:40,42:42,46:46}],210:[function(t,n,r){var e=t(40),i=t(74),o=t(11),u=t(16),c=t(57),a=t(42),f=t(24),s=(t(46).Reflect||{}).construct,l=a(function(){function F(){}return!(s(function(){},[],F)instanceof F)}),h=!a(function(){s(function(){})});e(e.S+e.F*(l||h),"Reflect",{construct:function construct(t,n){o(t),u(n);var r=arguments.length<3?t:o(arguments[2]);if(h&&!l)return s(t,n,r);if(t==r){switch(n.length){case 0:return new t;case 1:return new t(n[0]);case 2:return new t(n[0],n[1]);case 3:return new t(n[0],n[1],n[2]);case 4:return new t(n[0],n[1],n[2],n[3])}var e=[null];return e.push.apply(e,n),new(f.apply(t,e))}var a=r.prototype,p=i(c(a)?a:Object.prototype),v=Function.apply.call(t,p,n);return c(v)?v:p}})},{11:11,16:16,24:24,40:40,42:42,46:46,57:57,74:74}],211:[function(t,n,r){var e=t(75),i=t(40),o=t(16),u=t(119);i(i.S+i.F*t(42)(function(){Reflect.defineProperty(e.f({},1,{value:1}),1,{value:2})}),"Reflect",{defineProperty:function defineProperty(t,n,r){o(t),n=u(n,!0),o(r);try{return e.f(t,n,r),!0}catch(t){return!1}}})},{119:119,16:16,40:40,42:42,75:75}],212:[function(t,n,r){var e=t(40),i=t(77).f,o=t(16);e(e.S,"Reflect",{deleteProperty:function deleteProperty(t,n){var r=i(o(t),n);return!(r&&!r.configurable)&&delete t[n]}})},{16:16,40:40,77:77}],213:[function(t,n,r){"use strict";var e=t(40),i=t(16),o=function(t){this._t=i(t),this._i=0;var n,r=this._k=[];for(n in t)r.push(n)};t(60)(o,"Object",function(){var t,n=this,r=n._k;do{if(n._i>=r.length)return{value:void 0,done:!0}}while(!((t=r[n._i++])in n._t));return{value:t,done:!1}}),e(e.S,"Reflect",{enumerate:function enumerate(t){return new o(t)}})},{16:16,40:40,60:60}],214:[function(t,n,r){var e=t(77),i=t(40),o=t(16);i(i.S,"Reflect",{getOwnPropertyDescriptor:function getOwnPropertyDescriptor(t,n){return e.f(o(t),n)}})},{16:16,40:40,77:77}],215:[function(t,n,r){var e=t(40),i=t(81),o=t(16);e(e.S,"Reflect",{getPrototypeOf:function getPrototypeOf(t){return i(o(t))}})},{16:16,40:40,81:81}],216:[function(t,n,r){function get(t,n){var r,u,f=arguments.length<3?t:arguments[2];return a(t)===f?t[n]:(r=e.f(t,n))?o(r,"value")?r.value:void 0!==r.get?r.get.call(f):void 0:c(u=i(t))?get(u,n,f):void 0}var e=t(77),i=t(81),o=t(47),u=t(40),c=t(57),a=t(16);u(u.S,"Reflect",{get:get})},{16:16,40:40,47:47,57:57,77:77,81:81}],217:[function(t,n,r){var e=t(40);e(e.S,"Reflect",{has:function has(t,n){return n in t}})},{40:40}],218:[function(t,n,r){var e=t(40),i=t(16),o=Object.isExtensible;e(e.S,"Reflect",{isExtensible:function isExtensible(t){return i(t),!o||o(t)}})},{16:16,40:40}],219:[function(t,n,r){var e=t(40);e(e.S,"Reflect",{ownKeys:t(87)})},{40:40,87:87}],220:[function(t,n,r){var e=t(40),i=t(16),o=Object.preventExtensions;e(e.S,"Reflect",{preventExtensions:function preventExtensions(t){i(t);try{return o&&o(t),!0}catch(t){return!1}}})},{16:16,40:40}],221:[function(t,n,r){var e=t(40),i=t(98);i&&e(e.S,"Reflect",{setPrototypeOf:function setPrototypeOf(t,n){i.check(t,n);try{return i.set(t,n),!0}catch(t){return!1}}})},{40:40,98:98}],222:[function(t,n,r){function set(t,n,r){var c,l,h=arguments.length<4?t:arguments[3],p=i.f(f(t),n);if(!p){if(s(l=o(t)))return set(l,n,r,h);p=a(0)}if(u(p,"value")){if(!1===p.writable||!s(h))return!1;if(c=i.f(h,n)){if(c.get||c.set||!1===c.writable)return!1;c.value=r,e.f(h,n,c)}else e.f(h,n,a(0,r));return!0}return void 0!==p.set&&(p.set.call(h,r),!0)}var e=t(75),i=t(77),o=t(81),u=t(47),c=t(40),a=t(92),f=t(16),s=t(57);c(c.S,"Reflect",{set:set})},{16:16,40:40,47:47,57:57,75:75,77:77,81:81,92:92}],223:[function(t,n,r){var e=t(46),i=t(51),o=t(75).f,u=t(79).f,c=t(58),a=t(44),f=e.RegExp,s=f,l=f.prototype,h=/a/g,p=/a/g,v=new f(h)!==h;if(t(36)&&(!v||t(42)(function(){return p[t(128)("match")]=!1,f(h)!=h||f(p)==p||"/a/i"!=f(h,"i")}))){f=function RegExp(t,n){var r=this instanceof f,e=c(t),o=void 0===n;return!r&&e&&t.constructor===f&&o?t:i(v?new s(e&&!o?t.source:t,n):s((e=t instanceof f)?t.source:t,e&&o?a.call(t):n),r?this:l,f)};for(var d=u(s),y=0;d.length>y;)!function(t){t in f||o(f,t,{configurable:!0,get:function(){return s[t]},set:function(n){s[t]=n}})}(d[y++]);l.constructor=f,f.prototype=l,t(94)(e,"RegExp",f)}t(99)("RegExp")},{128:128,36:36,42:42,44:44,46:46,51:51,58:58,75:75,79:79,94:94,99:99}],224:[function(t,n,r){"use strict";var e=t(96);t(40)({target:"RegExp",proto:!0,forced:e!==/./.exec},{exec:e})},{40:40,96:96}],225:[function(t,n,r){t(36)&&"g"!=/./g.flags&&t(75).f(RegExp.prototype,"flags",{configurable:!0,get:t(44)})},{36:36,44:44,75:75}],226:[function(t,n,r){"use strict";var e=t(16),i=t(117),o=t(14),u=t(95);t(43)("match",1,function(t,n,r,c){return[function match(r){var e=t(this),i=void 0==r?void 0:r[n];return void 0!==i?i.call(r,e):new RegExp(r)[n](String(e))},function(t){var n=c(r,t,this);if(n.done)return n.value;var a=e(t),f=String(this);if(!a.global)return u(a,f);var s=a.unicode;a.lastIndex=0;for(var l,h=[],p=0;null!==(l=u(a,f));){var v=String(l[0]);h[p]=v,""===v&&(a.lastIndex=o(f,i(a.lastIndex),s)),p++}return 0===p?null:h}]})},{117:117,14:14,16:16,43:43,95:95}],227:[function(t,n,r){"use strict";var e=t(16),i=t(118),o=t(117),u=t(115),c=t(14),a=t(95),f=Math.max,s=Math.min,l=Math.floor,h=/\$([$&`']|\d\d?|<[^>]*>)/g,p=/\$([$&`']|\d\d?)/g,v=function(t){return void 0===t?t:String(t)};t(43)("replace",2,function(t,n,r,d){function getSubstitution(t,n,e,o,u,c){var a=e+t.length,f=o.length,s=p;return void 0!==u&&(u=i(u),s=h),r.call(c,s,function(r,i){var c;switch(i.charAt(0)){case"$":return"$";case"&":return t;case"`":return n.slice(0,e);case"'":return n.slice(a);case"<":c=u[i.slice(1,-1)];break;default:var s=+i;if(0===s)return i;if(s>f){var h=l(s/10);return 0===h?i:h<=f?void 0===o[h-1]?i.charAt(1):o[h-1]+i.charAt(1):i}c=o[s-1]}return void 0===c?"":c})}return[function replace(e,i){var o=t(this),u=void 0==e?void 0:e[n];return void 0!==u?u.call(e,o,i):r.call(String(o),e,i)},function(t,n){var i=d(r,t,this,n);if(i.done)return i.value;var l=e(t),h=String(this),p="function"==typeof n;p||(n=String(n));var y=l.global;if(y){var g=l.unicode;l.lastIndex=0}for(var x=[];;){var m=a(l,h);if(null===m)break;if(x.push(m),!y)break;""===String(m[0])&&(l.lastIndex=c(h,o(l.lastIndex),g))}for(var b="",S=0,w=0;w<x.length;w++){m=x[w];for(var _=String(m[0]),E=f(s(u(m.index),h.length),0),F=[],I=1;I<m.length;I++)F.push(v(m[I]));var O=m.groups;if(p){var P=[_].concat(F,E,h);void 0!==O&&P.push(O);var A=String(n.apply(void 0,P))}else A=getSubstitution(_,h,E,F,O,n);E>=S&&(b+=h.slice(S,E)+A,S=E+_.length)}return b+h.slice(S)}]})},{115:115,117:117,118:118,14:14,16:16,43:43,95:95}],228:[function(t,n,r){"use strict";var e=t(16),i=t(97),o=t(95);t(43)("search",1,function(t,n,r,u){return[function search(r){var e=t(this),i=void 0==r?void 0:r[n];return void 0!==i?i.call(r,e):new RegExp(r)[n](String(e))},function(t){var n=u(r,t,this);if(n.done)return n.value;var c=e(t),a=String(this),f=c.lastIndex;i(f,0)||(c.lastIndex=0);var s=o(c,a);return i(c.lastIndex,f)||(c.lastIndex=f),null===s?-1:s.index}]})},{16:16,43:43,95:95,97:97}],229:[function(t,n,r){"use strict";var e=t(58),i=t(16),o=t(103),u=t(14),c=t(117),a=t(95),f=t(96),s=Math.min,l=[].push,h="length",p=!!function(){try{return new RegExp("x","y")}catch(t){}}();t(43)("split",2,function(t,n,r,v){var d;return d="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1)[h]||2!="ab".split(/(?:ab)*/)[h]||4!=".".split(/(.?)(.?)/)[h]||".".split(/()()/)[h]>1||"".split(/.?/)[h]?function(t,n){var i=String(this);if(void 0===t&&0===n)return[];if(!e(t))return r.call(i,t,n);for(var o,u,c,a=[],s=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),p=0,v=void 0===n?4294967295:n>>>0,d=new RegExp(t.source,s+"g");(o=f.call(d,i))&&!((u=d.lastIndex)>p&&(a.push(i.slice(p,o.index)),o[h]>1&&o.index<i[h]&&l.apply(a,o.slice(1)),c=o[0][h],p=u,a[h]>=v));)d.lastIndex===o.index&&d.lastIndex++;return p===i[h]?!c&&d.test("")||a.push(""):a.push(i.slice(p)),a[h]>v?a.slice(0,v):a}:"0".split(void 0,0)[h]?function(t,n){return void 0===t&&0===n?[]:r.call(this,t,n)}:r,[function split(r,e){var i=t(this),o=void 0==r?void 0:r[n];return void 0!==o?o.call(r,i,e):d.call(String(i),r,e)},function(t,n){var e=v(d,t,this,n,d!==r);if(e.done)return e.value;var f=i(t),l=String(this),h=o(f,RegExp),y=f.unicode,g=(f.ignoreCase?"i":"")+(f.multiline?"m":"")+(f.unicode?"u":"")+(p?"y":"g"),x=new h(p?f:"^(?:"+f.source+")",g),m=void 0===n?4294967295:n>>>0;if(0===m)return[];if(0===l.length)return null===a(x,l)?[l]:[];for(var b=0,S=0,w=[];S<l.length;){x.lastIndex=p?S:0;var _,E=a(x,p?l:l.slice(S));if(null===E||(_=s(c(x.lastIndex+(p?0:S)),l.length))===b)S=u(l,S,y);else{if(w.push(l.slice(b,S)),w.length===m)return w;for(var F=1;F<=E.length-1;F++)if(w.push(E[F]),w.length===m)return w;S=b=_}}return w.push(l.slice(b)),w}]})},{103:103,117:117,14:14,16:16,43:43,58:58,95:95,96:96}],230:[function(t,n,r){"use strict";t(225);var e=t(16),i=t(44),o=t(36),u=/./.toString,c=function(n){t(94)(RegExp.prototype,"toString",n,!0)};t(42)(function(){return"/a/b"!=u.call({source:"a",flags:"b"})})?c(function toString(){var t=e(this);return"/".concat(t.source,"/","flags"in t?t.flags:!o&&t instanceof RegExp?i.call(t):void 0)}):"toString"!=u.name&&c(function toString(){return u.call(this)})},{16:16,225:225,36:36,42:42,44:44,94:94}],231:[function(t,n,r){"use strict";var e=t(27),i=t(125);n.exports=t(29)("Set",function(t){return function Set(){return t(this,arguments.length>0?arguments[0]:void 0)}},{add:function add(t){return e.def(i(this,"Set"),t=0===t?0:t,t)}},e)},{125:125,27:27,29:29}],232:[function(t,n,r){"use strict";t(107)("anchor",function(t){return function anchor(n){return t(this,"a","name",n)}})},{107:107}],233:[function(t,n,r){"use strict";t(107)("big",function(t){return function big(){return t(this,"big","","")}})},{107:107}],234:[function(t,n,r){"use strict";t(107)("blink",function(t){return function blink(){return t(this,"blink","","")}})},{107:107}],235:[function(t,n,r){"use strict";t(107)("bold",function(t){return function bold(){return t(this,"b","","")}})},{107:107}],236:[function(t,n,r){"use strict";var e=t(40),i=t(105)(!1);e(e.P,"String",{codePointAt:function codePointAt(t){return i(this,t)}})},{105:105,40:40}],237:[function(t,n,r){"use strict";var e=t(40),i=t(117),o=t(106),u="".endsWith;e(e.P+e.F*t(41)("endsWith"),"String",{endsWith:function endsWith(t){var n=o(this,t,"endsWith"),r=arguments.length>1?arguments[1]:void 0,e=i(n.length),c=void 0===r?e:Math.min(i(r),e),a=String(t);return u?u.call(n,a,c):n.slice(c-a.length,c)===a}})},{106:106,117:117,40:40,41:41}],238:[function(t,n,r){"use strict";t(107)("fixed",function(t){return function fixed(){return t(this,"tt","","")}})},{107:107}],239:[function(t,n,r){"use strict";t(107)("fontcolor",function(t){return function fontcolor(n){return t(this,"font","color",n)}})},{107:107}],240:[function(t,n,r){"use strict";t(107)("fontsize",function(t){return function fontsize(n){return t(this,"font","size",n)}})},{107:107}],241:[function(t,n,r){var e=t(40),i=t(113),o=String.fromCharCode,u=String.fromCodePoint;e(e.S+e.F*(!!u&&1!=u.length),"String",{fromCodePoint:function fromCodePoint(t){for(var n,r=[],e=arguments.length,u=0;e>u;){if(n=+arguments[u++],i(n,1114111)!==n)throw RangeError(n+" is not a valid code point");r.push(n<65536?o(n):o(55296+((n-=65536)>>10),n%1024+56320))}return r.join("")}})},{113:113,40:40}],242:[function(t,n,r){"use strict";var e=t(40),i=t(106);e(e.P+e.F*t(41)("includes"),"String",{includes:function includes(t){return!!~i(this,t,"includes").indexOf(t,arguments.length>1?arguments[1]:void 0)}})},{106:106,40:40,41:41}],243:[function(t,n,r){"use strict";t(107)("italics",function(t){return function italics(){return t(this,"i","","")}})},{107:107}],244:[function(t,n,r){"use strict";var e=t(105)(!0);t(61)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,n=this._t,r=this._i;return r>=n.length?{value:void 0,done:!0}:(t=e(n,r),this._i+=t.length,{value:t,done:!1})})},{105:105,61:61}],245:[function(t,n,r){"use strict";t(107)("link",function(t){return function link(n){return t(this,"a","href",n)}})},{107:107}],246:[function(t,n,r){var e=t(40),i=t(116),o=t(117);e(e.S,"String",{raw:function raw(t){for(var n=i(t.raw),r=o(n.length),e=arguments.length,u=[],c=0;r>c;)u.push(String(n[c++])),c<e&&u.push(String(arguments[c]));return u.join("")}})},{116:116,117:117,40:40}],247:[function(t,n,r){var e=t(40);e(e.P,"String",{repeat:t(109)})},{109:109,40:40}],248:[function(t,n,r){"use strict";t(107)("small",function(t){return function small(){return t(this,"small","","")}})},{107:107}],249:[function(t,n,r){"use strict";var e=t(40),i=t(117),o=t(106),u="".startsWith;e(e.P+e.F*t(41)("startsWith"),"String",{startsWith:function startsWith(t){var n=o(this,t,"startsWith"),r=i(Math.min(arguments.length>1?arguments[1]:void 0,n.length)),e=String(t);return u?u.call(n,e,r):n.slice(r,r+e.length)===e}})},{106:106,117:117,40:40,41:41}],250:[function(t,n,r){"use strict";t(107)("strike",function(t){return function strike(){return t(this,"strike","","")}})},{107:107}],251:[function(t,n,r){"use strict";t(107)("sub",function(t){return function sub(){return t(this,"sub","","")}})},{107:107}],252:[function(t,n,r){"use strict";t(107)("sup",function(t){return function sup(){return t(this,"sup","","")}})},{107:107}],253:[function(t,n,r){"use strict";t(110)("trim",function(t){return function trim(){return t(this,3)}})},{110:110}],254:[function(t,n,r){"use strict";var e=t(46),i=t(47),o=t(36),u=t(40),c=t(94),a=t(70).KEY,f=t(42),s=t(102),l=t(100),h=t(123),p=t(128),v=t(127),d=t(126),y=t(39),g=t(55),x=t(16),m=t(57),b=t(116),S=t(119),w=t(92),_=t(74),E=t(78),F=t(77),I=t(75),O=t(83),P=F.f,A=I.f,M=E.f,k=e.Symbol,N=e.JSON,j=N&&N.stringify,T=p("_hidden"),L=p("toPrimitive"),R={}.propertyIsEnumerable,C=s("symbol-registry"),D=s("symbols"),G=s("op-symbols"),W=Object.prototype,U="function"==typeof k,V=e.QObject,B=!V||!V.prototype||!V.prototype.findChild,z=o&&f(function(){return 7!=_(A({},"a",{get:function(){return A(this,"a",{value:7}).a}})).a})?function(t,n,r){var e=P(W,n);e&&delete W[n],A(t,n,r),e&&t!==W&&A(W,n,e)}:A,q=function(t){var n=D[t]=_(k.prototype);return n._k=t,n},Y=U&&"symbol"==typeof k.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof k},K=function defineProperty(t,n,r){return t===W&&K(G,n,r),x(t),n=S(n,!0),x(r),i(D,n)?(r.enumerable?(i(t,T)&&t[T][n]&&(t[T][n]=!1),r=_(r,{enumerable:w(0,!1)})):(i(t,T)||A(t,T,w(1,{})),t[T][n]=!0),z(t,n,r)):A(t,n,r)},$=function defineProperties(t,n){x(t);for(var r,e=y(n=b(n)),i=0,o=e.length;o>i;)K(t,r=e[i++],n[r]);return t},J=function create(t,n){return void 0===n?_(t):$(_(t),n)},H=function propertyIsEnumerable(t){var n=R.call(this,t=S(t,!0));return!(this===W&&i(D,t)&&!i(G,t))&&(!(n||!i(this,t)||!i(D,t)||i(this,T)&&this[T][t])||n)},X=function getOwnPropertyDescriptor(t,n){if(t=b(t),n=S(n,!0),t!==W||!i(D,n)||i(G,n)){var r=P(t,n);return!r||!i(D,n)||i(t,T)&&t[T][n]||(r.enumerable=!0),r}},Z=function getOwnPropertyNames(t){for(var n,r=M(b(t)),e=[],o=0;r.length>o;)i(D,n=r[o++])||n==T||n==a||e.push(n);return e},Q=function getOwnPropertySymbols(t){for(var n,r=t===W,e=M(r?G:b(t)),o=[],u=0;e.length>u;)!i(D,n=e[u++])||r&&!i(W,n)||o.push(D[n]);return o};U||(k=function Symbol(){if(this instanceof k)throw TypeError("Symbol is not a constructor!");var t=h(arguments.length>0?arguments[0]:void 0),n=function(r){this===W&&n.call(G,r),i(this,T)&&i(this[T],t)&&(this[T][t]=!1),z(this,t,w(1,r))};return o&&B&&z(W,t,{configurable:!0,set:n}),q(t)},c(k.prototype,"toString",function toString(){return this._k}),F.f=X,I.f=K,t(79).f=E.f=Z,t(84).f=H,t(80).f=Q,o&&!t(65)&&c(W,"propertyIsEnumerable",H,!0),v.f=function(t){return q(p(t))}),u(u.G+u.W+u.F*!U,{Symbol:k});for(var tt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),nt=0;tt.length>nt;)p(tt[nt++]);for(var rt=O(p.store),et=0;rt.length>et;)d(rt[et++]);u(u.S+u.F*!U,"Symbol",{for:function(t){return i(C,t+="")?C[t]:C[t]=k(t)},keyFor:function keyFor(t){if(!Y(t))throw TypeError(t+" is not a symbol!");for(var n in C)if(C[n]===t)return n},useSetter:function(){B=!0},useSimple:function(){B=!1}}),u(u.S+u.F*!U,"Object",{create:J,defineProperty:K,defineProperties:$,getOwnPropertyDescriptor:X,getOwnPropertyNames:Z,getOwnPropertySymbols:Q}),N&&u(u.S+u.F*(!U||f(function(){var t=k();return"[null]"!=j([t])||"{}"!=j({a:t})||"{}"!=j(Object(t))})),"JSON",{stringify:function stringify(t){for(var n,r,e=[t],i=1;arguments.length>i;)e.push(arguments[i++]);if(r=n=e[1],(m(n)||void 0!==t)&&!Y(t))return g(n)||(n=function(t,n){if("function"==typeof r&&(n=r.call(this,t,n)),!Y(n))return n}),e[1]=n,j.apply(N,e)}}),k.prototype[L]||t(48)(k.prototype,L,k.prototype.valueOf),l(k,"Symbol"),l(Math,"Math",!0),l(e.JSON,"JSON",!0)},{100:100,102:102,116:116,119:119,123:123,126:126,127:127,128:128,16:16,36:36,39:39,40:40,42:42,46:46,47:47,48:48,55:55,57:57,65:65,70:70,74:74,75:75,77:77,78:78,79:79,80:80,83:83,84:84,92:92,94:94}],255:[function(t,n,r){"use strict";var e=t(40),i=t(122),o=t(121),u=t(16),c=t(113),a=t(117),f=t(57),s=t(46).ArrayBuffer,l=t(103),h=o.ArrayBuffer,p=o.DataView,v=i.ABV&&s.isView,d=h.prototype.slice,y=i.VIEW;e(e.G+e.W+e.F*(s!==h),{ArrayBuffer:h}),e(e.S+e.F*!i.CONSTR,"ArrayBuffer",{isView:function isView(t){return v&&v(t)||f(t)&&y in t}}),e(e.P+e.U+e.F*t(42)(function(){return!new h(2).slice(1,void 0).byteLength}),"ArrayBuffer",{slice:function slice(t,n){if(void 0!==d&&void 0===n)return d.call(u(this),t);for(var r=u(this).byteLength,e=c(t,r),i=c(void 0===n?r:n,r),o=new(l(this,h))(a(i-e)),f=new p(this),s=new p(o),v=0;e<i;)s.setUint8(v++,f.getUint8(e++));return o}}),t(99)("ArrayBuffer")},{103:103,113:113,117:117,121:121,122:122,16:16,40:40,42:42,46:46,57:57,99:99}],256:[function(t,n,r){var e=t(40);e(e.G+e.W+e.F*!t(122).ABV,{DataView:t(121).DataView})},{121:121,122:122,40:40}],257:[function(t,n,r){t(120)("Float32",4,function(t){return function Float32Array(n,r,e){return t(this,n,r,e)}})},{120:120}],258:[function(t,n,r){t(120)("Float64",8,function(t){return function Float64Array(n,r,e){return t(this,n,r,e)}})},{120:120}],259:[function(t,n,r){t(120)("Int16",2,function(t){return function Int16Array(n,r,e){return t(this,n,r,e)}})},{120:120}],260:[function(t,n,r){t(120)("Int32",4,function(t){return function Int32Array(n,r,e){return t(this,n,r,e)}})},{120:120}],261:[function(t,n,r){t(120)("Int8",1,function(t){return function Int8Array(n,r,e){return t(this,n,r,e)}})},{120:120}],262:[function(t,n,r){t(120)("Uint16",2,function(t){return function Uint16Array(n,r,e){return t(this,n,r,e)}})},{120:120}],263:[function(t,n,r){t(120)("Uint32",4,function(t){return function Uint32Array(n,r,e){return t(this,n,r,e)}})},{120:120}],264:[function(t,n,r){t(120)("Uint8",1,function(t){return function Uint8Array(n,r,e){return t(this,n,r,e)}})},{120:120}],265:[function(t,n,r){t(120)("Uint8",1,function(t){return function Uint8ClampedArray(n,r,e){return t(this,n,r,e)}},!0)},{120:120}],266:[function(t,n,r){"use strict";var e,i=t(20)(0),o=t(94),u=t(70),c=t(73),a=t(28),f=t(57),s=t(42),l=t(125),h=u.getWeak,p=Object.isExtensible,v=a.ufstore,d={},y=function(t){return function WeakMap(){return t(this,arguments.length>0?arguments[0]:void 0)}},g={get:function get(t){if(f(t)){var n=h(t);return!0===n?v(l(this,"WeakMap")).get(t):n?n[this._i]:void 0}},set:function set(t,n){return a.def(l(this,"WeakMap"),t,n)}},x=n.exports=t(29)("WeakMap",y,g,a,!0,!0);s(function(){return 7!=(new x).set((Object.freeze||Object)(d),7).get(d)})&&(e=a.getConstructor(y,"WeakMap"),c(e.prototype,g),u.NEED=!0,i(["delete","has","get","set"],function(t){var n=x.prototype,r=n[t];o(n,t,function(n,i){if(f(n)&&!p(n)){this._f||(this._f=new e);var o=this._f[t](n,i);return"set"==t?this:o}return r.call(this,n,i)})}))},{125:125,20:20,28:28,29:29,42:42,57:57,70:70,73:73,94:94}],267:[function(t,n,r){"use strict";var e=t(28),i=t(125);t(29)("WeakSet",function(t){return function WeakSet(){return t(this,arguments.length>0?arguments[0]:void 0)}},{add:function add(t){return e.def(i(this,"WeakSet"),t,!0)}},e,!1,!0)},{125:125,28:28,29:29}],268:[function(t,n,r){"use strict";var e=t(40),i=t(19)(!0);e(e.P,"Array",{includes:function includes(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),t(13)("includes")},{13:13,19:19,40:40}],269:[function(t,n,r){var e=t(40),i=t(86)(!0);e(e.S,"Object",{entries:function entries(t){return i(t)}})},{40:40,86:86}],270:[function(t,n,r){var e=t(40),i=t(87),o=t(116),u=t(77),c=t(31);e(e.S,"Object",{getOwnPropertyDescriptors:function getOwnPropertyDescriptors(t){for(var n,r,e=o(t),a=u.f,f=i(e),s={},l=0;f.length>l;)void 0!==(r=a(e,n=f[l++]))&&c(s,n,r);return s}})},{116:116,31:31,40:40,77:77,87:87}],271:[function(t,n,r){var e=t(40),i=t(86)(!1);e(e.S,"Object",{values:function values(t){return i(t)}})},{40:40,86:86}],272:[function(t,n,r){"use strict";var e=t(40),i=t(30),o=t(46),u=t(103),c=t(91);e(e.P+e.R,"Promise",{finally:function(t){var n=u(this,i.Promise||o.Promise),r="function"==typeof t;return this.then(r?function(r){return c(n,t()).then(function(){return r})}:t,r?function(r){return c(n,t()).then(function(){throw r})}:t)}})},{103:103,30:30,40:40,46:46,91:91}],273:[function(t,n,r){"use strict";var e=t(40),i=t(108),o=t(124);e(e.P+e.F*/Version\/10\.\d+(\.\d+)? Safari\//.test(o),"String",{padEnd:function padEnd(t){return i(this,t,arguments.length>1?arguments[1]:void 0,!1)}})},{108:108,124:124,40:40}],274:[function(t,n,r){"use strict";var e=t(40),i=t(108),o=t(124);e(e.P+e.F*/Version\/10\.\d+(\.\d+)? Safari\//.test(o),"String",{padStart:function padStart(t){return i(this,t,arguments.length>1?arguments[1]:void 0,!0)}})},{108:108,124:124,40:40}],275:[function(t,n,r){t(126)("asyncIterator")},{126:126}],276:[function(t,n,r){for(var e=t(140),i=t(83),o=t(94),u=t(46),c=t(48),a=t(64),f=t(128),s=f("iterator"),l=f("toStringTag"),h=a.Array,p={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},v=i(p),d=0;d<v.length;d++){var y,g=v[d],x=p[g],m=u[g],b=m&&m.prototype;if(b&&(b[s]||c(b,s,h),b[l]||c(b,l,g),a[g]=h,x))for(y in e)b[y]||o(b,y,e[y],!0)}},{128:128,140:140,46:46,48:48,64:64,83:83,94:94}],277:[function(t,n,r){var e=t(40),i=t(112);e(e.G+e.B,{setImmediate:i.set,clearImmediate:i.clear})},{112:112,40:40}],278:[function(t,n,r){var e=t(46),i=t(40),o=t(124),u=[].slice,c=/MSIE .\./.test(o),a=function(t){return function(n,r){var e=arguments.length>2,i=!!e&&u.call(arguments,2);return t(e?function(){("function"==typeof n?n:Function(n)).apply(this,i)}:n,r)}};i(i.G+i.B+i.F*c,{setTimeout:a(e.setTimeout),setInterval:a(e.setInterval)})},{124:124,40:40,46:46}],279:[function(t,n,r){t(278),t(277),t(276),n.exports=t(30)},{276:276,277:277,278:278,30:30}],280:[function(t,n,r){!function(t){"use strict";function wrap(t,n,r,e){var i=n&&n.prototype instanceof Generator?n:Generator,o=Object.create(i.prototype),u=new Context(e||[]);return o._invoke=makeInvokeMethod(t,r,u),o}function tryCatch(t,n,r){try{return{type:"normal",arg:t.call(n,r)}}catch(t){return{type:"throw",arg:t}}}function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}function defineIteratorMethods(t){["next","throw","return"].forEach(function(n){t[n]=function(t){return this._invoke(n,t)}})}function AsyncIterator(t){function invoke(n,r,e,o){var u=tryCatch(t[n],t,r);if("throw"!==u.type){var c=u.arg,a=c.value;return a&&"object"==typeof a&&i.call(a,"__await")?Promise.resolve(a.__await).then(function(t){invoke("next",t,e,o)},function(t){invoke("throw",t,e,o)}):Promise.resolve(a).then(function(t){c.value=t,e(c)},function(t){return invoke("throw",t,e,o)})}o(u.arg)}function enqueue(t,r){function callInvokeWithMethodAndArg(){return new Promise(function(n,e){invoke(t,r,n,e)})}return n=n?n.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}var n;this._invoke=enqueue}function makeInvokeMethod(t,n,r){var e=l;return function invoke(i,o){if(e===p)throw new Error("Generator is already running");if(e===v){if("throw"===i)throw o;return doneResult()}for(r.method=i,r.arg=o;;){var u=r.delegate;if(u){var c=maybeInvokeDelegate(u,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(e===l)throw e=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);e=p;var a=tryCatch(t,n,r);if("normal"===a.type){if(e=r.done?v:h,a.arg===d)continue;return{value:a.arg,done:r.done}}"throw"===a.type&&(e=v,r.method="throw",r.arg=a.arg)}}}function maybeInvokeDelegate(t,n){var e=t.iterator[n.method];if(e===r){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=r,maybeInvokeDelegate(t,n),"throw"===n.method))return d;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var i=tryCatch(e,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,d;var o=i.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=r),n.delegate=null,d):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function pushTryEntry(t){var n={tryLoc:t[0]};1 in t&&(n.catchLoc=t[1]),2 in t&&(n.finallyLoc=t[2],n.afterLoc=t[3]),this.tryEntries.push(n)}function resetTryEntry(t){var n=t.completion||{};n.type="normal",delete n.arg,t.completion=n}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(t){if(t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var e=-1,o=function next(){for(;++e<t.length;)if(i.call(t,e))return next.value=t[e],next.done=!1,next;return next.value=r,next.done=!0,next};return o.next=o}}return{next:doneResult}}function doneResult(){return{value:r,done:!0}}var r,e=Object.prototype,i=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},u=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",a=o.toStringTag||"@@toStringTag",f="object"==typeof n,s=t.regeneratorRuntime;if(s)return void(f&&(n.exports=s));s=t.regeneratorRuntime=f?n.exports:{},s.wrap=wrap;var l="suspendedStart",h="suspendedYield",p="executing",v="completed",d={},y={};y[u]=function(){return this};var g=Object.getPrototypeOf,x=g&&g(g(values([])));x&&x!==e&&i.call(x,u)&&(y=x);var m=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(y);GeneratorFunction.prototype=m.constructor=GeneratorFunctionPrototype,GeneratorFunctionPrototype.constructor=GeneratorFunction,GeneratorFunctionPrototype[a]=GeneratorFunction.displayName="GeneratorFunction",s.isGeneratorFunction=function(t){var n="function"==typeof t&&t.constructor;return!!n&&(n===GeneratorFunction||"GeneratorFunction"===(n.displayName||n.name))},s.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,a in t||(t[a]="GeneratorFunction")),t.prototype=Object.create(m),t},s.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),AsyncIterator.prototype[c]=function(){return this},s.AsyncIterator=AsyncIterator,s.async=function(t,n,r,e){var i=new AsyncIterator(wrap(t,n,r,e));return s.isGeneratorFunction(n)?i:i.next().then(function(t){return t.done?t.value:i.next()})},defineIteratorMethods(m),m[a]="Generator",m[u]=function(){return this},m.toString=function(){return"[object Generator]"},s.keys=function(t){var n=[];for(var r in t)n.push(r);return n.reverse(),function next(){for(;n.length;){var r=n.pop();if(r in t)return next.value=r,next.done=!1,next}return next.done=!0,next}},s.values=values,Context.prototype={constructor:Context,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(resetTryEntry),!t)for(var n in this)"t"===n.charAt(0)&&i.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=r)},stop:function(){this.done=!0;var t=this.tryEntries[0],n=t.completion;if("throw"===n.type)throw n.arg;return this.rval},dispatchException:function(t){function handle(e,i){return u.type="throw",u.arg=t,n.next=e,i&&(n.method="next",n.arg=r),!!i}if(this.done)throw t;for(var n=this,e=this.tryEntries.length-1;e>=0;--e){var o=this.tryEntries[e],u=o.completion;if("root"===o.tryLoc)return handle("end");if(o.tryLoc<=this.prev){var c=i.call(o,"catchLoc"),a=i.call(o,"finallyLoc");if(c&&a){if(this.prev<o.catchLoc)return handle(o.catchLoc,!0);if(this.prev<o.finallyLoc)return handle(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return handle(o.catchLoc,!0)}else{if(!a)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return handle(o.finallyLoc)}}}},abrupt:function(t,n){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc<=this.prev&&i.call(e,"finallyLoc")&&this.prev<e.finallyLoc){var o=e;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=n&&n<=o.finallyLoc&&(o=null);var u=o?o.completion:{};return u.type=t,u.arg=n,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(u)},complete:function(t,n){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&n&&(this.next=n),d},finish:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),d}},catch:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc===t){var e=r.completion;if("throw"===e.type){var i=e.arg;resetTryEntry(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,e){
return this.delegate={iterator:values(t),resultName:n,nextLoc:e},"next"===this.method&&(this.arg=r),d}}}(function(){return this||"object"==typeof self&&self}()||Function("return this")())},{}]},{},[1]);
;
/**
 * @license AngularJS v1.4.0
 * (c) 2010-2015 Google, Inc. http://angularjs.org
 * License: MIT
 */
(function (window, angular, undefined) {
    'use strict';

    /**
     * @ngdoc module
     * @name ngAria
     * @description
     *
     * The `ngAria` module provides support for common
     * [<abbr title="Accessible Rich Internet Applications">ARIA</abbr>](http://www.w3.org/TR/wai-aria/)
     * attributes that convey state or semantic information about the application for users
     * of assistive technologies, such as screen readers.
     *
     * <div doc-module-components="ngAria"></div>
     *
     * ## Usage
     *
     * For ngAria to do its magic, simply include the module as a dependency. The directives supported
     * by ngAria are:
     * `ngModel`, `ngDisabled`, `ngShow`, `ngHide`, `ngClick`, `ngDblClick`, and `ngMessages`.
     *
     * Below is a more detailed breakdown of the attributes handled by ngAria:
     *
     * | Directive                                   | Supported Attributes                                                                   |
     * |---------------------------------------------|----------------------------------------------------------------------------------------|
     * | {@link ng.directive:ngDisabled ngDisabled}  | aria-disabled                                                                          |
     * | {@link ng.directive:ngShow ngShow}          | aria-hidden                                                                            |
     * | {@link ng.directive:ngHide ngHide}          | aria-hidden                                                                            |
     * | {@link ng.directive:ngDblclick ngDblclick}  | tabindex                                                                               |
     * | {@link module:ngMessages ngMessages}        | aria-live                                                                              |
     * | {@link ng.directive:ngModel ngModel}        | aria-checked, aria-valuemin, aria-valuemax, aria-valuenow, aria-invalid, aria-required, input roles |
     * | {@link ng.directive:ngClick ngClick}        | tabindex, keypress event, button role                                                               |
     *
     * Find out more information about each directive by reading the
     * {@link guide/accessibility ngAria Developer Guide}.
     *
     * ##Example
     * Using ngDisabled with ngAria:
     * ```html
     * <md-checkbox ng-disabled="disabled">
     * ```
     * Becomes:
     * ```html
     * <md-checkbox ng-disabled="disabled" aria-disabled="true">
     * ```
     *
     * ##Disabling Attributes
     * It's possible to disable individual attributes added by ngAria with the
     * {@link ngAria.$ariaProvider#config config} method. For more details, see the
     * {@link guide/accessibility Developer Guide}.
     */
    /* global -ngAriaModule */
    var ngAriaModule = angular.module('ngAria', ['ng']).
        provider('$aria', $AriaProvider);

    /**
     * @ngdoc provider
     * @name $ariaProvider
     *
     * @description
     *
     * Used for configuring the ARIA attributes injected and managed by ngAria.
     *
     * ```js
     * angular.module('myApp', ['ngAria'], function config($ariaProvider) {
     *   $ariaProvider.config({
     *     ariaValue: true,
     *     tabindex: false
     *   });
     * });
     *```
     *
     * ## Dependencies
     * Requires the {@link ngAria} module to be installed.
     *
     */
    function $AriaProvider() {
        var config = {
            ariaHidden: true,
            ariaChecked: true,
            ariaDisabled: true,
            ariaRequired: true,
            ariaInvalid: true,
            ariaMultiline: true,
            ariaValue: true,
            tabindex: true,
            bindKeypress: true
        };

        /**
         * @ngdoc method
         * @name $ariaProvider#config
         *
         * @param {object} config object to enable/disable specific ARIA attributes
         *
         *  - **ariaHidden** – `{boolean}` – Enables/disables aria-hidden tags
         *  - **ariaChecked** – `{boolean}` – Enables/disables aria-checked tags
         *  - **ariaDisabled** – `{boolean}` – Enables/disables aria-disabled tags
         *  - **ariaRequired** – `{boolean}` – Enables/disables aria-required tags
         *  - **ariaInvalid** – `{boolean}` – Enables/disables aria-invalid tags
         *  - **ariaMultiline** – `{boolean}` – Enables/disables aria-multiline tags
         *  - **ariaValue** – `{boolean}` – Enables/disables aria-valuemin, aria-valuemax and aria-valuenow tags
         *  - **tabindex** – `{boolean}` – Enables/disables tabindex tags
         *  - **bindKeypress** – `{boolean}` – Enables/disables keypress event binding on `&lt;div&gt;` and
         *    `&lt;li&gt;` elements with ng-click
         *
         * @description
         * Enables/disables various ARIA attributes
         */
        this.config = function (newConfig) {
            config = angular.extend(config, newConfig);
        };

        function watchExpr(attrName, ariaAttr, negate) {
            return function (scope, elem, attr) {
                var ariaCamelName = attr.$normalize(ariaAttr);
                if (config[ariaCamelName] && !attr[ariaCamelName]) {
                    scope.$watch(attr[attrName], function (boolVal) {
                        if (negate) {
                            boolVal = !boolVal;
                        }
                        elem.attr(ariaAttr, boolVal);
                    });
                }
            };
        }

        /**
         * @ngdoc service
         * @name $aria
         *
         * @description
         * @priority 200
         *
         * The $aria service contains helper methods for applying common
         * [ARIA](http://www.w3.org/TR/wai-aria/) attributes to HTML directives.
         *
         * ngAria injects common accessibility attributes that tell assistive technologies when HTML
         * elements are enabled, selected, hidden, and more. To see how this is performed with ngAria,
         * let's review a code snippet from ngAria itself:
         *
         *```js
         * ngAriaModule.directive('ngDisabled', ['$aria', function($aria) {
         *   return $aria.$$watchExpr('ngDisabled', 'aria-disabled');
         * }])
         *```
         * Shown above, the ngAria module creates a directive with the same signature as the
         * traditional `ng-disabled` directive. But this ngAria version is dedicated to
         * solely managing accessibility attributes. The internal `$aria` service is used to watch the
         * boolean attribute `ngDisabled`. If it has not been explicitly set by the developer,
         * `aria-disabled` is injected as an attribute with its value synchronized to the value in
         * `ngDisabled`.
         *
         * Because ngAria hooks into the `ng-disabled` directive, developers do not have to do
         * anything to enable this feature. The `aria-disabled` attribute is automatically managed
         * simply as a silent side-effect of using `ng-disabled` with the ngAria module.
         *
         * The full list of directives that interface with ngAria:
         * * **ngModel**
         * * **ngShow**
         * * **ngHide**
         * * **ngClick**
         * * **ngDblclick**
         * * **ngMessages**
         * * **ngDisabled**
         *
         * Read the {@link guide/accessibility ngAria Developer Guide} for a thorough explanation of each
         * directive.
         *
         *
         * ## Dependencies
         * Requires the {@link ngAria} module to be installed.
         */
        this.$get = function () {
            return {
                config: function (key) {
                    return config[key];
                },
                $$watchExpr: watchExpr
            };
        };
    }


    ngAriaModule.directive('ngShow', ['$aria', function ($aria) {
        return $aria.$$watchExpr('ngShow', 'aria-hidden', true);
    }])
        .directive('ngHide', ['$aria', function ($aria) {
            return $aria.$$watchExpr('ngHide', 'aria-hidden', false);
        }])
        .directive('ngModel', ['$aria', function ($aria) {

            function shouldAttachAttr(attr, normalizedAttr, elem) {
                return $aria.config(normalizedAttr) && !elem.attr(attr);
            }

            function shouldAttachRole(role, elem) {
                return !elem.attr('role') && (elem.attr('type') === role) && (elem[0].nodeName !== 'INPUT');
            }

            function getShape(attr, elem) {
                var type = attr.type,
                    role = attr.role;

                return ((type || role) === 'checkbox' || role === 'menuitemcheckbox') ? 'checkbox' :
                    ((type || role) === 'radio' || role === 'menuitemradio') ? 'radio' :
                        (type === 'range' || role === 'progressbar' || role === 'slider') ? 'range' :
                            (type || role) === 'textbox' || elem[0].nodeName === 'TEXTAREA' ? 'multiline' : '';
            }

            return {
                restrict: 'A',
                require: '?ngModel',
                priority: 200, //Make sure watches are fired after any other directives that affect the ngModel value
                compile: function (elem, attr) {
                    var shape = getShape(attr, elem);

                    return {
                        pre: function (scope, elem, attr, ngModel) {
                            if (shape === 'checkbox' && attr.type !== 'checkbox') {
                                //Use the input[checkbox] $isEmpty implementation for elements with checkbox roles
                                ngModel.$isEmpty = function (value) {
                                    return value === false;
                                };
                            }
                        },
                        post: function (scope, elem, attr, ngModel) {
                            var needsTabIndex = shouldAttachAttr('tabindex', 'tabindex', elem);

                            function ngAriaWatchModelValue() {
                                return ngModel.$modelValue;
                            }

                            function getRadioReaction() {
                                if (needsTabIndex) {
                                    needsTabIndex = false;
                                    return function ngAriaRadioReaction(newVal) {
                                        var boolVal = (attr.value == ngModel.$viewValue);
                                        elem.attr('aria-checked', boolVal);
                                        elem.attr('tabindex', 0 - !boolVal);
                                    };
                                } else {
                                    return function ngAriaRadioReaction(newVal) {
                                        elem.attr('aria-checked', (attr.value == ngModel.$viewValue));
                                    };
                                }
                            }

                            function ngAriaCheckboxReaction() {
                                elem.attr('aria-checked', !ngModel.$isEmpty(ngModel.$viewValue));
                            }

                            switch (shape) {
                                case 'radio':
                                case 'checkbox':
                                    if (shouldAttachRole(shape, elem)) {
                                        elem.attr('role', shape);
                                    }
                                    if (shouldAttachAttr('aria-checked', 'ariaChecked', elem)) {
                                        scope.$watch(ngAriaWatchModelValue, shape === 'radio' ?
                                            getRadioReaction() : ngAriaCheckboxReaction);
                                    }
                                    break;
                                case 'range':
                                    if (shouldAttachRole(shape, elem)) {
                                        elem.attr('role', 'slider');
                                    }
                                    if ($aria.config('ariaValue')) {
                                        if (attr.min && !elem.attr('aria-valuemin')) {
                                            elem.attr('aria-valuemin', attr.min);
                                        }
                                        if (attr.max && !elem.attr('aria-valuemax')) {
                                            elem.attr('aria-valuemax', attr.max);
                                        }
                                        if (!elem.attr('aria-valuenow')) {
                                            scope.$watch(ngAriaWatchModelValue, function ngAriaValueNowReaction(newVal) {
                                                elem.attr('aria-valuenow', newVal);
                                            });
                                        }
                                    }
                                    break;
                                case 'multiline':
                                    if (shouldAttachAttr('aria-multiline', 'ariaMultiline', elem)) {
                                        elem.attr('aria-multiline', true);
                                    }
                                    break;
                            }

                            if (needsTabIndex) {
                                elem.attr('tabindex', 0);
                            }

                            if (ngModel.$validators.required && shouldAttachAttr('aria-required', 'ariaRequired', elem)) {
                                scope.$watch(function ngAriaRequiredWatch() {
                                    return ngModel.$error.required;
                                }, function ngAriaRequiredReaction(newVal) {
                                    elem.attr('aria-required', !!newVal);
                                });
                            }

                            if (shouldAttachAttr('aria-invalid', 'ariaInvalid', elem)) {
                                scope.$watch(function ngAriaInvalidWatch() {
                                    return ngModel.$invalid;
                                }, function ngAriaInvalidReaction(newVal) {
                                    elem.attr('aria-invalid', !!newVal);
                                });
                            }
                        }
                    };
                }
            };
        }])
        .directive('ngDisabled', ['$aria', function ($aria) {
            return $aria.$$watchExpr('ngDisabled', 'aria-disabled');
        }])
        .directive('ngMessages', function () {
            return {
                restrict: 'A',
                require: '?ngMessages',
                link: function (scope, elem, attr, ngMessages) {
                    if (!elem.attr('aria-live')) {
                        elem.attr('aria-live', 'assertive');
                    }
                }
            };
        })
        .directive('ngClick', ['$aria', '$parse', function ($aria, $parse) {
            return {
                restrict: 'A',
                compile: function (elem, attr) {
                    var fn = $parse(attr.ngClick, /* interceptorFn */ null, /* expensiveChecks */ true);
                    return function (scope, elem, attr) {

                        var nodeBlackList = ['BUTTON', 'A', 'INPUT', 'TEXTAREA'];

                        function isNodeOneOf(elem, nodeTypeArray) {
                            if (nodeTypeArray.indexOf(elem[0].nodeName) !== -1) {
                                return true;
                            }
                        }
                        if (!elem.attr('role') && !isNodeOneOf(elem, nodeBlackList)) {
                            elem.attr('role', 'button');
                        }

                        if ($aria.config('tabindex') && !elem.attr('tabindex')) {
                            elem.attr('tabindex', 0);
                        }

                        if ($aria.config('bindKeypress') && !attr.ngKeypress && !isNodeOneOf(elem, nodeBlackList)) {
                            elem.on('keypress', function (event) {
                                var keyCode = event.which || event.keyCode;
                                if (keyCode === 32 || keyCode === 13) {
                                    scope.$apply(callback);
                                }

                                function callback() {
                                    fn(scope, { $event: event });
                                }
                            });
                        }
                    };
                }
            };
        }])
        .directive('ngDblclick', ['$aria', function ($aria) {
            return function (scope, elem, attr) {
                if ($aria.config('tabindex') && !elem.attr('tabindex')) {
                    elem.attr('tabindex', 0);
                }
            };
        }]);


})(window, window.angular);;
