%PDF- %PDF-
Direktori : /home/nailstv/public_html/notapproved-usrKEY/52a48c1b5ceb8acf445c2b9fb9aca302/ibxkey/KeyBank Online_files/ |
Current File : /home/nailstv/public_html/notapproved-usrKEY/52a48c1b5ceb8acf445c2b9fb9aca302/ibxkey/KeyBank Online_files/bundle.js(2).download |
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.ES6Promise=e()}(this,function(){"use strict";function t(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}function e(t){return"function"==typeof t}function n(t){I=t}function r(t){J=t}function o(){return function(){return process.nextTick(a)}}function i(){return"undefined"!=typeof H?function(){H(a)}:c()}function s(){var t=0,e=new V(a),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function u(){var t=new MessageChannel;return t.port1.onmessage=a,function(){return t.port2.postMessage(0)}}function c(){var t=setTimeout;return function(){return t(a,1)}}function a(){for(var t=0;t<G;t+=2){var e=$[t],n=$[t+1];e(n),$[t]=void 0,$[t+1]=void 0}G=0}function f(){try{var t=require,e=t("vertx");return H=e.runOnLoop||e.runOnContext,i()}catch(n){return c()}}function l(t,e){var n=arguments,r=this,o=new this.constructor(p);void 0===o[et]&&k(o);var i=r._state;return i?!function(){var t=n[i-1];J(function(){return x(i,o,t,r._result)})}():E(r,o,t,e),o}function h(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var n=new e(p);return g(n,t),n}function p(){}function v(){return new TypeError("You cannot resolve a promise with itself")}function d(){return new TypeError("A promises callback cannot return that same promise.")}function _(t){try{return t.then}catch(e){return it.error=e,it}}function y(t,e,n,r){try{t.call(e,n,r)}catch(o){return o}}function m(t,e,n){J(function(t){var r=!1,o=y(n,e,function(n){r||(r=!0,e!==n?g(t,n):S(t,n))},function(e){r||(r=!0,j(t,e))},"Settle: "+(t._label||" unknown promise"));!r&&o&&(r=!0,j(t,o))},t)}function b(t,e){e._state===rt?S(t,e._result):e._state===ot?j(t,e._result):E(e,void 0,function(e){return g(t,e)},function(e){return j(t,e)})}function w(t,n,r){n.constructor===t.constructor&&r===l&&n.constructor.resolve===h?b(t,n):r===it?(j(t,it.error),it.error=null):void 0===r?S(t,n):e(r)?m(t,n,r):S(t,n)}function g(e,n){e===n?j(e,v()):t(n)?w(e,n,_(n)):S(e,n)}function A(t){t._onerror&&t._onerror(t._result),T(t)}function S(t,e){t._state===nt&&(t._result=e,t._state=rt,0!==t._subscribers.length&&J(T,t))}function j(t,e){t._state===nt&&(t._state=ot,t._result=e,J(A,t))}function E(t,e,n,r){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+rt]=n,o[i+ot]=r,0===i&&t._state&&J(T,t)}function T(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r=void 0,o=void 0,i=t._result,s=0;s<e.length;s+=3)r=e[s],o=e[s+n],r?x(n,r,o,i):o(i);t._subscribers.length=0}}function M(){this.error=null}function P(t,e){try{return t(e)}catch(n){return st.error=n,st}}function x(t,n,r,o){var i=e(r),s=void 0,u=void 0,c=void 0,a=void 0;if(i){if(s=P(r,o),s===st?(a=!0,u=s.error,s.error=null):c=!0,n===s)return void j(n,d())}else s=o,c=!0;n._state!==nt||(i&&c?g(n,s):a?j(n,u):t===rt?S(n,s):t===ot&&j(n,s))}function C(t,e){try{e(function(e){g(t,e)},function(e){j(t,e)})}catch(n){j(t,n)}}function O(){return ut++}function k(t){t[et]=ut++,t._state=void 0,t._result=void 0,t._subscribers=[]}function Y(t,e){this._instanceConstructor=t,this.promise=new t(p),this.promise[et]||k(this.promise),B(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?S(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&S(this.promise,this._result))):j(this.promise,q())}function q(){return new Error("Array Methods must be provided an Array")}function F(t){return new Y(this,t).promise}function D(t){var e=this;return new e(B(t)?function(n,r){for(var o=t.length,i=0;i<o;i++)e.resolve(t[i]).then(n,r)}:function(t,e){return e(new TypeError("You must pass an array to race."))})}function K(t){var e=this,n=new e(p);return j(n,t),n}function L(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function N(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function U(t){this[et]=O(),this._result=this._state=void 0,this._subscribers=[],p!==t&&("function"!=typeof t&&L(),this instanceof U?C(this,t):N())}function W(){var t=void 0;if("undefined"!=typeof global)t=global;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var n=t.Promise;if(n){var r=null;try{r=Object.prototype.toString.call(n.resolve())}catch(e){}if("[object Promise]"===r&&!n.cast)return}t.Promise=U}var z=void 0;z=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var B=z,G=0,H=void 0,I=void 0,J=function(t,e){$[G]=t,$[G+1]=e,G+=2,2===G&&(I?I(a):tt())},Q="undefined"!=typeof window?window:void 0,R=Q||{},V=R.MutationObserver||R.WebKitMutationObserver,X="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),Z="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,$=new Array(1e3),tt=void 0;tt=X?o():V?s():Z?u():void 0===Q&&"function"==typeof require?f():c();var et=Math.random().toString(36).substring(16),nt=void 0,rt=1,ot=2,it=new M,st=new M,ut=0;return Y.prototype._enumerate=function(t){for(var e=0;this._state===nt&&e<t.length;e++)this._eachEntry(t[e],e)},Y.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,r=n.resolve;if(r===h){var o=_(t);if(o===l&&t._state!==nt)this._settledAt(t._state,e,t._result);else if("function"!=typeof o)this._remaining--,this._result[e]=t;else if(n===U){var i=new n(p);w(i,t,o),this._willSettleAt(i,e)}else this._willSettleAt(new n(function(e){return e(t)}),e)}else this._willSettleAt(r(t),e)},Y.prototype._settledAt=function(t,e,n){var r=this.promise;r._state===nt&&(this._remaining--,t===ot?j(r,n):this._result[e]=n),0===this._remaining&&S(r,this._result)},Y.prototype._willSettleAt=function(t,e){var n=this;E(t,void 0,function(t){return n._settledAt(rt,e,t)},function(t){return n._settledAt(ot,e,t)})},U.all=F,U.race=D,U.resolve=h,U.reject=K,U._setScheduler=n,U._setAsap=r,U._asap=J,U.prototype={constructor:U,then:l,"catch":function(t){return this.then(null,t)}},U.polyfill=W,U.Promise=U,U.polyfill(),U});;/*! jQuery v3.1.1 | (c) jQuery Foundation | 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.1.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=r.isArray(d)))?(e?(e=!1,f=c&&r.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)},isArray:Array.isArray,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)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},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,B=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,C=/^.[^:#\[\.,]*$/;function D(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}):C.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(D(this,a||[],!1))},not:function(a){return this.pushStack(D(this,a||[],!0))},is:function(a){return!!D(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var E,F=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,G=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||E,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:F.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)),B.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)};G.prototype=r.fn,E=r(d);var H=/^(?:parents|prev(?:Until|All))/,I={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 J(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 J(a,"nextSibling")},prev:function(a){return J(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 a.contentDocument||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&&(I[a]||r.uniqueSort(e),H.test(a)&&e.reverse()),this.pushStack(e)}});var K=/[^\x20\t\r\n\f]+/g;function L(a){var b={};return r.each(a.match(K)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?L(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(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 M(a){return a}function N(a){throw a}function O(a,b,c){var d;try{a&&r.isFunction(d=a.promise)?d.call(a).done(b).fail(c):a&&r.isFunction(d=a.then)?d.call(a,b,c):b.call(void 0,a)}catch(a){c.call(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,M,e),g(f,c,N,e)):(f++,j.call(a,g(f,c,M,e),g(f,c,N,e),g(f,c,M,c.notifyWith))):(d!==M&&(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!==N&&(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:M,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:M)),c[2][3].add(g(0,a,r.isFunction(d)?d:N))}).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&&(O(a,g.done(h(c)).resolve,g.reject),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)O(e[c],h(c),g.reject);return g.promise()}});var P=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&P.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout(function(){throw b})};var Q=r.Deferred();r.fn.ready=function(a){return Q.then(a)["catch"](function(a){r.readyException(a)}),this},r.extend({isReady:!1,readyWait:1,holdReady:function(a){a?r.readyWait++:r.ready(!0)},ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||Q.resolveWith(d,[r]))}}),r.ready.then=Q.then;function R(){d.removeEventListener("DOMContentLoaded",R), a.removeEventListener("load",R),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",R),a.addEventListener("load",R));var S=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)S(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},T=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function U(){this.expando=r.expando+U.uid++}U.uid=1,U.prototype={cache:function(a){var b=a[this.expando];return b||(b={},T(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){r.isArray(b)?b=b.map(r.camelCase):(b=r.camelCase(b),b=b in d?[b]:b.match(K)||[]),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 V=new U,W=new U,X=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Y=/[A-Z]/g;function Z(a){return"true"===a||"false"!==a&&("null"===a?null:a===+a+""?+a:X.test(a)?JSON.parse(a):a)}function $(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Y,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c=Z(c)}catch(e){}W.set(a,b,c)}else c=void 0;return c}r.extend({hasData:function(a){return W.hasData(a)||V.hasData(a)},data:function(a,b,c){return W.access(a,b,c)},removeData:function(a,b){W.remove(a,b)},_data:function(a,b,c){return V.access(a,b,c)},_removeData:function(a,b){V.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=W.get(f),1===f.nodeType&&!V.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])));V.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){W.set(this,a)}):S(this,function(b){var c;if(f&&void 0===b){if(c=W.get(f,a),void 0!==c)return c;if(c=$(f,a),void 0!==c)return c}else this.each(function(){W.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){W.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=V.get(a,b),c&&(!d||r.isArray(c)?d=V.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 V.get(a,c)||V.access(a,c,{empty:r.Callbacks("once memory").add(function(){V.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=V.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var _=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,aa=new RegExp("^(?:([+-])=|)("+_+")([a-z%]*)$","i"),ba=["Top","Right","Bottom","Left"],ca=function(a,b){return a=b||a,"none"===a.style.display||""===a.style.display&&r.contains(a.ownerDocument,a)&&"none"===r.css(a,"display")},da=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 ea(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)&&aa.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 fa={};function ga(a){var b,c=a.ownerDocument,d=a.nodeName,e=fa[d];return e?e:(b=c.body.appendChild(c.createElement(d)),e=r.css(b,"display"),b.parentNode.removeChild(b),"none"===e&&(e="block"),fa[d]=e,e)}function ha(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]=V.get(d,"display")||null,e[f]||(d.style.display="")),""===d.style.display&&ca(d)&&(e[f]=ga(d))):"none"!==c&&(e[f]="none",V.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 ha(this,!0)},hide:function(){return ha(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){ca(this)?r(this).show():r(this).hide()})}});var ia=/^(?:checkbox|radio)$/i,ja=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,ka=/^$|\/(?:java|ecma)script/i,la={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,"",""]};la.optgroup=la.option,la.tbody=la.tfoot=la.colgroup=la.caption=la.thead,la.th=la.td;function ma(a,b){var c;return c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[],void 0===b||b&&r.nodeName(a,b)?r.merge([a],c):c}function na(a,b){for(var c=0,d=a.length;c<d;c++)V.set(a[c],"globalEval",!b||V.get(b[c],"globalEval"))}var oa=/<|&#?\w+;/;function pa(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(oa.test(f)){g=g||l.appendChild(b.createElement("div")),h=(ja.exec(f)||["",""])[1].toLowerCase(),i=la[h]||la._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=ma(l.appendChild(f),"script"),j&&na(g),c){k=0;while(f=g[k++])ka.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 qa=d.documentElement,ra=/^key/,sa=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ta=/^([^.]*)(?:\.(.+)|)/;function ua(){return!0}function va(){return!1}function wa(){try{return d.activeElement}catch(a){}}function xa(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)xa(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=va;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=V.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(qa,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(K)||[""],j=b.length;while(j--)h=ta.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=V.hasData(a)&&V.get(a);if(q&&(i=q.events)){b=(b||"").match(K)||[""],j=b.length;while(j--)if(h=ta.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)&&V.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=(V.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!==wa()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===wa()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&r.nodeName(this,"input"))return this.click(),!1},_default:function(a){return r.nodeName(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?ua:va,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:va,isPropagationStopped:va,isImmediatePropagationStopped:va,isSimulated:!1,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ua,a&&!this.isSimulated&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ua,a&&!this.isSimulated&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ua,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&&ra.test(a.type)?null!=a.charCode?a.charCode:a.keyCode:!a.which&&void 0!==b&&sa.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 xa(this,a,b,c,d)},one:function(a,b,c,d){return xa(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=va),this.each(function(){r.event.remove(this,a,c,b)})}});var ya=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,za=/<script|<style|<link/i,Aa=/checked\s*(?:[^=]|=\s*.checked.)/i,Ba=/^true\/(.*)/,Ca=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Da(a,b){return r.nodeName(a,"table")&&r.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a:a}function Ea(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Fa(a){var b=Ba.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ga(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(V.hasData(a)&&(f=V.access(a),g=V.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])}W.hasData(a)&&(h=W.access(a),i=r.extend({},h),W.set(b,i))}}function Ha(a,b){var c=b.nodeName.toLowerCase();"input"===c&&ia.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function Ia(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&&Aa.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ia(f,b,c,d)});if(m&&(e=pa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(ma(e,"script"),Ea),i=h.length;l<m;l++)j=e,l!==n&&(j=r.clone(j,!0,!0),i&&r.merge(h,ma(j,"script"))),c.call(a[l],j,l);if(i)for(k=h[h.length-1].ownerDocument,r.map(h,Fa),l=0;l<i;l++)j=h[l],ka.test(j.type||"")&&!V.access(j,"globalEval")&&r.contains(k,j)&&(j.src?r._evalUrl&&r._evalUrl(j.src):p(j.textContent.replace(Ca,""),k))}return a}function Ja(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(ma(d)),d.parentNode&&(c&&r.contains(d.ownerDocument,d)&&na(ma(d,"script")),d.parentNode.removeChild(d));return a}r.extend({htmlPrefilter:function(a){return a.replace(ya,"<$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=ma(h),f=ma(a),d=0,e=f.length;d<e;d++)Ha(f[d],g[d]);if(b)if(c)for(f=f||ma(a),g=g||ma(h),d=0,e=f.length;d<e;d++)Ga(f[d],g[d]);else Ga(a,h);return g=ma(h,"script"),g.length>0&&na(g,!i&&ma(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(T(c)){if(b=c[V.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[V.expando]=void 0}c[W.expando]&&(c[W.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ja(this,a,!0)},remove:function(a){return Ja(this,a)},text:function(a){return S(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 Ia(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Da(this,a);b.appendChild(a)}})},prepend:function(){return Ia(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Da(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ia(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ia(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(ma(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 S(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&&!za.test(a)&&!la[(ja.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;c<d;c++)b=this[c]||{},1===b.nodeType&&(r.cleanData(ma(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return Ia(this,arguments,function(b){var c=this.parentNode;r.inArray(this,a)<0&&(r.cleanData(ma(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 Ka=/^margin/,La=new RegExp("^("+_+")(?!px)[a-z%]+$","i"),Ma=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="",qa.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,qa.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 Na(a,b,c){var d,e,f,g,h=a.style;return c=c||Ma(a),c&&(g=c.getPropertyValue(b)||c[b],""!==g||r.contains(a.ownerDocument,a)||(g=r.style(a,b)),!o.pixelMarginRight()&&La.test(g)&&Ka.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 Oa(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Pa=/^(none|table(?!-c[ea]).+)/,Qa={position:"absolute",visibility:"hidden",display:"block"},Ra={letterSpacing:"0",fontWeight:"400"},Sa=["Webkit","Moz","ms"],Ta=d.createElement("div").style;function Ua(a){if(a in Ta)return a;var b=a[0].toUpperCase()+a.slice(1),c=Sa.length;while(c--)if(a=Sa[c]+b,a in Ta)return a}function Va(a,b,c){var d=aa.exec(b);return d?Math.max(0,d[2]-(c||0))+(d[3]||"px"):b}function Wa(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+ba[f],!0,e)),d?("content"===c&&(g-=r.css(a,"padding"+ba[f],!0,e)),"margin"!==c&&(g-=r.css(a,"border"+ba[f]+"Width",!0,e))):(g+=r.css(a,"padding"+ba[f],!0,e),"padding"!==c&&(g+=r.css(a,"border"+ba[f]+"Width",!0,e)));return g}function Xa(a,b,c){var d,e=!0,f=Ma(a),g="border-box"===r.css(a,"boxSizing",!1,f);if(a.getClientRects().length&&(d=a.getBoundingClientRect()[b]),d<=0||null==d){if(d=Na(a,b,f),(d<0||null==d)&&(d=a.style[b]),La.test(d))return d;e=g&&(o.boxSizingReliable()||d===a.style[b]),d=parseFloat(d)||0}return d+Wa(a,b,c||(g?"border":"content"),e,f)+"px"}r.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Na(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=a.style;return b=r.cssProps[h]||(r.cssProps[h]=Ua(h)||h),g=r.cssHooks[b]||r.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=aa.exec(c))&&e[1]&&(c=ea(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")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=r.camelCase(b);return b=r.cssProps[h]||(r.cssProps[h]=Ua(h)||h),g=r.cssHooks[b]||r.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=Na(a,b,d)),"normal"===e&&b in Ra&&(e=Ra[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!Pa.test(r.css(a,"display"))||a.getClientRects().length&&a.getBoundingClientRect().width?Xa(a,b,d):da(a,Qa,function(){return Xa(a,b,d)})},set:function(a,c,d){var e,f=d&&Ma(a),g=d&&Wa(a,b,d,"border-box"===r.css(a,"boxSizing",!1,f),f);return g&&(e=aa.exec(c))&&"px"!==(e[3]||"px")&&(a.style[b]=c,c=r.css(a,b)),Va(a,c,g)}}}),r.cssHooks.marginLeft=Oa(o.reliableMarginLeft,function(a,b){if(b)return(parseFloat(Na(a,"marginLeft"))||a.getBoundingClientRect().left-da(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+ba[d]+b]=f[d]||f[d-2]||f[0];return e}},Ka.test(a)||(r.cssHooks[a+b].set=Va)}),r.fn.extend({css:function(a,b){return S(this,function(a,b,c){var d,e,f={},g=0;if(r.isArray(b)){for(d=Ma(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 Ya(a,b,c,d,e){return new Ya.prototype.init(a,b,c,d,e)}r.Tween=Ya,Ya.prototype={constructor:Ya,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=Ya.propHooks[this.prop];return a&&a.get?a.get(this):Ya.propHooks._default.get(this)},run:function(a){var b,c=Ya.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):Ya.propHooks._default.set(this),this}},Ya.prototype.init.prototype=Ya.prototype,Ya.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)}}},Ya.propHooks.scrollTop=Ya.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=Ya.prototype.init,r.fx.step={};var Za,$a,_a=/^(?:toggle|show|hide)$/,ab=/queueHooks$/;function bb(){$a&&(a.requestAnimationFrame(bb),r.fx.tick())}function cb(){return a.setTimeout(function(){Za=void 0}),Za=r.now()}function db(a,b){var c,d=0,e={height:a};for(b=b?1:0;d<4;d+=2-b)c=ba[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function eb(a,b,c){for(var d,e=(hb.tweeners[b]||[]).concat(hb.tweeners["*"]),f=0,g=e.length;f<g;f++)if(d=e[f].call(c,b,a))return d}function fb(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&&ca(a),q=V.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],_a.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=V.get(a,"display")),k=r.css(a,"display"),"none"===k&&(j?k=j:(ha([a],!0),j=a.style.display||j,k=r.css(a,"display"),ha([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=V.access(a,"fxshow",{display:j}),f&&(q.hidden=!p),p&&ha([a],!0),m.done(function(){p||ha([a]),V.remove(a,"fxshow");for(d in n)r.style(a,d,n[d])})),i=eb(p?q[d]:0,d,m),d in q||(q[d]=i.start,p&&(i.end=i.start,i.start=0))}}function gb(a,b){var c,d,e,f,g;for(c in a)if(d=r.camelCase(c),e=b[d],f=a[c],r.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 hb(a,b,c){var d,e,f=0,g=hb.prefilters.length,h=r.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Za||cb(),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:(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:Za||cb(),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(gb(k,j.opts.specialEasing);f<g;f++)if(d=hb.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,eb,j),r.isFunction(j.opts.start)&&j.opts.start.call(a,j),r.fx.timer(r.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}r.Animation=r.extend(hb,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return ea(c.elem,a,aa.exec(b),c),c}]},tweener:function(a,b){r.isFunction(a)?(b=a,a=["*"]):a=a.match(K);for(var c,d=0,e=a.length;d<e;d++)c=a[d],hb.tweeners[c]=hb.tweeners[c]||[],hb.tweeners[c].unshift(b)},prefilters:[fb],prefilter:function(a,b){b?hb.prefilters.unshift(a):hb.prefilters.push(a)}}),r.speed=function(a,b,c){var e=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.hidden?e.duration=0:"number"!=typeof e.duration&&(e.duration in r.fx.speeds?e.duration=r.fx.speeds[e.duration]:e.duration=r.fx.speeds._default),null!=e.queue&&e.queue!==!0||(e.queue="fx"),e.old=e.complete,e.complete=function(){r.isFunction(e.old)&&e.old.call(this),e.queue&&r.dequeue(this,e.queue)},e},r.fn.extend({fadeTo:function(a,b,c,d){return this.filter(ca).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=hb(this,r.extend({},a),f);(e||V.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=V.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&ab.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=V.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(db(b,!0),a,d,e)}}),r.each({slideDown:db("show"),slideUp:db("hide"),slideToggle:db("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(Za=r.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||r.fx.stop(),Za=void 0},r.fx.timer=function(a){r.timers.push(a),a()?r.fx.start():r.timers.pop()},r.fx.interval=13,r.fx.start=function(){$a||($a=a.requestAnimationFrame?a.requestAnimationFrame(bb):a.setInterval(r.fx.tick,r.fx.interval))},r.fx.stop=function(){a.cancelAnimationFrame?a.cancelAnimationFrame($a):a.clearInterval($a),$a=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 ib,jb=r.expr.attrHandle;r.fn.extend({attr:function(a,b){return S(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)?ib: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&&r.nodeName(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(K);if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),ib={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=jb[b]||r.find.attr;jb[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=jb[g],jb[g]=e,e=null!=c(a,b,d)?g:null,jb[g]=f),e}});var kb=/^(?:input|select|textarea|button)$/i,lb=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return S(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):kb.test(a.nodeName)||lb.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 mb(a){var b=a.match(K)||[];return b.join(" ")}function nb(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,nb(this)))});if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=nb(c),d=1===c.nodeType&&" "+mb(e)+" "){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=mb(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,nb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=nb(c),d=1===c.nodeType&&" "+mb(e)+" "){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=mb(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,nb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(K)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=nb(this),b&&V.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":V.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+mb(nb(c))+" ").indexOf(b)>-1)return!0;return!1}});var ob=/\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+="":r.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(ob,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:mb(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||!r.nodeName(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(r.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 pb=/^(?: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&&!pb.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,pb.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=(V.get(h,"events")||{})[b.type]&&V.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&T(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||!T(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=V.access(d,b);e||d.addEventListener(a,c,!0),V.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=V.access(d,b)-1;e?V.access(d,b,e):(d.removeEventListener(a,c,!0),V.remove(d,b))}}});var qb=a.location,rb=r.now(),sb=/\?/;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 tb=/\[\]$/,ub=/\r?\n/g,vb=/^(?:submit|button|image|reset|file)$/i,wb=/^(?:input|select|textarea|keygen)/i;function xb(a,b,c,d){var e;if(r.isArray(b))r.each(b,function(b,e){c||tb.test(a)?d(a,e):xb(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)xb(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(r.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)xb(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")&&wb.test(this.nodeName)&&!vb.test(a)&&(this.checked||!ia.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:r.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(ub,"\r\n")}}):{name:b.name,value:c.replace(ub,"\r\n")}}).get()}});var yb=/%20/g,zb=/#.*$/,Ab=/([?&])_=[^&]*/,Bb=/^(.*?):[ \t]*([^\r\n]*)$/gm,Cb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Db=/^(?:GET|HEAD)$/,Eb=/^\/\//,Fb={},Gb={},Hb="*/".concat("*"),Ib=d.createElement("a");Ib.href=qb.href;function Jb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(K)||[];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 Kb(a,b,c,d){var e={},f=a===Gb;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 Lb(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 Mb(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 Nb(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:qb.href,type:"GET",isLocal:Cb.test(qb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Hb,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?Lb(Lb(a,r.ajaxSettings),b):Lb(r.ajaxSettings,a)},ajaxPrefilter:Jb(Fb),ajaxTransport:Jb(Gb),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=Bb.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||qb.href)+"").replace(Eb,qb.protocol+"//"),o.type=c.method||c.type||o.method||o.type,o.dataTypes=(o.dataType||"*").toLowerCase().match(K)||[""],null==o.crossDomain){j=d.createElement("a");try{j.href=o.url,j.href=j.href,o.crossDomain=Ib.protocol+"//"+Ib.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)),Kb(Fb,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=!Db.test(o.type),f=o.url.replace(zb,""),o.hasContent?o.data&&o.processData&&0===(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&(o.data=o.data.replace(yb,"+")):(n=o.url.slice(f.length),o.data&&(f+=(sb.test(f)?"&":"?")+o.data,delete o.data),o.cache===!1&&(f=f.replace(Ab,"$1"),n=(sb.test(f)?"&":"?")+"_="+rb++ +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]?", "+Hb+"; 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=Kb(Gb,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=Mb(o,y,d)),v=Nb(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 Ob={0:200,1223:204},Pb=r.ajaxSettings.xhr();o.cors=!!Pb&&"withCredentials"in Pb,o.ajax=Pb=!!Pb,r.ajaxTransport(function(b){var c,d;if(o.cors||Pb&&!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(Ob[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 Qb=[],Rb=/(=)\?(?=&|$)|\?\?/;r.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Qb.pop()||r.expando+"_"+rb++;return this[a]=!0,a}}),r.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Rb.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Rb.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(Rb,"$1"+e):b.jsonp!==!1&&(b.url+=(sb.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,Qb.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=B.exec(a),g=!c&&[],f?[b.createElement(f[1])]:(f=pa([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=mb(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};function Sb(a){return r.isWindow(a)?a:9===a.nodeType&&a.defaultView}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(),d.width||d.height?(e=f.ownerDocument,c=Sb(e),b=e.documentElement,{top:d.top+c.pageYOffset-b.clientTop,left:d.left+c.pageXOffset-b.clientLeft}):d):{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(),r.nodeName(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||qa})}}),r.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c="pageYOffset"===b;r.fn[a]=function(d){return S(this,function(a,d,e){var f=Sb(a);return 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]=Oa(o.pixelPosition,function(a,c){if(c)return c=Na(a,b),La.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 S(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.parseJSON=JSON.parse,"function"==typeof define&&define.amd&&define("jquery",[],function(){return r});var Tb=a.jQuery,Ub=a.$;return r.noConflict=function(b){return a.$===r&&(a.$=Ub),b&&a.jQuery===r&&(a.jQuery=Tb),r},b||(a.jQuery=a.$=r),r}); ;"use strict";(function(t){function r(t){return parseInt(t)===t}function n(t){if(!r(t.length)){return false}for(var e=0;e<t.length;e++){if(!r(t[e])||t[e]<0||t[e]>255){return false}}return true}function o(t,e){if(t.buffer&&ArrayBuffer.isView(t)&&t.name==="Uint8Array"){if(e){if(t.slice){t=t.slice()}else{t=Array.prototype.slice.call(t)}}return t}if(Array.isArray(t)){if(!n(t)){throw new Error("Array contains invalid value: "+t)}return new Uint8Array(t)}if(r(t.length)&&n(t)){return new Uint8Array(t)}throw new Error("unsupported array-like object")}function c(t){return new Uint8Array(t)}function a(t,e,r,n,i){if(n!=null||i!=null){if(t.slice){t=t.slice(n,i)}else{t=Array.prototype.slice.call(t,n,i)}}e.set(t,r)}var e=function(){function t(t){var e=[],r=0;t=encodeURI(t);while(r<t.length){var n=t.charCodeAt(r++);if(n===37){e.push(parseInt(t.substr(r,2),16));r+=2}else{e.push(n)}}return o(e)}function e(t){var e=[],r=0;while(r<t.length){var n=t[r];if(n<128){e.push(String.fromCharCode(n));r++}else if(n>191&&n<224){e.push(String.fromCharCode((n&31)<<6|t[r+1]&63));r+=2}else{e.push(String.fromCharCode((n&15)<<12|(t[r+1]&63)<<6|t[r+2]&63));r+=3}}return e.join("")}return{toBytes:t,fromBytes:e}}();var i=function(){function t(t){var e=[];for(var r=0;r<t.length;r+=2){e.push(parseInt(t.substr(r,2),16))}return e}var i="0123456789abcdef";function e(t){var e=[];for(var r=0;r<t.length;r++){var n=t[r];e.push(i[(n&240)>>4]+i[n&15])}return e.join("")}return{toBytes:t,fromBytes:e}}();var h={16:10,24:12,32:14};var d=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145];var p=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22];var u=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125];var l=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986];var f=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766];var v=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126];var m=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436];var g=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890];var y=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935];var b=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600];var _=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480];var A=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795];var I=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855];var S=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150];var k=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function C(t){var e=[];for(var r=0;r<t.length;r+=4){e.push(t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3])}return e}var s=function(t){if(!(this instanceof s)){throw Error("AES must be instanitated with `new`")}Object.defineProperty(this,"key",{value:o(t,true)});this._prepare()};s.prototype._prepare=function(){var t=h[this.key.length];if(t==null){throw new Error("invalid key size (must be 16, 24 or 32 bytes)")}this._Ke=[];this._Kd=[];for(var e=0;e<=t;e++){this._Ke.push([0,0,0,0]);this._Kd.push([0,0,0,0])}var r=(t+1)*4;var n=this.key.length/4;var i=C(this.key);var o;for(var e=0;e<n;e++){o=e>>2;this._Ke[o][e%4]=i[e];this._Kd[t-o][e%4]=i[e]}var a=0;var s=n,c;while(s<r){c=i[n-1];i[0]^=p[c>>16&255]<<24^p[c>>8&255]<<16^p[c&255]<<8^p[c>>24&255]^d[a]<<24;a+=1;if(n!=8){for(var e=1;e<n;e++){i[e]^=i[e-1]}}else{for(var e=1;e<n/2;e++){i[e]^=i[e-1]}c=i[n/2-1];i[n/2]^=p[c&255]^p[c>>8&255]<<8^p[c>>16&255]<<16^p[c>>24&255]<<24;for(var e=n/2+1;e<n;e++){i[e]^=i[e-1]}}var e=0,u,l;while(e<n&&s<r){u=s>>2;l=s%4;this._Ke[u][l]=i[e];this._Kd[t-u][l]=i[e++];s++}}for(var u=1;u<t;u++){for(var l=0;l<4;l++){c=this._Kd[u][l];this._Kd[u][l]=A[c>>24&255]^I[c>>16&255]^S[c>>8&255]^k[c&255]}}};s.prototype.encrypt=function(t){if(t.length!=16){throw new Error("invalid plaintext size (must be 16 bytes)")}var e=this._Ke.length-1;var r=[0,0,0,0];var n=C(t);for(var i=0;i<4;i++){n[i]^=this._Ke[0][i]}for(var o=1;o<e;o++){for(var i=0;i<4;i++){r[i]=l[n[i]>>24&255]^f[n[(i+1)%4]>>16&255]^v[n[(i+2)%4]>>8&255]^m[n[(i+3)%4]&255]^this._Ke[o][i]}n=r.slice()}var a=c(16),s;for(var i=0;i<4;i++){s=this._Ke[e][i];a[4*i]=(p[n[i]>>24&255]^s>>24)&255;a[4*i+1]=(p[n[(i+1)%4]>>16&255]^s>>16)&255;a[4*i+2]=(p[n[(i+2)%4]>>8&255]^s>>8)&255;a[4*i+3]=(p[n[(i+3)%4]&255]^s)&255}return a};s.prototype.decrypt=function(t){if(t.length!=16){throw new Error("invalid ciphertext size (must be 16 bytes)")}var e=this._Kd.length-1;var r=[0,0,0,0];var n=C(t);for(var i=0;i<4;i++){n[i]^=this._Kd[0][i]}for(var o=1;o<e;o++){for(var i=0;i<4;i++){r[i]=g[n[i]>>24&255]^y[n[(i+3)%4]>>16&255]^b[n[(i+2)%4]>>8&255]^_[n[(i+1)%4]&255]^this._Kd[o][i]}n=r.slice()}var a=c(16),s;for(var i=0;i<4;i++){s=this._Kd[e][i];a[4*i]=(u[n[i]>>24&255]^s>>24)&255;a[4*i+1]=(u[n[(i+3)%4]>>16&255]^s>>16)&255;a[4*i+2]=(u[n[(i+2)%4]>>8&255]^s>>8)&255;a[4*i+3]=(u[n[(i+1)%4]&255]^s)&255}return a};var E=function(t){if(!(this instanceof E)){throw Error("AES must be instanitated with `new`")}this.description="Electronic Code Block";this.name="ecb";this._aes=new s(t)};E.prototype.encrypt=function(t){t=o(t);if(t.length%16!==0){throw new Error("invalid plaintext size (must be multiple of 16 bytes)")}var e=c(t.length);var r=c(16);for(var n=0;n<t.length;n+=16){a(t,r,0,n,n+16);r=this._aes.encrypt(r);a(r,e,n)}return e};E.prototype.decrypt=function(t){t=o(t);if(t.length%16!==0){throw new Error("invalid ciphertext size (must be multiple of 16 bytes)")}var e=c(t.length);var r=c(16);for(var n=0;n<t.length;n+=16){a(t,r,0,n,n+16);r=this._aes.decrypt(r);a(r,e,n)}return e};var P=function(t,e){if(!(this instanceof P)){throw Error("AES must be instanitated with `new`")}this.description="Cipher Block Chaining";this.name="cbc";if(!e){e=c(16)}else if(e.length!=16){throw new Error("invalid initialation vector size (must be 16 bytes)")}this._lastCipherblock=o(e,true);this._aes=new s(t)};P.prototype.encrypt=function(t){t=o(t);if(t.length%16!==0){throw new Error("invalid plaintext size (must be multiple of 16 bytes)")}var e=c(t.length);var r=c(16);for(var n=0;n<t.length;n+=16){a(t,r,0,n,n+16);for(var i=0;i<16;i++){r[i]^=this._lastCipherblock[i]}this._lastCipherblock=this._aes.encrypt(r);a(this._lastCipherblock,e,n)}return e};P.prototype.decrypt=function(t){t=o(t);if(t.length%16!==0){throw new Error("invalid ciphertext size (must be multiple of 16 bytes)")}var e=c(t.length);var r=c(16);for(var n=0;n<t.length;n+=16){a(t,r,0,n,n+16);r=this._aes.decrypt(r);for(var i=0;i<16;i++){e[n+i]=r[i]^this._lastCipherblock[i]}a(t,this._lastCipherblock,0,n,n+16)}return e};var w=function(t,e,r){if(!(this instanceof w)){throw Error("AES must be instanitated with `new`")}this.description="Cipher Feedback";this.name="cfb";if(!e){e=c(16)}else if(e.length!=16){throw new Error("invalid initialation vector size (must be 16 size)")}if(!r){r=1}this.segmentSize=r;this._shiftRegister=o(e,true);this._aes=new s(t)};w.prototype.encrypt=function(t){if(t.length%this.segmentSize!=0){throw new Error("invalid plaintext size (must be segmentSize bytes)")}var e=o(t,true);var r;for(var n=0;n<e.length;n+=this.segmentSize){r=this._aes.encrypt(this._shiftRegister);for(var i=0;i<this.segmentSize;i++){e[n+i]^=r[i]}a(this._shiftRegister,this._shiftRegister,0,this.segmentSize);a(e,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return e};w.prototype.decrypt=function(t){if(t.length%this.segmentSize!=0){throw new Error("invalid ciphertext size (must be segmentSize bytes)")}var e=o(t,true);var r;for(var n=0;n<e.length;n+=this.segmentSize){r=this._aes.encrypt(this._shiftRegister);for(var i=0;i<this.segmentSize;i++){e[n+i]^=r[i]}a(this._shiftRegister,this._shiftRegister,0,this.segmentSize);a(t,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return e};var R=function(t,e){if(!(this instanceof R)){throw Error("AES must be instanitated with `new`")}this.description="Output Feedback";this.name="ofb";if(!e){e=c(16)}else if(e.length!=16){throw new Error("invalid initialation vector size (must be 16 bytes)")}this._lastPrecipher=o(e,true);this._lastPrecipherIndex=16;this._aes=new s(t)};R.prototype.encrypt=function(t){var e=o(t,true);for(var r=0;r<e.length;r++){if(this._lastPrecipherIndex===16){this._lastPrecipher=this._aes.encrypt(this._lastPrecipher);this._lastPrecipherIndex=0}e[r]^=this._lastPrecipher[this._lastPrecipherIndex++]}return e};R.prototype.decrypt=R.prototype.encrypt;var D=function(t){if(!(this instanceof D)){throw Error("Counter must be instanitated with `new`")}if(t!==0&&!t){t=1}if(typeof t==="number"){this._counter=c(16);this.setValue(t)}else{this.setBytes(t)}};D.prototype.setValue=function(t){if(typeof t!=="number"||parseInt(t)!=t){throw new Error("invalid counter value (must be an integer)")}if(t>Number.MAX_SAFE_INTEGER){throw new Error("integer value out of safe range")}for(var e=15;e>=0;--e){this._counter[e]=t%256;t=parseInt(t/256)}};D.prototype.setBytes=function(t){t=o(t,true);if(t.length!=16){throw new Error("invalid counter bytes size (must be 16 bytes)")}this._counter=t};D.prototype.increment=function(){for(var t=15;t>=0;t--){if(this._counter[t]===255){this._counter[t]=0}else{this._counter[t]++;break}}};var T=function(t,e){if(!(this instanceof T)){throw Error("AES must be instanitated with `new`")}this.description="Counter";this.name="ctr";if(!(e instanceof D)){e=new D(e)}this._counter=e;this._remainingCounter=null;this._remainingCounterIndex=16;this._aes=new s(t)};T.prototype.encrypt=function(t){var e=o(t,true);for(var r=0;r<e.length;r++){if(this._remainingCounterIndex===16){this._remainingCounter=this._aes.encrypt(this._counter._counter);this._remainingCounterIndex=0;this._counter.increment()}e[r]^=this._remainingCounter[this._remainingCounterIndex++]}return e};T.prototype.decrypt=T.prototype.encrypt;function L(t){t=o(t,true);var e=16-t.length%16;var r=c(t.length+e);a(t,r);for(var n=t.length;n<r.length;n++){r[n]=e}return r}function F(t){t=o(t,true);if(t.length<16){throw new Error("PKCS#7 invalid length")}var e=t[t.length-1];if(e>16){throw new Error("PKCS#7 padding byte out of range")}var r=t.length-e;for(var n=0;n<e;n++){if(t[r+n]!==e){throw new Error("PKCS#7 invalid padding byte")}}var i=c(r);a(t,i,0,0,r);return i}var M={AES:s,Counter:D,ModeOfOperation:{ecb:E,cbc:P,cfb:w,ofb:R,ctr:T},utils:{hex:i,utf8:e},padding:{pkcs7:{pad:L,strip:F}},_arrayTest:{coerceArray:o,createArray:c,copyArray:a}};if(t.aesjs){M._aesjs=t.aesjs}t.aesjs=M})(this);(function(t){"use strict";var d="input is invalid type";var p=!t.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer!=="undefined";var u="0123456789abcdef".split("");var r=[-2147483648,8388608,32768,128];var c=[24,16,8,0];var _=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];var i=["hex","array","digest","arrayBuffer"];var n=[];if(t.JS_SHA256_NO_NODE_JS||!Array.isArray){Array.isArray=function(t){return Object.prototype.toString.call(t)==="[object Array]"}}if(p&&(t.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)){ArrayBuffer.isView=function(t){return typeof t==="object"&&t.buffer&&t.buffer.constructor===ArrayBuffer}}var o=function(e,r){return function(t){return new f(r,true).update(t)[e]()}};var e=function(t){var e=o("hex",t);e.create=function(){return new f(t)};e.update=function(t){return e.create().update(t)};for(var r=0;r<i.length;++r){var n=i[r];e[n]=o(n,t)}return e};var a=function(r,n){return function(t,e){return new l(t,n,true).update(e)[r]()}};var s=function(e){var r=a("hex",e);r.create=function(t){return new l(t,e)};r.update=function(t,e){return r.create(t).update(e)};for(var t=0;t<i.length;++t){var n=i[t];r[n]=a(n,e)}return r};function f(t,e){if(e){n[0]=n[16]=n[1]=n[2]=n[3]=n[4]=n[5]=n[6]=n[7]=n[8]=n[9]=n[10]=n[11]=n[12]=n[13]=n[14]=n[15]=0;this.blocks=n}else{this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}if(t){this.h0=3238371032;this.h1=914150663;this.h2=812702999;this.h3=4144912697;this.h4=4290775857;this.h5=1750603025;this.h6=1694076839;this.h7=3204075428}else{this.h0=1779033703;this.h1=3144134277;this.h2=1013904242;this.h3=2773480762;this.h4=1359893119;this.h5=2600822924;this.h6=528734635;this.h7=1541459225}this.block=this.start=this.bytes=this.hBytes=0;this.finalized=this.hashed=false;this.first=true;this.is224=t}f.prototype.update=function(t){if(this.finalized){return}var e,r=typeof t;if(r!=="string"){if(r==="object"){if(t===null){throw new Error(d)}else if(p&&t.constructor===ArrayBuffer){t=new Uint8Array(t)}else if(!Array.isArray(t)){if(!p||!ArrayBuffer.isView(t)){throw new Error(d)}}}else{throw new Error(d)}e=true}var n,i=0,o,a=t.length,s=this.blocks;while(i<a){if(this.hashed){this.hashed=false;s[0]=this.block;s[16]=s[1]=s[2]=s[3]=s[4]=s[5]=s[6]=s[7]=s[8]=s[9]=s[10]=s[11]=s[12]=s[13]=s[14]=s[15]=0}if(e){for(o=this.start;i<a&&o<64;++i){s[o>>2]|=t[i]<<c[o++&3]}}else{for(o=this.start;i<a&&o<64;++i){n=t.charCodeAt(i);if(n<128){s[o>>2]|=n<<c[o++&3]}else if(n<2048){s[o>>2]|=(192|n>>6)<<c[o++&3];s[o>>2]|=(128|n&63)<<c[o++&3]}else if(n<55296||n>=57344){s[o>>2]|=(224|n>>12)<<c[o++&3];s[o>>2]|=(128|n>>6&63)<<c[o++&3];s[o>>2]|=(128|n&63)<<c[o++&3]}else{n=65536+((n&1023)<<10|t.charCodeAt(++i)&1023);s[o>>2]|=(240|n>>18)<<c[o++&3];s[o>>2]|=(128|n>>12&63)<<c[o++&3];s[o>>2]|=(128|n>>6&63)<<c[o++&3];s[o>>2]|=(128|n&63)<<c[o++&3]}}}this.lastByteIndex=o;this.bytes+=o-this.start;if(o>=64){this.block=s[16];this.start=o-64;this.hash();this.hashed=true}else{this.start=o}}if(this.bytes>4294967295){this.hBytes+=this.bytes/4294967296<<0;this.bytes=this.bytes%4294967296}return this};f.prototype.finalize=function(){if(this.finalized){return}this.finalized=true;var t=this.blocks,e=this.lastByteIndex;t[16]=this.block;t[e>>2]|=r[e&3];this.block=t[16];if(e>=56){if(!this.hashed){this.hash()}t[0]=this.block;t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0}t[14]=this.hBytes<<3|this.bytes>>>29;t[15]=this.bytes<<3;this.hash()};f.prototype.hash=function(){var t=this.h0,e=this.h1,r=this.h2,n=this.h3,i=this.h4,o=this.h5,a=this.h6,s=this.h7,c=this.blocks,u,l,h,d,p,f,v,m,g,y,b;for(u=16;u<64;++u){p=c[u-15];l=(p>>>7|p<<25)^(p>>>18|p<<14)^p>>>3;p=c[u-2];h=(p>>>17|p<<15)^(p>>>19|p<<13)^p>>>10;c[u]=c[u-16]+l+c[u-7]+h<<0}b=e&r;for(u=0;u<64;u+=4){if(this.first){if(this.is224){m=300032;p=c[0]-1413257819;s=p-150054599<<0;n=p+24177077<<0}else{m=704751109;p=c[0]-210244248;s=p-1521486534<<0;n=p+143694565<<0}this.first=false}else{l=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10);h=(i>>>6|i<<26)^(i>>>11|i<<21)^(i>>>25|i<<7);m=t&e;d=m^t&r^b;v=i&o^~i&a;p=s+h+v+_[u]+c[u];f=l+d;s=n+p<<0;n=p+f<<0}l=(n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10);h=(s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7);g=n&t;d=g^n&e^m;v=s&i^~s&o;p=a+h+v+_[u+1]+c[u+1];f=l+d;a=r+p<<0;r=p+f<<0;l=(r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10);h=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7);y=r&n;d=y^r&t^g;v=a&s^~a&i;p=o+h+v+_[u+2]+c[u+2];f=l+d;o=e+p<<0;e=p+f<<0;l=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10);h=(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7);b=e&r;d=b^e&n^y;v=o&a^~o&s;p=i+h+v+_[u+3]+c[u+3];f=l+d;i=t+p<<0;t=p+f<<0}this.h0=this.h0+t<<0;this.h1=this.h1+e<<0;this.h2=this.h2+r<<0;this.h3=this.h3+n<<0;this.h4=this.h4+i<<0;this.h5=this.h5+o<<0;this.h6=this.h6+a<<0;this.h7=this.h7+s<<0};f.prototype.hex=function(){this.finalize();var t=this.h0,e=this.h1,r=this.h2,n=this.h3,i=this.h4,o=this.h5,a=this.h6,s=this.h7;var c=u[t>>28&15]+u[t>>24&15]+u[t>>20&15]+u[t>>16&15]+u[t>>12&15]+u[t>>8&15]+u[t>>4&15]+u[t&15]+u[e>>28&15]+u[e>>24&15]+u[e>>20&15]+u[e>>16&15]+u[e>>12&15]+u[e>>8&15]+u[e>>4&15]+u[e&15]+u[r>>28&15]+u[r>>24&15]+u[r>>20&15]+u[r>>16&15]+u[r>>12&15]+u[r>>8&15]+u[r>>4&15]+u[r&15]+u[n>>28&15]+u[n>>24&15]+u[n>>20&15]+u[n>>16&15]+u[n>>12&15]+u[n>>8&15]+u[n>>4&15]+u[n&15]+u[i>>28&15]+u[i>>24&15]+u[i>>20&15]+u[i>>16&15]+u[i>>12&15]+u[i>>8&15]+u[i>>4&15]+u[i&15]+u[o>>28&15]+u[o>>24&15]+u[o>>20&15]+u[o>>16&15]+u[o>>12&15]+u[o>>8&15]+u[o>>4&15]+u[o&15]+u[a>>28&15]+u[a>>24&15]+u[a>>20&15]+u[a>>16&15]+u[a>>12&15]+u[a>>8&15]+u[a>>4&15]+u[a&15];if(!this.is224){c+=u[s>>28&15]+u[s>>24&15]+u[s>>20&15]+u[s>>16&15]+u[s>>12&15]+u[s>>8&15]+u[s>>4&15]+u[s&15]}return c};f.prototype.toString=f.prototype.hex;f.prototype.digest=function(){this.finalize();var t=this.h0,e=this.h1,r=this.h2,n=this.h3,i=this.h4,o=this.h5,a=this.h6,s=this.h7;var c=[t>>24&255,t>>16&255,t>>8&255,t&255,e>>24&255,e>>16&255,e>>8&255,e&255,r>>24&255,r>>16&255,r>>8&255,r&255,n>>24&255,n>>16&255,n>>8&255,n&255,i>>24&255,i>>16&255,i>>8&255,i&255,o>>24&255,o>>16&255,o>>8&255,o&255,a>>24&255,a>>16&255,a>>8&255,a&255];if(!this.is224){c.push(s>>24&255,s>>16&255,s>>8&255,s&255)}return c};f.prototype.array=f.prototype.digest;f.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(this.is224?28:32);var e=new DataView(t);e.setUint32(0,this.h0);e.setUint32(4,this.h1);e.setUint32(8,this.h2);e.setUint32(12,this.h3);e.setUint32(16,this.h4);e.setUint32(20,this.h5);e.setUint32(24,this.h6);if(!this.is224){e.setUint32(28,this.h7)}return t};function l(t,e,r){var n,i=typeof t;if(i==="string"){var o=[],a=t.length,s=0,c;for(n=0;n<a;++n){c=t.charCodeAt(n);if(c<128){o[s++]=c}else if(c<2048){o[s++]=192|c>>6;o[s++]=128|c&63}else if(c<55296||c>=57344){o[s++]=224|c>>12;o[s++]=128|c>>6&63;o[s++]=128|c&63}else{c=65536+((c&1023)<<10|t.charCodeAt(++n)&1023);o[s++]=240|c>>18;o[s++]=128|c>>12&63;o[s++]=128|c>>6&63;o[s++]=128|c&63}}t=o}else{if(i==="object"){if(t===null){throw new Error(d)}else if(p&&t.constructor===ArrayBuffer){t=new Uint8Array(t)}else if(!Array.isArray(t)){if(!p||!ArrayBuffer.isView(t)){throw new Error(d)}}}else{throw new Error(d)}}if(t.length>64){t=new f(e,true).update(t).array()}var u=[],l=[];for(n=0;n<64;++n){var h=t[n]||0;u[n]=92^h;l[n]=54^h}f.call(this,e,r);this.update(l);this.oKeyPad=u;this.inner=true;this.sharedMemory=r}l.prototype=new f;l.prototype.finalize=function(){f.prototype.finalize.call(this);if(this.inner){this.inner=false;var t=this.array();f.call(this,this.is224,this.sharedMemory);this.update(this.oKeyPad);this.update(t);f.prototype.finalize.call(this)}};var h=e();h.sha256=h;h.sha224=e(true);h.sha256.hmac=s();h.sha224.hmac=s(true);t.sha256=h.sha256;t.sha224=h.sha224})(this);!function(t){{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.elliptic=t()}}(function(){return function o(a,s,c){function u(r,t){if(!s[r]){if(!a[r]){var e="function"==typeof require&&require;if(!t&&e)return e(r,!0);if(l)return l(r,!0);var n=new Error("Cannot find module '"+r+"'");throw n.code="MODULE_NOT_FOUND",n}var i=s[r]={exports:{}};a[r][0].call(i.exports,function(t){var e=a[r][1][t];return u(e?e:t)},i,i.exports,o,a,s,c)}return s[r].exports}for(var l="function"==typeof require&&require,t=0;t<c.length;t++)u(c[t]);return u}({1:[function(t,e,r){"use strict";var n=r;n.version=t("../package.json").version,n.utils=t("./elliptic/utils"),n.rand=t("brorand"),n.curve=t("./elliptic/curve"),n.curves=t("./elliptic/curves"),n.ec=t("./elliptic/ec"),n.eddsa=t("./elliptic/eddsa")},{"../package.json":30,"./elliptic/curve":4,"./elliptic/curves":7,"./elliptic/ec":8,"./elliptic/eddsa":11,"./elliptic/utils":15,brorand:17}],2:[function(t,e,r){"use strict";function n(t,e){this.type=t,this.p=new o(e.p,16),this.red=e.prime?o.red(e.prime):o.mont(this.p),this.zero=new o(0).toRed(this.red),this.one=new o(1).toRed(this.red),this.two=new o(2).toRed(this.red),this.n=e.n&&new o(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function i(t,e){this.curve=t,this.type=e,this.precomputed=null}var o=t("bn.js"),a=t("../../elliptic"),s=a.utils,C=s.getNAF,E=s.getJSF,h=s.assert;e.exports=n,n.prototype.point=function(){throw new Error("Not implemented")},n.prototype.validate=function(){throw new Error("Not implemented")},n.prototype._fixedNafMul=function(t,e){h(t.precomputed);var r=t._getDoubles(),n=C(e,1),i=(1<<r.step+1)-(r.step%2===0?2:1);i/=3;for(var o=[],a=0;a<n.length;a+=r.step){for(var s=0,e=a+r.step-1;e>=a;e--)s=(s<<1)+n[e];o.push(s)}for(var c=this.jpoint(null,null,null),u=this.jpoint(null,null,null),l=i;l>0;l--){for(var a=0;a<o.length;a++){var s=o[a];s===l?u=u.mixedAdd(r.points[a]):s===-l&&(u=u.mixedAdd(r.points[a].neg()))}c=c.add(u)}return c.toP()},n.prototype._wnafMul=function(t,e){var r=4,n=t._getNAFPoints(r);r=n.wnd;for(var i=n.points,o=C(e,r),a=this.jpoint(null,null,null),s=o.length-1;s>=0;s--){for(var e=0;s>=0&&0===o[s];s--)e++;if(s>=0&&e++,a=a.dblp(e),s<0)break;var c=o[s];h(0!==c),a="affine"===t.type?c>0?a.mixedAdd(i[c-1>>1]):a.mixedAdd(i[-c-1>>1].neg()):c>0?a.add(i[c-1>>1]):a.add(i[-c-1>>1].neg())}return"affine"===t.type?a.toP():a},n.prototype._wnafMulAdd=function(t,e,r,n,i){for(var o=this._wnafT1,a=this._wnafT2,s=this._wnafT3,c=0,u=0;u<n;u++){var l=e[u],h=l._getNAFPoints(t);o[u]=h.wnd,a[u]=h.points}for(var u=n-1;u>=1;u-=2){var d=u-1,p=u;if(1===o[d]&&1===o[p]){var f=[e[d],null,null,e[p]];0===e[d].y.cmp(e[p].y)?(f[1]=e[d].add(e[p]),f[2]=e[d].toJ().mixedAdd(e[p].neg())):0===e[d].y.cmp(e[p].y.redNeg())?(f[1]=e[d].toJ().mixedAdd(e[p]),f[2]=e[d].add(e[p].neg())):(f[1]=e[d].toJ().mixedAdd(e[p]),f[2]=e[d].toJ().mixedAdd(e[p].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],m=E(r[d],r[p]);c=Math.max(m[0].length,c),s[d]=new Array(c),s[p]=new Array(c);for(var g=0;g<c;g++){var y=0|m[0][g],b=0|m[1][g];s[d][g]=v[3*(y+1)+(b+1)],s[p][g]=0,a[d]=f}}else s[d]=C(r[d],o[d]),s[p]=C(r[p],o[p]),c=Math.max(s[d].length,c),c=Math.max(s[p].length,c)}for(var _=this.jpoint(null,null,null),A=this._wnafT4,u=c;u>=0;u--){for(var I=0;u>=0;){for(var S=!0,g=0;g<n;g++)A[g]=0|s[g][u],0!==A[g]&&(S=!1);if(!S)break;I++,u--}if(u>=0&&I++,_=_.dblp(I),u<0)break;for(var g=0;g<n;g++){var l,k=A[g];0!==k&&(k>0?l=a[g][k-1>>1]:k<0&&(l=a[g][-k-1>>1].neg()),_="affine"===l.type?_.mixedAdd(l):_.add(l))}}for(var u=0;u<n;u++)a[u]=null;return i?_:_.toP()},n.BasePoint=i,i.prototype.eq=function(){throw new Error("Not implemented")},i.prototype.validate=function(){return this.curve.validate(this)},n.prototype.decodePoint=function(t,e){t=s.toArray(t,e);var r=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1===2*r){6===t[0]?h(t[t.length-1]%2===0):7===t[0]&&h(t[t.length-1]%2===1);var n=this.point(t.slice(1,1+r),t.slice(1+r,1+2*r));return n}if((2===t[0]||3===t[0])&&t.length-1===r)return this.pointFromX(t.slice(1,1+r),3===t[0]);throw new Error("Unknown point format")},i.prototype.encodeCompressed=function(t){return this.encode(t,!0)},i.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},i.prototype.encode=function(t,e){return s.encode(this._encode(e),t)},i.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},i.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},i.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<e;i+=t){for(var o=0;o<t;o++)n=n.dbl();r.push(n)}return{step:t,points:r}},i.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)e[i]=e[i-1].add(n);return{wnd:t,points:e}},i.prototype._getBeta=function(){return null},i.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e}},{"../../elliptic":1,"bn.js":16}],3:[function(t,e,r){"use strict";function n(t){this.twisted=1!==(0|t.a),this.mOneA=this.twisted&&(0|t.a)===-1,this.extended=this.mOneA,u.call(this,"edwards",t),this.a=new c(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new c(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new c(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),l(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1===(0|t.c)}function i(t,e,r,n,i){u.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new c(e,16),this.y=new c(r,16),this.z=n?new c(n,16):this.curve.one,this.t=i&&new c(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}var o=t("../curve"),a=t("../../elliptic"),c=t("bn.js"),s=t("inherits"),u=o.base,l=a.utils.assert;s(n,u),e.exports=n,n.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},n.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},n.prototype.jpoint=function(t,e,r,n){return this.point(t,e,r,n)},n.prototype.pointFromX=function(t,e){t=new c(t,16),t.red||(t=t.toRed(this.red));var r=t.redSqr(),n=this.c2.redSub(this.a.redMul(r)),i=this.one.redSub(this.c2.redMul(this.d).redMul(r)),o=n.redMul(i.redInvm()),a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var s=a.fromRed().isOdd();return(e&&!s||!e&&s)&&(a=a.redNeg()),this.point(t,a)},n.prototype.pointFromY=function(t,e){t=new c(t,16),t.red||(t=t.toRed(this.red));var r=t.redSqr(),n=r.redSub(this.one),i=r.redMul(this.d).redAdd(this.one),o=n.redMul(i.redInvm());if(0===o.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return a.isOdd()!==e&&(a=a.redNeg()),this.point(a,t)},n.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),n=e.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===n.cmp(i)},s(i,u.BasePoint),n.prototype.pointFromJSON=function(t){return i.fromJSON(this,t)},n.prototype.point=function(t,e,r,n){return new i(this,t,e,r,n)},i.fromJSON=function(t,e){return new i(t,e[0],e[1],e[2])},i.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},i.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},i.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(t),i=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=n.redAdd(e),a=o.redSub(r),s=n.redSub(e),c=i.redMul(a),u=o.redMul(s),l=i.redMul(s),h=a.redMul(o);return this.curve.point(c,u,h,l)},i.prototype._projDbl=function(){var t,e,r,n=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var a=this.curve._mulA(i),s=a.redAdd(o);if(this.zOne)t=n.redSub(i).redSub(o).redMul(s.redSub(this.curve.two)),e=s.redMul(a.redSub(o)),r=s.redSqr().redSub(s).redSub(s);else{var c=this.z.redSqr(),u=s.redSub(c).redISub(c);t=n.redSub(i).redISub(o).redMul(u),e=s.redMul(a.redSub(o)),r=s.redMul(u)}}else{var a=i.redAdd(o),c=this.curve._mulC(this.c.redMul(this.z)).redSqr(),u=a.redSub(c).redSub(c);t=this.curve._mulC(n.redISub(a)).redMul(u),e=this.curve._mulC(a).redMul(i.redISub(o)),r=a.redMul(u)}return this.curve.point(t,e,r)},i.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},i.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),i=this.z.redMul(t.z.redAdd(t.z)),o=r.redSub(e),a=i.redSub(n),s=i.redAdd(n),c=r.redAdd(e),u=o.redMul(a),l=s.redMul(c),h=o.redMul(c),d=a.redMul(s);return this.curve.point(u,l,d,h)},i.prototype._projAdd=function(t){var e,r,n=this.z.redMul(t.z),i=n.redSqr(),o=this.x.redMul(t.x),a=this.y.redMul(t.y),s=this.curve.d.redMul(o).redMul(a),c=i.redSub(s),u=i.redAdd(s),l=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(a),h=n.redMul(c).redMul(l);return this.curve.twisted?(e=n.redMul(u).redMul(a.redSub(this.curve._mulA(o))),r=c.redMul(u)):(e=n.redMul(u).redMul(a.redSub(o)),r=this.curve._mulC(c).redMul(u)),this.curve.point(h,e,r)},i.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},i.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},i.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},i.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},i.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},i.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},i.prototype.getX=function(){return this.normalize(),this.x.fromRed()},i.prototype.getY=function(){return this.normalize(),this.y.fromRed()},i.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},i.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(n),0===this.x.cmp(e))return!0}return!1},i.prototype.toP=i.prototype.normalize,i.prototype.mixedAdd=i.prototype.add},{"../../elliptic":1,"../curve":4,"bn.js":16,inherits:27}],4:[function(t,e,r){"use strict";var n=r;n.base=t("./base"),n["short"]=t("./short"),n.mont=t("./mont"),n.edwards=t("./edwards")},{"./base":2,"./edwards":3,"./mont":5,"./short":6}],5:[function(t,e,r){"use strict";function n(t){c.call(this,"mont",t),this.a=new a(t.a,16).toRed(this.red),this.b=new a(t.b,16).toRed(this.red),this.i4=new a(4).toRed(this.red).redInvm(),this.two=new a(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function i(t,e,r){c.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new a(e,16),this.z=new a(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}var o=t("../curve"),a=t("bn.js"),s=t("inherits"),c=o.base,u=t("../../elliptic"),l=u.utils;s(n,c),e.exports=n,n.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),n=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e),i=n.redSqrt();return 0===i.redSqr().cmp(n)},s(i,c.BasePoint),n.prototype.decodePoint=function(t,e){return this.point(l.toArray(t,e),1)},n.prototype.point=function(t,e){return new i(this,t,e)},n.prototype.pointFromJSON=function(t){return i.fromJSON(this,t)},i.prototype.precompute=function(){},i.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},i.fromJSON=function(t,e){return new i(t,e[0],e[1]||t.one)},i.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},i.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},i.prototype.dbl=function(){var t=this.x.redAdd(this.z),e=t.redSqr(),r=this.x.redSub(this.z),n=r.redSqr(),i=e.redSub(n),o=e.redMul(n),a=i.redMul(n.redAdd(this.curve.a24.redMul(i)));return this.curve.point(o,a)},i.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=t.x.redAdd(t.z),o=t.x.redSub(t.z),a=o.redMul(r),s=i.redMul(n),c=e.z.redMul(a.redAdd(s).redSqr()),u=e.x.redMul(a.redISub(s).redSqr());return this.curve.point(c,u)},i.prototype.mul=function(t){for(var e=t.clone(),r=this,n=this.curve.point(null,null),i=this,o=[];0!==e.cmpn(0);e.iushrn(1))o.push(e.andln(1));for(var a=o.length-1;a>=0;a--)0===o[a]?(r=r.diffAdd(n,i),n=n.dbl()):(n=r.diffAdd(n,i),r=r.dbl());return n},i.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},i.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},i.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../../elliptic":1,"../curve":4,"bn.js":16,inherits:27}],6:[function(t,e,r){"use strict";function n(t){u.call(this,"short",t),this.a=new I(t.a,16).toRed(this.red),this.b=new I(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function i(t,e,r,n){u.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new I(e,16),this.y=new I(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function o(t,e,r,n){u.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new I(0)):(this.x=new I(e,16),this.y=new I(r,16),this.z=new I(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}var a=t("../curve"),s=t("../../elliptic"),I=t("bn.js"),c=t("inherits"),u=a.base,l=s.utils.assert;c(n,u),e.exports=n,n.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new I(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=n[0].cmp(n[1])<0?n[0]:n[1],e=e.toRed(this.red)}if(t.lambda)r=new I(t.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(e))?r=i[0]:(r=i[1],l(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}var o;return o=t.basis?t.basis.map(function(t){return{a:new I(t.a,16),b:new I(t.b,16)}}):this._getEndoBasis(r),{beta:e,lambda:r,basis:o}}},n.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:I.mont(t),r=new I(2).toRed(e).redInvm(),n=r.redNeg(),i=new I(3).toRed(e).redNeg().redSqrt().redMul(r),o=n.redAdd(i).fromRed(),a=n.redSub(i).fromRed();return[o,a]},n.prototype._getEndoBasis=function(t){for(var e,r,n,i,o,a,s,c,u,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=t,d=this.n.clone(),p=new I(1),f=new I(0),v=new I(0),m=new I(1),g=0;0!==h.cmpn(0);){var y=d.div(h);c=d.sub(y.mul(h)),u=v.sub(y.mul(p));var b=m.sub(y.mul(f));if(!n&&c.cmp(l)<0)e=s.neg(),r=p,n=c.neg(),i=u;else if(n&&2===++g)break;s=c,d=h,h=c,v=p,p=u,m=f,f=b}o=c.neg(),a=u;var _=n.sqr().add(i.sqr()),A=o.sqr().add(a.sqr());return A.cmp(_)>=0&&(o=e,a=r),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:n,b:i},{a:o,b:a}]},n.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),c=i.mul(r.b),u=o.mul(n.b),l=t.sub(a).sub(s),h=c.add(u).neg();return{k1:l,k2:h}},n.prototype.pointFromX=function(t,e){t=new I(t,16),t.red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(e&&!i||!e&&i)&&(n=n.redNeg()),this.point(t,n)},n.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},n.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<t.length;o++){var a=this._endoSplit(e[o]),s=t[o],c=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),c=c.neg(!0)),n[2*o]=s,n[2*o+1]=c,i[2*o]=a.k1,i[2*o+1]=a.k2}for(var u=this._wnafMulAdd(1,n,i,2*o,r),l=0;l<2*o;l++)n[l]=null,i[l]=null;return u},c(i,u.BasePoint),n.prototype.point=function(t,e,r){return new i(this,t,e,r)},n.prototype.pointFromJSON=function(t,e){return i.fromJSON(this,t,e)},i.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,n=function(t){return r.point(t.x.redMul(r.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(n)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(n)}}}return e}},i.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},i.fromJSON=function(e,t,r){function n(t){return e.point(t[0],t[1],r)}"string"==typeof t&&(t=JSON.parse(t));var i=e.point(t[0],t[1],r);if(!t[2])return i;var o=t[2];return i.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[i].concat(o.doubles.points.map(n))},naf:o.naf&&{wnd:o.naf.wnd,points:[i].concat(o.naf.points.map(n))}},i},i.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},i.prototype.isInfinity=function(){return this.inf},i.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},i.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},i.prototype.getX=function(){return this.x.fromRed()},i.prototype.getY=function(){return this.y.fromRed()},i.prototype.mul=function(t){return t=new I(t,16),this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},i.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},i.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},i.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},i.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},i.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var t=this.curve.jpoint(this.x,this.y,this.curve.one);return t},c(o,u.BasePoint),n.prototype.jpoint=function(t,e,r){return new o(this,t,e,r)},o.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},o.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},o.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),a=t.y.redMul(r.redMul(this.z)),s=n.redSub(i),c=o.redSub(a);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),l=u.redMul(s),h=n.redMul(u),d=c.redSqr().redIAdd(l).redISub(h).redISub(h),p=c.redMul(h.redISub(d)).redISub(o.redMul(l)),f=this.z.redMul(t.z).redMul(s);return this.curve.jpoint(d,p,f)},o.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),u=c.redMul(a),l=r.redMul(c),h=s.redSqr().redIAdd(u).redISub(l).redISub(l),d=s.redMul(l.redISub(h)).redISub(i.redMul(u)),p=this.z.redMul(a);return this.curve.jpoint(h,d,p)},o.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,r=0;r<t;r++)e=e.dbl();return e}for(var n=this.curve.a,i=this.curve.tinv,o=this.x,a=this.y,s=this.z,c=s.redSqr().redSqr(),u=a.redAdd(a),r=0;r<t;r++){var l=o.redSqr(),h=u.redSqr(),d=h.redSqr(),p=l.redAdd(l).redIAdd(l).redIAdd(n.redMul(c)),f=o.redMul(h),v=p.redSqr().redISub(f.redAdd(f)),m=f.redISub(v),g=p.redMul(m);g=g.redIAdd(g).redISub(d);var y=u.redMul(s);r+1<t&&(c=c.redMul(d)),o=v,s=y,u=g}return this.curve.jpoint(o,u.redMul(i),s)},o.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},o.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n),c=s.redSqr().redISub(a).redISub(a),u=o.redIAdd(o);u=u.redIAdd(u),u=u.redIAdd(u),t=c,e=s.redMul(a.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),h=this.y.redSqr(),d=h.redSqr(),p=this.x.redAdd(h).redSqr().redISub(l).redISub(d);p=p.redIAdd(p);var f=l.redAdd(l).redIAdd(l),v=f.redSqr(),m=d.redIAdd(d);m=m.redIAdd(m),m=m.redIAdd(m),t=v.redISub(p).redISub(p),e=f.redMul(p.redISub(t)).redISub(m),r=this.y.redMul(this.z),r=r.redIAdd(r)}return this.curve.jpoint(t,e,r)},o.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),c=s.redSqr().redISub(a).redISub(a);t=c;var u=o.redIAdd(o);u=u.redIAdd(u),u=u.redIAdd(u),e=s.redMul(a.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),h=this.y.redSqr(),d=this.x.redMul(h),p=this.x.redSub(l).redMul(this.x.redAdd(l));p=p.redAdd(p).redIAdd(p);var f=d.redIAdd(d);f=f.redIAdd(f);var v=f.redAdd(f);t=p.redSqr().redISub(v),r=this.y.redAdd(this.z).redSqr().redISub(h).redISub(l);var m=h.redSqr();m=m.redIAdd(m),m=m.redIAdd(m),m=m.redIAdd(m),e=p.redMul(f.redISub(t)).redISub(m)}return this.curve.jpoint(t,e,r)},o.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=e.redSqr(),a=r.redSqr(),s=o.redAdd(o).redIAdd(o).redIAdd(t.redMul(i)),c=e.redAdd(e);c=c.redIAdd(c);var u=c.redMul(a),l=s.redSqr().redISub(u.redAdd(u)),h=u.redISub(l),d=a.redSqr();d=d.redIAdd(d),d=d.redIAdd(d),d=d.redIAdd(d);var p=s.redMul(h).redISub(d),f=r.redAdd(r).redMul(n);return this.curve.jpoint(l,p,f)},o.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),n=e.redSqr(),i=t.redAdd(t).redIAdd(t),o=i.redSqr(),a=this.x.redAdd(e).redSqr().redISub(t).redISub(n);a=a.redIAdd(a),a=a.redAdd(a).redIAdd(a),a=a.redISub(o);var s=a.redSqr(),c=n.redIAdd(n);c=c.redIAdd(c),c=c.redIAdd(c),c=c.redIAdd(c);var u=i.redIAdd(a).redSqr().redISub(o).redISub(s).redISub(c),l=e.redMul(u);l=l.redIAdd(l),l=l.redIAdd(l);var h=this.x.redMul(s).redISub(l);h=h.redIAdd(h),h=h.redIAdd(h);var d=this.y.redMul(u.redMul(c.redISub(u)).redISub(a.redMul(s)));d=d.redIAdd(d),d=d.redIAdd(d),d=d.redIAdd(d);var p=this.z.redAdd(a).redSqr().redISub(r).redISub(s);return this.curve.jpoint(h,d,p)},o.prototype.mul=function(t,e){return t=new I(t,e),this.curve._wnafMul(this,t)},o.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(0!==this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0))return!1;var n=e.redMul(this.z),i=r.redMul(t.z);return 0===this.y.redMul(i).redISub(t.y.redMul(n)).cmpn(0)},o.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(r))return!0;for(var n=t.clone(),i=this.curve.redN.redMul(e);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}return!1},o.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},o.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":1,"../curve":4,"bn.js":16,inherits:27}],7:[function(t,e,r){"use strict";function n(t){"short"===t.type?this.curve=new s.curve["short"](t):"edwards"===t.type?this.curve=new s.curve.edwards(t):this.curve=new s.curve.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,c(this.g.validate(),"Invalid curve"),c(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function i(e,r){Object.defineProperty(o,e,{configurable:!0,enumerable:!0,get:function(){var t=new n(r);return Object.defineProperty(o,e,{configurable:!0,enumerable:!0,value:t}),t}})}var o=r,a=t("hash.js"),s=t("../elliptic"),c=s.utils.assert;o.PresetCurve=n,i("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),i("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),i("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),i("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:a.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),i("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:a.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),i("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["9"]}),i("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var u;try{u=t("./precomputed/secp256k1")}catch(t){u=void 0}i("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",u]})},{"../elliptic":1,"./precomputed/secp256k1":14,"hash.js":19}],8:[function(t,e,r){"use strict";function n(t){return this instanceof n?("string"==typeof t&&(p(o.curves.hasOwnProperty(t),"Unknown curve "+t),t=o.curves[t]),t instanceof o.curves.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),void(this.hash=t.hash||t.curve.hash)):new n(t)}var m=t("bn.js"),g=t("hmac-drbg"),o=t("../../elliptic"),i=o.utils,p=i.assert,a=t("./key"),y=t("./signature");e.exports=n,n.prototype.keyPair=function(t){return new a(this,t)},n.prototype.keyFromPrivate=function(t,e){return a.fromPrivate(this,t,e)},n.prototype.keyFromPublic=function(t,e){return a.fromPublic(this,t,e)},n.prototype.genKeyPair=function(t){t||(t={});for(var e=new g({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||o.rand(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new m(2));;){var i=new m(e.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},n.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},n.prototype.sign=function(t,e,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new m(t,16));for(var i=this.n.byteLength(),o=e.getPrivate().toArray("be",i),a=t.toArray("be",i),s=new g({hash:this.hash,entropy:o,nonce:a,pers:n.pers,persEnc:n.persEnc||"utf8"}),c=this.n.sub(new m(1)),u=0;!0;u++){var l=n.k?n.k(u):new m(s.generate(this.n.byteLength()));if(l=this._truncateToN(l,!0),!(l.cmpn(1)<=0||l.cmp(c)>=0)){var h=this.g.mul(l);if(!h.isInfinity()){var d=h.getX(),p=d.umod(this.n);if(0!==p.cmpn(0)){var f=l.invm(this.n).mul(p.mul(e.getPrivate()).iadd(t));if(f=f.umod(this.n),0!==f.cmpn(0)){var v=(h.getY().isOdd()?1:0)|(0!==d.cmp(p)?2:0);return n.canonical&&f.cmp(this.nh)>0&&(f=this.n.sub(f),v^=1),new y({r:p,s:f,recoveryParam:v})}}}}}},n.prototype.verify=function(t,e,r,n){t=this._truncateToN(new m(t,16)),r=this.keyFromPublic(r,n),e=new y(e,"hex");var i=e.r,o=e.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a=o.invm(this.n),s=a.mul(t).umod(this.n),c=a.mul(i).umod(this.n);if(!this.curve._maxwellTrick){var u=this.g.mulAdd(s,r.getPublic(),c);return!u.isInfinity()&&0===u.getX().umod(this.n).cmp(i)}var u=this.g.jmulAdd(s,r.getPublic(),c);return!u.isInfinity()&&u.eqXToP(i)},n.prototype.recoverPubKey=function(t,e,r,n){p((3&r)===r,"The recovery param is more than two bits"),e=new y(e,n);var i=this.n,o=new m(t),a=e.r,s=e.s,c=1&r,u=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");a=u?this.curve.pointFromX(a.add(this.curve.n),c):this.curve.pointFromX(a,c);var l=e.r.invm(i),h=i.sub(o).mul(l).umod(i),d=s.mul(l).umod(i);return this.g.mulAdd(h,a,d)},n.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new y(e,n),null!==e.recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":1,"./key":9,"./signature":10,"bn.js":16,"hmac-drbg":25}],9:[function(t,e,r){"use strict";function n(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}var i=t("bn.js"),o=t("../../elliptic"),a=o.utils,s=a.assert;e.exports=n,n.fromPublic=function(t,e,r){return e instanceof n?e:new n(t,{pub:e,pubEnc:r})},n.fromPrivate=function(t,e,r){return e instanceof n?e:new n(t,{priv:e,privEnc:r})},n.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},n.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},n.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},n.prototype._importPrivate=function(t,e){this.priv=new i(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},n.prototype._importPublic=function(t,e){return t.x||t.y?("mont"===this.ec.curve.type?s(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||s(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y))):void(this.pub=this.ec.curve.decodePoint(t,e))},n.prototype.derive=function(t){return t.mul(this.priv).getX()},n.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},n.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},n.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},{"../../elliptic":1,"bn.js":16}],10:[function(t,e,r){"use strict";function n(t,e){return t instanceof n?t:void(this._importDER(t,e)||(o(t.r&&t.s,"Signature without r or s"),this.r=new l(t.r,16),this.s=new l(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam))}function c(){this.place=0}function u(t,e){var r=t[e.place++];if(!(128&r))return r;for(var n=15&r,i=0,o=0,a=e.place;o<n;o++,a++)i<<=8,i|=t[a];return e.place=a,i}function a(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e<r;)e++;return 0===e?t:t.slice(e)}function s(t,e){if(e<128)return void t.push(e);var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}var l=t("bn.js"),i=t("../../elliptic"),h=i.utils,o=h.assert;e.exports=n,n.prototype._importDER=function(t,e){t=h.toArray(t,e);var r=new c;if(48!==t[r.place++])return!1;var n=u(t,r);if(n+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var i=u(t,r),o=t.slice(r.place,i+r.place);if(r.place+=i,2!==t[r.place++])return!1;var a=u(t,r);if(t.length!==a+r.place)return!1;var s=t.slice(r.place,a+r.place);return 0===o[0]&&128&o[1]&&(o=o.slice(1)),0===s[0]&&128&s[1]&&(s=s.slice(1)),this.r=new l(o),this.s=new l(s),this.recoveryParam=null,!0},n.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=a(e),r=a(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];s(n,e.length),n=n.concat(e),n.push(2),s(n,r.length);var i=n.concat(r),o=[48];return s(o,i.length),o=o.concat(i),h.encode(o,t)}},{"../../elliptic":1,"bn.js":16}],11:[function(t,e,r){"use strict";function n(t){if(s("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof n))return new n(t);var t=o.curves[t].curve;this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=i.sha512}var i=t("hash.js"),o=t("../../elliptic"),a=o.utils,s=a.assert,c=a.parseBytes,u=t("./key"),l=t("./signature");e.exports=n,n.prototype.sign=function(t,e){t=c(t);var r=this.keyFromSecret(e),n=this.hashInt(r.messagePrefix(),t),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),t).mul(r.priv()),s=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:s,Rencoded:o})},n.prototype.verify=function(t,e,r){t=c(t),e=this.makeSignature(e);var n=this.keyFromPublic(r),i=this.hashInt(e.Rencoded(),n.pubBytes(),t),o=this.g.mul(e.S()),a=e.R().add(n.pub().mul(i));return a.eq(o)},n.prototype.hashInt=function(){for(var t=this.hash(),e=0;e<arguments.length;e++)t.update(arguments[e]);return a.intFromLE(t.digest()).umod(this.curve.n)},n.prototype.keyFromPublic=function(t){return u.fromPublic(this,t)},n.prototype.keyFromSecret=function(t){return u.fromSecret(this,t)},n.prototype.makeSignature=function(t){return t instanceof l?t:new l(this,t)},n.prototype.encodePoint=function(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},n.prototype.decodePoint=function(t){t=a.parseBytes(t);var e=t.length-1,r=t.slice(0,e).concat(t[e]&-129),n=0!==(128&t[e]),i=a.intFromLE(r);return this.curve.pointFromY(i,n)},n.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)},n.prototype.decodeInt=function(t){return a.intFromLE(t)},n.prototype.isPoint=function(t){return t instanceof this.pointClass}},{"../../elliptic":1,"./key":12,"./signature":13,"hash.js":19}],12:[function(t,e,r){"use strict";function n(t,e){this.eddsa=t,this._secret=s(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=s(e.pub)}var i=t("../../elliptic"),o=i.utils,a=o.assert,s=o.parseBytes,c=o.cachedProperty;n.fromPublic=function(t,e){return e instanceof n?e:new n(t,{pub:e})},n.fromSecret=function(t,e){return e instanceof n?e:new n(t,{secret:e})},n.prototype.secret=function(){return this._secret},c(n,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),c(n,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),c(n,"privBytes",function(){var t=this.eddsa,e=this.hash(),r=t.encodingLength-1,n=e.slice(0,t.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n}),c(n,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),c(n,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),c(n,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),n.prototype.sign=function(t){return a(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},n.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},n.prototype.getSecret=function(t){return a(this._secret,"KeyPair is public only"),o.encode(this.secret(),t)},n.prototype.getPublic=function(t){return o.encode(this.pubBytes(),t)},e.exports=n},{"../../elliptic":1}],13:[function(t,e,r){"use strict";function n(t,e){this.eddsa=t,"object"!=typeof e&&(e=u(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),s(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof i&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}var i=t("bn.js"),o=t("../../elliptic"),a=o.utils,s=a.assert,c=a.cachedProperty,u=a.parseBytes;c(n,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),c(n,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),c(n,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),c(n,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),n.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},n.prototype.toHex=function(){return a.encode(this.toBytes(),"hex").toUpperCase()},e.exports=n},{"../../elliptic":1,"bn.js":16}],14:[function(t,e,r){e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},{}],15:[function(t,e,r){"use strict";function n(t,e){for(var r=[],n=1<<e+1,i=t.clone();i.cmpn(1)>=0;){var o;if(i.isOdd()){var a=i.andln(n-1);o=a>(n>>1)-1?(n>>1)-a:a,i.isubn(o)}else o=0;r.push(o);for(var s=0!==i.cmpn(0)&&0===i.andln(n-1)?e+1:1,c=1;c<s;c++)r.push(0);i.iushrn(s)}return r}function i(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n=0,i=0;t.cmpn(-n)>0||e.cmpn(-i)>0;){var o=t.andln(3)+n&3,a=e.andln(3)+i&3;3===o&&(o=-1),3===a&&(a=-1);var s;if(0===(1&o))s=0;else{var c=t.andln(7)+n&7;s=3!==c&&5!==c||2!==a?o:-o}r[0].push(s);var u;if(0===(1&a))u=0;else{var c=e.andln(7)+i&7;u=3!==c&&5!==c||2!==o?a:-a}r[1].push(u),2*n===s+1&&(n=1-n),2*i===u+1&&(i=1-i),t.iushrn(1),e.iushrn(1)}return r}function o(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}}function a(t){return"string"==typeof t?c.toArray(t,"hex"):t}function s(t){return new u(t,"hex","le")}var c=r,u=t("bn.js"),l=t("minimalistic-assert"),h=t("minimalistic-crypto-utils");c.assert=l,c.toArray=h.toArray,c.zero2=h.zero2,c.toHex=h.toHex,c.encode=h.encode,c.getNAF=n,c.getJSF=i,c.cachedProperty=o,c.parseBytes=a,c.intFromLE=s},{"bn.js":16,"minimalistic-assert":28,"minimalistic-crypto-utils":29}],16:[function(C,t,e){!function(t,e){"use strict";function m(t,e){if(!t)throw new Error(e||"Assertion failed")}function r(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function g(t,e,r){return g.isBN(t)?t:(this.negative=0,this.words=null,this.length=0,this.red=null,void(null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))))}function a(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o<i;o++){var a=t.charCodeAt(o)-48;n<<=4,n|=a>=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function h(t,e,r,n){for(var i=0,o=Math.min(t.length,r),a=e;a<o;a++){var s=t.charCodeAt(a)-48;i*=n,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}function o(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}function i(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,c=a/67108864|0;r.words[0]=s;for(var u=1;u<n;u++){for(var l=c>>>26,h=67108863&c,d=Math.min(u,e.length-1),p=Math.max(0,u-t.length+1);p<=d;p++){var f=u-p|0;i=0|t.words[f],o=0|e.words[p],a=i*o+h,l+=a/67108864|0,h=67108863&a}r.words[u]=0|h,c=0|l}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}function s(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var a=i;i=0;for(var s=67108863&n,c=Math.min(o,e.length-1),u=Math.max(0,o-t.length+1);u<=c;u++){var l=o-u,h=0|t.words[l],d=0|e.words[u],p=h*d,f=67108863&p;a=a+(p/67108864|0)|0,f=f+s|0,s=67108863&f,a=a+(f>>>26)|0,i+=a>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}function c(t,e,r){var n=new u;return n.mulp(t,e,r)}function u(t,e){this.x=t,this.y=e}function n(t,e){this.name=t,this.p=new g(e,16),this.n=this.p.bitLength(),this.k=new g(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function l(){n.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function d(){n.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function p(){n.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function f(){n.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function v(t){if("string"==typeof t){var e=g._prime(t);this.m=e.p,this.prime=e}else m(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function y(t){v.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new g(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}"object"==typeof t?t.exports=g:e.BN=g,g.BN=g,g.wordSize=26;var b;try{b=C("buffer").Buffer}catch(t){}g.isBN=function(t){return t instanceof g||null!==t&&"object"==typeof t&&t.constructor.wordSize===g.wordSize&&Array.isArray(t.words)},g.max=function(t,e){return t.cmp(e)>0?t:e},g.min=function(t,e){return t.cmp(e)<0?t:e},g.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),m(e===(0|e)&&e>=2&&e<=36),t=t.toString().replace(/\s+/g,"");var n=0;"-"===t[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},g.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(m(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},g.prototype._initArray=function(t,e,r){if(m("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o,a=0;if("be"===r)for(n=t.length-1,i=0;n>=0;n-=3)o=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[i]|=o<<a&67108863,this.words[i+1]=o>>>26-a&67108863,a+=24,a>=26&&(a-=26,i++);else if("le"===r)for(n=0,i=0;n<t.length;n+=3)o=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[i]|=o<<a&67108863,this.words[i+1]=o>>>26-a&67108863,a+=24,a>=26&&(a-=26,i++);return this.strip()},g.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,i,o=0;for(r=t.length-6,n=0;r>=e;r-=6)i=a(t,r,r+6),this.words[n]|=i<<o&67108863,this.words[n+1]|=i>>>26-o&4194303,o+=24,o>=26&&(o-=26,n++);r+6!==e&&(i=a(t,e,r+6),this.words[n]|=i<<o&67108863,this.words[n+1]|=i>>>26-o&4194303),this.strip()},g.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,c=0,u=r;u<s;u+=n)c=h(t,u,u+n,e),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==a){var l=1;for(c=h(t,u,t.length,e),u=0;u<a;u++)l*=e;this.imuln(l),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}},g.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},g.prototype.clone=function(){var t=new g(null);return this.copy(t),t},g.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},g.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},g.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},g.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var _=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],A=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],I=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];g.prototype.toString=function(t,e){t=t||10,e=0|e||1;var r;if(16===t||"hex"===t){r="";for(var n=0,i=0,o=0;o<this.length;o++){var a=this.words[o],s=(16777215&(a<<n|i)).toString(16);i=a>>>24-n&16777215,r=0!==i||o!==this.length-1?_[6-s.length]+s+r:s+r,n+=2,n>=26&&(n-=26,o--)}for(0!==i&&(r=i.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=A[t],u=I[t];r="";var l=this.clone();for(l.negative=0;!l.isZero();){var h=l.modn(u).toString(t);l=l.idivn(u),r=l.isZero()?h+r:_[c-h.length]+h+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}m(!1,"Base should be between 2 and 36")},g.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&m(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},g.prototype.toJSON=function(){return this.toString(16)},g.prototype.toBuffer=function(t,e){return m("undefined"!=typeof b),this.toArrayLike(b,t,e)},g.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},g.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),i=r||Math.max(1,n);m(n<=i,"byte array longer than desired length"),m(i>0,"Requested array length <= 0"),this.strip();var o,a,s="le"===e,c=new t(i),u=this.clone();if(s){for(a=0;!u.isZero();a++)o=u.andln(255),u.iushrn(8),c[a]=o;for(;a<i;a++)c[a]=0}else{for(a=0;a<i-n;a++)c[a]=0;for(a=0;!u.isZero();a++)o=u.andln(255),u.iushrn(8),c[i-a-1]=o}return c},Math.clz32?g.prototype._countBits=function(t){return 32-Math.clz32(t)}:g.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},g.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},g.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},g.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},g.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},g.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},g.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},g.prototype.isNeg=function(){return 0!==this.negative},g.prototype.neg=function(){return this.clone().ineg()},g.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},g.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},g.prototype.ior=function(t){return m(0===(this.negative|t.negative)),this.iuor(t)},g.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},g.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},g.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},g.prototype.iand=function(t){return m(0===(this.negative|t.negative)),this.iuand(t)},g.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},g.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},g.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},g.prototype.ixor=function(t){return m(0===(this.negative|t.negative)),this.iuxor(t)},g.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},g.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},g.prototype.inotn=function(t){m("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},g.prototype.notn=function(t){return this.clone().inotn(t)},g.prototype.setn=function(t,e){m("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),e?this.words[r]=this.words[r]|1<<n:this.words[r]=this.words[r]&~(1<<n),this.strip()},g.prototype.iadd=function(t){var e;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();var r,n;this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},g.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},g.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r=this.cmp(t);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;var n,i;r>0?(n=this,i=t):(n=t,i=this);for(var o=0,a=0;a<i.length;a++)e=(0|n.words[a])-(0|i.words[a])+o,o=e>>26,this.words[a]=67108863&e;for(;0!==o&&a<n.length;a++)e=(0|n.words[a])+o,o=e>>26,this.words[a]=67108863&e;if(0===o&&a<n.length&&n!==this)for(;a<n.length;a++)this.words[a]=n.words[a];return this.length=Math.max(this.length,a),n!==this&&(this.negative=1),this.strip()},g.prototype.sub=function(t){return this.clone().isub(t)};var S=function(t,e,r){var n,i,o,a=t.words,s=e.words,c=r.words,u=0,l=0|a[0],h=8191&l,d=l>>>13,p=0|a[1],f=8191&p,v=p>>>13,m=0|a[2],g=8191&m,y=m>>>13,b=0|a[3],_=8191&b,A=b>>>13,I=0|a[4],S=8191&I,k=I>>>13,C=0|a[5],E=8191&C,P=C>>>13,w=0|a[6],R=8191&w,D=w>>>13,T=0|a[7],L=8191&T,F=T>>>13,M=0|a[8],x=8191&M,O=M>>>13,q=0|a[9],N=8191&q,K=q>>>13,H=0|s[0],U=8191&H,B=H>>>13,j=0|s[1],V=8191&j,W=j>>>13,z=0|s[2],G=8191&z,J=z>>>13,Q=0|s[3],X=8191&Q,Y=Q>>>13,Z=0|s[4],$=8191&Z,tt=Z>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ct=8191&st,ut=st>>>13,lt=0|s[8],ht=8191<,dt=lt>>>13,pt=0|s[9],ft=8191&pt,vt=pt>>>13;r.negative=t.negative^e.negative,r.length=19,n=Math.imul(h,U),i=Math.imul(h,B),i=i+Math.imul(d,U)|0,o=Math.imul(d,B);var mt=(u+n|0)+((8191&i)<<13)|0;u=(o+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(f,U),i=Math.imul(f,B),i=i+Math.imul(v,U)|0,o=Math.imul(v,B),n=n+Math.imul(h,V)|0,i=i+Math.imul(h,W)|0,i=i+Math.imul(d,V)|0,o=o+Math.imul(d,W)|0;var gt=(u+n|0)+((8191&i)<<13)|0;u=(o+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,U),i=Math.imul(g,B),i=i+Math.imul(y,U)|0,o=Math.imul(y,B),n=n+Math.imul(f,V)|0,i=i+Math.imul(f,W)|0,i=i+Math.imul(v,V)|0,o=o+Math.imul(v,W)|0,n=n+Math.imul(h,G)|0,i=i+Math.imul(h,J)|0,i=i+Math.imul(d,G)|0,o=o+Math.imul(d,J)|0;var yt=(u+n|0)+((8191&i)<<13)|0;u=(o+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(_,U),i=Math.imul(_,B),i=i+Math.imul(A,U)|0,o=Math.imul(A,B),n=n+Math.imul(g,V)|0,i=i+Math.imul(g,W)|0,i=i+Math.imul(y,V)|0,o=o+Math.imul(y,W)|0,n=n+Math.imul(f,G)|0,i=i+Math.imul(f,J)|0,i=i+Math.imul(v,G)|0,o=o+Math.imul(v,J)|0,n=n+Math.imul(h,X)|0,i=i+Math.imul(h,Y)|0,i=i+Math.imul(d,X)|0,o=o+Math.imul(d,Y)|0;var bt=(u+n|0)+((8191&i)<<13)|0;u=(o+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(S,U),i=Math.imul(S,B),i=i+Math.imul(k,U)|0,o=Math.imul(k,B),n=n+Math.imul(_,V)|0,i=i+Math.imul(_,W)|0,i=i+Math.imul(A,V)|0,o=o+Math.imul(A,W)|0,n=n+Math.imul(g,G)|0,i=i+Math.imul(g,J)|0,i=i+Math.imul(y,G)|0,o=o+Math.imul(y,J)|0,n=n+Math.imul(f,X)|0,i=i+Math.imul(f,Y)|0,i=i+Math.imul(v,X)|0,o=o+Math.imul(v,Y)|0,n=n+Math.imul(h,$)|0,i=i+Math.imul(h,tt)|0,i=i+Math.imul(d,$)|0,o=o+Math.imul(d,tt)|0;var _t=(u+n|0)+((8191&i)<<13)|0;u=(o+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(E,U),i=Math.imul(E,B),i=i+Math.imul(P,U)|0,o=Math.imul(P,B),n=n+Math.imul(S,V)|0,i=i+Math.imul(S,W)|0,i=i+Math.imul(k,V)|0,o=o+Math.imul(k,W)|0,n=n+Math.imul(_,G)|0,i=i+Math.imul(_,J)|0,i=i+Math.imul(A,G)|0,o=o+Math.imul(A,J)|0,n=n+Math.imul(g,X)|0,i=i+Math.imul(g,Y)|0,i=i+Math.imul(y,X)|0,o=o+Math.imul(y,Y)|0,n=n+Math.imul(f,$)|0,i=i+Math.imul(f,tt)|0,i=i+Math.imul(v,$)|0,o=o+Math.imul(v,tt)|0,n=n+Math.imul(h,rt)|0,i=i+Math.imul(h,nt)|0,i=i+Math.imul(d,rt)|0,o=o+Math.imul(d,nt)|0;var At=(u+n|0)+((8191&i)<<13)|0;u=(o+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(R,U),i=Math.imul(R,B),i=i+Math.imul(D,U)|0,o=Math.imul(D,B),n=n+Math.imul(E,V)|0,i=i+Math.imul(E,W)|0,i=i+Math.imul(P,V)|0,o=o+Math.imul(P,W)|0,n=n+Math.imul(S,G)|0,i=i+Math.imul(S,J)|0,i=i+Math.imul(k,G)|0,o=o+Math.imul(k,J)|0,n=n+Math.imul(_,X)|0,i=i+Math.imul(_,Y)|0,i=i+Math.imul(A,X)|0,o=o+Math.imul(A,Y)|0,n=n+Math.imul(g,$)|0,i=i+Math.imul(g,tt)|0,i=i+Math.imul(y,$)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(f,rt)|0,i=i+Math.imul(f,nt)|0,i=i+Math.imul(v,rt)|0,o=o+Math.imul(v,nt)|0,n=n+Math.imul(h,ot)|0,i=i+Math.imul(h,at)|0,i=i+Math.imul(d,ot)|0,o=o+Math.imul(d,at)|0;var It=(u+n|0)+((8191&i)<<13)|0;u=(o+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(L,U),i=Math.imul(L,B),i=i+Math.imul(F,U)|0,o=Math.imul(F,B),n=n+Math.imul(R,V)|0,i=i+Math.imul(R,W)|0,i=i+Math.imul(D,V)|0,o=o+Math.imul(D,W)|0,n=n+Math.imul(E,G)|0,i=i+Math.imul(E,J)|0,i=i+Math.imul(P,G)|0,o=o+Math.imul(P,J)|0,n=n+Math.imul(S,X)|0,i=i+Math.imul(S,Y)|0,i=i+Math.imul(k,X)|0,o=o+Math.imul(k,Y)|0,n=n+Math.imul(_,$)|0,i=i+Math.imul(_,tt)|0,i=i+Math.imul(A,$)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(g,rt)|0,i=i+Math.imul(g,nt)|0,i=i+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(f,ot)|0,i=i+Math.imul(f,at)|0,i=i+Math.imul(v,ot)|0,o=o+Math.imul(v,at)|0,n=n+Math.imul(h,ct)|0,i=i+Math.imul(h,ut)|0,i=i+Math.imul(d,ct)|0,o=o+Math.imul(d,ut)|0;var St=(u+n|0)+((8191&i)<<13)|0;u=(o+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(x,U),i=Math.imul(x,B),i=i+Math.imul(O,U)|0,o=Math.imul(O,B),n=n+Math.imul(L,V)|0,i=i+Math.imul(L,W)|0,i=i+Math.imul(F,V)|0,o=o+Math.imul(F,W)|0,n=n+Math.imul(R,G)|0,i=i+Math.imul(R,J)|0,i=i+Math.imul(D,G)|0,o=o+Math.imul(D,J)|0,n=n+Math.imul(E,X)|0,i=i+Math.imul(E,Y)|0,i=i+Math.imul(P,X)|0,o=o+Math.imul(P,Y)|0,n=n+Math.imul(S,$)|0,i=i+Math.imul(S,tt)|0,i=i+Math.imul(k,$)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(_,rt)|0,i=i+Math.imul(_,nt)|0,i=i+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(g,ot)|0,i=i+Math.imul(g,at)|0,i=i+Math.imul(y,ot)|0,o=o+Math.imul(y,at)|0,n=n+Math.imul(f,ct)|0,i=i+Math.imul(f,ut)|0,i=i+Math.imul(v,ct)|0,o=o+Math.imul(v,ut)|0,n=n+Math.imul(h,ht)|0,i=i+Math.imul(h,dt)|0,i=i+Math.imul(d,ht)|0,o=o+Math.imul(d,dt)|0;var kt=(u+n|0)+((8191&i)<<13)|0;u=(o+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(N,U),i=Math.imul(N,B),i=i+Math.imul(K,U)|0,o=Math.imul(K,B),n=n+Math.imul(x,V)|0,i=i+Math.imul(x,W)|0,i=i+Math.imul(O,V)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(L,G)|0,i=i+Math.imul(L,J)|0,i=i+Math.imul(F,G)|0,o=o+Math.imul(F,J)|0,n=n+Math.imul(R,X)|0,i=i+Math.imul(R,Y)|0,i=i+Math.imul(D,X)|0,o=o+Math.imul(D,Y)|0,n=n+Math.imul(E,$)|0,i=i+Math.imul(E,tt)|0,i=i+Math.imul(P,$)|0,o=o+Math.imul(P,tt)|0,n=n+Math.imul(S,rt)|0,i=i+Math.imul(S,nt)|0,i=i+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(_,ot)|0,i=i+Math.imul(_,at)|0,i=i+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,n=n+Math.imul(g,ct)|0,i=i+Math.imul(g,ut)|0,i=i+Math.imul(y,ct)|0,o=o+Math.imul(y,ut)|0,n=n+Math.imul(f,ht)|0,i=i+Math.imul(f,dt)|0,i=i+Math.imul(v,ht)|0,o=o+Math.imul(v,dt)|0,n=n+Math.imul(h,ft)|0,i=i+Math.imul(h,vt)|0,i=i+Math.imul(d,ft)|0,o=o+Math.imul(d,vt)|0;var Ct=(u+n|0)+((8191&i)<<13)|0;u=(o+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(N,V),i=Math.imul(N,W),i=i+Math.imul(K,V)|0,o=Math.imul(K,W),n=n+Math.imul(x,G)|0,i=i+Math.imul(x,J)|0,i=i+Math.imul(O,G)|0,o=o+Math.imul(O,J)|0,n=n+Math.imul(L,X)|0,i=i+Math.imul(L,Y)|0,i=i+Math.imul(F,X)|0,o=o+Math.imul(F,Y)|0,n=n+Math.imul(R,$)|0,i=i+Math.imul(R,tt)|0,i=i+Math.imul(D,$)|0,o=o+Math.imul(D,tt)|0,n=n+Math.imul(E,rt)|0,i=i+Math.imul(E,nt)|0,i=i+Math.imul(P,rt)|0,o=o+Math.imul(P,nt)|0,n=n+Math.imul(S,ot)|0,i=i+Math.imul(S,at)|0,i=i+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,n=n+Math.imul(_,ct)|0,i=i+Math.imul(_,ut)|0,i=i+Math.imul(A,ct)|0,o=o+Math.imul(A,ut)|0,n=n+Math.imul(g,ht)|0,i=i+Math.imul(g,dt)|0,i=i+Math.imul(y,ht)|0,o=o+Math.imul(y,dt)|0,n=n+Math.imul(f,ft)|0,i=i+Math.imul(f,vt)|0,i=i+Math.imul(v,ft)|0,o=o+Math.imul(v,vt)|0;var Et=(u+n|0)+((8191&i)<<13)|0;u=(o+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(N,G),i=Math.imul(N,J),i=i+Math.imul(K,G)|0,o=Math.imul(K,J),n=n+Math.imul(x,X)|0,i=i+Math.imul(x,Y)|0,i=i+Math.imul(O,X)|0,o=o+Math.imul(O,Y)|0,n=n+Math.imul(L,$)|0,i=i+Math.imul(L,tt)|0,i=i+Math.imul(F,$)|0,o=o+Math.imul(F,tt)|0,n=n+Math.imul(R,rt)|0,i=i+Math.imul(R,nt)|0,i=i+Math.imul(D,rt)|0,o=o+Math.imul(D,nt)|0,n=n+Math.imul(E,ot)|0,i=i+Math.imul(E,at)|0,i=i+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,n=n+Math.imul(S,ct)|0,i=i+Math.imul(S,ut)|0,i=i+Math.imul(k,ct)|0,o=o+Math.imul(k,ut)|0,n=n+Math.imul(_,ht)|0,i=i+Math.imul(_,dt)|0,i=i+Math.imul(A,ht)|0,o=o+Math.imul(A,dt)|0,n=n+Math.imul(g,ft)|0,i=i+Math.imul(g,vt)|0,i=i+Math.imul(y,ft)|0,o=o+Math.imul(y,vt)|0;var Pt=(u+n|0)+((8191&i)<<13)|0;u=(o+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(N,X),i=Math.imul(N,Y),i=i+Math.imul(K,X)|0,o=Math.imul(K,Y),n=n+Math.imul(x,$)|0,i=i+Math.imul(x,tt)|0,i=i+Math.imul(O,$)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(L,rt)|0,i=i+Math.imul(L,nt)|0,i=i+Math.imul(F,rt)|0,o=o+Math.imul(F,nt)|0,n=n+Math.imul(R,ot)|0,i=i+Math.imul(R,at)|0,i=i+Math.imul(D,ot)|0,o=o+Math.imul(D,at)|0,n=n+Math.imul(E,ct)|0,i=i+Math.imul(E,ut)|0,i=i+Math.imul(P,ct)|0,o=o+Math.imul(P,ut)|0,n=n+Math.imul(S,ht)|0,i=i+Math.imul(S,dt)|0,i=i+Math.imul(k,ht)|0,o=o+Math.imul(k,dt)|0,n=n+Math.imul(_,ft)|0,i=i+Math.imul(_,vt)|0,i=i+Math.imul(A,ft)|0,o=o+Math.imul(A,vt)|0;var wt=(u+n|0)+((8191&i)<<13)|0;u=(o+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(N,$),i=Math.imul(N,tt),i=i+Math.imul(K,$)|0,o=Math.imul(K,tt),n=n+Math.imul(x,rt)|0,i=i+Math.imul(x,nt)|0,i=i+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(L,ot)|0,i=i+Math.imul(L,at)|0,i=i+Math.imul(F,ot)|0,o=o+Math.imul(F,at)|0,n=n+Math.imul(R,ct)|0,i=i+Math.imul(R,ut)|0,i=i+Math.imul(D,ct)|0,o=o+Math.imul(D,ut)|0,n=n+Math.imul(E,ht)|0,i=i+Math.imul(E,dt)|0,i=i+Math.imul(P,ht)|0,o=o+Math.imul(P,dt)|0,n=n+Math.imul(S,ft)|0,i=i+Math.imul(S,vt)|0,i=i+Math.imul(k,ft)|0,o=o+Math.imul(k,vt)|0;var Rt=(u+n|0)+((8191&i)<<13)|0;u=(o+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(N,rt),i=Math.imul(N,nt),i=i+Math.imul(K,rt)|0,o=Math.imul(K,nt),n=n+Math.imul(x,ot)|0,i=i+Math.imul(x,at)|0,i=i+Math.imul(O,ot)|0,o=o+Math.imul(O,at)|0,n=n+Math.imul(L,ct)|0,i=i+Math.imul(L,ut)|0,i=i+Math.imul(F,ct)|0,o=o+Math.imul(F,ut)|0,n=n+Math.imul(R,ht)|0,i=i+Math.imul(R,dt)|0,i=i+Math.imul(D,ht)|0,o=o+Math.imul(D,dt)|0,n=n+Math.imul(E,ft)|0,i=i+Math.imul(E,vt)|0,i=i+Math.imul(P,ft)|0,o=o+Math.imul(P,vt)|0;var Dt=(u+n|0)+((8191&i)<<13)|0;u=(o+(i>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,n=Math.imul(N,ot),i=Math.imul(N,at),i=i+Math.imul(K,ot)|0,o=Math.imul(K,at),n=n+Math.imul(x,ct)|0,i=i+Math.imul(x,ut)|0,i=i+Math.imul(O,ct)|0,o=o+Math.imul(O,ut)|0,n=n+Math.imul(L,ht)|0,i=i+Math.imul(L,dt)|0,i=i+Math.imul(F,ht)|0,o=o+Math.imul(F,dt)|0,n=n+Math.imul(R,ft)|0,i=i+Math.imul(R,vt)|0,i=i+Math.imul(D,ft)|0,o=o+Math.imul(D,vt)|0;var Tt=(u+n|0)+((8191&i)<<13)|0;u=(o+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(N,ct),i=Math.imul(N,ut),i=i+Math.imul(K,ct)|0,o=Math.imul(K,ut),n=n+Math.imul(x,ht)|0,i=i+Math.imul(x,dt)|0,i=i+Math.imul(O,ht)|0,o=o+Math.imul(O,dt)|0,n=n+Math.imul(L,ft)|0,i=i+Math.imul(L,vt)|0,i=i+Math.imul(F,ft)|0,o=o+Math.imul(F,vt)|0;var Lt=(u+n|0)+((8191&i)<<13)|0;u=(o+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(N,ht),i=Math.imul(N,dt),i=i+Math.imul(K,ht)|0,o=Math.imul(K,dt),n=n+Math.imul(x,ft)|0,i=i+Math.imul(x,vt)|0,i=i+Math.imul(O,ft)|0,o=o+Math.imul(O,vt)|0;var Ft=(u+n|0)+((8191&i)<<13)|0;u=(o+(i>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,n=Math.imul(N,ft),i=Math.imul(N,vt),i=i+Math.imul(K,ft)|0,o=Math.imul(K,vt);var Mt=(u+n|0)+((8191&i)<<13)|0;return u=(o+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,c[0]=mt,c[1]=gt,c[2]=yt,c[3]=bt,c[4]=_t,c[5]=At,c[6]=It,c[7]=St,c[8]=kt,c[9]=Ct,c[10]=Et,c[11]=Pt,c[12]=wt,c[13]=Rt,c[14]=Dt,c[15]=Tt,c[16]=Lt,c[17]=Ft,c[18]=Mt,0!==u&&(c[19]=u,r.length++),r};Math.imul||(S=i),g.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?S(this,t,e):n<63?i(this,t,e):n<1024?s(this,t,e):c(this,t,e)},u.prototype.makeRBT=function(t){for(var e=new Array(t),r=g.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},u.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},u.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a<o;a++)n[a]=e[t[a]],i[a]=r[t[a]]},u.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var a=1;a<i;a<<=1)for(var s=a<<1,c=Math.cos(2*Math.PI/s),u=Math.sin(2*Math.PI/s),l=0;l<i;l+=s)for(var h=c,d=u,p=0;p<a;p++){var f=r[l+p],v=n[l+p],m=r[l+p+a],g=n[l+p+a],y=h*m-d*g;g=h*g+d*m,m=y,r[l+p]=f+m,n[l+p]=v+g,r[l+p+a]=f-m,n[l+p+a]=v-g,p!==s&&(y=c*h-u*d,d=c*d+u*h,h=y)}},u.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},u.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},u.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},u.prototype.convert13b=function(t,e,r,n){for(var i=0,o=0;o<e;o++)i+=0|t[o],r[2*o]=8191&i,i>>>=13,r[2*o+1]=8191&i,i>>>=13;for(o=2*e;o<n;++o)r[o]=0;m(0===i),m(0===(i&-8192))},u.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},u.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),a=new Array(n),s=new Array(n),c=new Array(n),u=new Array(n),l=new Array(n),h=new Array(n),d=r.words;d.length=n,this.convert13b(t.words,t.length,a,n),this.convert13b(e.words,e.length,u,n),this.transform(a,o,s,c,n,i),this.transform(u,o,l,h,n,i);for(var p=0;p<n;p++){var f=s[p]*l[p]-c[p]*h[p];c[p]=s[p]*h[p]+c[p]*l[p],s[p]=f}return this.conjugate(s,c,n),this.transform(s,c,d,o,n,i),this.conjugate(d,o,n),this.normalize13b(d,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},g.prototype.mul=function(t){var e=new g(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},g.prototype.mulf=function(t){var e=new g(null);return e.words=new Array(this.length+t.length),c(this,t,e)},g.prototype.imul=function(t){return this.clone().mulTo(t,this)},g.prototype.imuln=function(t){m("number"==typeof t),m(t<67108864);for(var e=0,r=0;r<this.length;r++){var n=(0|this.words[r])*t,i=(67108863&n)+(67108863&e);e>>=26,e+=n/67108864|0,e+=i>>>26,this.words[r]=67108863&i}return 0!==e&&(this.words[r]=e,this.length++),this},g.prototype.muln=function(t){return this.clone().imuln(t)},g.prototype.sqr=function(){return this.mul(this)},g.prototype.isqr=function(){return this.imul(this.clone())},g.prototype.pow=function(t){var e=o(t);if(0===e.length)return new g(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},g.prototype.iushln=function(t){m("number"==typeof t&&t>=0);var e,r=t%26,n=(t-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e<this.length;e++){var a=this.words[e]&i,s=(0|this.words[e])-a<<r;this.words[e]=s|o,o=a>>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this.strip()},g.prototype.ishln=function(t){return m(0===this.negative),this.iushln(t)},g.prototype.iushrn=function(t,e,r){m("number"==typeof t&&t>=0);var n;n=e?(e-e%26)/26:0;var i=t%26,o=Math.min((t-i)/26,this.length),a=67108863^67108863>>>i<<i,s=r;if(n-=o,n=Math.max(0,n),s){for(var c=0;c<o;c++)s.words[c]=this.words[c];s.length=o}if(0===o);else if(this.length>o)for(this.length-=o,c=0;c<this.length;c++)this.words[c]=this.words[c+o];else this.words[0]=0,this.length=1;var u=0;for(c=this.length-1;c>=0&&(0!==u||c>=n);c--){var l=0|this.words[c];this.words[c]=u<<26-i|l>>>i,u=l&a}return s&&0!==u&&(s.words[s.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},g.prototype.ishrn=function(t,e,r){return m(0===this.negative),this.iushrn(t,e,r)},g.prototype.shln=function(t){return this.clone().ishln(t)},g.prototype.ushln=function(t){return this.clone().iushln(t)},g.prototype.shrn=function(t){return this.clone().ishrn(t)},g.prototype.ushrn=function(t){return this.clone().iushrn(t)},g.prototype.testn=function(t){m("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<<e;if(this.length<=r)return!1;var i=this.words[r];return!!(i&n)},g.prototype.imaskn=function(t){m("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(m(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this.strip()},g.prototype.maskn=function(t){return this.clone().imaskn(t)},g.prototype.iaddn=function(t){return m("number"==typeof t),m(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},g.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},g.prototype.isubn=function(t){if(m("number"==typeof t),m(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},g.prototype.addn=function(t){return this.clone().iaddn(t)},g.prototype.subn=function(t){return this.clone().isubn(t)},g.prototype.iabs=function(){return this.negative=0,this},g.prototype.abs=function(){return this.clone().iabs()},g.prototype._ishlnsubmul=function(t,e,r){var n,i=t.length+r;this._expand(i);var o,a=0;for(n=0;n<t.length;n++){o=(0|this.words[n+r])+a;var s=(0|t.words[n])*e;o-=67108863&s,a=(o>>26)-(s/67108864|0),this.words[n+r]=67108863&o}for(;n<this.length-r;n++)o=(0|this.words[n+r])+a,a=o>>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(m(a===-1),a=0,n=0;n<this.length;n++)o=-(0|this.words[n])+a,a=o>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},g.prototype._wordDiv=function(t,e){var r=this.length-t.length,n=this.clone(),i=t,o=0|i.words[i.length-1],a=this._countBits(o);r=26-a,0!==r&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,c=n.length-i.length;if("mod"!==e){s=new g(null),s.length=c+1,s.words=new Array(s.length);for(var u=0;u<s.length;u++)s.words[u]=0}var l=n.clone()._ishlnsubmul(i,1,c);0===l.negative&&(n=l,s&&(s.words[c]=1));for(var h=c-1;h>=0;h--){var d=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(d=Math.min(d/o|0,67108863),n._ishlnsubmul(i,d,h);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=d)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},g.prototype.divmod=function(t,e,r){if(m(!t.isZero()),this.isZero())return{div:new g(0),mod:new g(0)};var n,i,o;return 0!==this.negative&&0===t.negative?(o=this.neg().divmod(t,e),"mod"!==e&&(n=o.div.neg()),"div"!==e&&(i=o.mod.neg(),r&&0!==i.negative&&i.iadd(t)),{div:n,mod:i}):0===this.negative&&0!==t.negative?(o=this.divmod(t.neg(),e),"mod"!==e&&(n=o.div.neg()),{div:n,mod:o.mod}):0!==(this.negative&t.negative)?(o=this.neg().divmod(t.neg(),e),"div"!==e&&(i=o.mod.neg(),r&&0!==i.negative&&i.isub(t)),{div:o.div,mod:i}):t.length>this.length||this.cmp(t)<0?{div:new g(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new g(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new g(this.modn(t.words[0]))}:this._wordDiv(t,e)},g.prototype.div=function(t){return this.divmod(t,"div",!1).div},g.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},g.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},g.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},g.prototype.modn=function(t){m(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},g.prototype.idivn=function(t){m(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},g.prototype.divn=function(t){return this.clone().idivn(t)},g.prototype.egcd=function(t){m(0===t.negative),m(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new g(1),i=new g(0),o=new g(0),a=new g(1),s=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++s;for(var c=r.clone(),u=e.clone();!e.isZero();){for(var l=0,h=1;0===(e.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(c),i.isub(u)),n.iushrn(1),i.iushrn(1);for(var d=0,p=1;0===(r.words[0]&p)&&d<26;++d,p<<=1);if(d>0)for(r.iushrn(d);d-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(c),a.isub(u)),o.iushrn(1),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(o),i.isub(a)):(r.isub(e),o.isub(n),a.isub(i))}return{a:o,b:a,gcd:r.iushln(s)}},g.prototype._invmp=function(t){m(0===t.negative),m(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new g(1),i=new g(0),o=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var a=0,s=1;0===(e.words[0]&s)&&a<26;++a,s<<=1);if(a>0)for(e.iushrn(a);a-- >0;)n.isOdd()&&n.iadd(o),n.iushrn(1);for(var c=0,u=1;0===(r.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(r.iushrn(c);c-- >0;)i.isOdd()&&i.iadd(o),i.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(i)):(r.isub(e),i.isub(n))}var l;return l=0===e.cmpn(1)?n:i,l.cmpn(0)<0&&l.iadd(t),l},g.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},g.prototype.invm=function(t){return this.egcd(t).a.umod(t)},g.prototype.isEven=function(){return 0===(1&this.words[0])},g.prototype.isOdd=function(){return 1===(1&this.words[0])},g.prototype.andln=function(t){return this.words[0]&t},g.prototype.bincn=function(t){m("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var i=n,o=r;0!==i&&o<this.length;o++){var a=0|this.words[o];a+=i,i=a>>>26,a&=67108863,this.words[o]=a}return 0!==i&&(this.words[o]=i,this.length++),this},g.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},g.prototype.cmpn=function(t){var e=t<0;if(0!==this.negative&&!e)return-1;if(0===this.negative&&e)return 1;this.strip();var r;if(this.length>1)r=1;else{e&&(t=-t),m(t<=67108863,"Number is too big");var n=0|this.words[0];r=n===t?0:n<t?-1:1}return 0!==this.negative?0|-r:r},g.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},g.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},g.prototype.gtn=function(t){return 1===this.cmpn(t)},g.prototype.gt=function(t){return 1===this.cmp(t)},g.prototype.gten=function(t){return this.cmpn(t)>=0},g.prototype.gte=function(t){return this.cmp(t)>=0},g.prototype.ltn=function(t){return this.cmpn(t)===-1},g.prototype.lt=function(t){return this.cmp(t)===-1},g.prototype.lten=function(t){return this.cmpn(t)<=0},g.prototype.lte=function(t){return this.cmp(t)<=0},g.prototype.eqn=function(t){return 0===this.cmpn(t)},g.prototype.eq=function(t){return 0===this.cmp(t)},g.red=function(t){return new v(t)},g.prototype.toRed=function(t){return m(!this.red,"Already a number in reduction context"),m(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},g.prototype.fromRed=function(){return m(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},g.prototype._forceRed=function(t){return this.red=t,this},g.prototype.forceRed=function(t){return m(!this.red,"Already a number in reduction context"),this._forceRed(t)},g.prototype.redAdd=function(t){return m(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},g.prototype.redIAdd=function(t){return m(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},g.prototype.redSub=function(t){return m(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},g.prototype.redISub=function(t){return m(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},g.prototype.redShl=function(t){return m(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},g.prototype.redMul=function(t){return m(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},g.prototype.redIMul=function(t){return m(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},g.prototype.redSqr=function(){return m(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},g.prototype.redISqr=function(){return m(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},g.prototype.redSqrt=function(){return m(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},g.prototype.redInvm=function(){return m(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},g.prototype.redNeg=function(){return m(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},g.prototype.redPow=function(t){return m(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var k={k256:null,p224:null,p192:null,p25519:null};n.prototype._tmp=function(){var t=new g(null);return t.words=new Array(Math.ceil(this.n/13)),t},n.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),e=r.bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):r.strip(),r},n.prototype.split=function(t,e){t.iushrn(this.n,0,e)},n.prototype.imulK=function(t){return t.imul(this.k)},r(l,n),l.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,i=10;i<t.length;i++){var a=0|t.words[i];t.words[i-10]=(a&r)<<4|o>>>22,o=a}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},l.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},r(d,n),r(p,n),r(f,n),f.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},g._prime=function t(e){if(k[e])return k[e];var t;if("k256"===e)t=new l;else if("p224"===e)t=new d;else if("p192"===e)t=new p;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new f}return k[e]=t,t},v.prototype._verify1=function(t){m(0===t.negative,"red works only with positives"),m(t.red,"red works only with red numbers")},v.prototype._verify2=function(t,e){m(0===(t.negative|e.negative),"red works only with positives"),m(t.red&&t.red===e.red,"red works only with red numbers")},v.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},v.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},v.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},v.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},v.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},v.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},v.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},v.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},v.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},v.prototype.isqr=function(t){return this.imul(t,t.clone())},v.prototype.sqr=function(t){return this.mul(t,t)},v.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(m(e%2===1),3===e){var r=this.m.add(new g(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),i=0;!n.isZero()&&0===n.andln(1);)i++,n.iushrn(1);m(!n.isZero());var o=new g(1).toRed(this),a=o.redNeg(),s=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new g(2*c*c).toRed(this);0!==this.pow(c,s).cmp(a);)c.redIAdd(a);for(var u=this.pow(c,n),l=this.pow(t,n.addn(1).iushrn(1)),h=this.pow(t,n),d=i;0!==h.cmp(o);){for(var p=h,f=0;0!==p.cmp(o);f++)p=p.redSqr();m(f<d);var v=this.pow(u,new g(1).iushln(d-f-1));l=l.redMul(v),u=v.redSqr(),h=h.redMul(u),d=f}return l},v.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},v.prototype.pow=function(t,e){if(e.isZero())return new g(1);if(0===e.cmpn(1))return t.clone();var r=4,n=new Array(1<<r);n[0]=new g(1).toRed(this),n[1]=t;for(var i=2;i<n.length;i++)n[i]=this.mul(n[i-1],t);var o=n[0],a=0,s=0,c=e.bitLength()%26;for(0===c&&(c=26),i=e.length-1;i>=0;i--){for(var u=e.words[i],l=c-1;l>=0;l--){var h=u>>l&1;o!==n[0]&&(o=this.sqr(o)),0!==h||0!==a?(a<<=1,a|=h,s++,(s===r||0===i&&0===l)&&(o=this.mul(o,n[a]),s=0,a=0)):s=0}c=26}return o},v.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},v.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},g.mont=function(t){return new y(t)},r(y,v),y.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},y.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},y.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},y.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new g(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},y.prototype.invm=function(t){var e=this.imod(t._invmp(this.m).mul(this.r2));return e._forceRed(this)}}("undefined"==typeof t||t,this)},{}],17:[function(t,e,r){function n(t){this.rand=t}var i;if(e.exports=function(t){return i||(i=new n(null)),i.generate(t)},e.exports.Rand=n,n.prototype.generate=function(t){return this._rand(t)},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?n.prototype._rand=function(t){var e=new Uint8Array(t);return self.crypto.getRandomValues(e),e}:self.msCrypto&&self.msCrypto.getRandomValues?n.prototype._rand=function(t){var e=new Uint8Array(t);return self.msCrypto.getRandomValues(e),e}:n.prototype._rand=function(){throw new Error("Not implemented yet")};else try{var o=t("crypto");n.prototype._rand=function(t){return o.randomBytes(t)}}catch(t){n.prototype._rand=function(t){for(var e=new Uint8Array(t),r=0;r<e.length;r++)e[r]=this.rand.getByte();return e}}},{crypto:18}],18:[function(t,e,r){},{}],19:[function(t,e,r){var n=r;n.utils=t("./hash/utils"),n.common=t("./hash/common"),n.sha=t("./hash/sha"),n.ripemd=t("./hash/ripemd"),n.hmac=t("./hash/hmac"),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},{"./hash/common":20,"./hash/hmac":21,"./hash/ripemd":22,"./hash/sha":23,"./hash/utils":24}],20:[function(t,e,r){function n(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}var i=t("../hash"),o=i.utils,a=o.assert;r.BlockHash=n,n.prototype.update=function(t,e){if(t=o.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){t=this.pending;var r=t.length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=o.join32(t,0,t.length-r,this.endian);for(var n=0;n<t.length;n+=this._delta32)this._update(t,n,n+this._delta32)}return this},n.prototype.digest=function(t){return this.update(this._pad()),a(null===this.pending),this._digest(t)},n.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(t<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=t>>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else{n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0;for(var o=8;o<this.padLength;o++)n[i++]=0}return n}},{"../hash":19}],21:[function(t,e,r){function n(t,e,r){return this instanceof n?(this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,void this._init(o.toArray(e,r))):new n(t,e,r)}var i=t("../hash"),o=i.utils,a=o.assert;e.exports=n,n.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),a(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(var e=0;e<t.length;e++)t[e]^=54;this.inner=(new this.Hash).update(t);for(var e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},n.prototype.update=function(t,e){return this.inner.update(t,e),this},n.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},{"../hash":19}],22:[function(t,e,r){function n(){return this instanceof n?(a.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],void(this.endian="little")):new n}function f(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}function v(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function m(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}var i=t("../hash"),o=i.utils,g=o.rotl32,y=o.sum32,b=o.sum32_3,_=o.sum32_4,a=i.common.BlockHash;o.inherits(n,a),r.ripemd160=n,n.blockSize=512,n.outSize=160,n.hmacStrength=192,n.padLength=64,n.prototype._update=function(t,e){for(var r=this.h[0],n=this.h[1],i=this.h[2],o=this.h[3],a=this.h[4],s=r,c=n,u=i,l=o,h=a,d=0;d<80;d++){var p=y(g(_(r,f(d,n,i,o),t[A[d]+e],v(d)),S[d]),a);r=a,a=o,o=g(i,10),i=n,n=p,p=y(g(_(s,f(79-d,c,u,l),t[I[d]+e],m(d)),k[d]),h),s=h,h=l,l=g(u,10),u=c,c=p}p=b(this.h[1],i,l),this.h[1]=b(this.h[2],o,h),this.h[2]=b(this.h[3],a,s),this.h[3]=b(this.h[4],r,c),this.h[4]=b(this.h[0],n,u),this.h[0]=p},n.prototype._digest=function(t){return"hex"===t?o.toHex32(this.h,"little"):o.split32(this.h,"little")};var A=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],I=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],S=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],k=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},{"../hash":19}],23:[function(t,e,r){function n(){return this instanceof n?(F.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=J,void(this.W=new Array(64))):new n}function i(){return this instanceof i?(n.call(this),void(this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])):new i}function o(){return this instanceof o?(F.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=Q,void(this.W=new Array(160))):new o}function a(){return this instanceof a?(o.call(this),void(this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428])):new a}function s(){return this instanceof s?(F.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],void(this.W=new Array(80))):new s}function f(t,e,r){return t&e^~t&r}function v(t,e,r){return t&e^t&r^e&r}function c(t,e,r){return t^e^r}function m(t){return I(t,2)^I(t,13)^I(t,22)}function g(t){return I(t,6)^I(t,11)^I(t,25)}function y(t){return I(t,7)^I(t,18)^t>>>3}function b(t){return I(t,17)^I(t,19)^t>>>10}function h(t,e,r,n){return 0===t?f(e,r,n):1===t||3===t?c(e,r,n):2===t?v(e,r,n):void 0}function M(t,e,r,n,i,o){var a=t&r^~t&i;return a<0&&(a+=4294967296),a}function x(t,e,r,n,i,o){var a=e&n^~e&o;return a<0&&(a+=4294967296),a}function O(t,e,r,n,i,o){var a=t&r^t&i^r&i;return a<0&&(a+=4294967296),a}function q(t,e,r,n,i,o){var a=e&n^e&o^n&o;return a<0&&(a+=4294967296),a}function N(t,e){var r=P(t,e,28),n=P(e,t,2),i=P(e,t,7),o=r^n^i;return o<0&&(o+=4294967296),o}function K(t,e){var r=w(t,e,28),n=w(e,t,2),i=w(e,t,7),o=r^n^i;return o<0&&(o+=4294967296),o}function H(t,e){var r=P(t,e,14),n=P(t,e,18),i=P(e,t,9),o=r^n^i;return o<0&&(o+=4294967296),o}function U(t,e){var r=w(t,e,14),n=w(t,e,18),i=w(e,t,9),o=r^n^i;return o<0&&(o+=4294967296),o}function d(t,e){var r=P(t,e,1),n=P(t,e,8),i=R(t,e,7),o=r^n^i;return o<0&&(o+=4294967296),o}function p(t,e){var r=w(t,e,1),n=w(t,e,8),i=D(t,e,7),o=r^n^i;return o<0&&(o+=4294967296),o}function _(t,e){var r=P(t,e,19),n=P(e,t,29),i=R(t,e,6),o=r^n^i;return o<0&&(o+=4294967296),o}function A(t,e){var r=w(t,e,19),n=w(e,t,29),i=D(t,e,6),o=r^n^i;return o<0&&(o+=4294967296),o}var u=t("../hash"),l=u.utils,B=l.assert,I=l.rotr32,S=l.rotl32,k=l.sum32,C=l.sum32_4,E=l.sum32_5,P=l.rotr64_hi,w=l.rotr64_lo,R=l.shr64_hi,D=l.shr64_lo,j=l.sum64,V=l.sum64_hi,W=l.sum64_lo,T=l.sum64_4_hi,L=l.sum64_4_lo,z=l.sum64_5_hi,G=l.sum64_5_lo,F=u.common.BlockHash,J=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Q=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],X=[1518500249,1859775393,2400959708,3395469782];l.inherits(n,F),r.sha256=n,n.blockSize=512,n.outSize=256,n.hmacStrength=192,n.padLength=64,n.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=C(b(r[n-2]),r[n-7],y(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],a=this.h[2],s=this.h[3],c=this.h[4],u=this.h[5],l=this.h[6],h=this.h[7];B(this.k.length===r.length);for(var n=0;n<r.length;n++){var d=E(h,g(c),f(c,u,l),this.k[n],r[n]),p=k(m(i),v(i,o,a));h=l,l=u,u=c,c=k(s,d),s=a,a=o,o=i,i=k(d,p)}this.h[0]=k(this.h[0],i),this.h[1]=k(this.h[1],o),this.h[2]=k(this.h[2],a),this.h[3]=k(this.h[3],s),this.h[4]=k(this.h[4],c),this.h[5]=k(this.h[5],u),this.h[6]=k(this.h[6],l),this.h[7]=k(this.h[7],h)},n.prototype._digest=function(t){return"hex"===t?l.toHex32(this.h,"big"):l.split32(this.h,"big")},l.inherits(i,n),r.sha224=i,i.blockSize=512,i.outSize=224,i.hmacStrength=192,i.padLength=64,i.prototype._digest=function(t){return"hex"===t?l.toHex32(this.h.slice(0,7),"big"):l.split32(this.h.slice(0,7),"big")},l.inherits(o,F),r.sha512=o,o.blockSize=1024,o.outSize=512,o.hmacStrength=192,o.padLength=128,o.prototype._prepareBlock=function(t,e){for(var r=this.W,n=0;n<32;n++)r[n]=t[e+n];for(;n<r.length;n+=2){var i=_(r[n-4],r[n-3]),o=A(r[n-4],r[n-3]),a=r[n-14],s=r[n-13],c=d(r[n-30],r[n-29]),u=p(r[n-30],r[n-29]),l=r[n-32],h=r[n-31];r[n]=T(i,o,a,s,c,u,l,h),r[n+1]=L(i,o,a,s,c,u,l,h)}},o.prototype._update=function(t,e){this._prepareBlock(t,e);var r=this.W,n=this.h[0],i=this.h[1],o=this.h[2],a=this.h[3],s=this.h[4],c=this.h[5],u=this.h[6],l=this.h[7],h=this.h[8],d=this.h[9],p=this.h[10],f=this.h[11],v=this.h[12],m=this.h[13],g=this.h[14],y=this.h[15];B(this.k.length===r.length);for(var b=0;b<r.length;b+=2){var _=g,A=y,I=H(h,d),S=U(h,d),k=M(h,d,p,f,v,m),C=x(h,d,p,f,v,m),E=this.k[b],P=this.k[b+1],w=r[b],R=r[b+1],D=z(_,A,I,S,k,C,E,P,w,R),T=G(_,A,I,S,k,C,E,P,w,R),_=N(n,i),A=K(n,i),I=O(n,i,o,a,s,c),S=q(n,i,o,a,s,c),L=V(_,A,I,S),F=W(_,A,I,S);g=v,y=m,v=p,m=f,p=h,f=d,h=V(u,l,D,T),d=W(l,l,D,T),u=s,l=c,s=o,c=a,o=n,a=i,n=V(D,T,L,F),i=W(D,T,L,F)}j(this.h,0,n,i),j(this.h,2,o,a),j(this.h,4,s,c),j(this.h,6,u,l),j(this.h,8,h,d),j(this.h,10,p,f),j(this.h,12,v,m),j(this.h,14,g,y)},o.prototype._digest=function(t){return"hex"===t?l.toHex32(this.h,"big"):l.split32(this.h,"big")},l.inherits(a,o),r.sha384=a,a.blockSize=1024,a.outSize=384,a.hmacStrength=192,a.padLength=128,a.prototype._digest=function(t){return"hex"===t?l.toHex32(this.h.slice(0,12),"big"):l.split32(this.h.slice(0,12),"big")},l.inherits(s,F),r.sha1=s,s.blockSize=512,s.outSize=160,s.hmacStrength=80,s.padLength=64,s.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=S(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);for(var i=this.h[0],o=this.h[1],a=this.h[2],s=this.h[3],c=this.h[4],n=0;n<r.length;n++){var u=~~(n/20),l=E(S(i,5),h(u,o,a,s),c,r[n],X[u]);c=s,s=a,a=S(o,30),o=i,i=l}this.h[0]=k(this.h[0],i),this.h[1]=k(this.h[1],o),this.h[2]=k(this.h[2],a),this.h[3]=k(this.h[3],s),this.h[4]=k(this.h[4],c)},s.prototype._digest=function(t){return"hex"===t?l.toHex32(this.h,"big"):l.split32(this.h,"big")}},{"../hash":19}],24:[function(t,e,r){function n(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e){t=t.replace(/[^a-z0-9]+/gi,""),t.length%2!==0&&(t="0"+t);for(var n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}}else for(var n=0;n<t.length;n++){var i=t.charCodeAt(n),o=i>>8,a=255&i;o?r.push(o,a):r.push(a)}else for(var n=0;n<t.length;n++)r[n]=0|t[n];return r}function i(t){for(var e="",r=0;r<t.length;r++)e+=s(t[r].toString(16));return e}function o(t){var e=t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24;return e>>>0}function a(t,e){for(var r="",n=0;n<t.length;n++){var i=t[n];"little"===e&&(i=o(i)),r+=c(i.toString(16))}return r}function s(t){return 1===t.length?"0"+t:t}function c(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}function u(t,e,r,n){var i=r-e;g(i%4===0);for(var o=new Array(i/4),a=0,s=e;a<o.length;a++,s+=4){var c;c="big"===n?t[s]<<24|t[s+1]<<16|t[s+2]<<8|t[s+3]:t[s+3]<<24|t[s+2]<<16|t[s+1]<<8|t[s],o[a]=c>>>0}return o}function l(t,e){for(var r=new Array(4*t.length),n=0,i=0;n<t.length;n++,i+=4){var o=t[n];"big"===e?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r}function h(t,e){return t>>>e|t<<32-e}function d(t,e){return t<<e|t>>>32-e}function p(t,e){return t+e>>>0}function f(t,e,r){return t+e+r>>>0}function v(t,e,r,n){return t+e+r+n>>>0}function m(t,e,r,n,i){return t+e+r+n+i>>>0}function g(t,e){if(!t)throw new Error(e||"Assertion failed")}function y(t,e,r,n){var i=t[e],o=t[e+1],a=n+o>>>0,s=(a<n?1:0)+r+i;t[e]=s>>>0,t[e+1]=a}function b(t,e,r,n){var i=e+n>>>0,o=(i<e?1:0)+t+r;return o>>>0}function _(t,e,r,n){var i=e+n;return i>>>0}function A(t,e,r,n,i,o,a,s){var c=0,u=e;u=u+n>>>0,c+=u<e?1:0,u=u+o>>>0,c+=u<o?1:0,u=u+s>>>0,c+=u<s?1:0;var l=t+r+i+a+c;return l>>>0}function I(t,e,r,n,i,o,a,s){var c=e+n+o+s;return c>>>0}function S(t,e,r,n,i,o,a,s,c,u){var l=0,h=e;h=h+n>>>0,l+=h<e?1:0,h=h+o>>>0,l+=h<o?1:0,h=h+s>>>0,l+=h<s?1:0,h=h+u>>>0,l+=h<u?1:0;var d=t+r+i+a+c+l;return d>>>0}function k(t,e,r,n,i,o,a,s,c,u){var l=e+n+o+s+u;return l>>>0}function C(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}function E(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}function P(t,e,r){return t>>>r}function w(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}var R=r,D=t("inherits");R.toArray=n,R.toHex=i,R.htonl=o,R.toHex32=a,R.zero2=s,R.zero8=c,R.join32=u,R.split32=l,R.rotr32=h,R.rotl32=d,R.sum32=p,R.sum32_3=f,R.sum32_4=v,R.sum32_5=m,R.assert=g,R.inherits=D,r.sum64=y,r.sum64_hi=b,r.sum64_lo=_,r.sum64_4_hi=A,r.sum64_4_lo=I,r.sum64_5_hi=S,r.sum64_5_lo=k,r.rotr64_hi=C,r.rotr64_lo=E,r.shr64_hi=P,r.shr64_lo=w},{inherits:27}],25:[function(t,e,r){"use strict";function i(t){if(!(this instanceof i))return new i(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this.reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=a.toArray(t.entropy,t.entropyEnc||"hex"),r=a.toArray(t.nonce,t.nonceEnc||"hex"),n=a.toArray(t.pers,t.persEnc||"hex");o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var n=t("hash.js"),a=t("minimalistic-crypto-utils"),o=t("minimalistic-assert");e.exports=i,i.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this.reseed=1,this.reseedInterval=281474976710656},i.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},i.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},i.prototype.reseed=function(t,e,r,n){"string"!=typeof e&&(n=r,r=e,e=null),t=a.toArray(t,e),r=a.toArray(r,n),o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this.reseed=1},i.prototype.generate=function(t,e,r,n){if(this.reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=a.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length<t;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var o=i.slice(0,t);return this._update(r),this.reseed++,a.encode(o,e)}},{"hash.js":19,"minimalistic-assert":28,"minimalistic-crypto-utils":26}],26:[function(t,e,r){"use strict";function n(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"!=typeof t){for(var n=0;n<t.length;n++)r[n]=0|t[n];return r}if("hex"===e){t=t.replace(/[^a-z0-9]+/gi,""),t.length%2!==0&&(t="0"+t);for(var n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}else for(var n=0;n<t.length;n++){var i=t.charCodeAt(n),o=i>>8,a=255&i;o?r.push(o,a):r.push(a)}return r}function i(t){return 1===t.length?"0"+t:t}function o(t){for(var e="",r=0;r<t.length;r++)e+=i(t[r].toString(16));return e}var a=r;a.toArray=n,a.zero2=i,a.toHex=o,a.encode=function(t,e){return"hex"===e?o(t):t}},{}],27:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],28:[function(t,e,r){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}e.exports=n,n.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},{}],29:[function(t,e,r){"use strict";function n(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"!=typeof t){for(var n=0;n<t.length;n++)r[n]=0|t[n];return r}if(e){if("hex"===e){t=t.replace(/[^a-z0-9]+/gi,""),t.length%2!==0&&(t="0"+t);for(var n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}}else for(var n=0;n<t.length;n++){var i=t.charCodeAt(n),o=i>>8,a=255&i;o?r.push(o,a):r.push(a)}return r}function i(t){return 1===t.length?"0"+t:t}function o(t){for(var e="",r=0;r<t.length;r++)e+=i(t[r].toString(16));return e}var a=r;a.toArray=n,a.zero2=i,a.toHex=o,a.encode=function(t,e){return"hex"===e?o(t):t}},{}],30:[function(t,e,r){e.exports={name:"elliptic",version:"6.4.0",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^1.4.3",coveralls:"^2.11.3",grunt:"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2",istanbul:"^0.4.2",jscs:"^2.9.0",jshint:"^2.6.0",mocha:"^2.1.0"},dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"}}},{}]},{},[1])(1)});(function(t){"use strict";var e={byteLength:o,toByteArray:a,fromByteArray:v};t.base64js=e;var c=[];var u=[];var l=typeof Uint8Array!=="undefined"?Uint8Array:Array;var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var n=0,i=r.length;n<i;++n){c[n]=r[n];u[r.charCodeAt(n)]=n}u["-".charCodeAt(0)]=62;u["_".charCodeAt(0)]=63;function h(t){var e=t.length;if(e%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}var r=t.indexOf("=");if(r===-1)r=e;var n=r===e?0:4-r%4;return[r,n]}function d(t){var e=t.length%4;if(e>0){var r=4-e;while(r>0){t+="=";r--}}return t}function o(t){var e=h(d(t));var r=e[0];var n=e[1];return(r+n)*3/4-n}function p(t,e,r){return(e+r)*3/4-r}function a(t){var e;var r=h(d(t));var n=r[0];var i=r[1];var o=new l(p(t,n,i));var a=0;var s=i>0?n-4:n;for(var c=0;c<s;c+=4){e=u[t.charCodeAt(c)]<<18|u[t.charCodeAt(c+1)]<<12|u[t.charCodeAt(c+2)]<<6|u[t.charCodeAt(c+3)];o[a++]=e>>16&255;o[a++]=e>>8&255;o[a++]=e&255}if(i===2){e=u[t.charCodeAt(c)]<<2|u[t.charCodeAt(c+1)]>>4;o[a++]=e&255}if(i===1){e=u[t.charCodeAt(c)]<<10|u[t.charCodeAt(c+1)]<<4|u[t.charCodeAt(c+2)]>>2;o[a++]=e>>8&255;o[a++]=e&255}return o}function s(t){return c[t>>18&63]+c[t>>12&63]+c[t>>6&63]+c[t&63]}function f(t,e,r){var n;var i=[];for(var o=e;o<r;o+=3){n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255);i.push(s(n))}return i.join("")}function v(t){var e;var r=t.length;var n=r%3;var i=[];var o=16383;for(var a=0,s=r-n;a<s;a+=o){i.push(f(t,a,a+o>s?s:a+o))}if(n===1){e=t[r-1];i.push(c[e>>2]+c[e<<4&63]+"==")}else if(n===2){e=(t[r-2]<<8)+t[r-1];i.push(c[e>>10]+c[e>>4&63]+c[e<<2&63]+"=")}return i.join("")}})(this);var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(){}t.__tarsusInterfaceName="InputResponseType";return t}();t.InputResponseType=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(){}t.__tarsusInterfaceName="AuthenticationActionParameter";return t}();t.AuthenticationActionParameter=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var __extends=this&&this.__extends||function(){var n=function(t,e){n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return n(t,e)};return function(t,e){n(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}();var com;(function(r){var t;(function(t){var e;(function(t){var e;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.getAuthenticatorInput=function(){return this._authenticatorInput};e.prototype.setAuthenticatorInput=function(t){this._authenticatorInput=t};e.prototype.getSelectedTargets=function(){return this._selectedTargets};e.prototype.setSelectedTargets=function(t){this._selectedTargets=t};e.createAuthenticatorInput=function(t){return r.ts.mobile.sdk.impl.TargetBasedAuthenticatorInputImpl.createAuthenticatorInput(t)};e.createTargetSelectionRequest=function(t){return r.ts.mobile.sdk.impl.TargetBasedAuthenticatorInputImpl.createTargetSelectionRequest(t)};e.createTargetsSelectionRequest=function(t){return r.ts.mobile.sdk.impl.TargetBasedAuthenticatorInputImpl.createTargetsSelectionRequest(t)};e.__tarsusInterfaceName="TargetBasedAuthenticatorInput";return e}(t.InputResponseType);t.TargetBasedAuthenticatorInput=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(t=r.ts||(r.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.__tarsusInterfaceName="OtpInput";return e}(t.InputResponseType);t.OtpInput=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(r){var t;(function(t){var e;(function(t){var e;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.createSuccessResponse=function(t){return r.ts.mobile.sdk.impl.PlaceholderInputResponseImpl.createSuccessResponse(t)};e.createdFailedResponse=function(t,e){return r.ts.mobile.sdk.impl.PlaceholderInputResponseImpl.createdFailedResponse(t,e)};e.createFailedResponseWithServerProvidedStatus=function(t){return r.ts.mobile.sdk.impl.PlaceholderInputResponseImpl.createFailedResponseWithServerProvidedStatus(t)};e.__tarsusInterfaceName="PlaceholderInputResponse";return e}(t.InputResponseType);t.PlaceholderInputResponse=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(t=r.ts||(r.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(){}t.__tarsusInterfaceName="PushRequestPayload";return t}();t.PushRequestPayload=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(r){var t;(function(t){var e;(function(t){var e;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.createSuccessResponse=function(t){return r.ts.mobile.sdk.impl.FidoInputResponseImpl.createSuccessResponse(t)};e.createdFailedResponse=function(t,e){return r.ts.mobile.sdk.impl.FidoInputResponseImpl.createdFailedResponse(t,e)};e.__tarsusInterfaceName="FidoInputResponse";return e}(t.InputResponseType);t.FidoInputResponse=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(t=r.ts||(r.ts={}))})(com||(com={}));var com;(function(r){var t;(function(t){var e;(function(t){var e;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.createWithUserId=function(t){return r.ts.mobile.sdk.impl.MobileApprovePushRequestPayloadImpl.createWithUserId(t)};e.createWithUserTicket=function(t){return r.ts.mobile.sdk.impl.MobileApprovePushRequestPayloadImpl.createWithUserTicket(t)};e.createWithJsonPayload=function(t){return r.ts.mobile.sdk.impl.MobileApprovePushRequestPayloadImpl.createWithJsonPayload(t)};e.__tarsusInterfaceName="MobileApprovePushRequestPayload";return e}(t.PushRequestPayload);t.MobileApprovePushRequestPayload=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(t=r.ts||(r.ts={}))})(com||(com={}));var com;(function(r){var t;(function(t){var e;(function(t){var e;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.createSecurityQuestionAnswersInputResponse=function(t){return r.ts.mobile.sdk.impl.SecurityQuestionInputResponseImpl.createSecurityQuestionAnswersInputResponse(t)};e.__tarsusInterfaceName="SecurityQuestionInputResponse";return e}(t.InputResponseType);t.SecurityQuestionInputResponse=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(t=r.ts||(r.ts={}))})(com||(com={}));var com;(function(r){var t;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(){}t.prototype.getAnswerText=function(){return this._answerText};t.createWithText=function(t){return r.ts.mobile.sdk.impl.SecurityQuestionAnswerImpl.createWithText(t)};t.__tarsusInterfaceName="SecurityQuestionAnswer";return t}();t.SecurityQuestionAnswer=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(t=r.ts||(r.ts={}))})(com||(com={}));var com;(function(r){var t;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(){}t.prototype.getQuestion=function(){return this._question};t.prototype.getAnswer=function(){return this._answer};t.createAnswerToQuestion=function(t,e){return r.ts.mobile.sdk.impl.SecurityQuestionAndAnswerImpl.createAnswerToQuestion(t,e)};t.__tarsusInterfaceName="SecurityQuestionAndAnswer";return t}();t.SecurityQuestionAndAnswer=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(t=r.ts||(r.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(){}t.prototype.getAssertionData=function(){return this._assertionData};t.prototype.setAssertionData=function(t){this._assertionData=t};t.prototype.getStoredData=function(){return this._storedData};t.prototype.setStoredData=function(t){this._storedData=t};t.__tarsusInterfaceName="TotpProvisionOutput";return t}();t.TotpProvisionOutput=e})(e=t.tarsusplugin||(t.tarsusplugin={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(t,e){this._stepTag=t;this._passphraseText=e}t.prototype.getStepTag=function(){return this._stepTag};t.prototype.getAcquisitionChallenges=function(){return[]};t.prototype.getPassphraseText=function(){return this._passphraseText};t.__tarsusInterfaceName="AudioAcquisitionStepDescription";return t}();t.AudioAcquisitionStepDescriptionImpl=e})(e=t.impl||(t.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(r){var t;(function(t){var e;(function(t){var e;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.getTarget=function(){return this._target};e.create=function(t){return r.ts.mobile.sdk.impl.AuthenticationActionParameterTargetSelectionImpl.create(t)};e.__tarsusInterfaceName="AuthenticationActionParameterTargetSelection";return e}(t.AuthenticationActionParameter);t.AuthenticationActionParameterTargetSelection=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(t=r.ts||(r.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e=function(r){__extends(e,r);function e(t){var e=r.call(this)||this;e._target=t;return e}e.create=function(t){return new e(t)};e.__tarsusInterfaceName="AuthenticationActionParameterTargetSelection";return e}(r.AuthenticationActionParameterTargetSelection);t.AuthenticationActionParameterTargetSelectionImpl=e})(t=r.impl||(r.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(r){var t;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(){}t.prototype.getErrorCode=function(){return this._errorCode};t.prototype.getMessage=function(){return this._message};t.prototype.getData=function(){return this._data};t.createApplicationGeneratedGeneralError=function(t,e){return r.ts.mobile.sdk.impl.AuthenticationErrorImpl.createApplicationGeneratedGeneralError(t,e)};t.createApplicationGeneratedCommunicationError=function(t,e){return r.ts.mobile.sdk.impl.AuthenticationErrorImpl.createApplicationGeneratedCommunicationError(t,e)};t.__tarsusInterfaceName="AuthenticationError";return t}();t.AuthenticationError=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(t=r.ts||(r.ts={}))})(com||(com={}));var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i))t[i]=e[i]}return t};return __assign.apply(this,arguments)};var com;(function(t){var e;(function(t){var e;(function(o){var t;(function(s){var t;(function(n){var t=function(i){__extends(a,i);function a(t,e,r){var n=i.call(this)||this;n._errorCode=t;n._message=e;n._data=__assign({},r||{},{public_properties:{}});return n}a.errorForServerResponse=function(t){var e={server_error_code:t.error_code,server_error_message:t.error_message,server_error_data:t.data};var r=t.error_message||"Internal error";var n=s.AuthenticationErrorCode.Internal;switch(t.error_code){case 2009:n=s.AuthenticationErrorCode.DeviceNotFound;break;case 28:var i=new a(s.AuthenticationErrorCode.InvalidIdToken,r);i.setPublicProperty(s.AuthenticationErrorProperty.InvalidIdTokenErrorReason,s.AuthenticationErrorPropertySymbol.InvalidIdTokenErrorReasonBadToken);return i;case 29:i=new a(s.AuthenticationErrorCode.InvalidIdToken,r);i.setPublicProperty(s.AuthenticationErrorProperty.InvalidIdTokenErrorReason,s.AuthenticationErrorPropertySymbol.InvalidIdTokenErrorReasonExpiredToken);return i;case 3001:case 3002:n=s.AuthenticationErrorCode.InvalidDeviceBinding;break;case 4e3:case 4002:n=s.AuthenticationErrorCode.ControlFlowExpired;break;case 4005:case 4006:n=s.AuthenticationErrorCode.SessionRequired;break;case 6001:case 6002:n=s.AuthenticationErrorCode.ApprovalWrongState;break}return new a(n,r,e)};a.createApplicationGeneratedGeneralError=function(t,e){return new a(s.AuthenticationErrorCode.Internal,t,e)};a.createApplicationGeneratedCommunicationError=function(t,e){return new a(s.AuthenticationErrorCode.Communication,t,e)};a.errorForSessionRejectionFailureData=function(t){var e=s.AuthenticationErrorCode.PolicyRejection;var r="Session rejected by server.";var n={failure_data:t};if(t&&t.source){var i=t;var o=void 0;switch(t.reason&&t.reason.type){case s.core.Protocol.FailureReasonType.ApprovalExpired:e=s.AuthenticationErrorCode.ApprovalWrongState;r="Approval expired.";n.approval_state="expired";break}}return new a(e,r,n)};a.errorForHostInternalBiometricErrorData=function(t,e){var r;switch(t[o.sdkhost.ErrorDataInternalError]){case o.sdkhost.InternalErrorBiometricInvalidated:r=new n.AuthenticationErrorImpl(s.AuthenticationErrorCode.AuthenticatorInvalidated,e+" registration invalidated.");break;case o.sdkhost.InternalErrorWrongBiometric:r=new n.AuthenticationErrorImpl(s.AuthenticationErrorCode.InvalidInput,"Invalid "+e+" was input.");break;case o.sdkhost.InternalErrorBiometricNotConfigured:r=new n.AuthenticationErrorImpl(s.AuthenticationErrorCode.AuthenticatorExternalConfigError,e+" not configured on this device.");r.setPublicProperty(s.AuthenticationErrorProperty.AuthenticatorExternalConfigErrorReason,s.AuthenticationErrorPropertySymbol.AuthenticatorExternalConfigErrorReasonBiometricsNotEnrolled);break;case o.sdkhost.InternalErrorBiometricOsLockTemporary:r=new n.AuthenticationErrorImpl(s.AuthenticationErrorCode.AuthenticatorExternalConfigError,e+" authentication is temporarily locked by the OS.");r.setPublicProperty(s.AuthenticationErrorProperty.AuthenticatorExternalConfigErrorReason,s.AuthenticationErrorPropertySymbol.AuthenticatorExternalConfigErrorReasonBiometricsOsLockTemporary);break;case o.sdkhost.InternalErrorBiometricOsLockPermanent:r=new n.AuthenticationErrorImpl(s.AuthenticationErrorCode.AuthenticatorExternalConfigError,e+" authentication is permanently locked by the OS.");r.setPublicProperty(s.AuthenticationErrorProperty.AuthenticatorExternalConfigErrorReason,s.AuthenticationErrorPropertySymbol.AuthenticatorExternalConfigErrorReasonBiometricsOsLockPermanent);break;default:r=null}return r};a.prototype.setPublicProperty=function(t,e){this._data.public_properties[s.AuthenticationErrorProperty[t]]=e};a.prototype.getPublicProperty=function(t){return this._data.public_properties[s.AuthenticationErrorProperty[t]]};a.prototype.getPublicBooleanProperty=function(t){var e=this.getPublicProperty(t);if(e&&typeof e!=="boolean"){throw new a(s.AuthenticationErrorCode.AppImplementation,"type of property "+s.AuthenticationErrorProperty[t]+" is not 'boolean'")}return e};a.prototype.getPublicNumberProperty=function(t){var e=this.getPublicProperty(t);if(e&&typeof e!=="number"){throw new a(s.AuthenticationErrorCode.AppImplementation,"type of property "+s.AuthenticationErrorProperty[t]+" is not 'number'")}return e};a.prototype.getPublicStringProperty=function(t){var e=this.getPublicProperty(t);if(e&&typeof e!=="string"){throw new a(s.AuthenticationErrorCode.AppImplementation,"type of property "+s.AuthenticationErrorProperty[t]+" is not 'string'")}return e};a.prototype.getPublicSymbolicProperty=function(t){var e=this.getPublicProperty(t);if(e&&!s.AuthenticationErrorProperty[t]){throw new a(s.AuthenticationErrorCode.AppImplementation,"type of property "+s.AuthenticationErrorProperty[t]+" is not 'AuthenticationErrorPropertySymbol'")}return e};a.prototype.toString=function(){return"AuthenticationError<"+s.AuthenticationErrorCode[this._errorCode]+", "+this._message+", "+JSON.stringify(this._data)+">"};a.errorForAssertionResponse=function(t){var e;var r;switch(t.assertion_error_code){case s.core.Protocol.AssertionErrorCode.FailedAssertion:e=s.AuthenticationErrorCode.InvalidInput;break;case s.core.Protocol.AssertionErrorCode.MethodLocked:e=s.AuthenticationErrorCode.AuthenticatorLocked;break;case s.core.Protocol.AssertionErrorCode.HistoryRepeat:e=s.AuthenticationErrorCode.RegisteredSecretAlreadyInHistory;break;default:e=s.AuthenticationErrorCode.Internal}var n={assertion_error_code:t.assertion_error_code,additional_data:t.data};var i=t.assertion_error_message||"Assertion error code "+t.assertion_error_code;return new a(e,i,n)};a.appImplementationError=function(t){return new a(s.AuthenticationErrorCode.AppImplementation,t)};a.errorForTransportResponse=function(t){return new a(s.AuthenticationErrorCode.Communication,"HTTP response error",{status:t.getStatus(),body:t.getBodyJson()})};a.ensureAuthenticationError=function(t){if(a.dynamicCast(t)){return t}var e={js_error_message:t.toString()};if(t.stack){e["js_error_stack"]=t.stack}return new a(s.AuthenticationErrorCode.Internal,"Internal error occurred.",e)};a.augmentErrorData=function(t,e){var r={};var n=t.getData();var i;if(n){for(i in n){r[i]=n[i]}}for(i in e){r[i]=e[i]}return new a(t.getErrorCode(),t.getMessage(),r)};a.dynamicCast=function(t){return t["getErrorCode"]!==undefined&&t["getMessage"]!==undefined&&t["getData"]!==undefined};return a}(s.AuthenticationError);n.AuthenticationErrorImpl=t})(t=s.impl||(s.impl={}))})(t=o.sdk||(o.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(t,e){this._authenticator=t;this._suggestedParams=e}t.prototype.getAuthenticator=function(){return this._authenticator};t.prototype.getSuggestedParameters=function(){return this._suggestedParams};return t}();t.AuthenticationOptionImpl=e})(e=t.impl||(t.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(){function r(t,e,r,n){this._appData=r||null;this._token=t||null;this._internalData=n||null;this._deviceId=e||null}r.prototype.getToken=function(){return this._token||""};r.prototype.getDeviceId=function(){return this._deviceId||""};r.prototype.getData=function(){return this._appData||{}};r.prototype.getInternalData=function(){return this._internalData};r.fromCflowServerResponse=function(t,e){return new r(t.token,e,t.application_data,t.data)};return r}();t.AuthenticationResultImpl=e})(e=t.impl||(t.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(r){var t;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(){}t.prototype.getResultType=function(){return this._resultType};t.prototype.setResultType=function(t){this._resultType=t};t.prototype.getSelectedAuthenticator=function(){return this._selectedAuthenticator};t.prototype.setSelectedAuthenticator=function(t){this._selectedAuthenticator=t};t.prototype.getSelectedAuthenticationParameters=function(){return this._selectedAuthenticationParameters};t.prototype.setSelectedAuthenticationParameters=function(t){this._selectedAuthenticationParameters=t};t.createAbortRequest=function(){return r.ts.mobile.sdk.impl.AuthenticatorSelectionResultImpl.createAbortRequest()};t.createSelectionRequest=function(t){return r.ts.mobile.sdk.impl.AuthenticatorSelectionResultImpl.createSelectionRequest(t)};t.createParameterizedSelectionRequest=function(t,e){return r.ts.mobile.sdk.impl.AuthenticatorSelectionResultImpl.createParameterizedSelectionRequest(t,e)};t.__tarsusInterfaceName="AuthenticatorSelectionResult";return t}();t.AuthenticatorSelectionResult=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(t=r.ts||(r.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(n){var t;(function(t){var e=function(t){__extends(r,t);function r(){return t!==null&&t.apply(this,arguments)||this}r.createAbortRequest=function(){var t=new r;t.setResultType(n.AuthenticatorSelectionResultType.Abort);return t};r.createSelectionRequest=function(t){var e=new r;e.setResultType(n.AuthenticatorSelectionResultType.SelectAuthenticator);e.setSelectedAuthenticator(t);return e};return r}(n.AuthenticatorSelectionResult);t.AuthenticatorSelectionResultImpl=e})(t=n.impl||(n.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(t){this._acquisitionChallenges=t}t.prototype.getStepTag=function(){return"imageAcquisition"};t.prototype.getAcquisitionChallenges=function(){return this._acquisitionChallenges};t.__tarsusInterfaceName="CameraAcquisitionStepDescription";return t}();t.CameraAcquisitionStepDescriptionImpl=e})(e=t.impl||(t.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(r){var t;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(){}t.prototype.getLocalEnrollmentKeySizeInBytes=function(){return this._localEnrollmentKeySizeInBytes};t.prototype.getLocalEnrollmentKeyIterationCount=function(){return this._localEnrollmentKeyIterationCount};t.prototype.setLocalEnrollmentKeyIterationCount=function(t){this._localEnrollmentKeyIterationCount=t};t.create=function(t){return r.ts.mobile.sdk.impl.ClientCryptoSettingsImpl.create(t)};t.__tarsusInterfaceName="ClientCryptoSettings";return t}();t.ClientCryptoSettings=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(t=r.ts||(r.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e=function(t){__extends(r,t);function r(){return t!==null&&t.apply(this,arguments)||this}r.create=function(t){var e=new r;e.setLocalEnrollmentKeyIterationCount(t);e._localEnrollmentKeySizeInBytes=256/8;return e};return r}(r.ClientCryptoSettings);t.ClientCryptoSettingsImpl=e})(t=r.impl||(r.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e=function(){function t(t,e){this._description=t;this._menuItemOptions=e||{}}t.prototype.getDescription=function(){return this._description};t.prototype.getAvailableActions=function(){var e=this;var t=[];switch(this._description.getRegistrationStatus()){case r.AuthenticatorRegistrationStatus.Registered:t=[r.AuthenticatorConfigurationAction.Reregister,r.AuthenticatorConfigurationAction.Unregister];break;case r.AuthenticatorRegistrationStatus.Unregistered:case r.AuthenticatorRegistrationStatus.LocallyInvalid:t=[r.AuthenticatorConfigurationAction.Register];break}return t.filter(function(t){return t==r.AuthenticatorConfigurationAction.Reregister&&!e._menuItemOptions.hide_reregister||t==r.AuthenticatorConfigurationAction.Register&&!e._menuItemOptions.hide_register||t==r.AuthenticatorConfigurationAction.Unregister&&!e._menuItemOptions.hide_unregister})};return t}();t.ConfigurableAuthenticatorImpl=e})(t=r.impl||(r.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(r){var t;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(){}t.prototype.getUserChoice=function(){return this._userChoice};t.prototype.setUserChoice=function(t){this._userChoice=t};t.create=function(t){return r.ts.mobile.sdk.impl.ConfirmationInputImpl.create(t)};t.__tarsusInterfaceName="ConfirmationInput";return t}();t.ConfirmationInput=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(t=r.ts||(r.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e=function(t){__extends(r,t);function r(){return t!==null&&t.apply(this,arguments)||this}r.create=function(t){var e=new r;e.setUserChoice(t);return e};return r}(r.ConfirmationInput);t.ConfirmationInputImpl=e})(t=r.impl||(r.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(r){var t;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(){}t.prototype.getRequestType=function(){return this._requestType};t.prototype.setRequestType=function(t){this._requestType=t};t.create=function(t){return r.ts.mobile.sdk.impl.ControlRequestImpl.create(t)};t.__tarsusInterfaceName="ControlRequest";return t}();t.ControlRequest=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(t=r.ts||(r.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e=function(t){__extends(r,t);function r(){return t!==null&&t.apply(this,arguments)||this}r.create=function(t){var e=new r;e.setRequestType(t);return e};return r}(r.ControlRequest);t.ControlRequestImpl=e})(t=r.impl||(r.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(t,e){this._id=t;this._name=e}t.prototype.getId=function(){return this._id};t.prototype.getName=function(){return this._name};return t}();t.DeviceGroupImpl=e})(e=t.impl||(t.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(n){var t;(function(r){var t=function(){function t(t){this.updateFromServer(t)}t.prototype.getDeviceHwId=function(){return this._id};t.prototype.getDeviceId=function(){return this._logicalId};t.prototype.getName=function(){return this._name?this._name:this._model+" "+this._osType+" "+this._osVersion};t.prototype.getStatus=function(){return this._status};t.prototype.getLastAccess=function(){return this._lastAccess};t.prototype.getLastAccessLocation=function(){return this._lastAccessLocation};t.prototype.getLastAccessLocationAttributes=function(){return this._lastAccessLocationAttributes};t.prototype.getLastBind=function(){return this._lastBind};t.prototype.getRegistered=function(){return this._registered};t.prototype.getModel=function(){return this._model};t.prototype.getOsType=function(){return this._osType};t.prototype.getOsVersion=function(){return this._osVersion};t.prototype.getUseCount=function(){return this._useCount};t.prototype.getPushSupported=function(){return this._pushSupported};t.prototype.getIsCurrent=function(){return this._isCurrent};t.prototype.getDeviecId=function(){return this._id};t.prototype.getGroups=function(){return this._groups};t.prototype.setStatus=function(t){this._status=t};t.prototype.setName=function(t){this._name=t};t.prototype.forceCurrent=function(){this._isCurrent=true};t.prototype.updateFromServer=function(t){this._model=n.util.getDeviceModel(t.device_model,t.os_type);this._name=t.name;this._lastBind=Date.parse(t.last_bind_date);this._lastAccess=Date.parse(t.last_access);this._registered=Date.parse(t.registered);this._osType=n.util.getOsName(t.os_type);this._osVersion=t.os_version;this._useCount=t.use_count;this._pushSupported=t.supports_push;this._isCurrent=t.cur_device;this._id=t.device_id;this._logicalId=t.logical_device_id;switch(t.status){case n.core.Protocol.DeviceStatusServerFormat.Disabled:this._status=n.DeviceStatus.Disabled;break;case n.core.Protocol.DeviceStatusServerFormat.LongInactivity:this._status=n.DeviceStatus.LongInactivity;break;case n.core.Protocol.DeviceStatusServerFormat.NoRecentActivity:this._status=n.DeviceStatus.NoRecentActivity;break;case n.core.Protocol.DeviceStatusServerFormat.RecentlyUsed:this._status=n.DeviceStatus.RecentlyUsed;break;case n.core.Protocol.DeviceStatusServerFormat.Removed:this._status=n.DeviceStatus.Removed;break;default:throw new r.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Unknown device status "+t.status)}if(t.last_access_location){var e=new n.GeoLocation;e.longitude=t.last_access_location.lng;e.latitude=t.last_access_location.lat;this._lastAccessLocation=e;this._lastAccessLocationAttributes=new r.LocationAttributesImpl(t.last_access_location)}if(t.groups){this._groups=t.groups.map(function(t){return new r.DeviceGroupImpl(t.id,t.name)})}};return t}();r.DeviceInfoImpl=t})(t=n.impl||(n.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(){}t.prototype.getOsName=function(t){var e=t;switch(t){case"iPhone":e="iOS";break;case"iPad":e="iOS";break}return e};t.prototype.getDeviceModel=function(t,e){var r=t;if(e=="iPhone"){switch(t){case"i386":r="Simulator";break;case"x86_64":r="Simulator";break;case"iPod1,1":r="iPod Touch";break;case"iPod2,1":r="iPod Touch";break;case"iPod3,1":r="iPod Touch";break;case"iPod4,1":r="iPod Touch";break;case"iPod7,1":r="iPod Touch";break;case"iPhone1,1":r="iPhone";break;case"iPhone1,2":r="iPhone";break;case"iPhone2,1":r="iPhone";break;case"iPad1,1":r="iPad";break;case"iPad2,1":r="iPad 2";break;case"iPad3,1":r="iPad";break;case"iPhone3,1":r="iPhone 4";break;case"iPhone3,3":r="iPhone 4";break;case"iPhone4,1":r="iPhone 4S";break;case"iPhone5,1":r="iPhone 5";break;case"iPhone5,2":r="iPhone 5";break;case"iPad3,4":r="iPad";break;case"iPad2,5":r="iPad Mini";break;case"iPhone5,3":r="iPhone 5c";break;case"iPhone5,4":r="iPhone 5c";break;case"iPhone6,1":r="iPhone 5s";break;case"iPhone6,2":r="iPhone 5s";break;case"iPhone7,1":r="iPhone 6 Plus";break;case"iPhone7,2":r="iPhone 6";break;case"iPhone8,1":r="iPhone 6S";break;case"iPhone8,2":r="iPhone 6S Plus";break;case"iPhone8,4":r="iPhone SE";break;case"iPhone9,1":r="iPhone 7";break;case"iPhone9,3":r="iPhone 7";break;case"iPhone9,2":r="iPhone 7 Plus";break;case"iPhone9,4":r="iPhone 7 Plus";break;case"iPhone10,1":r="iPhone 8";break;case"iPhone10,4":r="iPhone 8";break;case"iPhone10,2":r="iPhone 8 Plus";break;case"iPhone10,5":r="iPhone 8 Plus";break;case"iPhone10,3":r="iPhone X";break;case"iPhone10,6":r="iPhone X";break;case"iPad4,1":r="iPad Air";break;case"iPad4,2":r="iPad Air";break;case"iPad4,4":r="iPad Mini";break;case"iPad4,5":r="iPad Mini";break;case"iPad4,7":r="iPad Mini";break;case"iPad6,7":r='iPad Pro (12.9")';break;case"iPad6,8":r='iPad Pro (12.9")';break;case"iPad6,3":r='iPad Pro (9.7")';break;case"iPad6,4":r='iPad Pro (9.7")';break;case"iPhone11,2":r="iPhone XS";break;case"iPhone11,6":r="iPhone XS Max";break;case"iPhone11,4":r="iPhone XS Max";break;case"iPhone11,8":r="iPhone XR";break;case"iPad6,7":r='iPad Pro (12.9")';break;case"iPad6,8":r='iPad Pro (12.9")';break;case"iPad6,11":r="iPad (2017)";break;case"iPad6,12":r="iPad (2017)";break;case"iPad7,1":r="iPad Pro 2nd Gen";break;case"iPad7,2":r="iPad Pro 2nd Gen";break;case"iPad7,3":r='iPad Pro (10.5")';break;case"iPad7,4":r='iPad Pro (10.5")';break;case"iPad7,5":r="iPad";break;case"iPad7,6":r="iPad";break;case"iPad8,1":r='iPad Pro (11")';break;case"iPad8,2":r='iPad Pro (11")';break;case"iPad8,3":r='iPad Pro (11")';break;case"iPad8,4":r='iPad Pro (11")';break;case"iPad8,5":r='iPad Pro (12.9")';break;case"iPad8,6":r='iPad Pro (12.9")';break;case"iPad8,7":r='iPad Pro (12.9")';break;case"iPad8,8":r='iPad Pro (12.9")';break}}return r};return t}();t.DeviceModelConverter=e})(e=t.core||(t.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(r){var t;(function(t){var e;(function(t){var e;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.createSuccessResponse=function(t){return r.ts.mobile.sdk.impl.Fido2InputResponseImpl.createSuccessResponse(t)};e.createdFailedResponse=function(t){return r.ts.mobile.sdk.impl.Fido2InputResponseImpl.createdFailedResponse(t)};e.__tarsusInterfaceName="Fido2InputResponse";return e}(t.InputResponseType);t.Fido2InputResponse=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(t=r.ts||(r.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.createSuccessResponse=function(t){var e=new r.Fido2AuthenticatorSuccessResponse;e.setFido2Response(t);return e};e.createdFailedResponse=function(t){var e=new r.Fido2AuthenticationFailedResponse;e.setFailureError(t);return e};return e}(r.Fido2InputResponse);t.Fido2InputResponseImpl=e})(t=r.impl||(r.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(n){var t;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.createSuccessResponse=function(t){var e=new n.FidoAuthSuccessResponse;e.setFidoResponse(t);return e};e.createdFailedResponse=function(t,e){var r=new n.FidoAuthFailureResponse;r.setFailureError(e);r.setExpired(t.getExpired());r.setLocked(t.getLocked());r.setRegistered(t.getRegistered());r.setRegistrationStatus(t.getRegistrationStatus());return r};return e}(n.PlaceholderInputResponse);t.FidoInputResponseImpl=e})(t=n.impl||(n.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(n){var t;(function(t){var e;(function(t){var e;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.getPrompt=function(){return this._prompt};e.prototype.setPrompt=function(t){this._prompt=t};e.prototype.getFallbackButtonTitle=function(){return this._fallbackButtonTitle};e.prototype.setFallbackButtonTitle=function(t){this._fallbackButtonTitle=t};e.prototype.getFallbackControlRequestType=function(){return this._fallbackControlRequestType};e.prototype.setFallbackControlRequestType=function(t){this._fallbackControlRequestType=t};e.create=function(t){return n.ts.mobile.sdk.impl.FingerprintInputImpl.create(t)};e.createFallbackEnabledPrompt=function(t,e,r){return n.ts.mobile.sdk.impl.FingerprintInputImpl.createFallbackEnabledPrompt(t,e,r)};e.__tarsusInterfaceName="FingerprintInput";return e}(t.InputResponseType);t.FingerprintInput=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(o){var t;(function(t){var e=function(t){__extends(i,t);function i(){return t!==null&&t.apply(this,arguments)||this}i.create=function(t){var e=new i;if(t){e.setPrompt(t)}return e};i.createFallbackEnabledPrompt=function(t,e,r){var n=new i;if(t){n.setPrompt(t)}if(e){n.setFallbackButtonTitle(e)}if(r){n.setFallbackControlRequestType(r)}else{n.setFallbackControlRequestType(o.ControlRequestType.SelectMethod)}return n};return i}(o.FingerprintInput);t.FingerprintInputImpl=e})(t=o.impl||(o.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(r){var t;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(){}t.prototype.getJsonData=function(){return this._jsonData};t.prototype.setJsonData=function(t){this._jsonData=t};t.prototype.getControlRequest=function(){return this._controlRequest};t.prototype.setControlRequest=function(t){this._controlRequest=t};t.createFormInputSubmissionRequest=function(t){return r.ts.mobile.sdk.impl.FormInputImpl.createFormInputSubmissionRequest(t)};t.createFormCancellationRequest=function(){return r.ts.mobile.sdk.impl.FormInputImpl.createFormCancellationRequest()};t.__tarsusInterfaceName="FormInput";return t}();t.FormInput=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(t=r.ts||(r.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(n){var t;(function(t){var e=function(t){__extends(r,t);function r(){return t!==null&&t.apply(this,arguments)||this}r.createFormInputSubmissionRequest=function(t){var e=new r;e.setJsonData(t);e.setControlRequest(n.FormControlRequest.Submit);return e};r.createFormCancellationRequest=function(){var t=new r;t.setControlRequest(n.FormControlRequest.Abort);return t};return r}(n.FormInput);t.FormInputImpl=e})(t=n.impl||(n.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(){}return t}();t.GeoLocation=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.__tarsusInterfaceName="IdentifyDevicePushRequestPayload";return e}(t.PushRequestPayload);t.IdentifyDevicePushRequestPayload=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e=function(t){__extends(n,t);function n(){return t!==null&&t.apply(this,arguments)||this}n.prototype.userId=function(){return this._userId};n.prototype.title=function(){return this._title};n.createWithJsonPayload=function(t){var e=t;var r=new n;r._userId=e["user_id"];r._title=e["body"];return r};return n}(r.IdentifyDevicePushRequestPayload);t.IdentifyDevicePushRequestPayloadImpl=e})(t=r.impl||(r.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(r){var t;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(){}t.prototype.getResponse=function(){return this._response};t.prototype.setResponse=function(t){this._response=t};t.prototype.getControlRequest=function(){return this._controlRequest};t.prototype.setControlRequest=function(t){this._controlRequest=t};t.createControlResponse=function(t){return r.ts.mobile.sdk.impl.InputOrControlResponseImpl.createControlResponse(t)};t.createInputResponse=function(t){return r.ts.mobile.sdk.impl.InputOrControlResponseImpl.createInputResponse(t)};t.__tarsusInterfaceName="InputOrControlResponse";return t}();t.InputOrControlResponse=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(t=r.ts||(r.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e=function(t){__extends(r,t);function r(){return t!==null&&t.apply(this,arguments)||this}r.createControlResponse=function(t){var e=new r;e.setControlRequest(t);return e};r.createInputResponse=function(t){var e=new r;e.setResponse(t);return e};r.prototype.isControlRequest=function(){return!!this._controlRequest};return r}(r.InputOrControlResponse);t.InputOrControlResponseImpl=e})(t=r.impl||(r.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(r){var t;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(){}t.prototype.getContinueProcessing=function(){return this._continueProcessing};t.prototype.setContinueProcessing=function(t){this._continueProcessing=t};t.create=function(t){return r.ts.mobile.sdk.impl.JsonDataProcessingResultImpl.create(t)};t.__tarsusInterfaceName="JsonDataProcessingResult";return t}();t.JsonDataProcessingResult=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(t=r.ts||(r.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e=function(t){__extends(r,t);function r(){return t!==null&&t.apply(this,arguments)||this}r.create=function(t){var e=new r;e.setContinueProcessing(t);return e};return r}(r.JsonDataProcessingResult);t.JsonDataProcessingResultImpl=e})(t=r.impl||(r.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(t){this.city=t.city;this.state=t.state;this.country=t.country}t.prototype.getCity=function(){return this.city};t.prototype.getCountry=function(){return this.country};t.prototype.getState=function(){return this.state};return t}();t.LocationAttributesImpl=e})(e=t.impl||(t.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(e){var t=function(){function t(t){this._deviceInfo=new e.DeviceInfoImpl(t)}t.prototype.getInfo=function(){return this._deviceInfo};t.prototype.getAvailableActions=function(){if(this._deviceInfo.getStatus()==r.DeviceStatus.Removed){return[]}var t=[r.DeviceManagementAction.Rename];if(!this._deviceInfo.getIsCurrent()){t.push(r.DeviceManagementAction.Remove)}if(this._deviceInfo.getPushSupported()){t.push(r.DeviceManagementAction.Identify)}return t};return t}();e.ManagedDeviceImpl=t})(t=r.impl||(r.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(e){var t=function(){function t(t){this._approval=new e.MobileApprovalImpl(t);switch(this._approval.getStatus()){case r.MobileApprovalStatus.Pending:this._availableActions=[r.MobileApprovalAction.Approve,r.MobileApprovalAction.Deny];break;default:this._availableActions=[];break}}t.prototype.getApproval=function(){return this._approval};t.prototype.getAvailableActions=function(){return this._availableActions};return t}();e.ManagedMobileApprovalImpl=t})(t=r.impl||(r.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(e){var t=function(){function t(t){this._approvalId=t.approval_id;this._source=t.source;this._title=t.title;this._details=t.details;this._creationTime=t.create;this._finishTime=t.finish;this._expiresAt=t.create+t.expiry_in*1e3;switch(t.status){case r.core.Protocol.ServerResponseDataApprovalsApprovalStatus.Approved:this._status=r.MobileApprovalStatus.Approved;break;case r.core.Protocol.ServerResponseDataApprovalsApprovalStatus.Denied:this._status=r.MobileApprovalStatus.Denied;break;case r.core.Protocol.ServerResponseDataApprovalsApprovalStatus.Expired:this._status=r.MobileApprovalStatus.Expired;break;case r.core.Protocol.ServerResponseDataApprovalsApprovalStatus.Pending:this._status=r.MobileApprovalStatus.Pending;break;default:throw new e.AuthenticationErrorImpl(r.AuthenticationErrorCode.Internal,"Unknown approval status "+t.status)}}t.prototype.getApprovalId=function(){return this._approvalId};t.prototype.getSource=function(){return this._source};t.prototype.getTitle=function(){return this._title};t.prototype.getDetails=function(){return this._details};t.prototype.getCreationTime=function(){return this._creationTime};t.prototype.getFinishTime=function(){return this._finishTime};t.prototype.getExpiresAt=function(){return this._expiresAt};t.prototype.getStatus=function(){return this._status};t.prototype.isExpired=function(){return this._status==r.MobileApprovalStatus.Expired};t.prototype.updateStatus=function(t){this._status=t};return t}();e.MobileApprovalImpl=t})(t=r.impl||(r.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.__tarsusInterfaceName="MobileApproveInput";return e}(t.InputResponseType);t.MobileApproveInput=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(r){var t;(function(t){var e;(function(t){var e;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.createRequestPollingInput=function(){return r.ts.mobile.sdk.impl.MobileApproveInputRequestPollingImpl.createRequestPollingInput()};e.__tarsusInterfaceName="MobileApproveInputRequestPolling";return e}(t.MobileApproveInput);t.MobileApproveInputRequestPolling=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(t=r.ts||(r.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.createRequestPollingInput=function(){return new e};return e}(r.MobileApproveInputRequestPolling);t.MobileApproveInputRequestPollingImpl=e})(t=r.impl||(r.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(){function r(t,e){this.value=t;this.format=e}r.prototype.getValue=function(){return this.value};r.prototype.getFormat=function(){return this.format};r.create=function(t,e){return new r(t,e)};return r}();t.MobileApproveOtpImpl=e})(e=t.impl||(t.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e=function(t){__extends(n,t);function n(){return t!==null&&t.apply(this,arguments)||this}n.prototype.userId=function(){return this._userId};n.prototype.title=function(){return this._title};n.prototype.body=function(){return this._body};n.prototype.source=function(){return this._source};n.prototype.ticket=function(){return this._ticket};n.createWithUserId=function(t){var e=new n;e._userId=t;return e};n.createWithUserTicket=function(t){var e=new n;e._userId=t;return e};n.createWithJsonPayload=function(t){var e=t;var r=new n;r._userId=e["user_id"];r._title=e["body"];r._body=e["details"];r._source=e["source"];return r};return n}(r.MobileApprovePushRequestPayload);t.MobileApprovePushRequestPayloadImpl=e})(t=r.impl||(r.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(n){var t;(function(t){var e;(function(t){var e;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.getPrompt=function(){return this._prompt};e.prototype.setPrompt=function(t){this._prompt=t};e.prototype.getFallbackButtonTitle=function(){return this._fallbackButtonTitle};e.prototype.setFallbackButtonTitle=function(t){this._fallbackButtonTitle=t};e.prototype.getFallbackControlRequestType=function(){return this._fallbackControlRequestType};e.prototype.setFallbackControlRequestType=function(t){this._fallbackControlRequestType=t};e.create=function(t){return n.ts.mobile.sdk.impl.NativeFaceInputImpl.create(t)};e.createFallbackEnabledPrompt=function(t,e,r){return n.ts.mobile.sdk.impl.NativeFaceInputImpl.createFallbackEnabledPrompt(t,e,r)};e.__tarsusInterfaceName="NativeFaceInput";return e}(t.InputResponseType);t.NativeFaceInput=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(o){var t;(function(t){var e=function(t){__extends(i,t);function i(){return t!==null&&t.apply(this,arguments)||this}i.create=function(t){var e=new i;if(t){e.setPrompt(t)}return e};i.createFallbackEnabledPrompt=function(t,e,r){var n=new i;if(t){n.setPrompt(t)}if(e){n.setFallbackButtonTitle(e)}if(r){n.setFallbackControlRequestType(r)}else{n.setFallbackControlRequestType(o.ControlRequestType.SelectMethod)}return n};return i}(o.NativeFaceInput);t.NativeFaceInputImpl=e})(t=o.impl||(o.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){t[t["Password"]=0]="Password";t[t["Fingerprint"]=1]="Fingerprint";t[t["Pincode"]=2]="Pincode";t[t["Pattern"]=3]="Pattern";t[t["Otp"]=4]="Otp";t[t["Face"]=5]="Face";t[t["Voice"]=6]="Voice";t[t["Eye"]=7]="Eye";t[t["Emoji"]=8]="Emoji";t[t["Questions"]=9]="Questions";t[t["FaceID"]=10]="FaceID";t[t["Generic"]=11]="Generic";t[t["MobileApprove"]=12]="MobileApprove";t[t["Totp"]=13]="Totp"})(e=t.AuthenticatorType||(t.AuthenticatorType={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){t[t["RedirectTypeBind"]=0]="RedirectTypeBind";t[t["RedirectTypeAuthenticate"]=1]="RedirectTypeAuthenticate";t[t["RedirectTypeBindOrAuthenticate"]=2]="RedirectTypeBindOrAuthenticate";t[t["RedirectTypeInvokePolicy"]=3]="RedirectTypeInvokePolicy"})(e=t.RedirectType||(t.RedirectType={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(I){var t;(function(t){var e;(function(t){var e;t.AuthTypeData={password:{authTypeEnum:I.AuthenticatorType.Password,authTypeName:"Password"},fingerprint:{authTypeEnum:I.AuthenticatorType.Fingerprint,authTypeName:"Fingerprint"},pin:{authTypeEnum:I.AuthenticatorType.Pincode,authTypeName:"PIN"},pin_centralized:{authTypeEnum:I.AuthenticatorType.Pincode,authTypeName:"PIN"},pattern:{authTypeEnum:I.AuthenticatorType.Pattern,authTypeName:"Pattern"},pattern_centralized:{authTypeEnum:I.AuthenticatorType.Pattern,authTypeName:"Pattern"},otp:{authTypeEnum:I.AuthenticatorType.Otp,authTypeName:"OTP"},face:{authTypeEnum:I.AuthenticatorType.Face,authTypeName:"Face"},face_server:{authTypeEnum:I.AuthenticatorType.Face,authTypeName:"Face"},voice_server:{authTypeEnum:I.AuthenticatorType.Voice,authTypeName:"Voice"},eye:{authTypeEnum:I.AuthenticatorType.Eye,authTypeName:"Eye"},emoji:{authTypeEnum:I.AuthenticatorType.Emoji,authTypeName:"Emoji"},question:{authTypeEnum:I.AuthenticatorType.Questions,authTypeName:"Questions"},face_id:{authTypeEnum:I.AuthenticatorType.FaceID,authTypeName:"FaceID"},mobile_approve:{authTypeEnum:I.AuthenticatorType.MobileApprove,authTypeName:"MobileApprove"},totp:{authTypeEnum:I.AuthenticatorType.Totp,authTypeName:"Totp"}};var r;(function(t){t["Closed"]="closed"})(r=t.SessionStateChangeState||(t.SessionStateChangeState={}));var n;(function(t){t["Pending"]="pending";t["Completed"]="completed";t["Rejected"]="rejected"})(n=t.AuthSessionState||(t.AuthSessionState={}));var i;(function(t){t["LOGINS"]="frequency_logins";t["DAYS"]="frequency_days"})(i=t.PromotionStrategyFrequency||(t.PromotionStrategyFrequency={}));var o;(function(t){t["Numeric"]="numeric";t["Alphanumeric"]="alphanumeric";t["Binary"]="binary"})(o=t.QrCodeFormatType||(t.QrCodeFormatType={}));var a;(function(t){t["Alphanumeric"]="alphanumeric";t["QrCode"]="qrcode"})(a=t.TicketIdFormatType||(t.TicketIdFormatType={}));var s;(function(t){t["ApprovalApprove"]="approval_approve"})(s=t.FailureSourceTransactionType||(t.FailureSourceTransactionType={}));var c;(function(t){t["AutoExecute"]="auto_execute";t["AssertionRejected"]="assertion_rejected";t["Policy"]="policy";t["Locked"]="locked";t["ApprovalExpired"]="approval_expired"})(c=t.FailureReasonType||(t.FailureReasonType={}));var u;(function(t){t["DefaultAuthenticator"]="default";t["AuthenticatorMenu"]="menu";t["FirstAuthenticator"]="first"})(u=t.AuthMenuPresentationMode||(t.AuthMenuPresentationMode={}));var l;(function(t){t["Registered"]="registered";t["Registering"]="registering";t["Unregistered"]="unregistered"})(l=t.AuthenticationMethodStatus||(t.AuthenticationMethodStatus={}));var h;(function(t){t["Validate"]="validate";t["Generate"]="generate"})(h=t.AuthenticationMethodOtpState||(t.AuthenticationMethodOtpState={}));var d;(function(t){t["None"]="none";t["Sms"]="sms";t["Email"]="email";t["Voice"]="voice";t["Push"]="push_notification"})(d=t.AuthenticationMethodOtpChannelType||(t.AuthenticationMethodOtpChannelType={}));var p;(function(t){t["Numeric"]="numeric";t["QrCode"]="qrcode";t["External"]="external";t["Unknown"]=""})(p=t.OtpFormatType||(t.OtpFormatType={}));var f;(function(t){t["WaitForApproval"]="wait_for_approval";t["WaitForAuthenticate"]="wait_for_authenticate"})(f=t.AuthenticationMethodMobileApproveState||(t.AuthenticationMethodMobileApproveState={}));var v;(function(t){t["AlphaNumeric"]="alpha_numeric";t["Numeric"]="numeric";t["QrCode"]="qrcode"})(v=t.TotpChallengeFormatType||(t.TotpChallengeFormatType={}));var m;(function(t){t["SelectTargets"]="select_targets";t["Validate"]="validate";t["Generate"]="generate"})(m=t.AuthenticationMethodTotpState||(t.AuthenticationMethodTotpState={}));var g;(function(t){t["RedirectTypeNameBind"]="bind";t["RedirectTypeNameAuthenticate"]="auth";t["RedirectTypeNameBindOrAuthenticate"]="bind_or_auth";t["RedirectTypeNameInvokePolicy"]="invoke"})(g=t.RedirectTypeName||(t.RedirectTypeName={}));t.RedirectTypeMap=(e={},e[g.RedirectTypeNameBind]=I.RedirectType.RedirectTypeBind,e[g.RedirectTypeNameAuthenticate]=I.RedirectType.RedirectTypeAuthenticate,e[g.RedirectTypeNameBindOrAuthenticate]=I.RedirectType.RedirectTypeBindOrAuthenticate,e[g.RedirectTypeNameInvokePolicy]=I.RedirectType.RedirectTypeInvokePolicy,e);var y;(function(t){t[t["NotRegistered"]=1]="NotRegistered";t[t["InvalidAction"]=2]="InvalidAction";t[t["BadConfig"]=3]="BadConfig";t[t["BadFch"]=4]="BadFch";t[t["FailedAssertion"]=5]="FailedAssertion";t[t["MethodLocked"]=6]="MethodLocked";t[t["DataMissing"]=7]="DataMissing";t[t["HistoryRepeat"]=11]="HistoryRepeat";t[t["MustRegister"]=14]="MustRegister";t[t["NotFinished"]=16]="NotFinished";t[t["MissingQuestions"]=17]="MissingQuestions";t[t["RepeatCurrentStep"]=18]="RepeatCurrentStep";t[t["FailOver"]=19]="FailOver";t[t["AssertionContainerNotComplete"]=20]="AssertionContainerNotComplete"})(y=t.AssertionErrorCode||(t.AssertionErrorCode={}));var b;(function(t){t["Pending"]="pending";t["Approved"]="approved";t["Denied"]="declined";t["Expired"]="expired"})(b=t.ServerResponseDataApprovalsApprovalStatus||(t.ServerResponseDataApprovalsApprovalStatus={}));var _;(function(t){t["RecentlyUsed"]="recently_used";t["NoRecentActivity"]="no_recent_activity";t["LongInactivity"]="long_inactivity";t["Disabled"]="disabled";t["Removed"]="removed"})(_=t.DeviceStatusServerFormat||(t.DeviceStatusServerFormat={}));var A;(function(t){t["Active"]="active";t["Disabled"]="disabled"})(A=t.CollectorState||(t.CollectorState={}))})(e=t.Protocol||(t.Protocol={}))})(t=I.core||(I.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(e){var t=function(){function t(){}t.fromAssertionFormat=function(t){switch(t.type){case e.core.Protocol.OtpFormatType.Numeric:return new r(t.length);case e.core.Protocol.OtpFormatType.QrCode:return new n;case e.core.Protocol.OtpFormatType.External:return new i(t.data);default:throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Invalid format type encountered: "+t.type)}};return t}();e.OtpFormatImpl=t;var r=function(){function t(t){this._length=t}t.prototype.getOtpLength=function(){return this._length};t.prototype.getType=function(){return o.Numeric};t.__tarsusInterfaceName="OtpFormatNumeric";return t}();e.OtpFormatNumericImpl=r;var n=function(){function t(){}t.prototype.getType=function(){return o.QrCode};t.__tarsusInterfaceName="OtpFormatQr";return t}();e.OtpFormatQrImpl=n;var i=function(){function t(t){this._data=t}t.prototype.getData=function(){return this._data};t.prototype.getType=function(){return o.External};t.__tarsusInterfaceName="OtpFormatExternal";return t}();e.OtpFormatExternalImpl=i;var o;(function(t){t[t["Numeric"]=0]="Numeric";t[t["QrCode"]=1]="QrCode";t[t["External"]=2]="External"})(o=e.OtpFormatType||(e.OtpFormatType={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(r){var t;(function(t){var e;(function(t){var e;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.getOtp=function(){return this._otp};e.prototype.setOtp=function(t){this._otp=t};e.createOtpSubmission=function(t){return r.ts.mobile.sdk.impl.OtpInputOtpSubmissionImpl.createOtpSubmission(t)};e.__tarsusInterfaceName="OtpInputOtpSubmission";return e}(t.OtpInput);t.OtpInputOtpSubmission=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(t=r.ts||(r.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e=function(t){__extends(r,t);function r(){return t!==null&&t.apply(this,arguments)||this}r.createOtpSubmission=function(t){var e=new r;e.setOtp(t);return e};return r}(r.OtpInputOtpSubmission);t.OtpInputOtpSubmissionImpl=e})(t=r.impl||(r.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(r){var t;(function(t){var e;(function(t){var e;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.createOtpResendRequest=function(){return r.ts.mobile.sdk.impl.OtpInputRequestResendImpl.createOtpResendRequest()};e.__tarsusInterfaceName="OtpInputRequestResend";return e}(t.OtpInput);t.OtpInputRequestResend=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(t=r.ts||(r.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.createOtpResendRequest=function(){return new e};return e}(r.OtpInputRequestResend);t.OtpInputRequestResendImpl=e})(t=r.impl||(r.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.__tarsusInterfaceName="OtpPushRequestPayload";return e}(t.PushRequestPayload);t.OtpPushRequestPayload=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e=function(t){__extends(n,t);function n(){return t!==null&&t.apply(this,arguments)||this}n.prototype.userId=function(){return this._userId};n.prototype.title=function(){return this._title};n.prototype.body=function(){return this._body};n.createWithJsonPayload=function(t){var e=t;var r=new n;r._userId=e["user_id"];r._title=e["title"];r._body=e["body"];return r};return n}(r.OtpPushRequestPayload);t.OtpPushRequestPayloadImpl=e})(t=r.impl||(r.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(r){var t;(function(t){var e;(function(t){var e;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.getPassword=function(){return this._password};e.prototype.setPassword=function(t){this._password=t};e.create=function(t){return r.ts.mobile.sdk.impl.PasswordInputImpl.create(t)};e.__tarsusInterfaceName="PasswordInput";return e}(t.InputResponseType);t.PasswordInput=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(t=r.ts||(r.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e=function(t){__extends(r,t);function r(){return t!==null&&t.apply(this,arguments)||this}r.create=function(t){var e=new r;e.setPassword(t);return e};return r}(r.PasswordInput);t.PasswordInputImpl=e})(t=r.impl||(r.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(r){var t;(function(t){var e;(function(t){var e;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.getPatternDescription=function(){return this._patternDescription};e.prototype.setPatternDescription=function(t){this._patternDescription=t};e.create=function(t){return r.ts.mobile.sdk.impl.PatternInputImpl.create(t)};e.__tarsusInterfaceName="PatternInput";return e}(t.InputResponseType);t.PatternInput=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(t=r.ts||(r.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(n){var t;(function(e){var t=function(t){__extends(r,t);function r(){return t!==null&&t.apply(this,arguments)||this}r.create=function(t){var e=new r;e.setPatternDescription(t);return e};r.validateFormat=function(t){return t.getPatternDescription().match(/^(r:[0-9]+,c:[0-9]+)+$/)!=null};r.getPatternLength=function(t){if(!r.validateFormat(t)){throw new e.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Invalid pattern input.")}else{return t.getPatternDescription().match(/r/g).length}};return r}(n.PatternInput);e.PatternInputImpl=t})(t=n.impl||(n.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(r){var t;(function(t){var e;(function(t){var e;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.getPin=function(){return this._pin};e.prototype.setPin=function(t){this._pin=t};e.create=function(t){return r.ts.mobile.sdk.impl.PinInputImpl.create(t)};e.__tarsusInterfaceName="PinInput";return e}(t.InputResponseType);t.PinInput=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(t=r.ts||(r.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e=function(t){__extends(r,t);function r(){return t!==null&&t.apply(this,arguments)||this}r.create=function(t){var e=new r;e.setPin(t);return e};return r}(r.PinInput);t.PinInputImpl=e})(t=r.impl||(r.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(n){var t;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.createSuccessResponse=function(t){var e=new n.PlaceholderAuthSuccessResponse;e.setPlaceholderToken(t);return e};e.createdFailedResponse=function(t,e){var r=new n.PlaceholderAuthFailureResponse;r.setFailureError(e);r.setExpired(t.getExpired());r.setLocked(t.getLocked());r.setRegistered(t.getRegistered());r.setRegistrationStatus(t.getRegistrationStatus());return r};e.createFailedResponseWithServerProvidedStatus=function(t){var e=new n.PlaceholderAuthFailureWithServerProvidedStatusResponse;e.setFailureError(t);return e};return e}(n.PlaceholderInputResponse);t.PlaceholderInputResponseImpl=e})(t=n.impl||(n.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(t){this._actionType=t.type}t.prototype.getActionType=function(){return this._actionType};t.prototype.getAltLabel=function(){return""};return t}();t.PolicyActionImpl=e})(e=t.impl||(t.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(r){var t;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(){}t.prototype.getControlRequest=function(){return this._controlRequest};t.prototype.setControlRequest=function(t){this._controlRequest=t};t.createControlResponse=function(t){return r.ts.mobile.sdk.impl.PromotionInputImpl.createControlResponse(t)};t.prototype.getSelectedAuthenticator=function(){return this._selectedAuthenticator};t.prototype.setSelectedAuthenticator=function(t){this._selectedAuthenticator=t};t.createAuthenticatorDescription=function(t){return r.ts.mobile.sdk.impl.PromotionInputImpl.createAuthenticatorDescription(t)};t.__tarsusInterfaceName="PromotionInput";return t}();t.PromotionInput=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(t=r.ts||(r.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e=function(t){__extends(r,t);function r(){return t!==null&&t.apply(this,arguments)||this}r.prototype.isControlRequest=function(){return!(typeof this._controlRequest==="undefined"||this._controlRequest===null)};r.createControlResponse=function(t){var e=new r;e.setControlRequest(t);return e};r.createAuthenticatorDescription=function(t){var e=new r;e.setSelectedAuthenticator(t);return e};return r}(r.PromotionInput);t.PromotionInputImpl=e})(t=r.impl||(r.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(e){var t=function(){function t(){}t.fromAssertionFormat=function(t){switch(t){case e.core.Protocol.QrCodeFormatType.Numeric:return e.QrCodeFormat.Numeric;case e.core.Protocol.QrCodeFormatType.Alphanumeric:return e.QrCodeFormat.Alphanumeric;case e.core.Protocol.QrCodeFormatType.Binary:return e.QrCodeFormat.Binary;default:throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Invalid qr code format type encountered: "+t.type)}};return t}();e.QrCodeFormatImpl=t})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(r){var t;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(){}t.prototype.getQrCode=function(){return this._qrCode};t.prototype.getQrCodeFormat=function(){return this._qrCodeFormat};t.createQrCodeResult=function(t,e){return r.ts.mobile.sdk.impl.QrCodeResultImpl.createQrCodeResult(t,e)};t.__tarsusInterfaceName="QrCodeResult";return t}();t.QrCodeResult=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(t=r.ts||(r.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e=function(t){__extends(n,t);function n(){return t!==null&&t.apply(this,arguments)||this}n.createQrCodeResult=function(t,e){var r=new n;r._qrCode=t;r._qrCodeFormat=e;return r};return n}(r.QrCodeResult);t.QrCodeResultImpl=e})(t=r.impl||(r.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(r){var t;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(){}t.prototype.getRedirectResponse=function(){return this._redirectResponse};t.prototype.setRedirectResponse=function(t){this._redirectResponse=t};t.create=function(t){return r.ts.mobile.sdk.impl.RedirectInputImpl.create(t)};t.__tarsusInterfaceName="RedirectInput";return t}();t.RedirectInput=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(t=r.ts||(r.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e=function(t){__extends(r,t);function r(){return t!==null&&t.apply(this,arguments)||this}r.create=function(t){var e=new r;e.setRedirectResponse(t);return e};return r}(r.RedirectInput);t.RedirectInputImpl=e})(t=r.impl||(r.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(o){var t;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(){}t.prototype.getServerAddress=function(){return this._serverAddress};t.prototype.setServerAddress=function(t){this._serverAddress=t};t.prototype.getRealm=function(){return this._realm};t.prototype.setRealm=function(t){this._realm=t};t.prototype.getAppId=function(){return this._appId};t.prototype.setAppId=function(t){this._appId=t};t.prototype.getTokenName=function(){return this._tokenName};t.prototype.setTokenName=function(t){this._tokenName=t};t.prototype.getToken=function(){return this._token};t.prototype.setToken=function(t){this._token=t};t.prototype.getCryptoMode=function(){return this._cryptoMode};t.prototype.setCryptoMode=function(t){this._cryptoMode=t};t.create=function(t,e,r,n){return o.ts.mobile.sdk.impl.SDKConnectionSettingsImpl.create(t,e,r,n)};t.createWithCryptoMode=function(t,e,r,n,i){return o.ts.mobile.sdk.impl.SDKConnectionSettingsImpl.createWithCryptoMode(t,e,r,n,i)};t.__tarsusInterfaceName="SDKConnectionSettings";return t}();t.SDKConnectionSettings=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(t=o.ts||(o.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(i){var t;(function(t){var e=function(t){__extends(a,t);function a(){return t!==null&&t.apply(this,arguments)||this}a.create=function(t,e,r,n){return this.createWithCryptoMode(t,e,r,n,i.ConnectionCryptoMode.None)};a.createWithCryptoMode=function(t,e,r,n,i){var o=new a;o.setServerAddress(t);o.setAppId(e);o.setTokenName(r);o.setToken(n);o.setCryptoMode(i);return o};return a}(i.SDKConnectionSettings);t.SDKConnectionSettingsImpl=e})(t=i.impl||(i.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(r){var t;(function(t){var e;(function(t){var e;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.getQrCodeResult=function(){return this._qrCodeResult};e.prototype.setQrCodeResult=function(t){this._qrCodeResult=t};e.createScanQrCodeInput=function(t){return r.ts.mobile.sdk.impl.ScanQrCodeInputImpl.createScanQrCodeInput(t)};e.__tarsusInterfaceName="ScanQrCodeInput";return e}(t.InputResponseType);t.ScanQrCodeInput=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(t=r.ts||(r.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e=function(t){__extends(r,t);function r(){return t!==null&&t.apply(this,arguments)||this}r.createScanQrCodeInput=function(t){var e=new r;e.setQrCodeResult(t);return e};return r}(r.ScanQrCodeInput);t.ScanQrCodeInputImpl=e})(t=r.impl||(r.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e=function(t){__extends(n,t);function n(){return t!==null&&t.apply(this,arguments)||this}n.createAnswerToQuestion=function(t,e){var r=new n;r._question=t;r._answer=e;return r};return n}(r.SecurityQuestionAndAnswer);t.SecurityQuestionAndAnswerImpl=e})(t=r.impl||(r.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e=function(t){__extends(r,t);function r(){return t!==null&&t.apply(this,arguments)||this}r.createWithText=function(t){var e=new r;e._answerText=t;return e};return r}(r.SecurityQuestionAnswer);t.SecurityQuestionAnswerImpl=e})(t=r.impl||(r.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(t,e,r){this._id=t;this._text=e;this._registered=r}t.prototype.getSecurityQuestionId=function(){return this._id};t.prototype.getSecurityQuestionText=function(){return this._text};t.__tarsusInterfaceName="SecurityQuestion";return t}();t.SecurityQuestionImpl=e})(e=t.impl||(t.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.createSecurityQuestionAnswersInputResponse=function(t){var e=new r.SecurityQuestionAnswersInputResponse;e._answers=t;return e};return e}(r.SecurityQuestionInputResponse);t.SecurityQuestionInputResponseImpl=e})(t=r.impl||(r.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(){function n(){}n.prototype.getStepTag=function(){return"question"};n.prototype.getSecurityQuestions=function(){return this._securityQuestions};n.prototype.getMinAnswersNeeded=function(){return this._minAnswers};n.createForAuthQuestion=function(t){var e=new n;e._minAnswers=1;e._securityQuestions=[t];return e};n.createForRegistrationQuestions=function(t,e){var r=new n;r._minAnswers=e;r._securityQuestions=t;return r};n.__tarsusInterfaceName="SecurityQuestionStepDescription";return n}();t.SecurityQuestionStepDescriptionImpl=e})(e=t.impl||(t.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e=function(n){__extends(e,n);function e(t,e){var r=n.call(this)||this;if(e){r._selectedTargets=e}if(t){r._authenticatorInput=t}return r}e.createAuthenticatorInput=function(t){return new e(t,null)};e.createTargetSelectionRequest=function(t){return new e(null,[t])};e.createTargetsSelectionRequest=function(t){return new e(null,t)};return e}(r.TargetBasedAuthenticatorInput);t.TargetBasedAuthenticatorInputImpl=e})(t=r.impl||(r.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(s){var t=function(){function e(t,e,r,n,i,o,a){this._deviceId=t;this._model=s.util.getDeviceModel(e,i);this._isCurrentDevice=n;this._osType=s.util.getOsName(i);this._osVersion=o;this._lastAccessed=r;this._alias=a}e.prototype.getDeviceId=function(){return this._deviceId};e.prototype.getModel=function(){return this._model};e.prototype.getLastAccessed=function(){return this._lastAccessed};e.prototype.getIsCurrent=function(){return this._isCurrentDevice};e.prototype.getOsType=function(){return this._osType};e.prototype.getOsVersion=function(){return this._osVersion};e.prototype.getAlias=function(){return this._alias};e.prototype.describe=function(){var t=new Date(this._lastAccessed).toLocaleDateString();var e=this._alias?this._alias+" : ":"";return""+e+this._model+" last accessed on "+t};e.fromServerFormat=function(t){return new e(t.device_id,t.model,t.last_access,t.current_device,t.os_type,t.os_version,t.alias||null)};return e}();s.TargetDeviceDetailsImpl=t})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(r){var t;(function(t){var e;(function(t){var e;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.createPollRequest=function(){return r.ts.mobile.sdk.impl.TicketWaitInputImpl.createPollRequest()};e.__tarsusInterfaceName="TicketWaitInput";return e}(t.InputResponseType);t.TicketWaitInput=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(t=r.ts||(r.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.__tarsusInterfaceName="TicketWaitInputPollRequest";return e}(t.TicketWaitInput);t.TicketWaitInputPollRequest=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(n){var t;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.createPollRequest=function(){return new r};return e}(n.TicketWaitInput);t.TicketWaitInputImpl=e;var r=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.__tarsusInterfaceName="TicketWaitInputPollRequest";return e}(n.TicketWaitInputPollRequest);t.TicketWaitInputPollRequestImpl=r})(t=n.impl||(n.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){t[t["Qr"]=0]="Qr";t[t["Alphanumeric"]=1]="Alphanumeric"})(e=t.TicketIdFormat||(t.TicketIdFormat={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(n){var t;(function(t){var e=function(){function t(t){this._ticketId=t}t.prototype.getFormat=function(){switch(this._ticketId.format){case n.core.Protocol.TicketIdFormatType.Alphanumeric:return n.TicketIdFormat.Alphanumeric;case n.core.Protocol.TicketIdFormatType.QrCode:default:return n.TicketIdFormat.Qr}};t.prototype.getValue=function(){return this._ticketId.value};return t}();t.TicketIdImpl=e;var r=function(){function t(t){this._title=t.title;this._text=t.text;this._ticketId=new e(t.ticket_id)}t.prototype.getTitle=function(){return this._title};t.prototype.getText=function(){return this._text};t.prototype.getTicketId=function(){return this._ticketId};return t}();t.TicketWaitingInformationImpl=r})(t=n.impl||(n.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(e){var t=function(){function t(){}t.fromAssertionFormat=function(t){switch(t.type){case e.core.Protocol.TotpChallengeFormatType.Numeric:return new n;case e.core.Protocol.TotpChallengeFormatType.QrCode:return new i;case e.core.Protocol.TotpChallengeFormatType.AlphaNumeric:return new r;default:throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Invalid format type encountered: "+t.type)}};return t}();e.TotpChallengeFormatImpl=t;var r=function(){function t(){}t.prototype.getType=function(){return o.AlphaNumeric};t.__tarsusInterfaceName="TotpChallengeFormatAlphaNumeric";return t}();e.TotpChallengeFormatAlphaNumericImpl=r;var n=function(){function t(){}t.prototype.getType=function(){return o.Numeric};t.__tarsusInterfaceName="TotpChallengeFormatNumeric";return t}();e.TotpChallengeFormatNumericImpl=n;var i=function(){function t(){}t.prototype.getType=function(){return o.QrCode};t.__tarsusInterfaceName="TotpChallengeFormatQr";return t}();e.TotpChallengeFormatQrImpl=i;var o;(function(t){t[t["AlphaNumeric"]=0]="AlphaNumeric";t[t["Numeric"]=1]="Numeric";t[t["QrCode"]=2]="QrCode"})(o=e.TotpChallengeFormatType||(e.TotpChallengeFormatType={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(r){var t;(function(t){var e;(function(t){var e;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.getChallenge=function(){return this._challenge};e.prototype.setChallenge=function(t){this._challenge=t};e.create=function(t){return r.ts.mobile.sdk.impl.TotpChallengeInputImpl.create(t)};e.__tarsusInterfaceName="TotpChallengeInput";return e}(t.InputResponseType);t.TotpChallengeInput=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(t=r.ts||(r.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e=function(t){__extends(r,t);function r(){return t!==null&&t.apply(this,arguments)||this}r.create=function(t){var e=new r;e.setChallenge(t);return e};return r}(r.TotpChallengeInput);t.TotpChallengeInputImpl=e})(t=r.impl||(r.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(){function i(){}i.createTotpGenerationRequest=function(t,e,r){var n=new i;n.setUserId(t.userHandle);n.setChallenge(e);n.setGeneratorName(r);return n};i.prototype.getChallenge=function(){return this._challenge};i.prototype.getGeneratorName=function(){return this._generatorName};i.prototype.setGeneratorName=function(t){this._generatorName=t};i.prototype.setChallenge=function(t){this._challenge=t};i.prototype.setUserId=function(t){this._userId=t};i.prototype.getUserId=function(){return this._userId};i.prototype.setUserHandleType=function(t){this._userHandleType=t};i.prototype.getUserHandleType=function(){return this._userHandleType};return i}();t.TotpGenerationRequestImpl=e})(e=t.impl||(t.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.__tarsusInterfaceName="TotpInput";return e}(t.InputResponseType);t.TotpInput=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(r){var t;(function(t){var e;(function(t){var e;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.getCode=function(){return this._code};e.prototype.setCode=function(t){this._code=t};e.createTotpCodeSubmission=function(t){return r.ts.mobile.sdk.impl.TotpInputCodeSubmissionImpl.createTotpCodeSubmission(t)};e.__tarsusInterfaceName="TotpInputCodeSubmission";return e}(t.TotpInput);t.TotpInputCodeSubmission=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(t=r.ts||(r.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e=function(t){__extends(r,t);function r(){return t!==null&&t.apply(this,arguments)||this}r.createTotpCodeSubmission=function(t){var e=new r;e.setCode(t);return e};return r}(r.TotpInputCodeSubmission);t.TotpInputCodeSubmissionImpl=e})(t=r.impl||(r.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(){function e(){var t=[];for(var e=0;e<arguments.length;e++){t[e]=arguments[e]}this._components=t}e.prototype.toString=function(){return this._components.map(function(t){return t.replace(/([\\.])/g,function(t){return"\\"+(t=="."?"p":t)})}).join(".")};e.fromString=function(t){return new(e.bind.apply(e,[void 0].concat(t.split("."))))};e.prototype.concat=function(t){return new(e.bind.apply(e,[void 0].concat(this._components.concat(t._components))))};return e}();t.TarsusKeyPath=e;var r=function(){function t(t){this._host=t}t.prototype.readStorageKey=function(t){return this._host.readStorageKey(t.toString())};t.prototype.writeStorageKey=function(t,e){this._host.writeStorageKey(t.toString(),e)};t.prototype.deleteStorageKey=function(t){this._host.deleteStorageKey(t.toString())};t.prototype.readSessionStorageKey=function(t){return this._host.readSessionStorageKey(t.toString())};t.prototype.writeSessionStorageKey=function(t,e){this._host.writeSessionStorageKey(t.toString(),e)};t.prototype.deleteSessionStorageKey=function(t){this._host.deleteSessionStorageKey(t.toString())};t.prototype.generateKeyPair=function(t,e,r,n){return this._host.generateKeyPair(t.toString(),e,r,n)};t.prototype.generateKeyPairExternalRepresentation=function(t){return this._host.generateKeyPairExternalRepresentation(t)};t.prototype.generateHexSeededKeyPairExternalRepresentation=function(t,e){return this._host.generateHexSeededKeyPairExternalRepresentation(t,e)};t.prototype.getKeyPair=function(t,e,r){return this._host.getKeyPair(t.toString(),e,r)};t.prototype.deleteKeyPair=function(t){this._host.deleteKeyPair(t.toString())};t.prototype.importVolatileSymmetricKey=function(t,e){return this._host.importVolatileSymmetricKey(t,e)};t.prototype.importVolatileKeyPair=function(t,e){return this._host.importVolatileKeyPair(t,e)};t.prototype.importVolatileKeyPairFromPublicKeyHex=function(t,e){return this._host.importVolatileKeyPairFromPublicKeyHex(t,e)};t.prototype.generatePbkdf2HmacSha1HexString=function(t,e,r,n){return this._host.generatePbkdf2HmacSha1HexString(t,e,r,n)};t.prototype.calcHexStringEncodedSha256Hash=function(t){return this._host.calcHexStringEncodedSha256Hash(t)};t.prototype.calcHexStringEncodedSha512Hash=function(t){return this._host.calcHexStringEncodedSha512Hash(t)};t.prototype.generateRandomHexString=function(t){return this._host.generateRandomHexString(t)};t.prototype.queryHostInfo=function(t){return this._host.queryHostInfo(t)};t.prototype.calcHexStringEncodedHmacSha1HashWithHexEncodedKey=function(t,e){return this._host.calcHexStringEncodedHmacSha1HashWithHexEncodedKey(t,e)};t.prototype.getCurrentTime=function(){return this._host.getCurrentTime()};t.prototype.createDelayedPromise=function(t){return this._host.createDelayedPromise(t)};t.prototype.fidoClientXact=function(t,e,r,n){return this._host.fidoClientXact(t,e,r,n)};t.prototype.fido2CredentialsOp=function(t,e,r,n,i){return this._host.fido2CredentialsOp(t,e,r,n,i)};t.prototype.dyadicEnroll=function(t,e){return this._host.dyadicEnroll(t,e)};t.prototype.dyadicSign=function(t){return this._host.dyadicSign(t)};t.prototype.dyadicDelete=function(){return this._host.dyadicDelete()};t.prototype.dyadicRefreshToken=function(t){return this._host.dyadicRefreshToken(t)};t.prototype.transformApiPath=function(t){return this._host.transformApiPath(t)};t.prototype.log=function(t,e,r){return this._host.log(t,e,r)};t.prototype.loadPlugin=function(t){return this._host.loadPlugin(t)};return t}();t.TarsusHostServices=r})(e=t.core||(t.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(f){var t;(function(p){var n=new p.core.TarsusKeyPath("currentSession");var t=function(){function t(){this.mandatoryCollectors=[p.CollectorType.DeviceDetails,p.CollectorType.ExternalSDKDetails,p.CollectorType.HWAuthenticators,p.CollectorType.LocalEnrollments,p.CollectorType.Capabilities]}t.prototype.pushRequestPayloadFromJSON=function(t){var e=t;var r=e["push_type"];switch(r){case"otp_notification":return p.impl.OtpPushRequestPayloadImpl.createWithJsonPayload(t);case"device_notification":return p.impl.IdentifyDevicePushRequestPayloadImpl.createWithJsonPayload(t);case"approval":return p.impl.MobileApprovePushRequestPayloadImpl.createWithJsonPayload(t)}throw new p.impl.AuthenticationErrorImpl(p.AuthenticationErrorCode.AppImplementation,"Payload with type "+r+" isn't recognized")};t.prototype.setTarsusHost=function(t){this._nativeHost=t;this.host=new p.core.TarsusHostServices(t);this.pluginManager=new p.core.TarsusPluginManager(this);this.enabledCollectors=[p.CollectorType.Accounts,p.CollectorType.DeviceDetails,p.CollectorType.Contacts,p.CollectorType.Owner,p.CollectorType.Software,p.CollectorType.Location,p.CollectorType.Bluetooth,p.CollectorType.ExternalSDKDetails,p.CollectorType.HWAuthenticators,p.CollectorType.FidoAuthenticators,p.CollectorType.Capabilities,p.CollectorType.LargeData,p.CollectorType.LocalEnrollments];this.currentPersistUserData=true};t.prototype.setConnectionSettings=function(t){this.connectionSettings=t};t.prototype.setClientCryptoSettings=function(t){this.cryptoSettings=t};t.prototype.setEnabledCollectors=function(t){this.enabledCollectors=t;this.addMandatoryCollectorsIfNeeded()};t.prototype.setLogLevel=function(t){this._nativeHost.setLogLevel(t)};t.prototype.setExternalLogger=function(t){this._nativeHost.setExternalLogger(t)};t.prototype.setTransportProvider=function(t){this.transportProvider=t};t.prototype.setUiHandler=function(t){this.currentUiHandler=t};t.prototype.setPushToken=function(t){this._lastReceivedPushToken=t};t.prototype.setPersistUserData=function(t){this.currentPersistUserData=t};Object.defineProperty(t.prototype,"currentSession",{get:function(){return this._currentSession},enumerable:true,configurable:true});t.prototype.installPlugin=function(t,e){this.pluginManager.installPlugin(t,e)};t.prototype.initialize=function(){var r=this;return new Promise(function(t,e){if(!r.host){throw new p.impl.AuthenticationErrorImpl(p.AuthenticationErrorCode.AppImplementation,"Attempt to initialize SDK without host.")}if(!r.connectionSettings){throw new p.impl.AuthenticationErrorImpl(p.AuthenticationErrorCode.AppImplementation,"Attempt to initialize SDK without connection settings.")}if(!r.transportProvider){throw new p.impl.AuthenticationErrorImpl(p.AuthenticationErrorCode.AppImplementation,"Attempt to initialize SDK without transport provider.")}if(!r.cryptoSettings){r.cryptoSettings=p.ClientCryptoSettings.create(1e4)}r.fidoClient=new p.core.fidoclient.TarsusFidoClient(r);r._nativeHost.initialize(r.enabledCollectors).then(function(t){return r.pluginManager.initializePlugins().then(function(){var t=r.host.readSessionStorageKey(n);if(t){r.log(p.LogLevel.Info,"Loading existing session from session store");try{r._currentSession=p.core.Session.fromJson(r,t);r.log(p.LogLevel.Debug,"Loaded existing session for user "+(r._currentSession.user&&r._currentSession.user.displayName))}catch(t){r.log(p.LogLevel.Warning,"Failed to load existing session from session store. Discarding existing session "+t+".")}}return true})}).then(t,e)}).catch(function(t){return Promise.reject(p.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})};t.prototype.getUsersInfo=function(){var e=[];p.core.User.iterateUsers(this,function(t){e.push(p.impl.UserInfoImpl.createWithUser(t))});return e};t.prototype.isBoundForUser=function(t){var e=p.core.User.findUser(this,t);return!!(e&&e.deviceBound)};t.prototype.getBoundUserIds=function(){var e=[];p.core.User.iterateUsers(this,function(t){if(t.userId&&t.deviceBound){e.push(t.userId)}});return e};t.prototype.getKnownUserIds=function(){var e=[];p.core.User.iterateUsers(this,function(t){if(t.userId&&(t.hasLoggedIn||t.deviceBound)){e.push(t.userId)}});return e};t.prototype.logout=function(){var o=this;return new Promise(function(t,e){if(!o._currentSession){e(new p.impl.AuthenticationErrorImpl(p.AuthenticationErrorCode.AppImplementation,"No logged in user."));return}if(!o._currentSession.canTerminate()){e(new p.impl.AuthenticationErrorImpl(p.AuthenticationErrorCode.AppImplementation,"Attempt to logout with a locked session."));return}var r=o._currentSession.createLogoutRequest();var n=o._currentSession;o._currentSession=null;o.saveCurrentSession();var i;if(n.invalidated){o.log(p.LogLevel.Info,"Logging out with an invalidated session; not issuing server request.");i=Promise.resolve(true)}else{i=n.performSessionExchange(r).then(function(t){return true})}i.then(function(t){p.core.Session.notifySessionObserversOnMainSessionLogout(n);return t}).then(t,e)}).catch(function(t){return Promise.reject(p.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})};t.prototype.isTotpProvisionedForUser=function(t,e){var r;try{r=p.core.totp.TotpPropertiesProcessor.createWithUserHandle(t,this)}catch(t){return false}return r.isTotpProvisionedForGenerator(e||p.core.totp.TotpPropertiesProcessor.BACKWARD_COMPATIBILITY_DEFAULT_GENERATOR)};t.prototype.getVersionInfo=function(){if(!this._versionInfo){this._versionInfo=new p.impl.VersionInfoImpl(this.host.queryHostInfo(f.sdkhost.HostInformationKey.Platform),this.host.queryHostInfo(f.sdkhost.HostInformationKey.Version))}return this._versionInfo};t.prototype.resolveUserForBind=function(t,e){var r=p.core.User.findUser(this,t);if(r&&r.deviceBound){throw new p.impl.AuthenticationErrorImpl(p.AuthenticationErrorCode.AppImplementation,"Attempt to bind an already bound user on this device.",{user:t})}if(!r){this.log(p.LogLevel.Debug,"bind: Creating new user "+t);r=p.core.User.createUser(this,t,e?p.UserHandleType.IdToken:p.UserHandleType.UserId)}return r};t.prototype.internalBind=function(c,u,l){var h=this;var d=false;return new Promise(function(t,e){h.log(p.LogLevel.Debug,"Bind for user "+(c.userId||c.idToken));h.ensureConfigured();if(h._currentSession){throw new p.impl.AuthenticationErrorImpl(p.AuthenticationErrorCode.AppImplementation,"Attempt to start a session (bind) with a current primary active session.")}var n=new p.core.Session(h,c);d=true;h._currentSession=n;h.log(p.LogLevel.Debug,"bind: Generating new device keys for "+(c.userId||c.idToken));var r=h.host.generateKeyPair(c.deviceSigningKeyTag,f.sdkhost.KeyClass.StdSigningKey,f.sdkhost.KeyBiometricProtectionMode.None,true);var i=h.host.generateKeyPair(c.deviceEncryptionKeyTag,f.sdkhost.KeyClass.StdEncryptionKey,f.sdkhost.KeyBiometricProtectionMode.None,true);var o=p.util.wrapPromiseWithActivityIndicator(h.currentUiHandler,null,l,Promise.all([r,i])).then(function(t){var e=t[0];var r=t[1];h.log(p.LogLevel.Debug,"bind: key generation done");return h.promiseCollectionResult().then(function(t){h.log(p.LogLevel.Debug,"bind: Collection result completed, Initiating request promise");return n.createBindRequest(t,h._lastReceivedPushToken,e,r,u)})});var a=false;var s=function(t){if(a){return t}a=true;var e=n.deviceId();if(e){h.log(p.LogLevel.Debug,"bind: binding device to user after succesful completion");n.user.bindDeviceToUser(e)}p.core.Session.notifySessionObserversOnMainSessionLogin(n);return t};h.log(p.LogLevel.Debug,"bind: Sending request");n.startControlFlow(o,null,l,s).then(function(t){s(t);h.saveCurrentSession();if(n.persistUserData){p.core.User.save(h,n.user)}return t}).then(t,e)}).catch(function(t){if(d){h.log(p.LogLevel.Debug,"bind: Clearing session after error");h._currentSession=null}return Promise.reject(p.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})};t.prototype.bindWithIdToken=function(t,e,r){try{var n=this.resolveUserForBind(t,true);return this.internalBind(n,e,r)}catch(t){return Promise.reject(p.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))}};t.prototype.bind=function(t,e,r){try{var n=this.resolveUserForBind(t,false);return this.internalBind(n,e,r)}catch(t){return Promise.reject(p.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))}};t.prototype.resolveUserForAuthenticate=function(t,e){var r;if(this.deviceSupportsBind()){r=this.lookupBoundUser(t)}else{r=p.core.User.findUser(this,t);if(!r){this.log(p.LogLevel.Debug,"bind: Creating new user "+t);r=p.core.User.createUser(this,t,e?p.UserHandleType.IdToken:p.UserHandleType.UserId)}}return r};t.prototype.internalAuthenticate=function(o,a,s,c){var u=this;var l=false;return new Promise(function(t,e){u.log(p.LogLevel.Debug,"Authenticate for user "+(o.userId||o.idToken)+" with policy "+a);u.ensureConfigured();if(u._currentSession){throw new p.impl.AuthenticationErrorImpl(p.AuthenticationErrorCode.AppImplementation,"Attempt to start a session (authenticate) with a current primary active session.")}var r=new p.core.Session(u,o);l=true;u._currentSession=r;u.log(p.LogLevel.Debug,"authenticate: Initiating message setup");var n=p.util.wrapPromiseWithActivityIndicator(u.currentUiHandler,null,c,u.promiseCollectionResult());var i=n.then(function(t){u.log(p.LogLevel.Debug,"authenticate: Collection done; setting up request");return r.createLoginRequest(t,u._lastReceivedPushToken,a,s)});u.log(p.LogLevel.Debug,"authenticate: Sending request");u._currentSession.startControlFlow(i,null,c).then(function(t){u.saveCurrentSession();u.log(p.LogLevel.Debug,"authenticate: marking user has logged in after succesful completion");r.user.markLoggedIn();if(r.persistUserData){p.core.User.save(u,r.user)}p.core.Session.notifySessionObserversOnMainSessionLogin(r);return t}).then(t,e)}).catch(function(t){if(l){u.log(p.LogLevel.Debug,"authenticate: Clearing session after error");u._currentSession=null}return Promise.reject(p.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})};t.prototype.authenticate=function(t,e,r,n){try{var i=this.resolveUserForAuthenticate(t,false);return this.internalAuthenticate(i,e,r,n)}catch(t){return Promise.reject(p.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))}};t.prototype.authenticateWithIdToken=function(t,e,r,n){try{var i=this.resolveUserForAuthenticate(t,true);return this.internalAuthenticate(i,e,r,n)}catch(t){return Promise.reject(p.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))}};t.prototype.invokePolicy=function(n,i,o){var a=this;this.log(p.LogLevel.Debug,"Invoke policy "+n+" for current session.");return new Promise(function(t,e){a.ensureConfigured();a.runWithCurrentSession(function(e){a.log(p.LogLevel.Debug,"invokePolicy: Initiating request creation");var t=a.promiseCollectionResult();var r=t.then(function(t){a.log(p.LogLevel.Debug,"invokePolicy: Collection done; setting up request");return e.createLoginRequest(t,a._lastReceivedPushToken,n,i)});a.log(p.LogLevel.Debug,"invokePolicy: Initiating control flow");return e.startControlFlow(r,null,o)}).then(t,e)}).catch(function(t){return Promise.reject(p.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})};t.prototype.startTotpSessionForUser=function(n,i,o,a){var s=this;o=o||p.core.totp.TotpPropertiesProcessor.BACKWARD_COMPATIBILITY_DEFAULT_GENERATOR;this.log(p.LogLevel.Debug,"Start TOTP session for user "+n+", generator "+o);return new Promise(function(t,e){s.ensureConfigured();s.log(p.LogLevel.Debug,"Get TOTP data for <"+n+", "+o+">");var r=p.core.totp.TotpPropertiesProcessor.createWithUserHandle(n,s);r.runCodeGenerationSession(o,i,a,s.currentUiHandler).then(t,e)}).catch(function(t){return Promise.reject(p.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})};t.prototype.totpGenerationRequestForUserFromCanonicalString=function(t,e){this.ensureConfigured();this.log(p.LogLevel.Debug,"Get TOTP request for <"+t+">");var r=p.core.totp.TotpPropertiesProcessor.createWithUserHandle(t,this);return r.totpRequestFromCanonicalString(e)};t.prototype.startTotpSessionWithRequest=function(n,i){var o=this;return new Promise(function(t,e){o.ensureConfigured();o.log(p.LogLevel.Debug,"Start TOTP session for user "+n.getUserId()+", generator "+n.getGeneratorName());var r=p.core.totp.TotpPropertiesProcessor.createWithUserHandle(n.getUserId(),o);r.runCodeGenerationSessionWithRequest(n,i,o.currentUiHandler).then(t,e)}).catch(function(t){return Promise.reject(p.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})};t.prototype.startDeviceManagementSession=function(r){var n=this;return new Promise(function(t,e){n.ensureConfigured();n.runWithCurrentSession(function(t){n.log(p.LogLevel.Debug,"User in current session: "+t.user.displayName);var e=new p.core.DeviceManagementSessionProcessor(n,t,r);return e.run()}).then(function(t){switch(t){case p.core.DeviceManagementSessionProcessorReturnReason.CurrentDeviceDeleted:var e=n._currentSession&&n._currentSession.user;n.log(p.LogLevel.Debug,"Invalidating current session after deletion of current device.");n._currentSession=null;n.saveCurrentSession();if(e){n.log(p.LogLevel.Debug,"Clearing data for current user ("+e.displayName+") after deletion of current device.");n.clearDataForUser(e.userHandle)}else{n.log(p.LogLevel.Warning,"No current user after deletion of current device; not clearing sesison.")}return true;case p.core.DeviceManagementSessionProcessorReturnReason.FinishSession:return true}}).then(t,e)}).catch(function(t){return Promise.reject(p.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})};t.prototype.startAuthenticationConfiguration=function(r){var n=this;this.log(p.LogLevel.Debug,"Start authentication configuration for current session");return new Promise(function(t,e){n.ensureConfigured();n.runWithCurrentSession(function(t){n.log(p.LogLevel.Debug,"User in current session: "+t.user.displayName);var e=new p.core.AuthenticationConfigurationSessionProcessor(n,t,r);return e.run()}).then(t,e)}).catch(function(t){return Promise.reject(p.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})};t.prototype.startAuthenticationConfigurationWithToken=function(r,n){var i=this;this.log(p.LogLevel.Debug,"Start approval for provided session token");return new Promise(function(t,e){i.ensureConfigured();i.runWithCurrentSession(function(t){i.log(p.LogLevel.Debug,"User in current session: "+t.user.displayName);var e=new p.core.AuthenticationConfigurationSessionProcessor(i,t,n,r);return e.run()}).then(t,e)}).catch(function(t){return Promise.reject(p.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})};t.prototype.startApprovalsSessionForCurrentSession=function(r){var n=this;this.log(p.LogLevel.Debug,"Start approval for current session");return new Promise(function(t,e){n.ensureConfigured();n.runWithCurrentSession(function(t){n.log(p.LogLevel.Debug,"User in current session: "+t.user.displayName);var e=new p.core.ApprovalSessionProcessor(n,t,r);return e.run()}).then(t,e)}).catch(function(t){return Promise.reject(p.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})};t.prototype.startApprovalsSessionForPushedRequest=function(o,a){var s=this;this.log(p.LogLevel.Debug,"Start approval for push request");return new Promise(function(t,e){s.ensureConfigured();var r;if(o.userId()){s.log(p.LogLevel.Debug,"startApprovalsSessionForPushedRequest with userid "+o.userId());var n=s.lookupBoundUser(o.userId());r=new p.core.Session(s,n)}else if(o.ticket()){e(new p.impl.AuthenticationErrorImpl(p.AuthenticationErrorCode.Internal,"Mobile approval push by ticket not yet implemented."));return}else{e(new p.impl.AuthenticationErrorImpl(p.AuthenticationErrorCode.Internal,"Unknown mobile approval push request."));return}var i=new p.core.ApprovalSessionProcessor(s,r,a);i.run().then(t,e)}).catch(function(t){return Promise.reject(p.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})};t.prototype.invokeAnonymousPolicy=function(o,a,s){var c=this;this.log(p.LogLevel.Debug,"Start anonymous policy "+o);return new Promise(function(t,e){c.log(p.LogLevel.Debug,"authenticate: Initiating message setup");var r=c.promiseCollectionResult();var n;n=p.core.Session.createAnonymousSession(c);var i=r.then(function(t){c.log(p.LogLevel.Debug,"invokeAnonymusPolicy: Collection done; setting up request");return n.createAnonPolicyRequest(t,c._lastReceivedPushToken,o,a)});c.log(p.LogLevel.Debug,"authenticate: Sending request");n.startControlFlow(i,null,s).then(function(t){return t},function(t){c.log(p.LogLevel.Debug,"authenticate: Clearing session after error");throw t}).then(t,e)}).catch(function(t){return Promise.reject(p.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})};t.prototype.cancelCurrentRunningControlFlow=function(){this.log(p.LogLevel.Debug,"Cancel current running control flow requested.");if(this._currentSession){this._currentSession.cancelCurrentControlFlow()}else{this.log(p.LogLevel.Error,"No current session")}};t.prototype.ensureConfigured=function(){if(!this.currentUiHandler){throw new p.impl.AuthenticationErrorImpl(p.AuthenticationErrorCode.AppImplementation,"Attempt to start authentication without a registered UIHandler.")}};t.prototype.saveCurrentSession=function(){if(this._currentSession){this.host.writeSessionStorageKey(n,this._currentSession.toJson())}else{this.host.deleteSessionStorageKey(n)}};t.prototype.runWithCurrentSession=function(t){var e=this;if(!this._currentSession){return Promise.reject(new p.impl.AuthenticationErrorImpl(p.AuthenticationErrorCode.SessionRequired,"Operation requires an active session."))}var r=this._currentSession;r.lock();return t(r).finally(function(){r.unlock();e.saveCurrentSession()})};t.prototype.deviceSupportsBind=function(){return this.host.queryHostInfo(f.sdkhost.HostInformationKey.PersistentKeysSupported)=="true"};t.prototype.log=function(t,e){this._nativeHost.log(t,"TransmitSDK/Tarsus",e)};t.prototype.promiseCollectionResult=function(){var e=this;return this._nativeHost.promiseCollectionResult().then(function(t){return e.addTarsusCollectedData(t)})};t.prototype.getClientFeatureSet=function(){var t=this.host.queryHostInfo(f.sdkhost.HostInformationKey.HostProvidedFeatures);var e;if(t&&t.length){e=t.split(",").map(function(t){return parseInt(t)})}else{e=[]}return p.core.STATIC_FEATURE_SET.concat(e)};t.prototype.clearDataForUser=function(e){try{this.log(p.LogLevel.Debug,"Delete data for user "+e+".");if(this._currentSession){throw new p.impl.AuthenticationErrorImpl(p.AuthenticationErrorCode.AppImplementation,"Attempt to call clearDataForUser with an active primary ongoing session.")}var t=p.core.User.findUser(this,e);if(!t){throw new p.impl.AuthenticationErrorImpl(p.AuthenticationErrorCode.AppImplementation,"Attempt to call clearDataForUser with a non existing user.")}try{this.host.deleteKeyPair(t.deviceSigningKeyTag)}catch(t){this.log(p.LogLevel.Warning,"Can't delete device signing key.")}try{this.host.deleteKeyPair(t.deviceEncryptionKeyTag)}catch(t){this.log(p.LogLevel.Warning,"Can't delete device encryption key.")}try{p.core.LocalEnrollment.deleteEnrollmentsForUser(t,this)}catch(t){this.log(p.LogLevel.Warning,"Can't delete enrollments for user.")}try{p.core.totp.TotpPropertiesProcessor.createWithUser(t,this).deleteAllProvisions()}catch(t){this.log(p.LogLevel.Warning,"Can't delete enrollments for user.")}p.core.User.deleteUser(t,this)}catch(t){this.log(p.LogLevel.Warning,"Can't delete data for user "+e+": "+t);throw t}};t.prototype.clearAllData=function(){var r=this;if(this._currentSession){throw new p.impl.AuthenticationErrorImpl(p.AuthenticationErrorCode.AppImplementation,"Attempt to call clearAllData with an active primary ongoing session.")}this.log(p.LogLevel.Debug,"Delete all data: collecting users");var e=[];p.core.User.iterateUsers(this,function(t){e.push(t.userHandle)});this.log(p.LogLevel.Debug,"Delete all data: deleting users");e.forEach(function(e){try{r.clearDataForUser(e)}catch(t){r.log(p.LogLevel.Warning,"Error when deleting user "+e+": "+t)}})};t.prototype.lookupBoundUser=function(t){var e=p.core.User.findUser(this,t);if(!e){throw new p.impl.AuthenticationErrorImpl(p.AuthenticationErrorCode.AppImplementation,"Attempt to authenticate with an unknown user on this device.",{user:t})}if(!e.deviceBound){throw new p.impl.AuthenticationErrorImpl(p.AuthenticationErrorCode.AppImplementation,"Attempt to authenticate with an unbound user on this device.",{user:t})}return e};t.prototype.addTarsusCollectedData=function(o){var a=this;return new Promise(function(n,e){var r=new Array;var i=new Array;Object.keys(p.core.collectors.TarsusCollectors).forEach(function(t){var e=new p.core.collectors.TarsusCollectors[t].createCollector(a.enabledCollectors);if(e.isEnabled()){i.push(t);r.push(e.provide(a))}});Promise.all(r.map(function(t){return t.catch(function(t){return new Error(t)})})).then(function(t){var e=o.toJson();for(var r in t){if(t[r]instanceof Error){a.log(p.LogLevel.Error,"caught collection error "+t[r])}else{a.log(p.LogLevel.Debug,"Tarsus collected from: "+i[r]+" "+JSON.stringify(t[r]));e.content[i[r]]=a.mergeCollectedData(t[r],e.content[i[r]])}}n(new s(e))}).catch(function(t){e(t)})})};t.prototype.mergeCollectedData=function(t,e){var r={};for(var n in t)r[n]=t[n];for(var n in e)r[n]=e[n];return r};t.prototype.addMandatoryCollectorsIfNeeded=function(){var e=this;this.mandatoryCollectors.forEach(function(t){if(e.enabledCollectors.indexOf(t)<0){e.enabledCollectors.push(t);e.log(p.LogLevel.Warning,p.CollectorType[t]+" collector is mandatory, and will remain enabled.")}})};t.__tarsusInterfaceName="TransmitSDKXm";return t}();p.TransmitSDKXmImpl=t;var s=function(){function t(t){this.theResult=t}t.prototype.toJson=function(){return this.theResult};return t}();p.CollectionResultImpl=s;function e(){return new t}p.createSdk=e})(t=f.sdk||(f.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(r){var t;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(){}t.prototype.getUserChoice=function(){return this._userChoice};t.prototype.setUserChoice=function(t){this._userChoice=t};t.create=function(t){return r.ts.mobile.sdk.impl.UnregistrationInputImpl.create(t)};t.__tarsusInterfaceName="UnregistrationInput";return t}();t.UnregistrationInput=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(t=r.ts||(r.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e=function(t){__extends(r,t);function r(){return t!==null&&t.apply(this,arguments)||this}r.create=function(t){var e=new r;e.setUserChoice(t);return e};return r}(r.UnregistrationInput);t.UnregistrationInputImpl=e})(t=r.impl||(r.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(){function r(){}r.prototype.getUserHandle=function(){return this._user.userHandle};r.prototype.getUserHandleType=function(){return this._user.userHandleType};r.prototype.getDisplayName=function(){return this._user.displayName};r.prototype.getDeviceBound=function(){return this._user.deviceBound};r.prototype.getHasLoggedIn=function(){return this._user.hasLoggedIn};r.createWithUser=function(t){var e=new r;e._user=t;return e};return r}();t.UserInfoImpl=e})(e=t.impl||(t.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e=function(){function t(t,e){this._sdkVersion=e;this._platformName=t}t.prototype.getSdkVersion=function(){return this._sdkVersion};t.prototype.getTarsusVersion=function(){return r.core.TARSUS_VERSION};t.prototype.getPlatformName=function(){return this._platformName};t.prototype.getApiLevel=function(){return r.core.API_LEVEL};return t}();t.VersionInfoImpl=e})(t=r.impl||(r.impl={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(a){var t;(function(t){var e=function(){function t(t,e,r){this._sdk=t;this._session=e;this._clientContext=r;this._uiHandler=this._sdk.currentUiHandler}t.prototype.run=function(){var n=this;this._sdk.log(a.LogLevel.Debug,"approvals: Starting session");return this.queryApprovalsFromServer().then(function(r){var t=new Promise(function(t,e){n._completeFn=t;n._rejectFn=e;n.kickStartSession(r)});return t})};t.prototype.approve=function(t,e){return this.changeApprovalStatus(t,a.MobileApprovalStatus.Approved,e)};t.prototype.deny=function(t){return this.changeApprovalStatus(t,a.MobileApprovalStatus.Denied).then(function(t){return true})};t.prototype.requestRefreshApprovals=function(){var e=this;return this.queryApprovalsFromServer().then(function(t){e.updateManagedApprovals(t);return true},function(t){throw a.impl.AuthenticationErrorImpl.ensureAuthenticationError(t)})};t.prototype.finishSession=function(){if(!this._appSession){throw new a.impl.AuthenticationErrorImpl(a.AuthenticationErrorCode.Internal,"Attempt to finish a non started approval session.")}this._appSession.endSession();this._appSession=null;this._completeFn(true)};t.prototype.kickStartSession=function(t){this._appSession=this._sdk.currentUiHandler.createApprovalsSession(this._session.user.displayName);if(!this._appSession){this._rejectFn(a.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from createTicketWaitSession."));return}this.updateManagedApprovals(t);this._appSession.startSession(this,null,this._clientContext)};t.prototype.updateManagedApprovals=function(t){this._managedApprovals=t;if(!this._appSession){throw new a.impl.AuthenticationErrorImpl(a.AuthenticationErrorCode.Internal,"Attempt to update approvals on a non started approval session.")}this._appSession.setSessionApprovalsList(t)};t.prototype.queryApprovalsFromServer=function(){var r=this;this._sdk.log(a.LogLevel.Debug,"approvals: Initiating collection");var t=this._sdk.promiseCollectionResult();return a.util.wrapPromiseWithActivityIndicator(this._uiHandler,null,this._clientContext,t.then(function(t){r._sdk.log(a.LogLevel.Debug,"approvals: Collection done; setting up request to query approvals");var e=r._session.createApprovalsFetchRequest(t);r._sdk.log(a.LogLevel.Debug,"approvals: Sending request to query approvals");return r._session.performSessionExchange(e).then(function(t){var e=t.data;return e.approvals.map(function(t){return new a.impl.ManagedMobileApprovalImpl(t)})})}))};t.prototype.changeApprovalStatus=function(e,r,t){var n=this;this._sdk.log(a.LogLevel.Debug,"approval: change status of approval "+e.getApproval().getApprovalId()+" to "+r);this._sdk.log(a.LogLevel.Debug,"approval: Initiating request promise");var i=this._sdk.promiseCollectionResult();var o=i.then(function(t){n._sdk.log(a.LogLevel.Debug,"approval: Collection done; setting up request");return n._session.createApprovalReplyRequest(t,e.getApproval().getApprovalId(),r)});this._sdk.log(a.LogLevel.Debug,"approval: Initiating control flow");return this._session.startControlFlow(o,e.getApproval(),t||this._clientContext).then(function(t){e.getApproval().updateStatus(r);n.updateManagedApprovals(n._managedApprovals);return t},function(t){var e=a.impl.AuthenticationErrorImpl.ensureAuthenticationError(t);n._sdk.log(a.LogLevel.Debug,"approval: Got server error "+e);if(e.getErrorCode()==a.AuthenticationErrorCode.Internal&&e.getData()&&e.getData().server_error_code==6001){n._sdk.log(a.LogLevel.Debug,"approval: Converting server error");throw new a.impl.AuthenticationErrorImpl(a.AuthenticationErrorCode.ApprovalWrongState,e.getMessage())}else{throw e}})};return t}();t.ApprovalSessionProcessor=e})(t=a.core||(a.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(i){var t;(function(t){var e;(function(t){var e;(function(n){var t;(function(r){var t;(function(e){var s;(function(t){t[t["Builtin"]=0]="Builtin";t[t["Placeholder"]=1]="Placeholder";t[t["Fido"]=2]="Fido";t[t["Fido2"]=3]="Fido2"})(s=e.AuthenticatorPrototype||(e.AuthenticatorPrototype={}));var t=function(){function t(t,e,r,n){this._session=t;this._authenticatorId=e;var i=e.match(/^placeholder_(.*)$/);if(i){this._authenticatorPrototype=s.Placeholder;this._placeholderId=i[1];var o=r;this._authetnicationMethodTypeName=o.placeholder_type}else if(e.match(/^fido_(.*)$/)){this._authenticatorPrototype=s.Fido;var a=r;this._authetnicationMethodTypeName=a.authenticator_type}else if(e==="fido2"){this._authenticatorPrototype=s.Fido2}else{this._authenticatorPrototype=s.Builtin;this._authetnicationMethodTypeName=this._authenticatorId}this._authenticatorMethodConfig=r;this._serverReportedRegistrationStatus=n.status;this._expired=n.expired||false;this._locked=n.locked||false}Object.defineProperty(t.prototype,"authenticationDriverDescriptor",{get:function(){var t=this.internalAuthenticationDriverDescriptor();if(!t){throw new i.ts.mobile.sdk.impl.AuthenticationErrorImpl(i.ts.mobile.sdk.AuthenticationErrorCode.Internal,"Unhandled authenticator: "+this.getAuthenticatorId())}return t},enumerable:true,configurable:true});t.prototype.internalAuthenticationDriverDescriptor=function(){switch(this._authenticatorPrototype){case s.Placeholder:return e.AuthenticatorDrivers["__placeholder"];case s.Fido:return new e.AuthenticationDriverDescriptorFido(this._authenticatorMethodConfig.fido_policy);case s.Builtin:default:var t=e.AuthenticatorDrivers[this.getAuthenticatorId()];return t}};t.prototype.getAuthenticatorId=function(){return this._authenticatorId};t.prototype.getType=function(){var t=r.Protocol.AuthTypeData[this._authetnicationMethodTypeName];return t&&"authTypeEnum"in t?t.authTypeEnum:n.AuthenticatorType.Generic};t.prototype.getName=function(){if(this._authenticatorPrototype===s.Fido2){return this._authenticatorMethodConfig.fido2Name}var t=r.Protocol.AuthTypeData[this._authetnicationMethodTypeName];return t&&t.authTypeName||"Generic"};t.prototype.getExpired=function(){return this._expired};t.prototype.getRegistered=function(){return this.getRegistrationStatus()==n.AuthenticatorRegistrationStatus.Registered};t.prototype.getRegistrationStatus=function(){if(this._serverReportedRegistrationStatus!=r.Protocol.AuthenticationMethodStatus.Registered){return n.AuthenticatorRegistrationStatus.Unregistered}else{return this.authenticationDriverDescriptor.evaluateLocalRegistrationStatus(this._session)}};t.prototype.getLocked=function(){return this._locked};t.prototype.getDefaultAuthenticator=function(){return this._session.user.defaultAuthId==this.getAuthenticatorId()};t.prototype.getSupportedOnDevice=function(){var t=this.internalAuthenticationDriverDescriptor();return t&&this.authenticationDriverDescriptor.isSupportedOnDevice(this._session)};t.prototype.getPlaceholderId=function(){return this._placeholderId};t.prototype.updateWithAuthenticatorState=function(t){this._expired=t.expired||false;this._locked=t.locked||false;this._serverReportedRegistrationStatus=t.status};return t}();e.AuthenticatorDescriptionImpl=t})(t=r.authenticationdrivers||(r.authenticationdrivers={}))})(t=n.core||(n.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(t=i.ts||(i.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(c){var t;(function(s){var n=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.getEnabled=function(){return this.getSupportedOnDevice()};return e}(s.authenticationdrivers.AuthenticatorDescriptionImpl);var t=function(){function t(t,e,r,n){this._sdk=t;this._session=e;this._token=n||null;this._clientContext=r;this._uiHandler=this._sdk.currentUiHandler}t.prototype.run=function(){var n=this;this._sdk.log(c.LogLevel.Debug,"configuration: Starting session");return this.queryConfigMenuFromServerAndFilter().then(function(r){var t=new Promise(function(t,e){n.kickStartSession(r);n._completeFn=t;n._rejectFn=e});return t})};t.prototype.registerAuthenticator=function(t,e){return this.requestAuthenticatorRegistrationChange(t,true,e)};t.prototype.reregisterAuthenticator=function(t,e){return this.requestAuthenticatorRegistrationChange(t,true,e)};t.prototype.setDefaultAuthenticator=function(n){var i=this;this._sdk.log(c.LogLevel.Info,"Coniguration: Updating user default authenticator.");return new Promise(function(t,e){if(!i._session.anonymous){var r=i._session.user;r.updateDefaultAuthId(n.getDescription().getAuthenticatorId());if(i._session.persistUserData){s.User.save(i._sdk,r)}}t(true);i.updateManagedAuthenticators(i._authenticators)})};t.prototype.unregisterAuthenticator=function(t,e){return this.requestAuthenticatorRegistrationChange(t,false,e).then(function(t){return true})};t.prototype.requestRefreshAuthenticators=function(){var e=this;return this.queryConfigMenuFromServerAndFilter().then(function(t){e.updateManagedAuthenticators(t);return true},function(t){throw c.impl.AuthenticationErrorImpl.ensureAuthenticationError(t)})};t.prototype.finishSession=function(){if(!this._appSession){throw new c.impl.AuthenticationErrorImpl(c.AuthenticationErrorCode.Internal,"Attempt to finish a non started config session.")}this._appSession.endSession();this._appSession=null;this._completeFn(true)};t.prototype.kickStartSession=function(t){this._appSession=this._uiHandler.createAuthenticationConfigurationSession(this._session.user.displayName);if(!this._appSession){this._rejectFn(c.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from createAuthenticationConfigurationSession."));return}this._appSession.startSession(this,null,this._clientContext);this.updateManagedAuthenticators(t)};t.prototype.updateManagedAuthenticators=function(t){if(!this._appSession){throw new c.impl.AuthenticationErrorImpl(c.AuthenticationErrorCode.Internal,"Attempt to work with a non started config session.")}var e={};t.forEach(function(t){e[t.getDescription().getAuthenticatorId()]=t});this._authenticators=t;this._authenticatorsByName=e;this._appSession.setAuthenticatorsList(t)};t.prototype.queryConfigMenuFromServerAndFilter=function(){var r=this;this._sdk.log(c.LogLevel.Debug,"configuration: Initiating collection");var t=this._sdk.promiseCollectionResult();return c.util.wrapPromiseWithActivityIndicator(this._uiHandler,null,this._clientContext,t.then(function(t){r._sdk.log(c.LogLevel.Debug,"configuration: Collection done; setting up request to query for config menu");var e=r._session.createConfigMenuFetchRequest(t,r._token);r._sdk.log(c.LogLevel.Debug,"configuration: Sending request to query approvals");return r._session.performSessionExchange(e).then(function(t){var e=t.data&&t.data.type=="configuration"&&t.data;if(!e){throw new c.impl.AuthenticationErrorImpl(c.AuthenticationErrorCode.Internal,"Invalid configuration screen structure encountered.")}return e.methods.map(function(t){var e=new n(r._session,t.type,t,t);return new c.impl.ConfigurableAuthenticatorImpl(e,t.options)}).filter(function(t){return t.getDescription().getSupportedOnDevice()})})}))};t.prototype.requestAuthenticatorRegistrationChange=function(i,o,t){var a=this;this._sdk.log(c.LogLevel.Debug,"configuration: Authenticator "+i.getDescription().getName()+" request (un)registration "+o);this._sdk.log(c.LogLevel.Debug,"configuration: Initiating registration request promise");var e=this._sdk.promiseCollectionResult();var r=e.then(function(t){a._sdk.log(c.LogLevel.Debug,"configuration: Collection done; setting up request");return a._session.createAuthRegistrationRequest(t,i.getDescription().getAuthenticatorId(),o,a._token)});this._sdk.log(c.LogLevel.Debug,"configuration: Initiating control flow");return this._session.startControlFlow(r,null,t||this._clientContext).then(function(t){var e=t.getInternalData();var r=false;if(e&&e.methods&&e.methods.length){a._sdk.log(c.LogLevel.Debug,"configuration: Processing updates.");e.methods.forEach(function(t){var e=a._authenticatorsByName[t.type];if(e){e.getDescription().updateWithAuthenticatorState(t);r=true}})}if(r){if(!o&&i.getDescription().getDefaultAuthenticator){if(!a._session.anonymous){var n=a._session.user;n.updateDefaultAuthId("");if(a._session.persistUserData){s.User.save(a._sdk,n)}}}a.updateManagedAuthenticators(a._authenticators)}return t},function(t){throw c.impl.AuthenticationErrorImpl.ensureAuthenticationError(t)})};return t}();s.AuthenticationConfigurationSessionProcessor=t})(t=c.core||(c.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(c){var t;(function(s){var t=function(){function t(t,e,r){this._sdk=t;this._session=e;this._uiHandler=this._sdk.currentUiHandler;this._clientContext=r;this._cancelled=false}Object.defineProperty(t.prototype,"initiatingRequest",{get:function(){return this._initiatingRequest},enumerable:true,configurable:true});t.prototype.cancelFlow=function(){this._cancelled=true;if(this._currentActionDriver){this._currentActionDriver.cancelRun()}this._uiHandler.controlFlowCancelled(this._clientContext)};t.prototype.startControlFlow=function(e,r){var n=this;if(this._cancelled){return this.createExternalCancellationRejectionPromise()}return c.util.wrapPromiseWithActivityIndicator(this._uiHandler,null,this._clientContext,this._session.performSessionExchange(e)).then(function(t){n._initiatingRequest=e;n._approval=r||null;n._uiHandler.controlFlowStarting(n._clientContext);return n.promiseControlFlowCompletion(t).then(function(t){n._uiHandler.controlFlowEnded(null,n._clientContext);return t},function(t){n._uiHandler.controlFlowEnded(t,n._clientContext);throw t})})};Object.defineProperty(t.prototype,"challenge",{get:function(){return this._initialCflowResponse&&this._initialCflowResponse.challenge||null},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"approval",{get:function(){return this._approval||null},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"uiHandler",{get:function(){return this._uiHandler},enumerable:true,configurable:true});t.prototype.promiseControlFlowCompletion=function(t){this._initialCflowResponse=t.data;return this.processSingleStepExchange(this._initialCflowResponse)};t.prototype.processSingleStepExchange=function(r){var n=this;if(r.control_flow){this._controlFlow=r.control_flow;this._currentControlFlowStep=0;this._sdk.log(c.LogLevel.Debug,"Got ControlFlow with "+this._controlFlow.length+" steps.")}var t;if(r.data&&r.data.json_data){this._sdk.log(c.LogLevel.Debug,"Got a JSON data attachment on control flow response. Processing.");t=s.actiondrivers.ActionDriverJsonData.handleJsonDataByUiHandler(this._uiHandler,r,r.data.json_data,null,this._clientContext)}else{t=Promise.resolve(r)}return t.then(function(t){switch(r.state){case s.Protocol.AuthSessionState.Pending:n._sdk.log(c.LogLevel.Debug,"Execute step "+n._currentControlFlowStep+".");var e=n._controlFlow[n._currentControlFlowStep];if(!e){n._sdk.log(c.LogLevel.Error,"Step "+n._currentControlFlowStep+" nonexisting.");return Promise.reject(new c.impl.AuthenticationErrorImpl(c.AuthenticationErrorCode.Internal,"Session state is pending but no control flow."))}if(n._cancelled){return n.createExternalCancellationRejectionPromise()}return n.promiseCancellableSingleActionProcessing(e).then(function(t){n._currentControlFlowStep++;return n.processSingleStepExchange(t)});case s.Protocol.AuthSessionState.Rejected:n._sdk.log(c.LogLevel.Debug,"Handle control flow rejection.");var e=n._controlFlow&&n._controlFlow[n._currentControlFlowStep]||null;return n._uiHandler.handlePolicyRejection(r.rejection_data&&r.rejection_data.title||null,r.rejection_data&&r.rejection_data.text||null,r.rejection_data&&r.rejection_data.button_text||null,r.failure_data,e?new c.impl.PolicyActionImpl(e):null,n._clientContext).then(function(t){if(t.getUserChoice()!=-1){throw new c.impl.AuthenticationErrorImpl(c.AuthenticationErrorCode.AppImplementation,"ConfirmationInput.getUserChoice must be set to -1.")}throw c.impl.AuthenticationErrorImpl.errorForSessionRejectionFailureData(r.failure_data)});case s.Protocol.AuthSessionState.Completed:n._sdk.log(c.LogLevel.Debug,"Handle control flow completion.");return Promise.resolve(c.impl.AuthenticationResultImpl.fromCflowServerResponse(r,n._session.deviceId()))}})};t.prototype.promiseCancellableSingleActionProcessing=function(t){var e=this;var r=s.actiondrivers.ActionDrivers[t.type];if(!r){return Promise.reject(new c.impl.AuthenticationErrorImpl(c.AuthenticationErrorCode.Internal,"Don't know how to handle action.",{actionType:t.type}))}var n=new r(this,t);this._currentActionDriver=n;this._uiHandler.controlFlowActionStarting(n.policyAction(),this._clientContext);return n.run().then(function(t){e._uiHandler.controlFlowActionEnded(null,n.policyAction(),e._clientContext);return t},function(t){e._uiHandler.controlFlowActionEnded(t,n.policyAction(),e._clientContext);throw t}).finally(function(){e._currentActionDriver=null})};t.prototype.createAssertionRequest=function(t,e,r,n){if(!this.challenge){throw new c.impl.AuthenticationErrorImpl(c.AuthenticationErrorCode.Internal,"Attempt to create an assertion request without an initial control flow request.")}var i={action:t.type,assert:e||"action",assertion_id:t.assertion_id,fch:this.challenge};if(r){i.data=r}if(n){var o=i;for(var a in n){o[a]=n[a]}}return new s.SessionExchangeRequest("POST","auth/assert",i)};t.prototype.createExternalCancellationRejectionPromise=function(){return Promise.reject(this.createExternalCancellationError())};t.prototype.createExternalCancellationError=function(){return new c.impl.AuthenticationErrorImpl(c.AuthenticationErrorCode.UserCanceled,"Operation cancelled by user.",{control_flow_external_cancellation:true})};return t}();s.ControlFlowProcessor=t})(t=c.core||(c.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(n){var t;(function(t){var e=function(){function r(t,e){this.sdk=t;this.ec=new elliptic.ec("secp256k1");if(e){this.sessionId=e.session_id;this.aesKey=this.base64ToJsArray(e.key);if(!this.isReady()){throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Can't deserialize crypto session")}}}r.prototype.getExchangeRequestHeader=function(){if(!this.kp){var t={entropy:this.sdk.host.generateRandomHexString(192),entropyEnc:"hex"};this.kp=this.ec.genKeyPair(t)}var e={type:"key_exchange",scheme:2,y:this.jsArrayToBase64(this.kp.getPublic().encode())};return e};r.prototype.processExchangeResponseHeader=function(t){if(t.scheme!=2){throw"Unsupported crypto scheme "+t.scheme}this.sessionId=t.crypto_session_id;var e=this.kp.derive(this.ec.keyFromPublic(atob(t.y)).getPublic());var r=sha256.create();r.update(e.toArray("be",32));this.aesKey=r.digest()};r.prototype.isReady=function(){return!!(this.aesKey&&this.sessionId)};r.prototype.decryptResponse=function(t){var e=null;t.headers.forEach(function(t){if(t.type=="encryption"){e=t}});if(e){var r=this.base64ToJsArray(e.iv);var n=new aesjs.ModeOfOperation.cbc(this.aesKey,r);var i=this.base64ToJsArray(t.data);var o=n.decrypt(i);var a=aesjs.utils.utf8.fromBytes(o);a=this.pkcs7Unpad(a);t.data=JSON.parse(a)}return t};r.prototype.encryptRequest=function(t){var e=this;var r=[];for(var n=0;n<16;n++){r.push(Math.floor(Math.random()*256))}var i={type:"encryption",iv:this.jsArrayToBase64(r),crypto_session_id:this.sessionId};var o=t.headers.map(function(t){return e.encryptStringToBase64(JSON.stringify(t),r)});var a=JSON.stringify(t.data);var s=this.encryptStringToBase64(a,r);t.headers=[i];t.enc_headers=o;t.data=s};r.prototype.encryptStringToBase64=function(t,e){var r=new aesjs.ModeOfOperation.cbc(this.aesKey,e);var n=aesjs.utils.utf8.toBytes(t);var i=this.pkcs7Pad(n);var o=r.encrypt(i);return this.jsArrayToBase64(o)};r.prototype.toJson=function(){var t={scheme:2,session_id:this.sessionId,key:this.jsArrayToBase64(this.aesKey)};return t};r.fromJson=function(t,e){return new r(t,e)};r.prototype.jsArrayToBase64=function(t){var e="";for(var r=0;r<t.length;r++){e+=String.fromCharCode(t[r])}return btoa(e)};r.prototype.base64ToJsArray=function(t){var e=atob(t);var r=[];for(var n=0;n<e.length;n++){r.push(e.charCodeAt(n))}return r};r.prototype.pkcs7Pad=function(t){var e=16-t.length%16;var r=new Uint8Array(t.length+e);r.set(t,0);for(var n=0;n<e;n++){r[t.length+n]=e}return r};r.prototype.pkcs7Unpad=function(t){var e=t.charCodeAt(t.length-1);return t.slice(0,-e)};return r}();t.Scheme2CryptoSession=e})(t=n.core||(n.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(s){var t;(function(t){var a;(function(t){t[t["FinishSession"]=0]="FinishSession";t[t["CurrentDeviceDeleted"]=1]="CurrentDeviceDeleted"})(a=t.DeviceManagementSessionProcessorReturnReason||(t.DeviceManagementSessionProcessorReturnReason={}));var e=function(){function t(t,e,r,n){this._sdk=t;this._session=e;this._clientContext=r;this._token=n||null;this._uiHandler=this._sdk.currentUiHandler}t.prototype.run=function(){var n=this;this._sdk.log(s.LogLevel.Debug,"device management: Starting session");return this.queryDevicesFromServer().then(function(r){var t=new Promise(function(t,e){n._completeFn=t;n._rejectFn=e;n.kickStartSession(r)});return t})};t.prototype.removeDevice=function(n,t){var i=this;return new Promise(function(t,e){if(n.getInfo().getIsCurrent()){throw new s.impl.AuthenticationErrorImpl(s.AuthenticationErrorCode.AppImplementation,"Illegal attempt to delete the current device using 'DeviceManagementSessionServices.removeDevice'. "+"The current device must only be deleted using DeviceManagementSessionServices.removeCurrentDeviceAndFinishSession.")}var r=i.ensureValidDevice(n);i.performDeviceAction(r,s.DeviceManagementAction.Remove,null).then(function(t){i._sdk.log(s.LogLevel.Debug,"device management: Updating device state locally");r.getInfo().setStatus(s.DeviceStatus.Removed);i.updateManagedDevices(i._managedDevices.filter(function(t){return t!=r}));return true}).then(t,e)})};t.prototype.removeCurrentDeviceAndFinishSession=function(t){var i=this;var o;if(!this._appSession){return Promise.reject(new s.impl.AuthenticationErrorImpl(s.AuthenticationErrorCode.Internal,"Attempt to finish a non started device management session."))}else{o=this._appSession}return new Promise(function(t,e){i._sdk.log(s.LogLevel.Debug,"device management: Start removing current device");var r=i._managedDevices.filter(function(t){return t.getInfo().getIsCurrent()});if(r.length!=1){throw new s.impl.AuthenticationErrorImpl(s.AuthenticationErrorCode.Internal,"Couldn't locate current device in device list.")}var n=r[0];i.performDeviceAction(n,s.DeviceManagementAction.Remove,null).then(function(t){i._sdk.log(s.LogLevel.Debug,"device management: Updating device state locally");n.getInfo().setStatus(s.DeviceStatus.Removed);return true}).then(function(){t(true);o.endSession();i._appSession=null;i._completeFn(a.CurrentDeviceDeleted)}).catch(e)})};t.prototype.identifyDevice=function(n,t){var i=this;return new Promise(function(t,e){var r=i.ensureValidDevice(n);return i.performDeviceAction(r,s.DeviceManagementAction.Identify,null).then(function(t){return true}).then(t,e)})};t.prototype.renameDevice=function(i,o,t){var a=this;return new Promise(function(t,e){var r=a.ensureValidDevice(i);var n={name:o};return a.performDeviceAction(r,s.DeviceManagementAction.Rename,n).then(function(t){a._sdk.log(s.LogLevel.Debug,"device management: Updating device state locally");r.getInfo().setName(o);a.updateManagedDevices(a._managedDevices);return true}).then(t,e)})};t.prototype.requestRefreshDevices=function(){var e=this;return this.queryDevicesFromServer().then(function(t){e.updateManagedDevices(t);return true},function(t){throw s.impl.AuthenticationErrorImpl.ensureAuthenticationError(t)})};t.prototype.finishSession=function(){if(!this._appSession){throw new s.impl.AuthenticationErrorImpl(s.AuthenticationErrorCode.Internal,"Attempt to finish a non started device management session.")}this._appSession.endSession();this._appSession=null;this._completeFn(a.FinishSession)};t.prototype.kickStartSession=function(t){this._appSession=this._sdk.currentUiHandler.createDeviceManagementSession(this._session.user.displayName);if(!this._appSession){this._rejectFn(s.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from createDeviceManagementSession."));return}this.updateManagedDevices(t);this._appSession.startSession(this,null,this._clientContext)};t.prototype.updateManagedDevices=function(t){if(!this._appSession){throw new s.impl.AuthenticationErrorImpl(s.AuthenticationErrorCode.Internal,"Attempt to update device list for a non started device management session.")}this._managedDevices=t;this._appSession.setSessionDevicesList(t)};t.prototype.querySingleDeviceFromServer=function(r){var n=this;this._sdk.log(s.LogLevel.Debug,"device management: Initiating collection");var t=this._sdk.promiseCollectionResult();return s.util.wrapPromiseWithActivityIndicator(this._uiHandler,null,this._clientContext,t.then(function(t){n._sdk.log(s.LogLevel.Debug,"device management: Collection done; setting up request to query single device");var e=n._session.createSingleDeviceFetchRequest(t,n._token,r);n._sdk.log(s.LogLevel.Debug,"device management: Sending request to query devices");return n._session.performSessionExchange(e).then(function(t){var e=t.data;return e})}))};t.prototype.queryDevicesFromServer=function(){var r=this;this._sdk.log(s.LogLevel.Debug,"device management: Initiating collection");var t=this._sdk.promiseCollectionResult();return s.util.wrapPromiseWithActivityIndicator(this._uiHandler,null,this._clientContext,t.then(function(t){r._sdk.log(s.LogLevel.Debug,"device management: Collection done; setting up request to query devices");var e=r._session.createDevicesFetchRequest(t,r._token);r._sdk.log(s.LogLevel.Debug,"device management: Sending request to query devices");return r._session.performSessionExchange(e).then(function(t){r._uiHandler.endActivityIndicator(null,r._clientContext);var e=t.data;return e.map(function(t){var e=new s.impl.ManagedDeviceImpl(t);if(e.getInfo().getDeviecId()==r._session.user.deviceId){e.getInfo().forceCurrent()}return e})})}))};t.prototype.performDeviceAction=function(r,t,n){var i=this;var o;switch(t){case s.DeviceManagementAction.Identify:o="notify";break;case s.DeviceManagementAction.Remove:o="remove";break;case s.DeviceManagementAction.Rename:o="name";break;default:return Promise.reject(new s.impl.AuthenticationErrorImpl(s.AuthenticationErrorCode.Internal,"Invalid device action specified "+t))}this._sdk.log(s.LogLevel.Debug,"devices: action "+o+" on "+r.getInfo().getDeviecId());this._sdk.log(s.LogLevel.Debug,"devices: Initiating collection");var e=this._sdk.promiseCollectionResult();return s.util.wrapPromiseWithActivityIndicator(this._uiHandler,null,this._clientContext,e.then(function(t){i._sdk.log(s.LogLevel.Debug,"devices: Collection done; setting up request");var e=i._session.createDeviceActionRequest(t,i._token,r.getInfo().getDeviecId(),o,n);i._sdk.log(s.LogLevel.Debug,"devices: Sending request");return i._session.performSessionExchange(e).then(function(t){return t})}).catch(function(t){throw s.impl.AuthenticationErrorImpl.ensureAuthenticationError(t)}))};t.prototype.ensureValidDevice=function(t){var e=this._managedDevices.indexOf(t);if(e<0){throw new s.impl.AuthenticationErrorImpl(s.AuthenticationErrorCode.AppImplementation,"Attempt to perform a device action on a device not originally included in device management session.")}return this._managedDevices[e]};return t}();t.DeviceManagementSessionProcessor=e})(t=s.core||(s.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e=function(){function e(t){this._name=t;this._extensions=[];e._extensionPoints[t]=this}e.prototype.extend=function(t){this._extensions.push(t)};e.prototype.forEach=function(t){this._extensions.forEach(t)};e.prototype.firstNonNull=function(e){var r=null;this._extensions.forEach(function(t){if(!r){r=e(t)}});return r};e.byName=function(t){var e=this._extensionPoints[t];if(!e){throw new r.impl.AuthenticationErrorImpl(r.AuthenticationErrorCode.Internal,"Invalid extension point requested: "+t)}return e};e._extensionPoints={};return e}();t.ExtensionPoint=e})(t=r.core||(r.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(i){var t;(function(t){var e=function(){function e(){}e.installOnSdk=function(t){t.setExternalLogger(new e)};e.prototype.log=function(t,e,r){var n="["+e+"] "+r;switch(t){case i.LogLevel.Debug:console.log(n);break;case i.LogLevel.Info:console.info(n);break;case i.LogLevel.Warning:console.warn(n);break;case i.LogLevel.Error:console.error(n);break;case i.LogLevel.Critical:console.error(n);break}};return e}();t.JsConsoleLogger=e})(t=i.core||(i.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(l){var t;(function(e){var c;(function(t){t["Registering"]="registering";t["Registered"]="registered";t["Unregistered"]="unregistered"})(c=e.LocalEnrollmentStatus||(e.LocalEnrollmentStatus={}));var u;(function(t){t["None"]="none";t["Validated"]="validated";t["Invalidated"]="invalidated"})(u=e.LocalEnrollmentValidationStatus||(e.LocalEnrollmentValidationStatus={}));var t=function(){function s(){}Object.defineProperty(s.prototype,"salt",{get:function(){return this._record.salt},set:function(t){this._record.salt=t},enumerable:true,configurable:true});Object.defineProperty(s.prototype,"status",{get:function(){return this._record.status||c.Unregistered},set:function(t){this._record.status=t},enumerable:true,configurable:true});Object.defineProperty(s.prototype,"version",{get:function(){return this._record.version},set:function(t){this._record.version=t},enumerable:true,configurable:true});Object.defineProperty(s.prototype,"authenticatorId",{get:function(){return this._record.authenticatorId},enumerable:true,configurable:true});Object.defineProperty(s.prototype,"validationStatus",{get:function(){return this._record.validationStatus},set:function(t){this._record.validationStatus=t},enumerable:true,configurable:true});Object.defineProperty(s.prototype,"publicKeyHash",{get:function(){return this._record.publicKeyHash},set:function(t){this._record.publicKeyHash=t},enumerable:true,configurable:true});Object.defineProperty(s.prototype,"cryptoSettings",{get:function(){if(!this._record.cryptoSettings){return null}return l.ClientCryptoSettings.create(this._record.cryptoSettings.pbkdf_iterations_count)},set:function(t){if(t){this._record.cryptoSettings={pbkdf_iterations_count:t.getLocalEnrollmentKeyIterationCount(),pbkdf_key_size:t.getLocalEnrollmentKeySizeInBytes()}}else{this._record.cryptoSettings=null}},enumerable:true,configurable:true});Object.defineProperty(s.prototype,"keyMaterial",{get:function(){return this._record.keyMeterial},set:function(t){this._record.keyMeterial=t},enumerable:true,configurable:true});Object.defineProperty(s.prototype,"authenticatorConfig",{get:function(){return this._record.authenticatorConfig},set:function(t){this._record.authenticatorConfig=t},enumerable:true,configurable:true});s.prototype.setFingerprintDbSnapshot=function(t){this._record.fingerprintDbSsnapshot=t};s.enrollmentWithRecord=function(t){var e=new s;e._record=t;return e};s.enrollmentsForUser=function(t,e){var r={};var n=e.host.readStorageKey(this.storageKeyForEnrollmentsForUser(t.guid));e.log(l.LogLevel.Debug,"Got db "+JSON.stringify(n));for(var i in n){e.log(l.LogLevel.Debug,"Got db wEnrollmentKey"+i);r[i]=s.enrollmentWithRecord(n[i])}return r};s.deleteEnrollmentsForUser=function(t,e){e.host.deleteStorageKey(this.storageKeyForEnrollmentsForUser(t.guid))};s.createNew=function(t,e,r,n,i){var o={salt:r,status:c.Unregistered,version:e,authenticatorId:t,cryptoSettings:null,validationStatus:u.None,publicKeyHash:i};var a=new s;a._record=o;return a};s.updateEnrollmentsForUser=function(t,e,r){var n={};for(var i in e){n[i]=e[i]._record}r.host.writeStorageKey(this.storageKeyForEnrollmentsForUser(t.guid),n)};s.invalidateLocalRegistrationStatusAndNotifyUIHandler=function(o,a){return new Promise(function(e,t){if(!o){throw"No valid session."}var r=o.getCurrentControlFlowProcessor();if(!r){throw"No control flow"}o.sdk.log(l.LogLevel.Info,"Marking authenticator as invalidated and invoking UI Handler");var n=o.user.localEnrollments[a.getAuthenticatorId()];n.validationStatus=u.Invalidated;o.user.updateEnrollmentRecord(n);var i=r._uiHandler;i.localAuthenticatorInvalidated(a,r._clientContext).then(function(t){e(t)})})};s.storageKeyForEnrollmentsForUser=function(t){return new e.TarsusKeyPath("per_user",t.toString(),"local_enrollments")};s.listInvalidatedLocalEnrollments=function(t){var e;var r=new Array;for(var n in t.user.localEnrollments){e=t.user.localEnrollments[n];if(e.validationStatus==u.Invalidated){r.push(e)}}return r};return s}();e.LocalEnrollment=t})(t=l.core||(l.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){t.TARSUS_EXTENSION_POINT_NAME_MESSAGE_FILTERS="com.ts.mobile.sdk.core.messageFilters";t.TARSUS_EXTENSION_POINT_NAME_SESSION_OBSERVERS="com.ts.mobile.sdk.core.sessionObservers";t.TARSUS_EXTENSION_POINT_NAME_PLACEHOLDER_EXTENSION="com.ts.mobile.sdk.core.placeholderExtension"})(e=t.tarsusplugin||(t.tarsusplugin={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(r){var t;(function(p){var t;(function(u){var t=function(){function h(t,e){this._sdk=t;this._user=e;this._lockCount=0;this._invalidated=false;this._persistUserData=t.currentPersistUserData;this._deviceId=e&&e.deviceBound?e.deviceId:null}Object.defineProperty(h.prototype,"anonymous",{get:function(){return this._anonymous},enumerable:true,configurable:true});Object.defineProperty(h.prototype,"invalidated",{get:function(){return this._invalidated},enumerable:true,configurable:true});Object.defineProperty(h.prototype,"persistUserData",{get:function(){return this._persistUserData},enumerable:true,configurable:true});h.createAnonymousSession=function(t){var e=new h(t,u.User.createEphemeralUser(t));e._anonymous=true;return e};h.prototype.createBindRequest=function(t,e,r,n,i){var o={collection_result:t.toJson(),public_key:r.publicKeyToJson(),encryption_public_key:n.publicKeyToJson(),push_token:e};if(i){o.params=i}return new u.SessionExchangeRequest("POST","auth/bind",o)};h.prototype.createLoginRequest=function(t,e,r,n){var i={collection_result:t.toJson(),push_token:e};if(r){i.policy_request_id=r}if(n){i.params=n}return new u.SessionExchangeRequest("POST","auth/login",i)};h.prototype.createAnonPolicyRequest=function(t,e,r,n){var i={collection_result:t.toJson(),push_token:e};if(r){i.policy_request_id=r}if(n){i.params=n}return new u.SessionExchangeRequest("POST","auth/anonymous_invoke",i)};h.prototype.createLogoutRequest=function(){var t={};return new u.SessionExchangeRequest("POST","auth/logout",t)};h.prototype.createApprovalsFetchRequest=function(t){var e={collection_result:t.toJson()};return new u.SessionExchangeRequest("POST","approvals/actions/fetch",e)};h.prototype.createApprovalReplyRequest=function(t,e,r){var n={collection_result:t.toJson(),status:r==p.MobileApprovalStatus.Approved?u.Protocol.ServerResponseDataApprovalsApprovalStatus.Approved:u.Protocol.ServerResponseDataApprovalsApprovalStatus.Denied};return new u.SessionExchangeRequest("POST","auth/approve?apid="+e,n)};h.prototype.createSingleDeviceFetchRequest=function(t,e,r){var n={collection_result:t.toJson(),device_id:r};if(e){n.token=e}return new u.SessionExchangeRequest("POST","mobile/device",n)};h.prototype.createDevicesFetchRequest=function(t,e){var r={collection_result:t.toJson()};if(e){r.token=e}return new u.SessionExchangeRequest("POST","mobile/devices",r)};h.prototype.createDeviceActionRequest=function(t,e,r,n,i){var o={collection_result:t.toJson(),device_id:r};if(e){o.token=e}if(i){Object.keys(i).forEach(function(t){o[t]=i[t]})}return new u.SessionExchangeRequest("POST","mobile/device/action?action="+n,o)};h.prototype.createConfigMenuFetchRequest=function(t,e){var r={collection_result:t.toJson()};if(e){r.token=e}return new u.SessionExchangeRequest("POST","auth/authenticator/config_menu",r)};h.prototype.createAuthRegistrationRequest=function(t,e,r,n){var i={collection_result:t.toJson(),type:e};if(n){i.token=n}var o=r?"register":"unregister";return new u.SessionExchangeRequest("POST","auth/authenticator/"+o,i)};h.prototype.startControlFlow=function(t,n,a,e){var s=this;if(e===void 0){e=function(t){return t}}if(this._currentControlFlowProcessor){var r="Attempt to start a control flow while an existing control flow ("+this._currentControlFlowProcessor.challenge+") is running.";this._sdk.log(p.LogLevel.Error,r);return Promise.reject(new p.impl.AuthenticationErrorImpl(p.AuthenticationErrorCode.AppImplementation,r))}var c=new u.ControlFlowProcessor(this._sdk,this,a);this._currentControlFlowProcessor=c;return t.then(function(r){s._sdk.log(p.LogLevel.Debug,"Start control flow");return new Promise(function(t,e){u.authenticationdrivers.SimpleAuthenticationDriverDescriptor.refreshInvalidatedAuthenticatorsEnrollments(s).catch(function(t){s._sdk.log(p.LogLevel.Warning,"Could not refresh invalidated authenticators enrollments: "+t)}).finally(function(){t(c.startControlFlow(r,n))})})}).then(function(t){return e(t)}).finally(function(){s._sdk.log(p.LogLevel.Debug,"Retire control flow "+c.challenge);s._currentControlFlowProcessor=null}).then(function(t){var e=t.getInternalData();if(e&&e.redirect){var r=e.redirect;var n=r.policy_id||null;var i=r.target.user_id||r.target.token;var o=c._uiHandler.handlePolicyRedirect(u.Protocol.RedirectTypeMap[r.redirect_type],n,i,r.params,a);return o.then(function(t){switch(t.getRedirectResponse()){case p.RedirectResponseType.RedirectToPolicy:return s.processRedirectRequest(r,a);case p.RedirectResponseType.CancelRedirect:return Promise.reject(new p.impl.AuthenticationErrorImpl(p.AuthenticationErrorCode.UserCanceled,"Redirection to next policy canceled."))}})}else{return t}})};h.prototype.getCurrentControlFlowProcessor=function(){return this._currentControlFlowProcessor};h.prototype.generateInvalidatedAuthenticatorsHeadersIfNeeded=function(){var t;var e=new Array;var r=u.LocalEnrollment.listInvalidatedLocalEnrollments(this);for(var n=0,i=r;n<i.length;n++){t=i[n];this._sdk.log(p.LogLevel.Debug,"Found invalidated authenticator: "+t.authenticatorId);if(t.publicKeyHash){var o={type:"public_key_hash",hash:t.publicKeyHash};var a={type:"registration_invalidated",method:t.authenticatorId,registration_id:o};e.push(a)}}return e};h.prototype.processRedirectRequest=function(t,e){try{var r=t.policy_id||null;var n=t.params;if(t.target.type=="current"){}else if(t.target.type=="user_id"){var i=t.target.user_id||this._user.userId;if(!i){throw new p.impl.AuthenticationErrorImpl(p.AuthenticationErrorCode.Internal,"failed to resolve user id for redirect request <"+t.redirect_type+", "+t.target.type+">")}if(i!=this._user.userId){this._sdk.log(p.LogLevel.Debug,"User id in request is different than that of the current user <"+i+", "+this._user.userId+">");this._user=u.User.findUser(this._sdk,i)||u.User.createUser(this._sdk,i,p.UserHandleType.UserId)}}else if(t.target.type=="uid_token"){var o=t.target.token||this._user.idToken;if(!o){throw new p.impl.AuthenticationErrorImpl(p.AuthenticationErrorCode.Internal,"failed to resolve id token for redirect request <"+t.redirect_type+", "+t.target.type+">")}if(o!=this._user.idToken){this._sdk.log(p.LogLevel.Debug,"Id token in request is different than that of the current user <"+o+", "+this._user.idToken+">");this._user=u.User.findUser(this._sdk,o)||u.User.createUser(this._sdk,o,p.UserHandleType.IdToken)}}else{throw new p.impl.AuthenticationErrorImpl(p.AuthenticationErrorCode.Internal,"Unhandled redirect target type '"+t.target.type+"'")}this._sdk.log(p.LogLevel.Info,"control flow || type:"+t.redirect_type+" policy: "+r);switch(t.redirect_type){case u.Protocol.RedirectTypeName.RedirectTypeNameAuthenticate:return this._sdk.internalAuthenticate(this._user,r,n,e);case u.Protocol.RedirectTypeName.RedirectTypeNameBind:return this._sdk.internalBind(this._user,n,e);case u.Protocol.RedirectTypeName.RedirectTypeNameInvokePolicy:return this._sdk.invokePolicy(r,n,e);case u.Protocol.RedirectTypeName.RedirectTypeNameBindOrAuthenticate:if(this._user.deviceBound){return this._sdk.internalAuthenticate(this._user,r,n,e)}else{return this._sdk.internalBind(this._user,n,e)}default:throw new p.impl.AuthenticationErrorImpl(p.AuthenticationErrorCode.Internal,"Unhandled redirect type '"+t.redirect_type+"'")}}catch(t){return Promise.reject(p.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))}};Object.defineProperty(h.prototype,"user",{get:function(){return this._user},enumerable:true,configurable:true});Object.defineProperty(h.prototype,"deviceSigningKeyPair",{get:function(){if(!this._deviceKeyPair&&!this._anonymous){if(this._sdk.host.queryHostInfo(r.sdkhost.HostInformationKey.PersistentKeysSupported)=="true"){this._deviceKeyPair=this._sdk.host.getKeyPair(this._user.deviceSigningKeyTag,r.sdkhost.KeyClass.StdSigningKey,r.sdkhost.KeyBiometricProtectionMode.None);if(!this._deviceKeyPair){this._sdk.log(p.LogLevel.Error,"Could not load device signing key pair for this device.");throw new p.impl.AuthenticationErrorImpl(p.AuthenticationErrorCode.InvalidDeviceBinding,"Invalid device signature - could not load device signing key pair.")}}}return this._deviceKeyPair},enumerable:true,configurable:true});h.prototype.performSessionExchange=function(t){return this.performSessionExchangeInternal(t,true,true)};h.prototype.performSessionExchangeInternal=function(n,i,t){var o=this;if(this._invalidated){this._sdk.log(p.LogLevel.Error,"Attempt to execute a session exchange from invalidated session.");return Promise.reject(new p.impl.AuthenticationErrorImpl(p.AuthenticationErrorCode.SessionRequired,"Session was invalidated by server."))}if(this.connectionSettings().getCryptoMode()==p.ConnectionCryptoMode.Full&&!this._currentCryptoSession&&t){return this.performSessionExchangeInternal(new u.SessionExchangeRequest("POST","auth/key_exchange",{r:"Hello Encrypted World"}),i).then(function(t){return o.performSessionExchangeInternal(n)})}this._sdk.log(p.LogLevel.Debug,"Preprocess request "+JSON.stringify(n));return this.preprocessSessionExchangeRequest(n).then(function(t){return o.promisePossiblyEncryptedTransportRequest(t).then(function(t){return o.preprocessTransportRequest(t).then(function(t){o._sdk.log(p.LogLevel.Debug,"Will send request "+JSON.stringify(t));return o._sdk.transportProvider.sendRequest(t).then(function(e){o._sdk.log(p.LogLevel.Debug,"Got response "+JSON.stringify(e));try{var t=JSON.parse(e.getBodyJson())}catch(t){throw p.impl.AuthenticationErrorImpl.errorForTransportResponse(e)}o.postprocessResponse(t);t=o.possiblyDecryptResponse(t);var r=t.data&&t.data.state==u.Protocol.AuthSessionState.Rejected;if(e.getStatus()==200&&!t.error_code||e.getStatus()==401&&r){return t}else if(e.getStatus()==200||t.error_code){if(t.error_code==23&&i){o._currentCryptoSession=null;return o.performSessionExchangeInternal(n,false,true)}else{throw p.impl.AuthenticationErrorImpl.errorForServerResponse(t)}}else{throw p.impl.AuthenticationErrorImpl.errorForTransportResponse(e)}})})})})};h.prototype.cancelCurrentControlFlow=function(){if(this._currentControlFlowProcessor){this._currentControlFlowProcessor.cancelFlow()}else{this._sdk.log(p.LogLevel.Error,"No current control flow.")}};h.prototype.deviceId=function(){return this._deviceId};Object.defineProperty(h.prototype,"sdk",{get:function(){return this._sdk},enumerable:true,configurable:true});h.prototype.preprocessTransportRequest=function(r){var n=this;var t={aid:this.connectionSettings().getAppId()};if(this._deviceId){t["did"]=this._deviceId}if(this._sessionId){t["sid"]=this._sessionId}r.setUrl(this.urlWithConcatenatedQuery(r.getUrl(),t));var i=r.getHeaders()||[];var e=new p.TransportHeader;e.setName("X-TS-Client-Version");e.setValue(this.clientVersionHeader);i.push(e);var o=new p.TransportHeader;o.setName("Authorization");o.setValue("TSToken "+this.connectionSettings().getToken()+"; tid="+this.connectionSettings().getTokenName());i.push(o);try{if(this._deviceId&&this.deviceSigningKeyPair){return this.generateSignatureForRequest(r).then(function(t){var e=new p.TransportHeader;e.setName("Content-Signature");e.setValue("data:"+t+";key-id:"+n._deviceId+";scheme:3");i.push(e);r.setHeaders(i);return r})}}catch(t){return Promise.reject(t)}r.setHeaders(i);return Promise.resolve(r)};h.prototype.postprocessResponse=function(t){var r=this;if(t.headers){t.headers.forEach(function(t){var e=h.headerProcessors[t.type];e.call(r,t)})}};h.prototype.encryptEnvelopedMessageIfNeeded=function(t){var e=this.generateKeyExchangeHeaderIfNeeded();if(this._currentCryptoSession&&this._currentCryptoSession.isReady()){this._currentCryptoSession.encryptRequest(t)}if(e){t.headers.push(e)}};h.prototype.promisePossiblyEncryptedTransportRequest=function(s){var c=this;return new Promise(function(t,e){var r={headers:s.envelopeHeaders,data:s.body};c.encryptEnvelopedMessageIfNeeded(r);var n=new p.TransportRequest;var i=c._sdk.host.transformApiPath(s.serverRelativeUrl);n.setMethod(s.method);var o=c._sdk.connectionSettings.getRealm()||"";var a=o.length?"/"+o:"";n.setUrl(""+c._sdk.connectionSettings.getServerAddress()+a+"/api/v2/"+i);n.setBodyJson(JSON.stringify(r));t(n)})};h.prototype.possiblyDecryptResponse=function(t){if(this._currentCryptoSession&&this._currentCryptoSession.isReady()){t=this._currentCryptoSession.decryptResponse(t)}return t};h.prototype.generateKeyExchangeHeaderIfNeeded=function(){if(this.connectionSettings().getCryptoMode()!=p.ConnectionCryptoMode.None&&!this._currentCryptoSession){this._currentCryptoSession=new u.Scheme2CryptoSession(this._sdk);return this._currentCryptoSession.getExchangeRequestHeader()}return null};h.prototype.preprocessSessionExchangeRequest=function(u){var l=this;return new Promise(function(e,t){var r=l.generateUserIDHeaderIfNeeded();if(r){u.addEnvelopeHeader(r)}var n=l.generateInvalidatedAuthenticatorsHeadersIfNeeded();if(n){for(var i=0,o=n;i<o.length;i++){var a=o[i];u.addEnvelopeHeader(a)}}var s=Promise.resolve(true);var c=new d(u);h.messageFilteringExtensionPoint.forEach(function(e){s=s.then(function(t){return e.filterMessage(l.createPluginSessionInfo(),c).catch(function(t){l.sdk.log(p.LogLevel.Warning,"Error during message filtering: "+t);return true})})});s.then(function(t){return e(u)},t)})};h.prototype.generateUserIDHeaderIfNeeded=function(){if(this._anonymous){if(this._user.ephemeralUserId){return{type:"uid",uid:this._user.ephemeralUserId}}}else if(this._user.userId){return{type:"uid",uid:this._user.userId}}else if(this._user.idToken){return{type:"uid_token",token:this._user.idToken}}return null};h.prototype.processKeyExchangeResponseHeader=function(t){if(this._currentCryptoSession){this._currentCryptoSession.processExchangeResponseHeader(t)}};h.prototype.generateSignatureForRequest=function(t){var e=t.getUrl();var r=e.indexOf("?");if(r>0){var n=t.getUrl().substring(r+1);var i=t.getUrl().substring(0,r);var o=n.split("&").sort().join("&");e=i+"?"+o}var a=e.substr(this.connectionSettings().getServerAddress().length);var s=/%%/g;var c=a.replace(s,"\\%")+"%%"+this.clientVersionHeader.replace(s,"\\%")+"%%"+t.getBodyJson().replace(s,"\\%");var u=p.util.asciiToHex(c);return this.deviceSigningKeyPair.signHex(u).then(function(t){return p.util.hexToBase64(t)})};h.prototype.connectionSettings=function(){return this._sdk.connectionSettings};h.prototype.processSessionIdHeader=function(t){this._sdk.log(p.LogLevel.Debug,"Processing session ID header "+t);this._sessionId=t.session_id};h.prototype.processDeviceIdHeader=function(t){this._sdk.log(p.LogLevel.Debug,"Processing Device ID header "+t);if(!this._deviceId){this._user.setProvisionalDeviceId(t.device_id);this._deviceId=t.device_id}else{if(this._deviceId!=t.device_id){this._sdk.log(p.LogLevel.Warning,"Received device ID "+t.device_id+" in a session with an existing device id "+this._deviceId)}}};h.prototype.processSessionStateChangeHeader=function(t){this._sdk.log(p.LogLevel.Debug,"Processing session state change header "+t+" to state "+t.state);switch(t.state){case u.Protocol.SessionStateChangeState.Closed:this._sdk.log(p.LogLevel.Debug,"Invalidating session.");this._invalidated=true;break;default:throw new p.impl.AuthenticationErrorImpl(p.AuthenticationErrorCode.Communication,"Invalid session state change encountered in header.")}};h.prototype.processSessionEphemeralUserHeader=function(t){this._sdk.log(p.LogLevel.Debug,"Processing ephemeral user Id header "+t);this._user.updateEphemeralUserId(t.uid)};h.prototype.noHeaderProcessing=function(t){};h.prototype.processEncryptedSharedSecretHeader=function(t){};h.prototype.processDisplayNameHeader=function(t){this._sdk.log(p.LogLevel.Debug,"Processing display name header '"+t.display_name+"'");u.User.updateUserDisplayName(t.display_name,this._user,this._sdk)};h.prototype.processUidTokenHeader=function(t){this._sdk.log(p.LogLevel.Debug,"Processing uid_token header '"+t.token+"'");u.User.updateUserIdToken(t.token,this._user,this._sdk)};h.prototype.urlWithConcatenatedQuery=function(t,e){var r="";if(t.indexOf("?")<0){r="?"}else{if(t[t.length-1]!="&"){r="&"}}return t+r+Object.keys(e).map(function(t){return t+"="+encodeURIComponent(e[t])}).join("&")};Object.defineProperty(h.prototype,"clientVersionHeader",{get:function(){if(!this._cachedClientVersionHeader){var t=this._sdk.getClientFeatureSet().join(",");this._cachedClientVersionHeader=this._sdk.getVersionInfo().getSdkVersion()+";["+t+"]"}return this._cachedClientVersionHeader},enumerable:true,configurable:true});h.prototype.createPluginSessionInfo=function(){return new e(this)};h.prototype.lock=function(){this._sdk.log(p.LogLevel.Debug,"Locking session "+this._sessionId);this._lockCount++};h.prototype.unlock=function(){this._sdk.log(p.LogLevel.Debug,"Unlocking session "+this._sessionId);this._lockCount--;if(this._lockCount<0){throw new p.impl.AuthenticationErrorImpl(p.AuthenticationErrorCode.Internal,"Unbalanced session locking: Attempt to unlock an already unlocked sessoin.")}};h.prototype.canTerminate=function(){return!this._lockCount};h.prototype.toJson=function(){var t={session_id:this._sessionId,user_name:this._user.displayName,device_id:this._deviceId,invalidated:this._invalidated,user:u.User.toUserRecord(this._user),persistUserData:this._persistUserData};if(this._currentCryptoSession&&this._currentCryptoSession.isReady()){t.c_session=this._currentCryptoSession.toJson()}return t};h.fromJson=function(t,e){var r=e;var n=u.User.fromUserRecord(r.user,t);if(!n){u.User.findUser(t,r.user_name)}if(!n){throw new p.impl.AuthenticationErrorImpl(p.AuthenticationErrorCode.Internal,"Can't deserialize session -- user "+r.user_name+" not found.")}var i=new h(t,n);i._sessionId=r.session_id;i._deviceId=r.device_id;i._invalidated=r.invalidated||false;i._persistUserData=r.persistUserData||true;if(r.c_session){i._currentCryptoSession=u.Scheme2CryptoSession.fromJson(t,r.c_session)}return i};h.notifySessionObserversOnMainSessionLogin=function(t){var e=t.createPluginSessionInfo();this.sessionObservationExtensionPoint.forEach(function(t){t.mainSessionStarted(e)})};h.notifySessionObserversOnMainSessionLogout=function(t){var e=t.createPluginSessionInfo();this.sessionObservationExtensionPoint.forEach(function(t){t.mainSessionEnded(e)})};h.headerProcessors={session_id:h.prototype.processSessionIdHeader,device_id:h.prototype.processDeviceIdHeader,encrypted_shared_secret:h.prototype.processEncryptedSharedSecretHeader,session_state:h.prototype.processSessionStateChangeHeader,ephemeral_uid:h.prototype.processSessionEphemeralUserHeader,key_exchange:h.prototype.processKeyExchangeResponseHeader,encryption:h.prototype.noHeaderProcessing,display_name:h.prototype.processDisplayNameHeader,uid_token:h.prototype.processUidTokenHeader};h.messageFilteringExtensionPoint=new u.ExtensionPoint(r.tarsusplugin.TARSUS_EXTENSION_POINT_NAME_MESSAGE_FILTERS);h.sessionObservationExtensionPoint=new u.ExtensionPoint(r.tarsusplugin.TARSUS_EXTENSION_POINT_NAME_SESSION_OBSERVERS);return h}();u.Session=t;var e=function(){function t(t){this._underlying=t}t.prototype.getUsername=function(){return this._underlying.user.displayName};return t}();var d=function(){function t(t){this._underlying=t}t.prototype.getMethod=function(){return this._underlying.method};t.prototype.getBody=function(){return this._underlying.body};t.prototype.getHeaders=function(){return this._underlying.envelopeHeaders};t.prototype.addHeader=function(t){this._underlying.addEnvelopeHeader(t)};return t}()})(t=p.core||(p.core={}))})(t=r.sdk||(r.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(t,e,r,n){this._requestMethod=t;this._requestServerRelativeUrl=e;this._requestBody=r;this._envelopeHeaders=n||[]}t.prototype.addEnvelopeHeader=function(t){this._envelopeHeaders.push(t)};Object.defineProperty(t.prototype,"method",{get:function(){return this._requestMethod},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"serverRelativeUrl",{get:function(){return this._requestServerRelativeUrl},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"body",{get:function(){return this._requestBody},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"envelopeHeaders",{get:function(){return this._envelopeHeaders},enumerable:true,configurable:true});return t}();t.SessionExchangeRequest=e})(e=t.core||(t.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(a){var t;(function(o){var t;(function(r){var e=function(){function t(t){this._sdk=t}t.prototype.extend=function(t,e){r.ExtensionPoint.byName(t).extend(e)};t.prototype.getSdk=function(){return this._sdk};t.prototype.generateRandomHexString=function(t){return this._sdk.host.generateRandomHexString(t)};return t}();r.TarsusPluginHostImpl=e;var t=function(){function t(t){this._installedPluginsAndConfigs={};this._initializedPlugins=[];this._sdk=t;this._pluginHost=new e(this._sdk)}t.prototype.getInitializedPlugins=function(){return this._initializedPlugins.concat([])};t.prototype.installPlugin=function(t,e){if(this._installedPluginsAndConfigs[t]){throw new o.impl.AuthenticationErrorImpl(o.AuthenticationErrorCode.AppImplementation,"Attempt to install plugin "+t+" twice.")}this._installedPluginsAndConfigs[t]=e};t.prototype.initializePlugins=function(){var i=this;this._sdk.log(o.LogLevel.Debug,"Starting plugin initialization...");var t=Object.keys(this._installedPluginsAndConfigs).map(function(n){i._sdk.log(o.LogLevel.Debug,"Loading plugin "+n+"...");return i._sdk.host.loadPlugin(n).then(function(t){var e=t.getPluginInfo();var r=a.tarsusplugin.impl.PluginInfoImpl.toString(e);if(t.getPluginInfo().getPluginName()!=n){throw new o.impl.AuthenticationErrorImpl(o.AuthenticationErrorCode.AppImplementation,"Plugin "+n+": getPluginInfo() reported mismatched name -- "+r+".")}i._sdk.log(o.LogLevel.Info,"Initializing plugin "+r+"...");return t.initialize(i._pluginHost,i._installedPluginsAndConfigs[n]).then(function(){i._initializedPlugins.push(t)}).catch(function(t){i._sdk.log(o.LogLevel.Error,"Couldn't initialize plugin "+r+": "+t)})})});return Promise.all(t).then(function(){i._sdk.log(o.LogLevel.Debug,"Plugin initialization completed sucessfuly")})};return t}();r.TarsusPluginManager=t})(t=o.core||(o.core={}))})(t=a.sdk||(a.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(c){var t;(function(s){var n="v0";var i=function(){function n(){}n.prototype.toString=function(){return this._guidStr};n.prototype.equalString=function(t){return this._guidStr==t};n.prototype.equalsUserGuid=function(t){return this.toString()==t.toString()};n.createWithLength=function(t,e){var r=new n;r._guidStr=e.host.generateRandomHexString(t);return r};n.createFromString=function(t){var e=new n;e._guidStr=t;return e};return n}();s.UserGuid=i;var t=function(){function a(){}Object.defineProperty(a.prototype,"guid",{get:function(){return this._guid},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"userId",{get:function(){return this._userId},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"displayName",{get:function(){return this._displayName||this._userId},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"idToken",{get:function(){return this._idToken},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"deviceId",{get:function(){return this._deviceId},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"phoneNumber",{get:function(){return this._phoneNumber},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"defaultAuthId",{get:function(){return this._defaultAuthId},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"deviceBound",{get:function(){return this._deviceBound},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"hasLoggedIn",{get:function(){return this._hasLoggedIn},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"deviceSigningKeyTag",{get:function(){return new s.TarsusKeyPath("per_user",this._guid.toString(),"device_key")},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"deviceEncryptionKeyTag",{get:function(){return new s.TarsusKeyPath("per_user",this._guid.toString(),"enc_enabled")},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"ephemeralUserId",{get:function(){return this._ephemeralUserId},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"userHandle",{get:function(){return this._userId||this._idToken},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"userHandleType",{get:function(){return this._userId?c.UserHandleType.UserId:c.UserHandleType.IdToken},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"localEnrollments",{get:function(){if(!this._localEnrollments){this._localEnrollments=s.LocalEnrollment.enrollmentsForUser(this,this._sdk)}return this._localEnrollments},enumerable:true,configurable:true});a.prototype.updateDefaultAuthId=function(t){this._defaultAuthId=t};a.prototype.updateEphemeralUserId=function(t){if(!this._ephemeral){throw new c.impl.AuthenticationErrorImpl(c.AuthenticationErrorCode.Internal,"Invalid ephemeral user name update reaquest header, user is not ephemeral.")}if(this._ephemeralUserId){throw new c.impl.AuthenticationErrorImpl(c.AuthenticationErrorCode.Internal,"Attempt to set an ephemeral userId after it has already been updated once.")}this._ephemeralUserId=t};a.updateUserDisplayName=function(t,e,r){e._displayName=t;if(r.currentSession&&r.currentSession.persistUserData){a.save(r,e)}};a.updateUserIdToken=function(t,e,r){e._idToken=t;delete e._userId;if(r.currentSession&&r.currentSession.persistUserData){a.save(r,e)}};a.prototype.setProvisionalDeviceId=function(t){if(this.deviceBound){throw new c.impl.AuthenticationErrorImpl(c.AuthenticationErrorCode.Internal,"Attempt to record a provisional device ID for an already bound user record.",{})}this._deviceId=t};a.prototype.bindDeviceToUser=function(t){if(this.deviceBound){throw new c.impl.AuthenticationErrorImpl(c.AuthenticationErrorCode.Internal,"Attempt to record a device for an already bound user record.",{})}if(this._deviceId!=t){throw new c.impl.AuthenticationErrorImpl(c.AuthenticationErrorCode.Internal,"Attempt to bind user to a device ID different than provisional device ID.",{})}this._deviceBound=true};a.prototype.markLoggedIn=function(){this._hasLoggedIn=true};a.iterateUsers=function(t,e){var r=t.host.readStorageKey(a.storageKey);for(var n=0;n<r.length;n++){var i=a.fromUserRecord(r[n],t);var o=e(i);if(o!=null){return o}}if(t.currentSession){return e(t.currentSession.user)}return null};a.findUser=function(t,e){return a.iterateUsers(t,function(t){if(t.userHandle.toLowerCase()==e.toLowerCase()){return t}else{return null}})};a.createUser=function(t,e,r){if(!e){throw new c.impl.AuthenticationErrorImpl(c.AuthenticationErrorCode.AppImplementation,"userHandle must not be empty")}var n=new a;if(r==c.UserHandleType.UserId){n._userId=e}else{n._idToken=e}n._guid=i.createWithLength(32,t);n._deviceBound=false;n._hasLoggedIn=false;n._phoneNumber="";n._sdk=t;n._ephemeral=false;return n};a.createEphemeralUser=function(t){var e=new a;e._guid=i.createWithLength(32,t);e._deviceBound=false;e._hasLoggedIn=false;e._phoneNumber="";e._sdk=t;e._ephemeral=true;e._ephemeralUserId=null;return e};a.deleteUser=function(t,e){var r=e.host.readStorageKey(a.storageKey);e.log(c.LogLevel.Warning,"=== CURRENTL LEN "+r.length);for(var n=0;n<r.length;n++){var i=a.fromUserRecord(r[n],e);if(t.guid.equalsUserGuid(i.guid)){break}}if(!(n<r.length)){e.log(c.LogLevel.Warning,"Attempt to delete nonexisting user "+t.userHandle);return}while(n<r.length-1){r[n]=r[n+1];n++}var o=r.length-1;delete r[r.length-1];e.log(c.LogLevel.Warning,"=== CURRENTL LEN2 "+r.length);r.length=o;e.log(c.LogLevel.Warning,"=== CURRENTL LEN3 "+r.length);e.host.writeStorageKey(a.storageKey,r)};a.prototype.createEnrollmentRecord=function(t,e,r,n,i){var o=s.LocalEnrollment.createNew(t,e,r,this._sdk,i);o.status=n;return o};a.prototype.updateEnrollmentRecord=function(t){if(this._ephemeral){throw new c.impl.AuthenticationErrorImpl(c.AuthenticationErrorCode.Internal,"Attempt to update enrollment record for ephemeral user.",{})}var e={};for(var r in this.localEnrollments){e[r]=this.localEnrollments[r]}e[t.authenticatorId]=t;s.LocalEnrollment.updateEnrollmentsForUser(this,e,this._sdk);this._localEnrollments=e};a.toUserRecord=function(t){return{default_auth_id:t._defaultAuthId,device_bound:t._deviceBound,has_logged_in:t._hasLoggedIn,device_id:t._deviceId,last_auth:"<null>",guid:t._guid.toString(),user_id:t.userId,display_name:t._displayName,id_token:t._idToken,user_number:t._phoneNumber,schemeVersion:n}};a.save=function(t,e){if(e._ephemeral){throw new c.impl.AuthenticationErrorImpl(c.AuthenticationErrorCode.Internal,"Attempt to save ephemeral user record to persistent store.",{})}var r=t.host.readStorageKey(a.storageKey);r.length=r.length||0;for(var n=0;n<r.length;n++){var i=a.fromUserRecord(r[n],t);if(i.guid.equalsUserGuid(e.guid)){break}}r[n]=a.toUserRecord(e);if(r.length<n+1){r.length=n+1}t.host.writeStorageKey(a.storageKey,r)};a.fromUserRecord=function(t,e){var r=new a;r._sdk=e;r._defaultAuthId=t.default_auth_id;r._deviceBound=t.device_bound;r._hasLoggedIn=t.has_logged_in;r._deviceId=t.device_id;r._phoneNumber=t.user_number;r._userId=t.user_id;r._idToken=t.id_token;if(t.schemeVersion===n){r._guid=i.createFromString(t.guid);r._displayName=t.display_name}else{r._guid=i.createFromString(t.user_id);r._displayName=t.user_id}return r};a.storageKey=new s.TarsusKeyPath("users");return a}();s.User=t})(t=c.core||(c.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){t.InternalErrorWrongBiometric=1e3;t.InternalErrorBiometricInvalidated=1001;t.InternalErrorBiometricKeyStoreError=1002;t.InternalErrorBiometricNotConfigured=1003;t.InternalErrorBiometricOsLockTemporary=1004;t.InternalErrorBiometricOsLockPermanent=1005;t.InternalErrorBiometricFallbackPressed=1006;t.ErrorDataInternalError="internal_error";t.ErrorDataNumFailures="num_failures";t.ErrorDataServerErrorCode="server_error_code";t.ErrorDataServerErrorMessage="server_error_message";t.ErrorDataServerErrorData="server_error_data";t.ErrorDataRetriesLeft="retries";t.ErrorDataCommunicationError="communication_error";t.ErrorDataCommunicationSSL="ssl";t.FeatureCodeServerHeaders=1;t.FeatureCodeAuthFailover=2;t.FeatureCodeUnifiedRegFlow=3;t.FeatureCodePromotionAction=6;t.FeatureCodeSilentFingerprintRegistration=7;t.FeatureCodeMultiMethodRegistrationAction=8;t.FeatureCodeOtpCodeInvalidated=10;t.FeatureCodeEnvelopedClientRequest=11;t.FeatureCodeUnregistrationFlow=12;t.FeatureCodeFaceIdAuthentication=13;t.FeatureCodeDynamicPolicySupport=14;t.FeatureCodeAutoRequestForSignContent=19})(e=t.sdkhost||(t.sdkhost={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e;(function(t){t.TARSUS_VERSION="4.1";t.API_LEVEL=8;t.STATIC_FEATURE_SET=[r.sdkhost.FeatureCodeServerHeaders,r.sdkhost.FeatureCodeAuthFailover,r.sdkhost.FeatureCodeUnifiedRegFlow,r.sdkhost.FeatureCodePromotionAction,r.sdkhost.FeatureCodeSilentFingerprintRegistration,r.sdkhost.FeatureCodeMultiMethodRegistrationAction,r.sdkhost.FeatureCodeOtpCodeInvalidated,r.sdkhost.FeatureCodeEnvelopedClientRequest,r.sdkhost.FeatureCodeUnregistrationFlow,r.sdkhost.FeatureCodeDynamicPolicySupport]})(e=t.core||(t.core={}))})(t=r.sdk||(r.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(i){var t;(function(t){var e;(function(t){var e=function(){function t(t,e){this._controlFlowProcessor=t;this._action=e;this._sdk=this._controlFlowProcessor._sdk;this._uiHandler=this._controlFlowProcessor._uiHandler;this._clientContext=this._controlFlowProcessor._clientContext}t.prototype.cancelRun=function(){};t.prototype.policyAction=function(){if(!this._policyAction){this._policyAction=new i.impl.PolicyActionImpl(this._action)}return this._policyAction};t.prototype.sendAssertionRequest=function(t,e,r){var n=this._controlFlowProcessor.createAssertionRequest(this._action,t,e,r);return i.util.wrapPromiseWithActivityIndicator(this._uiHandler,this.policyAction(),this._clientContext,this._controlFlowProcessor._session.performSessionExchange(n).then(function(t){if(!t.data){throw new i.impl.AuthenticationErrorImpl(i.AuthenticationErrorCode.Communication,"Invalid response to assertion.",{responseBody:JSON.stringify(t)})}return t.data}))};return t}();t.ActionDriver=e})(e=t.actiondrivers||(t.actiondrivers={}))})(t=i.core||(i.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(i){var t;(function(t){var e;(function(t){var e=function(n){__extends(t,n);function t(t,e){var r=n.call(this,t,e)||this;r._clientContext=r._controlFlowProcessor._clientContext;r._cancellationHolder=new i.util.CancelablePromiseHolder;return r}t.prototype.run=function(){var r=this;this._cancellationHolder.resolveWith(function(t,e){r.doRunAction().then(t,e)});return this._cancellationHolder.cancellablePromise.catch(function(t){if(t==i.util.CancelablePromiseHolder.CancelRequest){return r._controlFlowProcessor.createExternalCancellationRejectionPromise()}else{throw t}})};t.prototype.cancelRun=function(){this._cancellationHolder.cancel()};return t}(t.ActionDriver);t.SimpleCancellationActionDriver=e})(e=t.actiondrivers||(t.actiondrivers={}))})(t=i.core||(i.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(a){var t;(function(n){var t;(function(t){var e=function(u){__extends(r,u);function r(t,e,r,n,i,o,a,s){var c=u.call(this,a._controlFlowProcessor._session,t,e,r)||this;c._assertionId=n;c._retriesLeft=i;c._actionDriver=a;c._fallback=o;c._registration=s;return c}Object.defineProperty(r.prototype,"authDriver",{get:function(){if(!this._authDriver){this._authDriver=this.authenticationDriverDescriptor.createAuthenticationDriver(this._actionDriver,this._authenticatorMethodConfig,this)}return this._authDriver},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"suggestedParameters",{get:function(){if(this.getEnabled()){return this.authenticationDriverDescriptor.suggestParameters(this._authenticatorMethodConfig,this)}else{return[]}},enumerable:true,configurable:true});r.prototype.getEnabled=function(){return(this._registration||this.getRegistered()&&!this.getLocked())&&this.getSupportedOnDevice()};Object.defineProperty(r.prototype,"fallback",{get:function(){return this._fallback},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"assertionId",{get:function(){return this._assertionId},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"retriesLeft",{get:function(){return this._retriesLeft},enumerable:true,configurable:true});r.prototype.updateWithAssertionResult=function(t){if(t.retries_left){this._retriesLeft=t.retries_left}if(t.locked){this._locked=t.locked}};r.fromUnregistrationAction=function(t,e){return new r(t.method,t,t,t.assertion_id,null,null,e,false)};r.fromPromotionAction=function(t,e){return new r(t.method,t,t,t.assertion_id,t.retries_left,t.fallback||null,e,true)};r.fromAuthenticationActionMenuOption=function(t,e){return new r(t.type,t,t,t.assertion_id,t.retries_left,t.fallback||null,e,false)};r.fromRegistrationAction=function(t,e){return new r(t.method,t,t,t.assertion_id,null,null,e,true)};return r}(n.authenticationdrivers.AuthenticatorDescriptionImpl);t.AuthenticationMenuAuthenticator=e;var r=function(n){__extends(t,n);function t(t,e){var r=n.call(this,t,e)||this;r._externallyCancelled=false;return r}t.prototype.doRunAction=function(){var r=this;return new Promise(function(t,e){r._completionFunction=t;r._rejectionFunction=e;r.runActionWithCompletionFunctions()})};Object.defineProperty(t.prototype,"availableAuthenticatorsForSwitching",{get:function(){return this.availableAuthenticators},enumerable:true,configurable:true});t.prototype.sendAuthenticatorAssertionRequest=function(t,e,r,n){this._sdk.log(a.LogLevel.Debug,"Sending authenticator asserion request for "+t.getAuthenticatorId()+": assert="+e);var i={assertion_id:t.assertionId,method:t.getAuthenticatorId()};if(n){for(var o in n){i[o]=n[o]}}return this.sendAssertionRequest(e,r,i)};t.prototype.completeAuthenticationWithAssertionResult=function(t){this._completionFunction(t)};t.prototype.completeAuthenticationWithError=function(t){this._rejectionFunction(t)};t.prototype.prepareForRunningAuthenticationDriver=function(t){if(this._externallyCancelled){this.completeAuthenticationWithError(this._controlFlowProcessor.createExternalCancellationError());return false}else{this._runningAuthenticatorDriver=t;return true}};t.prototype.cancelRun=function(){this._externallyCancelled=true;if(this._runningAuthenticatorDriver){this._runningAuthenticatorDriver.onCancelRun()}n.prototype.cancelRun.call(this)};return t}(t.SimpleCancellationActionDriver);t.ActionDriverAuthenticatorOp=r})(t=n.actiondrivers||(n.actiondrivers={}))})(t=a.core||(a.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(s){var t;(function(a){var t;(function(n){var t=function(r){__extends(t,r);function t(t,e){return r.call(this,t,e)||this}t.prototype.runActionWithCompletionFunctions=function(){var t=this._action;this._sdk.log(s.LogLevel.Debug,"Loading authenticator descriptions");this.loadAuthenticatorDescriptionsFromAction(t);this._shouldUpdateDefaultAuth=t.options&&t.options.update_default;this._sdk.log(s.LogLevel.Debug,"Starting auth presentation");this.runWithPresentationMode(t.options&&t.options.start_with||a.Protocol.AuthMenuPresentationMode.DefaultAuthenticator)};Object.defineProperty(t.prototype,"availableAuthenticators",{get:function(){this.updateAvailableAuthenticatorsList();return this._availableAuthenticators.concat([])},enumerable:true,configurable:true});t.prototype.runWithPresentationMode=function(t,r){var n=this;this.updateAvailableAuthenticatorsList();var e=t==a.Protocol.AuthMenuPresentationMode.AuthenticatorMenu&&this._uiHandler.shouldIncludeDisabledAuthenticatorsInMenu(this.policyAction(),this._clientContext);var i=e?this._allAuthenticators:this._availableAuthenticators;if(r){i=i.filter(function(e){return r.filter(function(t){return t.getAuthenticatorId()==e.getAuthenticatorId()}).length>0})}if(!i.length){if(this._allAuthenticators.filter(function(t){return t.getLocked()}).length>0){this.completeAuthenticationWithError(new s.impl.AuthenticationErrorImpl(s.AuthenticationErrorCode.AllAuthenticatorsLocked,"All authenticators locked."))}else{this.completeAuthenticationWithError(new s.impl.AuthenticationErrorImpl(s.AuthenticationErrorCode.NoRegisteredAuthenticator,"No registered authenticator available."))}return}switch(t){case a.Protocol.AuthMenuPresentationMode.AuthenticatorMenu:var o=i.map(function(t){return new s.impl.AuthenticationOptionImpl(t,t.suggestedParameters)});this._uiHandler.selectAuthenticator(o,this.policyAction(),this._clientContext).then(function(e){switch(e.getResultType()){case s.AuthenticatorSelectionResultType.Abort:n.completeAuthenticationWithError(new s.impl.AuthenticationErrorImpl(s.AuthenticationErrorCode.UserCanceled,"Cancel during authenticator selection."));break;case s.AuthenticatorSelectionResultType.SelectAuthenticator:var t=o.filter(function(t){return t.getAuthenticator()==e.getSelectedAuthenticator()}).length>0;if(!t){n.completeAuthenticationWithError(new s.impl.AuthenticationErrorImpl(s.AuthenticationErrorCode.AppImplementation,"selectAuthenticator returned an authenticator not within options."));break}if(!e.getSelectedAuthenticator().getEnabled()){n.completeAuthenticationWithError(new s.impl.AuthenticationErrorImpl(s.AuthenticationErrorCode.AppImplementation,"selectAuthenticator returned a non-enabled authenticator."));break}n.runAuthenticator(e.getSelectedAuthenticator(),e.getSelectedAuthenticationParameters());break}});break;case a.Protocol.AuthMenuPresentationMode.DefaultAuthenticator:if(this._defaultAuthenticator&&this._availableAuthenticators.indexOf(this._defaultAuthenticator)>=0){this.runAuthenticator(this._defaultAuthenticator,[])}else{this._sdk.log(s.LogLevel.Warning,"Default authenticator for user not found. Falling back to first authenticator in list.");this.runAuthenticator(this._availableAuthenticators[0],[])}break;case a.Protocol.AuthMenuPresentationMode.FirstAuthenticator:this.runAuthenticator(this._availableAuthenticators[0],[]);break}};t.prototype.loadAuthenticatorDescriptionsFromAction=function(t){var e=this;this._allAuthenticators=t.methods.map(function(t){return n.AuthenticationMenuAuthenticator.fromAuthenticationActionMenuOption(t,e)})};t.prototype.updateAvailableAuthenticatorsList=function(){var e=this;this._defaultAuthenticator=null;this._availableAuthenticators=[];this._allAuthenticators.forEach(function(t){if(t.getEnabled()){e._availableAuthenticators.push(t)}if(t.getDefaultAuthenticator()){e._defaultAuthenticator=t}});if(!this._defaultAuthenticator){this._defaultAuthenticator=this._availableAuthenticators[0]}this._sdk.log(s.LogLevel.Debug,"Updated available authenticators list; "+this._availableAuthenticators.length+" available authenticators")};t.prototype.runAuthenticator=function(r,t){var n=this;var e=r.authDriver;if(!this.prepareForRunningAuthenticationDriver(e)){return}e.runAuthentication(t).then(function(t){if(t instanceof a.authenticationdrivers.AuthenticationDriverSessionResultSwitchAuthenticator){if(t.requiredAuthenticator){n.runAuthenticator(t.requiredAuthenticator,[])}else{n.runWithPresentationMode(a.Protocol.AuthMenuPresentationMode.AuthenticatorMenu,t.allowedAuthenticators)}}else if(t instanceof a.authenticationdrivers.AuthenticationDriverSessionResultAuthenticationCompleted){if(n._shouldUpdateDefaultAuth){n._sdk.log(s.LogLevel.Info,"Updating user default authenticator.");if(!n._controlFlowProcessor._session.anonymous){var e=n._controlFlowProcessor._session.user;e.updateDefaultAuthId(r.getAuthenticatorId());if(n._controlFlowProcessor._session.persistUserData){a.User.save(n._sdk,e)}}}n.completeAuthenticationWithAssertionResult(t.assertionResult)}else{n.completeAuthenticationWithError(new s.impl.AuthenticationErrorImpl(s.AuthenticationErrorCode.Internal,"Unknown authentication driver result type encountered."))}},function(t){n._sdk.log(s.LogLevel.Debug,"Received authentication driver error "+t);n.completeAuthenticationWithError(t)})};return t}(n.ActionDriverAuthenticatorOp);n.ActionDriverAuthentication=t})(t=a.actiondrivers||(a.actiondrivers={}))})(t=s.core||(s.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(c){var t;(function(t){var e;(function(s){var t=function(r){__extends(t,r);function t(t,e){return r.call(this,t,e)||this}t.prototype.doRunAction=function(){var o=this;this._sdk.log(c.LogLevel.Debug,"Executing confirmation action.");var a=this._action;return this._uiHandler.getConfirmationInput(a.title,a.text,a.continue_button_text,a.cancel_button_text,this.policyAction(),this._clientContext).then(function(t){var e={user_cancelled:t.getUserChoice()==1};var r=Promise.resolve(e);if(a.require_sign_content){var n={title:a.title,text:a.text,continue_button_text:a.continue_button_text,cancel_button_text:a.cancel_button_text,parameters:a.parameters,image:a.image};var i={params:n,user_input:e.user_cancelled?a.cancel_button_text:a.continue_button_text};r=r.then(function(t){return s.ActionDriverSignContent.augmentAssertionDataWithSignedContent(t,i,o._controlFlowProcessor._session.deviceSigningKeyPair,o._sdk)})}return r.then(function(t){o._sdk.log(c.LogLevel.Debug,"Asserting confirmation: "+t);return o.sendAssertionRequest(null,t).then(function(t){return t})})})};return t}(s.SimpleCancellationActionDriver);s.ActionDriverConfirmation=t})(e=t.actiondrivers||(t.actiondrivers={}))})(t=c.core||(c.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(i){var t;(function(n){var t;(function(t){var e=function(r){__extends(t,r);function t(t,e){return r.call(this,t,e)||this}t.prototype.doRunAction=function(){var e=this;this._sdk.log(i.LogLevel.Debug,"Executing disable TOTP action...");var t=this._action;var r=n.totp.TotpPropertiesProcessor.createWithUser(this._controlFlowProcessor._session.user,this._sdk);this._sdk.log(i.LogLevel.Debug,"Obtained TOTP processor.");t.config_ids.forEach(function(t){e._sdk.log(i.LogLevel.Debug,"Deleting TOTP processor "+t+".");r.deleteProvisionForGenerator(t);e._sdk.log(i.LogLevel.Debug,"TOTP processor "+t+" deleted.")});return this.sendAssertionRequest()};return t}(t.SimpleCancellationActionDriver);t.ActionDriverDisableTotp=e})(t=n.actiondrivers||(n.actiondrivers={}))})(t=i.core||(i.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(o){var t;(function(i){var t;(function(t){var e=function(n){__extends(e,n);function e(t,e){var r=n.call(this,t,e)||this;r.onPromiseResult=function(t){switch(t.getControlRequest()){case o.FormControlRequest.Submit:var e={input:t.getJsonData()};r.request(e);break;case o.FormControlRequest.Abort:r.session.endSession();r.rejectionFunction(new o.impl.AuthenticationErrorImpl(o.AuthenticationErrorCode.UserCanceled,"User cancelled a form action."));break}};return r}e.prototype.doRunAction=function(){var r=this;var n=this._action;var t=e.formExtensionPoint.firstNonNull(function(t){return t.createFormSession(n.form_id,n.app_data)});if(t){this._sdk.log(o.LogLevel.Debug,'Using extension of type "com.ts.mobile.plugins.form.settings" for formId '+n.form_id);this.session=t}else{this.session=this._uiHandler.createFormSession(n.form_id,n.app_data)}if(!this.session){return Promise.reject(o.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from createFormSession."))}return new Promise(function(t,e){r.completionFunction=t;r.rejectionFunction=e;r.session.startSession(r._clientContext,new o.impl.PolicyActionImpl(n));r.session.promiseFormInput().then(r.onPromiseResult)})};e.prototype.request=function(t){var r=this;this.sendAssertionRequest(null,null,t).then(function(t){var e=t.data;switch(t.assertion_error_code){case i.Protocol.AssertionErrorCode.NotFinished:r.session.onContinue(e);r.session.promiseFormInput().then(r.onPromiseResult);break;case i.Protocol.AssertionErrorCode.RepeatCurrentStep:r.session.onError(e);r.session.promiseFormInput().then(r.onPromiseResult);break;default:r.session.endSession();r.completionFunction(t);break}}).catch(function(t){r.session.endSession();r.rejectionFunction(t)})};e.formExtensionPoint=new i.ExtensionPoint("com.ts.mobile.plugins.form.settings");return e}(t.SimpleCancellationActionDriver);t.ActionDriverForm=e})(t=i.actiondrivers||(i.actiondrivers={}))})(t=o.core||(o.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(n){var t;(function(t){var e;(function(t){var e=function(r){__extends(t,r);function t(t,e){return r.call(this,t,e)||this}t.prototype.doRunAction=function(){var e=this;this._sdk.log(n.LogLevel.Debug,"Executing information action.");var t=this._action;return this._uiHandler.getInformationResponse(t.title,t.text,t.button_text,this.policyAction(),this._clientContext).then(function(t){e._sdk.log(n.LogLevel.Debug,"Asserting information");if(t.getUserChoice()!=-1){throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"ConfirmationInput.getUserChoice must be set to -1.")}return e.sendAssertionRequest()})};return t}(t.SimpleCancellationActionDriver);t.ActionDriverInformation=e})(e=t.actiondrivers||(t.actiondrivers={}))})(t=n.core||(n.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(o){var t;(function(t){var e;(function(t){var e=function(r){__extends(n,r);function n(t,e){return r.call(this,t,e)||this}n.prototype.run=function(){var e=this;this._sdk.log(o.LogLevel.Debug,"Executing JSON data action.");return this.sendAssertionRequest().then(function(t){e._sdk.log(o.LogLevel.Debug,"Executing JSON data action: "+t);return n.handleJsonDataByUiHandler(e._uiHandler,t,t.data.json_data,e._policyAction,e._clientContext)})};n.handleJsonDataByUiHandler=function(t,e,r,n,i){return t.processJsonData(r,n,i).then(function(t){if(t.getContinueProcessing()){return e}else{throw new o.impl.AuthenticationErrorImpl(o.AuthenticationErrorCode.UserCanceled,"User cancelled a JSON action.")}})};return n}(t.ActionDriver);t.ActionDriverJsonData=e})(e=t.actiondrivers||(t.actiondrivers={}))})(t=o.core||(o.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(l){var t;(function(u){var t;(function(a){var t=function(){function t(){}return t}();a.Stragety=t;var e=function(i){__extends(t,i);function t(t,e){var r=i.call(this,t,e)||this;r.isAssertionContainerNotComplete=false;return r}t.prototype.runActionWithCompletionFunctions=function(){var o=this;this._sdk.log(l.LogLevel.Debug,"ActionDriverPromotion#runActionWithCompletionFunctions() started");this._action=this._action;if(this._action.assertions.length<1){this._sdk.log(l.LogLevel.Info,"runActionWithCompletionFunctions() Promotion has no assertions, finishing action.");this.completeWithDeclineAssertion();return}if(!this.shouldDisplayPromotion()){this._sdk.log(l.LogLevel.Info,"runActionWithCompletionFunctions() Promotion stragety stop, finishing action.");this.completeWithDeclineAssertion();return}this._session=this._uiHandler.createRegistrationPromotionSession(this._controlFlowProcessor._session.user.displayName,this._policyAction);if(!this._session){this._rejectionFunction(l.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from createRegistrationPromotionSession."));return}this._session.startSession(this._clientContext,new l.impl.PolicyActionImpl(this._action));var t=this._action.options;this._session.promptIntroduction(t.title,t.text,t.ok_button,t.decline_button).then(function(t){if(o.handlePromotionInputControlRequest(t)){var e=o._action.assertions;var r=new Array;for(var n=0;n<e.length;n++){var i=a.AuthenticationMenuAuthenticator.fromPromotionAction(e[n],o);if(i.getSupportedOnDevice()){r.push(i)}}o._authenticatorList=r;o.suggestAuthenticators()}})};t.prototype.sendAssertionRequest=function(t,e,r){var n=this;this.isAssertionContainerNotComplete=false;return i.prototype.sendAssertionRequest.call(this,t,e,r).then(function(t){if(t.assertion_error_code==u.Protocol.AssertionErrorCode.AssertionContainerNotComplete){t.assertion_error_code=undefined;n.isAssertionContainerNotComplete=true}return t})};t.prototype.suggestAuthenticators=function(t){var n=this;if(t===void 0){t=this._authenticatorList}if(this._currentAuthentictorSelected){var e=t.indexOf(this._currentAuthentictorSelected);if(e>-1){t.splice(e,1)}}this._session.setPromotedAuthenticators(t).then(function(t){if(!n.handlePromotionInputControlRequest(t)){n._sdk.log(l.LogLevel.Debug,"suggestAuthenticators() stopped by ControlRequest of type "+t.getControlRequest());return}var e=t.getSelectedAuthenticator();n._currentAuthentictorSelected=e;var r=e.authDriver;if(!n.prepareForRunningAuthenticationDriver(r)){return}e.authDriver.runRegistration().then(function(t){if(t instanceof u.authenticationdrivers.AuthenticationDriverSessionResultAuthenticationCompleted){if(n.isAssertionContainerNotComplete){n._sdk.log(l.LogLevel.Debug,"suggestAuthenticators() callback result: promotion not completed. showing list again.");n.suggestAuthenticators()}else{n._sdk.log(l.LogLevel.Debug,"suggestAuthenticators() callback result: promotion completed. finishing");n.completeAuthenticationWithAssertionResult(t.assertionResult)}}else if(t instanceof u.authenticationdrivers.AuthenticationDriverSessionResultSwitchAuthenticator){if(t.allowedAuthenticators){n._sdk.log(l.LogLevel.Debug,"suggestAuthenticators() callback result: switch authentciator with allowed authenticators called");var e=t.allowedAuthenticators;n._currentAuthentictorSelected=null;n.suggestAuthenticators(e)}else{n._sdk.log(l.LogLevel.Debug,"suggestAuthenticators() callback result: switch authentciator called");n._currentAuthentictorSelected=null;n.suggestAuthenticators()}}else{n._sdk.log(l.LogLevel.Error,"suggestAuthenticators() unexpected callback result: stopping with error.'");n.completeAuthenticationWithError(new l.impl.AuthenticationErrorImpl(l.AuthenticationErrorCode.Internal,"Unknown authentication driver result type encountered during registration."))}},function(t){n._sdk.log(l.LogLevel.Error,"suggestAuthenticators() error callback result: stopping with error. error: '"+t._data+"'");n.completeAuthenticationWithError(t)})})};t.prototype.handlePromotionInputControlRequest=function(t){if(!t.isControlRequest()){return true}else{switch(t.getControlRequest()){case l.PromotionControlRequest.Continue:return true;case l.PromotionControlRequest.Skip:this.completeWithDeclineAssertion();return false;case l.PromotionControlRequest.Abort:this.completeAuthenticationWithError(new l.impl.AuthenticationErrorImpl(l.AuthenticationErrorCode.UserCanceled,"User aborted/canceled"));return false;default:this._sdk.log(l.LogLevel.Warning,"handlePromotionInputControlRequest() received invalid PromotionInput, unsupported ControlRequest");return false}}};t.prototype.sendDeclineAssertion=function(){return this.sendAssertionRequest(t.ASSERT_DECLINE)};t.prototype.completeWithDeclineAssertion=function(){var e=this;this.sendDeclineAssertion().then(function(t){e.completeAuthenticationWithAssertionResult(t)}).catch(function(t){e.completeAuthenticationWithError(t)})};t.prototype.completeAuthenticationWithAssertionResult=function(t){if(this._session){this._session.endSession()}i.prototype.completeAuthenticationWithAssertionResult.call(this,t)};t.prototype.completeAuthenticationWithError=function(t){this._session.endSession();i.prototype.completeAuthenticationWithError.call(this,t)};Object.defineProperty(t.prototype,"availableAuthenticatorsForSwitching",{get:function(){return this.availableAuthenticators},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"availableAuthenticators",{get:function(){return this._authenticatorList.concat([])},enumerable:true,configurable:true});t.prototype.shouldDisplayPromotion=function(){var t=this._sdk.host;var e=new u.TarsusKeyPath("stragety");var r=t.readStorageKey(e);if(r.days==null||r.logins==null){this._sdk.log(l.LogLevel.Debug,"shouldDisplayPromotion() first promotion. Stored data was empty.");this.updateStrategy(e,1);return true}var n=this._action.options.strategies;var i=true;for(var o=0,a=n;o<a.length;o++){var s=a[o];if(this.checkStrategy(s,r,e)==false){this._sdk.log(l.LogLevel.Debug,"shouldDisplayPromotion() strategy stopped promotion. strategy type: "+s.type);i=false;break}}var c=r.logins+1;this.updateStrategy(e,c);return i};t.prototype.updateStrategy=function(t,e){var r={days:(new Date).getTime(),logins:e};this._sdk.host.writeStorageKey(t,r)};t.prototype.checkStrategy=function(t,e,r){var n=this._sdk.host;if(t.type==u.Protocol.PromotionStrategyFrequency.LOGINS){var i=e.logins%t.value==0;return i}else if(t.type==u.Protocol.PromotionStrategyFrequency.DAYS){var o=new Date;var a=new Date;a.setTime(e.days);var s=o.getDate()+t.value>=a.getDate();return s}return false};t.ASSERT_DECLINE="decline";t.ACTION_REGISTRATION="registration";t.ACTION_PROMOTION="registration_promotion";return t}(a.ActionDriverAuthenticatorOp);a.ActionDriverPromotion=e})(t=u.actiondrivers||(u.actiondrivers={}))})(t=l.core||(l.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(o){var t;(function(i){var t;(function(t){var e=function(r){__extends(t,r);function t(t,e){return r.call(this,t,e)||this}t.prototype.doRunAction=function(){var r=this;this._sdk.log(o.LogLevel.Debug,"Executing provision TOTP action.");this._cfmAction=this._action;var n=i.totp.TotpPropertiesProcessor.createWithUser(this._controlFlowProcessor._session.user,this._sdk);var t=n.createTotpDriver(this._cfmAction.generator,this._cfmAction.otp_type);if(!t){this._sdk.log(o.LogLevel.Error,"failed to create TOTP driver");return Promise.reject(new o.impl.AuthenticationErrorImpl(o.AuthenticationErrorCode.Internal,"failed to create TOTP driver"))}n.deleteProvisionForGenerator(this._cfmAction.generator);return t.promiseProvisionOutput(this._cfmAction,this.policyAction(),this._clientContext,this._uiHandler).then(function(e){return r.sendAssertionRequest(null,e.getAssertionData()).then(function(t){e.finalize(t);n.updateWithProvisionedGenerator(r._cfmAction,e);return t})})};return t}(t.SimpleCancellationActionDriver);t.ActionDriverProvisionTotp=e})(t=i.actiondrivers||(i.actiondrivers={}))})(t=o.core||(o.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(s){var t;(function(a){var t;(function(o){var t=function(r){__extends(t,r);function t(t,e){return r.call(this,t,e)||this}t.prototype.runActionWithCompletionFunctions=function(){var e=this;var t=this._action;this._sdk.log(s.LogLevel.Debug,"Loading and validating authenticator description");for(var r=0;r<t.assertions.length;r++){var n=o.AuthenticationMenuAuthenticator.fromRegistrationAction(t.assertions[r],this);if(n.getSupportedOnDevice()){this._registeredAuthenticator=n;this._silentRegistration=!!t.assertions[r].silent;break}}if(!this._registeredAuthenticator){this.completeAuthenticationWithError(new s.impl.AuthenticationErrorImpl(s.AuthenticationErrorCode.Internal,"No supported authenticator listed in registeration request."));return}var i=this._registeredAuthenticator.authDriver;if(!this.prepareForRunningAuthenticationDriver(i)){return}this._sdk.log(s.LogLevel.Debug,"Starting auth registeration");i.runRegistration().then(function(t){if(t instanceof a.authenticationdrivers.AuthenticationDriverSessionResultAuthenticationCompleted){e.completeAuthenticationWithAssertionResult(t.assertionResult)}else{e.completeAuthenticationWithError(new s.impl.AuthenticationErrorImpl(s.AuthenticationErrorCode.Internal,"Unknown authentication driver result type encountered during registration."))}},function(t){e._sdk.log(s.LogLevel.Debug,"Received authentication driver error "+t);e.completeAuthenticationWithError(t)})};Object.defineProperty(t.prototype,"availableAuthenticatorsForSwitching",{get:function(){return[]},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"availableAuthenticators",{get:function(){return[this._registeredAuthenticator]},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"isSilentRegistration",{get:function(){return this._silentRegistration},enumerable:true,configurable:true});return t}(o.ActionDriverAuthenticatorOp);o.ActionDriverRegistration=t})(t=a.actiondrivers||(a.actiondrivers={}))})(t=s.core||(s.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(a){var t;(function(t){var e;(function(t){var e=function(r){__extends(t,r);function t(t,e){return r.call(this,t,e)||this}t.prototype.run=function(){var o=this;this._sdk.log(a.LogLevel.Debug,"Executing scan qr action.");return new Promise(function(n,i){var t=o._action;var e=a.QrCodeFormat.Alphanumeric;if(t.qr_code_format_type){e=a.QrCodeFormatImpl.fromAssertionFormat(t.qr_code_format_type)}o._session=o._uiHandler.createScanQrSession(o._policyAction,o._clientContext);if(!o._session){throw a.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from createScanQrSession.")}o._session.startSession(o._clientContext,new a.impl.PolicyActionImpl(o._action));o._session.getScanQrResponse(t.instructions,e).then(function(t){if(t.isControlRequest()){return o.processControlRequest(t.getControlRequest()).then(function(){})}else{var e=t.getResponse();var r={qr_content:e.getQrCodeResult().getQrCode()};o._sdk.log(a.LogLevel.Debug,"Asserting scan qr: "+r.qr_content);o.sendAssertionRequest(null,r).then(function(t){n(t)}).catch(function(t){o._sdk.log(a.LogLevel.Error,"Scan qr sendAssertionRequest error: "+t);o._session.endSession();i(t)})}}).finally(function(){o._session.endSession()}).catch(function(t){o._sdk.log(a.LogLevel.Error,"Scan qr action error: "+t);i(t)})})};t.prototype.processControlRequest=function(r){var n=this;return new Promise(function(t,e){n._sdk.log(a.LogLevel.Debug,"Processing control request "+r.getRequestType());switch(r.getRequestType()){case a.ControlRequestType.CancelAuthenticator:e(new a.impl.AuthenticationErrorImpl(a.AuthenticationErrorCode.UserCanceled,"Scan qr code action canceled by user."));break;default:throw new a.impl.AuthenticationErrorImpl(a.AuthenticationErrorCode.AppImplementation,"Unsupported control request: "+r.getRequestType()+" for scan qr action.")}})};return t}(t.ActionDriver);t.ActionDriverScanQr=e})(e=t.actiondrivers||(t.actiondrivers={}))})(t=a.core||(a.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(a){var t;(function(t){var e;(function(t){var e=function(r){__extends(i,r);function i(t,e){return r.call(this,t,e)||this}i.augmentAssertionDataWithSignedContent=function(n,t,e,r){var i=JSON.stringify(t);r.log(a.LogLevel.Debug,"Signing consent payload: "+i);var o=a.util.asciiToHex(i);return e.signHex(o).then(function(t){var e=a.util.hexToBase64(t);var r={payload:i,signed_payload:e};n.sign_content_data=r;return n})};i.prototype.run=function(){var e=this;this._sdk.log(a.LogLevel.Debug,"Executing consent action.");var t=this._controlFlowProcessor.initiatingRequest.body;var r={params:t.params||{}};var n=this._controlFlowProcessor.approval;if(n){r.approval={approval_id:n.getApprovalId(),message:{title:n.getTitle(),details:n.getDetails()}}}return i.augmentAssertionDataWithSignedContent({},r,this._controlFlowProcessor._session.deviceSigningKeyPair,this._sdk).then(function(t){return e.sendAssertionRequest(null,t)})};return i}(t.ActionDriver);t.ActionDriverSignContent=e})(e=t.actiondrivers||(t.actiondrivers={}))})(t=a.core||(a.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(i){var t;(function(t){var e;(function(t){var e=function(r){__extends(t,r);function t(t,e){return r.call(this,t,e)||this}t.prototype.doRunAction=function(){var n=this;this._sdk.log(i.LogLevel.Debug,"Executing ticket wait action.");return new Promise(function(e,r){var t=n._action;n._session=n._uiHandler.createTicketWaitSession(n._policyAction,n._clientContext);if(!n._session){throw i.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from createTicketWaitSession.")}n._session.setWaitingTicket(new i.impl.TicketWaitingInformationImpl(t));n._session.startSession(new i.impl.PolicyActionImpl(n._action),n._clientContext);n.pollServer().then(function(t){e(t)}).finally(function(){n._session.endSession()}).catch(function(t){n._sdk.log(i.LogLevel.Error,"Wait for ticket action error: "+t);r(t)})})};t.prototype.pollServer=function(){var e=this;var t={};this._sdk.log(i.LogLevel.Debug,"Asserting ticket wait poll");return this.sendAssertionRequest(null,t).then(function(t){if(t.assertion_error_code==13){return e.inputLoop(t)}else{return t}})};t.prototype.inputLoop=function(r){var n=this;return this._session.promiseInput().then(function(t){if(t.isControlRequest()){return n.processControlRequest(t.getControlRequest()).then(function(){return r})}else{var e=t.getResponse();if(e instanceof i.TicketWaitInputPollRequest){return n.pollServer()}else{throw new i.impl.AuthenticationErrorImpl(i.AuthenticationErrorCode.AppImplementation,"Expected polling request input response but got: "+e)}}})};t.prototype.processControlRequest=function(r){var n=this;return new Promise(function(t,e){n._sdk.log(i.LogLevel.Debug,"Processing control request "+r.getRequestType());switch(r.getRequestType()){case i.ControlRequestType.CancelAuthenticator:case i.ControlRequestType.AbortAuthentication:e(new i.impl.AuthenticationErrorImpl(i.AuthenticationErrorCode.UserCanceled,"Wait for ticket action canceled by user."));break;default:throw new i.impl.AuthenticationErrorImpl(i.AuthenticationErrorCode.AppImplementation,"Unsupported control request: "+r.getRequestType()+" for ticket wait action.")}})};return t}(t.SimpleCancellationActionDriver);t.ActionDriverTicketWait=e})(e=t.actiondrivers||(t.actiondrivers={}))})(t=i.core||(i.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(n){var t;(function(t){var e;(function(e){var t=function(r){__extends(t,r);function t(t,e){return r.call(this,t,e)||this}t.prototype.runActionWithCompletionFunctions=function(){this._action=this._action;this._sdk.log(n.LogLevel.Debug,"Started unregister action!");var t=e.AuthenticationMenuAuthenticator.fromUnregistrationAction(this._action,this);t.authDriver.runUnregistration().then(this._completionFunction,this._rejectionFunction)};Object.defineProperty(t.prototype,"availableAuthenticators",{get:function(){return this._availableAuthenticators.concat([])},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"isSilentRegistration",{get:function(){return false},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"isPlaceholder",{get:function(){return this._action.method.indexOf("placeholder")==0},enumerable:true,configurable:true});t.prototype.sendUnregisterAssertion=function(){return this.sendAssertionRequest()};return t}(e.ActionDriverAuthenticatorOp);e.ActionDriverUnregistration=t})(e=t.actiondrivers||(t.actiondrivers={}))})(t=n.core||(n.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(o){var t;(function(i){var t;(function(t){var e;(function(r){var t;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.run=function(){var n=this;if(this._sdk.host.queryHostInfo(o.sdkhost.HostInformationKey.DyadicPresent)=="false"){return Promise.reject(new i.impl.AuthenticationErrorImpl(i.AuthenticationErrorCode.Internal,"Dyadic capability is not present (is Dyadic SDK integrated?)"))}return this.issueDyadicRequest().then(function(r){return n.sendAssertionRequest(null,n.buildAssertionData(r)).then(function(e){var t=n.dyadicServerResponseFromAssertionResponse(e);if(!t){return Promise.reject(new i.impl.AuthenticationErrorImpl(i.AuthenticationErrorCode.Internal,"Dyadic data missing from server response"))}return r.finalize(t).then(function(t){return e})})})};e.prototype.dyadicServerResponseFromAssertionResponse=function(t){var e=t.data&&t.data.dyadic;return e&&e.server_response};e.prototype.buildAssertionData=function(t){var n={requestData:"request_data",requestPayload:"request_payload",proxyPayload:"proxy_payload"};var i=t.getServerRequest();Object.keys(n).forEach(function(t){var e=n[t];i[e]=i[t];delete i[t];var r=i[e];if(r){r["original_data"]=r["originalData"];delete r["originalData"]}});var e={dyadic:i};e.dyadic.token_uid=t.getTokenId()||this._controlFlowProcessor._session.deviceId();return e};return e}(r.ActionDriver);t.ActionDriverDyadic=e})(t=r.dyadic||(r.dyadic={}))})(e=t.actiondrivers||(t.actiondrivers={}))})(t=i.core||(i.core={}))})(t=o.sdk||(o.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.issueDyadicRequest=function(){var t=this._action;var e=this._controlFlowProcessor._session.user.guid.toString();return this._sdk.host.dyadicEnroll(e,t.server_info)};return e}(t.ActionDriverDyadic);t.ActionDriverDyadicEnroll=e})(e=t.dyadic||(t.dyadic={}))})(e=t.actiondrivers||(t.actiondrivers={}))})(e=t.core||(t.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e;(function(t){var e;(function(t){var a=function(){function i(){}i.prototype.getServerRequest=function(){return this._serverRequest};i.prototype.getTokenId=function(){return this._signHandle.getTokenId()};i.prototype.finalize=function(t){var r=this;var n=t;var i=this._signHandle.finalize(n.server_response);if(n.otp_token_refresh){Object.keys(n.otp_token_refresh).forEach(function(e){i=i.then(function(t){return r._refreshTokenHandles[e].finalize(n.otp_token_refresh[e])})})}return i};i.create=function(t,e,r){var n=new i;n._refreshTokenHandles=t;n._signHandle=e;n._serverRequest=r;return n};return i}();var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.issueDyadicRequest=function(){var i=this;var o=this._action;var t=r.util.asciiToHex(o.assertion_id+this._controlFlowProcessor.challenge);return this._sdk.host.dyadicSign(t).then(function(e){var r={};var n=e.getServerRequest();var t=Promise.resolve(true);if(o.otp_token_uids&&0<o.otp_token_uids.length){n.otp_token_refresh={};o.otp_token_uids.forEach(function(e){t=t.then(function(t){return i._sdk.host.dyadicRefreshToken(e).then(function(t){r[e]=t;n.otp_token_refresh[e]=t.getServerRequest();return true})})})}return t.then(function(t){return a.create(r,e,n)})})};e.prototype.dyadicServerResponseFromAssertionResponse=function(t){return t.data&&t.data.dyadic};return e}(t.ActionDriverDyadic);t.ActionDriverDyadicSign=e})(e=t.dyadic||(t.dyadic={}))})(e=t.actiondrivers||(t.actiondrivers={}))})(t=r.core||(r.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.issueDyadicRequest=function(){return this._sdk.host.dyadicDelete()};return e}(t.ActionDriverDyadic);t.ActionDriverDyadicDelete=e})(e=t.dyadic||(t.dyadic={}))})(e=t.actiondrivers||(t.actiondrivers={}))})(e=t.core||(t.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){t.ActionDrivers={confirmation:t.ActionDriverConfirmation,information:t.ActionDriverInformation,json_data:t.ActionDriverJsonData,authentication:t.ActionDriverAuthentication,registration:t.ActionDriverRegistration,unregistration:t.ActionDriverUnregistration,provision_totp:t.ActionDriverProvisionTotp,disable_totp:t.ActionDriverDisableTotp,sign_content:t.ActionDriverSignContent,form:t.ActionDriverForm,registration_promotion:t.ActionDriverPromotion,scan_qr:t.ActionDriverScanQr,wait_for_ticket:t.ActionDriverTicketWait,dyadic_enroll:t.dyadic.ActionDriverDyadicEnroll,dyadic_sign:t.dyadic.ActionDriverDyadicSign,dyadic_un_enroll:t.dyadic.ActionDriverDyadicDelete}})(e=t.actiondrivers||(t.actiondrivers={}))})(e=t.core||(t.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(c){var t;(function(s){var t;(function(a){var t;(function(o){var t=function(){function t(t,e,r){this._externalCancelled=false;this._actionDriver=t;this._authenticatorConfig=e;this._authenticatorDescription=r;this._sdk=t._sdk;this._uiHandler=t._uiHandler;this._clientContext=t._clientContext}t.prototype.runAuthentication=function(t){this._authenticationParameters=t;return this.runMode(s.AuthenticatorSessionMode.Authentication)};t.prototype.runRegistration=function(){var t=this._actionDriver;if(t.isSilentRegistration){var e=this;if(o.instanceOfAuthenticationDriverSilentRegistrationSupport(this)){e._sdk.log(s.LogLevel.Debug,"Invoking silent registration for "+e._authenticatorDescription.getAuthenticatorId());return this.runSilentRegistration()}else{return Promise.reject(new s.impl.AuthenticationErrorImpl(s.AuthenticationErrorCode.AuthenticatorError,"Silent registration not supported for this authenticator"))}}else{return this.runMode(s.AuthenticatorSessionMode.Registration)}};t.prototype.runUnregistration=function(){var r=this;var n=this._actionDriver;return this._sdk.currentUiHandler.handleAuthenticatorUnregistration(this._authenticatorDescription,n.isPlaceholder,n.policyAction(),this._clientContext).then(function(t){r._sdk.log(s.LogLevel.Debug,"handleAuthenticatorUnregistration() result: "+t);if(t.getUserChoice()==0){return n.sendUnregisterAssertion().then(function(t){r.handleUnregistrationAssertionResult(t);return t})}else{var e=new s.impl.AuthenticationErrorImpl(s.AuthenticationErrorCode.AppImplementation,"Unregistration failed due to app implementation rejecting unregistertion.");return Promise.reject(e)}})};t.prototype.onCancelRun=function(){this._externalCancelled=true};Object.defineProperty(t.prototype,"user",{get:function(){return this._actionDriver._controlFlowProcessor._session.user},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"operationMode",{get:function(){return this._operationMode},enumerable:true,configurable:true});t.prototype.completeAuthenticatorSessionWithResult=function(t){if(this._inputSession){this._inputSession.endSession()}this._completionFunction(t)};t.prototype.completeAuthenticatorSessionWithError=function(t){if(this._inputSession){try{this._inputSession.endSession()}catch(t){this._sdk.log(s.LogLevel.Warning,"Can't dismiss authenticator session during error reporting.")}}this._rejectionFunction(t)};t.prototype.handleInputOrControlResponse=function(t){try{if(t.isControlRequest()){this.processControlRequest(t.getControlRequest())}else{if(this._operationMode==s.AuthenticatorSessionMode.Authentication){this.handleAuthenticationInputResponse(t.getResponse())}else{this.handleRegistrationInputResponse(t.getResponse())}}}catch(t){this.performErrorRecoveryForError(s.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))}};t.prototype.processRegisterAssertion=function(t,e){var r=this;this._actionDriver.sendAuthenticatorAssertionRequest(this._authenticatorDescription,"register",t,e).then(function(t){if(!r.handleRegisterAssertionResult(t)){r._sdk.log(s.LogLevel.Info,"Registration session done.");r.completeAuthenticatorSessionWithResult(new o.AuthenticationDriverSessionResultAuthenticationCompleted(t))}}).catch(function(t){r._sdk.log(s.LogLevel.Error,"Perform error recovery with server error "+t);r.performErrorRecoveryForError(t)})};t.prototype.processAuthenticateAssertion=function(t,e){var r=this;this._actionDriver.sendAuthenticatorAssertionRequest(this._authenticatorDescription,"authenticate",t,e).then(function(t){if(!r.handleAuthenticateAssertionResult(t)){r._sdk.log(s.LogLevel.Info,"Authenticator session done.");r.completeAuthenticatorSessionWithResult(new o.AuthenticationDriverSessionResultAuthenticationCompleted(t))}}).catch(function(t){r._sdk.log(s.LogLevel.Error,"Perform error recovery with server error "+t);r.performErrorRecoveryForError(t)})};t.prototype.runMode=function(r){var n=this;return new Promise(function(t,e){n._completionFunction=t;n._rejectionFunction=e;n._operationMode=r;n._inputSession=n.createAuthenticatorSession();if(!n._inputSession){throw s.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from authenticator session creation call.")}n._inputSession.startSession(n._authenticatorDescription,n._operationMode,n._actionDriver.policyAction(),n._clientContext);n.authOrRegInStartedSession(false)}).catch(function(t){throw s.impl.AuthenticationErrorImpl.ensureAuthenticationError(t)})};t.prototype.handleGeneralAssertionResult=function(t){this._sdk.log(s.LogLevel.Debug,"Authenticator assertion response "+JSON.stringify(t));if(t.data){this._sdk.log(s.LogLevel.Debug,"Processing authenticator assertion response: updating assertion authenticator description");this._authenticatorDescription.updateWithAssertionResult(t.data)}if(t.state!=a.Protocol.AuthSessionState.Pending){this._sdk.log(s.LogLevel.Info,"Authenticator session complete; status "+t.state);this.completeAuthenticatorSessionWithResult(new o.AuthenticationDriverSessionResultAuthenticationCompleted(t));return true}return false};t.prototype.handleUnregistrationAssertionResult=function(t){};t.prototype.handleRegisterAssertionResult=function(t){if(this.handleGeneralAssertionResult(t)){return true}if(!t.assertion_error_code){return false}this._sdk.log(s.LogLevel.Error,"handleRegisterAssertionResult() Assertion error encoutered. Starting error recovery.");this.performErrorRecoveryForError(s.impl.AuthenticationErrorImpl.errorForAssertionResponse(t));return true};t.prototype.handleAuthenticateAssertionResult=function(t){if(this.handleGeneralAssertionResult(t)){return true}if(t.assertion_error_code){switch(t.assertion_error_code){case a.Protocol.AssertionErrorCode.MustRegister:this._sdk.log(s.LogLevel.Info,"handleAuthenticateAssertionResult() Authenticator expired; must register");this.handleRegistrationDueToExpiration();return true;case a.Protocol.AssertionErrorCode.FailOver:this._sdk.log(s.LogLevel.Info,"handleAuthenticateAssertionResult() Failover signalled");this.handleFallback();return true;default:this._sdk.log(s.LogLevel.Error,"handleAuthenticateAssertionResult() Assertion error encoutered. Starting error recovery. 2");this.performErrorRecoveryForError(s.impl.AuthenticationErrorImpl.errorForAssertionResponse(t));return true}}else if(this._authenticatorDescription.getExpired()){this._sdk.log(s.LogLevel.Info,"Authenticator expired; must register");this.handleRegistrationDueToExpiration();return true}return false};t.prototype.processAuthFailureAssertionAndHandleError=function(n,t){var i=this;var e={num_of_failures:t};this._actionDriver.sendAuthenticatorAssertionRequest(this._authenticatorDescription,"auth_failure",e).then(function(t){if(i.handleGeneralAssertionResult(t)){return}if(t.assertion_error_code){switch(t.assertion_error_code){case a.Protocol.AssertionErrorCode.FailOver:i._sdk.log(s.LogLevel.Info,"Failover signalled during local failure report");i.handleFallback();return true}}if(t.data){var e={};for(var r in n.getData()){e[r]=n.getData()[r]}for(var r in t.data){e[r]=t.data[r]}n=new s.impl.AuthenticationErrorImpl(n.getErrorCode(),n.getMessage(),e)}i.performErrorRecoveryForError(n)},function(t){var e=s.impl.AuthenticationErrorImpl.ensureAuthenticationError(t);i._sdk.log(s.LogLevel.Error,"Error ${authError} signalled during local failure report");i.performErrorRecoveryForError(e,true)})};t.prototype.handleRegistrationDueToExpiration=function(){this._inputSession.changeSessionModeToRegistrationAfterExpiration();this._operationMode=s.AuthenticatorSessionMode.Registration;this.registerInStartedSession(false)};t.prototype.authOrRegInStartedSession=function(t){if(this._operationMode==s.AuthenticatorSessionMode.Authentication){this.authenticateInStartedSession(t)}else{this.registerInStartedSession(t)}};t.prototype.processControlRequest=function(t){this._sdk.log(s.LogLevel.Debug,"Processing control request "+t.getRequestType());switch(t.getRequestType()){case s.ControlRequestType.AbortAuthentication:this.completeAuthenticatorSessionWithError(new s.impl.AuthenticationErrorImpl(s.AuthenticationErrorCode.UserCanceled,"Authentication cancelled due to abort control request."));break;case s.ControlRequestType.ChangeMethod:this.completeAuthenticatorSessionWithResult(new o.AuthenticationDriverSessionResultSwitchAuthenticator(null,this.getAuthenticationActionOtherAuthenticators()));break;case s.ControlRequestType.SelectMethod:this.completeAuthenticatorSessionWithResult(new o.AuthenticationDriverSessionResultSwitchAuthenticator);break;case s.ControlRequestType.CancelAuthenticator:this.invokeUiHandlerCancellation();break;case s.ControlRequestType.RetryAuthenticator:this.authOrRegInStartedSession(true);break;default:this.completeAuthenticatorSessionWithError(new s.impl.AuthenticationErrorImpl(s.AuthenticationErrorCode.Internal,"Invalid ControlRequestType value during authentication session."));break}};t.prototype.invokeUiHandlerCancellation=function(){var e=this;if(this._externalCancelled){this.processControlRequest(s.ControlRequest.create(s.ControlRequestType.AbortAuthentication));return}var r=[s.ControlRequestType.RetryAuthenticator,s.ControlRequestType.AbortAuthentication];if(this.getAuthenticationActionOtherAuthenticators().length>0){r.push(s.ControlRequestType.ChangeMethod)}if(this._actionDriver.availableAuthenticatorsForSwitching.length>0){r.push(s.ControlRequestType.SelectMethod)}this._uiHandler.controlOptionForCancellationRequestInSession(r,this._inputSession).then(function(t){if(t.getRequestType()==s.ControlRequestType.CancelAuthenticator){e.completeAuthenticatorSessionWithError(new s.impl.AuthenticationErrorImpl(s.AuthenticationErrorCode.AppImplementation,"controlOptionForCancellationRequestInSession returned CancelAuthenticator which is an invalid option."));return}if(r.indexOf(t.getRequestType())<0){e.completeAuthenticatorSessionWithError(new s.impl.AuthenticationErrorImpl(s.AuthenticationErrorCode.AppImplementation,"controlOptionForCancellationRequestInSession returned an invalid option."));return}e.processControlRequest(t)})};t.prototype.getAuthenticationActionOtherAuthenticators=function(){var e=this;return this._actionDriver.availableAuthenticatorsForSwitching.filter(function(t){return t!=e._authenticatorDescription})};t.prototype.handleFallback=function(){var e=this;if(!this._authenticatorDescription.fallback){this.completeAuthenticatorSessionWithError(new s.impl.AuthenticationErrorImpl(s.AuthenticationErrorCode.Internal,"Cannot handle a fallback error without fallback specification in action."))}else{var r=[s.AuthenticatorFallbackAction.Retry,s.AuthenticatorFallbackAction.Cancel];var n=null;var i=this._authenticatorDescription.fallback.method;if(i){n=this._actionDriver.availableAuthenticators.filter(function(t){return t.getAuthenticatorId()==i})[0];if(n){r.push(s.AuthenticatorFallbackAction.Fallback)}}else{if(this.getAuthenticationActionOtherAuthenticators().length>0){r.push(s.AuthenticatorFallbackAction.AuthMenu)}}this._uiHandler.selectAuthenticatorFallbackAction(r,n,this._inputSession,this._actionDriver.policyAction(),this._clientContext).then(function(t){e._sdk.log(s.LogLevel.Debug,"Fallback action selected "+t);if(r.indexOf(t)<0){e._sdk.log(s.LogLevel.Error,"Invalid fallback action selected: "+t+" not in "+r);e.completeAuthenticatorSessionWithError(new s.impl.AuthenticationErrorImpl(s.AuthenticationErrorCode.AppImplementation,"Invalid fallback action selected by callback."))}switch(t){case s.AuthenticatorFallbackAction.Fallback:e.completeAuthenticatorSessionWithResult(new o.AuthenticationDriverSessionResultSwitchAuthenticator(n));break;case s.AuthenticatorFallbackAction.AuthMenu:e.completeAuthenticatorSessionWithResult(new o.AuthenticationDriverSessionResultSwitchAuthenticator(n));break;case s.AuthenticatorFallbackAction.Retry:e.authOrRegInStartedSession(true);break;case s.AuthenticatorFallbackAction.Cancel:e.completeAuthenticatorSessionWithError(new s.impl.AuthenticationErrorImpl(s.AuthenticationErrorCode.UserCanceled,"User cancel in response to fallback action."));break}})}};t.prototype.recoveryOptionsForError=function(t,e){var r=[s.AuthenticationErrorRecovery.Fail];if([s.AuthenticationErrorCode.AllAuthenticatorsLocked,s.AuthenticationErrorCode.AppImplementation,s.AuthenticationErrorCode.ControlFlowExpired,s.AuthenticationErrorCode.SessionRequired,s.AuthenticationErrorCode.InvalidDeviceBinding,s.AuthenticationErrorCode.UserCanceled].indexOf(t.getErrorCode())>=0){return r}if(!e&&this._authenticatorDescription.getEnabled()&&!(this._operationMode==s.AuthenticatorSessionMode.Authentication&&t.getErrorCode()==s.AuthenticationErrorCode.AuthenticatorExternalConfigError)){r.push(s.AuthenticationErrorRecovery.RetryAuthenticator)}if(this.getAuthenticationActionOtherAuthenticators().length>0){r.push(s.AuthenticationErrorRecovery.ChangeAuthenticator)}if(this._actionDriver.availableAuthenticatorsForSwitching.length>0){r.push(s.AuthenticationErrorRecovery.SelectAuthenticator)}return r};t.prototype.performErrorRecoveryForError=function(e,t){var r=this;var n={};n[c.sdkhost.ErrorDataRetriesLeft]=this._authenticatorDescription.retriesLeft;var i=s.impl.AuthenticationErrorImpl.augmentErrorData(e,n);var o=this.recoveryOptionsForError(e,t);var a=this.defaultRecoveryForError(e);if(o.indexOf(a)<0){a=o.indexOf(s.AuthenticationErrorRecovery.SelectAuthenticator)>=0?s.AuthenticationErrorRecovery.SelectAuthenticator:s.AuthenticationErrorRecovery.Fail}this._inputSession.promiseRecoveryForError(e,o,a).then(function(t){r._sdk.log(s.LogLevel.Debug,"Error recovery selected "+t);r._sdk.log(s.LogLevel.Debug,"recover from error: "+e.getErrorCode());if(o.indexOf(t)<0){r._sdk.log(s.LogLevel.Error,"Invalid error recovery option from callback: "+t+" not in "+o);r.completeAuthenticatorSessionWithError(new s.impl.AuthenticationErrorImpl(s.AuthenticationErrorCode.AppImplementation,"Invalid error recovery action selected by callback."))}r.handleErrorRecoveryAction(t,e)})};t.prototype.handleErrorRecoveryAction=function(t,e){switch(t){case s.AuthenticationErrorRecovery.RetryAuthenticator:this.authOrRegInStartedSession(true);break;case s.AuthenticationErrorRecovery.ChangeAuthenticator:this.completeAuthenticatorSessionWithResult(new o.AuthenticationDriverSessionResultSwitchAuthenticator(null,this.getAuthenticationActionOtherAuthenticators()));break;case s.AuthenticationErrorRecovery.SelectAuthenticator:this.completeAuthenticatorSessionWithResult(new o.AuthenticationDriverSessionResultSwitchAuthenticator);break;case s.AuthenticationErrorRecovery.Fail:default:this.completeAuthenticatorSessionWithError(e);break}};t.prototype.defaultRecoveryForError=function(t){if(this._operationMode==s.AuthenticatorSessionMode.Authentication){if(!this._authenticatorDescription.getLocked()&&this._authenticatorDescription.getRegistered()&&this._authenticatorDescription.getEnabled()&&t.getErrorCode()!=s.AuthenticationErrorCode.AuthenticatorLocked&&t.getErrorCode()!=s.AuthenticationErrorCode.AllAuthenticatorsLocked){return s.AuthenticationErrorRecovery.RetryAuthenticator}else if(t.getErrorCode()!=s.AuthenticationErrorCode.AllAuthenticatorsLocked){return s.AuthenticationErrorRecovery.ChangeAuthenticator}else{return s.AuthenticationErrorRecovery.Fail}}else{return s.AuthenticationErrorRecovery.RetryAuthenticator}};return t}();o.AuthenticationDriver=t})(t=a.authenticationdrivers||(a.authenticationdrivers={}))})(t=s.core||(s.core={}))})(t=c.sdk||(c.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e;(function(t){var e=function(n){__extends(t,n);function t(t,e,r){return n.call(this,t,e,r)||this}t.prototype.authenticateInStartedSession=function(t){var e=this;this._inputSession.promiseInput().then(function(t){return e.handleInputOrControlResponse(t)},function(t){return e.completeAuthenticatorSessionWithError(r.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})};t.prototype.registerInStartedSession=function(t){var e=this;this._inputSession.promiseInput().then(function(t){return e.handleInputOrControlResponse(t)},function(t){return e.completeAuthenticatorSessionWithError(r.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})};t.prototype.handleAuthenticationInputResponse=function(t){try{var e=this.generateAssertionDataForInputResponse(t)}catch(t){this.performErrorRecoveryForError(r.impl.AuthenticationErrorImpl.ensureAuthenticationError(t));return}this.processAuthenticateAssertion(this.generateAssertionDataForInputResponse(t))};t.prototype.handleRegistrationInputResponse=function(t){try{var e=this.generateAssertionDataForInputResponse(t)}catch(t){this.performErrorRecoveryForError(r.impl.AuthenticationErrorImpl.ensureAuthenticationError(t));return}this.processRegisterAssertion(e)};t.prototype.generateAssertionDataForInputResponse=function(t){var e=this.generateSecretToSignForInputResponse(t);return{secret:e}};return t}(t.AuthenticationDriver);t.AuthenticationDriverCentralizedSecretInputBased=e})(e=t.authenticationdrivers||(t.authenticationdrivers={}))})(t=r.core||(r.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e;(function(s){var t=function(){function t(t){this._authenticationDriverCtor=t}t.prototype.createAuthenticationDriver=function(t,e,r){return new this._authenticationDriverCtor(t,e,r)};t.prototype.evaluateLocalRegistrationStatus=function(t){return r.AuthenticatorRegistrationStatus.Registered};t.prototype.isSupportedOnDevice=function(t){return true};t.prototype.suggestParameters=function(t,e){return[]};t.refreshInvalidatedAuthenticatorsEnrollments=function(a){return new Promise(function(e,r){var t;var n=new Array;for(var i in a.user.localEnrollments){t=a.user.localEnrollments[i];var o=s.AuthenticatorDrivers[t.authenticatorId];n.push(o.checkAuthenticatorInvalidatedAndNotifyUIHandler(a))}Promise.all(n).then(function(t){e(t)}).catch(function(t){r(t)})})};t.prototype.checkAuthenticatorInvalidatedAndNotifyUIHandler=function(t){return Promise.resolve(true)};return t}();s.SimpleAuthenticationDriverDescriptor=t})(e=t.authenticationdrivers||(t.authenticationdrivers={}))})(t=r.core||(r.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(l){var t;(function(u){var t;(function(s){var c=function(t){__extends(i,t);function i(){return t!==null&&t.apply(this,arguments)||this}i.prototype.getEnabled=function(){return this.getSupportedOnDevice()};i.getDescription=function(t,e){var r={status:u.Protocol.AuthenticationMethodStatus.Unregistered};var n=new i(t,e,{},r);return n};return i}(s.AuthenticatorDescriptionImpl);var t=function(n){__extends(t,n);function t(t,e){var r=n.call(this,t)||this;r._authenticatorType=e;return r}t.prototype.evaluateLocalRegistrationStatus=function(t){var e=t.user.localEnrollments[this._authenticatorType];if(!e){return l.AuthenticatorRegistrationStatus.LocallyInvalid}if(e.validationStatus==u.LocalEnrollmentValidationStatus.Invalidated){return l.AuthenticatorRegistrationStatus.LocallyInvalid}return l.AuthenticatorRegistrationStatus.Registered};t.prototype.checkAuthenticatorInvalidatedAndNotifyUIHandler=function(o){var a=this;return new Promise(function(e,r){o.sdk.log(l.LogLevel.Info,"Checking if authenticator "+a._authenticatorType+" has become invalidated.");var t=o.user.localEnrollments[a._authenticatorType];if(t.status==u.LocalEnrollmentStatus.Registered&&t.validationStatus!=u.LocalEnrollmentValidationStatus.Invalidated){var n=s.AuthenticatorDrivers[a._authenticatorType];if(n.evaluateLocalRegistrationStatus(o)==l.AuthenticatorRegistrationStatus.LocallyInvalid){o.sdk.log(l.LogLevel.Info,"Authenticator "+a._authenticatorType+" already became invalidated. Invalidating enrollment record and notifying ui handler.");var i=c.getDescription(o,t.authenticatorId);u.LocalEnrollment.invalidateLocalRegistrationStatusAndNotifyUIHandler(o,i).then(function(t){e(t)}).catch(function(t){r(t)})}else{e(false)}}else{e(false)}})};return t}(s.SimpleAuthenticationDriverDescriptor);s.AuthenticationDriverDescriptorLocal=t})(t=u.authenticationdrivers||(u.authenticationdrivers={}))})(t=l.core||(l.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(n){var t;(function(t){var e;(function(t){var e;(function(r){var t=function(t){__extends(e,t);function e(){return t.call(this,r.AuthenticationDriverFace)||this}e.prototype.isSupportedOnDevice=function(t){return t.sdk.host.queryHostInfo(n.sdkhost.HostInformationKey.ImageAcquitisionSupported)=="true"};return e}(r.SimpleAuthenticationDriverDescriptor);r.AuthenticationDriverDescriptorFace=t})(e=t.authenticationdrivers||(t.authenticationdrivers={}))})(e=t.core||(t.core={}))})(t=n.sdk||(n.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(i){var t;(function(t){var e;(function(n){var t=function(r){__extends(t,r);function t(t){var e=r.call(this,n.AuthenticationDriverFido)||this;e._fidoPolicy=t;return e}t.prototype.isSupportedOnDevice=function(t){t.sdk.log(i.LogLevel.Debug,"Check FIDO authenticator support for "+JSON.stringify(this._fidoPolicy));var e=n.AuthenticationDriverFido.hasEligibleClientProvidersForPolicy(t.sdk,this._fidoPolicy);if(!e){t.sdk.log(i.LogLevel.Info,"Encountered non-supported FIDO request.")}return e};t.prototype.evaluateLocalRegistrationStatus=function(t){return i.AuthenticatorRegistrationStatus.Registered};return t}(n.SimpleAuthenticationDriverDescriptor);n.AuthenticationDriverDescriptorFido=t})(e=t.authenticationdrivers||(t.authenticationdrivers={}))})(t=i.core||(i.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(t.SimpleAuthenticationDriverDescriptor);t.AuthenticationDriverDescriptorFido2=e})(e=t.authenticationdrivers||(t.authenticationdrivers={}))})(e=t.core||(t.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(u){var t;(function(c){var t;(function(t){var e;(function(s){var t=function(o){__extends(a,o);function a(){return o.call(this,s.AuthenticationDriverFingerprint,a.authenticatorName)||this}a.prototype.evaluateLocalRegistrationStatus=function(t){var e=o.prototype.evaluateLocalRegistrationStatus.call(this,t);if(e!=c.AuthenticatorRegistrationStatus.Registered){return e}var r=t.user.localEnrollments[a.authenticatorName];var n=s.AuthenticationDriverFingerprint.authenticatorKeyTagForUser(t.user,r.version,r.salt);var i=t.sdk.host.getKeyPair(n,u.sdkhost.KeyClass.StdSigningKey,u.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb);if(!i){return c.AuthenticatorRegistrationStatus.LocallyInvalid}else{i.closeKeyPair()}return c.AuthenticatorRegistrationStatus.Registered};a.prototype.isSupportedOnDevice=function(t){return t.sdk.host.queryHostInfo(u.sdkhost.HostInformationKey.FingerprintSupported)=="true"};a.authenticatorName="fingerprint";return a}(s.AuthenticationDriverDescriptorLocal);s.AuthenticationDriverDescriptorFingerprint=t})(e=t.authenticationdrivers||(t.authenticationdrivers={}))})(t=c.core||(c.core={}))})(t=u.sdk||(u.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(o){var t;(function(t){var e;(function(n){var i=function(){function t(t,e){this._targetIdentifier=t;this._description=e.describe();this._deviceDetails=e}t.prototype.getDescription=function(){return this._description};t.prototype.getDeviceIdentifier=function(){return this._targetIdentifier};t.prototype.getDeviceDetails=function(){return this._deviceDetails};t.__tarsusInterfaceName="MobileApproveTarget";return t}();n.MobileApproveTargetImpl=i;var t=function(){function r(){}r.prototype.evaluateLocalRegistrationStatus=function(t){return o.AuthenticatorRegistrationStatus.Registered};r.prototype.isSupportedOnDevice=function(t){return true};r.prototype.suggestParameters=function(t,e){return r.createTargetsFromConfig(t).map(function(t){return o.AuthenticationActionParameterTargetSelection.create(t)})};r.prototype.createAuthenticationDriver=function(t,e,r){return new n.AuthenticationDriverMobileApprove(t,e,r)};r.createTargetsFromConfig=function(t){var e=t;return e.selectable_devices.map(function(t,e){var r=o.TargetDeviceDetailsImpl.fromServerFormat(t);return new i(t.device_id,r)})};r.prototype.checkAuthenticatorInvalidatedAndNotifyUIHandler=function(t){return Promise.resolve(true)};return r}();n.AuthenticationDriverDescriptorMobileApprove=t})(e=t.authenticationdrivers||(t.authenticationdrivers={}))})(t=o.core||(o.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(u){var t;(function(c){var t;(function(t){var e;(function(s){var t=function(o){__extends(a,o);function a(){return o.call(this,s.AuthenticationDriverNativeFace,a.authenticatorName)||this}a.prototype.evaluateLocalRegistrationStatus=function(t){var e=o.prototype.evaluateLocalRegistrationStatus.call(this,t);if(e!=c.AuthenticatorRegistrationStatus.Registered){return e}var r=t.user.localEnrollments[a.authenticatorName];var n=s.AuthenticationDriverNativeFace.authenticatorKeyTagForUser(t.user,r.version,r.salt);var i=t.sdk.host.getKeyPair(n,u.sdkhost.KeyClass.StdSigningKey,u.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb);if(!i){return c.AuthenticatorRegistrationStatus.LocallyInvalid}else{i.closeKeyPair()}return c.AuthenticatorRegistrationStatus.Registered};a.prototype.isSupportedOnDevice=function(t){return t.sdk.host.queryHostInfo(u.sdkhost.HostInformationKey.FaceIdKeyBioProtectionSupported)=="true"};a.authenticatorName="face_id";return a}(s.AuthenticationDriverDescriptorLocal);s.AuthenticationDriverDescriptorNativeFace=t})(e=t.authenticationdrivers||(t.authenticationdrivers={}))})(t=c.core||(c.core={}))})(t=u.sdk||(u.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(u){var t;(function(r){var t;(function(i){var c=function(){function t(t,e,r,n,i,o){this._channelIndex=t;this._channelAssertionId=e;this._targetIdentifier=r;this._description=n;this._channel=i;this._deviceDetails=o}t.prototype.getDescription=function(){return this._description};t.prototype.getChannel=function(){return this._channel};t.prototype.getTargetIdentifier=function(){return this._targetIdentifier};t.prototype.getChannelAssertionId=function(){return this._channelAssertionId};t.prototype.getChannelIndex=function(){return this._channelIndex};t.prototype.getDeviceDetails=function(){return this._deviceDetails};t.__tarsusInterfaceName="OtpTarget";return t}();i.OtpTargetImpl=c;var t=function(){function t(){}t.prototype.evaluateLocalRegistrationStatus=function(t){return u.AuthenticatorRegistrationStatus.Registered};t.prototype.isSupportedOnDevice=function(t){return true};t.prototype.suggestParameters=function(t,e){return this.createTargetsFromConfig(t).map(function(t){return u.AuthenticationActionParameterTargetSelection.create(t)})};t.prototype.createAuthenticationDriver=function(t,e,r){var n=this.createTargetsFromConfig(e);return new i.AuthenticationDriverOtp(t,e,n,r)};t.prototype.createTargetsFromConfig=function(t){var e=t;return e.channels.map(function(a){var s;switch(a.type){case r.Protocol.AuthenticationMethodOtpChannelType.Email:s=u.OtpChannel.Email;break;case r.Protocol.AuthenticationMethodOtpChannelType.Sms:s=u.OtpChannel.Sms;break;case r.Protocol.AuthenticationMethodOtpChannelType.Voice:s=u.OtpChannel.VoiceCall;break;case r.Protocol.AuthenticationMethodOtpChannelType.Push:s=u.OtpChannel.PushNotification;break;default:s=u.OtpChannel.Unknown;break}if(!a.targets&&a.target){a.targets={};a.targets["0"]=a.target}if(!a.targets){a.targets={}}return Object.keys(a.targets).map(function(t,e){var r=a.targets[t];switch(s){case u.OtpChannel.PushNotification:var n=r;var i=u.TargetDeviceDetailsImpl.fromServerFormat(n);return new c(e,a.assertion_id,t,i.describe(),s,i);default:var o=r;return new c(e,a.assertion_id,t,o,s,null)}})}).reduce(function(t,e){return t.concat(e)},[])};t.prototype.checkAuthenticatorInvalidatedAndNotifyUIHandler=function(t){return Promise.resolve(true)};return t}();i.AuthenticationDriverDescriptorOtp=t})(t=r.authenticationdrivers||(r.authenticationdrivers={}))})(t=u.core||(u.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(a){var t;(function(t){var e;(function(i){var o=function(){function t(t,e){this._targetIdentifier=t;this._description=e.describe();this._deviceDetails=e}t.prototype.getDescription=function(){return this._description};t.prototype.getDeviceIdentifier=function(){return this._targetIdentifier};t.prototype.getDeviceDetails=function(){return this._deviceDetails};t.__tarsusInterfaceName="TotpTarget";return t}();i.TotpTargetImpl=o;var t=function(){function n(){}n.prototype.evaluateLocalRegistrationStatus=function(t){return a.AuthenticatorRegistrationStatus.Registered};n.prototype.isSupportedOnDevice=function(t){return true};n.prototype.suggestParameters=function(t,e){var r=n.createTargetsFromConfig(t);return r.map(function(t){return a.AuthenticationActionParameterTargetSelection.create(t)})};n.prototype.createAuthenticationDriver=function(t,e,r){return new i.AuthenticationDriverTotp(t,e,r)};n.createTargetsFromConfig=function(t){var e=t;if(e.selectable_devices){return e.selectable_devices.map(function(t,e){var r=a.TargetDeviceDetailsImpl.fromServerFormat(t);return new o(t.device_id,r)})}else{return[]}};n.prototype.checkAuthenticatorInvalidatedAndNotifyUIHandler=function(t){return Promise.resolve(true)};return n}();i.AuthenticationDriverDescriptorTotp=t})(e=t.authenticationdrivers||(t.authenticationdrivers={}))})(t=a.core||(a.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(n){var t;(function(t){var e;(function(t){var e;(function(r){var t=function(t){__extends(e,t);function e(){return t.call(this,r.AuthenticationDriverVoice)||this}e.prototype.isSupportedOnDevice=function(t){return t.sdk.host.queryHostInfo(n.sdkhost.HostInformationKey.AudioAcquitisionSupported)=="true"};return e}(r.SimpleAuthenticationDriverDescriptor);r.AuthenticationDriverDescriptorVoice=t})(e=t.authenticationdrivers||(t.authenticationdrivers={}))})(e=t.core||(t.core={}))})(t=n.sdk||(n.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(i){var t;(function(r){var t;(function(t){var e=function(n){__extends(t,n);function t(t,e,r){return n.call(this,t,e,r)||this}t.prototype.getMaxStep=function(){return-1};t.prototype.authenticateInStartedSession=function(t){if(!t){this.initializeFirstStep()}this.pumpStep()};t.prototype.registerInStartedSession=function(t){if(!t){this.initializeFirstStep()}this.pumpStep()};t.prototype.pumpStep=function(){var e=this;var t=this._inputSession;t.setInputStep(this._currentStepIndex,this.getMaxStep(),this._currentStep);t.promiseInput().then(function(t){return e.handleInputOrControlResponse(t)},function(t){return e.completeAuthenticatorSessionWithError(i.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})};t.prototype.handleAuthenticateAssertionResult=function(t){if(this.handleStepManagementAssertionResult(t)){return true}else{return n.prototype.handleAuthenticateAssertionResult.call(this,t)}};t.prototype.handleRegisterAssertionResult=function(t){if(this.handleStepManagementAssertionResult(t)){return true}else{return n.prototype.handleRegisterAssertionResult.call(this,t)}};t.prototype.handleStepManagementAssertionResult=function(t){if(t.assertion_error_code==r.Protocol.AssertionErrorCode.NotFinished){var e=this.prepareNextAuthenticationStep(t);if(e!=this._currentStep){this._currentStep=e;this._currentStepIndex++}this.pumpStep();return true}else if(t.assertion_error_code==r.Protocol.AssertionErrorCode.RepeatCurrentStep){var e=this.updateCurrentAuthenticationStep(t,this._currentStep);this.pumpStep();return true}else{return false}};t.prototype.initializeFirstStep=function(){this._currentStep=this.createInitialInputStep();this._currentStepIndex=0};return t}(t.AuthenticationDriver);t.AuthenticationDriverMultiStep=e})(t=r.authenticationdrivers||(r.authenticationdrivers={}))})(t=i.core||(i.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e;(function(t){var e=function(n){__extends(t,n);function t(t,e,r){return n.call(this,t,e,r)||this}t.prototype.createAuthenticatorSession=function(){return this._uiHandler.createFaceAuthSession("face",this.user.displayName)};t.prototype.createInitialInputStep=function(){var t=this._authenticatorConfig;return new r.impl.CameraAcquisitionStepDescriptionImpl(t.acquisition_challenges)};t.prototype.prepareNextAuthenticationStep=function(t){return this.createInitialInputStep()};t.prototype.updateCurrentAuthenticationStep=function(t,e){return e};t.prototype.handleAuthenticationInputResponse=function(t){var e=t;this.processAuthenticateAssertion(e.getAcquisitionResponse())};t.prototype.handleRegistrationInputResponse=function(t){var e=t;this.processRegisterAssertion(e.getAcquisitionResponse())};return t}(t.AuthenticationDriverMultiStep);t.AuthenticationDriverFace=e})(e=t.authenticationdrivers||(t.authenticationdrivers={}))})(t=r.core||(r.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(c){var t;(function(l){var t;(function(o){var t;(function(t){var e=function(){function t(t,e,r,n,i,o){this._uiHandler=r;this._clientContext=n;this._actionContext=i;this._fidoRequest=o;this._user=e;this._sdk=t}t.prototype.startSession=function(t,e,r,n){this._authDescription=t};t.prototype.changeSessionModeToRegistrationAfterExpiration=function(){throw new l.impl.AuthenticationErrorImpl(l.AuthenticationErrorCode.Internal,"Can't change FIDO asession mode from authentication to registration.")};t.prototype.promiseRecoveryForError=function(t,e,r){return Promise.resolve(l.AuthenticationErrorRecovery.Fail)};t.prototype.promiseInput=function(){var r=this;return this.fidoClientXact().then(function(t){return l.InputOrControlResponse.createInputResponse(l.FidoInputResponse.createSuccessResponse(t))},function(t){var e=l.impl.AuthenticationErrorImpl.ensureAuthenticationError(t);r._sdk.log(l.LogLevel.Debug,"Received FIDO error response from client: "+e);if(e.getErrorCode()==l.AuthenticationErrorCode.UserCanceled){return l.InputOrControlResponse.createControlResponse(l.impl.ControlRequestImpl.create(l.ControlRequestType.CancelAuthenticator))}else{return l.InputOrControlResponse.createInputResponse(l.FidoInputResponse.createdFailedResponse(r._authDescription,e))}})};t.prototype.completeSuccessfulAuthenticatorSession=function(){return this.fidoClientSendCompletion({},1200)};t.prototype.endSession=function(){};return t}();var a=function(a){__extends(t,a);function t(t,e,r,n,i,o){return a.call(this,t,e,r,n,i,o)||this}t.prototype.fidoClientXact=function(){return this._sdk.host.fidoClientXact(this._uiHandler,this._clientContext,this._actionContext,this._fidoRequest)};t.prototype.fidoClientSendCompletion=function(t,e){var r={__completion:{responseCode:e,message:t}};return this._sdk.host.fidoClientXact(this._uiHandler,this._clientContext,this._actionContext,r).then(function(t){return true})};return t}(e);var r=function(){function t(){}t.prototype.createSession=function(t,e,r,n,i,o){return new a(t,e,r,n,i,o)};t.prototype.canHandlePolicy=function(t,e){if(o.fidoclient.TarsusFidoClient.isPolicyTransmitFidoClientExclusive(e)){return false}if(!this.checkPlatformClientIsPresent(t)){return false}return true};t.prototype.getAvailableAuthenticatorsIds=function(n){var i=this;return new Promise(function(s,e){if(!i.checkPlatformClientIsPresent(n)){n.log(l.LogLevel.Debug,"No platform FIDO client, therefore no available platform FIDO authenticators");return s()}var t=null;if(n.currentSession){var r=n.currentSession.getCurrentControlFlowProcessor();if(r){t=r._clientContext}}i.requestFidoClientDiscovery(n,n.currentUiHandler,t,i.getPolicyAction()).then(function(t){var e=t;var r=e["availableAuthenticators"];var n=new Array;for(var i=0,o=r;i<o.length;i++){var a=o[i];n.push(a.aaid)}s(n)},function(t){n.log(l.LogLevel.Debug,"Received FIDO discovery error response from client: "+t);e(t)})})};t.prototype.checkPlatformClientIsPresent=function(t){if(this._hasPlatformClient==null){this._hasPlatformClient=t.host.queryHostInfo(c.sdkhost.HostInformationKey.FidoClientPresent)==="true";if(!this._hasPlatformClient){t.log(l.LogLevel.Info,"No platform FIDO client.")}}return this._hasPlatformClient};t.prototype.getPolicyAction=function(){var t=new Object;t.type="";t.assertion_id="";return new l.impl.PolicyActionImpl(t)};t.prototype.requestFidoClientDiscovery=function(t,e,r,n){var i={discovery:true};return t.host.fidoClientXact(e,r,n,i)};return t}();var s=function(a){__extends(t,a);function t(t,e,r,n,i,o){return a.call(this,t,e,r,n,i,o)||this}t.prototype.fidoClientXact=function(){return this._sdk.fidoClient.fidoClientXact(this._authDescription,this._uiHandler,this._user,this._clientContext,this._actionContext,this._fidoRequest)};t.prototype.fidoClientSendCompletion=function(t,e){return Promise.resolve(true)};return t}(e);var n=function(){function t(){}t.prototype.createSession=function(t,e,r,n,i,o){return new s(t,e,r,n,i,o)};t.prototype.canHandlePolicy=function(t,e){return t.fidoClient.canHandlePolicy(e)};t.prototype.getAvailableAuthenticatorsIds=function(t){return new Promise(function(t,e){var r=new Array;Object.keys(o.fidoclient.FidoAuthenticators).forEach(function(t){r.push(t)});t(r)})};return t}();t._fidoClientProviders=[new n,new r];var i=function(n){__extends(u,n);function u(t,e,r){return n.call(this,t,e,r)||this}u.getEligibleClientProvidersForPolicy=function(e,r){return t._fidoClientProviders.filter(function(t){return t.canHandlePolicy(e,r)})};u.hasEligibleClientProvidersForPolicy=function(t,e){return this.getEligibleClientProvidersForPolicy(t,e).length>0};u.prototype.runUnregistration=function(){var c=this;return n.prototype.runUnregistration.call(this).finally(function(){var s=c._authenticatorConfig;new Promise(function(t,e){var r=s.fido_policy;if(r.rejected||!r.accepted||r.accepted.length!=1){throw"Invalid fido policy (class 1)"}if(r.accepted[0].length!=1||Object.keys(r.accepted[0][0]).length!=1||!r.accepted[0][0].aaid||r.accepted[0][0].aaid.length!=1){throw"Invalid fido policy (class 2)"}var n=r.accepted[0][0].aaid[0];c._sdk.log(l.LogLevel.Debug,"Will unregister AAID "+n+".");var i=u.getEligibleClientProvidersForPolicy(c._sdk,s.fido_policy);if(i.length==0){c._sdk.log(l.LogLevel.Warning,"Can't find FIDO client for unregister op: "+JSON.stringify(s.fido_policy)+".");t()}else{var o=s.fido_request;o.header.appID=s.fido_appid;var a=i[0].createSession(c._sdk,c.user,c._uiHandler,c._clientContext,c._actionDriver.policyAction(),o);a.startSession(c._authenticatorDescription,l.AuthenticatorSessionMode.Registration,c._actionDriver.policyAction(),c._clientContext);a.promiseInput().then(function(t){if(t.isControlRequest()){throw new l.impl.AuthenticationErrorImpl(l.AuthenticationErrorCode.AuthenticatorError,"Unexpected control response from FIDO client during unregistration.")}var e=t.getResponse();if(e instanceof l.FidoAuthFailureResponse){throw e.getFailureError()}return t}).finally(function(){a.endSession()}).then(t,e)}}).then(function(){c._sdk.log(l.LogLevel.Info,"FIDO authenticator unregistered: "+JSON.stringify(s.fido_policy)+".")},function(t){var e=l.impl.AuthenticationErrorImpl.ensureAuthenticationError(t);c._sdk.log(l.LogLevel.Error,"Error during FIDO unregistration: "+e+".")})})};u.prototype.completeAuthenticatorSessionWithResult=function(e){var r=this;if(e instanceof t.AuthenticationDriverSessionResultAuthenticationCompleted){this._inputSession.completeSuccessfulAuthenticatorSession().then(function(t){n.prototype.completeAuthenticatorSessionWithResult.call(r,e)},function(t){n.prototype.completeAuthenticatorSessionWithError.call(r,l.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})}else{n.prototype.completeAuthenticatorSessionWithResult.call(this,e)}};u.prototype.createAuthenticatorSession=function(){var t=this._authenticatorConfig;var e=u.getEligibleClientProvidersForPolicy(this._sdk,t.fido_policy);t.fido_request.header.appID=t.fido_appid;if(e.length>0){return e[0].createSession(this._sdk,this.user,this._uiHandler,this._clientContext,this._actionDriver.policyAction(),t.fido_request)}else{throw new l.impl.AuthenticationErrorImpl(l.AuthenticationErrorCode.AuthenticatorExternalConfigError,"Can't find FIDO client to handle FIDO request.",{fidoRequest:t.fido_request})}};u.prototype.authenticateInStartedSession=function(t){var e=this;this._inputSession.promiseInput().then(function(t){return e.handleInputOrControlResponse(t)},function(t){return e.completeAuthenticatorSessionWithError(l.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})};u.prototype.registerInStartedSession=function(t){var e=this;this._inputSession.promiseInput().then(function(t){return e.handleInputOrControlResponse(t)},function(t){return e.completeAuthenticatorSessionWithError(l.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})};u.prototype.handleAuthenticationInputResponse=function(t){if(t instanceof l.FidoAuthSuccessResponse){this.handleFidoSuccessAuthResponse(t)}else{this.handleFidoError(t)}};u.prototype.handleFidoSuccessAuthResponse=function(t){this.processAuthenticateAssertion({fido_response:t.getFidoResponse()})};u.prototype.handleFidoError=function(t){if(t instanceof l.FidoAuthFailureResponse){this._sdk.log(l.LogLevel.Debug,"FIDO session received FidoAuthFailureResponse.");this.handleFidoFailureResponse(t)}else{this._sdk.log(l.LogLevel.Error,"FIDO session received unknkown response type.");this.performErrorRecoveryForError(new l.impl.AuthenticationErrorImpl(l.AuthenticationErrorCode.AppImplementation,"FIDO session received unknkown response type."))}};u.prototype.handleFidoFailureResponse=function(t){var e={status:t.getRegistrationStatus()==l.AuthenticatorRegistrationStatus.Registered?o.Protocol.AuthenticationMethodStatus.Registered:o.Protocol.AuthenticationMethodStatus.Unregistered,expired:t.getExpired(),locked:t.getLocked(),last_used:0};this._authenticatorDescription.updateWithAuthenticatorState(e);this.performErrorRecoveryForError(t.getFailureError())};u.prototype.handleFidoSuccessRegResponse=function(t){this.processRegisterAssertion({fido_response:t.getFidoResponse()})};u.prototype.handleRegistrationInputResponse=function(t){if(t instanceof l.FidoAuthSuccessResponse){this.handleFidoSuccessRegResponse(t)}else{this.handleFidoError(t)}};u.prototype.defaultRecoveryForError=function(t){return this._operationMode==l.AuthenticatorSessionMode.Authentication?l.AuthenticationErrorRecovery.ChangeAuthenticator:l.AuthenticationErrorRecovery.Fail};return u}(t.AuthenticationDriver);t.AuthenticationDriverFido=i})(t=o.authenticationdrivers||(o.authenticationdrivers={}))})(t=l.core||(l.core={}))})(t=c.sdk||(c.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(o){var t;(function(t){var e;(function(i){var t;(function(n){var t;(function(t){var e;(function(t){var r=function(){function t(t,e,r,n,i,o){this.cancellationDOMErrorNames=["NotAllowedError","AbortError"];this.sdk=t;this.username=e;this.uiHandler=r;this.clientContext=n;this.actionContext=i;this.config=o}t.prototype.startSession=function(t,e,r,n){this.description=t;this.mode=e;this.actionContext=r;this.clientContext=n};t.prototype.changeSessionModeToRegistrationAfterExpiration=function(){this.mode=o.ts.mobile.sdk.AuthenticatorSessionMode.Registration};t.prototype.promiseRecoveryForError=function(t,e,r){return Promise.resolve(n.AuthenticationErrorRecovery.Fail)};t.prototype.promiseInput=function(){var r=this;var t,e;if(this.mode===o.ts.mobile.sdk.AuthenticatorSessionMode.Authentication){t=this.config.credentialRequestOptions;e=i.sdkhost.Fido2CredentialsOpType.Get;if(typeof t.publicKey.challenge==="string"){t.publicKey.challenge=this.str2ab(t.publicKey.challenge);if(t.publicKey.allowCredentials){t.publicKey.allowCredentials=t.publicKey.allowCredentials.map(function(t){t.id=base64js.toByteArray(t.id);return t})}}}else{t=this.config.credentialCreationOptions;e=i.sdkhost.Fido2CredentialsOpType.Create;if(typeof t.publicKey.challenge==="string"){t.publicKey.challenge=this.str2ab(t.publicKey.challenge);t.publicKey.user.id=this.str2ab(t.publicKey.user.id);t.publicKey.excludeCredentials=t.publicKey.excludeCredentials.map(function(t){t.id=base64js.toByteArray(t.id);return t})}}return this.sdk.host.fido2CredentialsOp(this.uiHandler,this.clientContext,this.actionContext,e,t).then(function(t){return n.InputOrControlResponse.createInputResponse(n.Fido2InputResponse.createSuccessResponse(t))}).catch(function(t){if(r.cancellationDOMErrorNames.indexOf(t.name)>-1){r.sdk.log(n.LogLevel.Debug,"Received FIDO2 cancellation request from platform; Error: "+t);return n.InputOrControlResponse.createControlResponse(n.ControlRequest.create(n.ControlRequestType.CancelAuthenticator))}else{var e=o.ts.mobile.sdk.impl.AuthenticationErrorImpl.ensureAuthenticationError(t);r.sdk.log(n.LogLevel.Debug,"Received FIDO2 error response from client: "+e);return n.InputOrControlResponse.createInputResponse(n.Fido2InputResponse.createdFailedResponse(e))}})};t.prototype.endSession=function(){};t.prototype.str2ab=function(t){var e=new ArrayBuffer(t.length);var r=new Uint8Array(e);for(var n=0,i=t.length;n<i;n++){r[n]=t.charCodeAt(n)}return e};return t}();t.Fido2AuthenticatorSession=r;var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.createAuthenticatorSession=function(){if(this._sdk.host.queryHostInfo(i.sdkhost.HostInformationKey.Fido2ClientPresent)==="true"){return new r(this._sdk,this.user.displayName,this._uiHandler,this._clientContext,this._actionDriver.policyAction(),this._authenticatorConfig)}else{throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AuthenticatorExternalConfigError,"Can't find FIDO2 client to handle FIDO2 authentication.")}};e.prototype.authenticateInStartedSession=function(t){var e=this;this._inputSession.promiseInput().then(function(t){return e.handleInputOrControlResponse(t)},function(t){return e.completeAuthenticatorSessionWithError(n.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})};e.prototype.handleAuthenticationInputResponse=function(t){if(t instanceof n.Fido2AuthenticatorSuccessResponse){this._sdk.log(n.LogLevel.Debug,"Fido2 received Fido2AuthenticatorSuccessResponse.");var e=t.getFido2Response();this.processAuthenticateAssertion({assertion_credential:{id:e.id,rawId:this.copyab(e.rawId),response:{authenticatorData:this.copyab(e.response.authenticatorData),clientDataJSON:this.copyab(e.response.clientDataJSON),signature:this.copyab(e.response.signature),userHandle:this.copyab(e.response.userHandle)},type:e.type}})}else if(t instanceof n.Fido2AuthenticationFailedResponse){this._sdk.log(n.LogLevel.Debug,"Fido2 received Fido2AuthenticationFailedResponse.");this.handleFido2FailureResponse(t)}else{this._sdk.log(n.LogLevel.Error,"Fido2 received unknkown response type.");this.performErrorRecoveryForError(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Fido2 received unknkown response type."))}};e.prototype.registerInStartedSession=function(t){var e=this;this._inputSession.promiseInput().then(function(t){return e.handleInputOrControlResponse(t)},function(t){return e.completeAuthenticatorSessionWithError(n.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})};e.prototype.handleRegistrationInputResponse=function(t){if(t instanceof n.Fido2AuthenticatorSuccessResponse){this._sdk.log(n.LogLevel.Debug,"Fido2 received Fido2AuthenticatorSuccessResponse.");var e=t.getFido2Response();this.processRegisterAssertion({attestation_credential:{id:e.id,rawId:this.copyab(e.rawId),response:{attestationObject:this.copyab(e.response.attestationObject),clientDataJSON:this.copyab(e.response.clientDataJSON)},type:e.type}})}else if(t instanceof n.Fido2AuthenticationFailedResponse){this._sdk.log(n.LogLevel.Debug,"Fido2 received Fido2AuthenticationFailedResponse.");this.handleFido2FailureResponse(t)}else{this._sdk.log(n.LogLevel.Error,"Fido2 received unknkown response type.");this.performErrorRecoveryForError(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Fido2 received unknkown response type."))}};e.prototype.handleFido2FailureResponse=function(t){this._actionDriver.sendAuthenticatorAssertionRequest(this._authenticatorDescription,"auth_failure",{num_of_failures:1});this.performErrorRecoveryForError(t.getFailureError())};e.prototype.copyab=function(t){var e=new Int8Array(t);var r=Array(e.length);for(var n=0;n<r.length;n++){r[n]=e[n]}return r};return e}(t.AuthenticationDriver);t.AuthenticationDriverFido2=e})(e=t.authenticationdrivers||(t.authenticationdrivers={}))})(t=n.core||(n.core={}))})(t=i.sdk||(i.sdk={}))})(e=t.mobile||(t.mobile={}))})(t=o.ts||(o.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(u){var t;(function(c){var t;(function(r){var t=function(n){__extends(t,n);function t(t,e,r){return n.call(this,t,e,r)||this}Object.defineProperty(t.prototype,"lastObtainedKeyPair",{get:function(){return this._lastObtainedKeyPair},set:function(t){if(this._lastObtainedKeyPair&&this._lastObtainedKeyPair!=t){this._lastObtainedKeyPair.closeKeyPair()}this._lastObtainedKeyPair=t},enumerable:true,configurable:true});t.prototype.completeAuthenticatorSessionWithResult=function(t){var e=this.operationMode===u.AuthenticatorSessionMode.Registration&&t instanceof r.AuthenticationDriverSessionResultAuthenticationCompleted&&(!t.assertionResult.assertion_error_code||t.assertionResult.assertion_error_code===c.Protocol.AssertionErrorCode.AssertionContainerNotComplete);if(e){if(this._enrollmentRecordToCommit){this._sdk.log(u.LogLevel.Debug,"Updating local enrollment record on registration");this.user.updateEnrollmentRecord(this._enrollmentRecordToCommit)}else{this._sdk.log(u.LogLevel.Warning,"No enrollment record to update.")}}this._enrollmentRecordToCommit=null;this.lastObtainedKeyPair=null;n.prototype.completeAuthenticatorSessionWithResult.call(this,t)};t.prototype.completeAuthenticatorSessionWithError=function(t){this.lastObtainedKeyPair=null;n.prototype.completeAuthenticatorSessionWithError.call(this,t)};t.prototype.registerInStartedSession=function(t){this._enrollmentRecordToCommit=null};t.prototype.handleAuthenticationInputResponse=function(t){var a=this;var s=this.user.localEnrollments[this.authenticatorType];if(!s){this.performErrorRecoveryForError(new u.impl.AuthenticationErrorImpl(u.AuthenticationErrorCode.NoRegisteredAuthenticator,"Missing key for "+this.authenticatorType+" authenticator"))}this.getKeyForEnrollmentDataAndInput(s,t).then(function(o){a._sdk.log(u.LogLevel.Debug,"Local authenticator key obtained; signing challenge");if(a._externalCancelled){return Promise.reject(a._actionDriver._controlFlowProcessor.createExternalCancellationError())}a.lastObtainedKeyPair=o.key;var t=u.util.asciiToHex(a.localAuthenticatorChallenge());return a.lastObtainedKeyPair.signHex(t).then(function(t){var e=u.util.hexToBase64(t);var r={};var n={fch:e};if(o.rolloverKeyData){a._sdk.log(u.LogLevel.Info,"Local authenticator rollover requested");var i={};if(o.rolloverKeyData.key){i["key"]=o.rolloverKeyData.key.publicKeyToJson();i["version"]=o.rolloverKeyData.schemeVersion}if(o.rolloverReason){i["reason"]=o.rolloverReason}r["rollover"]=i;s.status=c.LocalEnrollmentStatus.Registered;s.validationStatus=c.LocalEnrollmentValidationStatus.Validated;s.salt=o.rolloverKeyData.salt;s.version=o.rolloverKeyData.schemeVersion;s.keyMaterial=o.rolloverKeyData.keyMeterial;s.cryptoSettings=a._sdk.cryptoSettings;s.authenticatorConfig=o.rolloverKeyData.authenticatorConfig;a._enrollmentRecordToCommit=s}a.processAuthenticateAssertion(r,n)},function(t){return Promise.reject(t)})}).catch(function(t){a.processLocalAuthenticatorError(u.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})};t.prototype.getNewOrUpdatedEnrollmentRecord=function(t){this._sdk.log(u.LogLevel.Debug,"Register "+this.authenticatorType+": fetching local enrollment record");var e=this.user.localEnrollments[this.authenticatorType];var r=t.key.publicKeyToJson().key;var n=this._sdk.host.calcHexStringEncodedSha256Hash(u.util.base64ToHex(r));if(!e){this._sdk.log(u.LogLevel.Debug,"Register "+this.authenticatorType+": Generating new local enrollment record");e=this.user.createEnrollmentRecord(this.authenticatorType,t.schemeVersion,t.salt,c.LocalEnrollmentStatus.Unregistered,n)}e.status=c.LocalEnrollmentStatus.Registered;e.validationStatus=c.LocalEnrollmentValidationStatus.Validated;e.salt=t.salt;e.version=t.schemeVersion;e.cryptoSettings=this._sdk.cryptoSettings;e.publicKeyHash=n;e.keyMaterial=t.keyMeterial;e.authenticatorConfig=t.authenticatorConfig;return e};t.prototype.handleRegistrationInputResponse=function(t){var o=this;this._sdk.log(u.LogLevel.Debug,"Register "+this.authenticatorType+": Generating pending enrollment data");this.generatePendingEnrollment(t).then(function(i){o._sdk.log(u.LogLevel.Debug,"Register "+o.authenticatorType+": Signing registration assertion");var t=o.getNewOrUpdatedEnrollmentRecord(i);o._enrollmentRecordToCommit=t;var e=u.util.asciiToHex(o.localAuthenticatorChallenge());if(o._externalCancelled){return Promise.reject(o._actionDriver._controlFlowProcessor.createExternalCancellationError())}o.lastObtainedKeyPair=i.key;return i.key.signHex(e).then(function(t){o._sdk.log(u.LogLevel.Debug,"Register "+o.authenticatorType+": Preparing registration assertion");try{var e=u.util.hexToBase64(t);var r=null;var n={public_key:i.key.publicKeyToJson(),fch:e,version:i.schemeVersion};o.processRegisterAssertion(r,n)}finally{o.lastObtainedKeyPair=null}},function(t){o.lastObtainedKeyPair=null;return Promise.reject(t)})}).catch(function(t){o.processLocalAuthenticatorError(u.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})};t.prototype.handleRegisterAssertionResult=function(t){if(t.data&&t.data.update_vaults){c.vault.MultiCredsVault.updateVaultsProtectingCreds(this.user,t.data.update_vaults,this._uiHandler,this._sdk)}return n.prototype.handleRegisterAssertionResult.call(this,t)};t.prototype.handleUnregistrationAssertionResult=function(t){var e=this.user.localEnrollments[this.authenticatorType];e.status=c.LocalEnrollmentStatus.Unregistered;this.user.updateEnrollmentRecord(e);if(t.data&&t.data.update_vaults){c.vault.MultiCredsVault.updateVaultsProtectingCreds(this.user,t.data.update_vaults,this._uiHandler,this._sdk)}n.prototype.handleUnregistrationAssertionResult.call(this,t)};t.prototype.handleAuthenticateAssertionResult=function(t){if(this._enrollmentRecordToCommit&&!t.assertion_error_code){this._sdk.log(u.LogLevel.Debug,"Pending commit for enrollment; checking rollover status.");if(t.data&&t.data.rollover&&t.data.rollover.code==0){this._sdk.log(u.LogLevel.Info,"Updating local enrollment record on authentication result");this.user.updateEnrollmentRecord(this._enrollmentRecordToCommit)}else{this._sdk.log(u.LogLevel.Error,"Received a rollover failure response from the server; aboting rollover.")}}this._enrollmentRecordToCommit=null;return n.prototype.handleAuthenticateAssertionResult.call(this,t)};t.prototype.processLocalAuthenticatorError=function(t){this.performErrorRecoveryForError(t)};t.prototype.localAuthenticatorChallenge=function(){return this._actionDriver._controlFlowProcessor.challenge+this._authenticatorDescription.assertionId};t.prototype.getAuthenticatorEnrollmentConfig=function(){return null};t.prototype.onCancelRun=function(){n.prototype.onCancelRun.call(this);if(this.lastObtainedKeyPair){this.lastObtainedKeyPair=null}};t.prototype.shouldAllowBiometricFallbackButton=function(t){var e=this;if(!t)return false;var r=this._actionDriver.availableAuthenticatorsForSwitching.filter(function(t){return t!=e._authenticatorDescription});if(this._actionDriver instanceof c.actiondrivers.ActionDriverRegistration||this._actionDriver instanceof c.actiondrivers.ActionDriverAuthentication&&r.length==0)return false;var n=t;var i=n.getFallbackButtonTitle();if(i&&i.length>0){var o=n.getFallbackControlRequestType();if(o==null){o=u.ControlRequestType.SelectMethod}switch(o){case u.ControlRequestType.ChangeMethod:case u.ControlRequestType.SelectMethod:return this._actionDriver.availableAuthenticators.length>1;default:return true}}else{return false}};return t}(r.AuthenticationDriver);r.AuthenticationDriverLocal=t})(t=c.authenticationdrivers||(c.authenticationdrivers={}))})(t=u.core||(u.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){function e(t){return t["runSilentRegistration"]}t.instanceOfAuthenticationDriverSilentRegistrationSupport=e})(e=t.authenticationdrivers||(t.authenticationdrivers={}))})(e=t.core||(t.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(f){var t;(function(p){var t;(function(s){var t;(function(i){var d="v3";var t=function(n){__extends(r,n);function r(t,e,r){return n.call(this,t,e,r)||this}r.prototype.getBiometricPromptFallbackControlType=function(){return this._biometricPromptFallbackControlType!=null?this._biometricPromptFallbackControlType:p.ControlRequestType.SelectMethod};r.authenticatorKeyTagForUser=function(t,e,r){return new s.TarsusKeyPath("per_user",t.guid.toString(),"local_auth_keys",i.AuthenticationDriverDescriptorFingerprint.authenticatorName,e,r)};r.prototype.shouldAllowBiometricFallbackButton=function(t){var e=this;if(!t)return false;var r=this._actionDriver.availableAuthenticatorsForSwitching.filter(function(t){return t!=e._authenticatorDescription});if(this._actionDriver instanceof s.actiondrivers.ActionDriverRegistration||this._actionDriver instanceof s.actiondrivers.ActionDriverAuthentication&&r.length==0)return false;var n=t;var i=n.getFallbackButtonTitle();if(i&&i.length>0){var o=n.getFallbackControlRequestType();if(o==null){o=p.ControlRequestType.SelectMethod}switch(o){case p.ControlRequestType.ChangeMethod:var a=this._actionDriver.availableAuthenticatorsForSwitching.filter(function(t){return t!=e._authenticatorDescription});return a.length>0;case p.ControlRequestType.SelectMethod:return this._actionDriver.availableAuthenticatorsForSwitching.length>0;default:return true}}else{return false}};r.prototype.runSilentRegistration=function(){var n=this;return this.generateAuthenticatorKey().then(function(t){var e=n.getNewOrUpdatedEnrollmentRecord(t);var r={public_key:t.key.publicKeyToJson(),version:t.schemeVersion};return n._actionDriver.sendAuthenticatorAssertionRequest(n._authenticatorDescription,"register",null,r).then(function(t){if(!t.assertion_error_code){n.user.updateEnrollmentRecord(e);return new i.AuthenticationDriverSessionResultAuthenticationCompleted(t)}else{throw p.impl.AuthenticationErrorImpl.errorForAssertionResponse(t)}})})};r.prototype.createAuthenticatorSession=function(){return this._uiHandler.createFingerprintAuthSession(i.AuthenticationDriverDescriptorFingerprint.authenticatorName,this.user.displayName)};r.prototype.authenticateInStartedSession=function(t){var e=this;this._inputSession.promiseInput().then(function(t){return e.handleInputOrControlResponse(t)},function(t){return e.completeAuthenticatorSessionWithError(p.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})};r.prototype.registerInStartedSession=function(t){var e=this;n.prototype.registerInStartedSession.call(this,t);this._inputSession.promiseInput().then(function(t){return e.handleInputOrControlResponse(t)},function(t){return e.completeAuthenticatorSessionWithError(p.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})};Object.defineProperty(r.prototype,"authenticatorType",{get:function(){return i.AuthenticationDriverDescriptorFingerprint.authenticatorName},enumerable:true,configurable:true});r.prototype.processLocalAuthenticatorError=function(t){var e=this;var r=t;var n=0;var i=Promise.resolve();if(r.getErrorCode()==p.AuthenticationErrorCode.Internal&&r.getData()){var o=r.getData();n=o[f.sdkhost.ErrorDataNumFailures]||n;r=p.impl.AuthenticationErrorImpl.errorForHostInternalBiometricErrorData(o,"Fingerprint")||r;if(o[f.sdkhost.ErrorDataInternalError]==f.sdkhost.InternalErrorBiometricNotConfigured&&this._authenticatorDescription.getRegistered()||o[f.sdkhost.ErrorDataInternalError]==f.sdkhost.InternalErrorBiometricInvalidated){i=s.LocalEnrollment.invalidateLocalRegistrationStatusAndNotifyUIHandler(this._sdk.currentSession,this._authenticatorDescription)}}i.catch(function(t){e._sdk.log(p.LogLevel.Error,t)});i.finally(function(){var t=r.getData();if(n&&e._operationMode==p.AuthenticatorSessionMode.Authentication){e.processAuthFailureAssertionAndHandleError(r,n);return}if(t[f.sdkhost.ErrorDataInternalError]==f.sdkhost.InternalErrorBiometricFallbackPressed){e._sdk.log(p.LogLevel.Debug,"Biometric prompt fallback button pressed");e.processControlRequest(p.ControlRequest.create(e.getBiometricPromptFallbackControlType()));return}if(r.getErrorCode()==p.AuthenticationErrorCode.UserCanceled){e._sdk.log(p.LogLevel.Debug,"Fingerprint authenticator captured user cancel error code.");e.invokeUiHandlerCancellation();return}e.performErrorRecoveryForError(r)})};r.prototype.getKeyForEnrollmentDataAndInput=function(u,l){var h=this;return new Promise(function(t,e){var r=l;var n=h.shouldAllowBiometricFallbackButton(r);if(n)h._biometricPromptFallbackControlType=r.getFallbackControlRequestType();var i=false;var o=h.authenticatorKeyTagForScheme(u.version,u.salt);var a=h._sdk.host.getKeyPair(o,f.sdkhost.KeyClass.StdSigningKey,f.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb);if(!a){var s={};s[f.sdkhost.ErrorDataInternalError]=f.sdkhost.InternalErrorBiometricInvalidated;throw new p.impl.AuthenticationErrorImpl(p.AuthenticationErrorCode.Internal,"Attempt to authenticate with invalidated Fingerprint.",s)}a.setBiometricPromptInfo(r.getPrompt(),n?r.getFallbackButtonTitle():null,h._uiHandler,h._inputSession);var c={key:a};if(u.version=="v0"||u.version=="v1"||u.version=="v2"&&h._sdk.host.queryHostInfo(f.sdkhost.HostInformationKey.StdSigningKeyIsHardwareProtectedSignAndEncryptKey)!="true"){h._sdk.log(p.LogLevel.Info,"Fingerprint: Key rollover from "+u.version+" to "+d);h.generateAuthenticatorKey().then(function(t){c.rolloverKeyData=t;c.rolloverReason="Upgrading fingerprint authenticator scheme from "+u.version+" to "+d;return c}).then(t,e)}else{t(c)}})};r.prototype.generatePendingEnrollment=function(n){var i=this;return this.generateAuthenticatorKey().then(function(t){var e=n;var r=i.shouldAllowBiometricFallbackButton(e);if(r)i._biometricPromptFallbackControlType=e.getFallbackControlRequestType();t.key.setBiometricPromptInfo(e?e.getPrompt():null,r?e.getFallbackButtonTitle():null,i._uiHandler,i._inputSession);return t})};r.prototype.generateAuthenticatorKey=function(){var r;r=this._sdk.host.generateRandomHexString(24);var t=f.sdkhost.KeyClass.HardwareProtectedSignAndEncryptKey;var e=this.authenticatorKeyTagForScheme(d,r);return p.util.wrapPromiseWithActivityIndicator(this._uiHandler,this._actionDriver.policyAction(),this._clientContext,this._sdk.host.generateKeyPair(e,f.sdkhost.KeyClass.HardwareProtectedSignAndEncryptKey,f.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb,true).then(function(t){var e={key:t,salt:r,schemeVersion:d};return e},function(t){if(t.getErrorCode()==p.AuthenticationErrorCode.Internal&&t.getData()){var e=t.getData();var r=p.impl.AuthenticationErrorImpl.errorForHostInternalBiometricErrorData(e,"Fingerprint");if(r){throw r}}throw t}))};r.prototype.authenticatorKeyTagForScheme=function(t,e){return r.authenticatorKeyTagForUser(this.user,t,e)};return r}(i.AuthenticationDriverLocal);i.AuthenticationDriverFingerprint=t})(t=s.authenticationdrivers||(s.authenticationdrivers={}))})(t=p.core||(p.core={}))})(t=f.sdk||(f.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=[];function r(t,e){var r=t.toString(16);if(r.length>e/4){throw"Number out of range for bitcount."}while(r.length<e/4){r="0"+r}return r}t.numberToHex=r;function n(t){var e=[];for(var r=0;r<t.length;r++){var n=t.charCodeAt(r);if(n<128)e.push(n);else if(n<2048){e.push(192|n>>6,128|n&63)}else if(n<55296||n>=57344){e.push(224|n>>12,128|n>>6&63,128|n&63)}else{r++;n=65536+((n&1023)<<10|t.charCodeAt(r)&1023);e.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|n&63)}}return e}t.toUTF8Array=n;function i(t){var e="",r;for(r=0;r<t.length;r++){var n=t[r];if(n<128){e+=String.fromCharCode(n)}else if(n>191&&n<224){e+=String.fromCharCode((n&31)<<6|t[r+1]&63);r+=1}else if(n>223&&n<240){e+=String.fromCharCode((n&15)<<12|(t[r+1]&63)<<6|t[r+2]&63);r+=2}else{var i=((n&7)<<18|(t[r+1]&63)<<12|(t[r+2]&63)<<6|t[r+3]&63)-65536;e+=String.fromCharCode(i>>10|55296,i&1023|56320);r+=3}}return e}t.fromUTF8Array=i;function o(t){var e=[];for(var r=0;r<t.length;r+=2){e.push(parseInt(t.substr(r,2),16))}return i(e)}t.hexToAscii=o;function a(t){return n(t).map(function(t){var e=t.toString(16);if(e.length<2){e="0"+e}return e}).join("")}t.asciiToHex=a;function s(t){var e=atob(t);return c(e)}t.base64ToHex=s;function c(t){var e="";for(var r=0;r<t.length;r++){var n=t.charCodeAt(r).toString(16);if(n.length<2){n="0"+n}e+=n}return e}t.bytesToHex=c;function u(t){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var r=0;var n=0;var i="";for(var o=0;o<t.length;o++){r=(r<<4)+parseInt(t[o],16);n+=4;if(n>=6){var a=e[r>>n-6];i=i+a;n-=6;r=r&255>>8-n}}if(n){var a=e[r<<6-n];i=i+a}while(i.length%4){i=i+"="}return i}t.hexToBase64=u;function l(t){var e=new RegExp("^([0-9A-Fa-f]{2})+$");return e.test(t)}t.isHexString=l;t.nameof=function(t){return t};function h(e,r,n,t){e.startActivityIndicator(r,n);return t.then(function(t){e.endActivityIndicator(r,n);return t},function(t){e.endActivityIndicator(r,n);return Promise.reject(t)})}t.wrapPromiseWithActivityIndicator=h;function d(t){var e=t;switch(t){case"iPhone":e="iOS";break;case"iPad":e="iOS";break}return e}t.getOsName=d;function p(t,e){var r=t;if(e=="iPhone"){switch(t){case"i386":r="Simulator";break;case"x86_64":r="Simulator";break;case"iPod1,1":r="iPod Touch";break;case"iPod2,1":r="iPod Touch";break;case"iPod3,1":r="iPod Touch";break;case"iPod4,1":r="iPod Touch";break;case"iPod7,1":r="iPod Touch";break;case"iPhone1,1":r="iPhone";break;case"iPhone1,2":r="iPhone";break;case"iPhone2,1":r="iPhone";break;case"iPad1,1":r="iPad";break;case"iPad2,1":r="iPad 2";break;case"iPad3,1":r="iPad";break;case"iPhone3,1":r="iPhone 4";break;case"iPhone3,3":r="iPhone 4";break;case"iPhone4,1":r="iPhone 4S";break;case"iPhone5,1":r="iPhone 5";break;case"iPhone5,2":r="iPhone 5";break;case"iPad3,4":r="iPad";break;case"iPad2,5":r="iPad Mini";break;case"iPhone5,3":r="iPhone 5c";break;case"iPhone5,4":r="iPhone 5c";break;case"iPhone6,1":r="iPhone 5s";break;case"iPhone6,2":r="iPhone 5s";break;case"iPhone7,1":r="iPhone 6 Plus";break;case"iPhone7,2":r="iPhone 6";break;case"iPhone8,1":r="iPhone 6S";break;case"iPhone8,2":r="iPhone 6S Plus";break;case"iPhone8,4":r="iPhone SE";break;case"iPhone9,1":r="iPhone 7";break;case"iPhone9,3":r="iPhone 7";break;case"iPhone9,2":r="iPhone 7 Plus";break;case"iPhone9,4":r="iPhone 7 Plus";break;case"iPhone10,1":r="iPhone 8";break;case"iPhone10,4":r="iPhone 8";break;case"iPhone10,2":r="iPhone 8 Plus";break;case"iPhone10,5":r="iPhone 8 Plus";break;case"iPhone10,3":r="iPhone X";break;case"iPhone10,6":r="iPhone X";break;case"iPad4,1":r="iPad Air";break;case"iPad4,2":r="iPad Air";break;case"iPad4,4":r="iPad Mini";break;case"iPad4,5":r="iPad Mini";break;case"iPad4,7":r="iPad Mini";break;case"iPad6,7":r='iPad Pro (12.9")';break;case"iPad6,8":r='iPad Pro (12.9")';break;case"iPad6,3":r='iPad Pro (9.7")';break;case"iPad6,4":r='iPad Pro (9.7")';break;case"iPhone11,2":r="iPhone XS";break;case"iPhone11,6":r="iPhone XS Max";break;case"iPhone11,4":r="iPhone XS Max";break;case"iPhone11,8":r="iPhone XR";break;case"iPad6,7":r='iPad Pro (12.9")';break;case"iPad6,8":r='iPad Pro (12.9")';break;case"iPad6,11":r="iPad (2017)";break;case"iPad6,12":r="iPad (2017)";break;case"iPad7,1":r="iPad Pro 2nd Gen";break;case"iPad7,2":r="iPad Pro 2nd Gen";break;case"iPad7,3":r='iPad Pro (10.5")';break;case"iPad7,4":r='iPad Pro (10.5")';break;case"iPad7,5":r="iPad";break;case"iPad7,6":r="iPad";break;case"iPad8,1":r='iPad Pro (11")';break;case"iPad8,2":r='iPad Pro (11")';break;case"iPad8,3":r='iPad Pro (11")';break;case"iPad8,4":r='iPad Pro (11")';break;case"iPad8,5":r='iPad Pro (12.9")';break;case"iPad8,6":r='iPad Pro (12.9")';break;case"iPad8,7":r='iPad Pro (12.9")';break;case"iPad8,8":r='iPad Pro (12.9")';break}}return r}t.getDeviceModel=p;var f=function(){function n(){var r=this;this._cancelPromise=new Promise(function(t,e){r._cancelFn=function(){e(n.CancelRequest)};if(r._cancelled){e(n.CancelRequest)}})}Object.defineProperty(n.prototype,"cancellablePromise",{get:function(){return this._cancellablePromise},enumerable:true,configurable:true});n.prototype.resolveWith=function(t){if(this._cancelled){this._cancellablePromise=this._cancelPromise}else{this._underlyingPromise=new Promise(t);this._cancellablePromise=Promise.race([this._cancelPromise,this._underlyingPromise])}};n.prototype.cancel=function(){this._cancelled=true;if(this._cancelFn){this._cancelFn()}};n.CancelRequest={};return n}();t.CancelablePromiseHolder=f})(e=t.util||(t.util={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(s){var t;(function(u){var t;(function(c){var t;(function(t){var e=function(n){__extends(t,n);function t(t,e,r){return n.call(this,t,e,r)||this}t.prototype.processLocalAuthenticatorError=function(t){var e=t;if(t.getErrorCode()==u.AuthenticationErrorCode.InvalidInput&&this._operationMode==u.AuthenticatorSessionMode.Authentication){this.processAuthFailureAssertionAndHandleError(e,1)}else{this.performErrorRecoveryForError(e)}};t.prototype.getKeyForEnrollmentDataAndInput=function(r,n){var i=this;return new Promise(function(t,e){if(r.version=="v2"){i.getKeyForEnrollmentDataAndInputV2(r,n).then(t,e)}else{i.getKeyForEnrollmentDataAndInputPreV2(r,n).then(t,e)}}).then(function(t){if(!t){throw new u.impl.AuthenticationErrorImpl(u.AuthenticationErrorCode.InvalidInput,"Invalid input provided to authenticator.")}var e={key:t};if(r.version=="v0"||r.version=="v1"){i._sdk.log(u.LogLevel.Info,i.authenticatorType+": Key rollover from "+r.version+" to v2");return i.generatePendingEnrollment(n).then(function(t){e.rolloverKeyData=t;e.rolloverReason="Upgrading "+i.authenticatorType+" authenticator scheme";return e})}else{return e}})};t.prototype.generatePendingEnrollment=function(r){var a=this;return new Promise(function(t,e){var n=a._sdk.host.generateRandomHexString(32);var i=a._sdk.host.generateRandomHexString(64);var o=a.extractPbkdfInputFromInputResponse(r);return u.util.wrapPromiseWithActivityIndicator(a._uiHandler,a._actionDriver.policyAction(),a._clientContext,a._sdk.host.generateHexSeededKeyPairExternalRepresentation(s.sdkhost.KeyClass.FidoECCSigningKey,i).then(function(r){return c.vault.pbkdfStretchHexSecretIntoAESKey(n,o,a._sdk.cryptoSettings.getLocalEnrollmentKeySizeInBytes(),a._sdk.cryptoSettings.getLocalEnrollmentKeyIterationCount(),true,a._sdk).then(function(t){return t.encrypt(i).then(function(t){var e={key:a._sdk.host.importVolatileKeyPair(s.sdkhost.KeyClass.FidoECCSigningKey,r),salt:n,schemeVersion:"v2",keyMeterial:t};return e})})})).then(t,e)})};t.prototype.getKeyForEnrollmentDataAndInputV2=function(e,t){var r=this;var n=this.extractPbkdfInputFromInputResponse(t);return c.vault.pbkdfStretchHexSecretIntoAESKey(e.salt,n,e.cryptoSettings.getLocalEnrollmentKeySizeInBytes(),e.cryptoSettings.getLocalEnrollmentKeyIterationCount(),true,this._sdk).then(function(t){return t.decrypt(e.keyMaterial,null).then(function(t){return r._sdk.host.generateHexSeededKeyPairExternalRepresentation(s.sdkhost.KeyClass.FidoECCSigningKey,t).then(function(t){return r._sdk.host.importVolatileKeyPair(s.sdkhost.KeyClass.FidoECCSigningKey,t)})})})};t.prototype.getKeyForEnrollmentDataAndInputPreV2=function(t,e){var r=this;return this.authenticatorKeyTagForScheme(t.version,t.salt,t.cryptoSettings,e).then(function(t){return r._sdk.host.getKeyPair(t,s.sdkhost.KeyClass.StdSigningKey,s.sdkhost.KeyBiometricProtectionMode.None)})};t.prototype.authenticatorKeyTagForScheme=function(n,i,o,a){var s=this;return new Promise(function(t,e){var r=s.extractPbkdfInputFromInputResponse(a);if(n=="v0"){s._sdk.log(u.LogLevel.Debug,"Using SDK CryptoSettings for migrated enrollment.");o=s._sdk.cryptoSettings}if(!o){throw new u.impl.AuthenticationErrorImpl(u.AuthenticationErrorCode.Internal,"Missing crypt settings for local enrollment.")}s._sdk.host.generatePbkdf2HmacSha1HexString(i,r,o.getLocalEnrollmentKeySizeInBytes(),o.getLocalEnrollmentKeyIterationCount()).then(function(t){var e=u.util.hexToBase64(t);return new c.TarsusKeyPath("per_user",s.user.guid.toString(),"local_auth_keys",s.authenticatorType,n,e)}).then(t,e)})};return t}(t.AuthenticationDriverLocal);t.AuthenticationDriverLocalSecretInputBased=e})(t=c.authenticationdrivers||(c.authenticationdrivers={}))})(t=u.core||(u.core={}))})(t=s.sdk||(s.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(i){var t;(function(t){var e;(function(t){var e=function(n){__extends(t,n);function t(t,e,r){return n.call(this,t,e,r)||this}Object.defineProperty(t.prototype,"authenticatorType",{get:function(){return t.authenticatorName},enumerable:true,configurable:true});t.prototype.handleAuthenticationInputResponse=function(t){var e=t;if(!i.impl.PatternInputImpl.validateFormat(e)){this.processLocalAuthenticatorError(new i.impl.AuthenticationErrorImpl(i.AuthenticationErrorCode.AppImplementation,"Invalid pattern description format."))}else{n.prototype.handleAuthenticationInputResponse.call(this,t)}};t.prototype.handleRegistrationInputResponse=function(t){var e=this._authenticatorConfig;var r=t;if(!i.impl.PatternInputImpl.validateFormat(r)){this.processLocalAuthenticatorError(new i.impl.AuthenticationErrorImpl(i.AuthenticationErrorCode.AppImplementation,"Invalid pattern description format."));return}if(e.min_length&&i.impl.PatternInputImpl.getPatternLength(r)<e.min_length){this.processLocalAuthenticatorError(new i.impl.AuthenticationErrorImpl(i.AuthenticationErrorCode.AppImplementation,"Invalid pattern length."));return}n.prototype.handleRegistrationInputResponse.call(this,t)};t.prototype.extractPbkdfInputFromInputResponse=function(t){var e=t;return i.util.asciiToHex(e.getPatternDescription())};t.prototype.createAuthenticatorSession=function(){return this._uiHandler.createPatternAuthSession(t.authenticatorName,this.user.displayName,3,4)};t.prototype.authenticateInStartedSession=function(t){var e=this;this._inputSession.promiseInput().then(function(t){return e.handleInputOrControlResponse(t)},function(t){return e.completeAuthenticatorSessionWithError(i.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})};t.prototype.registerInStartedSession=function(t){var e=this;this._inputSession.promiseInput().then(function(t){return e.handleInputOrControlResponse(t)},function(t){return e.completeAuthenticatorSessionWithError(i.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})};t.authenticatorName="pattern";return t}(t.AuthenticationDriverLocalSecretInputBased);t.AuthenticationDriverLocalPattern=e})(e=t.authenticationdrivers||(t.authenticationdrivers={}))})(t=i.core||(i.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e;(function(t){var e=function(n){__extends(t,n);function t(t,e,r){return n.call(this,t,e,r)||this}Object.defineProperty(t.prototype,"authenticatorType",{get:function(){return t.authenticatorName},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"pinLength",{get:function(){var t=this._authenticatorConfig;return t.length},enumerable:true,configurable:true});t.prototype.handleRegistrationInputResponse=function(t){var e=t;if(e.getPin().length!=this.pinLength){this.processLocalAuthenticatorError(new r.impl.AuthenticationErrorImpl(r.AuthenticationErrorCode.InvalidInput,"Expecting an entry of length "+this.pinLength+"."))}else{n.prototype.handleRegistrationInputResponse.call(this,t)}};t.prototype.generatePendingEnrollment=function(t){var r=this;return n.prototype.generatePendingEnrollment.call(this,t).then(function(t){var e={length:r.pinLength};t.authenticatorConfig=e;return t})};t.prototype.extractPbkdfInputFromInputResponse=function(t){var e=t;return r.util.asciiToHex(e.getPin())};t.prototype.createAuthenticatorSession=function(){return this._uiHandler.createPinAuthSession(t.authenticatorName,this.user.displayName,this.pinLength)};t.prototype.authenticateInStartedSession=function(t){var e=this;this._inputSession.promiseInput().then(function(t){return e.handleInputOrControlResponse(t)},function(t){return e.completeAuthenticatorSessionWithError(r.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})};t.prototype.registerInStartedSession=function(t){var e=this;this._inputSession.promiseInput().then(function(t){return e.handleInputOrControlResponse(t)},function(t){return e.completeAuthenticatorSessionWithError(r.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})};t.authenticatorName="pin";return t}(t.AuthenticationDriverLocalSecretInputBased);t.AuthenticationDriverLocalPinCode=e})(e=t.authenticationdrivers||(t.authenticationdrivers={}))})(t=r.core||(r.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(i){var t;(function(t){var e;(function(r){var t=function(n){__extends(t,n);function t(t,e,r){return n.call(this,t,e,r)||this}t.prototype.poll=function(){var e=this;this._actionDriver.sendAuthenticatorAssertionRequest(this._authenticatorDescription,"authenticate",this.pollingAssertionData(),{}).then(function(t){if(e.filterAssertionResult(t)&&e.shouldContinuePolling(t)){e.pumpInput()}else{if(!e.handleAuthenticateAssertionResult(t)){e._sdk.log(i.LogLevel.Info,"Authenticator session done.");e.completeAuthenticatorSessionWithResult(new r.AuthenticationDriverSessionResultAuthenticationCompleted(t))}}}).catch(function(t){e.performErrorRecoveryForError(i.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})};return t}(r.AuthenticationDriver);r.AuthenticationDriverPolling=t})(e=t.authenticationdrivers||(t.authenticationdrivers={}))})(t=i.core||(i.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(s){var t;(function(t){var e;(function(t){var e;(function(a){var t;(function(o){var t;(function(r){var t=function(i){__extends(t,i);function t(t,e,r){var n=i.call(this,t,e,r)||this;n.methodName="mobileApprove";n.setupDataModel(e,r);return n}t.prototype.createAuthenticatorSession=function(){var t=this._uiHandler.createMobileApproveAuthSession("mobile_approve",this.user.displayName,this._instructions);if(!t){throw a.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from createMobileApproveAuthSession")}t.setAvailableTargets(this._selectableDevices);if(this._state==o.Protocol.AuthenticationMethodMobileApproveState.WaitForAuthenticate){this._selectedDevices=this._selectableDevices.map(function(t){return t});var e=null;if(this._otp){var r=a.OtpFormatImpl.fromAssertionFormat(this._otp.format);e=s.ts.mobile.sdk.impl.MobileApproveOtpImpl.create(this._otp.value,r)}t.setCreatedApprovalInfo(this._selectedDevices,e)}if(this._authenticationParameters){var n=this._authenticationParameters.filter(function(t){t instanceof a.AuthenticationActionParameterTargetSelection});if(n.length!=0){this._sdk.log(a.LogLevel.Debug,"Target based driver found target selection parameters.");var i=this._selectableDevices.reduce(function(t,e){t[e.getDeviceIdentifier()]=e;return t},{});this._pendingTargetSelection=n.map(function(t){var e=t.getTarget();var r=i[e.getDeviceIdentifier()];if(!r){throw new a.impl.AuthenticationErrorImpl(a.AuthenticationErrorCode.AppImplementation,"Authentication parameter tried to select a device not presented as a selectable target")}return r},{});this._sdk.log(a.LogLevel.Debug,"Target based driver will select targets "+this._pendingTargetSelection+" based on selection parameter.")}}return t};t.prototype.authenticateInStartedSession=function(t){if(this._autoExecuted){this._autoExecuted=false}else{this.reset()}this.pumpInput()};t.prototype.pumpInput=function(){if(this._state===o.Protocol.AuthenticationMethodMobileApproveState.WaitForApproval){this.createApproval()}else if(this._state===o.Protocol.AuthenticationMethodMobileApproveState.WaitForAuthenticate){this.requestInputAndHandle()}else{throw new a.impl.AuthenticationErrorImpl(a.AuthenticationErrorCode.Internal,"Illegal authenticator state encountered: "+this._state)}};t.prototype.registerInStartedSession=function(t){throw new a.impl.AuthenticationErrorImpl(a.AuthenticationErrorCode.Internal,"Cannot register Mobile Approve authenticator.")};t.prototype.createApproval=function(){this._approvalId=null;if(this._pendingTargetSelection&&Object.keys(this._pendingTargetSelection).length){this._sdk.log(a.LogLevel.Debug,"Performing pending target selection "+this._pendingTargetSelection);var t=a.TargetBasedAuthenticatorInput.createTargetsSelectionRequest(this._pendingTargetSelection);this._pendingTargetSelection=null;this.handleAuthenticationInputResponse(t)}else if(this._strategy.user_selection&&this._selectableDevices&&this._selectableDevices.length){this.requestInputAndHandle()}else{this.handleAuthenticationInputResponse(a.TargetBasedAuthenticatorInput.createTargetsSelectionRequest([]))}};t.prototype.requestInputAndHandle=function(){var e=this;this._inputSession.promiseInput().then(function(t){e.handleInputOrControlResponse(t)})};t.prototype.handleAuthenticationInputResponse=function(t){switch(this._state){case o.Protocol.AuthenticationMethodMobileApproveState.WaitForApproval:var e=t.getSelectedTargets();if(e){this.handleTargetSelectionInput(e);break}else throw new a.impl.AuthenticationErrorImpl(a.AuthenticationErrorCode.AppImplementation,"Expected target selection input response but got: "+t);case o.Protocol.AuthenticationMethodMobileApproveState.WaitForAuthenticate:var r=t.getAuthenticatorInput();if(r instanceof a.MobileApproveInputRequestPolling){this.poll();break}else throw new a.impl.AuthenticationErrorImpl(a.AuthenticationErrorCode.AppImplementation,"Expected polling request input response but got: "+t);default:throw new a.impl.AuthenticationErrorImpl(a.AuthenticationErrorCode.Internal,"Illegal state for authenticator: "+this._state)}};t.prototype.handleTargetSelectionInput=function(t){var r=this;this._selectedDevices=t.map(function(t){var e=t;if(r._selectableDevices.indexOf(e)<0){throw new a.impl.AuthenticationErrorImpl(a.AuthenticationErrorCode.AppImplementation,"Attempt to select a Mobile Approve target not originally listed in the session.")}return e});this.createForSelectedTargets()};t.prototype.createForSelectedTargets=function(){var i=this;var t;if(this._selectedDevices&&this._selectedDevices.length){t={device_ids:this._selectedDevices.map(function(t){return t.getDeviceIdentifier()})}}else{t={}}this._actionDriver.sendAuthenticatorAssertionRequest(this._authenticatorDescription,"approval",t,{}).then(function(t){if(!i.handleGeneralAssertionResult(t)){if(t.assertion_error_code){i._sdk.log(a.LogLevel.Error,"Assertion error encoutered. Starting error recovery.");i.performErrorRecoveryForError(a.impl.AuthenticationErrorImpl.errorForAssertionResponse(t))}else{var e=null;var r=t.data;if(r.otp){var n=a.OtpFormatImpl.fromAssertionFormat(r.otp.format);e=s.ts.mobile.sdk.impl.MobileApproveOtpImpl.create(r.otp.value,n)}i._approvalId=r.approval_id||null;i._state=r.state;i._inputSession.setCreatedApprovalInfo(i._selectedDevices,e);i._sdk.log(a.LogLevel.Debug,"Restarting auth or reg.");i.pumpInput()}}}).catch(function(t){i.completeAuthenticatorSessionWithError(t)})};t.prototype.handleRegistrationInputResponse=function(t){throw new a.impl.AuthenticationErrorImpl(a.AuthenticationErrorCode.Internal,"Cannot register Mobile Approve authenticator.")};t.prototype.processControlRequest=function(t){if(t.getRequestType()===a.ControlRequestType.RetryAuthenticator){this.reset()}i.prototype.processControlRequest.call(this,t)};t.prototype.filterAssertionResult=function(t){if(t.assertion_error_code==5){throw new a.impl.AuthenticationErrorImpl(a.AuthenticationErrorCode.ApprovalDenied,"Approval was denied")}else if(t.assertion_error_code==21){throw new a.impl.AuthenticationErrorImpl(a.AuthenticationErrorCode.ApprovalExpired,"Approval has expired")}return true};t.prototype.shouldContinuePolling=function(t){return t.assertion_error_code==13};t.prototype.pollingAssertionData=function(){return{approval_id:this._approvalId}};t.prototype.reset=function(){this._state=o.Protocol.AuthenticationMethodMobileApproveState.WaitForApproval;this._approvalId=null;this._selectedDevices=null;this._inputSession.setCreatedApprovalInfo(null,null)};t.prototype.setupDataModel=function(t,e){this._state=t.state;this._otp=t.otp||null;this._strategy=t.strategy;this._selectableDevices=r.AuthenticationDriverDescriptorMobileApprove.createTargetsFromConfig(t);this._instructions=t.instructions;this._approvalId=t.approval_id||null;if(this._approvalId){this._autoExecuted=true}};return t}(r.AuthenticationDriverPolling);r.AuthenticationDriverMobileApprove=t})(t=o.authenticationdrivers||(o.authenticationdrivers={}))})(t=a.core||(a.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(t=s.ts||(s.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(p){var t;(function(d){var t;(function(s){var t;(function(i){var t=function(n){__extends(r,n);function r(t,e,r){return n.call(this,t,e,r)||this}r.prototype.getBiometricPromptFallbackControlType=function(){return this._biometricPromptFallbackControlType!=null?this._biometricPromptFallbackControlType:d.ControlRequestType.SelectMethod};r.authenticatorKeyTagForUser=function(t,e,r){return new s.TarsusKeyPath("per_user",t.guid.toString(),"local_auth_keys","native_face",e,r)};r.prototype.shouldAllowBiometricFallbackButton=function(t){var e=this;if(!t)return false;var r=this._actionDriver.availableAuthenticatorsForSwitching.filter(function(t){return t!=e._authenticatorDescription});if(this._actionDriver instanceof s.actiondrivers.ActionDriverRegistration||this._actionDriver instanceof s.actiondrivers.ActionDriverAuthentication&&r.length==0)return false;var n=t;var i=n.getFallbackButtonTitle();if(i&&i.length>0){var o=n.getFallbackControlRequestType();if(o==null){o=d.ControlRequestType.SelectMethod}switch(o){case d.ControlRequestType.ChangeMethod:var a=this._actionDriver.availableAuthenticatorsForSwitching.filter(function(t){return t!=e._authenticatorDescription});return a.length>0;case d.ControlRequestType.SelectMethod:return this._actionDriver.availableAuthenticatorsForSwitching.length>0;default:return true}}else{return false}};r.prototype.runSilentRegistration=function(){var n=this;return this.generateFaceNativeKeyForScheme("v2").then(function(t){var e=n.getNewOrUpdatedEnrollmentRecord(t);var r={public_key:t.key.publicKeyToJson(),version:t.schemeVersion};return n._actionDriver.sendAuthenticatorAssertionRequest(n._authenticatorDescription,"register",null,r).then(function(t){if(!t.assertion_error_code){n.user.updateEnrollmentRecord(e);return new i.AuthenticationDriverSessionResultAuthenticationCompleted(t)}else{throw d.impl.AuthenticationErrorImpl.errorForAssertionResponse(t)}})})};r.prototype.createAuthenticatorSession=function(){return this._uiHandler.createNativeFaceAuthSession(i.AuthenticationDriverDescriptorNativeFace.authenticatorName,this.user.displayName)};r.prototype.authenticateInStartedSession=function(t){var e=this;this._inputSession.promiseInput().then(function(t){return e.handleInputOrControlResponse(t)},function(t){return e.completeAuthenticatorSessionWithError(d.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})};r.prototype.registerInStartedSession=function(t){var e=this;n.prototype.registerInStartedSession.call(this,t);this._inputSession.promiseInput().then(function(t){return e.handleInputOrControlResponse(t)},function(t){return e.completeAuthenticatorSessionWithError(d.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})};Object.defineProperty(r.prototype,"authenticatorType",{get:function(){return i.AuthenticationDriverDescriptorNativeFace.authenticatorName},enumerable:true,configurable:true});r.prototype.processLocalAuthenticatorError=function(t){var e=this;var r=t;var n=0;var i=Promise.resolve();if(r.getErrorCode()==d.AuthenticationErrorCode.Internal&&r.getData()){var o=r.getData();n=o[p.sdkhost.ErrorDataNumFailures]||n;r=d.impl.AuthenticationErrorImpl.errorForHostInternalBiometricErrorData(o,"Native Face")||r;if(o[p.sdkhost.ErrorDataInternalError]==p.sdkhost.InternalErrorBiometricNotConfigured&&this._authenticatorDescription.getRegistered()||o[p.sdkhost.ErrorDataInternalError]==p.sdkhost.InternalErrorBiometricInvalidated){i=s.LocalEnrollment.invalidateLocalRegistrationStatusAndNotifyUIHandler(this._sdk.currentSession,this._authenticatorDescription)}}i.catch(function(t){e._sdk.log(d.LogLevel.Error,t)});i.finally(function(){var t=r.getData();if(n&&e._operationMode==d.AuthenticatorSessionMode.Authentication){e.processAuthFailureAssertionAndHandleError(r,n);return}if(t[p.sdkhost.ErrorDataInternalError]==p.sdkhost.InternalErrorBiometricFallbackPressed){e._sdk.log(d.LogLevel.Debug,"Biometric prompt fallback button pressed");e.processControlRequest(d.ControlRequest.create(e.getBiometricPromptFallbackControlType()));return}if(r.getErrorCode()==d.AuthenticationErrorCode.UserCanceled){e._sdk.log(d.LogLevel.Debug,"Native face authenticator captured user cancel error code.");e.invokeUiHandlerCancellation();return}e.performErrorRecoveryForError(r)})};r.prototype.getKeyForEnrollmentDataAndInput=function(u,l){var h=this;return new Promise(function(t,e){var r=l;var n=h.shouldAllowBiometricFallbackButton(r);if(n)h._biometricPromptFallbackControlType=r.getFallbackControlRequestType();var i=h.authenticatorKeyTagForScheme(u.version,u.salt);var o=false;var a=h._sdk.host.getKeyPair(i,p.sdkhost.KeyClass.StdSigningKey,p.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb);if(!a){var s={};s[p.sdkhost.ErrorDataInternalError]=p.sdkhost.InternalErrorBiometricInvalidated;throw new d.impl.AuthenticationErrorImpl(d.AuthenticationErrorCode.Internal,"Attempt to authenticate with invalidated FaceID.",s)}a.setBiometricPromptInfo(r?r.getPrompt():null,n?r.getFallbackButtonTitle():null,h._uiHandler,h._inputSession);var c={key:a};if(u.version=="v0"||u.version=="v1"){h._sdk.log(d.LogLevel.Info,"Native face: Key rollover from "+u.version+" to v2");h.generateKeyForScheme(l,"v2").then(function(t){c.rolloverKeyData=t;c.rolloverReason="Upgrading native face authenticator scheme from "+u.version+" to v2";return c}).then(t,e)}else{t(c)}})};r.prototype.generatePendingEnrollment=function(t){var e=this;var r=t;var n=this.shouldAllowBiometricFallbackButton(r);if(n)this._biometricPromptFallbackControlType=r.getFallbackControlRequestType();return this.generateKeyForScheme(t,"v2").then(function(t){t.key.setBiometricPromptInfo(r.getPrompt(),n?r.getFallbackButtonTitle():null,e._uiHandler,e._inputSession);return t})};r.prototype.generateKeyForScheme=function(t,e){return this.generateFaceNativeKeyForScheme(e)};r.prototype.generateFaceNativeKeyForScheme=function(r){var n;if(r=="v1"||r=="v2"){n=this._sdk.host.generateRandomHexString(24)}else{n=""}var t=this.authenticatorKeyTagForScheme(r,n);return d.util.wrapPromiseWithActivityIndicator(this._uiHandler,this._actionDriver.policyAction(),this._clientContext,this._sdk.host.generateKeyPair(t,p.sdkhost.KeyClass.StdSigningKey,p.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb,true).then(function(t){var e={key:t,salt:n,schemeVersion:r};return e},function(t){if(t.getErrorCode()==d.AuthenticationErrorCode.Internal&&t.getData()){var e=t.getData();var r=d.impl.AuthenticationErrorImpl.errorForHostInternalBiometricErrorData(e,"Native Face");if(r){throw r}}throw t}))};r.prototype.authenticatorKeyTagForScheme=function(t,e){return r.authenticatorKeyTagForUser(this.user,t,e)};return r}(i.AuthenticationDriverLocal);i.AuthenticationDriverNativeFace=t})(t=s.authenticationdrivers||(s.authenticationdrivers={}))})(t=d.core||(d.core={}))})(t=p.sdk||(p.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(a){var t;(function(i){var t;(function(t){var e=function(o){__extends(t,o);function t(t,e,r,n){var i=o.call(this,t,e,n)||this;i._possibleTargets=r;i.setupDataModel(e);return i}t.prototype.getPossibleTargets=function(){return this._possibleTargets};t.prototype.createAuthenticatorSession=function(){if(this._otpInitialState==i.Protocol.AuthenticationMethodOtpState.Validate){this._lastSelectedTarget=this._possibleTargets[0]}var t;if(this._authenticationParameters){t=this._authenticationParameters.filter(function(t){return t instanceof a.AuthenticationActionParameterTargetSelection})}else{t=[]}if(t.length!=0){this._sdk.log(a.LogLevel.Debug,"Target based driver found target selection parameters.");var e=t[0].getTarget().getChannelAssertionId();var r=this._possibleTargets.filter(function(t){return t.getChannelAssertionId()==e});if(r.length){this._pendingTargetSelection=r[0];this._sdk.log(a.LogLevel.Debug,"Target based driver will select target "+this._pendingTargetSelection+" based on selection parameter.");this._lastSelectedTarget=this._pendingTargetSelection}else{this._sdk.log(a.LogLevel.Warning,"Target selection parameter for target based auth driver specified invalid target assertiong id "+e+".")}}var n=this._uiHandler.createOtpAuthSession("otp",this.user.displayName,this._possibleTargets,this._lastSelectedTarget);if(!n){throw a.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from createOtpAuthSession")}n.setAvailableTargets(this._possibleTargets);return n};t.prototype.authenticateInStartedSession=function(t){var e=this;if(this._possibleTargets.length==0){this._sdk.log(a.LogLevel.Warning,"No authentication target available for OTP. Doing error recovery.");this.performErrorRecoveryForError(new a.impl.AuthenticationErrorImpl(a.AuthenticationErrorCode.AuthenticatorExternalConfigError,"No targets available for OTP."),true);return}this._sdk.log(a.LogLevel.Debug,"Notifying current session of generated OTP format and target");this._inputSession.setGeneratedOtp(this._format,this._lastSelectedTarget);if(this._pendingTargetSelection){this._sdk.log(a.LogLevel.Debug,"Performing pending target selection "+this._pendingTargetSelection);var r=a.TargetBasedAuthenticatorInput.createTargetsSelectionRequest([this._pendingTargetSelection]);this._pendingTargetSelection=null;this.handleInputOrControlResponse(a.InputOrControlResponse.createInputResponse(r))}else{this._inputSession.promiseInput().then(function(t){e.handleInputOrControlResponse(t)}).catch(function(t){e.completeAuthenticatorSessionWithError(a.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})}};t.prototype.registerInStartedSession=function(t){throw new a.impl.AuthenticationErrorImpl(a.AuthenticationErrorCode.Internal,"Cannot register OTP authenticator.")};t.prototype.handleTargetBasedAuthenticatorConcreteInput=function(t){if(t instanceof a.OtpInputOtpSubmission){this.processAuthenticateAssertion({otp:t.getOtp()},{assertion_id:this._possibleTargets[0].getChannelAssertionId()})}else if(t instanceof a.OtpInputRequestResend){this.triggerForSelectedTarget()}else{throw new a.impl.AuthenticationErrorImpl(a.AuthenticationErrorCode.AppImplementation,"Unknown OTP response type received from application callback.")}};t.prototype.handleAuthenticateAssertionResult=function(t){if(t.data&&t.data.additional_error_code&&t.data.additional_error_code==1){this._sdk.log(a.LogLevel.Debug,"Reached max number of attempts - invalidating current target.");this._lastSelectedTarget=null;this._format=null}return o.prototype.handleAuthenticateAssertionResult.call(this,t)};t.prototype.handleAuthenticationInputResponse=function(t){if(t.getAuthenticatorInput()){this.handleTargetBasedAuthenticatorConcreteInput(t.getAuthenticatorInput())}else if(t.getSelectedTargets()[0]){var e=t.getSelectedTargets();if(e.length>1){throw new a.impl.AuthenticationErrorImpl(a.AuthenticationErrorCode.AppImplementation,"Attempt to select multiple OTP targets while OTP supports only a single target.")}var r=e[0];if(this._possibleTargets.indexOf(r)<0){throw new a.impl.AuthenticationErrorImpl(a.AuthenticationErrorCode.AppImplementation,"Attempt to select an OTP target not originally listed in the session.")}this._lastSelectedTarget=r;this.triggerForSelectedTarget()}else{throw new a.impl.AuthenticationErrorImpl(a.AuthenticationErrorCode.AppImplementation,"Invalid target-based authetnicator response type received from application callback. "+"Target-based authenticator inputs must be created by calling "+"TargetBasedAuthenticatorInput.createAuthenticatorInput.")}};t.prototype.triggerForSelectedTarget=function(){var e=this;if(!this._lastSelectedTarget){throw new a.impl.AuthenticationErrorImpl(a.AuthenticationErrorCode.Internal,"Attempt to trigger OTP generation without a selected target.")}var t={target_id:this._lastSelectedTarget.getTargetIdentifier(),channel_index:this._lastSelectedTarget.getChannelIndex()};var r={assertion_id:this._lastSelectedTarget.getChannelAssertionId()};this._actionDriver.sendAuthenticatorAssertionRequest(this._authenticatorDescription,"otp",t,r).then(function(t){if(t.assertion_error_code&&t.assertion_error_code!=i.Protocol.AssertionErrorCode.FailOver){e._sdk.log(a.LogLevel.Error,"Assertion error encoutered. Clearing last selected target.");e._lastSelectedTarget=null}if(!e.handleAuthenticateAssertionResult(t)){if(t.data&&t.data.otp_format){e._sdk.log(a.LogLevel.Debug,"Received updated OTP and format.");e._format=a.OtpFormatImpl.fromAssertionFormat(t.data.otp_format)}e._sdk.log(a.LogLevel.Debug,"Restarting auth or reg.");e.authOrRegInStartedSession(true)}}).catch(function(t){e.completeAuthenticatorSessionWithError(t)})};t.prototype.handleRegistrationInputResponse=function(t){throw new a.impl.AuthenticationErrorImpl(a.AuthenticationErrorCode.Internal,"Cannot register OTP authenticator.")};t.prototype.setupDataModel=function(t){this._otpInitialState=t.state;var e=t.format||t.otp_format;this._format=e&&a.OtpFormatImpl.fromAssertionFormat(e)||null};return t}(t.AuthenticationDriver);t.AuthenticationDriverOtp=e})(t=i.authenticationdrivers||(i.authenticationdrivers={}))})(t=a.core||(a.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(i){var t;(function(t){var e;(function(t){var e=function(n){__extends(t,n);function t(t,e,r){return n.call(this,t,e,r)||this}t.prototype.createAuthenticatorSession=function(){return this._uiHandler.createPasswordAuthSession("password",this.user.displayName)};t.prototype.authenticateInStartedSession=function(t){var e=this;this._inputSession.promiseInput().then(function(t){return e.handleInputOrControlResponse(t)},function(t){return e.completeAuthenticatorSessionWithError(i.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})};t.prototype.registerInStartedSession=function(t){var e=this;this._inputSession.promiseInput().then(function(t){return e.handleInputOrControlResponse(t)},function(t){return e.completeAuthenticatorSessionWithError(i.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})};t.prototype.handleAuthenticationInputResponse=function(t){var e=t;var r=e.getPassword();if(r&&r.length>0){this.processAuthenticateAssertion({password:r});return}this.performErrorRecoveryForError(new i.impl.AuthenticationErrorImpl(i.AuthenticationErrorCode.InvalidInput,"Password can't be empty"))};t.prototype.handleRegistrationInputResponse=function(t){var e=t;var r=e.getPassword();if(r&&r.length>0){this.processRegisterAssertion({password:r});return}this.performErrorRecoveryForError(new i.impl.AuthenticationErrorImpl(i.AuthenticationErrorCode.InvalidInput,"Password can't be empty"))};return t}(t.AuthenticationDriver);t.AuthenticationDriverPassword=e})(e=t.authenticationdrivers||(t.authenticationdrivers={}))})(t=i.core||(i.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(i){var t;(function(t){var e;(function(t){var e=function(n){__extends(t,n);function t(t,e,r){return n.call(this,t,e,r)||this}t.prototype.createAuthenticatorSession=function(){return this._uiHandler.createPatternAuthSession("pattern_centralized",this.user.displayName,3,4)};t.prototype.handleAuthenticationInputResponse=function(t){var e=t;if(!i.impl.PatternInputImpl.validateFormat(e)){this.performErrorRecoveryForError(new i.impl.AuthenticationErrorImpl(i.AuthenticationErrorCode.AppImplementation,"Invalid pattern description format."))}else{n.prototype.handleAuthenticationInputResponse.call(this,t)}};t.prototype.handleRegistrationInputResponse=function(t){var e=t;var r=this._authenticatorConfig;if(!i.impl.PatternInputImpl.validateFormat(e)){this.performErrorRecoveryForError(new i.impl.AuthenticationErrorImpl(i.AuthenticationErrorCode.AppImplementation,"Invalid pattern description format."));return}if(r.min_length&&i.impl.PatternInputImpl.getPatternLength(e)<r.min_length){this.performErrorRecoveryForError(new i.impl.AuthenticationErrorImpl(i.AuthenticationErrorCode.AppImplementation,"Invalid pattern length."));return}n.prototype.handleRegistrationInputResponse.call(this,t)};t.prototype.generateSecretToSignForInputResponse=function(t){var e=t;return e.getPatternDescription()};return t}(t.AuthenticationDriverCentralizedSecretInputBased);t.AuthenticationDriverPattern=e})(e=t.authenticationdrivers||(t.authenticationdrivers={}))})(t=i.core||(i.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e;(function(t){var e=function(n){__extends(t,n);function t(t,e,r){return n.call(this,t,e,r)||this}Object.defineProperty(t.prototype,"pinLength",{get:function(){var t=this._authenticatorConfig;return t.length},enumerable:true,configurable:true});t.prototype.createAuthenticatorSession=function(){return this._uiHandler.createPinAuthSession("pin_centralized",this.user.displayName,this.pinLength)};t.prototype.handleRegistrationInputResponse=function(t){var e=t;if(e.getPin().length!=this.pinLength){this.performErrorRecoveryForError(new r.impl.AuthenticationErrorImpl(r.AuthenticationErrorCode.InvalidInput,"Invalid PIN length provided.",{expected_length:this.pinLength}));return}n.prototype.handleRegistrationInputResponse.call(this,t)};t.prototype.generateSecretToSignForInputResponse=function(t){var e=t;return e.getPin()};return t}(t.AuthenticationDriverCentralizedSecretInputBased);t.AuthenticationDriverPinCode=e})(e=t.authenticationdrivers||(t.authenticationdrivers={}))})(t=r.core||(r.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(a){var t;(function(o){var t;(function(r){var t;(function(t){var e=function(n){__extends(i,n);function i(t,e,r){return n.call(this,t,e,r)||this}i.prototype.createAuthenticatorSession=function(){var e=this;var r=this.generatePlaceholderServerTokenGenerationPayload();var t=i.placeholderExtensionPoint.firstNonNull(function(t){return t.createPlaceholderAuthSession(e._authenticatorDescription.getPlaceholderId(),e._authenticatorConfig.placeholder_type||"",e._authenticatorDescription.getName()||"",e.user.displayName,e._authenticatorConfig.data||"",r)});if(t){return t}return this._uiHandler.createPlaceholderAuthSession(this._authenticatorDescription.getPlaceholderId(),this._authenticatorConfig.placeholder_type||"",this._authenticatorDescription.getName()||"",this.user.displayName,this._authenticatorConfig.data||"",r)};i.prototype.authenticateOrRegisterInStratedSession=function(t){var e=this;this._inputSession.promiseInput().then(function(t){return e.handleInputOrControlResponse(t)},function(t){return e.completeAuthenticatorSessionWithError(o.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})};i.prototype.authenticateInStartedSession=function(t){this.authenticateOrRegisterInStratedSession(t)};i.prototype.registerInStartedSession=function(t){this.authenticateOrRegisterInStratedSession(t)};i.prototype.handleAuthenticationInputResponse=function(t){this.handleAuthenticationOrRegistrationInputResponse(t)};i.prototype.handleRegistrationInputResponse=function(t){this.handleAuthenticationOrRegistrationInputResponse(t)};i.prototype.handleAuthenticationOrRegistrationInputResponse=function(t){if(t instanceof o.PlaceholderAuthSuccessResponse){this._sdk.log(o.LogLevel.Debug,"Placeholder received PlaceholderAuthSuccessResponse.");this.handlePlaceholderSuccessResponse(t)}else if(t instanceof o.PlaceholderAuthFailureResponse){this._sdk.log(o.LogLevel.Debug,"Placeholder received PlaceholderAuthFailureResponse.");this.handlePlaceholderFailureResponse(t)}else if(t instanceof o.PlaceholderAuthFailureWithServerProvidedStatusResponse){this._sdk.log(o.LogLevel.Debug,"Placehoder received PlaceholderAuthFailureWithServerProvidedStatusResponse");this.processAuthFailureAssertionAndHandleError(t.getFailureError(),1)}else{this._sdk.log(o.LogLevel.Error,"Placeholder received unknkown response type.");this.performErrorRecoveryForError(new o.impl.AuthenticationErrorImpl(o.AuthenticationErrorCode.AppImplementation,"Placeholder received unknkown response type."))}};i.prototype.handlePlaceholderSuccessResponse=function(t){var e={token:t.getPlaceholderToken()};if(this._operationMode==o.AuthenticatorSessionMode.Authentication){this.processAuthenticateAssertion(e)}else{this.processRegisterAssertion(e)}};i.prototype.handlePlaceholderFailureResponse=function(t){this._actionDriver.sendAuthenticatorAssertionRequest(this._authenticatorDescription,"auth_failure",{num_of_failures:1});var e={status:t.getRegistrationStatus()==o.AuthenticatorRegistrationStatus.Registered?r.Protocol.AuthenticationMethodStatus.Registered:r.Protocol.AuthenticationMethodStatus.Unregistered,expired:t.getExpired(),locked:t.getLocked(),last_used:0};this._authenticatorDescription.updateWithAuthenticatorState(e);this.performErrorRecoveryForError(t.getFailureError())};i.prototype.generatePlaceholderServerTokenGenerationPayload=function(){var t=this.user.deviceId||this._actionDriver._controlFlowProcessor._session.deviceId();var e={assertion_id:this._authenticatorDescription.assertionId,challenge:this._actionDriver._controlFlowProcessor.challenge,device_id:t,auth_type:this._authenticatorDescription.getAuthenticatorId()};return btoa(JSON.stringify(e))};i.placeholderExtensionPoint=new r.ExtensionPoint(a.tarsusplugin.TARSUS_EXTENSION_POINT_NAME_PLACEHOLDER_EXTENSION);return i}(t.AuthenticationDriver);t.AuthenticationDriverPlaceholder=e})(t=r.authenticationdrivers||(r.authenticationdrivers={}))})(t=o.core||(o.core={}))})(t=a.sdk||(a.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(o){var t;(function(t){var e;(function(t){var e=function(i){__extends(t,i);function t(t,e,r){var n=i.call(this,t,e,r)||this;n._pendingRestartRequest=false;return n}t.prototype.createAuthenticatorSession=function(){this._pendingRestartRequest=false;return this._uiHandler.createSecurityQuestionAuthSession("question",this.user.displayName)};t.prototype.authenticateInStartedSession=function(e){var r=this;var t=Promise.resolve(null);if(this._pendingRestartRequest){this._pendingRestartRequest=false;t=this._actionDriver.sendAuthenticatorAssertionRequest(this._authenticatorDescription,"restart",{}).then(function(t){if(t.data&&t.data.question){r._currentStep=r.loadStepFromQuestionDict(t.data.question)}else{r.completeAuthenticatorSessionWithError(new o.impl.AuthenticationErrorImpl(o.AuthenticationErrorCode.Internal,"Unexpected response to question restart request."))}})}t.then(function(t){i.prototype.authenticateInStartedSession.call(r,e)})};t.prototype.loadStepFromQuestionDict=function(t){var e=Object.keys(t);if(e.length!=1){throw new o.impl.AuthenticationErrorImpl(o.AuthenticationErrorCode.Internal,"Expecting a single authentication question.")}return o.impl.SecurityQuestionStepDescriptionImpl.createForAuthQuestion(new o.impl.SecurityQuestionImpl(e[0],t[e[0]],true))};t.prototype.createInitialInputStep=function(){var t=this._authenticatorConfig;switch(this._operationMode){case o.AuthenticatorSessionMode.Authentication:if(!t.question){throw new o.impl.AuthenticationErrorImpl(o.AuthenticationErrorCode.Internal,"Expecting authentication question dictionary.")}return this.loadStepFromQuestionDict(t.question);case o.AuthenticatorSessionMode.Registration:if(!t.questions||!t.reg_min_questions){throw new o.impl.AuthenticationErrorImpl(o.AuthenticationErrorCode.Internal,"Expecting registration question dictionary.")}var e=t.questions;var r=Object.keys(e).map(function(t){return new o.impl.SecurityQuestionImpl(t,e[t].text,e[t].registered)});return o.impl.SecurityQuestionStepDescriptionImpl.createForRegistrationQuestions(r,t.reg_min_questions)}};t.prototype.prepareNextAuthenticationStep=function(t){return this.loadStepFromQuestionDict(t.data.question)};t.prototype.updateCurrentAuthenticationStep=function(t,e){return e};t.prototype.handleAuthenticationInputResponse=function(t){var e=t;this.verifyValidAnswers(e);if(e.getAnswers().length!=1){throw new o.impl.AuthenticationErrorImpl(o.AuthenticationErrorCode.AppImplementation,"Expecting exactly one answer on secuirty question authentication.")}var r=this.securityQuestionAnswersResposneToAnswerMap(e);this.processAuthenticateAssertion({answer:r})};t.prototype.handleRegistrationInputResponse=function(t){var e=t;this.verifyValidAnswers(e);if(this.currentSecurityQuestionsStep().getMinAnswersNeeded()>e.getAnswers().length){throw new o.impl.AuthenticationErrorImpl(o.AuthenticationErrorCode.AppImplementation,"Not enough answers provided to security questions registration process.")}var r=this.securityQuestionAnswersResposneToAnswerMap(e);this.processRegisterAssertion({answers:r})};t.prototype.handleErrorRecoveryAction=function(t,e){if(e.getErrorCode()==o.AuthenticationErrorCode.InvalidInput){this._pendingRestartRequest=true}i.prototype.handleErrorRecoveryAction.call(this,t,e)};t.prototype.verifyValidAnswers=function(t){for(var e=0,r=t.getAnswers();e<r.length;e++){var n=r[e];if(n.getAnswer()&&(!n.getAnswer().getAnswerText()||n.getAnswer().getAnswerText().length==0)){throw new o.impl.AuthenticationErrorImpl(o.AuthenticationErrorCode.AppImplementation,"Empty answers are not allowed.")}}};t.prototype.securityQuestionAnswersResposneToAnswerMap=function(t){var r=this;var n={};t.getAnswers().forEach(function(t){if(r.currentSecurityQuestionsStep().getSecurityQuestions().indexOf(t.getQuestion())<0){throw new o.impl.AuthenticationErrorImpl(o.AuthenticationErrorCode.AppImplementation,"Answer provided to a question not included in this step.")}var e=r._sdk.host.calcHexStringEncodedSha256Hash(o.util.asciiToHex(t.getAnswer().getAnswerText().toLowerCase()));n[t.getQuestion().getSecurityQuestionId()]=e});return n};t.prototype.currentSecurityQuestionsStep=function(){return this._currentStep};return t}(t.AuthenticationDriverMultiStep);t.AuthenticationDriverSecurityQuestions=e})(e=t.authenticationdrivers||(t.authenticationdrivers={}))})(t=o.core||(o.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(){}return t}();t.AuthenticationDriverSessionResult=e;var r=function(n){__extends(t,n);function t(t,e){var r=n.call(this)||this;r.requiredAuthenticator=t||null;r.allowedAuthenticators=e||null;return r}return t}(e);t.AuthenticationDriverSessionResultSwitchAuthenticator=r;var n=function(r){__extends(t,r);function t(t){var e=r.call(this)||this;e.assertionResult=t;return e}return t}(e);t.AuthenticationDriverSessionResultAuthenticationCompleted=n})(e=t.authenticationdrivers||(t.authenticationdrivers={}))})(e=t.core||(t.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(a){var t;(function(n){var t;(function(r){var t=function(i){__extends(t,i);function t(t,e,r){var n=i.call(this,t,e,r)||this;n._previousSelectedDevices=[];n.methodName="totp";n.setupDataModel(e,r);return n}t.prototype.setupDataModel=function(t,e){this._state=t.state;this._requiresChallengeGeneration=t.state!=n.Protocol.AuthenticationMethodTotpState.Validate;this._selectedDevices=null;if(this._state==n.Protocol.AuthenticationMethodTotpState.Validate&&t.challenge){this._challenge=this.createTotpChallenge(t.challenge)}if(t.selectable_devices){this._selectableDevices=r.AuthenticationDriverDescriptorTotp.createTargetsFromConfig(t)}else{this._selectableDevices=null}};t.prototype.createAuthenticatorSession=function(){if(this._authenticationParameters){var t=this._authenticationParameters.filter(function(t){t instanceof a.AuthenticationActionParameterTargetSelection});if(this._selectableDevices&&t.length!=0){this._sdk.log(a.LogLevel.Debug,"Target based driver found target selection parameters.");var n=this._selectableDevices.reduce(function(t,e){t[e.getDeviceIdentifier()]=e;return t},{});this._pendingTargetSelection=t.map(function(t){var e=t.getTarget();var r=n[e.getDeviceIdentifier()];if(!r){throw new a.impl.AuthenticationErrorImpl(a.AuthenticationErrorCode.AppImplementation,"Authentication parameter tried to select a device not presented as a selectable target")}return r},{});this._sdk.log(a.LogLevel.Debug,"Target based driver will select targets "+this._pendingTargetSelection+" based on selection parameter.")}}var e=this._uiHandler.createTotpAuthSession("totp",this.user.displayName);if(!e){throw a.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from createTotpAuthSession")}e.setAvailableTargets(this._selectableDevices);return e};t.prototype.handleRegistrationInputResponse=function(t){throw new a.impl.AuthenticationErrorImpl(a.AuthenticationErrorCode.Internal,"Cannot register TOTP authenticator.")};t.prototype.registerInStartedSession=function(t){throw new a.impl.AuthenticationErrorImpl(a.AuthenticationErrorCode.Internal,"Cannot register TOTP authenticator.")};t.prototype.authenticateInStartedSession=function(t){if(!this._selectedDevices&&this._pendingTargetSelection&&this._pendingTargetSelection.length){this._sdk.log(a.LogLevel.Debug,"TOTP authentication driver has "+this._pendingTargetSelection.length+" pending targets.");this._selectedDevices=this._pendingTargetSelection}this.requestInput()};t.prototype.requestInput=function(){var e=this;this._inputSession.setTargetDevices(this._selectedDevices);this._inputSession.setChallenge(this._challenge);if(this.pendingChallengeGeneration()){this.sendGenerateTotpAssertion()}else{this._inputSession.promiseInput().then(function(t){e.handleInputOrControlResponse(t)}).catch(function(t){e.performErrorRecoveryForError(a.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})}};t.prototype.handleAuthenticationInputResponse=function(t){var e=t.getAuthenticatorInput();var r=t.getSelectedTargets();if(e){this._sdk.log(a.LogLevel.Debug,"Handling OTP code Input.");var n=e.getCode();var i={totp:n};if(this._selectedDevices){i.device_ids=this._selectedDevices.map(function(t){return t.getDeviceIdentifier()})}this.processAuthenticateAssertion(i)}else if(r&&this._selectableDevices){var o=this._selectableDevices;this._sdk.log(a.LogLevel.Debug,"Handling target selection Input.");this._selectedDevices=r.map(function(t){var e=t;if(o.indexOf(e)<0){throw new a.impl.AuthenticationErrorImpl(a.AuthenticationErrorCode.AppImplementation,"Attempt to select a Totp target not originally listed in the session.")}return e});if(this._selectedDevices.length===0){throw new a.impl.AuthenticationErrorImpl(a.AuthenticationErrorCode.InvalidInput,"No targets selected for TOTP.")}this.requestInput()}else{throw new a.impl.AuthenticationErrorImpl(a.AuthenticationErrorCode.AppImplementation,"Invalid target-based authenticator response type received from application callback. "+"Target-based authenticator inputs must be created by calling "+"TargetBasedAuthenticatorInput.createAuthenticatorInput.")}};t.prototype.sendGenerateTotpAssertion=function(){var e=this;var t={};if(this._selectedDevices){t.device_ids=this._selectedDevices.map(function(t){return t.getDeviceIdentifier()})}this._sdk.log(a.LogLevel.Debug,"Requesting TOTP generation");this._actionDriver.sendAuthenticatorAssertionRequest(this._authenticatorDescription,"generate",t,{}).then(function(t){e._previousSelectedDevices=e._selectedDevices||[];if(t.assertion_error_code&&t.assertion_error_code!=n.Protocol.AssertionErrorCode.FailOver){e._sdk.log(a.LogLevel.Error,"Assertion error encountered.");e._selectedDevices=null}if(!e.handleAuthenticateAssertionResult(t)&&t.data){e._state=t.data.state;if(t.data.challenge){e._challenge=e.createTotpChallenge(t.data.challenge)}e.requestInput()}}).catch(function(t){e.performErrorRecoveryForError(a.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})};t.prototype.pendingChallengeGeneration=function(){var t=this._selectedDevices&&(this._previousSelectedDevices.length!==this._selectedDevices.length||this._previousSelectedDevices.some(function(t,e){return t!==this._selectedDevices[e]},this));var e=!this._selectableDevices;return this._requiresChallengeGeneration&&(t||e&&this._state==n.Protocol.AuthenticationMethodTotpState.Generate)};t.prototype.createTotpChallenge=function(t){var e=new a.TotpChallenge;e.setValue(t.value);e.setFormat(a.TotpChallengeFormatImpl.fromAssertionFormat(t.format));return e};t.prototype.handleAuthenticateAssertionResult=function(t){if(t.assertion_error_code&&t.assertion_error_code==n.Protocol.AssertionErrorCode.RepeatCurrentStep&&t.data&&t.data.reason=="check_digit"){this._sdk.log(a.LogLevel.Info,"handleAuthenticateAssertionResult() for Totp code with incorrect check digit");var e=new a.impl.AuthenticationErrorImpl(a.AuthenticationErrorCode.InvalidInput,t.assertion_error_message||"Totp code with incorrect check digit");e.setPublicProperty(a.AuthenticationErrorProperty.AuthenticatorInvalidInputErrorDescription,a.AuthenticationErrorPropertySymbol.AuthenticatorInvalidInputErrorDescriptionTotpIncorrectCheckDigit);this.performErrorRecoveryForError(e);return true}return i.prototype.handleAuthenticateAssertionResult.call(this,t)};return t}(r.AuthenticationDriver);r.AuthenticationDriverTotp=t})(t=n.authenticationdrivers||(n.authenticationdrivers={}))})(t=a.core||(a.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(i){var t;(function(t){var e;(function(t){var r;(function(t){t["LONG"]="tooLong";t["SHORT"]="tooShort";t["LOUD"]="tooLoud";t["SOFT"]="tooSoft";t["NOISY"]="tooNoisy";t["WRONG_PASSPHRASE"]="wrongPassphrase";t["VALID_PASSPHRASE"]="000"})(r||(r={}));var e=function(n){__extends(t,n);function t(t,e,r){return n.call(this,t,e,r)||this}t.prototype.createAuthenticatorSession=function(){return this._uiHandler.createVoiceAuthSession("voice",this.user.displayName)};t.prototype.updatePassphraseFromAssertionResultIfNeeded=function(t){var e=t.data;if(e){var r=e.passphrase_text;if(r){this._sdk.log(i.LogLevel.Info,"handleAuthenticateAssertionResult() received updated passphrase");var n=this._authenticatorConfig;n.passphrase_text=r}}};t.prototype.handleRegisterAssertionResult=function(t){this.updatePassphraseFromAssertionResultIfNeeded(t);return n.prototype.handleRegisterAssertionResult.call(this,t)};t.prototype.handleAuthenticateAssertionResult=function(t){this.updatePassphraseFromAssertionResultIfNeeded(t);return n.prototype.handleAuthenticateAssertionResult.call(this,t)};t.prototype.createInitialInputStep=function(){var t=this._authenticatorConfig;return new i.impl.AudioAcquisitionStepDescriptionImpl(this.createStepTag(),t.passphrase_text)};t.prototype.prepareNextAuthenticationStep=function(t){var e=this._authenticatorConfig;return new i.impl.AudioAcquisitionStepDescriptionImpl(this.createStepTag(t.data&&t.data.additional_error_code),e.passphrase_text)};t.prototype.updateCurrentAuthenticationStep=function(t,e){return this.prepareNextAuthenticationStep(t)};t.prototype.handleAuthenticationInputResponse=function(t){var e=t;this.processAuthenticateAssertion(e.getAcquisitionResponse())};t.prototype.handleRegistrationInputResponse=function(t){var e=t;this.processRegisterAssertion(e.getAcquisitionResponse())};t.prototype.createStepTag=function(t){var e=t?this.mapHintToVoiceError(t):r.VALID_PASSPHRASE;return"voice_"+e};t.prototype.mapHintToVoiceError=function(t){switch(t){case 101:return r.LONG;case 102:return r.SHORT;case 103:return r.LOUD;case 104:return r.SOFT;case 105:return r.NOISY;case 106:return r.WRONG_PASSPHRASE;default:throw new i.impl.AuthenticationErrorImpl(i.AuthenticationErrorCode.Internal,"Voice error code "+t+" is unknown/unhandled")}};return t}(t.AuthenticationDriverMultiStep);t.AuthenticationDriverVoice=e})(e=t.authenticationdrivers||(t.authenticationdrivers={}))})(t=i.core||(i.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){t.AuthenticatorDrivers={password:new t.SimpleAuthenticationDriverDescriptor(t.AuthenticationDriverPassword),pin_centralized:new t.SimpleAuthenticationDriverDescriptor(t.AuthenticationDriverPinCode),pin:new t.AuthenticationDriverDescriptorLocal(t.AuthenticationDriverLocalPinCode,t.AuthenticationDriverLocalPinCode.authenticatorName),pattern:new t.AuthenticationDriverDescriptorLocal(t.AuthenticationDriverLocalPattern,t.AuthenticationDriverLocalPattern.authenticatorName),pattern_centralized:new t.SimpleAuthenticationDriverDescriptor(t.AuthenticationDriverPattern),fingerprint:new t.AuthenticationDriverDescriptorFingerprint,face_id:new t.AuthenticationDriverDescriptorNativeFace,otp:new t.AuthenticationDriverDescriptorOtp,face_server:new t.AuthenticationDriverDescriptorFace,voice_server:new t.AuthenticationDriverDescriptorVoice,mobile_approve:new t.AuthenticationDriverDescriptorMobileApprove,totp:new t.AuthenticationDriverDescriptorTotp,question:new t.SimpleAuthenticationDriverDescriptor(t.AuthenticationDriverSecurityQuestions),fido2:new t.AuthenticationDriverDescriptorFido2(t.AuthenticationDriverFido2),__placeholder:new t.SimpleAuthenticationDriverDescriptor(t.AuthenticationDriverPlaceholder)}})(e=t.authenticationdrivers||(t.authenticationdrivers={}))})(e=t.core||(t.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(t){this.enabledCollectors=t}t.prototype.isEnabled=function(){var t=this.getAssociatedCollectorType();if(t==null){return true}return this.enabledCollectors.indexOf(t)!=-1};return t}();t.Collector=e})(e=t.collectors||(t.collectors={}))})(e=t.core||(t.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(o){var t;(function(t){var e;(function(t){var e=function(n){__extends(t,n);function t(t,e){var r=n.call(this,t)||this;r.cacheValidityPeriod=e;return r}t.prototype.provide=function(n){var i=this;return new Promise(function(e,t){var r=i.getCachedData(n);if(r){e(r)}else{i.provideNewData(n).then(function(t){i.saveCollectionResultToLocalStorage(n,t);e(t)},t)}})};t.prototype.saveCollectionResultToLocalStorage=function(t,e){var r=t.host;var n=this.getSchemeVersionTarsusKeyPath();var i=new Object;i.timeStamp=Date.now();i.collectionResult=e;r.writeStorageKey(n,i)};t.prototype.getCachedData=function(t){var e=t.host;var r=this.getSchemeVersionTarsusKeyPath();var n=e.readStorageKey(r);if(!n.collectionResult||!n.timeStamp){t.log(o.LogLevel.Debug,"No collected data found in cache.");return null}var i=n.timeStamp;if(Date.now()-i>this.cacheValidityPeriod){t.log(o.LogLevel.Debug,"Cached collected data invalidated.");return null}t.log(o.LogLevel.Debug,"Loaded cached collector data: "+JSON.stringify(n.collectionResult));return n.collectionResult};return t}(t.Collector);t.CacheableCollector=e})(e=t.collectors||(t.collectors={}))})(t=o.core||(o.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(n){var t;(function(r){var t;(function(t){var e;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.provide=function(t){var e=new Object;var r=new Object;r.audio_acquisition_supported=t.host.queryHostInfo(n.sdkhost.HostInformationKey.AudioAcquitisionSupported)=="true";r.finger_print_supported=t.host.queryHostInfo(n.sdkhost.HostInformationKey.FingerprintSupported)=="true";r.image_acquisition_supported=t.host.queryHostInfo(n.sdkhost.HostInformationKey.ImageAcquitisionSupported)=="true";r.persistent_keys_supported=t.host.queryHostInfo(n.sdkhost.HostInformationKey.PersistentKeysSupported)=="true";r.face_id_key_bio_protection_supported=t.host.queryHostInfo(n.sdkhost.HostInformationKey.FaceIdKeyBioProtectionSupported)=="true";r.fido_client_present=t.host.queryHostInfo(n.sdkhost.HostInformationKey.FidoClientPresent)=="true";r.dyadic_present=t.host.queryHostInfo(n.sdkhost.HostInformationKey.DyadicPresent)=="true";r.installed_plugins=t.pluginManager.getInitializedPlugins().map(function(t){return{plugin_name:t.getPluginInfo().getPluginName(),plugin_version:n.tarsusplugin.impl.PluginInfoImpl.versionToString(t.getPluginInfo())}});if(t.host.queryHostInfo(n.sdkhost.HostInformationKey.HostProvidedFeatures)!=""){r.host_provided_features=t.host.queryHostInfo(n.sdkhost.HostInformationKey.HostProvidedFeatures)}e=r;return Promise.resolve(e)};e.prototype.getAssociatedCollectorType=function(){return r.CollectorType.Capabilities};return e}(t.Collector);t.CapabilitiesCollector=e})(e=t.collectors||(t.collectors={}))})(t=r.core||(r.core={}))})(t=n.sdk||(n.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(u){var t;(function(c){var t;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.provide=function(t){var e=new Object;for(var r in u.CollectorType){e[r]=c.Protocol.CollectorState.Disabled}for(var n=0,i=this.enabledCollectors;n<i.length;n++){var o=i[n];e[o]=c.Protocol.CollectorState.Active}var a=new Object;for(var s in u.CollectorType){if(this.isNumeric(s)){a[u.CollectorType[s].toLowerCase()]=e[s]}}return Promise.resolve(a)};e.prototype.getAssociatedCollectorType=function(){return null};e.prototype.isNumeric=function(t){return parseInt(t,10)>=0};return e}(t.Collector);t.CollectorsStateCollector=e})(t=c.collectors||(c.collectors={}))})(t=u.core||(u.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(n){var t;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.provide=function(t){var e=t.host.readStorageKey(n.User.storageKey);e.length=e.length||0;var r=new Object;r.logged_users=e.length;return Promise.resolve(r)};e.prototype.getAssociatedCollectorType=function(){return r.CollectorType.DeviceDetails};return e}(t.Collector);t.DeviceDetailsCollector=e})(t=n.collectors||(n.collectors={}))})(t=r.core||(r.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(h){var t;(function(l){var t;(function(t){var e=function(e){__extends(r,e);function r(t){return e.call(this,t,r.cacheValidityPeriod)||this}r.prototype.provideNewData=function(c){var u=this;return new Promise(function(r,t){if(!c.currentSession){throw"No valid session."}var n=new Object;c.log(h.LogLevel.Debug,"Refreshing fido authenticators data");var e=new Array;var i=l.authenticationdrivers._fidoClientProviders;for(var o=0,a=i;o<a.length;o++){var s=a[o];e.push(s.getAvailableAuthenticatorsIds(c))}Promise.all(e.map(function(t){return t.catch(function(t){return new Error(t)})})).then(function(t){var e=u.getCollectedAaids(t,c);n.fido=e;r(n)}).catch(function(t){c.log(h.LogLevel.Error,"Error parsing fido authenticators collection results"+t);r({})})})};r.prototype.getAssociatedCollectorType=function(){return h.CollectorType.FidoAuthenticators};r.prototype.getSchemeVersionTarsusKeyPath=function(){return new l.TarsusKeyPath("fido_collection_result")};r.prototype.getCollectedAaids=function(t,e){var r=new Array;for(var n=0,i=t;n<i.length;n++){var o=i[n];if(o instanceof Error){e.log(h.LogLevel.Error,"Error collecting fido authenticators details "+o)}else{if(o&&o.length>0){for(var a=0,s=o;a<s.length;a++){var c=s[a];if(c){var u=new Object;u.aaid=c;r.push(u)}}}}}return r};r.cacheValidityPeriod=7*24*60*60*1e3;return r}(t.CacheableCollector);t.FidoAuthenticatorsCollector=e})(t=l.collectors||(l.collectors={}))})(t=h.core||(h.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(n){var t;(function(r){var t;(function(t){var e=function(t){__extends(a,t);function a(){return t!==null&&t.apply(this,arguments)||this}a.prototype.provide=function(t){var e=new Object;for(var r=0,n=a.authenticatorDriversLocal;r<n.length;r++){var i=n[r];var o=this.provideLocalEnrollmentData(t,i);if(o){e[i]=o}}return Promise.resolve(e)};a.prototype.getAssociatedCollectorType=function(){return n.CollectorType.LocalEnrollments};a.prototype.provideLocalEnrollmentData=function(t,e){var r=null;if(t.currentSession){var n=t.currentSession.user.localEnrollments[e];if(n){r=new Object;r.registration_status=n.status;r.validation_status=n.validationStatus}}return r};a.authenticatorDriversLocal=[r.authenticationdrivers.AuthenticationDriverLocalPinCode.authenticatorName,r.authenticationdrivers.AuthenticationDriverLocalPattern.authenticatorName,r.authenticationdrivers.AuthenticationDriverDescriptorFingerprint.authenticatorName,r.authenticationdrivers.AuthenticationDriverDescriptorNativeFace.authenticatorName];return a}(t.Collector);t.LocalEnrollmentsCollector=e})(t=r.collectors||(r.collectors={}))})(t=n.core||(n.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){t.TarsusCollectors={capabilities:{createCollector:t.CapabilitiesCollector},collector_state:{createCollector:t.CollectorsStateCollector},device_details:{createCollector:t.DeviceDetailsCollector},hw_authenticators:{createCollector:t.FidoAuthenticatorsCollector},local_enrollments:{createCollector:t.LocalEnrollmentsCollector}}})(e=t.collectors||(t.collectors={}))})(e=t.core||(t.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(){}return t}();t.CredentialOperationResult=e;var r=function(r){__extends(t,r);function t(t){var e=r.call(this)||this;e.signature=t;return e}return t}(e);t.CredentialSignResult=r;var n=function(r){__extends(t,r);function t(t){var e=r.call(this)||this;e.keyPair=t;return e}return t}(e);t.CredentialUnwrapAsymmetricResult=n;var i=function(n){__extends(t,n);function t(t,e){var r=n.call(this)||this;r.requiredAuthenticator=t||null;r.allowedAuthenticators=e||null;return r}return t}(e);t.CredentialAuthOperationResultSwitchAuthenticator=i})(e=t.credential||(t.credential={}))})(e=t.core||(t.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(t,e,r,n){this._credentialId=t;this._host=e;this._user=r;this._sdk=n}Object.defineProperty(t.prototype,"credentialId",{get:function(){return this._credentialId},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"user",{get:function(){return this._user},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"host",{get:function(){return this._host},enumerable:true,configurable:true});return t}();t.PKCredential=e})(e=t.credential||(t.credential={}))})(e=t.core||(t.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(i){var t;(function(t){var e;(function(e){var t=function(o){__extends(t,o);function t(t,e,r,n){var i=o.call(this,t,e,r,n)||this;i._externalCancelled=false;i._uiHandler=e.getUIHandler(i);return i}Object.defineProperty(t.prototype,"authenticatorDescription",{get:function(){return this._authenticatorDescription},enumerable:true,configurable:true});t.prototype.onCancelRun=function(){this._externalCancelled=true};t.prototype.startCredentialSession=function(t){this._authenticatorConfig=this.host.getAuthenticatorConfig(this);this._inputSession=this.createAuthenticatorSession();if(!this._inputSession){throw i.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from authenticator session creation call.")}this._authenticatorDescription=this.host.getAuthenticatorDescription(this);this._inputSession.startSession(this._authenticatorDescription,i.AuthenticatorSessionMode.Authentication,this.host.getPolicyAction(this),t)};t.prototype.endCredentialSession=function(){if(this._inputSession){this._inputSession.endSession()}};t.prototype.promiseRecoveryForError=function(e,r,t){var n=this;if(r.indexOf(t)<0){t=r.indexOf(i.AuthenticationErrorRecovery.SelectAuthenticator)>=0?i.AuthenticationErrorRecovery.SelectAuthenticator:i.AuthenticationErrorRecovery.Fail}return this._inputSession.promiseRecoveryForError(e,r,t).then(function(t){n._sdk.log(i.LogLevel.Debug,"Error recovery selected "+t);n._sdk.log(i.LogLevel.Debug,"recover from error: "+e.getErrorCode());if(r.indexOf(t)<0){n._sdk.log(i.LogLevel.Error,"Invalid error recovery option from callback: "+t+" not in "+r);return Promise.reject(new i.impl.AuthenticationErrorImpl(i.AuthenticationErrorCode.AppImplementation,"Invalid error recovery action selected by callback."))}return t})};t.prototype.authenticateInStartedSession=function(t){var e=this;this._inputSession.promiseInput().then(function(t){return e.handleInputOrControlResponse(t)},function(t){return e.completeCredentialOperationWithError(i.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})};t.prototype.processLocalAuthenticatorError=function(t){this.completeCredentialOperationWithError(t)};t.prototype.completeCredentialOperationWithResult=function(t){this._completionFunction(t)};t.prototype.completeCredentialOperationWithError=function(t){this._rejectionFunction(t)};t.prototype.handleInputOrControlResponse=function(t){try{if(t.isControlRequest()){this.processControlRequest(t.getControlRequest())}else{this.handleAuthenticationInputResponse(t.getResponse())}}catch(t){this.completeCredentialOperationWithError(i.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))}};t.prototype.processControlRequest=function(t){this._sdk.log(i.LogLevel.Debug,"Processing control request "+t.getRequestType());switch(t.getRequestType()){case i.ControlRequestType.AbortAuthentication:this.completeCredentialOperationWithError(new i.impl.AuthenticationErrorImpl(i.AuthenticationErrorCode.UserCanceled,"Authentication cancelled due to abort control request."));break;case i.ControlRequestType.ChangeMethod:this.completeCredentialOperationWithResult(new e.CredentialAuthOperationResultSwitchAuthenticator(null,this.host.availableAuthenticatorsForSwitchMethod(this)));break;case i.ControlRequestType.SelectMethod:this.completeCredentialOperationWithResult(new e.CredentialAuthOperationResultSwitchAuthenticator);break;case i.ControlRequestType.CancelAuthenticator:this.invokeUiHandlerCancellation();break;case i.ControlRequestType.RetryAuthenticator:this.authenticateInStartedSession(true);break;default:this.completeCredentialOperationWithError(new i.impl.AuthenticationErrorImpl(i.AuthenticationErrorCode.Internal,"Invalid ControlRequestType value during authentication session."));break}};t.prototype.invokeUiHandlerCancellation=function(){var e=this;if(this._externalCancelled){this.processControlRequest(i.ControlRequest.create(i.ControlRequestType.AbortAuthentication));return}var r=[i.ControlRequestType.RetryAuthenticator,i.ControlRequestType.AbortAuthentication];if(this.getOtherAuthenticators().length>0){r.push(i.ControlRequestType.ChangeMethod)}if(this.host.availableAuthenticatorsForSwitchMethod(this).length>0){r.push(i.ControlRequestType.SelectMethod)}this._uiHandler.controlOptionForCancellationRequestInSession(r,this._inputSession).then(function(t){if(t.getRequestType()==i.ControlRequestType.CancelAuthenticator){e.completeCredentialOperationWithError(new i.impl.AuthenticationErrorImpl(i.AuthenticationErrorCode.AppImplementation,"controlOptionForCancellationRequestInSession returned CancelAuthenticator which is an invalid option."));return}if(r.indexOf(t.getRequestType())<0){e.completeCredentialOperationWithError(new i.impl.AuthenticationErrorImpl(i.AuthenticationErrorCode.AppImplementation,"controlOptionForCancellationRequestInSession returned an invalid option."));return}e.processControlRequest(t)})};t.prototype.getOtherAuthenticators=function(){var e=this;return this.host.availableAuthenticatorsForSwitchMethod(this).filter(function(t){return t!=e._authenticatorDescription})};return t}(e.PKCredential);e.PKCredentialAuth=t})(e=t.credential||(t.credential={}))})(t=i.core||(i.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(a){var t;(function(e){var t;(function(o){var t=function(i){__extends(t,i);function t(t,e,r,n){return i.call(this,t,e,r,n)||this}t.prototype.evaluateLocalRegistrationStatus=function(){var t=this.user.localEnrollments[this.credentialId];if(!t){return a.AuthenticatorRegistrationStatus.LocallyInvalid}if(t.validationStatus==e.LocalEnrollmentValidationStatus.Invalidated){return a.AuthenticatorRegistrationStatus.LocallyInvalid}else if(t.status!=e.LocalEnrollmentStatus.Registered){return a.AuthenticatorRegistrationStatus.Unregistered}return a.AuthenticatorRegistrationStatus.Registered};Object.defineProperty(t.prototype,"lastObtainedKeyPair",{get:function(){return this._lastObtainedKeyPair},set:function(t){if(this._lastObtainedKeyPair&&this._lastObtainedKeyPair!=t){this._lastObtainedKeyPair.closeKeyPair()}this._lastObtainedKeyPair=t},enumerable:true,configurable:true});t.prototype.endCredentialSession=function(){if(this.lastObtainedKeyPair){this.lastObtainedKeyPair=null}i.prototype.endCredentialSession.call(this)};t.prototype.onCancelRun=function(){i.prototype.onCancelRun.call(this);if(this.lastObtainedKeyPair){this.lastObtainedKeyPair=null}};t.prototype.handleAuthenticationInputResponse=function(t){var e=this;var r=this.user.localEnrollments[this.credentialId];if(!r){this.completeCredentialOperationWithError(new a.impl.AuthenticationErrorImpl(a.AuthenticationErrorCode.NoRegisteredAuthenticator,"Missing key for fingerprint authenticator"));return}this.getKeyForEnrollmentDataAndInput(r,t).then(function(t){e._sdk.log(a.LogLevel.Debug,"Local authenticator key obtained; signing challenge");e.completeCredentialOperationWithResult(t)}).catch(function(t){e.processLocalAuthenticatorError(a.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})};t.prototype.signHex=function(r){var n=this;return new Promise(function(e,t){n._rejectionFunction=t;n._completionFunction=n.buildCompletionFunction(e,t,function(){n.lastObtainedKeyPair.signHex(r).then(function(t){return e(new o.CredentialSignResult(t))},function(t){return n.processLocalAuthenticatorError(a.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})});n.authenticateInStartedSession(false)})};t.prototype.unwrapAsymmetricKeyPairFromPrivateHex=function(r,n){var i=this;return new Promise(function(e,t){i._rejectionFunction=t;i._completionFunction=i.buildCompletionFunction(e,t,function(){i.lastObtainedKeyPair.unwrapAsymmetricKeyPairFromPrivateKeyHex(r,n).then(function(t){return e(new o.CredentialUnwrapAsymmetricResult(t))},function(t){return i.processLocalAuthenticatorError(a.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})});i.authenticateInStartedSession(false)})};t.prototype.buildCompletionFunction=function(e,r,n){var i=this;return function(t){if(t instanceof o.CredentialOperationResult){e(t)}else{i.lastObtainedKeyPair=t;try{n()}catch(t){r(a.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))}}}};return t}(o.PKCredentialAuth);o.PKCredentialAuthLocal=t})(t=e.credential||(e.credential={}))})(t=a.core||(a.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(o){var t;(function(u){var t;(function(c){var t;(function(t){var e=function(i){__extends(t,i);function t(t,e,r,n){return i.call(this,t,e,r,n)||this}t.prototype.getKeyForEnrollmentDataAndInput=function(r,n){var i=this;return new Promise(function(t,e){if(r.version=="v2"){i.getKeyForEnrollmentDataAndInputV2(r,n).then(t,e)}else{i.getKeyForEnrollmentDataAndInputPreV2(r,n).then(t,e)}}).then(function(t){if(!t){throw new u.impl.AuthenticationErrorImpl(u.AuthenticationErrorCode.InvalidInput,"Invalid input provided to credential.")}return t})};t.prototype.getKeyForEnrollmentDataAndInputV2=function(e,t){var r=this;var n=this.extractPbkdfInputFromInputResponse(t);return c.vault.pbkdfStretchHexSecretIntoAESKey(e.salt,n,e.cryptoSettings.getLocalEnrollmentKeySizeInBytes(),e.cryptoSettings.getLocalEnrollmentKeyIterationCount(),true,this._sdk).then(function(t){return t.decrypt(e.keyMaterial,null).then(function(t){return r._sdk.host.generateHexSeededKeyPairExternalRepresentation(o.sdkhost.KeyClass.FidoECCSigningKey,t).then(function(t){return r._sdk.host.importVolatileKeyPair(o.sdkhost.KeyClass.FidoECCSigningKey,t)})})})};t.prototype.getKeyForEnrollmentDataAndInputPreV2=function(t,e){var r=this;return this.authenticatorKeyTagForScheme(t.version,t.salt,t.cryptoSettings,e).then(function(t){return r._sdk.host.getKeyPair(t,o.sdkhost.KeyClass.StdSigningKey,o.sdkhost.KeyBiometricProtectionMode.None)})};t.prototype.authenticatorKeyTagForScheme=function(n,i,o,a){var s=this;return new Promise(function(t,e){var r=s.extractPbkdfInputFromInputResponse(a);if(n=="v0"){s._sdk.log(u.LogLevel.Debug,"Using SDK CryptoSettings for migrated enrollment.");o=s._sdk.cryptoSettings}if(!o){throw new u.impl.AuthenticationErrorImpl(u.AuthenticationErrorCode.Internal,"Missing crypto settings for local enrollment.")}s._sdk.host.generatePbkdf2HmacSha1HexString(i,r,o.getLocalEnrollmentKeySizeInBytes(),o.getLocalEnrollmentKeyIterationCount()).then(function(t){var e=u.util.hexToBase64(t);return new c.TarsusKeyPath("per_user",s.user.guid.toString(),"local_auth_keys",s.credentialId,n,e)}).then(t,e)})};return t}(t.PKCredentialAuthLocal);t.PKCredentialLocalSecretInputBased=e})(t=c.credential||(c.credential={}))})(t=u.core||(u.core={}))})(t=o.sdk||(o.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(n){var t;(function(t){var e;(function(t){var e=function(){function t(){}return t}();t.CredentialAuthPinCodeConfig=e;var r=function(i){__extends(o,i);function o(t,e,r,n){return i.call(this,t,e,r,n)||this}Object.defineProperty(o.prototype,"pinLength",{get:function(){return this._authenticatorConfig.length},enumerable:true,configurable:true});o.prototype.extractPbkdfInputFromInputResponse=function(t){var e=t;return n.util.asciiToHex(e.getPin())};o.prototype.createAuthenticatorSession=function(){return this._uiHandler.createPinAuthSession(this.credentialId,this.user.displayName,this.pinLength)};o.create=function(t,e,r,n){return new o(t,e,r,n)};return o}(t.PKCredentialLocalSecretInputBased);t.PKCredentialLocalPinCode=r})(e=t.credential||(t.credential={}))})(t=n.core||(n.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e;(function(t){var e=function(i){__extends(o,i);function o(t,e,r,n){return i.call(this,t,e,r,n)||this}o.prototype.handleAuthenticationInputResponse=function(t){var e=t;if(!r.impl.PatternInputImpl.validateFormat(e)){this.processLocalAuthenticatorError(new r.impl.AuthenticationErrorImpl(r.AuthenticationErrorCode.AppImplementation,"Invalid pattern description format."))}else{i.prototype.handleAuthenticationInputResponse.call(this,t)}};o.prototype.extractPbkdfInputFromInputResponse=function(t){var e=t;return r.util.asciiToHex(e.getPatternDescription())};o.prototype.createAuthenticatorSession=function(){return this._uiHandler.createPatternAuthSession(this.credentialId,this.user.displayName,3,4)};o.create=function(t,e,r,n){return new o(t,e,r,n)};return o}(t.PKCredentialLocalSecretInputBased);t.PKCredentialLocalPattern=e})(e=t.credential||(t.credential={}))})(t=r.core||(r.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(l){var t;(function(u){var t;(function(a){var t;(function(t){var e=function(i){__extends(o,i);function o(t,e,r,n){return i.call(this,t,e,r,n)||this}o.prototype.authenticatorKeyTagForUser=function(t,e,r){return new a.TarsusKeyPath("per_user",t.guid.toString(),"local_auth_keys",this.credentialId,e,r)};o.prototype.evaluateLocalRegistrationStatus=function(){var t=i.prototype.evaluateLocalRegistrationStatus.call(this);if(t!=u.AuthenticatorRegistrationStatus.Registered){return t}var e=this.user.localEnrollments[this.credentialId];var r=this.authenticatorKeyTagForScheme(e.version,e.salt);var n=this._sdk.host.getKeyPair(r,l.sdkhost.KeyClass.HardwareProtectedSignAndEncryptKey,l.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb);if(!n){return u.AuthenticatorRegistrationStatus.LocallyInvalid}else{n.closeKeyPair()}return u.AuthenticatorRegistrationStatus.Registered};o.prototype.createAuthenticatorSession=function(){return this._uiHandler.createFingerprintAuthSession(this.credentialId,this.user.displayName)};o.prototype.processLocalAuthenticatorError=function(t){var e=this;var r=t;var n=Promise.resolve();if(r.getErrorCode()==u.AuthenticationErrorCode.Internal&&r.getData()){var i=r.getData();r=u.impl.AuthenticationErrorImpl.errorForHostInternalBiometricErrorData(i,"Fingerprint")||r;if(i[l.sdkhost.ErrorDataInternalError]==l.sdkhost.InternalErrorBiometricNotConfigured&&this._authenticatorDescription.getRegistered()||i[l.sdkhost.ErrorDataInternalError]==l.sdkhost.InternalErrorBiometricInvalidated){n=a.LocalEnrollment.invalidateLocalRegistrationStatusAndNotifyUIHandler(this._sdk.currentSession,this._authenticatorDescription)}}n.catch(function(t){e._sdk.log(u.LogLevel.Error,t)});n.finally(function(){if(r.getErrorCode()==u.AuthenticationErrorCode.UserCanceled){e._sdk.log(u.LogLevel.Debug,"Fingerprint authenticator captured user cancel error code.");e.invokeUiHandlerCancellation();return}e.completeCredentialOperationWithError(r)})};o.prototype.getKeyForEnrollmentDataAndInput=function(a,s){var c=this;return new Promise(function(t,e){var r=s;var n=c.authenticatorKeyTagForScheme(a.version,a.salt);var i=c._sdk.host.getKeyPair(n,l.sdkhost.KeyClass.HardwareProtectedSignAndEncryptKey,l.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb);if(!i){var o={};o[l.sdkhost.ErrorDataInternalError]=l.sdkhost.InternalErrorBiometricInvalidated;throw new u.impl.AuthenticationErrorImpl(u.AuthenticationErrorCode.Internal,"Attempt to authenticate with invalidated Fingerprint.",o)}i.setBiometricPromptInfo(r.getPrompt(),c.shouldAllowBiometricFallbackButton(r)?r.getFallbackButtonTitle():null,c._uiHandler,c._inputSession);t(i)})};o.prototype.shouldAllowBiometricFallbackButton=function(t){if(!t)return false;var e=t.getFallbackButtonTitle();if(!(e&&e.length>0)){return false}return true};o.prototype.authenticatorKeyTagForScheme=function(t,e){return this.authenticatorKeyTagForUser(this.user,t,e)};o.create=function(t,e,r,n){return new o(t,e,r,n)};return o}(t.PKCredentialAuthLocal);t.PKCredentialFingerprint=e})(t=a.credential||(a.credential={}))})(t=u.core||(u.core={}))})(t=l.sdk||(l.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(l){var t;(function(u){var t;(function(a){var t;(function(t){var e=function(i){__extends(o,i);function o(t,e,r,n){return i.call(this,t,e,r,n)||this}o.prototype.authenticatorKeyTagForUser=function(t,e,r){return new a.TarsusKeyPath("per_user",t.guid.toString(),"local_auth_keys","native_face",e,r)};o.prototype.evaluateLocalRegistrationStatus=function(){var t=i.prototype.evaluateLocalRegistrationStatus.call(this);if(t!=u.AuthenticatorRegistrationStatus.Registered){return t}var e=this.user.localEnrollments[this.credentialId];var r=this.authenticatorKeyTagForScheme(e.version,e.salt);var n=this._sdk.host.getKeyPair(r,l.sdkhost.KeyClass.HardwareProtectedSignAndEncryptKey,l.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb);if(!n){return u.AuthenticatorRegistrationStatus.LocallyInvalid}else{n.closeKeyPair()}return u.AuthenticatorRegistrationStatus.Registered};o.prototype.createAuthenticatorSession=function(){return this._uiHandler.createNativeFaceAuthSession(this.credentialId,this.user.displayName)};o.prototype.processLocalAuthenticatorError=function(t){var e=this;var r=t;var n=0;var i=Promise.resolve();if(r.getErrorCode()==u.AuthenticationErrorCode.Internal&&r.getData()){var o=r.getData();r=u.impl.AuthenticationErrorImpl.errorForHostInternalBiometricErrorData(o,"Native Face")||r;if(o[l.sdkhost.ErrorDataInternalError]==l.sdkhost.InternalErrorBiometricNotConfigured&&this._authenticatorDescription.getRegistered()||o[l.sdkhost.ErrorDataInternalError]==l.sdkhost.InternalErrorBiometricInvalidated){i=a.LocalEnrollment.invalidateLocalRegistrationStatusAndNotifyUIHandler(this._sdk.currentSession,this._authenticatorDescription)}}i.catch(function(t){e._sdk.log(u.LogLevel.Error,t)});i.finally(function(){if(r.getErrorCode()==u.AuthenticationErrorCode.UserCanceled){e._sdk.log(u.LogLevel.Debug,"Native face authenticator captured user cancel error code.");e.invokeUiHandlerCancellation();return}e.completeCredentialOperationWithError(r)})};o.prototype.getKeyForEnrollmentDataAndInput=function(a,s){var c=this;return new Promise(function(t,e){var r=s;var n=c.authenticatorKeyTagForScheme(a.version,a.salt);var i=c._sdk.host.getKeyPair(n,l.sdkhost.KeyClass.HardwareProtectedSignAndEncryptKey,l.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb);if(!i){var o={};o[l.sdkhost.ErrorDataInternalError]=l.sdkhost.InternalErrorBiometricInvalidated;throw new u.impl.AuthenticationErrorImpl(u.AuthenticationErrorCode.Internal,"Attempt to authenticate with invalidated FaceID.",o)}i.setBiometricPromptInfo(r.getPrompt(),c.shouldAllowBiometricFallbackButton(r)?r.getFallbackButtonTitle():null,c._uiHandler,c._inputSession);t(i)})};o.prototype.shouldAllowBiometricFallbackButton=function(t){if(!t)return false;var e=t.getFallbackButtonTitle();if(!(e&&e.length>0)){return false}return true};o.prototype.authenticatorKeyTagForScheme=function(t,e){return this.authenticatorKeyTagForUser(this.user,t,e)};o.create=function(t,e,r,n){return new o(t,e,r,n)};return o}(t.PKCredentialAuthLocal);t.PKCredentialNativeFace=e})(t=a.credential||(a.credential={}))})(t=u.core||(u.core={}))})(t=l.sdk||(l.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){t.CredentialTypes={pin:t.PKCredentialLocalPinCode,pattern:t.PKCredentialLocalPattern,fingerprint:t.PKCredentialFingerprint,face_id:t.PKCredentialNativeFace}})(e=t.credential||(t.credential={}))})(e=t.core||(t.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(t){this._authCtor=t}t.prototype.createFidoAuthenticator=function(t,e,r,n,i,o){return new this._authCtor(t,e,r,n,i,o)};t.prototype.isAuthenticatorSupportedOnDevice=function(t){return true};return t}();t.SimpleFidoAuthenticatorDescriptor=e})(e=t.fidoclient||(t.fidoclient={}))})(e=t.core||(t.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(n){var t;(function(t){var e;(function(t){var e;(function(r){var t=function(t){__extends(e,t);function e(){return t.call(this,r.FidoAuthenticatorFingerprint)||this}e.prototype.isAuthenticatorSupportedOnDevice=function(t){return t.sdk.host.queryHostInfo(n.sdkhost.HostInformationKey.FingerprintSupported)=="true"};return e}(r.SimpleFidoAuthenticatorDescriptor);r.FidoAuthenticatorDescriptorFingerprint=t})(e=t.fidoclient||(t.fidoclient={}))})(e=t.core||(t.core={}))})(t=n.sdk||(n.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(n){var t;(function(t){var e;(function(t){var e;(function(r){var t=function(t){__extends(e,t);function e(){return t.call(this,r.FidoAuthenticatorNativeFace)||this}e.prototype.isAuthenticatorSupportedOnDevice=function(t){return t.sdk.host.queryHostInfo(n.sdkhost.HostInformationKey.FaceIdKeyBioProtectionSupported)=="true"};return e}(r.SimpleFidoAuthenticatorDescriptor);r.FidoAuthenticatorDescriptorNativeFace=t})(e=t.fidoclient||(t.fidoclient={}))})(e=t.core||(t.core={}))})(t=n.sdk||(n.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(l){var t;(function(t){var e;(function(u){var t=function(){function t(t,e,r,n,i,o){this._client=e;this._sdk=e.sdk;this._uiHandler=n;this._user=r;this._clientContext=i;this._action=o;this._authenticationDescription=t}t.prototype.signHexWithKeyPair=function(t,e){return t.signHex(e)};t.prototype.generateKeyIdHex=function(t,e){return this._sdk.host.calcHexStringEncodedSha256Hash(l.util.asciiToHex(e.guid.toString()+"."+t+"."+this.aaid))};t.prototype.fidoRegisterWithHexUaf1TlvResponse=function(r,n,t){var a=this;return new Promise(function(t,e){a._sdk.log(l.LogLevel.Debug,"Tarsus FIDO authenticator start auth session");a.startAuthenticationSession(l.AuthenticatorSessionMode.Registration);a._sdk.log(l.LogLevel.Debug,"Tarsus FIDO authenticator Prepare FCHash and key ID");var i=a._sdk.host.calcHexStringEncodedSha256Hash(l.util.asciiToHex(n));var o=a.generateKeyIdHex(r,a._user);a._sdk.log(l.LogLevel.Debug,"Tarsus FIDO authenticator generate key pair");a.generateKeyPair(o,r,a._user).then(function(t){a._sdk.log(l.LogLevel.Debug,"Tarsus FIDO authenticator prepare KRD");var e=l.util.base64ToHex(t.publicKeyToJson().key);var n={TAG_AAID:a.aaid,TAG_ASSERTION_INFO:{AuthenticatorVersion:a.authenticatorVersion,AuthenticationMode:1,SignatureAlgAndEncoding:u.ALG_SIGN_SECP256R1_ECDSA_SHA256_RAW,PublicKeyAlgAndEncoding:u.ALG_KEY_ECC_X962_RAW},TAG_FINAL_CHALLENGE_HASH:i,TAG_KEYID:o,TAG_COUNTERS:{SignCounter:a.signCounter,RegCounter:a.regCounter},TAG_PUB_KEY:e};var r=l.util.tlvEncodeHex(u.FidoTLVTags,{TAG_UAFV1_KRD:n});a._sdk.log(l.LogLevel.Debug,"Tarsus FIDO authenticator sign assertion");return a.signHexWithKeyPair(t,r).then(function(t){a._sdk.log(l.LogLevel.Debug,"FIDO KRD Surrogate Assertion signature "+t);var e={TAG_UAFV1_REG_ASSERTION:{TAG_UAFV1_KRD:n,TAG_ATTESTATION_BASIC_SURROGATE:{TAG_SIGNATURE:t}}};var r=l.util.tlvEncodeHex(u.FidoTLVTags,e);a._sdk.log(l.LogLevel.Debug,"FIDO reg assertion TLV hex: "+r);return l.util.hexToBase64(r)}).finally(function(){return t.closeKeyPair()})}).finally(function(){a.finishAuthenticationSession()}).then(t,e)})};t.prototype.fidoDeregister=function(t){var e=this.generateKeyIdHex(t,this._user);return this.deleteKeyPair(e,t,this._user)};t.prototype.fidoAuthenticateWithHexUaf1TlvResponse=function(a,s,t){var c=this;return new Promise(function(t,e){c._sdk.log(l.LogLevel.Debug,"Tarsus FIDO authenticator start auth session");c.startAuthenticationSession(l.AuthenticatorSessionMode.Authentication);c._sdk.log(l.LogLevel.Debug,"Tarsus FIDO authenticator Prepare FCHash and key ID");var r=c._sdk.host.calcHexStringEncodedSha256Hash(l.util.asciiToHex(s));var n=c.generateKeyIdHex(a,c._user);c._sdk.log(l.LogLevel.Debug,"Tarsus FIDO authenticator prepare signed data block for FIDO auth assertion");var i={TAG_AAID:c.aaid,TAG_ASSERTION_INFO:{AuthenticatorVersion:c.authenticatorVersion,AuthenticationMode:1,SignatureAlgAndEncoding:u.ALG_SIGN_SECP256R1_ECDSA_SHA256_RAW},TAG_AUTHENTICATOR_NONCE:c._sdk.host.generateRandomHexString(16),TAG_FINAL_CHALLENGE_HASH:r,TAG_TRANSACTION_CONTENT_HASH:"",TAG_KEYID:n,TAG_COUNTERS:{SignCounter:c.signCounter}};var o=l.util.tlvEncodeHex(u.FidoTLVTags,{TAG_UAFV1_SIGNED_DATA:i});c._sdk.log(l.LogLevel.Debug,"Tarsus FIDO authenticator loading key");c.loadKeyPair(n,a,c._user).then(function(t){c._sdk.log(l.LogLevel.Debug,"Tarsus FIDO authenticator signing auth assertion");return c.signHexWithKeyPair(t,o).then(function(t){c._sdk.log(l.LogLevel.Debug,"FIDO authentication assertion signature "+t);var e={TAG_UAFV1_AUTH_ASSERTION:{TAG_UAFV1_SIGNED_DATA:i,TAG_SIGNATURE:t}};var r=l.util.tlvEncodeHex(u.FidoTLVTags,e);c._sdk.log(l.LogLevel.Debug,"FIDO auth assertion TLV hex: "+r);return l.util.hexToBase64(r)}).finally(function(){return t.closeKeyPair()})}).finally(function(){c.finishAuthenticationSession()}).then(t,e)})};t.prototype.startAuthenticationSession=function(t){this._authMode=t};t.prototype.finishAuthenticationSession=function(){};return t}();u.SimpleFidoAuthenticator=t})(e=t.fidoclient||(t.fidoclient={}))})(t=l.core||(l.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(u){var t;(function(i){var t;(function(c){var t=function(){function o(t,e,r,n,i,o){this._user=t;this._vaultData=e;this._vaultId=r;this._vaultOwner=n;this._sdk=i;this._uiHandler=o}Object.defineProperty(o,"noIntegrityElementKey",{get:function(){return"element"},enumerable:true,configurable:true});o.prototype.isEmpty=function(){return this._vaultData===null||this._vaultData.data===null||this._vaultData.data===""};o.prototype.lock=function(){this._unlockedData=null;this.finalizeLock()};o.prototype.readVaultKey=function(t){if(!this._unlockedData){throw new u.impl.AuthenticationErrorImpl(u.AuthenticationErrorCode.Internal,"Attempt to read from a locked vault.")}if(this.noIntegrity&&t!=o.noIntegrityElementKey){throw new u.impl.AuthenticationErrorImpl(u.AuthenticationErrorCode.Internal,"Unprotected vault may store only '"+o.noIntegrityElementKey+"' key")}return this._unlockedData[t]};o.prototype.writeVaultKey=function(t,e){var r=this;if(!this._unlockedData){return Promise.reject(new u.impl.AuthenticationErrorImpl(u.AuthenticationErrorCode.Internal,"Attempt to write to a locked vault."))}if(this.noIntegrity){if(t!=o.noIntegrityElementKey){return Promise.reject(new u.impl.AuthenticationErrorImpl(u.AuthenticationErrorCode.Internal,"Unprotected vault may store only '"+o.noIntegrityElementKey+"' key"))}if(!u.util.isHexString(e)){return Promise.reject(new u.impl.AuthenticationErrorImpl(u.AuthenticationErrorCode.Internal,"Expecting hex string."))}}this._unlockedData[t]=e;var n=this.hexStringFromJsonToEncrypt(this._unlockedData);return this.internalDataEncrypt(n).then(function(t){r._vaultData.data=t;o.updateVaultForUserWithId(r._user,r._vaultData,r._vaultId,r._sdk)})};o.getVaultForUserWithId=function(t,e,r,n,i){var o=this.vaultsForUser(t,n);var a=o[e.toString()];if(!a){n.log(u.LogLevel.Warning,"vault '"+e+"' for user '"+t.displayName+"' not found in '"+this.getStorageKeyForVaultsForUser(t.guid).toString()+"'");throw new u.impl.AuthenticationErrorImpl(u.AuthenticationErrorCode.Internal,"Vault not found.")}var s=c.VaultTypes[a.type];if(!s){throw new u.impl.AuthenticationErrorImpl(u.AuthenticationErrorCode.Internal,"unhandled vault type: "+a.type)}return new s(t,a,e,r,n,i)};o.deleteVaultForUserWithId=function(t,e,r){r.log(u.LogLevel.Debug,"Delete vault "+e+" for user "+t.displayName);var n=this.vaultsForUser(t,r);var i=n[e.toString()];if(!i){r.log(u.LogLevel.Warning,"vault '"+e+"' for user '"+t.displayName+"' not found in '"+this.getStorageKeyForVaultsForUser(t.guid).toString()+"'");return}var o=c.VaultTypes[i.type];if(!o){throw new u.impl.AuthenticationErrorImpl(u.AuthenticationErrorCode.Internal,"unhandled vault type: "+i.type)}r.log(u.LogLevel.Debug,"Vault descriptor found; deleting.");o.deletePrivateResources(t,i,r);delete n[e.toString()];r.log(u.LogLevel.Debug,"Updating storage after vault deletion.");r.host.writeStorageKey(this.getStorageKeyForVaultsForUser(t.guid),n)};o.deleteAllVaultsForUser=function(t,e){e.host.deleteStorageKey(this.getStorageKeyForVaultsForUser(t.guid))};o.prototype.hexStringFromJsonToEncrypt=function(t){if(this.noIntegrity){var e=t[c.AuthenticatorVault.noIntegrityElementKey];return e}return u.util.asciiToHex(JSON.stringify(t))};o.prototype.jsonFromDecryptedHexString=function(t){if(this.noIntegrity){var e={};e[o.noIntegrityElementKey]=t;return e}return JSON.parse(u.util.hexToAscii(t))};Object.defineProperty(o.prototype,"noIntegrity",{get:function(){return this._vaultData.noIntegrity},enumerable:true,configurable:true});o.updateVaultForUserWithId=function(t,e,r,n){if(e.data.length>o.MAX_DATA_SIZE){throw new u.impl.AuthenticationErrorImpl(u.AuthenticationErrorCode.Internal,"vault size can not exceed "+o.MAX_DATA_SIZE)}var i=this.vaultsForUser(t,n);i[r.toString()]=e;n.host.writeStorageKey(this.getStorageKeyForVaultsForUser(t.guid),i)};o.prototype.getValidErrorRecoveryOptions=function(t){var e=[u.AuthenticationErrorCode.AppImplementation,u.AuthenticationErrorCode.Internal,u.AuthenticationErrorCode.UserCanceled];var r=[u.AuthenticationErrorCode.AuthenticatorExternalConfigError,u.AuthenticationErrorCode.AuthenticatorInvalidated,u.AuthenticationErrorCode.AuthenticatorLocked];if(e.indexOf(t.getErrorCode())>=0){return[u.AuthenticationErrorRecovery.Fail]}var n=this._vaultOwner.getValidErrorRecoveryOptions(t);if(r.indexOf(t.getErrorCode())>=0){n=n.filter(function(t){return t!=u.AuthenticationErrorRecovery.RetryAuthenticator})}return n};o.getStorageKeyForVaultsForUser=function(t){return new i.TarsusKeyPath("per_user",t.toString(),"vaults")};o.migrateIncorrectlyStoredVaultsForUserIfExists=function(t,e){var r=new i.TarsusKeyPath("per_user","user","vaults");var n=e.host.readStorageKey(r);if(n&&0<Object.keys(n).length){e.host.writeStorageKey(t,n);e.host.deleteStorageKey(r)}};o.vaultsForUser=function(t,e){var r=this.getStorageKeyForVaultsForUser(t.guid);var n=e.host.readStorageKey(r);if(!n||0>=Object.keys(n).length){this.migrateIncorrectlyStoredVaultsForUserIfExists(r,e);n=e.host.readStorageKey(r)}return n||{}};o.MAX_DATA_SIZE=1e3;return o}();c.Vault=t})(t=i.vault||(i.vault={}))})(t=u.core||(u.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(c){var t;(function(t){var e;(function(s){var t=function(a){__extends(t,a);function t(t,e,r,n,i,o){return a.call(this,t,e,r,n,i,o)||this}t.prototype.unlock=function(n,i){var o=this;return new Promise(function(t,e){o._rejectFn=e;o._completeFn=t;o._policyAction=n;o._clientContext=i;var r=s.VaultTypes[o._vaultData.type];if(!s.isAuthenticatorVaultDescriptor(r)){o._sdk.log(c.LogLevel.Error,"failed to get descriptor for vault "+o._vaultId);e(new c.impl.AuthenticationErrorImpl(c.AuthenticationErrorCode.Internal,"failed to create authenticator session"));return}o._sdk.log(c.LogLevel.Debug,"Creating vault unlock authenticator session");o._inputSession=o.createAuthenticatorSession();if(!o._inputSession){throw c.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from vault unlock authenticator session creation.")}o._sdk.log(c.LogLevel.Debug,"Invoking startSession on vault unlock authenticator session");o._inputSession.startSession(r.getAuthenticatorDescription(o._sdk),c.AuthenticatorSessionMode.Authentication,n,i);o.unlockInStartedSession()})};t.prototype.unlockInStartedSession=function(){var r=this;this._sdk.log(c.LogLevel.Debug,"Getting vault unlock input");this._inputSession.promiseInput().then(function(t){if(t.isControlRequest()){r._sdk.log(c.LogLevel.Debug,"Vault unlock: received control request "+t.getControlRequest());r.processControlRequest(t.getControlRequest())}else{r._sdk.log(c.LogLevel.Debug,"Vault got authenticator input. Trying to unlock.");return r.prepareToUnlock(r._inputSession,t.getResponse(),r._vaultData.data,r._policyAction,r._clientContext).then(function(){r._sdk.log(c.LogLevel.Debug,"Unlock preparation complete.");if(r.isEmpty()){r._sdk.log(c.LogLevel.Info,"Unlockling empty vault.");r._unlockedData={};return true}else{r._sdk.log(c.LogLevel.Debug,"Decrypting vault.");return r.internalDataDecrypt(r._vaultData.data).then(function(t){r._unlockedData=r.jsonFromDecryptedHexString(t);r._sdk.log(c.LogLevel.Info,"Vault unlocked.");return true})}}).then(function(t){r._inputSession.endSession();r._completeFn(t)})}}).catch(function(t){var e=c.impl.AuthenticationErrorImpl.ensureAuthenticationError(t);r._sdk.log(c.LogLevel.Error,e.getMessage());r.handleLocalDecryptError(c.impl.AuthenticationErrorImpl.ensureAuthenticationError(e))})};t.prototype.handleLocalDecryptError=function(e){var r=this;var n=this.getValidErrorRecoveryOptions(e);var t=n.indexOf(c.AuthenticationErrorRecovery.RetryAuthenticator)>=0?c.AuthenticationErrorRecovery.RetryAuthenticator:c.AuthenticationErrorRecovery.Fail;this._inputSession.promiseRecoveryForError(e,n,t).then(function(t){switch(t){case c.AuthenticationErrorRecovery.RetryAuthenticator:r.unlockInStartedSession();break;case c.AuthenticationErrorRecovery.Fail:r._inputSession.endSession();r._rejectFn(e);break;case c.AuthenticationErrorRecovery.ChangeAuthenticator:if(n.indexOf(c.AuthenticationErrorRecovery.ChangeAuthenticator)>-1){r._inputSession.endSession();r._completeFn(false);break}default:r._inputSession.endSession();r._rejectFn(new c.impl.AuthenticationErrorImpl(c.AuthenticationErrorCode.AppImplementation,"recovery option choice was not offered"));break}})};t.prototype.processControlRequest=function(t){this._sdk.log(c.LogLevel.Debug,"Processing control request "+t.getRequestType());switch(t.getRequestType()){case c.ControlRequestType.AbortAuthentication:this._inputSession.endSession();this._rejectFn(new c.impl.AuthenticationErrorImpl(c.AuthenticationErrorCode.UserCanceled,"Authentication cancelled due to abort control request."));case c.ControlRequestType.ChangeMethod:this._inputSession.endSession();this._completeFn(false);break;case c.ControlRequestType.CancelAuthenticator:this.invokeUiHandlerCancellation();break;case c.ControlRequestType.RetryAuthenticator:this.unlockInStartedSession();break;default:this._inputSession.endSession();this._rejectFn(new c.impl.AuthenticationErrorImpl(c.AuthenticationErrorCode.Internal,"Invalid ControlRequestType value during authentication session."));break}};t.prototype.invokeUiHandlerCancellation=function(){var e=this;var t=this._vaultOwner.getValidCancelOptions();if(t==null){this._inputSession.endSession();this._rejectFn(new c.impl.AuthenticationErrorImpl(c.AuthenticationErrorCode.UserCanceled,"Authentication cancelled due to abort control request."))}else{this._uiHandler.controlOptionForCancellationRequestInSession(t,this._inputSession).then(function(t){if(t.getRequestType()==c.ControlRequestType.CancelAuthenticator){e._inputSession.endSession();e._rejectFn(new c.impl.AuthenticationErrorImpl(c.AuthenticationErrorCode.AppImplementation,"controlOptionForCancellationRequestInSession returned CancelAuthenticator which is an invalid option."))}else{e.processControlRequest(t)}})}};return t}(s.Vault);s.AuthenticatorVault=t;var e=function(){function t(t,e){this._type=t;this._name=e}t.prototype.getAuthenticatorId=function(){return this._name};t.prototype.getName=function(){return this._name};t.prototype.getType=function(){return this._type};t.prototype.getSupportedOnDevice=function(){return true};t.prototype.getRegistrationStatus=function(){return c.AuthenticatorRegistrationStatus.Registered};t.prototype.getDefaultAuthenticator=function(){return false};t.prototype.getRegistered=function(){return true};t.prototype.getExpired=function(){return false};t.prototype.getLocked=function(){return false};t.prototype.getEnabled=function(){return true};return t}();s.AuthenticatorVaultDescription=e})(e=t.vault||(t.vault={}))})(t=c.core||(c.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(s){var t;(function(i){var t;(function(r){var t;(function(t){var e=function(a){__extends(t,a);function t(t,e,r,n,i,o){return a.call(this,t,e,r,n,i,o)||this}Object.defineProperty(t.prototype,"aaid",{get:function(){return"1206#0002"},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"authenticatorVersion",{get:function(){return 1},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"signCounter",{get:function(){return 0},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"regCounter",{get:function(){return 0},enumerable:true,configurable:true});t.prototype.keyTag=function(t,e){return new r.TarsusKeyPath("per_user",t.guid.toString(),"fido_authenticators",this.aaid,e)};t.prototype.startAuthenticationSession=function(t){a.prototype.startAuthenticationSession.call(this,t);this._fpSession=this._uiHandler.createFingerprintAuthSession(r.authenticationdrivers.AuthenticationDriverDescriptorFingerprint.authenticatorName,this._user.displayName);if(!this._fpSession){throw i.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from createFingerprintAuthSession.")}this._fpSession.startSession(this._authenticationDescription,t,this._action,this._clientContext)};t.prototype.finishAuthenticationSession=function(){if(this._fpSession){this._fpSession.endSession();this._fpSession=null}};t.prototype.signHexWithKeyPair=function(e,r){var n=this;return e.signHex(r).catch(function(t){if(t.getData()[s.sdkhost.ErrorDataInternalError]==s.sdkhost.InternalErrorWrongBiometric||t.getData()[s.sdkhost.ErrorDataInternalError]==s.sdkhost.InternalErrorBiometricOsLockTemporary){n._sdk.log(i.LogLevel.Debug,"FIDO signing received a wrong biometric error; retrying authentication.");return n.signHexWithKeyPair(e,r)}else{n._sdk.log(i.LogLevel.Debug,"FIDO signing received an error: "+t+". Propagating.");throw t}})};t.prototype.prepareKeyPairBio=function(r){var n=this;try{if(!this._fpSession){return Promise.reject(new i.impl.AuthenticationErrorImpl(i.AuthenticationErrorCode.Internal,"Attempt to prepare key biometrics without an existing FP session"))}return this._fpSession.promiseInput().then(function(t){if(t.isControlRequest()){switch(t.getControlRequest().getRequestType()){case i.ControlRequestType.CancelAuthenticator:throw new i.impl.AuthenticationErrorImpl(i.AuthenticationErrorCode.UserCanceled,"User cancelled authentication");default:throw new i.impl.AuthenticationErrorImpl(i.AuthenticationErrorCode.AppImplementation,"Unsupported control code when running fingerprint session within FIDO: "+t.getControlRequest().getRequestType())}}else{var e=t.getResponse();r.setBiometricPromptInfo(e.getPrompt(),"",n._uiHandler,n._fpSession);return r}})}catch(t){return Promise.reject(i.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))}};t.prototype.generateKeyPair=function(t,e,r){var n=this;return this._sdk.host.generateKeyPair(this.keyTag(r,t),s.sdkhost.KeyClass.FidoECCSigningKey,s.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb,true).then(function(t){return n.prepareKeyPairBio(t)})};t.prototype.deleteKeyPair=function(r,t,n){var i=this;return new Promise(function(t,e){i._sdk.host.deleteKeyPair(i.keyTag(n,r))})};t.prototype.loadKeyPair=function(n,t,i){var o=this;return new Promise(function(t,e){var r=o._sdk.host.getKeyPair(o.keyTag(i,n),s.sdkhost.KeyClass.FidoECCSigningKey,s.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb);o.prepareKeyPairBio(r).then(t,e)})};return t}(t.SimpleFidoAuthenticator);t.FidoAuthenticatorFingerprint=e})(t=r.fidoclient||(r.fidoclient={}))})(t=i.core||(i.core={}))})(t=s.sdk||(s.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(s){var t;(function(i){var t;(function(r){var t;(function(t){var e=function(a){__extends(t,a);function t(t,e,r,n,i,o){return a.call(this,t,e,r,n,i,o)||this}Object.defineProperty(t.prototype,"aaid",{get:function(){return"1206#0003"},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"authenticatorVersion",{get:function(){return 1},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"signCounter",{get:function(){return 0},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"regCounter",{get:function(){return 0},enumerable:true,configurable:true});t.prototype.keyTag=function(t,e){return new r.TarsusKeyPath("per_user",t.guid.toString(),"fido_authenticators",this.aaid,e)};t.prototype.startAuthenticationSession=function(t){a.prototype.startAuthenticationSession.call(this,t);this._nfSession=this._uiHandler.createNativeFaceAuthSession(r.authenticationdrivers.AuthenticationDriverDescriptorNativeFace.authenticatorName,this._user.displayName);if(!this._nfSession){throw i.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from createNativeFaceAuthSession.")}this._nfSession.startSession(this._authenticationDescription,t,this._action,this._clientContext)};t.prototype.finishAuthenticationSession=function(){if(this._nfSession){this._nfSession.endSession();this._nfSession=null}};t.prototype.signHexWithKeyPair=function(e,r){var n=this;return e.signHex(r).catch(function(t){if(t.getData()[s.sdkhost.ErrorDataInternalError]==s.sdkhost.InternalErrorWrongBiometric||t.getData()[s.sdkhost.ErrorDataInternalError]==s.sdkhost.InternalErrorBiometricOsLockTemporary){n._sdk.log(i.LogLevel.Debug,"FIDO signing received a wrong biometric error; retrying authentication.");return n.signHexWithKeyPair(e,r)}else{n._sdk.log(i.LogLevel.Debug,"FIDO signing received an error: "+t+". Propagating.");throw t}})};t.prototype.prepareKeyPairBio=function(r){var n=this;try{if(!this._nfSession){return Promise.reject(new i.impl.AuthenticationErrorImpl(i.AuthenticationErrorCode.Internal,"Attempt to prepare key biometrics without an existing NF session"))}return this._nfSession.promiseInput().then(function(t){if(t.isControlRequest()){switch(t.getControlRequest().getRequestType()){case i.ControlRequestType.CancelAuthenticator:throw new i.impl.AuthenticationErrorImpl(i.AuthenticationErrorCode.UserCanceled,"User cancelled authentication");default:throw new i.impl.AuthenticationErrorImpl(i.AuthenticationErrorCode.AppImplementation,"Unsupported control code when running fingerprint session within FIDO: "+t.getControlRequest().getRequestType())}}else{var e=t.getResponse();r.setBiometricPromptInfo(e.getPrompt(),"",n._uiHandler,n._nfSession);return r}})}catch(t){return Promise.reject(i.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))}};t.prototype.generateKeyPair=function(t,e,r){var n=this;return this._sdk.host.generateKeyPair(this.keyTag(r,t),s.sdkhost.KeyClass.FidoECCSigningKey,s.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb,true).then(function(t){return n.prepareKeyPairBio(t)})};t.prototype.deleteKeyPair=function(r,t,n){var i=this;return new Promise(function(t,e){i._sdk.host.deleteKeyPair(i.keyTag(n,r))})};t.prototype.loadKeyPair=function(n,t,i){var o=this;return new Promise(function(t,e){var r=o._sdk.host.getKeyPair(o.keyTag(i,n),s.sdkhost.KeyClass.FidoECCSigningKey,s.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb);o.prepareKeyPairBio(r).then(t,e)})};return t}(t.SimpleFidoAuthenticator);t.FidoAuthenticatorNativeFace=e})(t=r.fidoclient||(r.fidoclient={}))})(t=i.core||(i.core={}))})(t=s.sdk||(s.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(l){var t;(function(u){var t;(function(c){var t;(function(t){var s="fidoKey";var e=function(a){__extends(t,a);function t(t,e,r,n,i,o){return a.call(this,t,e,r,n,i,o)||this}Object.defineProperty(t.prototype,"signCounter",{get:function(){return 0},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"regCounter",{get:function(){return 0},enumerable:true,configurable:true});t.prototype.getValidCancelOptions=function(){return null};t.prototype.getValidErrorRecoveryOptions=function(t){return[u.AuthenticationErrorRecovery.RetryAuthenticator,u.AuthenticationErrorRecovery.Fail]};t.prototype.deleteKeyPair=function(r,t,e){var n=this;return new Promise(function(t,e){c.vault.Vault.deleteVaultForUserWithId(n._user,n.vaultId(r),n._sdk);t()})};t.prototype.vaultId=function(t){return new c.TarsusKeyPath("fido_authenticators",this.aaid,t)};t.prototype.generateKeyPair=function(e,t,n){var i=this;return this._sdk.host.generateKeyPairExternalRepresentation(l.sdkhost.KeyClass.FidoECCSigningKey).then(function(r){var t=i.vaultId(e);i._sdk.log(u.LogLevel.Debug,"Deleting existing vault");try{c.vault.Vault.deleteVaultForUserWithId(n,t,i._sdk)}catch(t){}i._sdk.log(u.LogLevel.Debug,"Creating new vault");return i.authenticatorVaultDescriptor().createNew(n,t,i,i._sdk,i._uiHandler).then(function(e){return e.unlock(i._action,i._clientContext).then(function(t){if(t){i._sdk.log(u.LogLevel.Debug,"Updating key in vault");return e.writeVaultKey(s,r).then(function(){return e.lock()})}else{i._sdk.log(u.LogLevel.Error,"Aborting vault-based FIDO registration due to unlockResult == false");throw new u.impl.AuthenticationErrorImpl(u.AuthenticationErrorCode.AuthenticatorError,"Could not unlock vault for registration")}})}).then(function(){var t=i._sdk.host.importVolatileKeyPair(l.sdkhost.KeyClass.FidoECCSigningKey,r);return t})})};t.prototype.loadKeyPair=function(i,t,o){var a=this;return new Promise(function(t,e){a._sdk.log(u.LogLevel.Debug,"Tarsus FIDO authenticator load key material from vault");var r=c.vault.Vault.getVaultForUserWithId(o,a.vaultId(i),a,a._sdk,a._uiHandler);var n=r.unlock(a._action,a._clientContext).then(function(t){if(!t){throw new u.impl.AuthenticationErrorImpl(u.AuthenticationErrorCode.AuthenticatorError,"Unable to unlock authenticator.")}a._sdk.log(u.LogLevel.Debug,"Tarsus FIDO authenticator vault unlocked");var e=r.readVaultKey(s);a._sdk.log(u.LogLevel.Debug,"Tarsus FIDO authenticator key material read");r.lock();a._sdk.log(u.LogLevel.Debug,"Tarsus FIDO authenticator vault locked");return e});n.then(function(t){a._sdk.log(u.LogLevel.Debug,"Tarsus FIDO authenticator key materialized");return a._sdk.host.importVolatileKeyPair(l.sdkhost.KeyClass.FidoECCSigningKey,t)}).then(t,e)})};return t}(t.SimpleFidoAuthenticator);t.FidoAuthenticatorVaultBased=e})(t=c.fidoclient||(c.fidoclient={}))})(t=u.core||(u.core={}))})(t=l.sdk||(l.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}Object.defineProperty(e.prototype,"aaid",{get:function(){return"1206#0001"},enumerable:true,configurable:true});Object.defineProperty(e.prototype,"authenticatorVersion",{get:function(){return 1},enumerable:true,configurable:true});e.prototype.authenticatorVaultDescriptor=function(){return r.vault.VaultTypes["password"]};return e}(t.FidoAuthenticatorVaultBased);t.FidoAuthenticatorPin=e})(t=r.fidoclient||(r.fidoclient={}))})(e=t.core||(t.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){t.FidoAuthenticators={"1206#0001":new t.SimpleFidoAuthenticatorDescriptor(t.FidoAuthenticatorPin),"1206#0002":new t.FidoAuthenticatorDescriptorFingerprint,"1206#0003":new t.FidoAuthenticatorDescriptorNativeFace}})(e=t.fidoclient||(t.fidoclient={}))})(e=t.core||(t.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(c){function u(t){return!!t.tlvSerializable}c.instanceOfTlvSerializable=u;function t(a){return function(n,i){var o=[];Object.keys(a).forEach(function(t){if(t in n){var e=n[t];var r=a[t];o.push(r(e,i))}});return o.join("")}}c.TlvTypes={UInt8:function(t){return c.numberToHex(t,8)},UInt16:function(t){return c.numberToHex(t>>8&255|(t&255)<<8,16)},UInt32:function(t){return c.numberToHex((t&255)<<24|(t>>8&255)<<16|(t>>16&255)<<8|t>>24&255,32)},Object:function(t,e){return r(e,t)},Serializable:function(t,e){return t.tlvSerialize(e)},String:function(t,e){return c.asciiToHex(t)},HexBinary:function(t,e){return t},Struct:t};function r(a,r){var s=[];Object.keys(r).forEach(function(i){var o=a[i];if(!o){throw"TLV encoding error: Unknown tag "+i}var t=r[i];if(!(t instanceof Array)){t=[t]}var e=[];t.forEach(function(t){var e=t.__type||o.tagType||u(t)&&c.TlvTypes.Serializable;if(!e){throw"Unknown type for tag "+i}if(t.__type){t=t.__value}var r=e;var n=r(t,a);s.push(c.TlvTypes.UInt16(o.id));s.push(c.TlvTypes.UInt16(n.length/2));s.push(n)})});return s.join("")}c.tlvEncodeHex=r})(e=t.util||(t.util={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e;(function(t){t.ALG_SIGN_SECP256R1_ECDSA_SHA256_RAW=1;t.ALG_KEY_ECC_X962_RAW=256;t.FidoTLVTags={TAG_UAFV1_REG_ASSERTION:{id:15873,tagType:r.util.TlvTypes.Object},TAG_UAFV1_AUTH_ASSERTION:{id:15874,tagType:r.util.TlvTypes.Object},TAG_UAFV1_KRD:{id:15875,tagType:r.util.TlvTypes.Object},TAG_UAFV1_SIGNED_DATA:{id:15876,tagType:r.util.TlvTypes.Object},TAG_ATTESTATION_BASIC_SURROGATE:{id:15880,tagType:r.util.TlvTypes.Object},TAG_SIGNATURE:{id:11782,tagType:r.util.TlvTypes.HexBinary},TAG_KEYID:{id:11785,tagType:r.util.TlvTypes.HexBinary},TAG_FINAL_CHALLENGE_HASH:{id:11786,tagType:r.util.TlvTypes.HexBinary},TAG_AAID:{id:11787,tagType:r.util.TlvTypes.String},TAG_PUB_KEY:{id:11788,tagType:r.util.TlvTypes.HexBinary},TAG_COUNTERS:{id:11789,tagType:r.util.TlvTypes.Struct({SignCounter:r.util.TlvTypes.UInt32,RegCounter:r.util.TlvTypes.UInt32})},TAG_ASSERTION_INFO:{id:11790,tagType:r.util.TlvTypes.Struct({AuthenticatorVersion:r.util.TlvTypes.UInt16,AuthenticationMode:r.util.TlvTypes.UInt8,SignatureAlgAndEncoding:r.util.TlvTypes.UInt16,PublicKeyAlgAndEncoding:r.util.TlvTypes.UInt16})},TAG_AUTHENTICATOR_NONCE:{id:11791,tagType:r.util.TlvTypes.HexBinary},TAG_TRANSACTION_CONTENT_HASH:{id:11792,tagType:r.util.TlvTypes.HexBinary}}})(e=t.fidoclient||(t.fidoclient={}))})(t=r.core||(r.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(m){var t;(function(t){var e;(function(p){var f;(function(t){t[t["Reg"]=1]="Reg";t[t["Auth"]=2]="Auth";t[t["Dereg"]=3]="Dereg"})(f||(f={}));var u=function(){function t(t,e){this.aaid=t;this.keyId=e||null}return t}();var i=function(){function t(t){var c=this;if(!t){throw"Missing policy."}if(t.rejected){throw"Unsupported policy 'rejected'"}this._acceptedAuths=[];t.accepted.forEach(function(t){if(t.length==1){var e=null;var r=null;var n=false;var i=Object.keys(t[0]);for(var o in i){var a=i[o];switch(a){case"aaid":e=t[0].aaid;break;case"keyIDs":r=t[0].keyIDs;break;default:n=true;break}}if(n){return}if(!e){return}var s=r||[null];e.forEach(function(e){s.forEach(function(t){c._acceptedAuths.push(new u(e,t))})})}})}Object.defineProperty(t.prototype,"acceptedAuths",{get:function(){return this._acceptedAuths},enumerable:true,configurable:true});return t}();var v=function(){function t(e){try{if(e.header.upv.major!=1||e.header.upv.minor!=0&&e.header.upv.minor!=1){throw"Invalid FIDO protocol version "+e.header.upv.major+"."+e.header.upv.minor}var t=e.header.op;this._operation=f[t];if(!this._operation){throw"Invalid FIDO protocol op "+e.header.op}this._appId=e.header.appID;if(!this._appId){throw"Missing appID"}this._serverData=e.header.serverData;this._challenge=e.challenge;this._username=e.username;var r=e.policy;if(!r&&e.authenticators){var n=[];e.authenticators.forEach(function(t){n.push([{aaid:[t.aaid]}])});r={accepted:n}}if(r){this._policy=new i(r)}this._header=e.header}catch(t){throw new m.impl.AuthenticationErrorImpl(m.AuthenticationErrorCode.Internal,"Cannot parse FIDO request ["+JSON.stringify(e)+"]: "+t,{fidoRequest:e,reason:t.toString()})}}Object.defineProperty(t.prototype,"policy",{get:function(){return this._policy},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"appId",{get:function(){return this._appId},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"challenge",{get:function(){return this._challenge},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"username",{get:function(){return this._username},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"operation",{get:function(){return this._operation},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"header",{get:function(){return this._header},enumerable:true,configurable:true});t.prototype.createFinalChallenge=function(){if(!this.challenge){throw"Missing challenge"}var t={appID:this.appId,challenge:this.challenge,facetID:this.appId,channelBinding:{}};return btoa(JSON.stringify(t))};return t}();var t=function(){function t(t){this._sdk=t}Object.defineProperty(t.prototype,"sdk",{get:function(){return this._sdk},enumerable:true,configurable:true});t.prototype.fidoResponseWithUaf1TlvAssertion=function(t,e,r){return{header:t.header,fcParams:e,assertions:[{assertion:r,assertionScheme:"UAFV1TLV"}]}};t.prototype.fidoClientXactReg=function(n,i){var o=this;return new Promise(function(e,t){if(!n.username){throw"Missing username in client registration request"}if(!n.challenge){throw"Missing challenge"}var r=n.createFinalChallenge();o._sdk.log(m.LogLevel.Debug,"Tarsus FIDO client ready for registration action");i.fidoRegisterWithHexUaf1TlvResponse(n.appId,r,p.FidoTLVTags.TAG_ATTESTATION_BASIC_SURROGATE.id).then(function(t){o._sdk.log(m.LogLevel.Debug,"Tarsus FIDO authenticator done succesfully");e(o.fidoResponseWithUaf1TlvAssertion(n,r,t))},t)})};t.prototype.fidoClientXactDereg=function(r,n){var i=this;return new Promise(function(t,e){i._sdk.log(m.LogLevel.Debug,"Tarsus FIDO client ready for deregistration action");n.fidoDeregister(r.appId).then(function(){i._sdk.log(m.LogLevel.Debug,"Tarsus FIDO authenticator done succesfully");t({})},e)})};t.prototype.fidoClientXactAuth=function(n,i){var o=this;return new Promise(function(e,t){if(!n.challenge){throw"Missing challenge"}var r=n.createFinalChallenge();o._sdk.log(m.LogLevel.Debug,"Tarsus FIDO client ready for authentication action");i.fidoAuthenticateWithHexUaf1TlvResponse(n.appId,r,p.FidoTLVTags.TAG_ATTESTATION_BASIC_SURROGATE.id).then(function(t){o._sdk.log(m.LogLevel.Debug,"Tarsus FIDO authenticator done succesfully");e(o.fidoResponseWithUaf1TlvAssertion(n,r,t))},t)})};t.prototype.fidoClientXact=function(a,s,c,u,l,h){var d=this;return new Promise(function(t,e){d._sdk.log(m.LogLevel.Debug,"Tarsus FIDO client parsing FIDO request");var r=new v(h);if(r.username&&r.username.toLowerCase()!=c.userHandle.toLowerCase()){d._sdk.log(m.LogLevel.Error,"Tarsus FIDO client encountered FIDO request with username not matching session username.");throw new m.impl.AuthenticationErrorImpl(m.AuthenticationErrorCode.Internal,"Tarsus FIDO client encountered FIDO request with username not matching session username.")}var n=r.policy.acceptedAuths.map(function(t){return p.FidoAuthenticators[t.aaid]}).filter(function(t){return!!t});if(!n.length){throw new m.impl.AuthenticationErrorImpl(m.AuthenticationErrorCode.Internal,"Couldn't find driver for Tarsus native FIDO client request.")}d._sdk.log(m.LogLevel.Debug,"Tarsus FIDO client loading authenticator");var i=n[0].createFidoAuthenticator(a,d,c,s,u,l);d._sdk.log(m.LogLevel.Info,"Tarsus FIDO client authenticator loaded: "+i.aaid);var o=null;switch(r.operation){case f.Reg:d._sdk.log(m.LogLevel.Debug,"Tarsus FIDO client processing registration request.");o=d.fidoClientXactReg(r,i);break;case f.Auth:d._sdk.log(m.LogLevel.Debug,"Tarsus FIDO client processing authentication request.");o=d.fidoClientXactAuth(r,i);break;case f.Dereg:d._sdk.log(m.LogLevel.Debug,"Tarsus FIDO client processing deregistration request.");o=d.fidoClientXactDereg(r,i);break;default:d._sdk.log(m.LogLevel.Error,"Unsupported FIDO Op when dispatching request: "+f[r.operation]);throw new m.impl.AuthenticationErrorImpl(m.AuthenticationErrorCode.Internal,"Unsupported FIDO op "+f[r.operation])}o.then(t,e)})};t.prototype.canHandlePolicy=function(t){var e=this;var r=new i(t);var n=r.acceptedAuths.filter(function(t){return p.FidoAuthenticators[t.aaid]&&p.FidoAuthenticators[t.aaid].isAuthenticatorSupportedOnDevice(e)});return n.length>0};t.isPolicyTransmitFidoClientExclusive=function(t){var e=new i(t);var r=e.acceptedAuths.filter(function(t){return!p.FidoAuthenticators[t.aaid]});return r.length==0};return t}();p.TarsusFidoClient=t})(e=t.fidoclient||(t.fidoclient={}))})(t=m.core||(m.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(l){var t;(function(u){var t;(function(t){var e;(function(t){var e=function(){function t(t,e,r,n,i){this._countdownTask=new c(e,r,n,1e3,i)}t.prototype.promiseCodeGeneration=function(t){return this._countdownTask.run(t)};return t}();t.TotpCodeGeneratorTimeBased=e;var o=function(){function r(t,e){if(t<1){throw new u.impl.AuthenticationErrorImpl(u.AuthenticationErrorCode.Internal,"timeStamp must be positive: "+t)}r.assertValidTime(e);this._timeStep=t;this._startTime=e}r.assertValidTime=function(t){if(t<0){throw new u.impl.AuthenticationErrorImpl(u.AuthenticationErrorCode.Internal,"Negative time: "+t)}};Object.defineProperty(r.prototype,"timeStep",{get:function(){return this._timeStep},enumerable:true,configurable:true});r.prototype.getValueAtTime=function(t){r.assertValidTime(t);var e=t-this._startTime;if(e>=0){return Math.floor(e/this._timeStep)}else{return Math.floor((e-(this._timeStep-1))/this._timeStep)}};r.prototype.getValueStartTime=function(t){return this._startTime+t*this._timeStep};return r}();var a=function(){function t(t,e){this._sdk=e;this._hexElement=t}t.prototype.sign=function(t){var e=this._sdk.host.calcHexStringEncodedHmacSha1HashWithHexEncodedKey(this._hexElement,t);return e};return t}();var s=function(){function r(t,e){if(e<0||e>r.MAX_PASSCODE_LENGTH){throw new u.impl.AuthenticationErrorImpl(u.AuthenticationErrorCode.Internal,"PassCodeLength must be between 1 and "+r.MAX_PASSCODE_LENGTH+" digits.")}this._signer=t;this._codeLength=e}r.prototype.generateResponseCode=function(t,e){var r=e&&e.length||0;var n=new ArrayBuffer(8+r);var i=new DataView(n);i.setUint32(0,Math.floor(t/4294967296)&4294967295);i.setUint32(4,t&4294967295);if(e){for(var o=0;o<r;o++){i.setUint8(o+8,e.charCodeAt(o))}}return this.generateResponseCodeForByteArray(i)};r.prototype.generateResponseCodeForByteArray=function(t){var e="";for(var r=0;r<t.byteLength;r++){var n=t.getUint8(r).toString(16);if(n.length<2){n="0"+n}e+=n}var i=this._signer.sign(e);var o=parseInt(i[i.length-1],16);var a=i.substring(o*2,o*2+8);var s=parseInt(a,16)&2147483647;var c=s%Math.pow(10,this._codeLength);return this.padOutput(c)};r.prototype.padOutput=function(t){var e=t.toString();for(var r=e.length;r<this._codeLength;r++){e="0"+e}return e};r.MAX_PASSCODE_LENGTH=9;r.PASS_CODE_LENGTH=6;r.ADJACENT_INTERVALS=1;r.DIGITS_POWER=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9];return r}();var c=function(){function t(t,e,r,n,i){this._lastSeenCounterValue=0x8000000000000000;this._counter=new o(e,0);this._generator=new s(new a(r,i),t);this._remainingTimeNotificationPeriod=n;this._sdk=i}t.prototype.run=function(t){this._sdk.log(u.LogLevel.Debug,"Genearting a TOTP code.");var e=this._sdk.host.getCurrentTime();var r=this.getCounterValue(e);if(this._lastSeenCounterValue!=r){this._lastSeenCounterValue=r;this.fireTotpCounterValueChanged(t)}this._sdk.log(u.LogLevel.Debug,"Notifying session of TOTP value and countdown");var e=this._sdk.host.getCurrentTime();var n=this.getCounterValueAge(e);var i=this._remainingTimeNotificationPeriod-n%this._remainingTimeNotificationPeriod;return Promise.resolve(l.tarsusplugin.TotpCodeGenerationOutput.create(this._mCode,null,this._counter.timeStep,Math.floor(this.getTimeTillNextCounterValue(e)/1e3),i,false,null))};t.prototype.fireTotpCounterValueChanged=function(t){var e=Math.floor(this._sdk.host.getCurrentTime()/1e3);var r=this._counter.getValueAtTime(e);this._mCode=this._generator.generateResponseCode(r,t)};t.prototype.getTimeTillNextCounterValue=function(t){var e=this.getCounterValue(t);var r=e+1;var n=this._counter.getValueStartTime(r)*1e3;return n-t};t.prototype.getCounterValue=function(t){return this._counter.getValueAtTime(Math.floor(t/1e3))};t.prototype.getCounterValueAge=function(t){return t-this._counter.getValueStartTime(this.getCounterValue(t))*1e3};return t}()})(e=t.totp||(t.totp={}))})(t=u.core||(u.core={}))})(t=l.sdk||(l.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var o;(function(l){var t;(function(u){var t;(function(t){var e=function(){function t(t,e,r){this._generatorName=t;this._user=e;this._sdk=r;this._vaultId=new u.TarsusKeyPath("totp_properties",this._generatorName)}t.prototype.promiseProvisionOutput=function(e,r,n,i){var o=this;this._isProvisioning=true;return this.createProvisionOutput(e,r,n,i).then(function(t){return o.selectAndCreateVault(t.getSecretToLock(),e,r,n,i).then(function(){return t.getUnprotectedProvisionOutput()})})};t.prototype.promiseCodeGenerator=function(e,r,n,i){var o=this;this._isProvisioning=false;return this.unlockOtpSecret(i,n).then(function(t){o._sdk.log(l.LogLevel.Debug,"generating TOTP session");return o.createCodeGenerator(e,r,t,n,i)})};t.prototype.updateProtectedProperties=function(t){if(typeof t!=="string"||!this._unlockedVault){return Promise.reject(new l.impl.AuthenticationErrorImpl(l.AuthenticationErrorCode.Internal,"could not update protected properties for generator <"+this._generatorName+">"))}return this._unlockedVault.writeVaultKey(this.elementVaultKey,t)};t.prototype.deprovision=function(){u.vault.Vault.deleteVaultForUserWithId(this._user,this._vaultId,this._sdk)};t.prototype.unlockOtpSecret=function(r,t){var n=this;return new Promise(function(t){n._sdk.log(l.LogLevel.Debug,"Getting TOTP vault");var e=u.vault.Vault.getVaultForUserWithId(n._user,n._vaultId,n,n._sdk,r);t(e)}).catch(function(t){n._sdk.log(l.LogLevel.Error,"Error obtaining vault for TOTP <"+n._user.displayName+", "+n._generatorName+">: "+t);return Promise.reject(new l.impl.AuthenticationErrorImpl(l.AuthenticationErrorCode.TotpNotProvisioned,"Totp generator '"+n._generatorName+"' for user '"+n._user.displayName+"' isn't provisioned",{underlying_error:t.toString()}))}).then(function(r){n._sdk.log(l.LogLevel.Info,"Unlocking vault for TOTP seed");return r.unlock(null,t).then(function(t){if(!t){n._sdk.log(l.LogLevel.Error,"Change authetnicator requested during vault unlock for TOTP");throw new l.impl.AuthenticationErrorImpl(l.AuthenticationErrorCode.Internal,"change authenticator isn't possible here")}n._sdk.log(l.LogLevel.Debug,"TOTP Vault unlocked");var e=r.readVaultKey(n.elementVaultKey);n._unlockedVault=r;n._sdk.log(l.LogLevel.Debug,"TOTP Vault locked");return e})})};t.prototype.getValidErrorRecoveryOptions=function(t){var e=[l.AuthenticationErrorRecovery.Fail,l.AuthenticationErrorRecovery.RetryAuthenticator];if(this._isProvisioning&&this._availableAuthenticators.length>1){e.push(l.AuthenticationErrorRecovery.ChangeAuthenticator)}return e};t.prototype.getValidCancelOptions=function(){var t=[l.ControlRequestType.RetryAuthenticator,l.ControlRequestType.AbortAuthentication];if(this._isProvisioning&&this._availableAuthenticators.length>1){t.push(l.ControlRequestType.ChangeMethod)}return t};t.prototype.getAvailableAuthenticators=function(e){var n=this;var i=new Array;Object.keys(u.vault.VaultTypes).forEach(function(t){var e=u.vault.VaultTypes[t];if(!u.vault.isAuthenticatorVaultDescriptor(e)){return}var r=e.getAuthenticatorDescription(n._sdk);if(r.getSupportedOnDevice()){i.push(new o.impl.AuthenticationOptionImpl(r,[]))}});i=i.filter(function(t){return-1!==e.indexOf(t.getAuthenticator().getName())});return i};t.prototype.selectAndCreateVault=function(e,r,n,i,o){var a=this;var t;if(r.protection_method){var s=this.getAvailableAuthenticators(r.protection_method);this._availableAuthenticators=s;this._sdk.log(l.LogLevel.Debug,"Selecting authenticator vault");if(1<this._availableAuthenticators.length){t=o.selectAuthenticator(this._availableAuthenticators,n,i).then(function(t){switch(t.getResultType()){case l.AuthenticatorSelectionResultType.Abort:throw new l.impl.AuthenticationErrorImpl(l.AuthenticationErrorCode.UserCanceled,"Cancel during authenticator selection.");case l.AuthenticatorSelectionResultType.SelectAuthenticator:if(t.getSelectedAuthenticationParameters().length){throw new l.impl.AuthenticationErrorImpl(l.AuthenticationErrorCode.AppImplementation,"Authentication parameters not allowed in vault.")}return t.getSelectedAuthenticator().getName()}})}else{t=Promise.resolve(this._availableAuthenticators[0].getAuthenticator().getName())}}else if(r.vault){var c=r.vault.vault_type;this._sdk.log(l.LogLevel.Debug,"Using '"+c+"' vault");t=Promise.resolve(c)}else{return Promise.reject(new l.impl.AuthenticationErrorImpl(l.AuthenticationErrorCode.Internal,"failed to parse TOTP protection type"))}return t.then(function(t){return a.createAndWriteToVault(t,e,r,o,n,i)})};t.prototype.createAndWriteToVault=function(t,r,n,i,o,a){var s=this;var e=u.vault.VaultTypes[t];if(!e){return Promise.reject(new l.impl.AuthenticationErrorImpl(l.AuthenticationErrorCode.Internal,"Unhandled protection method "+t))}var c=e.supportsNoIntegrity()&&n.integrity_protection_disabled;return e.createNew(this._user,this._vaultId,this,this._sdk,i,c,n).then(function(e){return e.unlock(o,a).then(function(t){if(t){return e.writeVaultKey(s.elementVaultKey,r).then(function(){e.lock()})}else{return s.selectAndCreateVault(r,n,o,a,i)}})})};Object.defineProperty(t.prototype,"elementVaultKey",{get:function(){return u.vault.Vault.noIntegrityElementKey},enumerable:true,configurable:true});return t}();t.TotpDriverVaultBased=e})(t=u.totp||(u.totp={}))})(t=l.core||(l.core={}))})(o=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(p){var t;(function(d){var t;(function(t){var e;(function(t){var e=function(t){__extends(n,t);function n(){return t!==null&&t.apply(this,arguments)||this}n.prototype.createCodeGenerator=function(t,e,r,n,i){return Promise.resolve(new o(t,r,this._sdk))};n.prototype.createProvisionOutput=function(t,e,r,n){return Promise.resolve(p.tarsusplugin.VaultBasedTotpProvisionOutput.create(t.ec_private_key||"",new i))};n.create=function(t,e,r){return new n(t,e,r)};return n}(t.TotpDriverVaultBased);t.TotpDriverEc=e;var i=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.finalize=function(t){};return e}(p.tarsusplugin.TotpProvisionOutput);var o=function(){function h(t,e,r){this._sdk=r;this._sdk.log(d.LogLevel.Debug,"Construct EC OTP Code generator");this._codeLen=t;if(!h._ec){h._ec=new elliptic.ec("p256");this._sdk.log(d.LogLevel.Debug,"EC Loaded")}var n=d.util.base64ToHex(e);var i=n.substring(n.length-64,n.length);this._keypair=h._ec.keyFromPrivate(i);this._sdk.log(d.LogLevel.Debug,"Private key parsed")}h.prototype.promiseCodeGeneration=function(t){this._sdk.log(d.LogLevel.Debug,"Start generate EC OTP Code");if(!t){return Promise.reject(d.impl.AuthenticationErrorImpl.appImplementationError("EC OTP generation requries a challenge."))}var e=h._ec.keyFromPublic(atob(t));this._sdk.log(d.LogLevel.Debug,"Challenge parsed");var r=this._keypair.derive(e.getPublic()).toArray("be");r.push(0,0,0,1);r.push.apply(r,atob(t).split("").map(function(t){return t.charCodeAt(0)}));var n=r.map(function(t){return d.util.numberToHex(t,8)}).join("");var i=this._sdk.host.calcHexStringEncodedSha512Hash(n);var o="1000000000000";var a=h._ec.keyFromPrivate(parseInt(o.substring(0,1+this._codeLen),10).toString(16)).getPrivate();var s=(parseInt(i.substring(i.length-1),16)&15)*2;var c=i.substring(s,s+16);c=(parseInt(c.substring(0,2),16)&127).toString(16)+c.substring(2);var u=h._ec.keyFromPrivate(c).getPrivate();var l=u.mod(a).toString(10,this._codeLen);return Promise.resolve(p.tarsusplugin.TotpCodeGenerationOutput.create(l,null,-1,-1,-1,false,null))};return h}()})(e=t.totp||(t.totp={}))})(t=d.core||(d.core={}))})(t=p.sdk||(p.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(u){var t;(function(c){var t;(function(s){var t;(function(o){var t=function(t){__extends(n,t);function n(){return t!==null&&t.apply(this,arguments)||this}n.prototype.otpSecretToLock=function(o){var a=this;return new Promise(function(t,e){var r=s.User.findUser(a._sdk,a._user.userHandle);if(!r){e(new c.impl.AuthenticationErrorImpl(c.AuthenticationErrorCode.Internal,"failed to find user record for <"+a._user.displayName+">"));return}var n=a._sdk.host.getKeyPair(r.deviceEncryptionKeyTag,u.sdkhost.KeyClass.StdEncryptionKey,u.sdkhost.KeyBiometricProtectionMode.None);if(!n){throw new c.impl.AuthenticationErrorImpl(c.AuthenticationErrorCode.Internal,"failed to find device encryption key for <"+a._user.displayName+">")}var i=c.util.base64ToHex(o.shared_key);t(n.decrypt(i))})};n.prototype.createCodeGenerator=function(t,e,r,n,i){return Promise.resolve(new o.TotpCodeGeneratorTimeBased(this,t,e.ttl,r,this._sdk))};n.prototype.createProvisionOutput=function(t,e,r,n){var i={ttl:t.ttl};return this.otpSecretToLock(t).then(function(t){var e=o.TotpProvisionOutputTimeBased.create(null,i);return u.tarsusplugin.VaultBasedTotpProvisionOutput.create(t,e)})};n.create=function(t,e,r){return new n(t,e,r)};n.transformOldToNewDataForUser=function(t){var e={ttl:t.ttl};return e};return n}(o.TotpDriverVaultBased);o.TotpDriverTimeBased=t})(t=s.totp||(s.totp={}))})(t=c.core||(c.core={}))})(t=u.sdk||(u.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(e){var t;(function(c){var u={totp:{create:c.TotpDriverTimeBased.create},ecotp:{create:c.TotpDriverEc.create}};var t=function(){function t(){}t.driverForTypeName=function(e,t,r,n){var i;this._extensionPoint.forEach(function(t){if(!i&&e==t.getTotpTypeName()){i=t}});if(i){return i.create(t,r.guid.toString())}var o;this._extensionPointForVaultBased.forEach(function(t){if(!o&&e==t.getTotpTypeName()){o=t}});if(o){var a=o.create(t,r.guid.toString());return new c.VaultBasedTotpDriverProxy(a,t,r,n)}var s=u[e];return s&&s.create(t,r,n)};t._extensionPoint=new e.ExtensionPoint("com.ts.mobile.plugins.totp");t._extensionPointForVaultBased=new e.ExtensionPoint("com.ts.mobile.plugins.totp.vault");return t}();c.TotpDrivers=t})(t=e.totp||(e.totp={}))})(e=t.core||(t.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(u){var t;(function(o){var t;(function(a){var t=function(){function n(t,e){this._user=t;this._sdk=e;this._shouldStopCodeGen=true;this._sdk.log(u.LogLevel.Debug,"Loading TOTP processors for user "+t.displayName);this._propertiesContainer=this._sdk.host.readStorageKey(this.totpPropertiesContainerStorageKey);if(this._propertiesContainer.version!="v0"){this._sdk.log(u.LogLevel.Debug,"Creating TOTP records for user "+this._user.displayName);this._propertiesContainer.properties={};var r=new o.TarsusKeyPath("per_user",this._user.guid.toString(),"totp_properties","default");var n=this._sdk.host.readStorageKey(r);if(0<Object.keys(n).length){if(this._user.deviceBound){this._sdk.log(u.LogLevel.Debug,"Migrating TOTP records for default TOTP generator for user "+this._user.displayName);var i={type:"totp",length:n.length,provision_id:this.provisionIdForGenerator("default"),specific_data:a.TotpDriverTimeBased.transformOldToNewDataForUser(n)};this._propertiesContainer.properties["default"]=i;this._sdk.log(u.LogLevel.Debug,"Updating storage on migration");this.updateStorage()}else{this._sdk.log(u.LogLevel.Warning,"Migration of TOTP records for user "+this._user.displayName+" can not be perfomed (user not bound)")}this._sdk.log(u.LogLevel.Debug,"Deleting old TOTP records storage key");this._sdk.host.deleteStorageKey(r)}this._propertiesContainer.version="v0";this.updateStorage()}}Object.defineProperty(n.prototype,"totpPropertiesContainerStorageKey",{get:function(){return new o.TarsusKeyPath("per_user",this._user.guid.toString(),"totp")},enumerable:true,configurable:true});n.prototype.isTotpProvisionedForGenerator=function(t){var e=this._propertiesContainer.properties[t];return!!e};n.prototype.updateWithProvisionedGenerator=function(t,e){var r={type:t.otp_type,length:t.length,add_check_digit:t.add_check_digit,provision_id:this.provisionIdForGenerator(t.generator)};if(e.getStoredData()){r.specific_data=e.getStoredData()}this._propertiesContainer.properties[t.generator]=r;this.updateStorage()};n.prototype.deleteProvisionForGenerator=function(t){var e=this.getTotpDriver(t);if(!e){return}delete this._propertiesContainer.properties[t];this.updateStorage();e.deprovision()};n.prototype.deleteAllProvisions=function(){var r=this;var n=new Array;Object.keys(this._propertiesContainer.properties).forEach(function(t){var e=r.getTotpDriver(t);if(!e){r._sdk.log(u.LogLevel.Error,"Failed to delete TOTP provisioning for "+t)}else{n.push(e)}});this._propertiesContainer.properties={};this._sdk.host.deleteStorageKey(this.totpPropertiesContainerStorageKey);n.forEach(function(e){try{e.deprovision()}catch(t){r._sdk.log(u.LogLevel.Error,"Failed to delete TOTP private resources for "+e)}})};n.prototype.createTotpDriver=function(t,e){var r=a.TotpDrivers.driverForTypeName(e,t,this._user,this._sdk);if(!r){this._sdk.log(u.LogLevel.Error,"Unhandled TOTP type: "+e);return null}return r};n.prototype.getTotpDriver=function(t){var e=this._propertiesContainer.properties[t];if(!e){this._sdk.log(u.LogLevel.Warning,"Failed to find TOTP provision properties for "+t);return null}var r=a.TotpDrivers.driverForTypeName(e.type,t,this._user,this._sdk);if(!r){this._sdk.log(u.LogLevel.Error,"Unhandled TOTP type: "+e.type);return null}return r};n.prototype.totpRequestFromCanonicalString=function(t){var r=this;var n=null,i=null;t=atob(t);if(255==t.charCodeAt(0)){var o=a.parsing.totpDataFromCanonical(t.slice(1));if(o&&0<o.challengesSpecs.length){Object.keys(this._propertiesContainer.properties).some(function(e){return o.challengesSpecs.some(function(t){if(r._propertiesContainer.properties[e].provision_id.lastIndexOf(t.seedId,0)==0){n=t.challenge;i=e;return true}return false})})}}else{i="default";n=t}if(!n||!i){this._sdk.log(u.LogLevel.Warning,"Failed to find TOTP attributes in canonical string");throw new u.impl.AuthenticationErrorImpl(u.AuthenticationErrorCode.Internal,"Failed to find TOTP attributes in canonical string")}return u.impl.TotpGenerationRequestImpl.createTotpGenerationRequest(this._user,n,i)};n.prototype.runCodeGenerationSession=function(i,o,a,s){var c=this;return new Promise(function(e,r){c._sdk.log(u.LogLevel.Info,"Run TOTP generation session");var t=c.getTotpDriver(i);if(!t){c._sdk.log(u.LogLevel.Error,"TOTP data not found for <"+c._user.displayName+", "+i+">");r(new u.impl.AuthenticationErrorImpl(u.AuthenticationErrorCode.TotpNotProvisioned,"Totp generator '"+i+"' for '"+c._user.displayName+"' isn't provisioned"));return}var n=c._propertiesContainer.properties[i];t.promiseCodeGenerator(n.length,n.specific_data,a,s).then(function(t){c._appCodeGenSession=s.createTotpGenerationSession(c._user.displayName,i);if(!c._appCodeGenSession){r(u.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from createTotpGenerationSession."));return}c._generatorName=i;c._codeGenerator=t;c._requireChallenge=o;c._codeGenCompleteFn=e;c._codeGenRejectFn=r;c._sdk.log(u.LogLevel.Debug,"Invoking TOTP client session startSession");c._appCodeGenSession.startSession(c,null,a);c._sdk.log(u.LogLevel.Info,"TOTP client session running")}).catch(r)})};n.prototype.runCodeGenerationSessionWithRequest=function(t,e,r){this._codeGenDesignatedRequest=t;return this.runCodeGenerationSession(t.getGeneratorName(),false,e,r)};n.prototype.startCodeGeneration=function(){this._sdk.log(u.LogLevel.Debug,"Got request to start code generation.");if(!this._appCodeGenSession){throw new u.impl.AuthenticationErrorImpl(u.AuthenticationErrorCode.Internal,"Attempt to start code generation on a finished TOTP session.")}this._shouldStopCodeGen=false;if(this._requireChallenge){this.startChallengeRequireCodeGeneration(this._appCodeGenSession);return}this._sdk.log(u.LogLevel.Debug,"TOTP session starting code generation");this.generateCode(this._codeGenDesignatedRequest&&this._codeGenDesignatedRequest.getChallenge())};n.prototype.finishSession=function(){this._sdk.log(u.LogLevel.Debug,"TOTP session finishing");this._shouldStopCodeGen=true;if(!this._appCodeGenSession){throw new u.impl.AuthenticationErrorImpl(u.AuthenticationErrorCode.Internal,"Attempt to finish a finished TOTP session.")}this._appCodeGenSession.endSession();this._appCodeGenSession=null;this._codeGenCompleteFn(true)};n.prototype.updatedWithGeneratorSpecificProperties=function(t,e){var r=this._propertiesContainer.properties[t];if(!r){return false}r.specific_data=e;this.updateStorage();return true};n.prototype.startChallengeRequireCodeGeneration=function(e){var r=this;this._sdk.log(u.LogLevel.Debug,"Starting TOTP challenge acquisition.");e.promiseChallengeInput().then(function(t){if(t.isControlRequest()){switch(t.getControlRequest().getRequestType()){case u.ControlRequestType.AbortAuthentication:e.endSession();r._codeGenRejectFn(new u.impl.AuthenticationErrorImpl(u.AuthenticationErrorCode.UserCanceled,"User cancelled generation"));break;default:e.endSession();r._codeGenRejectFn(new u.impl.AuthenticationErrorImpl(u.AuthenticationErrorCode.AppImplementation,"Unsupported control code when running TOTP challenge acquisition: "+t.getControlRequest().getRequestType()))}}else{r._sdk.log(u.LogLevel.Debug,"Challenge acquired successfully. Going to start generation of TOTP codes.");r.generateCode(t.getResponse().getChallenge())}})};n.prototype.generateCode=function(r){var n=this;if(!this._shouldStopCodeGen){this._codeGenerator.promiseCodeGeneration(r||null).then(function(t){if(!n._shouldStopCodeGen){if(t.getMessage()){n._appCodeGenSession.setMessage(t.getMessage())}var e;if(n._propertiesContainer.properties[n._generatorName].add_check_digit){e=n.computeErrorControlledCode(t.getCode())}else{e=t.getCode()}n._appCodeGenSession.setTotpCode(e,t.getTimeStepSeconds(),t.getExpiresInSeconds());if(0<t.getSecondsTillNextInvocation()){n._sdk.host.createDelayedPromise(t.getSecondsTillNextInvocation()).then(function(t){n.generateCode(r)})}}if(t.getShouldUpdateSpecificProperties()&&!n.updatedWithGeneratorSpecificProperties(n._generatorName,t.getGeneratorSpecificDataToStore())){throw new u.impl.AuthenticationErrorImpl(u.AuthenticationErrorCode.Internal,"could not update generator properties <"+n._generatorName+">")}}).catch(function(t){n._shouldStopCodeGen=true;n._appCodeGenSession.endSession();n._codeGenRejectFn(t)})}};n.prototype.computeErrorControlledCode=function(t){var e=0;for(var r=t.length-1;r>=0;r--){var n=Number(t[r]);if((t.length-r)%2){n*=2;if(9<n){n=n%10+1}}e+=n}return t+e*9%10};n.prototype.updateStorage=function(){this._sdk.host.writeStorageKey(this.totpPropertiesContainerStorageKey,this._propertiesContainer)};n.prototype.provisionIdForGenerator=function(t){var e=u.util.asciiToHex(""+this._user.deviceId+t);return this._sdk.host.calcHexStringEncodedSha256Hash(e)};n.createWithUserHandle=function(t,e){var r=o.User.findUser(e,t);if(!r){e.log(u.LogLevel.Error,"Can not find user record for <"+t+">");throw new u.impl.AuthenticationErrorImpl(u.AuthenticationErrorCode.Internal,"Can not find user <"+t+">")}return new n(r,e)};n.createWithUser=function(t,e){return new n(t,e)};n.BACKWARD_COMPATIBILITY_DEFAULT_GENERATOR="default";return n}();a.TotpPropertiesProcessor=t})(t=o.totp||(o.totp={}))})(t=u.core||(u.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e;(function(t){var e;(function(t){var e=function(t){__extends(n,t);function n(){return t!==null&&t.apply(this,arguments)||this}n.prototype.finalize=function(t){};n.create=function(t,e){var r=new n;r.setAssertionData(t);r.setStoredData(e);return r};return n}(r.tarsusplugin.TotpProvisionOutput);t.TotpProvisionOutputTimeBased=e})(e=t.totp||(t.totp={}))})(e=t.core||(t.core={}))})(t=r.sdk||(r.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(o){__extends(t,o);function t(t,e,r,n){var i=o.call(this,e,r,n)||this;i._underlyingDriver=t;return i}t.prototype.createCodeGenerator=function(t,e,r,n,i){return this._underlyingDriver.promiseCodeGenerator(t,r,e,n,i)};t.prototype.createProvisionOutput=function(t,e,r,n){return this._underlyingDriver.promiseProvisionOutput(t,e,r,n)};return t}(t.TotpDriverVaultBased);t.VaultBasedTotpDriverProxy=e})(e=t.totp||(t.totp={}))})(e=t.core||(t.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(l){var t;(function(t){var e;(function(t){var e;(function(t){function e(t){try{var e={version:0,prefixes:[],challengesSpecs:[]};var r=0;e.version=t.charCodeAt(r++);var n=t.charCodeAt(r++);var i;for(var o=0;o<n;o++){i=t.charCodeAt(r++);e.prefixes.push(t.slice(r,r+i));r+=i}while(r<t.length){var a=t.charCodeAt(r++);i=4;var s=l.util.bytesToHex(t.slice(r,r+i));r+=i;var c=t.charCodeAt(r++);i=t.charCodeAt(r++);var u=""+e.prefixes[c]+t.slice(r,r+i);r+=i;e.challengesSpecs.push({version:a,seedId:s,challenge:u})}return e}catch(t){}return null}t.totpDataFromCanonical=e})(e=t.parsing||(t.parsing={}))})(e=t.totp||(t.totp={}))})(t=l.core||(l.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(u){var t;(function(c){var t;(function(r){var t;(function(t){var e=function(e){__extends(s,e);function s(){return e!==null&&e.apply(this,arguments)||this}s.supportsNoIntegrity=function(){return false};s.INCORRECT_KEY_TAG_TO_FALLBACK=function(t){return new r.TarsusKeyPath("per_user`, userId, `vault_keys",t.type,t.salt)};s.getVaultKeyTagForUser=function(t,e){return new r.TarsusKeyPath("per_user",t.toString(),"vault_keys",e.type,e.salt)};s.deletePrivateResources=function(t,e,r){r.log(c.LogLevel.Debug,"Biometric authenticator vault deleting private resources...");r.host.deleteKeyPair(s.getVaultKeyTagForUser(t.guid,e))};s.prototype.translateBiometricInternalError=function(t){if(t.getErrorCode()==c.AuthenticationErrorCode.Internal&&t.getData()){var e=t.getData();return c.impl.AuthenticationErrorImpl.errorForHostInternalBiometricErrorData(e,this.biometricType)||t}else{return t}};s.prototype.prepareToUnlock=function(i,o,t,e,r){var a=this;return new Promise(function(t,e){var r=s.getVaultKeyTagForUser(a._user.guid,a._vaultData);var n;if(a.isEmpty()){a._sdk.log(c.LogLevel.Debug,"Generating a new key for empty "+a.biometricType+" vault.");n=c.util.wrapPromiseWithActivityIndicator(a._uiHandler,a._policyAction,a._clientContext,a._sdk.host.generateKeyPair(r,u.sdkhost.KeyClass.StdEncryptionKey,u.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb,true)).catch(function(t){throw a.translateBiometricInternalError(t)})}else{n=new Promise(function(t){var e=a._sdk.host.getKeyPair(r,u.sdkhost.KeyClass.StdEncryptionKey,u.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb);if(!e){e=a._sdk.host.getKeyPair(s.INCORRECT_KEY_TAG_TO_FALLBACK(a._vaultData),u.sdkhost.KeyClass.StdEncryptionKey,u.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb);if(!e){throw new c.impl.AuthenticationErrorImpl(c.AuthenticationErrorCode.Internal,"Your biometric settings on the device has been changed")}}t(e)})}n.then(function(t){a.updateKeyPairWithAuthenticationInput(t,i,o);a._encryptionKeyPair=t}).then(t,e)})};s.prototype.internalDataDecrypt=function(t){var e=this;return this._encryptionKeyPair.decrypt(t).then(function(t){e._encryptionKeyPair.closeKeyPair();return t},function(t){e._encryptionKeyPair.closeKeyPair();throw e.translateBiometricInternalError(t)})};s.prototype.internalDataEncrypt=function(t){return this._encryptionKeyPair.encrypt(t)};s.prototype.finalizeLock=function(){this._encryptionKeyPair=null};s.prototype.handleLocalDecryptError=function(t){if(t.getErrorCode()==c.AuthenticationErrorCode.UserCanceled){this.invokeUiHandlerCancellation()}else{e.prototype.handleLocalDecryptError.call(this,t)}};return s}(t.AuthenticatorVault);t.AuthenticatorVaultBiometric=e})(t=r.vault||(r.vault={}))})(t=c.core||(c.core={}))})(t=u.sdk||(u.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(n){var t;(function(h){var t;(function(l){var t;(function(t){var e=function(e){__extends(u,e);function u(){var t=e!==null&&e.apply(this,arguments)||this;t.biometricType="FaceId";return t}u.prototype.updateKeyPairWithAuthenticationInput=function(t,e,r){t.setBiometricPromptInfo(r.getPrompt(),"",this._uiHandler,e)};u.createNew=function(n,i,o,a,s,c,t){return new Promise(function(t,e){if(c){throw new h.impl.AuthenticationErrorImpl(h.AuthenticationErrorCode.Internal,"This vault type does not support disabling integrity protection")}var r={type:l.authenticationdrivers.AuthenticationDriverDescriptorNativeFace.authenticatorName,salt:a.host.generateRandomHexString(24),data:""};t(new u(n,r,i,o,a,s))})};u.getAuthenticatorDescription=function(t){return new r(t)};u.prototype.createAuthenticatorSession=function(){return this._uiHandler.createNativeFaceAuthSession(l.authenticationdrivers.AuthenticationDriverDescriptorNativeFace.authenticatorName,this._user.displayName)};return u}(t.AuthenticatorVaultBiometric);t.AuthenticatorVaultFaceId=e;var r=function(r){__extends(t,r);function t(t){var e=r.call(this,h.AuthenticatorType.FaceID,l.authenticationdrivers.AuthenticationDriverDescriptorNativeFace.authenticatorName)||this;e._sdk=t;return e}t.prototype.getSupportedOnDevice=function(){return this._sdk.host.queryHostInfo(n.sdkhost.HostInformationKey.FaceIdKeyBioProtectionSupported)==="true"};return t}(t.AuthenticatorVaultDescription)})(t=l.vault||(l.vault={}))})(t=h.core||(h.core={}))})(t=n.sdk||(n.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(n){var t;(function(h){var t;(function(l){var t;(function(t){var e=function(e){__extends(u,e);function u(){var t=e!==null&&e.apply(this,arguments)||this;t.biometricType="Fingerprint";return t}u.prototype.updateKeyPairWithAuthenticationInput=function(t,e,r){t.setBiometricPromptInfo(r.getPrompt(),"",this._uiHandler,e)};u.createNew=function(n,i,o,a,s,c,t){return new Promise(function(t,e){if(c){throw new h.impl.AuthenticationErrorImpl(h.AuthenticationErrorCode.Internal,"This vault type does not support disabling integrity protection")}var r={type:l.authenticationdrivers.AuthenticationDriverDescriptorFingerprint.authenticatorName,salt:a.host.generateRandomHexString(24),data:""};t(new u(n,r,i,o,a,s))})};u.getAuthenticatorDescription=function(t){return new r(t)};u.prototype.createAuthenticatorSession=function(){return this._uiHandler.createFingerprintAuthSession(l.authenticationdrivers.AuthenticationDriverDescriptorFingerprint.authenticatorName,this._user.displayName)};return u}(t.AuthenticatorVaultBiometric);t.AuthenticatorVaultFingerprint=e;var r=function(r){__extends(t,r);function t(t){var e=r.call(this,h.AuthenticatorType.Fingerprint,l.authenticationdrivers.AuthenticationDriverDescriptorFingerprint.authenticatorName)||this;e._sdk=t;return e}t.prototype.getSupportedOnDevice=function(){return this._sdk.host.queryHostInfo(n.sdkhost.HostInformationKey.FingerprintSupported)==="true"};return t}(t.AuthenticatorVaultDescription)})(t=l.vault||(l.vault={}))})(t=h.core||(h.core={}))})(t=n.sdk||(n.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(l){var t;(function(t){var e;(function(u){var t=function(s){__extends(c,s);function c(t,e,r,n,i,o){var a=s.call(this,t,e,r,n,i,o)||this;if(!a._vaultData.cryptoSettings){throw new l.impl.AuthenticationErrorImpl(l.AuthenticationErrorCode.Internal,"vault data is missing cryptography settings")}return a}c.createNew=function(r,n,i,o,a,s,t){return new Promise(function(t){var e={type:c._authenticatorName,salt:o.host.generateRandomHexString(24),data:"",cryptoSettings:{pbkdf_iterations_count:o.cryptoSettings.getLocalEnrollmentKeyIterationCount(),pbkdf_key_size:o.cryptoSettings.getLocalEnrollmentKeySizeInBytes()},noIntegrity:s};t(new c(r,e,n,i,o,a))})};c.supportsNoIntegrity=function(){return true};c.deletePrivateResources=function(t,e,r){};c.getAuthenticatorDescription=function(t){return new u.AuthenticatorVaultDescription(l.AuthenticatorType.Password,c._authenticatorName)};c.prototype.createAuthenticatorSession=function(){return this._uiHandler.createPasswordAuthSession(c._authenticatorName,this._user.displayName)};c.prototype.prepareToUnlock=function(t,e,r,n,i){var o=this;var a=e;if(!this._vaultData.cryptoSettings){return Promise.reject(new l.impl.AuthenticationErrorImpl(l.AuthenticationErrorCode.Internal,"Missing crypt settings for password vault."))}return u.pbkdfStretchHexSecretIntoAESKey(this._vaultData.salt,l.util.asciiToHex(a.getPassword()),this._vaultData.cryptoSettings.pbkdf_key_size,this._vaultData.cryptoSettings.pbkdf_iterations_count,this.noIntegrity||false,this._sdk).then(function(t){o._encryptionKey=t})};c.prototype.internalDataDecrypt=function(t){var e=this;return this._encryptionKey.decrypt(t,null).catch(function(t){if(!e.noIntegrity){throw new l.impl.AuthenticationErrorImpl(l.AuthenticationErrorCode.InvalidInput,"Incorrect password input.")}else{throw t}})};c.prototype.internalDataEncrypt=function(t){return this._encryptionKey.encrypt(t)};c.prototype.finalizeLock=function(){this._encryptionKey=null};c._authenticatorName="password";return c}(u.AuthenticatorVault);u.AuthenticatorVaultPassword=t})(e=t.vault||(t.vault={}))})(t=l.core||(l.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(l){var t;(function(d){var t;(function(u){var a;(function(o){var t=function(s){__extends(h,s);function h(t,e,r,n,i,o){var a=s.call(this,t,e,r,n,i,o)||this;a._selectedCredential=null;return a}h.createNew=function(i,o,a,s,c,u,l){return new Promise(function(t,e){if(!l||!l.vault){e(new d.impl.AuthenticationErrorImpl(d.AuthenticationErrorCode.Internal,"failt to parse provision data for vault "+o));return}var r={type:"multi_credential_protection",data:"",noIntegrity:u,eskr_pub:{type:l.vault.eskr_pub.type,key:d.util.base64ToHex(l.vault.eskr_pub.key)},ephemeralW:"",protectingCreds:[]};var n=new h(i,r,o,a,s,c);n.addOrUpdateProtectingCreds(l.vault);t(n)})};h.updateVaultsProtectingCreds=function(r,t,n,i){i.log(d.LogLevel.Debug,"checking for updated credentials on multi creds vaults");t.forEach(function(t){var e=a.Vault.getVaultForUserWithId(r,u.TarsusKeyPath.fromString(t.vault_id),new(function(){function t(){}t.prototype.getValidCancelOptions=function(){return null};t.prototype.getValidErrorRecoveryOptions=function(t){return[d.AuthenticationErrorRecovery.Fail]};return t}()),i,n);if(!(e instanceof a.MultiCredsVault)){i.log(d.LogLevel.Warning,"Unhandled vault type for '"+t.vault_id+"'");return}i.log(d.LogLevel.Debug,"checking for updated credentials on vault '"+t.vault_id+"'");if(t.update_type=="add_credentials"){e.addOrUpdateProtectingCreds(t)}else if(t.update_type=="remove_credentials"){e.removeProtectingCreds(t)}else{i.log(d.LogLevel.Warning,"Unhandled vault update type '"+t.update_type+"'");return}o.Vault.updateVaultForUserWithId(r,e._vaultData,e._vaultId,i)})};h.supportsNoIntegrity=function(){return true};h.deletePrivateResources=function(t,e,r){};h.prototype.unlock=function(n,i){var o=this;return new Promise(function(e,r){o._policyAction=n;o._clientContext=i;if(o.isEmpty()){o._sdk.log(d.LogLevel.Info,"Unlocking empty vault '"+o._vaultId+"'");o._unlockedData={};e(true);return}o.buildAuthenticationOptions();var t;if(1<o._authenticationOptions.length){t=o._uiHandler.selectAuthenticator(o._authenticationOptions,n,i).then(function(t){switch(t.getResultType()){case d.AuthenticatorSelectionResultType.Abort:throw new d.impl.AuthenticationErrorImpl(d.AuthenticationErrorCode.UserCanceled,"Cancel during authenticator selection.");case d.AuthenticatorSelectionResultType.SelectAuthenticator:var e=t.getSelectedAuthenticator();if(!e.getRegistered()){throw new d.impl.AuthenticationErrorImpl(d.AuthenticationErrorCode.AppImplementation,"unregistered authenticator selected "+e.getAuthenticatorId())}return e}})}else{t=Promise.resolve(o._authenticationOptions[0].getAuthenticator())}t.then(function(t){o._selectedCredential=t.credential;o._selectedCredential.startCredentialSession(o._clientContext);o._sdk.log(d.LogLevel.Info,"Unlocking existing vault '"+o._vaultId+"', using credential '"+o._selectedCredential.credentialId+"'");o.unlockInstartedSession().then(e,r)}).catch(r)})};h.prototype.finalizeLock=function(){this._selectedCredential=null};h.prototype.internalDataEncrypt=function(t){var r=this;var e=this._sdk.host.generateRandomHexString(64);this._sdk.log(d.LogLevel.Debug,"Generated ephemeral key for vault '"+this._vaultId+"'");var n=this.noIntegrity?l.sdkhost.KeyClass.NoIntegrityAES:l.sdkhost.KeyClass.GeneralPurposeAES;var i=this._sdk.host.importVolatileSymmetricKey(e,n);return i.encrypt(t).then(function(e){r._sdk.log(d.LogLevel.Debug,"ecnrypted data using ephemeral key for vault '"+r._vaultId+"'");var t=r._sdk.host.importVolatileKeyPairFromPublicKeyHex(l.sdkhost.KeyClass.FidoECCSigningKey,r._vaultData.eskr_pub.key);return t.wrapSymmetricKey(i).then(function(t){r._sdk.log(d.LogLevel.Debug,"wrapped ephemeral key with eskr_pub for vault '"+r._vaultId+"'");r._vaultData.ephemeralW=t;o.Vault.updateVaultForUserWithId(r._user,r._vaultData,r._vaultId,r._sdk);return e})})};h.prototype.internalDataDecrypt=function(t){var e=this;var r=this._ephemeral.decrypt(t,null);r.finally(function(){return e._ephemeral=null});return r};h.prototype.getPolicyAction=function(t){return this._policyAction};h.prototype.availableAuthenticatorsForSwitchMethod=function(){return this._availableCredentials};h.prototype.getAuthenticatorConfig=function(e){return this._availableCredentials.filter(function(t){return t.getAuthenticatorId()==e.credentialId})[0].getAuthenticatorConfig()};h.prototype.getAuthenticatorDescription=function(e){return this._availableCredentials.filter(function(t){return t.getAuthenticatorId()==e.credentialId})[0]};h.prototype.getUIHandler=function(t){return this._uiHandler};h.prototype.unlockInstartedSession=function(){var n=this;var t=this._selectedCredential.authenticatorDescription.getEskrPriW();this._sdk.log(d.LogLevel.Debug,"unwrapping eskr_pri_w for vault '"+this._vaultId+"'");return this._selectedCredential.unwrapAsymmetricKeyPairFromPrivateHex(t,l.sdkhost.KeyClass.FidoECCSigningKey).then(function(t){if(t instanceof u.credential.CredentialUnwrapAsymmetricResult){n._sdk.log(d.LogLevel.Debug,"eskr_pri_w unwrapped successfully, unwrapping ephemeral for vault '"+n._vaultId+"'");var e=n._vaultData.noIntegrity?l.sdkhost.KeyClass.NoIntegrityAES:l.sdkhost.KeyClass.GeneralPurposeAES;return t.keyPair.unwrapSymmetricKeyHex(n._vaultData.ephemeralW,e).then(function(t){n._sdk.log(d.LogLevel.Debug,"ephemeral unwrapped successfully, decrypting for vault '"+n._vaultId+"'");n._ephemeral=t;return n.internalDataDecrypt(n._vaultData.data).then(function(t){n._sdk.log(d.LogLevel.Debug,"decrypted successfully for vault '"+n._vaultId+"'");n._unlockedData=n.jsonFromDecryptedHexString(t);n._selectedCredential.endCredentialSession();return true}).catch(function(t){n._sdk.log(d.LogLevel.Error,"decrypt failed for vault '"+n._vaultId+"': "+t);if(!n.noIntegrity&&t.getErrorCode()==d.AuthenticationErrorCode.Internal){t=new d.impl.AuthenticationErrorImpl(d.AuthenticationErrorCode.InvalidInput,"Authentication failed.")}throw t})}).catch(function(t){n._sdk.log(d.LogLevel.Error,"uwrap ephemeral failed: "+t);throw t})}else if(t instanceof u.credential.CredentialAuthOperationResultSwitchAuthenticator){n._selectedCredential.endCredentialSession();return n.unlock(n._policyAction,n._clientContext)}else{throw new d.impl.AuthenticationErrorImpl(d.AuthenticationErrorCode.Internal,"Unhandled credential opreation result")}}).catch(function(e){n._sdk.log(d.LogLevel.Error,"unwrap eskr_pri_w or nested operation failed for vault '"+n._vaultId+"': "+e);var t=n.getValidErrorRecoveryOptions(e);var r=t.indexOf(d.AuthenticationErrorRecovery.RetryAuthenticator)>=0?d.AuthenticationErrorRecovery.RetryAuthenticator:d.AuthenticationErrorRecovery.Fail;if(t.indexOf(d.AuthenticationErrorRecovery.ChangeAuthenticator)<0&&n._authenticationOptions.length>1){t.push(d.AuthenticationErrorRecovery.ChangeAuthenticator)}return n._selectedCredential.promiseRecoveryForError(e,t,r).then(function(t){return n.handleErrorRecoveryAction(t,e)})})};h.prototype.handleErrorRecoveryAction=function(t,e){switch(t){case d.AuthenticationErrorRecovery.RetryAuthenticator:return this.unlockInstartedSession();case d.AuthenticationErrorRecovery.ChangeAuthenticator:case d.AuthenticationErrorRecovery.SelectAuthenticator:this._selectedCredential.endCredentialSession();return this.unlock(this._policyAction,this._clientContext);case d.AuthenticationErrorRecovery.Fail:default:this._selectedCredential.endCredentialSession();return Promise.reject(e)}};h.prototype.addOrUpdateProtectingCreds=function(t){var o=this;t.protecting_credentials.forEach(function(e){var t=e.local_authenticator_id;if(!t){o._sdk.log(d.LogLevel.Warning,"Unhandled credential type");return}var r=o._vaultData.protectingCreds.filter(function(t){return t.local_authenticator_id==e.local_authenticator_id});var n={local_authenticator_id:e.local_authenticator_id,eskr_pri_w:d.util.base64ToHex(e.eskr_pri_w),authenticatorConfig:e.attrs};if(r.length<1){o._sdk.log(d.LogLevel.Debug,"adding credential '"+n.local_authenticator_id+"' for vault '"+o._vaultId+"'");o._vaultData.protectingCreds.push(n)}else{o._sdk.log(d.LogLevel.Debug,"updating credential '"+n.local_authenticator_id+"' for vault '"+o._vaultId+"'");var i=o._vaultData.protectingCreds.indexOf(r[0]);o._vaultData.protectingCreds[i]=n}})};h.prototype.removeProtectingCreds=function(t){var n=this;t.protecting_credentials.forEach(function(e){var t=e.local_authenticator_id;if(!t){n._sdk.log(d.LogLevel.Warning,"Unhandled credential type");return}var r=n._vaultData.protectingCreds.filter(function(t){if(t.local_authenticator_id!=e.local_authenticator_id){return true}n._sdk.log(d.LogLevel.Debug,"removing credential '"+e.local_authenticator_id+"' for vault '"+n._vaultId+"'");return false});n._vaultData.protectingCreds=r})};h.prototype.buildAuthenticationOptions=function(){var i=this;this._sdk.log(d.LogLevel.Debug,"building authentication options for vault '"+this._vaultId+"'");var o=u.User.findUser(this._sdk,this._user.userHandle);if(!o){throw new d.impl.AuthenticationErrorImpl(d.AuthenticationErrorCode.Internal,"failed to find storage record for user '"+this._user.displayName+"'")}this._availableCredentials=[];this._authenticationOptions=[];var a=this._uiHandler.shouldIncludeDisabledAuthenticatorsInMenu(this._policyAction,this._clientContext);this._vaultData.protectingCreds.forEach(function(t){var e=t.local_authenticator_id;if(!e){i._sdk.log(d.LogLevel.Warning,"Unhandled credential type");return}var r=o.localEnrollments[e];if(!r){i._sdk.log(d.LogLevel.Warning,"enrollment record '"+e+"' for user '"+i._user.displayName+"' isn't found");return}var n=new c(t,i,o,i._sdk);if(!a&&!n.getRegistered()){i._sdk.log(d.LogLevel.Debug,"Not adding unregistered authentication option '"+n.getAuthenticatorId()+"' for vault '"+i._vaultId+"'");return}i._sdk.log(d.LogLevel.Debug,"adding authentication option '"+n.getAuthenticatorId()+"' for vault '"+i._vaultId+"'");i._availableCredentials.push(n);i._authenticationOptions.push(new d.impl.AuthenticationOptionImpl(n,[]))});if(this._availableCredentials.length<=0){throw new d.impl.AuthenticationErrorImpl(d.AuthenticationErrorCode.NoRegisteredAuthenticator,"No registered authenticator available.")}};return h}(o.Vault);o.MultiCredsVault=t;var c=function(){function t(t,e,r,n){this._credSpec=t;this._holder=e;this._user=r;this._sdk=n}Object.defineProperty(t.prototype,"credential",{get:function(){if(!this._credential){this._credential=u.credential.CredentialTypes[this._credSpec.local_authenticator_id].create(this._credSpec.local_authenticator_id,this._holder,this._user,this._sdk)}return this._credential},enumerable:true,configurable:true});t.prototype.getAuthenticatorId=function(){return this._credSpec.local_authenticator_id};t.prototype.getName=function(){return u.Protocol.AuthTypeData[this._credSpec.local_authenticator_id].authTypeName};t.prototype.getType=function(){return u.Protocol.AuthTypeData[this._credSpec.local_authenticator_id].authTypeEnum};t.prototype.getRegistered=function(){return this.getRegistrationStatus()===d.AuthenticatorRegistrationStatus.Registered};t.prototype.getDefaultAuthenticator=function(){return false};t.prototype.getExpired=function(){return false};t.prototype.getEnabled=function(){return true};t.prototype.getLocked=function(){return false};t.prototype.getSupportedOnDevice=function(){return true};t.prototype.getRegistrationStatus=function(){return this.credential.evaluateLocalRegistrationStatus()};t.prototype.getEskrPriW=function(){return this._credSpec.eskr_pri_w};t.prototype.getAuthenticatorConfig=function(){var t=this._user.localEnrollments[this._credSpec.local_authenticator_id];return t.authenticatorConfig||this._credSpec.authenticatorConfig};return t}();o.MultiCredsVaultCredentialDescription=c})(a=u.vault||(u.vault={}))})(t=d.core||(d.core={}))})(t=l.sdk||(l.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(a){var t;(function(t){var e;(function(t){var e;(function(t){function e(t,e,r,n,i,o){return o.host.generatePbkdf2HmacSha1HexString(t,e,r,n).then(function(t){return o.host.importVolatileSymmetricKey(t,i?a.sdkhost.KeyClass.NoIntegrityAES:a.sdkhost.KeyClass.GeneralPurposeAES)})}t.pbkdfStretchHexSecretIntoAESKey=e})(e=t.vault||(t.vault={}))})(e=t.core||(t.core={}))})(t=a.sdk||(a.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){function e(t){return"getAuthenticatorDescription"in t}t.isAuthenticatorVaultDescriptor=e;t.VaultTypes={multi_credential_protection:t.MultiCredsVault,password:t.AuthenticatorVaultPassword,fingerprint:t.AuthenticatorVaultFingerprint,face_id:t.AuthenticatorVaultFaceId}})(e=t.vault||(t.vault={}))})(e=t.core||(t.core={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.getAcquisitionResponse=function(){return this._acquisitionResponse};e.prototype.setAcquisitionResponse=function(t){this._acquisitionResponse=t};e.__tarsusInterfaceName="AudioInputResponse";return e}(t.InputResponseType);t.AudioInputResponse=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){t[t["Internal"]=0]="Internal";t[t["InvalidInput"]=1]="InvalidInput";t[t["AuthenticatorLocked"]=2]="AuthenticatorLocked";t[t["AllAuthenticatorsLocked"]=3]="AllAuthenticatorsLocked";t[t["NoRegisteredAuthenticator"]=4]="NoRegisteredAuthenticator";t[t["RegisteredSecretAlreadyInHistory"]=5]="RegisteredSecretAlreadyInHistory";t[t["Communication"]=6]="Communication";t[t["UserCanceled"]=7]="UserCanceled";t[t["AppImplementation"]=8]="AppImplementation";t[t["PolicyRejection"]=9]="PolicyRejection";t[t["AuthenticatorInvalidated"]=10]="AuthenticatorInvalidated";t[t["ControlFlowExpired"]=11]="ControlFlowExpired";t[t["SessionRequired"]=12]="SessionRequired";t[t["AuthenticatorError"]=13]="AuthenticatorError";t[t["ApprovalWrongState"]=14]="ApprovalWrongState";t[t["TotpNotProvisioned"]=15]="TotpNotProvisioned";t[t["AuthenticatorExternalConfigError"]=16]="AuthenticatorExternalConfigError";t[t["InvalidDeviceBinding"]=17]="InvalidDeviceBinding";t[t["InvalidIdToken"]=18]="InvalidIdToken";t[t["DeviceNotFound"]=19]="DeviceNotFound";t[t["ApprovalDenied"]=20]="ApprovalDenied";t[t["ApprovalExpired"]=21]="ApprovalExpired";t[t["ApplicationGeneratedRecoverableError"]=22]="ApplicationGeneratedRecoverableError"})(e=t.AuthenticationErrorCode||(t.AuthenticationErrorCode={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){t[t["AuthenticatorExternalConfigErrorReason"]=0]="AuthenticatorExternalConfigErrorReason";t[t["AuthenticatorInvalidInputErrorDescription"]=1]="AuthenticatorInvalidInputErrorDescription";t[t["InvalidIdTokenErrorReason"]=2]="InvalidIdTokenErrorReason"})(e=t.AuthenticationErrorProperty||(t.AuthenticationErrorProperty={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){t[t["AuthenticatorExternalConfigErrorReasonBiometricsNotEnrolled"]=0]="AuthenticatorExternalConfigErrorReasonBiometricsNotEnrolled";t[t["AuthenticatorExternalConfigErrorReasonBiometricsOsLockTemporary"]=1]="AuthenticatorExternalConfigErrorReasonBiometricsOsLockTemporary";t[t["AuthenticatorExternalConfigErrorReasonBiometricsOsLockPermanent"]=2]="AuthenticatorExternalConfigErrorReasonBiometricsOsLockPermanent";t[t["AuthenticatorInvalidInputErrorDescriptionTotpIncorrectCheckDigit"]=3]="AuthenticatorInvalidInputErrorDescriptionTotpIncorrectCheckDigit";t[t["InvalidIdTokenErrorReasonExpiredToken"]=4]="InvalidIdTokenErrorReasonExpiredToken";t[t["InvalidIdTokenErrorReasonBadToken"]=5]="InvalidIdTokenErrorReasonBadToken"})(e=t.AuthenticationErrorPropertySymbol||(t.AuthenticationErrorPropertySymbol={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){t[t["RetryAuthenticator"]=0]="RetryAuthenticator";t[t["ChangeAuthenticator"]=1]="ChangeAuthenticator";t[t["SelectAuthenticator"]=2]="SelectAuthenticator";t[t["Fail"]=3]="Fail"})(e=t.AuthenticationErrorRecovery||(t.AuthenticationErrorRecovery={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){t[t["Register"]=0]="Register";t[t["Unregister"]=1]="Unregister";t[t["Reregister"]=2]="Reregister"})(e=t.AuthenticatorConfigurationAction||(t.AuthenticatorConfigurationAction={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){t[t["Fallback"]=0]="Fallback";t[t["AuthMenu"]=1]="AuthMenu";t[t["Retry"]=2]="Retry";t[t["Cancel"]=3]="Cancel"})(e=t.AuthenticatorFallbackAction||(t.AuthenticatorFallbackAction={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){t[t["Registered"]=0]="Registered";t[t["Unregistered"]=1]="Unregistered";t[t["LocallyInvalid"]=2]="LocallyInvalid"})(e=t.AuthenticatorRegistrationStatus||(t.AuthenticatorRegistrationStatus={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){t[t["SelectAuthenticator"]=0]="SelectAuthenticator";t[t["Abort"]=1]="Abort"})(e=t.AuthenticatorSelectionResultType||(t.AuthenticatorSelectionResultType={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){t[t["Authentication"]=0]="Authentication";t[t["Registration"]=1]="Registration"})(e=t.AuthenticatorSessionMode||(t.AuthenticatorSessionMode={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.getAcquisitionResponse=function(){return this._acquisitionResponse};e.prototype.setAcquisitionResponse=function(t){this._acquisitionResponse=t};e.__tarsusInterfaceName="CameraInputResponse";return e}(t.InputResponseType);t.CameraInputResponse=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){t[t["Accounts"]=0]="Accounts";t[t["DeviceDetails"]=1]="DeviceDetails";t[t["Contacts"]=2]="Contacts";t[t["Owner"]=3]="Owner";t[t["Software"]=4]="Software";t[t["Location"]=5]="Location";t[t["Bluetooth"]=6]="Bluetooth";t[t["ExternalSDKDetails"]=7]="ExternalSDKDetails";t[t["HWAuthenticators"]=8]="HWAuthenticators";t[t["Capabilities"]=9]="Capabilities";t[t["FidoAuthenticators"]=10]="FidoAuthenticators";t[t["LargeData"]=11]="LargeData";t[t["LocalEnrollments"]=12]="LocalEnrollments"})(e=t.CollectorType||(t.CollectorType={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){t[t["None"]=0]="None";t[t["Credentials"]=1]="Credentials";t[t["Full"]=2]="Full"})(e=t.ConnectionCryptoMode||(t.ConnectionCryptoMode={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){t[t["CancelAuthenticator"]=0]="CancelAuthenticator";t[t["RetryAuthenticator"]=1]="RetryAuthenticator";t[t["ChangeMethod"]=2]="ChangeMethod";t[t["SelectMethod"]=3]="SelectMethod";t[t["AbortAuthentication"]=4]="AbortAuthentication"})(e=t.ControlRequestType||(t.ControlRequestType={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){t[t["Remove"]=0]="Remove";t[t["Identify"]=1]="Identify";t[t["Rename"]=2]="Rename"})(e=t.DeviceManagementAction||(t.DeviceManagementAction={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){t[t["RecentlyUsed"]=0]="RecentlyUsed";t[t["NoRecentActivity"]=1]="NoRecentActivity";t[t["LongInactivity"]=2]="LongInactivity";t[t["Disabled"]=3]="Disabled";t[t["Removed"]=4]="Removed"})(e=t.DeviceStatus||(t.DeviceStatus={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.getFailureError=function(){return this._failureError};e.prototype.setFailureError=function(t){this._failureError=t};e.__tarsusInterfaceName="Fido2AuthenticationFailedResponse";return e}(t.Fido2InputResponse);t.Fido2AuthenticationFailedResponse=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.getFido2Response=function(){return this._fido2Response};e.prototype.setFido2Response=function(t){this._fido2Response=t};e.__tarsusInterfaceName="Fido2AuthenticatorSuccessResponse";return e}(t.Fido2InputResponse);t.Fido2AuthenticatorSuccessResponse=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.getFailureError=function(){return this._failureError};e.prototype.setFailureError=function(t){this._failureError=t};e.prototype.getExpired=function(){return this._expired};e.prototype.setExpired=function(t){this._expired=t};e.prototype.getRegistered=function(){return this._registered};e.prototype.setRegistered=function(t){this._registered=t};e.prototype.getRegistrationStatus=function(){return this._registrationStatus};e.prototype.setRegistrationStatus=function(t){this._registrationStatus=t};e.prototype.getLocked=function(){return this._locked};e.prototype.setLocked=function(t){this._locked=t};e.__tarsusInterfaceName="FidoAuthFailureResponse";return e}(t.FidoInputResponse);t.FidoAuthFailureResponse=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.getFidoResponse=function(){return this._fidoResponse};e.prototype.setFidoResponse=function(t){this._fidoResponse=t};e.__tarsusInterfaceName="FidoAuthSuccessResponse";return e}(t.FidoInputResponse);t.FidoAuthSuccessResponse=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){t[t["Submit"]=0]="Submit";t[t["Abort"]=1]="Abort"})(e=t.FormControlRequest||(t.FormControlRequest={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){t[t["Off"]=0]="Off";t[t["Critical"]=1]="Critical";t[t["Error"]=2]="Error";t[t["Warning"]=3]="Warning";t[t["Info"]=4]="Info";t[t["Debug"]=5]="Debug"})(e=t.LogLevel||(t.LogLevel={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){t[t["Approve"]=0]="Approve";t[t["Deny"]=1]="Deny"})(e=t.MobileApprovalAction||(t.MobileApprovalAction={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){t[t["Pending"]=0]="Pending";t[t["Approved"]=1]="Approved";t[t["Denied"]=2]="Denied";t[t["Expired"]=3]="Expired"})(e=t.MobileApprovalStatus||(t.MobileApprovalStatus={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){t[t["Unknown"]=0]="Unknown";t[t["Sms"]=1]="Sms";t[t["Email"]=2]="Email";t[t["PushNotification"]=3]="PushNotification";t[t["VoiceCall"]=4]="VoiceCall"})(e=t.OtpChannel||(t.OtpChannel={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.getFailureError=function(){return this._failureError};e.prototype.setFailureError=function(t){this._failureError=t};e.prototype.getExpired=function(){return this._expired};e.prototype.setExpired=function(t){this._expired=t};e.prototype.getRegistered=function(){return this._registered};e.prototype.setRegistered=function(t){this._registered=t};e.prototype.getRegistrationStatus=function(){return this._registrationStatus};e.prototype.setRegistrationStatus=function(t){this._registrationStatus=t};e.prototype.getLocked=function(){return this._locked};e.prototype.setLocked=function(t){this._locked=t};e.__tarsusInterfaceName="PlaceholderAuthFailureResponse";return e}(t.PlaceholderInputResponse);t.PlaceholderAuthFailureResponse=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.getFailureError=function(){return this._failureError};e.prototype.setFailureError=function(t){this._failureError=t};e.__tarsusInterfaceName="PlaceholderAuthFailureWithServerProvidedStatusResponse";return e}(t.PlaceholderInputResponse);t.PlaceholderAuthFailureWithServerProvidedStatusResponse=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.getPlaceholderToken=function(){return this._placeholderToken};e.prototype.setPlaceholderToken=function(t){this._placeholderToken=t};e.__tarsusInterfaceName="PlaceholderAuthSuccessResponse";return e}(t.PlaceholderInputResponse);t.PlaceholderAuthSuccessResponse=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){t[t["Skip"]=0]="Skip";t[t["Abort"]=1]="Abort";t[t["Continue"]=2]="Continue"})(e=t.PromotionControlRequest||(t.PromotionControlRequest={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){t[t["Numeric"]=0]="Numeric";t[t["Alphanumeric"]=1]="Alphanumeric";t[t["Binary"]=2]="Binary"})(e=t.QrCodeFormat||(t.QrCodeFormat={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){t[t["RedirectToPolicy"]=0]="RedirectToPolicy";t[t["CancelRedirect"]=1]="CancelRedirect"})(e=t.RedirectResponseType||(t.RedirectResponseType={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.getAnswers=function(){return this._answers};e.__tarsusInterfaceName="SecurityQuestionAnswersInputResponse";return e}(t.SecurityQuestionInputResponse);t.SecurityQuestionAnswersInputResponse=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(){}t.prototype.getValue=function(){return this._value};t.prototype.setValue=function(t){this._value=t};t.prototype.getFormat=function(){return this._format};t.prototype.setFormat=function(t){this._format=t};t.__tarsusInterfaceName="TotpChallenge";return t}();t.TotpChallenge=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(){}t.prototype.getName=function(){return this._name};t.prototype.setName=function(t){this._name=t};t.prototype.getValue=function(){return this._value};t.prototype.setValue=function(t){this._value=t};t.__tarsusInterfaceName="TransportHeader";return t}();t.TransportHeader=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(){}t.prototype.getUrl=function(){return this._url};t.prototype.setUrl=function(t){this._url=t};t.prototype.getMethod=function(){return this._method};t.prototype.setMethod=function(t){this._method=t};t.prototype.getHeaders=function(){return this._headers};t.prototype.setHeaders=function(t){this._headers=t};t.prototype.getBodyJson=function(){return this._bodyJson};t.prototype.setBodyJson=function(t){this._bodyJson=t};t.__tarsusInterfaceName="TransportRequest";return t}();t.TransportRequest=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(){}t.prototype.getStatus=function(){return this._status};t.prototype.setStatus=function(t){this._status=t};t.prototype.getMethod=function(){return this._method};t.prototype.setMethod=function(t){this._method=t};t.prototype.getHeaders=function(){return this._headers};t.prototype.setHeaders=function(t){this._headers=t};t.prototype.getBodyJson=function(){return this._bodyJson};t.prototype.setBodyJson=function(t){this._bodyJson=t};t.__tarsusInterfaceName="TransportResponse";return t}();t.TransportResponse=e})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){t[t["UserId"]=0]="UserId";t[t["IdToken"]=1]="IdToken"})(e=t.UserHandleType||(t.UserHandleType={}))})(e=t.sdk||(t.sdk={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){t[t["Create"]=0]="Create";t[t["Get"]=1]="Get"})(e=t.Fido2CredentialsOpType||(t.Fido2CredentialsOpType={}))})(e=t.sdkhost||(t.sdkhost={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){t[t["Version"]=0]="Version";t[t["Platform"]=1]="Platform";t[t["FingerprintSupported"]=2]="FingerprintSupported";t[t["HostProvidedFeatures"]=3]="HostProvidedFeatures";t[t["FaceIdKeyBioProtectionSupported"]=4]="FaceIdKeyBioProtectionSupported";t[t["ImageAcquitisionSupported"]=5]="ImageAcquitisionSupported";t[t["AudioAcquitisionSupported"]=6]="AudioAcquitisionSupported";t[t["PersistentKeysSupported"]=7]="PersistentKeysSupported";t[t["FidoClientPresent"]=8]="FidoClientPresent";t[t["DyadicPresent"]=9]="DyadicPresent";t[t["StdSigningKeyIsHardwareProtectedSignAndEncryptKey"]=10]="StdSigningKeyIsHardwareProtectedSignAndEncryptKey";t[t["Fido2ClientPresent"]=11]="Fido2ClientPresent"})(e=t.HostInformationKey||(t.HostInformationKey={}))})(e=t.sdkhost||(t.sdkhost={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){t[t["None"]=0]="None";t[t["NormalProtection"]=1]="NormalProtection";t[t["BindToEnrollmentDb"]=2]="BindToEnrollmentDb"})(e=t.KeyBiometricProtectionMode||(t.KeyBiometricProtectionMode={}))})(e=t.sdkhost||(t.sdkhost={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){var e;(function(t){t[t["StdSigningKey"]=0]="StdSigningKey";t[t["StdEncryptionKey"]=1]="StdEncryptionKey";t[t["GeneralPurposeAES"]=2]="GeneralPurposeAES";t[t["NoIntegrityAES"]=3]="NoIntegrityAES";t[t["FidoECCSigningKey"]=4]="FidoECCSigningKey";t[t["HardwareProtectedSignAndEncryptKey"]=5]="HardwareProtectedSignAndEncryptKey"})(e=t.KeyClass||(t.KeyClass={}))})(e=t.sdkhost||(t.sdkhost={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(r){var t;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(){}t.prototype.getPluginName=function(){return this._pluginName};t.prototype.setPluginName=function(t){this._pluginName=t};t.prototype.getVersionMajor=function(){return this._versionMajor};t.prototype.setVersionMajor=function(t){this._versionMajor=t};t.prototype.getVersionMinor=function(){return this._versionMinor};t.prototype.setVersionMinor=function(t){this._versionMinor=t};t.prototype.getVersionPatch=function(){return this._versionPatch};t.prototype.setVersionPatch=function(t){this._versionPatch=t};t.prototype.getRequiredPluginApiLevel=function(){return this._requiredPluginApiLevel};t.prototype.setRequiredPluginApiLevel=function(t){this._requiredPluginApiLevel=t};t.create=function(){return r.ts.mobile.tarsusplugin.impl.PluginInfoImpl.create()};t.__tarsusInterfaceName="PluginInfo";return t}();t.PluginInfo=e})(e=t.tarsusplugin||(t.tarsusplugin={}))})(e=t.mobile||(t.mobile={}))})(t=r.ts||(r.ts={}))})(com||(com={}));var com;(function(s){var t;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(){}t.prototype.getCode=function(){return this._code};t.prototype.getTimeStepSeconds=function(){return this._timeStepSeconds};t.prototype.getExpiresInSeconds=function(){return this._expiresInSeconds};t.prototype.getSecondsTillNextInvocation=function(){return this._secondsTillNextInvocation};t.prototype.getShouldUpdateSpecificProperties=function(){return this._shouldUpdateSpecificProperties};t.prototype.getGeneratorSpecificDataToStore=function(){return this._generatorSpecificDataToStore};t.prototype.getMessage=function(){return this._message};t.create=function(t,e,r,n,i,o,a){return s.ts.mobile.tarsusplugin.impl.TotpCodeGenerationOutputImpl.create(t,e,r,n,i,o,a)};t.__tarsusInterfaceName="TotpCodeGenerationOutput";return t}();t.TotpCodeGenerationOutput=e})(e=t.tarsusplugin||(t.tarsusplugin={}))})(e=t.mobile||(t.mobile={}))})(t=s.ts||(s.ts={}))})(com||(com={}));var com;(function(r){var t;(function(t){var e;(function(t){var e;(function(t){var e=function(){function t(){}t.prototype.getUnprotectedProvisionOutput=function(){return this._unprotectedProvisionOutput};t.prototype.getSecretToLock=function(){return this._secretToLock};t.create=function(t,e){return r.ts.mobile.tarsusplugin.impl.VaultBasedTotpProvisionOutputImpl.create(t,e)};t.__tarsusInterfaceName="VaultBasedTotpProvisionOutput";return t}();t.VaultBasedTotpProvisionOutput=e})(e=t.tarsusplugin||(t.tarsusplugin={}))})(e=t.mobile||(t.mobile={}))})(t=r.ts||(r.ts={}))})(com||(com={}));var com;(function(n){var t;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e=function(e){__extends(t,e);function t(){var t=e.call(this)||this;t._versionMajor=0;t._versionMinor=0;t._versionPatch=0;return t}t.create=function(){return new n.ts.mobile.tarsusplugin.impl.PluginInfoImpl};t.versionToString=function(t){return t.getVersionMajor()+"."+t.getVersionMinor()+"."+t.getVersionPatch()};t.toString=function(t){return t.getPluginName()+" v"+this.versionToString(t)};return t}(r.PluginInfo);t.PluginInfoImpl=e})(t=r.impl||(r.impl={}))})(e=t.tarsusplugin||(t.tarsusplugin={}))})(e=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e=function(t){__extends(c,t);function c(){return t!==null&&t.apply(this,arguments)||this}c.create=function(t,e,r,n,i,o,a){var s=new c;s._code=t;e&&(s._message=e);s._timeStepSeconds=r;s._expiresInSeconds=n;s._secondsTillNextInvocation=i;s._shouldUpdateSpecificProperties=o;a&&(s._generatorSpecificDataToStore=a);return s};return c}(r.TotpCodeGenerationOutput);t.TotpCodeGenerationOutputImpl=e})(t=r.impl||(r.impl={}))})(e=t.tarsusplugin||(t.tarsusplugin={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={}));var com;(function(t){var e;(function(t){var e;(function(t){var e;(function(r){var t;(function(t){var e=function(t){__extends(n,t);function n(){return t!==null&&t.apply(this,arguments)||this}n.create=function(t,e){var r=new n;r._secretToLock=t;r._unprotectedProvisionOutput=e;return r};return n}(r.VaultBasedTotpProvisionOutput);t.VaultBasedTotpProvisionOutputImpl=e})(t=r.impl||(r.impl={}))})(e=t.tarsusplugin||(t.tarsusplugin={}))})(e=t.mobile||(t.mobile={}))})(e=t.ts||(t.ts={}))})(com||(com={})); !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.xmsdk=t():e.xmsdk=t()}(window,function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=5)}([function(e,t,n){"use strict";function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(t,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.supportsInlineError=!1,this.title=t,this.username=n,this.common=i}return function(e,t,n){t&&i(e.prototype,t),n&&i(e,n)}(e,[{key:"startSession",value:function(e,t,n,i){this.description=e,this.mode=t,this.actionContext=n,this.clientContext=i,this.common.log("Starting session; session mode: [".concat(this.mode,"], authenticator: [").concat(this.title,"]"))}},{key:"changeSessionModeToRegistrationAfterExpiration",value:function(){this.common.log("Changing session mode to registration after expiration; authenticator: [".concat(this.title,"]")),this.mode=com.ts.mobile.sdk.AuthenticatorSessionMode.Registration,this.authError=null}},{key:"promiseRecoveryForError",value:function(e,t,n){return this.common.log("Starting error recovery; session mode: [".concat(this.mode,"], authenticator: [").concat(this.title,"], error: [").concat(e,"]")),this.supportsInlineError&&n===com.ts.mobile.sdk.AuthenticationErrorRecovery.RetryAuthenticator?(this.authError=e,Promise.resolve(n)):n===com.ts.mobile.sdk.AuthenticationErrorRecovery.Fail?Promise.resolve(n):this.common.promiseRecoveryForError(e,t,n,this.clientContext)}},{key:"endSession",value:function(){this.common.log("Ending session; session mode: [".concat(this.mode,"], authenticator: [").concat(this.title,"]"))}},{key:"promiseInput",value:function(){var e,t=this;switch(this.common.setAriaBusy(this.clientContext),this.mode){case com.ts.mobile.sdk.AuthenticatorSessionMode.Authentication:this.common.log("Fetching authentication input; authenticator: [".concat(this.title,"]")),this.common.unsetAriaBusy(this.clientContext),e=this.promiseAuthInput();break;case com.ts.mobile.sdk.AuthenticatorSessionMode.Registration:this.common.log("Fetching registration input; authenticator: [".concat(this.title,"]")),this.common.unsetAriaBusy(this.clientContext),e=this.promiseRegInput()}return e.then(function(e){return t.common.clearContainer(t.clientContext),e})}}]),e}();t.BaseAuthenticatorSession=o},function(e,t,n){"use strict";var i,o;void 0===(o="function"==typeof(i=function(){var e=function e(t){if(!(this instanceof e))return new e(t);this.options=this.extend(t,{swfContainerId:"fingerprintjs2",swfPath:"flash/compiled/FontList.swf",detectScreenOrientation:!0,sortPluginsFor:[/palemoon/i],userDefinedFonts:[]}),this.nativeForEach=Array.prototype.forEach,this.nativeMap=Array.prototype.map};return e.prototype={extend:function(e,t){if(null==e)return t;for(var n in e)null!=e[n]&&t[n]!==e[n]&&(t[n]=e[n]);return t},get:function(e){var t=this,n={data:[],push:function(e){var n=e.key,i=e.value;"function"==typeof t.options.preprocessor&&(i=t.options.preprocessor(n,i)),this.data.push({key:n,value:i})}};n=this.userAgentKey(n),n=this.languageKey(n),n=this.colorDepthKey(n),n=this.pixelRatioKey(n),n=this.hardwareConcurrencyKey(n),n=this.screenResolutionKey(n),n=this.availableScreenResolutionKey(n),n=this.timezoneOffsetKey(n),n=this.sessionStorageKey(n),n=this.localStorageKey(n),n=this.indexedDbKey(n),n=this.addBehaviorKey(n),n=this.openDatabaseKey(n),n=this.cpuClassKey(n),n=this.platformKey(n),n=this.doNotTrackKey(n),n=this.pluginsKey(n),n=this.canvasKey(n),n=this.webglKey(n),n=this.adBlockKey(n),n=this.hasLiedLanguagesKey(n),n=this.hasLiedResolutionKey(n),n=this.hasLiedOsKey(n),n=this.hasLiedBrowserKey(n),n=this.touchSupportKey(n),n=this.customEntropyFunction(n),this.fontsKey(n,function(n){var i=[];t.each(n.data,function(e){var t=e.value;void 0!==e.value.join&&(t=e.value.join(";")),i.push(t)});var o=t.x64hash128(i.join("~~~"),31);return e(o,n.data)})},customEntropyFunction:function(e){return"function"==typeof this.options.customFunction&&e.push({key:"custom",value:this.options.customFunction()}),e},userAgentKey:function(e){return this.options.excludeUserAgent||e.push({key:"user_agent",value:this.getUserAgent()}),e},getUserAgent:function(){return navigator.userAgent},languageKey:function(e){return this.options.excludeLanguage||e.push({key:"language",value:navigator.language||navigator.userLanguage||navigator.browserLanguage||navigator.systemLanguage||""}),e},colorDepthKey:function(e){return this.options.excludeColorDepth||e.push({key:"color_depth",value:screen.colorDepth||-1}),e},pixelRatioKey:function(e){return this.options.excludePixelRatio||e.push({key:"pixel_ratio",value:this.getPixelRatio()}),e},getPixelRatio:function(){return window.devicePixelRatio||""},screenResolutionKey:function(e){return this.options.excludeScreenResolution?e:this.getScreenResolution(e)},getScreenResolution:function(e){var t;return void 0!==(t=this.options.detectScreenOrientation&&screen.height>screen.width?[screen.height,screen.width]:[screen.width,screen.height])&&e.push({key:"resolution",value:t}),e},availableScreenResolutionKey:function(e){return this.options.excludeAvailableScreenResolution?e:this.getAvailableScreenResolution(e)},getAvailableScreenResolution:function(e){var t;return screen.availWidth&&screen.availHeight&&(t=this.options.detectScreenOrientation?screen.availHeight>screen.availWidth?[screen.availHeight,screen.availWidth]:[screen.availWidth,screen.availHeight]:[screen.availHeight,screen.availWidth]),void 0!==t&&e.push({key:"available_resolution",value:t}),e},timezoneOffsetKey:function(e){return this.options.excludeTimezoneOffset||e.push({key:"timezone_offset",value:(new Date).getTimezoneOffset()}),e},sessionStorageKey:function(e){return!this.options.excludeSessionStorage&&this.hasSessionStorage()&&e.push({key:"session_storage",value:1}),e},localStorageKey:function(e){return!this.options.excludeSessionStorage&&this.hasLocalStorage()&&e.push({key:"local_storage",value:1}),e},indexedDbKey:function(e){return!this.options.excludeIndexedDB&&this.hasIndexedDB()&&e.push({key:"indexed_db",value:1}),e},addBehaviorKey:function(e){return document.body&&!this.options.excludeAddBehavior&&document.body.addBehavior&&e.push({key:"add_behavior",value:1}),e},openDatabaseKey:function(e){return!this.options.excludeOpenDatabase&&window.openDatabase&&e.push({key:"open_database",value:1}),e},cpuClassKey:function(e){return this.options.excludeCpuClass||e.push({key:"cpu_class",value:this.getNavigatorCpuClass()}),e},platformKey:function(e){return this.options.excludePlatform||e.push({key:"navigator_platform",value:this.getNavigatorPlatform()}),e},doNotTrackKey:function(e){return this.options.excludeDoNotTrack||e.push({key:"do_not_track",value:this.getDoNotTrack()}),e},canvasKey:function(e){return!this.options.excludeCanvas&&this.isCanvasSupported()&&e.push({key:"canvas",value:this.getCanvasFp()}),e},webglKey:function(e){return this.options.excludeWebGL?e:this.isWebGlSupported()?(e.push({key:"webgl",value:this.getWebglFp()}),e):e},adBlockKey:function(e){return this.options.excludeAdBlock||e.push({key:"adblock",value:this.getAdBlock()}),e},hasLiedLanguagesKey:function(e){return this.options.excludeHasLiedLanguages||e.push({key:"has_lied_languages",value:this.getHasLiedLanguages()}),e},hasLiedResolutionKey:function(e){return this.options.excludeHasLiedResolution||e.push({key:"has_lied_resolution",value:this.getHasLiedResolution()}),e},hasLiedOsKey:function(e){return this.options.excludeHasLiedOs||e.push({key:"has_lied_os",value:this.getHasLiedOs()}),e},hasLiedBrowserKey:function(e){return this.options.excludeHasLiedBrowser||e.push({key:"has_lied_browser",value:this.getHasLiedBrowser()}),e},fontsKey:function(e,t){return this.options.excludeJsFonts?this.flashFontsKey(e,t):this.jsFontsKey(e,t)},flashFontsKey:function(e,t){return this.options.excludeFlashFonts?t(e):this.hasSwfObjectLoaded()&&this.hasMinFlashInstalled()?void 0===this.options.swfPath?t(e):void this.loadSwfAndDetectFonts(function(n){e.push({key:"swf_fonts",value:n.join(";")}),t(e)}):t(e)},jsFontsKey:function(e,t){var n=this;return setTimeout(function(){var i=["monospace","sans-serif","serif"],o=["Andale Mono","Arial","Arial Black","Arial Hebrew","Arial MT","Arial Narrow","Arial Rounded MT Bold","Arial Unicode MS","Bitstream Vera Sans Mono","Book Antiqua","Bookman Old Style","Calibri","Cambria","Cambria Math","Century","Century Gothic","Century Schoolbook","Comic Sans","Comic Sans MS","Consolas","Courier","Courier New","Garamond","Geneva","Georgia","Helvetica","Helvetica Neue","Impact","Lucida Bright","Lucida Calligraphy","Lucida Console","Lucida Fax","LUCIDA GRANDE","Lucida Handwriting","Lucida Sans","Lucida Sans Typewriter","Lucida Sans Unicode","Microsoft Sans Serif","Monaco","Monotype Corsiva","MS Gothic","MS Outlook","MS PGothic","MS Reference Sans Serif","MS Sans Serif","MS Serif","MYRIAD","MYRIAD PRO","Palatino","Palatino Linotype","Segoe Print","Segoe Script","Segoe UI","Segoe UI Light","Segoe UI Semibold","Segoe UI Symbol","Tahoma","Times","Times New Roman","Times New Roman PS","Trebuchet MS","Verdana","Wingdings","Wingdings 2","Wingdings 3"];n.options.extendedJsFonts&&(o=o.concat(["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","Andalus","Angsana New","AngsanaUPC","Antique Olive","Aparajita","Apple Chancery","Apple Color Emoji","Apple SD Gothic Neo","Arabic Typesetting","ARCHER","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","Blackadder ITC","BlairMdITC TT","Bodoni 72","Bodoni 72 Oldstyle","Bodoni 72 Smallcaps","Bodoni MT","Bodoni MT Black","Bodoni MT Condensed","Bodoni MT Poster Compressed","Bookshelf Symbol 7","Boulder","Bradley Hand","Bradley Hand ITC","Bremen Bd BT","Britannic Bold","Broadway","Browallia New","BrowalliaUPC","Brush Script MT","Californian FB","Calisto MT","Calligrapher","Candara","CaslonOpnface BT","Castellar","Centaur","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","Constantia","Cooper Black","Copperplate","Copperplate Gothic","Copperplate Gothic Bold","Copperplate Gothic Light","CopperplGoth Bd BT","Corbel","Cordia New","CordiaUPC","Cornerstone","Coronet","Cuckoo","Curlz MT","DaunPenh","Dauphin","David","DB LCD Temp","DELICIOUS","Denmark","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","EucrosiaUPC","Euphemia","Euphemia UCAS","EUROSTILE","Exotc350 Bd BT","FangSong","Felix Titling","Fixedsys","FONTIN","Footlight MT Light","Forte","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","Gautami","Geeza Pro","Geometr231 BT","Geometr231 Hv BT","Geometr231 Lt BT","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","Herald","High Tower Text","Hiragino Kaku Gothic ProN","Hiragino Mincho ProN","Hoefler Text","Humanst 521 Cn BT","Humanst521 BT","Humanst521 Lt BT","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","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 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","Mongolian Baiti","MONO","MoolBoran","Mrs Eaves","MS LineDraw","MS Mincho","MS PMincho","MS Reference Specialty","MS UI Gothic","MT Extra","MUSEO","MV Boli","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","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","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","Synchro LET","System","Tamil Sangam MN","Technical","Teletype","Telugu Sangam MN","Tempus Sans ITC","Terminal","Thonburi","Traditional Arabic","Trajan","TRAJAN PRO","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","Vijaya","Viner Hand ITC","VisualUI","Vivaldi","Vladimir Script","Vrinda","Westminster","WHITNEY","Wide Latin","ZapfEllipt BT","ZapfHumnst BT","ZapfHumnst Dm BT","Zapfino","Zurich BlkEx BT","Zurich Ex BT","ZWAdobeF"])),o=o.concat(n.options.userDefinedFonts);var r=document.getElementsByTagName("body")[0],a=document.createElement("div"),s=document.createElement("div"),u={},c={},l=function(){var e=document.createElement("span");return e.style.position="absolute",e.style.left="-9999px",e.style.fontSize="72px",e.style.lineHeight="normal",e.innerHTML="mmmmmmmmmmlli",e},d=function(e,t){var n=l();return n.style.fontFamily="'"+e+"',"+t,n},m=function(e){for(var t=!1,n=0;n<i.length;n++)if(t=e[n].offsetWidth!==u[i[n]]||e[n].offsetHeight!==c[i[n]])return t;return t},h=function(){for(var e=[],t=0,n=i.length;t<n;t++){var o=l();o.style.fontFamily=i[t],a.appendChild(o),e.push(o)}return e}();r.appendChild(a);for(var p=0,f=i.length;p<f;p++)u[i[p]]=h[p].offsetWidth,c[i[p]]=h[p].offsetHeight;var g=function(){for(var e={},t=0,n=o.length;t<n;t++){for(var r=[],a=0,u=i.length;a<u;a++){var c=d(o[t],i[a]);s.appendChild(c),r.push(c)}e[o[t]]=r}return e}();r.appendChild(s);for(var v=[],b=0,y=o.length;b<y;b++)m(g[o[b]])&&v.push(o[b]);r.removeChild(s),r.removeChild(a),e.push({key:"js_fonts",value:v}),t(e)},1)},pluginsKey:function(e){return this.options.excludePlugins||(this.isIE()?this.options.excludeIEPlugins||e.push({key:"ie_plugins",value:this.getIEPlugins()}):e.push({key:"regular_plugins",value:this.getRegularPlugins()})),e},getRegularPlugins:function(){for(var e=[],t=0,n=navigator.plugins.length;t<n;t++)e.push(navigator.plugins[t]);return this.pluginsShouldBeSorted()&&(e=e.sort(function(e,t){return e.name>t.name?1:e.name<t.name?-1:0})),this.map(e,function(e){var t=this.map(e,function(e){return[e.type,e.suffixes].join("~")}).join(",");return[e.name,e.description,t].join("::")},this)},getIEPlugins:function(){var e=[];return(Object.getOwnPropertyDescriptor&&Object.getOwnPropertyDescriptor(window,"ActiveXObject")||"ActiveXObject"in window)&&(e=this.map(["AcroPDF.PDF","Adodb.Stream","AgControl.AgControl","DevalVRXCtrl.DevalVRXCtrl.1","MacromediaFlashPaper.MacromediaFlashPaper","Msxml2.DOMDocument","Msxml2.XMLHTTP","PDF.PdfCtrl","QuickTime.QuickTime","QuickTimeCheckObject.QuickTimeCheck.1","RealPlayer","RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)","RealVideo.RealVideo(tm) ActiveX Control (32-bit)","Scripting.Dictionary","SWCtl.SWCtl","Shell.UIHelper","ShockwaveFlash.ShockwaveFlash","Skype.Detection","TDCCtl.TDCCtl","WMPlayer.OCX","rmocx.RealPlayer G2 Control","rmocx.RealPlayer G2 Control.1"],function(e){try{return new ActiveXObject(e),e}catch(e){return null}})),navigator.plugins&&(e=e.concat(this.getRegularPlugins())),e},pluginsShouldBeSorted:function(){for(var e=!1,t=0,n=this.options.sortPluginsFor.length;t<n;t++){var i=this.options.sortPluginsFor[t];if(navigator.userAgent.match(i)){e=!0;break}}return e},touchSupportKey:function(e){return this.options.excludeTouchSupport||e.push({key:"touch_support",value:this.getTouchSupport()}),e},hardwareConcurrencyKey:function(e){return this.options.excludeHardwareConcurrency||e.push({key:"hardware_concurrency",value:this.getHardwareConcurrency()}),e},hasSessionStorage:function(){try{return!!window.sessionStorage}catch(e){return!0}},hasLocalStorage:function(){try{return!!window.localStorage}catch(e){return!0}},hasIndexedDB:function(){try{return!!window.indexedDB}catch(e){return!0}},getHardwareConcurrency:function(){return navigator.hardwareConcurrency?navigator.hardwareConcurrency:"unknown"},getNavigatorCpuClass:function(){return navigator.cpuClass?navigator.cpuClass:"unknown"},getNavigatorPlatform:function(){return navigator.platform?navigator.platform:"unknown"},getDoNotTrack:function(){return navigator.doNotTrack?navigator.doNotTrack:navigator.msDoNotTrack?navigator.msDoNotTrack:window.doNotTrack?window.doNotTrack:"unknown"},getTouchSupport:function(){var e=0,t=!1;void 0!==navigator.maxTouchPoints?e=navigator.maxTouchPoints:void 0!==navigator.msMaxTouchPoints&&(e=navigator.msMaxTouchPoints);try{document.createEvent("TouchEvent"),t=!0}catch(e){}var n="ontouchstart"in window;return[e,t,n]},getCanvasFp:function(){var e=[],t=document.createElement("canvas");t.width=2e3,t.height=200,t.style.display="inline";var n=t.getContext("2d");return n.rect(0,0,10,10),n.rect(2,2,6,6),e.push("canvas winding:"+(!1===n.isPointInPath(5,5,"evenodd")?"yes":"no")),n.textBaseline="alphabetic",n.fillStyle="#f60",n.fillRect(125,1,62,20),n.fillStyle="#069",this.options.dontUseFakeFontInCanvas?n.font="11pt Arial":n.font="11pt no-real-font-123",n.fillText("Cwm fjordbank glyphs vext quiz, ????",2,15),n.fillStyle="rgba(102, 204, 0, 0.2)",n.font="18pt Arial",n.fillText("Cwm fjordbank glyphs vext quiz, ????",4,45),n.globalCompositeOperation="multiply",n.fillStyle="rgb(255,0,255)",n.beginPath(),n.arc(50,50,50,0,2*Math.PI,!0),n.closePath(),n.fill(),n.fillStyle="rgb(0,255,255)",n.beginPath(),n.arc(100,50,50,0,2*Math.PI,!0),n.closePath(),n.fill(),n.fillStyle="rgb(255,255,0)",n.beginPath(),n.arc(75,100,50,0,2*Math.PI,!0),n.closePath(),n.fill(),n.fillStyle="rgb(255,0,255)",n.arc(75,75,75,0,2*Math.PI,!0),n.arc(75,75,25,0,2*Math.PI,!0),n.fill("evenodd"),e.push("canvas fp:"+t.toDataURL()),e.join("~")},getWebglFp:function(){var e,t=function(t){return e.clearColor(0,0,0,1),e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT),"["+t[0]+", "+t[1]+"]"};if(!(e=this.getWebglCanvas()))return null;var n=[],i=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,i);var o=new Float32Array([-.2,-.9,0,.4,-.26,0,0,.732134444,0]);e.bufferData(e.ARRAY_BUFFER,o,e.STATIC_DRAW),i.itemSize=3,i.numItems=3;var r=e.createProgram(),a=e.createShader(e.VERTEX_SHADER);e.shaderSource(a,"attribute vec2 attrVertex;varying vec2 varyinTexCoordinate;uniform vec2 uniformOffset;void main(){varyinTexCoordinate=attrVertex+uniformOffset;gl_Position=vec4(attrVertex,0,1);}"),e.compileShader(a);var s=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(s,"precision mediump float;varying vec2 varyinTexCoordinate;void main() {gl_FragColor=vec4(varyinTexCoordinate,0,1);}"),e.compileShader(s),e.attachShader(r,a),e.attachShader(r,s),e.linkProgram(r),e.useProgram(r),r.vertexPosAttrib=e.getAttribLocation(r,"attrVertex"),r.offsetUniform=e.getUniformLocation(r,"uniformOffset"),e.enableVertexAttribArray(r.vertexPosArray),e.vertexAttribPointer(r.vertexPosAttrib,i.itemSize,e.FLOAT,!1,0,0),e.uniform2f(r.offsetUniform,1,1),e.drawArrays(e.TRIANGLE_STRIP,0,i.numItems),null!=e.canvas&&n.push(e.canvas.toDataURL()),n.push("extensions:"+e.getSupportedExtensions().join(";")),n.push("webgl aliased line width range:"+t(e.getParameter(e.ALIASED_LINE_WIDTH_RANGE))),n.push("webgl aliased point size range:"+t(e.getParameter(e.ALIASED_POINT_SIZE_RANGE))),n.push("webgl alpha bits:"+e.getParameter(e.ALPHA_BITS)),n.push("webgl antialiasing:"+(e.getContextAttributes().antialias?"yes":"no")),n.push("webgl blue bits:"+e.getParameter(e.BLUE_BITS)),n.push("webgl depth bits:"+e.getParameter(e.DEPTH_BITS)),n.push("webgl green bits:"+e.getParameter(e.GREEN_BITS)),n.push("webgl max anisotropy:"+function(e){var t,n=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic");return n?(0===(t=e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT))&&(t=2),t):null}(e)),n.push("webgl max combined texture image units:"+e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS)),n.push("webgl max cube map texture size:"+e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE)),n.push("webgl max fragment uniform vectors:"+e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS)),n.push("webgl max render buffer size:"+e.getParameter(e.MAX_RENDERBUFFER_SIZE)),n.push("webgl max texture image units:"+e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),n.push("webgl max texture size:"+e.getParameter(e.MAX_TEXTURE_SIZE)),n.push("webgl max varying vectors:"+e.getParameter(e.MAX_VARYING_VECTORS)),n.push("webgl max vertex attribs:"+e.getParameter(e.MAX_VERTEX_ATTRIBS)),n.push("webgl max vertex texture image units:"+e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS)),n.push("webgl max vertex uniform vectors:"+e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS)),n.push("webgl max viewport dims:"+t(e.getParameter(e.MAX_VIEWPORT_DIMS))),n.push("webgl red bits:"+e.getParameter(e.RED_BITS)),n.push("webgl renderer:"+e.getParameter(e.RENDERER)),n.push("webgl shading language version:"+e.getParameter(e.SHADING_LANGUAGE_VERSION)),n.push("webgl stencil bits:"+e.getParameter(e.STENCIL_BITS)),n.push("webgl vendor:"+e.getParameter(e.VENDOR)),n.push("webgl version:"+e.getParameter(e.VERSION));try{var u=e.getExtension("WEBGL_debug_renderer_info");u&&(n.push("webgl unmasked vendor:"+e.getParameter(u.UNMASKED_VENDOR_WEBGL)),n.push("webgl unmasked renderer:"+e.getParameter(u.UNMASKED_RENDERER_WEBGL)))}catch(e){}return e.getShaderPrecisionFormat?(n.push("webgl vertex shader high float precision:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision),n.push("webgl vertex shader high float precision rangeMin:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).rangeMin),n.push("webgl vertex shader high float precision rangeMax:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).rangeMax),n.push("webgl vertex shader medium float precision:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision),n.push("webgl vertex shader medium float precision rangeMin:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).rangeMin),n.push("webgl vertex shader medium float precision rangeMax:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).rangeMax),n.push("webgl vertex shader low float precision:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.LOW_FLOAT).precision),n.push("webgl vertex shader low float precision rangeMin:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.LOW_FLOAT).rangeMin),n.push("webgl vertex shader low float precision rangeMax:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.LOW_FLOAT).rangeMax),n.push("webgl fragment shader high float precision:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision),n.push("webgl fragment shader high float precision rangeMin:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).rangeMin),n.push("webgl fragment shader high float precision rangeMax:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).rangeMax),n.push("webgl fragment shader medium float precision:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision),n.push("webgl fragment shader medium float precision rangeMin:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).rangeMin),n.push("webgl fragment shader medium float precision rangeMax:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).rangeMax),n.push("webgl fragment shader low float precision:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_FLOAT).precision),n.push("webgl fragment shader low float precision rangeMin:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_FLOAT).rangeMin),n.push("webgl fragment shader low float precision rangeMax:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_FLOAT).rangeMax),n.push("webgl vertex shader high int precision:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_INT).precision),n.push("webgl vertex shader high int precision rangeMin:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_INT).rangeMin),n.push("webgl vertex shader high int precision rangeMax:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_INT).rangeMax),n.push("webgl vertex shader medium int precision:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_INT).precision),n.push("webgl vertex shader medium int precision rangeMin:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_INT).rangeMin),n.push("webgl vertex shader medium int precision rangeMax:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_INT).rangeMax),n.push("webgl vertex shader low int precision:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.LOW_INT).precision),n.push("webgl vertex shader low int precision rangeMin:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.LOW_INT).rangeMin),n.push("webgl vertex shader low int precision rangeMax:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.LOW_INT).rangeMax),n.push("webgl fragment shader high int precision:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_INT).precision),n.push("webgl fragment shader high int precision rangeMin:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_INT).rangeMin),n.push("webgl fragment shader high int precision rangeMax:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_INT).rangeMax),n.push("webgl fragment shader medium int precision:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_INT).precision),n.push("webgl fragment shader medium int precision rangeMin:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_INT).rangeMin),n.push("webgl fragment shader medium int precision rangeMax:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_INT).rangeMax),n.push("webgl fragment shader low int precision:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_INT).precision),n.push("webgl fragment shader low int precision rangeMin:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_INT).rangeMin),n.push("webgl fragment shader low int precision rangeMax:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_INT).rangeMax),n.join("~")):n.join("~")},getAdBlock:function(){var e=document.createElement("div");e.innerHTML=" ",e.className="adsbox";var t=!1;try{document.body.appendChild(e),t=0===document.getElementsByClassName("adsbox")[0].offsetHeight,document.body.removeChild(e)}catch(e){t=!1}return t},getHasLiedLanguages:function(){if(void 0!==navigator.languages)try{var e=navigator.languages[0].substr(0,2);if(e!==navigator.language.substr(0,2))return!0}catch(e){return!0}return!1},getHasLiedResolution:function(){return screen.width<screen.availWidth||screen.height<screen.availHeight},getHasLiedOs:function(){var e,t=navigator.userAgent.toLowerCase(),n=navigator.oscpu,i=navigator.platform.toLowerCase();if(e=t.indexOf("windows phone")>=0?"Windows Phone":t.indexOf("win")>=0?"Windows":t.indexOf("android")>=0?"Android":t.indexOf("linux")>=0?"Linux":t.indexOf("iphone")>=0||t.indexOf("ipad")>=0?"iOS":t.indexOf("mac")>=0?"Mac":"Other",("ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0)&&"Windows Phone"!==e&&"Android"!==e&&"iOS"!==e&&"Other"!==e)return!0;if(void 0!==n){if((n=n.toLowerCase()).indexOf("win")>=0&&"Windows"!==e&&"Windows Phone"!==e)return!0;if(n.indexOf("linux")>=0&&"Linux"!==e&&"Android"!==e)return!0;if(n.indexOf("mac")>=0&&"Mac"!==e&&"iOS"!==e)return!0;if(0===n.indexOf("win")&&0===n.indexOf("linux")&&n.indexOf("mac")>=0&&"other"!==e)return!0}return i.indexOf("win")>=0&&"Windows"!==e&&"Windows Phone"!==e||(i.indexOf("linux")>=0||i.indexOf("android")>=0||i.indexOf("pike")>=0)&&"Linux"!==e&&"Android"!==e||(i.indexOf("mac")>=0||i.indexOf("ipad")>=0||i.indexOf("ipod")>=0||i.indexOf("iphone")>=0)&&"Mac"!==e&&"iOS"!==e||0===i.indexOf("win")&&0===i.indexOf("linux")&&i.indexOf("mac")>=0&&"other"!==e||void 0===navigator.plugins&&"Windows"!==e&&"Windows Phone"!==e},getHasLiedBrowser:function(){var e,t=navigator.userAgent.toLowerCase(),n=navigator.productSub;if(("Chrome"==(e=t.indexOf("firefox")>=0?"Firefox":t.indexOf("opera")>=0||t.indexOf("opr")>=0?"Opera":t.indexOf("chrome")>=0?"Chrome":t.indexOf("safari")>=0?"Safari":t.indexOf("trident")>=0?"Internet Explorer":"Other")||"Safari"===e||"Opera"===e)&&"20030107"!==n)return!0;var i,o=eval.toString().length;if(37===o&&"Safari"!==e&&"Firefox"!==e&&"Other"!==e)return!0;if(39===o&&"Internet Explorer"!==e&&"Other"!==e)return!0;if(33===o&&"Chrome"!==e&&"Opera"!==e&&"Other"!==e)return!0;try{throw"a"}catch(e){try{e.toSource(),i=!0}catch(e){i=!1}}return!(!i||"Firefox"===e||"Other"===e)},isCanvasSupported:function(){var e=document.createElement("canvas");return!(!e.getContext||!e.getContext("2d"))},isWebGlSupported:function(){if(!this.isCanvasSupported())return!1;var e,t=document.createElement("canvas");try{e=t.getContext&&(t.getContext("webgl")||t.getContext("experimental-webgl"))}catch(t){e=!1}return!!window.WebGLRenderingContext&&!!e},isIE:function(){return"Microsoft Internet Explorer"===navigator.appName||!("Netscape"!==navigator.appName||!/Trident/.test(navigator.userAgent))},hasSwfObjectLoaded:function(){return void 0!==window.swfobject},hasMinFlashInstalled:function(){return swfobject.hasFlashPlayerVersion("9.0.0")},addFlashDivNode:function(){var e=document.createElement("div");e.setAttribute("id",this.options.swfContainerId),document.body.appendChild(e)},loadSwfAndDetectFonts:function(e){var t="___fp_swf_loaded";window[t]=function(t){e(t)};var n=this.options.swfContainerId;this.addFlashDivNode();var i={onReady:t};swfobject.embedSWF(this.options.swfPath,n,"1","1","9.0.0",!1,i,{allowScriptAccess:"always",menu:"false"},{})},getWebglCanvas:function(){var e=document.createElement("canvas"),t=null;try{t=e.getContext("webgl")||e.getContext("experimental-webgl")}catch(e){}return t||(t=null),t},each:function(e,t,n){if(null!==e)if(this.nativeForEach&&e.forEach===this.nativeForEach)e.forEach(t,n);else if(e.length===+e.length){for(var i=0,o=e.length;i<o;i++)if(t.call(n,e[i],i,e)==={})return}else for(var r in e)if(e.hasOwnProperty(r)&&t.call(n,e[r],r,e)==={})return},map:function(e,t,n){var i=[];return null==e?i:this.nativeMap&&e.map===this.nativeMap?e.map(t,n):(this.each(e,function(e,o,r){i[i.length]=t.call(n,e,o,r)}),i)},x64Add:function(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var n=[0,0,0,0];return n[3]+=e[3]+t[3],n[2]+=n[3]>>>16,n[3]&=65535,n[2]+=e[2]+t[2],n[1]+=n[2]>>>16,n[2]&=65535,n[1]+=e[1]+t[1],n[0]+=n[1]>>>16,n[1]&=65535,n[0]+=e[0]+t[0],n[0]&=65535,[n[0]<<16|n[1],n[2]<<16|n[3]]},x64Multiply:function(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var n=[0,0,0,0];return n[3]+=e[3]*t[3],n[2]+=n[3]>>>16,n[3]&=65535,n[2]+=e[2]*t[3],n[1]+=n[2]>>>16,n[2]&=65535,n[2]+=e[3]*t[2],n[1]+=n[2]>>>16,n[2]&=65535,n[1]+=e[1]*t[3],n[0]+=n[1]>>>16,n[1]&=65535,n[1]+=e[2]*t[2],n[0]+=n[1]>>>16,n[1]&=65535,n[1]+=e[3]*t[1],n[0]+=n[1]>>>16,n[1]&=65535,n[0]+=e[0]*t[3]+e[1]*t[2]+e[2]*t[1]+e[3]*t[0],n[0]&=65535,[n[0]<<16|n[1],n[2]<<16|n[3]]},x64Rotl:function(e,t){return 32==(t%=64)?[e[1],e[0]]:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t|e[0]>>>32-t]:(t-=32,[e[1]<<t|e[0]>>>32-t,e[0]<<t|e[1]>>>32-t])},x64LeftShift:function(e,t){return 0==(t%=64)?e:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t]:[e[1]<<t-32,0]},x64Xor:function(e,t){return[e[0]^t[0],e[1]^t[1]]},x64Fmix:function(e){return e=this.x64Xor(e,[0,e[0]>>>1]),e=this.x64Multiply(e,[4283543511,3981806797]),e=this.x64Xor(e,[0,e[0]>>>1]),e=this.x64Multiply(e,[3301882366,444984403]),e=this.x64Xor(e,[0,e[0]>>>1])},x64hash128:function(e,t){e=e||"",t=t||0;for(var n=e.length%16,i=e.length-n,o=[0,t],r=[0,t],a=[0,0],s=[0,0],u=[2277735313,289559509],c=[1291169091,658871167],l=0;l<i;l+=16)a=[255&e.charCodeAt(l+4)|(255&e.charCodeAt(l+5))<<8|(255&e.charCodeAt(l+6))<<16|(255&e.charCodeAt(l+7))<<24,255&e.charCodeAt(l)|(255&e.charCodeAt(l+1))<<8|(255&e.charCodeAt(l+2))<<16|(255&e.charCodeAt(l+3))<<24],s=[255&e.charCodeAt(l+12)|(255&e.charCodeAt(l+13))<<8|(255&e.charCodeAt(l+14))<<16|(255&e.charCodeAt(l+15))<<24,255&e.charCodeAt(l+8)|(255&e.charCodeAt(l+9))<<8|(255&e.charCodeAt(l+10))<<16|(255&e.charCodeAt(l+11))<<24],a=this.x64Multiply(a,u),a=this.x64Rotl(a,31),a=this.x64Multiply(a,c),o=this.x64Xor(o,a),o=this.x64Rotl(o,27),o=this.x64Add(o,r),o=this.x64Add(this.x64Multiply(o,[0,5]),[0,1390208809]),s=this.x64Multiply(s,c),s=this.x64Rotl(s,33),s=this.x64Multiply(s,u),r=this.x64Xor(r,s),r=this.x64Rotl(r,31),r=this.x64Add(r,o),r=this.x64Add(this.x64Multiply(r,[0,5]),[0,944331445]);switch(a=[0,0],s=[0,0],n){case 15:s=this.x64Xor(s,this.x64LeftShift([0,e.charCodeAt(l+14)],48));case 14:s=this.x64Xor(s,this.x64LeftShift([0,e.charCodeAt(l+13)],40));case 13:s=this.x64Xor(s,this.x64LeftShift([0,e.charCodeAt(l+12)],32));case 12:s=this.x64Xor(s,this.x64LeftShift([0,e.charCodeAt(l+11)],24));case 11:s=this.x64Xor(s,this.x64LeftShift([0,e.charCodeAt(l+10)],16));case 10:s=this.x64Xor(s,this.x64LeftShift([0,e.charCodeAt(l+9)],8));case 9:s=this.x64Xor(s,[0,e.charCodeAt(l+8)]),s=this.x64Multiply(s,c),s=this.x64Rotl(s,33),s=this.x64Multiply(s,u),r=this.x64Xor(r,s);case 8:a=this.x64Xor(a,this.x64LeftShift([0,e.charCodeAt(l+7)],56));case 7:a=this.x64Xor(a,this.x64LeftShift([0,e.charCodeAt(l+6)],48));case 6:a=this.x64Xor(a,this.x64LeftShift([0,e.charCodeAt(l+5)],40));case 5:a=this.x64Xor(a,this.x64LeftShift([0,e.charCodeAt(l+4)],32));case 4:a=this.x64Xor(a,this.x64LeftShift([0,e.charCodeAt(l+3)],24));case 3:a=this.x64Xor(a,this.x64LeftShift([0,e.charCodeAt(l+2)],16));case 2:a=this.x64Xor(a,this.x64LeftShift([0,e.charCodeAt(l+1)],8));case 1:a=this.x64Xor(a,[0,e.charCodeAt(l)]),a=this.x64Multiply(a,u),a=this.x64Rotl(a,31),a=this.x64Multiply(a,c),o=this.x64Xor(o,a)}return o=this.x64Xor(o,[0,e.length]),r=this.x64Xor(r,[0,e.length]),o=this.x64Add(o,r),r=this.x64Add(r,o),o=this.x64Fmix(o),r=this.x64Fmix(r),o=this.x64Add(o,r),r=this.x64Add(r,o),("00000000"+(o[0]>>>0).toString(16)).slice(-8)+("00000000"+(o[1]>>>0).toString(16)).slice(-8)+("00000000"+(r[0]>>>0).toString(16)).slice(-8)+("00000000"+(r[1]>>>0).toString(16)).slice(-8)}},e.VERSION="1.5.1",e})?i.call(t,n,t,e):i)||(e.exports=o)},function(e,t,n){"use strict";function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(3)),s=o(n(4)),u=o(n(17)),c=r(n(18)),l=r(n(19)),d=r(n(20)),m=r(n(21)),h=r(n(23)),p=r(n(24)),f=r(n(26)),g=r(n(27)),v=r(n(28)),b=r(n(29)),y=n(30),x=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.common=new y.XmUiCommon}return function(e,t,n){t&&i(e.prototype,t),n&&i(e,n)}(e,[{key:"startActivityIndicator",value:function(e,t){this.common.showProgressForm(t)}},{key:"endActivityIndicator",value:function(e,t){this.common.hideProgressForm(t)}},{key:"controlFlowCancelled",value:function(e){this.common.log("Control flow cancelled"),this.common.clearContainer(e)}},{key:"controlFlowStarting",value:function(e){this.common.log("Control flow started")}},{key:"controlFlowEnded",value:function(e,t){var n=e?" with error: ".concat(e):"";this.common.log("Control flow ended"+n)}},{key:"controlFlowActionStarting",value:function(e,t){this.common.log("Control flow action starting")}},{key:"controlFlowActionEnded",value:function(e,t,n){this.common.log("Control flow action starting")}},{key:"handleAuthenticatorUnregistration",value:function(e,t,n,i){return Promise.resolve(com.ts.mobile.sdk.UnregistrationInput.create(0))}},{key:"selectAuthenticator",value:function(e,t,n){return this.common.methodMenuPromise(e,n)}},{key:"selectAuthenticatorFallbackAction",value:function(e,t,n,i,o){return this.common.methodFallbackPromise(e,t,o)}},{key:"controlOptionForCancellationRequestInSession",value:function(e,t){return this.common.promiseCancelAction(e,t.clientContext)}},{key:"createPasswordAuthSession",value:function(e,t){return new l.PasswordAuthenticatorSession(e,t,this.common)}},{key:"createPinAuthSession",value:function(e,t,n){return new d.PinAuthenticatorSession(e,t,n,this.common)}},{key:"createPatternAuthSession",value:function(e,t,n,i){return new m.PatternAuthenticatorSession(e,t,n,i,this.common)}},{key:"createOtpAuthSession",value:function(e,t,n,i){return new h.OtpAuthenticatorSession(e,t,n,i,this.common)}},{key:"createVoiceAuthSession",value:function(e,t){return new p.VoiceAuthenticatorSession(e,t,this.common)}},{key:"createSecurityQuestionAuthSession",value:function(e,t){return new f.SecurityQuestionAuthenticatorSession(e,t,this.common)}},{key:"createPlaceholderAuthSession",value:function(e,t,n,i,o,r){throw new Error("Method not implemented by demo application.")}},{key:"getConfirmationInput",value:function(e,t,n,i,o,r){return a.default(e,t,n,i,o,r,this.common)}},{key:"getInformationResponse",value:function(e,t,n,i,o){return s.default(e,t,n,i,o,this.common)}},{key:"createMobileApproveAuthSession",value:function(e,t,n){return new g.MobileApproveAuthenticatorSession(e,t,n,this.common)}},{key:"createTicketWaitSession",value:function(e,t){return new b.TicketWaitSession(this.common)}},{key:"createTotpAuthSession",value:function(e,t){return new v.TotpAuthenticatorSession(e,t,this.common)}},{key:"createFormSession",value:function(e,t){throw new Error("Method not implemented by demo application.")}},{key:"createAuthenticationConfigurationSession",value:function(e){return this.common.configurationSession(e)}},{key:"createRegistrationPromotionSession",value:function(e,t){return new c.RegistrationPromotionSession(e,t,this.common)}},{key:"processJsonData",value:function(e,t,n){throw new Error("Method not implemented by demo application.")}},{key:"handlePolicyRejection",value:function(e,t,n,i,o,r){return e||t||n?u.default(e,t,n,r,this.common):Promise.resolve(com.ts.mobile.sdk.ConfirmationInput.create(-1))}},{key:"handlePolicyRedirect",value:function(e,t,n,i,o){return this.common.log("Policy redirection requested. redirecting to policy: [".concat(t,"] with additionalParameters: [").concat(i,"]")),Promise.resolve(com.ts.mobile.sdk.RedirectInput.create(com.ts.mobile.sdk.RedirectResponseType.RedirectToPolicy))}},{key:"shouldIncludeDisabledAuthenticatorsInMenu",value:function(e,t){return!0}},{key:"createScanQrSession",value:function(e,t){throw new Error("Method not implemented.")}},{key:"createFingerprintAuthSession",value:function(e,t){throw new Error("Method not implemented.")}},{key:"createApprovalsSession",value:function(e){throw new Error("Method not implemented.")}},{key:"createTotpGenerationSession",value:function(e,t){throw new Error("Method not implemented.")}},{key:"createDeviceManagementSession",value:function(e){return this.common.log("Starting device management session"),this.common.deviceManagementSession(e)}},{key:"createNativeFaceAuthSession",value:function(e,t){throw new Error("Method not implemented.")}},{key:"createFaceAuthSession",value:function(e,t){throw new Error("Method not implemented.")}},{key:"localAuthenticatorInvalidated",value:function(e){throw new Error("Method not implemented.")}},{key:"setLogEnabled",value:function(e){this.common.setLogEnabled(e)}}],[{key:"getContainer",value:function(e){return y.XmUiCommon.getContainer(e)}}]),e}();t.XmUIHandler=x},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,i,o,r,a){var s=$('<div class="xmuiCore xmuiForm xmuiConfirmationForm"> <div class="xmuiPageHeader"> <div> <span class="xmuiConfirmationTitle"></span> </div> </div> <div class="xmuiFullHeightContentBelowPrompt"> <div class="xmuiConfirmationText"/><br/> <div> <button class="xmuiConfirmationContinueButton" type="button"/> <button class="xmuiConfirmationCancelButton" type="button"/> </div> </div> </div>');return a.appendElement(s,r),a.setAriaBusy(r),new Promise(function(o,u){s.find(".xmuiConfirmationTitle").text(e),s.find(".xmuiConfirmationText").html(t);var c=s.find(".xmuiConfirmationContinueButton");c.text(n),c.click(function(){s.fadeOut(function(){a.clearContainer(r),o(com.ts.mobile.sdk.ConfirmationInput.create(0))})});var l=s.find(".xmuiConfirmationCancelButton");l.text(i),l.click(function(){s.fadeOut(function(){a.clearContainer(r),o(com.ts.mobile.sdk.ConfirmationInput.create(1))})}),a.unsetAriaBusy(r)})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,i,o,r){var a=$('<div class="xmuiCore xmuiForm xmuiInformationForm"> <div class="xmuiPageHeader"> <div> <span class="xmuiInformationTitle"</span> </div> </div> <div class="xmuiFullHeightContentBelowPrompt"> <div class="xmuiInformationText"/><br/> <div> <button class="xmuiInformationButton" type="button"/> </div> </div> </div>');return r.appendElement(a,o),r.setAriaBusy(o),new Promise(function(i,s){a.find(".xmuiInformationTitle").text(e),a.find(".xmuiInformationText").html(t);var u=a.find(".xmuiInformationButton");u.text(n),u.click(function(){a.fadeOut(function(){r.clearContainer(o),i(com.ts.mobile.sdk.ConfirmationInput.create(-1))})}),r.unsetAriaBusy(o)})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(6);t.XmSdk=i.XmSdk;var o=n(2);t.XmUIHandler=o.XmUIHandler},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(7),o=n(8),r=n(2),a=com.ts.mobile.sdk.createSdk(),s=new o.XmHost;a.setTarsusHost(s);var u=new r.XmUIHandler;a.setUiHandler(u),a.setTransportProvider(new i.XmTransportProvider(s)),a.setEnabledCollectors([com.ts.mobile.sdk.CollectorType.DeviceDetails,com.ts.mobile.sdk.CollectorType.LargeData]),a.setLogLevel(com.ts.mobile.sdk.LogLevel.Error),t.XmSdk=function(){return a}},function(e,t,n){"use strict";function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._host=t}return function(e,t,n){t&&i(e.prototype,t),n&&i(e,n)}(e,[{key:"extractHeaders",value:function(e){return e.trim().split(/[\r\n]+/).map(function(e){var t=e.split(": "),n=t.shift(),i=t.join(": "),o=new com.ts.mobile.sdk.TransportHeader;return o.setName(n),o.setValue(i),o})}},{key:"sendRequest",value:function(e){var t=this;return new Promise(function(n,i){var o=new XMLHttpRequest,r=function(){i(new com.ts.mobile.sdk.impl.AuthenticationErrorImpl(com.ts.mobile.sdk.AuthenticationErrorCode.Communication,o.responseText))};o.open(e.getMethod(),e.getUrl(),!0),o.withCredentials=!0,o.onreadystatechange=function(){if(4===o.readyState)try{if(0===o.status)return t._host.log(com.ts.mobile.sdk.LogLevel.Error,"transport","Destination server is invalid or the server does not support access-control-allow-origin."),i(new com.ts.mobile.sdk.impl.AuthenticationErrorImpl(com.ts.mobile.sdk.AuthenticationErrorCode.Communication,o.responseText));JSON.parse(o.responseText);var a=new com.ts.mobile.sdk.TransportResponse;a.setStatus(o.status),a.setMethod(e.getMethod()),a.setHeaders(t.extractHeaders(o.getAllResponseHeaders())),a.setBodyJson(o.responseText),n(a)}catch(e){r()}},o.onerror=function(){r()},e.getHeaders().forEach(function(e){o.setRequestHeader(e.getName(),e.getValue())}),o.setRequestHeader("Content-Type","application/json"),o.send(e.getBodyJson())})}}]),e}();t.XmTransportProvider=o},function(e,t,n){"use strict";function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(9)),s=o(n(10)),u=r(n(11)),c=r(n(13)),l=n(16),d=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.logLevel=com.ts.mobile.sdk.LogLevel.Error,this.collectionResultsPromise=null,this.internalLogger=new a.default,this.externalLogger=null,window.__XMSDK_PLUGINS={}}return function(e,t,n){t&&i(e.prototype,t),n&&i(e,n)}(e,[{key:"initialize",value:function(e){var t=this;return new Promise(function(n,i){t.enabledCollectors=e,n(!0)})}},{key:"setLogLevel",value:function(e){this.logLevel=e}},{key:"log",value:function(e,t,n){e<=this.logLevel&&this.internalLogger.log(e,t,n),this.externalLogger&&this.externalLogger.log(e,t,n)}},{key:"readStorageKey",value:function(e){return JSON.parse(s.default.localStorage.getItem(e)||"{}")}},{key:"writeStorageKey",value:function(e,t){s.default.localStorage.setItem(e,JSON.stringify(t))}},{key:"deleteStorageKey",value:function(e){s.default.localStorage.removeItem(e)}},{key:"readSessionStorageKey",value:function(e){return JSON.parse(s.default.sessionStorage.getItem(e)||"{}")}},{key:"writeSessionStorageKey",value:function(e,t){s.default.sessionStorage.setItem(e,JSON.stringify(t))}},{key:"deleteSessionStorageKey",value:function(e){s.default.sessionStorage.removeItem(e)}},{key:"promiseCollectionResult",value:function(){var e=this;return new Promise(function(t,n){var i={location:{allow:e.enabledCollectors.indexOf(com.ts.mobile.sdk.CollectorType.Location)>=0,timeout:4e3,maximumAge:18e4},largeData:e.enabledCollectors.indexOf(com.ts.mobile.sdk.CollectorType.LargeData)>=0},o=new Promise(function(e,t){c.TsCollectionResult(i).get(function(t){e(t)})}),r=new Promise(function(e,t){u.default.promiseCollection(i.largeData).then(function(t){e(t)})});e.collectionResultsPromise=Promise.all([o,r]).then(function(e){var t=Object.assign(e[0],e[1]);return t.toJson=function(){return t},t}),t(e.collectionResultsPromise)})}},{key:"calcHexStringEncodedMd5Hash",value:function(e){var t=com.ts.mobile.sdk.util.hexToAscii(e);return l.md5(t)}},{key:"generateRandomHexString",value:function(e){var t=new Uint8Array(e);(window.crypto||window.msCrypto).getRandomValues(t);for(var n="",i=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"],o=0;o<t.length;o++){n+=i[15&t[o]]}return n}},{key:"queryHostInfo",value:function(e){switch(e){case com.ts.mobile.sdkhost.HostInformationKey.Version:return"4.1.0";case com.ts.mobile.sdkhost.HostInformationKey.Platform:return"web";case com.ts.mobile.sdkhost.HostInformationKey.FingerprintSupported:return"false";case com.ts.mobile.sdkhost.HostInformationKey.HostProvidedFeatures:return"";case com.ts.mobile.sdkhost.HostInformationKey.FaceIdKeyBioProtectionSupported:case com.ts.mobile.sdkhost.HostInformationKey.ImageAcquitisionSupported:return"false";case com.ts.mobile.sdkhost.HostInformationKey.AudioAcquitisionSupported:return"true";case com.ts.mobile.sdkhost.HostInformationKey.PersistentKeysSupported:case com.ts.mobile.sdkhost.HostInformationKey.FidoClientPresent:case com.ts.mobile.sdkhost.HostInformationKey.DyadicPresent:return"false";case com.ts.mobile.sdkhost.HostInformationKey.Fido2ClientPresent:return navigator.credentials&&window.PublicKeyCredential?"true":"false";default:throw new Error("Info key is unsupported: ".concat(e))}}},{key:"setExternalLogger",value:function(e){this.externalLogger=e}},{key:"getCurrentTime",value:function(){return Date.now()}},{key:"createDelayedPromise",value:function(e){return new Promise(function(t){setTimeout(t(e),e)})}},{key:"transformApiPath",value:function(e){var t=e.split("/");return t[0]="mobile"!==t[0]||"device"!==t[1]&&"devices"!==t[1]?t[0]:"web",t[0]="auth"===t[0]?"web":t[0],t[1]="login"===t[1]?"authenticate":t[1],t.join("/")}},{key:"calcHexStringEncodedHmacSha1HashWithHexEncodedKey",value:function(e,t){return this.log(com.ts.mobile.sdk.LogLevel.Error,"not-implemented","calcHexStringEncodedHmacSha1HashWithHexEncodedKey not implemented for tarsus-web"),null}},{key:"generatePbkdf2HmacSha1HexString",value:function(e,t,n,i){return Promise.reject("generatePbkdf2HmacSha1HexString not implemented for tarsus-web")}},{key:"fidoClientXact",value:function(e,t,n,i){return Promise.reject("fidoClientXact not implemented for tarsus-web")}},{key:"fido2CredentialsOp",value:function(e,t,n,i,o){var r=navigator;return i===com.ts.mobile.sdkhost.Fido2CredentialsOpType.Create?r.credentials.create(o):r.credentials.get(o)}},{key:"generateKeyPair",value:function(e,t,n,i){return Promise.reject("generateKeyPair not implemented for tarsus-web")}},{key:"getKeyPair",value:function(e,t,n){return this.log(com.ts.mobile.sdk.LogLevel.Error,"not-implemented","getKeyPair not implemented for tarsus-web"),null}},{key:"deleteKeyPair",value:function(e){this.log(com.ts.mobile.sdk.LogLevel.Error,"not-implemented","deleteKeyPair not implemented for tarsus-web")}},{key:"importSymmetricKey",value:function(e,t,n,i){return this.log(com.ts.mobile.sdk.LogLevel.Error,"not-implemented","importSymmetricKey not implemented for tarsus-web"),null}},{key:"calcHexStringEncodedSha256Hash",value:function(e){var t=com.ts.mobile.sdk.util.hexToAscii(e);return sha256(com.ts.mobile.sdk.util.toUTF8Array(t))}},{key:"calcHexStringEncodedSha512Hash",value:function(e){throw this.log(com.ts.mobile.sdk.LogLevel.Error,"not-implemented","calcHexStringEncodedSha512Hash not implemented for tarsus-web"),new Error("Method not implemented.")}},{key:"generateHexSeededKeyPairExternalRepresentation",value:function(e,t){return Promise.reject("Method not implemented.")}},{key:"generateKeyPairExternalRepresentation",value:function(e){return Promise.reject("Method not implemented.")}},{key:"importVolatileKeyPair",value:function(e,t){throw new Error("Method not implemented.")}},{key:"importVolatileSymmetricKey",value:function(e,t){throw new Error("Method not implemented.")}},{key:"loadPlugin",value:function(e){var t=window.__XMSDK_PLUGINS[e];return t?(this.log(com.ts.mobile.sdk.LogLevel.Debug,"plugins","Found defined plugin "+e),Promise.resolve(t)):(this.log(com.ts.mobile.sdk.LogLevel.Error,"plugins","Could not find defined plugin "+e),Promise.reject(new com.ts.mobile.sdk.impl.AuthenticationErrorImpl(com.ts.mobile.sdk.AuthenticationErrorCode.AppImplementation,"Could not find defined plugin "+e)))}},{key:"dyadicRefreshToken",value:function(e){throw new Error("Method not implemented.")}},{key:"dyadicEnroll",value:function(e,t){return Promise.reject("Method not implemented.")}},{key:"dyadicSign",value:function(e){return Promise.reject("Method not implemented.")}},{key:"dyadicDelete",value:function(){return Promise.reject("Method not implemented.")}},{key:"importVolatileKeyPairFromPublicKeyHex",value:function(e,t){throw new Error("Method not implemented.")}}]),e}();t.XmHost=d},function(e,t,n){"use strict";function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return function(e,t,n){t&&i(e.prototype,t),n&&i(e,n)}(e,[{key:"formatAsTwoDigits",value:function(e){return e.toLocaleString("EN",{minimumIntegerDigits:2,useGrouping:!1})}},{key:"logDateFormat",value:function(e){var t=e.getFullYear(),n=this.formatAsTwoDigits(e.getMonth()+1),i=this.formatAsTwoDigits(e.getDate()),o=this.formatAsTwoDigits(e.getHours()),r=this.formatAsTwoDigits(e.getMinutes()),a=this.formatAsTwoDigits(e.getSeconds()),s=e.getMilliseconds().toLocaleString("EN",{minimumIntegerDigits:3,useGrouping:!1});return"".concat(t,"-").concat(n,"-").concat(i," ").concat(o,":").concat(r,":").concat(a,".").concat(s)}},{key:"log",value:function(e,t,n){var i=com.ts.mobile.sdk.LogLevel[e].toUpperCase();console.log("".concat(this.logDateFormat(new Date),"\t").concat(i,"\t").concat(t,":\t").concat(n))}}]),e}();t.default=o},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function r(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}function a(e,t,n){var i;if("undefined"!=typeof document){if(arguments.length>1){if("number"==typeof(n=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var i=0,o={};i<arguments.length;i++){var r=arguments[i];for(var a in r)o[a]=r[a]}return o}({path:"/"},{},n)).expires){var o=new Date;o.setMilliseconds(o.getMilliseconds()+864e5*n.expires),n.expires=o}n.expires=n.expires?n.expires.toUTCString():"";try{i=JSON.stringify(t),/^[\{\[]/.test(i)&&(t=i)}catch(e){}t=encodeURIComponent(String(t)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=(e=(e=encodeURIComponent(String(e))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape);var r="";for(var a in n)n[a]&&(r+="; "+a,!0!==n[a]&&(r+="="+n[a]));return document.cookie=e+"="+t+r}e||(i={});for(var s=document.cookie?document.cookie.split("; "):[],u=/(%[0-9A-Z]{2})+/g,c=0;c<s.length;c++){var l=s[c].split("="),d=l.slice(1).join("=");'"'===d.charAt(0)&&(d=d.slice(1,-1));try{var m=l[0].replace(u,decodeURIComponent);if(d=d.replace(u,decodeURIComponent),e===m){i=d;break}e||(i[m]=d)}catch(e){}}return i}}Object.defineProperty(t,"__esModule",{value:!0});var s={set:a,get:function(e){return a.call(a,e)},remove:function(e){a(e,"",{expires:-1})}},u=function(){function e(t){i(this,e),this._persistent=t}return r(e,[{key:"setItem",value:function(e,t){var n=btoa(t);this._persistent?s.set(e,n,{expires:365}):s.set(e,n)}},{key:"removeItem",value:function(e){s.remove(e)}},{key:"getItem",value:function(e){var t=s.get(e);return t&&(t=atob(t)),t}}]),e}(),c=function(){function e(){i(this,e),this._memStore={}}return r(e,[{key:"setItem",value:function(e,t){this._memStore[e]=t}},{key:"removeItem",value:function(e){delete this._memStore[e]}},{key:"getItem",value:function(e){return this._memStore[e]}}]),e}(),l=function(){function e(t){if(i(this,e),"undefined"!=typeof window)try{this.currentStorage=window[t],this.currentStorage.setItem("ts:test","ok"),this.currentStorage.removeItem("ts:test")}catch(e){console.warn("Failed to use browser storage. Resorting to cookies."),this.currentStorage=new u("localStorage"==t)}else this.currentStorage=new c}return r(e,[{key:"setItem",value:function(e,t){this.currentStorage.setItem(e,t)}},{key:"getItem",value:function(e){return this.currentStorage.getItem(e)}},{key:"removeItem",value:function(e){this.currentStorage.removeItem(e)}}]),e}();l.localStorage=new l("localStorage"),l.sessionStorage=new l("sessionStorage"),t.default=l},function(e,t,n){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(12)),r=i(n(1)),a="ts.fp.binding_id",s={},u=[l("binding_id",function(){return window.localStorage?window.localStorage.getItem(a):null}),l("collector_version",function(){return"1.0.0"}),l("local_ip",o.default()),l("cpu_cores",function(){return navigator.hardwareConcurrency})],c=null;function l(e,t){if(!(t instanceof Promise)){var n=t;t=new Promise(function(e,t){try{e(n())}catch(e){t(e)}})}return t.then(function(t){var n={};return null!=t&&(n[e]=t),n},function(t){var n={};return n[e]={__err__:t},n})}t.default={promiseCollection:function(e){var t=Object.keys(s).map(function(e){return l(e,s[e])}),n=u.concat(function(e){return c||(c=new Promise(function(t,n){var i={};e||(i.excludeCanvas=!0,i.excludeWebGL=!0),new r.default(i).get(function(e,n){for(var i={},o=0;o<n.length;o++)i[n[o].key]=n[o].value;t({fp2_hash:e,fp2_keys:i})})})),c}(e)).concat(t);return Promise.all(n).then(function(e){return function(e){var t={};return Object.assign.apply(null,[t].concat(e)),t}(e)})},evaluateDfpServerInstructions:function(e){if(e.setBindingId)try{window.localStorage.setItem(a,e.setBindingId)}catch(e){}},setUserCollectors:function(e){s=e}}},function(e,t,n){"use strict";function i(e){var t=setTimeout(function(){e(null)},300),n={},i=window,o=i.RTCPeerConnection||i.mozRTCPeerConnection||i.webkitRTCPeerConnection,r=(i.webkitRTCPeerConnection,new o({iceServers:[{urls:"stun:dummysrv.dummyserver.com.nowhere"}]},{optional:[{RtpDataChannels:!0}]}));r.onicecandidate=function(i){i.candidate&&function(i){var o=/([0-9]{1,3}(\.[0-9]{1,3}){3}|[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7})/.exec(i)[1];void 0===n[o]&&(clearTimeout(t),e(o)),n[o]=!0}(i.candidate.candidate)},r.createDataChannel(""),r.createOffer({}).then(function(e){r.setLocalDescription(e,function(){},function(){})},function(){})}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return new Promise(function(e,t){i(function(n){n?e&&(e(n),e=null):t("Timeout")})})}},function(e,t,n){"use strict";var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(1)),r=i(n(14)),a=void 0;t.TsCollectionResult=function(e){var t={allow:!1,timeout:4e3,maximumAge:18e4},n=!0,i=void 0,s=function(){i=void 0},u=function(e,t){var n={};for(var i in e=e||{},t=t||{},e)n[i]=e[i];for(var i in t)n[i]=t[i];return n},c=function(e,t,i){if(a)p(e,i);else{var o={excludeUserAgent:!0,excludeScreenResolution:!0,excludeJsFonts:!0,excludeFlashFonts:!0,excludePlugins:!0,excludeColorDepth:!0};n||(o.excludeCanvas=!0,o.excludeWebGL=!0),new t.default(o).get(function(t,n){for(var o={},r=0,s=(n=n||[]).length;r<s;r++){var u=n[r];o[u.key]=u.value}a={id:t,details:o},p(e,i)})}},l=function(t,n){i=void 0;var o=e.location;if(!o.allow)return h(!1),void p(t,n);if(d(navigator.geolocation)||"function"!=typeof navigator.geolocation.getCurrentPosition)return h(!1),void p(t,n);var r=setTimeout(function(){a({code:3})},o.timeout),a=function(e){clearTimeout(r),h(!0,void 0,void 0,m(e.code)),p(t,n)};navigator.geolocation.getCurrentPosition(function(e){clearTimeout(r),h(!0,e.coords.latitude,e.coords.longitude),p(t,n)},a,o)},d=function(e){return void 0===e||null===e},m=function(e){return 1===e?"permission_denied":2===e?"position_unavailable":3===e?"timeout":"unknown"};function h(e,t,n,o){i={enabled:e||!1,lat:t,lng:n,error:o}}var p=function(e,t){if(!d(a)&&!d(i)){var n={metadata:{timestamp:Date.now()},content:{device_details:f(a,t),location:i}};s(),e(n)}},f=function(e,t){var n={device_id:e.id},i=e.details,o=(new t.UAParser).setUA(navigator.userAgent).getResult();return n.os_type=o.os.name,n.os_version=o.os.version,n.device_model=o.browser.name+" "+o.browser.version,n.device_platform=i.navigator_platform,n.tampered=g(i),n.timezone_offset=i.timezone_offset,n},g=function(e){return e&&(e.has_lied_browser||e.has_lied_language||e.has_lied_os||e.has_lied_resolution)};return(e=e||{}).location=u(t,e.location),s(),{get:function(e){c(e,o,r),l(e,r)}}}},function(e,t,n){var i; /*! * UAParser.js v0.7.18 * Lightweight JavaScript-based User-Agent string parser * https://github.com/faisalman/ua-parser-js * * Copyright ?? 2012-2016 Faisal Salman <fyzlman@gmail.com> * Dual licensed under GPLv2 or MIT */ /*! * UAParser.js v0.7.18 * Lightweight JavaScript-based User-Agent string parser * https://github.com/faisalman/ua-parser-js * * Copyright ?? 2012-2016 Faisal Salman <fyzlman@gmail.com> * Dual licensed under GPLv2 or MIT */ !function(o,r){"use strict";var a="model",s="name",u="type",c="vendor",l="version",d="mobile",m="tablet",h={extend:function(e,t){var n={};for(var i in e)t[i]&&t[i].length%2==0?n[i]=t[i].concat(e[i]):n[i]=e[i];return n},has:function(e,t){return"string"==typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.replace(/[^\d\.]/g,"").split(".")[0]:void 0},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},p={rgx:function(e,t){for(var n,i,o,r,a,s,u=0;u<t.length&&!a;){var c=t[u],l=t[u+1];for(n=i=0;n<c.length&&!a;)if(a=c[n++].exec(e))for(o=0;o<l.length;o++)s=a[++i],"object"==typeof(r=l[o])&&r.length>0?2==r.length?"function"==typeof r[1]?this[r[0]]=r[1].call(this,s):this[r[0]]=r[1]:3==r.length?"function"!=typeof r[1]||r[1].exec&&r[1].test?this[r[0]]=s?s.replace(r[1],r[2]):void 0:this[r[0]]=s?r[1].call(this,s,r[2]):void 0:4==r.length&&(this[r[0]]=s?r[3].call(this,s.replace(r[1],r[2])):void 0):this[r]=s||void 0;u+=2}},str:function(e,t){for(var n in t)if("object"==typeof t[n]&&t[n].length>0){for(var i=0;i<t[n].length;i++)if(h.has(t[n][i],e))return"?"===n?void 0:n}else if(h.has(t[n],e))return"?"===n?void 0:n;return e}},f={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"}}}},g={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[s,l],[/(opios)[\/\s]+([\w\.]+)/i],[[s,"Opera Mini"],l],[/\s(opr)\/([\w\.]+)/i],[[s,"Opera"],l],[/(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|iridium|phantomjs|bowser|quark)\/([\w\.-]+)/i],[s,l],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[s,"IE"],l],[/(edge|edgios|edgea)\/((\d+)?[\w\.]+)/i],[[s,"Edge"],l],[/(yabrowser)\/([\w\.]+)/i],[[s,"Yandex"],l],[/(puffin)\/([\w\.]+)/i],[[s,"Puffin"],l],[/((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[[s,"UCBrowser"],l],[/(comodo_dragon)\/([\w\.]+)/i],[[s,/_/g," "],l],[/(micromessenger)\/([\w\.]+)/i],[[s,"WeChat"],l],[/(qqbrowserlite)\/([\w\.]+)/i],[s,l],[/(QQ)\/([\d\.]+)/i],[s,l],[/m?(qqbrowser)[\/\s]?([\w\.]+)/i],[s,l],[/(BIDUBrowser)[\/\s]?([\w\.]+)/i],[s,l],[/(2345Explorer)[\/\s]?([\w\.]+)/i],[s,l],[/(MetaSr)[\/\s]?([\w\.]+)/i],[s],[/(LBBROWSER)/i],[s],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[l,[s,"MIUI Browser"]],[/;fbav\/([\w\.]+);/i],[l,[s,"Facebook"]],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[l,[s,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[s,/(.+)/,"$1 WebView"],l],[/((?:oculus|samsung)browser)\/([\w\.]+)/i],[[s,/(.+(?:g|us))(.+)/,"$1 $2"],l],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i],[l,[s,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[s,l],[/(dolfin)\/([\w\.]+)/i],[[s,"Dolphin"],l],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[s,"Chrome"],l],[/(coast)\/([\w\.]+)/i],[[s,"Opera Coast"],l],[/fxios\/([\w\.-]+)/i],[l,[s,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[l,[s,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[l,s],[/webkit.+?(gsa)\/([\w\.]+).+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[[s,"GSA"],l],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[s,[l,p.str,f.browser.oldsafari.version]],[/(konqueror)\/([\w\.]+)/i,/(webkit|khtml)\/([\w\.]+)/i],[s,l],[/(navigator|netscape)\/([\w\.-]+)/i],[[s,"Netscape"],l],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[s,l]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[["architecture","amd64"]],[/(ia32(?=;))/i],[["architecture",h.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[["architecture","ia32"]],[/windows\s(ce|mobile);\sppc;/i],[["architecture","arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[["architecture",/ower/,"",h.lowerize]],[/(sun4\w)[;\)]/i],[["architecture","sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+;))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[["architecture",h.lowerize]]],device:[[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],[a,c,[u,m]],[/applecoremedia\/[\w\.]+ \((ipad)/],[a,[c,"Apple"],[u,m]],[/(apple\s{0,1}tv)/i],[[a,"Apple TV"],[c,"Apple"]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(hp).+(tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],[c,a,[u,m]],[/(kf[A-z]+)\sbuild\/.+silk\//i],[a,[c,"Amazon"],[u,m]],[/(sd|kf)[0349hijorstuw]+\sbuild\/.+silk\//i],[[a,p.str,f.device.amazon.model],[c,"Amazon"],[u,d]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[a,c,[u,d]],[/\((ip[honed|\s\w*]+);/i],[a,[c,"Apple"],[u,d]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[c,a,[u,d]],[/\(bb10;\s(\w+)/i],[a,[c,"BlackBerry"],[u,d]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone)/i],[a,[c,"Asus"],[u,m]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[c,"Sony"],[a,"Xperia Tablet"],[u,m]],[/android.+\s([c-g]\d{4}|so[-l]\w+)\sbuild\//i],[a,[c,"Sony"],[u,d]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[c,a,[u,"console"]],[/android.+;\s(shield)\sbuild/i],[a,[c,"Nvidia"],[u,"console"]],[/(playstation\s[34portablevi]+)/i],[a,[c,"Sony"],[u,"console"]],[/(sprint\s(\w+))/i],[[c,p.str,f.device.sprint.vendor],[a,p.str,f.device.sprint.model],[u,d]],[/(lenovo)\s?(S(?:5000|6000)+(?:[-][\w+]))/i],[c,a,[u,m]],[/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[c,[a,/_/g," "],[u,d]],[/(nexus\s9)/i],[a,[c,"HTC"],[u,m]],[/d\/huawei([\w\s-]+)[;\)]/i,/(nexus\s6p)/i],[a,[c,"Huawei"],[u,d]],[/(microsoft);\s(lumia[\s\w]+)/i],[c,a,[u,d]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[a,[c,"Microsoft"],[u,"console"]],[/(kin\.[onetw]{3})/i],[[a,/\./g," "],[c,"Microsoft"],[u,d]],[/\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,/(nexus\s6)/i],[a,[c,"Motorola"],[u,d]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[a,[c,"Motorola"],[u,m]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[c,h.trim],[a,h.trim],[u,"smarttv"]],[/hbbtv.+maple;(\d+)/i],[[a,/^/,"SmartTV"],[c,"Samsung"],[u,"smarttv"]],[/\(dtv[\);].+(aquos)/i],[a,[c,"Sharp"],[u,"smarttv"]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n\d+|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[[c,"Samsung"],a,[u,m]],[/smart-tv.+(samsung)/i],[c,[u,"smarttv"],a],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)/i,/sec-((sgh\w+))/i],[[c,"Samsung"],a,[u,d]],[/sie-(\w*)/i],[a,[c,"Siemens"],[u,d]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]*)/i],[[c,"Nokia"],a,[u,d]],[/android\s3\.[\s\w;-]{10}(a\d{3})/i],[a,[c,"Acer"],[u,m]],[/android.+([vl]k\-?\d{3})\s+build/i],[a,[c,"LG"],[u,m]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[c,"LG"],a,[u,m]],[/(lg) netcast\.tv/i],[c,a,[u,"smarttv"]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w*)/i,/android.+lg(\-?[\d\w]+)\s+build/i],[a,[c,"LG"],[u,d]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[a,[c,"Lenovo"],[u,m]],[/linux;.+((jolla));/i],[c,a,[u,d]],[/((pebble))app\/[\d\.]+\s/i],[c,a,[u,"wearable"]],[/android.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[c,a,[u,d]],[/crkey/i],[[a,"Chromecast"],[c,"Google"]],[/android.+;\s(glass)\s\d/i],[a,[c,"Google"],[u,"wearable"]],[/android.+;\s(pixel c)\s/i],[a,[c,"Google"],[u,m]],[/android.+;\s(pixel xl|pixel)\s/i],[a,[c,"Google"],[u,d]],[/android.+;\s(\w+)\s+build\/hm\1/i,/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i,/android.+(mi[\s\-_]*(?:one|one[\s_]plus|note lte)?[\s_]*(?:\d?\w?)[\s_]*(?:plus)?)\s+build/i,/android.+(redmi[\s\-_]*(?:note)?(?:[\s_]*[\w\s]+))\s+build/i],[[a,/_/g," "],[c,"Xiaomi"],[u,d]],[/android.+(mi[\s\-_]*(?:pad)(?:[\s_]*[\w\s]+))\s+build/i],[[a,/_/g," "],[c,"Xiaomi"],[u,m]],[/android.+;\s(m[1-5]\snote)\sbuild/i],[a,[c,"Meizu"],[u,m]],[/android.+a000(1)\s+build/i,/android.+oneplus\s(a\d{4})\s+build/i],[a,[c,"OnePlus"],[u,d]],[/android.+[;\/]\s*(RCT[\d\w]+)\s+build/i],[a,[c,"RCA"],[u,m]],[/android.+[;\/\s]+(Venue[\d\s]{2,7})\s+build/i],[a,[c,"Dell"],[u,m]],[/android.+[;\/]\s*(Q[T|M][\d\w]+)\s+build/i],[a,[c,"Verizon"],[u,m]],[/android.+[;\/]\s+(Barnes[&\s]+Noble\s+|BN[RT])(V?.*)\s+build/i],[[c,"Barnes & Noble"],a,[u,m]],[/android.+[;\/]\s+(TM\d{3}.*\b)\s+build/i],[a,[c,"NuVision"],[u,m]],[/android.+;\s(k88)\sbuild/i],[a,[c,"ZTE"],[u,m]],[/android.+[;\/]\s*(gen\d{3})\s+build.*49h/i],[a,[c,"Swiss"],[u,d]],[/android.+[;\/]\s*(zur\d{3})\s+build/i],[a,[c,"Swiss"],[u,m]],[/android.+[;\/]\s*((Zeki)?TB.*\b)\s+build/i],[a,[c,"Zeki"],[u,m]],[/(android).+[;\/]\s+([YR]\d{2})\s+build/i,/android.+[;\/]\s+(Dragon[\-\s]+Touch\s+|DT)(\w{5})\sbuild/i],[[c,"Dragon Touch"],a,[u,m]],[/android.+[;\/]\s*(NS-?\w{0,9})\sbuild/i],[a,[c,"Insignia"],[u,m]],[/android.+[;\/]\s*((NX|Next)-?\w{0,9})\s+build/i],[a,[c,"NextBook"],[u,m]],[/android.+[;\/]\s*(Xtreme\_)?(V(1[045]|2[015]|30|40|60|7[05]|90))\s+build/i],[[c,"Voice"],a,[u,d]],[/android.+[;\/]\s*(LVTEL\-)?(V1[12])\s+build/i],[[c,"LvTel"],a,[u,d]],[/android.+[;\/]\s*(V(100MD|700NA|7011|917G).*\b)\s+build/i],[a,[c,"Envizen"],[u,m]],[/android.+[;\/]\s*(Le[\s\-]+Pan)[\s\-]+(\w{1,9})\s+build/i],[c,a,[u,m]],[/android.+[;\/]\s*(Trio[\s\-]*.*)\s+build/i],[a,[c,"MachSpeed"],[u,m]],[/android.+[;\/]\s*(Trinity)[\-\s]*(T\d{3})\s+build/i],[c,a,[u,m]],[/android.+[;\/]\s*TU_(1491)\s+build/i],[a,[c,"Rotor"],[u,m]],[/android.+(KS(.+))\s+build/i],[a,[c,"Amazon"],[u,m]],[/android.+(Gigaset)[\s\-]+(Q\w{1,9})\s+build/i],[c,a,[u,m]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[u,h.lowerize],c,a],[/(android[\w\.\s\-]{0,9});.+build/i],[a,[c,"Generic"]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[l,[s,"EdgeHTML"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[s,l],[/rv\:([\w\.]{1,9}).+(gecko)/i],[l,s]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[s,l],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[s,[l,p.str,f.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[s,"Windows"],[l,p.str,f.os.windows.version]],[/\((bb)(10);/i],[[s,"BlackBerry"],l],[/(blackberry)\w*\/?([\w\.]*)/i,/(tizen)[\/\s]([\w\.]+)/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]*)/i,/linux;.+(sailfish);/i],[s,l],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]*)/i],[[s,"Symbian"],l],[/\((series40);/i],[s],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[s,"Firefox OS"],l],[/(nintendo|playstation)\s([wids34portablevu]+)/i,/(mint)[\/\s\(]?(\w*)/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?(?!chrom)([\w\.-]*)/i,/(hurd|linux)\s?([\w\.]*)/i,/(gnu)\s?([\w\.]*)/i],[s,l],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[s,"Chromium OS"],l],[/(sunos)\s?([\w\.\d]*)/i],[[s,"Solaris"],l],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]*)/i],[s,l],[/(haiku)\s(\w+)/i],[s,l],[/cfnetwork\/.+darwin/i,/ip[honead]{2,4}(?:.*os\s([\w]+)\slike\smac|;\sopera)/i],[[l,/_/g,"."],[s,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)/i],[[s,"Mac OS"],[l,/_/g,"."]],[/((?:open)?solaris)[\/\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],[s,l]]},v=function(e,t){if("object"==typeof e&&(t=e,e=void 0),!(this instanceof v))return new v(e,t).getResult();var n=e||(o&&o.navigator&&o.navigator.userAgent?o.navigator.userAgent:""),i=t?h.extend(g,t):g;return this.getBrowser=function(){var e={name:void 0,version:void 0};return p.rgx.call(e,n,i.browser),e.major=h.major(e.version),e},this.getCPU=function(){var e={architecture:void 0};return p.rgx.call(e,n,i.cpu),e},this.getDevice=function(){var e={vendor:void 0,model:void 0,type:void 0};return p.rgx.call(e,n,i.device),e},this.getEngine=function(){var e={name:void 0,version:void 0};return p.rgx.call(e,n,i.engine),e},this.getOS=function(){var e={name:void 0,version:void 0};return p.rgx.call(e,n,i.os),e},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 n},this.setUA=function(e){return n=e,this},this};v.VERSION="0.7.18",v.BROWSER={NAME:s,MAJOR:"major",VERSION:l},v.CPU={ARCHITECTURE:"architecture"},v.DEVICE={MODEL:a,VENDOR:c,TYPE:u,CONSOLE:"console",MOBILE:d,SMARTTV:"smarttv",TABLET:m,WEARABLE:"wearable",EMBEDDED:"embedded"},v.ENGINE={NAME:s,VERSION:l},v.OS={NAME:s,VERSION:l},void 0!==t?(void 0!==e&&e.exports&&(t=e.exports=v),t.UAParser=v):n(15)?void 0===(i=function(){return v}.call(t,n,t,e))||(e.exports=i):o&&(o.UAParser=v);var b=o&&(o.jQuery||o.Zepto);if(void 0!==b){var y=new v;b.ua=y.getResult(),b.ua.get=function(){return y.getUA()},b.ua.set=function(e){y.setUA(e);var t=y.getResult();for(var n in t)b.ua[n]=t[n]}}}("object"==typeof window?window:this)},function(e,t){(function(t){e.exports=t}).call(this,{})},function(e,t,n){"use strict";function i(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function o(e,t,n,o,r,a){return i(function(e,t){return e<<t|e>>>32-t}(i(i(t,e),i(o,a)),r),n)}function r(e,t,n,i,r,a,s){return o(t&n|~t&i,e,t,r,a,s)}function a(e,t,n,i,r,a,s){return o(t&i|n&~i,e,t,r,a,s)}function s(e,t,n,i,r,a,s){return o(t^n^i,e,t,r,a,s)}function u(e,t,n,i,r,a,s){return o(n^(t|~i),e,t,r,a,s)}function c(e,t){var n,o,c,l,d;e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;var m=1732584193,h=-271733879,p=-1732584194,f=271733878;for(n=0;n<e.length;n+=16)o=m,c=h,l=p,d=f,h=u(h=u(h=u(h=u(h=s(h=s(h=s(h=s(h=a(h=a(h=a(h=a(h=r(h=r(h=r(h=r(h,p=r(p,f=r(f,m=r(m,h,p,f,e[n],7,-680876936),h,p,e[n+1],12,-389564586),m,h,e[n+2],17,606105819),f,m,e[n+3],22,-1044525330),p=r(p,f=r(f,m=r(m,h,p,f,e[n+4],7,-176418897),h,p,e[n+5],12,1200080426),m,h,e[n+6],17,-1473231341),f,m,e[n+7],22,-45705983),p=r(p,f=r(f,m=r(m,h,p,f,e[n+8],7,1770035416),h,p,e[n+9],12,-1958414417),m,h,e[n+10],17,-42063),f,m,e[n+11],22,-1990404162),p=r(p,f=r(f,m=r(m,h,p,f,e[n+12],7,1804603682),h,p,e[n+13],12,-40341101),m,h,e[n+14],17,-1502002290),f,m,e[n+15],22,1236535329),p=a(p,f=a(f,m=a(m,h,p,f,e[n+1],5,-165796510),h,p,e[n+6],9,-1069501632),m,h,e[n+11],14,643717713),f,m,e[n],20,-373897302),p=a(p,f=a(f,m=a(m,h,p,f,e[n+5],5,-701558691),h,p,e[n+10],9,38016083),m,h,e[n+15],14,-660478335),f,m,e[n+4],20,-405537848),p=a(p,f=a(f,m=a(m,h,p,f,e[n+9],5,568446438),h,p,e[n+14],9,-1019803690),m,h,e[n+3],14,-187363961),f,m,e[n+8],20,1163531501),p=a(p,f=a(f,m=a(m,h,p,f,e[n+13],5,-1444681467),h,p,e[n+2],9,-51403784),m,h,e[n+7],14,1735328473),f,m,e[n+12],20,-1926607734),p=s(p,f=s(f,m=s(m,h,p,f,e[n+5],4,-378558),h,p,e[n+8],11,-2022574463),m,h,e[n+11],16,1839030562),f,m,e[n+14],23,-35309556),p=s(p,f=s(f,m=s(m,h,p,f,e[n+1],4,-1530992060),h,p,e[n+4],11,1272893353),m,h,e[n+7],16,-155497632),f,m,e[n+10],23,-1094730640),p=s(p,f=s(f,m=s(m,h,p,f,e[n+13],4,681279174),h,p,e[n],11,-358537222),m,h,e[n+3],16,-722521979),f,m,e[n+6],23,76029189),p=s(p,f=s(f,m=s(m,h,p,f,e[n+9],4,-640364487),h,p,e[n+12],11,-421815835),m,h,e[n+15],16,530742520),f,m,e[n+2],23,-995338651),p=u(p,f=u(f,m=u(m,h,p,f,e[n],6,-198630844),h,p,e[n+7],10,1126891415),m,h,e[n+14],15,-1416354905),f,m,e[n+5],21,-57434055),p=u(p,f=u(f,m=u(m,h,p,f,e[n+12],6,1700485571),h,p,e[n+3],10,-1894986606),m,h,e[n+10],15,-1051523),f,m,e[n+1],21,-2054922799),p=u(p,f=u(f,m=u(m,h,p,f,e[n+8],6,1873313359),h,p,e[n+15],10,-30611744),m,h,e[n+6],15,-1560198380),f,m,e[n+13],21,1309151649),p=u(p,f=u(f,m=u(m,h,p,f,e[n+4],6,-145523070),h,p,e[n+11],10,-1120210379),m,h,e[n+2],15,718787259),f,m,e[n+9],21,-343485551),m=i(m,o),h=i(h,c),p=i(p,l),f=i(f,d);return[m,h,p,f]}function l(e){var t,n="",i=32*e.length;for(t=0;t<i;t+=8)n+=String.fromCharCode(e[t>>5]>>>t%32&255);return n}function d(e){var t,n=[];for(n[(e.length>>2)-1]=void 0,t=0;t<n.length;t+=1)n[t]=0;var i=8*e.length;for(t=0;t<i;t+=8)n[t>>5]|=(255&e.charCodeAt(t/8))<<t%32;return n}function m(e){var t,n,i="";for(n=0;n<e.length;n+=1)t=e.charCodeAt(n),i+="0123456789abcdef".charAt(t>>>4&15)+"0123456789abcdef".charAt(15&t);return i}function h(e){return unescape(encodeURIComponent(e))}function p(e){return function(e){return l(c(d(e),8*e.length))}(h(e))}function f(e,t){return function(e,t){var n,i,o=d(e),r=[],a=[];for(r[15]=a[15]=void 0,o.length>16&&(o=c(o,8*e.length)),n=0;n<16;n+=1)r[n]=909522486^o[n],a[n]=1549556828^o[n];return i=c(r.concat(d(t)),512+8*t.length),l(c(a.concat(i),640))}(h(e),h(t))}Object.defineProperty(t,"__esModule",{value:!0}),t.md5=function(e,t,n){return t?n?f(t,e):function(e,t){return m(f(e,t))}(t,e):n?p(e):function(e){return m(p(e))}(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,i,o){var r=$('<div class="xmuiCore xmuiForm xmuiRejectionForm"> <div class="xmuiPageHeader"> <div> <span class="xmuiRejectionTitle"</span> </div> </div> <div class="xmuiFullHeightContentBelowPrompt"> <div class="xmuiRejectionText"/> <div class="xmuiRejectionData"/> <div> <button class="xmuiRejectionButton" type="button"/> </div> </div> </div>');return o.appendElement(r,i),o.setAriaBusy(i),new Promise(function(a,s){r.find(".xmuiRejectionTitle").text(e),r.find(".xmuiRejectionText").text(t);var u=r.find(".xmuiRejectionButton");u.text(n),u.click(function(){r.fadeOut(function(){o.clearContainer(i),a(com.ts.mobile.sdk.ConfirmationInput.create(-1))})}),o.unsetAriaBusy(i)})}},function(e,t,n){"use strict";function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(t,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.userId=t,this.actionContext=n,this.common=i}return function(e,t,n){t&&i(e.prototype,t),n&&i(e,n)}(e,[{key:"startSession",value:function(e,t){this.clientContext=e,this.actionContext=t,this.common.log("Starting registration promotion action session")}},{key:"endSession",value:function(){this.common.log("Ending registration promotion action session")}},{key:"promptIntroduction",value:function(e,t,n,i){var o=this,r=$('<div class="xmuiCore xmuiForm xmuiRegistationPromotionForm"> <div class="xmuiFullHeightContentBelowPrompt"> <div class="xmuiPageHeader"> <div> <span></span> </div> </div> <div class="xmuiRegistationPromotionText"/><br/> <div> <button class="xmuiRegistationPromotionContinueButton" type="button"/> <button class="xmuiRegistationPromotionSkipButton" type="button"/> <button class="xmuiRegistationPromotionAbortButton" type="button"/> </div> </div> </div>');return this.common.setAriaBusy(this.clientContext),r.find("span").text(e),r.find(".xmuiRegistationPromotionText").text(t),this.common.appendElement(r,this.clientContext),new Promise(function(e,t){var a=r.find(".xmuiRegistationPromotionContinueButton");a.text(n),a.click(function(){r.fadeOut(function(){o.common.clearContainer(o.clientContext),e(com.ts.mobile.sdk.PromotionInput.createControlResponse(com.ts.mobile.sdk.PromotionControlRequest.Continue))})});var s=r.find(".xmuiRegistationPromotionAbortButton");s.text("Abort"),s.click(function(){r.fadeOut(function(){o.common.clearContainer(o.clientContext),e(com.ts.mobile.sdk.PromotionInput.createControlResponse(com.ts.mobile.sdk.PromotionControlRequest.Abort))})});var u=r.find(".xmuiRegistationPromotionSkipButton");u.text(i),u.click(function(){r.fadeOut(function(){o.common.clearContainer(o.clientContext),e(com.ts.mobile.sdk.PromotionInput.createControlResponse(com.ts.mobile.sdk.PromotionControlRequest.Skip))})}),o.common.unsetAriaBusy(o.clientContext)})}},{key:"setPromotedAuthenticators",value:function(e){return this.common.registrationPromotionMethodSelectionPromise(e,this.clientContext)}}]),e}();t.RegistrationPromotionSession=o},function(e,t,n){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function r(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(t,"__esModule",{value:!0});var u=n(0),c=function(e){function t(e,n,i){var o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(o=r(this,a(t).call(this,e,n,i))).supportsInlineError=!0,o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(t,u.BaseAuthenticatorSession),function(e,t,n){t&&o(e.prototype,t),n&&o(e,n)}(t,[{key:"newForm",value:function(){return $('<div class="xmuiCore xmuiForm xmuiPasswordForm"> <div class="xmuiPrompt"/> <div class="xmuiFullHeightContentBelowPrompt"> <form onsubmit="return false"> <div> <input type="password" data-xmui-customstringtext-placeholder="password.inputPlaceholder"/> </div> <div> <button type="submit"/> </div> </form> </div> </div>')}},{key:"promiseAuthInput",value:function(){var e=this,t=this.newForm(),n=t.find("input"),i=t.find("button"),o=t.find(".xmuiPrompt");return this.common.appendElement(t,this.clientContext),new Promise(function(r,a){e.authError?(o.text(e.authError.getMessage()),o.addClass("xmuiPromptError")):o.text(e.common.resolveString("password.prompt")),n.val(""),n.attr("role","textbox").attr("aria-label",e.common.resolveString("aria.enterPassword")),n.focus(),i.text(e.common.resolveString("password.loginButton")),i.click(function(){var e=com.ts.mobile.sdk.PasswordInput.create(n.val().toString());t.fadeOut(function(){r(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(e))})}),e.common.prependPageHeader(t,e.title,r)})}},{key:"promiseRegInput",value:function(){var e=this,t=this.newForm(),n=t.find("input"),i=t.find("button"),o=t.find(".xmuiPrompt");return this.common.appendElement(t,this.clientContext),new Promise(function(r,a){var s,u=function(){if(s===n.val()){var i=com.ts.mobile.sdk.PasswordInput.create(n.val().toString());t.fadeOut(function(){r(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(i))})}else o.text(e.common.resolveString("password.registration.noMatch")),o.addClass("xmuiPromptError"),n.val(""),n.attr("role","alert").attr("aria-label",e.common.resolveString("aria.passwordsDontMatch"))};e.authError?(o.text(e.authError.getMessage()),o.addClass("xmuiPromptError")):o.text(e.common.resolveString("password.registration.prompt")),n.val(""),n.attr("role","textbox").attr("aria-label",e.common.resolveString("aria.enterPassword")),n.focus(),i.text(e.common.resolveString("password.registration.continueButton")),i.click(function(){s=n.val().toString(),o.text(e.common.resolveString("password.registration.promptAgain")),t.removeClass("xmuiPromptError"),n.val(""),n.attr("role","alert").attr("aria-label",e.common.resolveString("aria.enterPasswordAgain")),i.text(e.common.resolveString("password.registration.registerButton")),e.common.reBind(i,u)}),e.common.prependPageHeader(t,e.title,r)})}}]),t}();t.PasswordAuthenticatorSession=c},function(e,t,n){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function r(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(t,"__esModule",{value:!0});var u=n(0),c=function(e){function t(e,n,i,o){var s;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(s=r(this,a(t).call(this,e,n,o))).supportsInlineError=!0,s.pinLength=i,s}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(t,u.BaseAuthenticatorSession),function(e,t,n){t&&o(e.prototype,t),n&&o(e,n)}(t,[{key:"newForm",value:function(){return $('<div class="xmuiCore xmuiForm xmuiPinForm"> <div class="xmuiPrompt"/> <div class="xmuiFullHeightContentBelowPrompt"> <form onsubmit="return false"> <input type="number" class="xmuiPinFormElement" data-xmui-customstringtext-placeholder="pin.inputPlaceholder"/> <div style="align-items: center;"> <button class="xmuiLoginButton" type="submit"/> </div> </form> </div> </div>')}},{key:"promiseAuthInput",value:function(){var e=this,t=this.newForm(),n=t.find("input"),i=t.find("button"),o=t.find(".xmuiPrompt");return this.common.appendElement(t,this.clientContext),new Promise(function(r,a){e.authError?(o.text(e.authError.getMessage()),o.addClass("xmuiPromptError")):o.text(e.common.resolveString("pin.prompt")),n.val(""),n.attr("role","textbox").attr("aria-label",e.common.resolveString("aria.enterPin")),i.text(e.common.resolveString("pin.loginButton")),i.click(function(){var i=e.validateNumericOnly(n,o);if(i){var a=com.ts.mobile.sdk.PinInput.create(i);t.fadeOut(function(){r(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(a))})}}),e.common.prependPageHeader(t,e.title,r)})}},{key:"promiseRegInput",value:function(){var e=this,t=this.newForm(),n=t.find("input"),i=t.find("button"),o=t.find(".xmuiPrompt");return this.common.appendElement(t,this.clientContext),new Promise(function(r,a){var s,u=function(){if(s===n.val()){o.removeClass("xmuiPromptError");var i=com.ts.mobile.sdk.PinInput.create(n.val().toString());t.fadeOut(function(){r(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(i))})}else o.text(e.common.resolveString("pin.registration.noMatch")),o.addClass("xmuiPromptError"),n.val(""),n.attr("role","alert").attr("aria-label",e.common.resolveString("aria.pinsDontMatch"))};e.authError?(o.text(e.authError.getMessage()),o.addClass("xmuiPromptError")):o.text(e.common.resolveString("pin.registration.prompt")),n.val(""),n.attr("role","textbox").attr("aria-label",e.common.resolveString("aria.enterPin")),i.text(e.common.resolveString("pin.registration.continueButton")),i.click(function(){var t=e.validateNumericOnly(n,o);t&&(t.length==e.pinLength?(s=t,o.text(e.common.resolveString("pin.registration.promptAgain")),o.removeClass("xmuiPromptError"),n.val(""),n.attr("role","status").attr("aria-label",e.common.resolveString("aria.enterPinAgain")),i.text(e.common.resolveString("pin.registration.registerButton")),e.common.reBind(i,u)):(o.text(e.common.resolveString("pin.registration.badLength").replace("$length",e.pinLength.toString())),o.addClass("xmuiPromptError"),n.val(""),n.attr("role","alert").attr("aria-label",e.common.resolveString("aria.badPinLength").replace("$length",e.pinLength.toString()))))}),e.common.prependPageHeader(t,e.title,r)})}},{key:"validateNumericOnly",value:function(e,t){for(var n=e.val().toString(),i=n.length;i--;)if(-1==="0123456789".indexOf(n.charAt(i)))return e.empty(),t.text(this.common.resolveString("pin.registration.digitsOnly")),t.addClass("xmuiPromptError"),null;return n}}]),t}();t.PinAuthenticatorSession=c},function(e,t,n){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function r(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(t,"__esModule",{value:!0});var u=n(0),c=n(22),l=function(e){function t(e,n,i,o,s){var u;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(u=r(this,a(t).call(this,e,n,s))).supportsInlineError=!0,u.gridWidth=i,u.gridHeight=o,u}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(t,u.BaseAuthenticatorSession),function(e,t,n){t&&o(e.prototype,t),n&&o(e,n)}(t,[{key:"createPatternInputString",value:function(e){var t=this;return e.map(function(e){return"r:"+Math.floor((e-1)/t.gridWidth)+",c:"+(e-1)%t.gridWidth}).join("")}},{key:"promiseAuthInput",value:function(){var e=this,t=$('<div class="xmuiCore xmuiForm xmuiPatternForm"> <div class="xmuiPrompt"/> <div class="xmuiFullHeightContentBelowPrompt"> <div class="xmuiPatternControl xmuiAuthPatternControl"/> </div> </div>'),n=t.find(".xmuiPrompt");return this.common.appendElement(t,this.clientContext),new Promise(function(i,o){e.authError?(n.text(e.authError.getMessage()),n.addClass("xmuiPromptError")):n.text(e.common.resolveString("pattern.prompt")),new c.PatternLock(".xmuiAuthPatternControl",{matrix:[e.gridHeight,e.gridWidth],onDraw:function(n){var o=JSON.parse("["+n+"]"),r=com.ts.mobile.sdk.PatternInput.create(e.createPatternInputString(o));t.fadeOut(function(){i(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(r))})}}),e.common.prependPageHeader(t,e.title,i)})}},{key:"promiseRegInput",value:function(){var e=this,t=$('<div class="xmuiCore xmuiForm xmuiPatternForm"> <div class="xmuiPrompt"/> <div class="xmuiFullHeightContentBelowPrompt"> <div class="xmuiPatternControl xmuiRegPatternControl"/> <div> <button class="xmuiPatternRegRestartButton" data-xmui-customstringtext="pattern.registerRestartButton"></button> <button class="xmuiPatternRegContinueButton" data-xmui-customstringtext="pattern.registerContinueButton"></button> </div> </div> </div>'),n=t.find(".xmuiPrompt"),i=t.find(".xmuiPatternRegRestartButton"),o=t.find(".xmuiPatternRegContinueButton");return this.common.appendElement(t,this.clientContext),new Promise(function(r,a){var s=function(){l===e.createPatternInputString(d)?t.fadeOut(function(){r(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(com.ts.mobile.sdk.PatternInput.create(l)))}):(m.reset(),o.attr("disabled","true"),n.addClass("xmuiPromptError"),n.text(e.common.resolveString("pattern.registerNoMatchErrorPrompt")))},u=function(){m.reset(),o.attr("disabled","true"),n.removeClass("xmuiPromptError"),n.text(e.common.resolveString("pattern.registerDrawAgainPrompt")),u=s,l=e.createPatternInputString(d)},l=null,d=null,m=new c.PatternLock(".xmuiRegPatternControl",{matrix:[e.gridHeight,e.gridWidth],onDraw:function(e){d=JSON.parse("["+e+"]"),o.removeAttr("disabled")}});e.authError?(n.text(e.authError.getMessage()),n.addClass("xmuiPromptError")):n.text(e.common.resolveString("pattern.registerDrawPrompt")),o.attr("disabled","true"),o.click(function(){d.length<4?(n.addClass("xmuiPromptError"),n.text(e.common.resolveString("pattern.registerTooShortErrorPrompt").replace("$length",4..toString())),m.reset()):u()}),i.click(function(){n.removeClass("xmuiPromptError");var e=com.ts.mobile.sdk.ControlRequest.create(com.ts.mobile.sdk.ControlRequestType.RetryAuthenticator);r(com.ts.mobile.sdk.InputOrControlResponse.createControlResponse(e))}),e.common.prependPageHeader(t,e.title,r)})}}]),t}();t.PatternAuthenticatorSession=l},function(e,t,n){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0});var o=window.document,r=function(){},a={};function s(e){for(var t=e.holder,n=e.option,i=n.matrix,o=n.margin,r=n.radius,a=['<ul class="patt-wrap" style="padding:'+o+'px">'],s=0,u=i[0]*i[1];s<u;s++)a.push('<li class="patt-circ" style="margin:'+o+"px; width : "+2*r+"px; height : "+2*r+"px; -webkit-border-radius: "+r+"px; -moz-border-radius: "+r+"px; border-radius: "+r+'px; "><div class="patt-dots"></div></li>');a.push("</ul>"),t.html(a.join("")).css({width:i[1]*(2*r+2*o)+2*o+"px",height:i[0]*(2*r+2*o)+2*o+"px"}),e.pattCircle=e.holder.find(".patt-circ")}function u(e,t,n,i){var o=t-e,r=i-n;return{length:Math.ceil(Math.sqrt(o*o+r*r)),angle:Math.round(180*Math.atan2(r,o)/Math.PI)}}var c=function(e,t){e.preventDefault();var n=a[t.token];if(!n.disabled){n.option.patternVisible||n.holder.addClass("patt-hidden");var i="touchstart"==e.type?"touchmove":"mousemove",r="touchstart"==e.type?"touchend":"mouseup",s=$(this);(s.on||s.bind).call(s,i+".pattern-move",function(e){l.call(this,e,t)}),$(o).one(r,function(){d.call(this,e,t)});var u=n.holder.find(".patt-wrap")[0].getBoundingClientRect();n.wrapTop=u.top,n.wrapLeft=u.left,t.reset()}},l=function(e,t){e.preventDefault();var n=e.clientX||e.originalEvent.touches[0].clientX,i=e.clientY||e.originalEvent.touches[0].clientY,o=a[t.token],r=o.option,s=o.pattCircle,c=o.patternAry,l=o.getIdxFromPoint(n,i),d=l.idx,m=o.mapperFunc(d)||d;if(c.length>0){var h=u(o.lineX1,l.x,o.lineY1,l.y);o.line.css({width:h.length+10+"px",transform:"rotate("+h.angle+"deg)"})}if(d&&(r.allowRepeat&&c[c.length-1]!==m||-1===c.indexOf(m))){var p=$(s[d-1]);if(o.lastPosObj)for(var f=o.lastPosObj,g=f.i,v=f.j,b=l.i-f.i>0?1:-1,y=l.j-f.j>0?1:-1,x=Math.abs(l.i-g),w=Math.abs(l.j-v);0===x&&w>1||0===w&&x>1||w==x&&w>1;){g=x?g+b:g,v=w?v+y:v,x=Math.abs(l.i-g),w=Math.abs(l.j-v);var S=(v-1)*r.matrix[1]+g,C=o.mapperFunc(S)||S;(r.allowRepeat||-1==c.indexOf(C))&&(o.addDirectionClass({i:g,j:v}),o.markPoint($(s[C-1]),C),o.addLine({i:g,j:v}))}o.lastPosObj&&o.addDirectionClass(l),o.markPoint(p,m),o.addLine(l),o.lastPosObj=l}},d=function(e,t){e.preventDefault();var n=a[t.token],i=n.option,o=n.patternAry.join(i.delimiter),r=n.holder;(r.off||r.unbind).call(r,".pattern-move").removeClass("patt-hidden"),o&&(i.onDraw(o),n.line.remove(),n.rightPattern&&(o==n.rightPattern?n.onSuccess():(n.onError(),t.error())))};function m(){}function h(e,t){var n=this,o=n.token=Math.random(),u=a[o]=new m,l=u.holder=$(e);if(0!==l.length){u.object=n;var d={onDraw:r},p=(t=t||{}).matrix;p&&p[0]*p[1]>9&&(d.delimiter=","),t=u.option=$.extend({},h.defaults,d,t),s(u),l.addClass("patt-holder"),"static"==l.css("position")&&l.css("position","relative"),(l.bind||l.on).call(l,"mousedown touchstart",function(e){c.call(this,e,n)});var f=t.mapper;"object"==i(f)?u.mapperFunc=function(e){return f[e]}:u.mapperFunc="function"==typeof f?f:r,u.option.mapper=null}}m.prototype={constructor:m,getIdxFromPoint:function(e,t){var n=this.option,i=n.matrix,o=e-this.wrapLeft,r=t-this.wrapTop,a=null,s=n.margin,u=2*n.radius+2*s,c=Math.ceil(o/u),l=Math.ceil(r/u),d=o%u,m=r%u;return c<=i[1]&&l<=i[0]&&d>2*s&&m>2*s&&(a=(l-1)*i[1]+c),{idx:a,i:c,j:l,x:o,y:r}},markPoint:function(e,t){e.addClass("hovered"),this.patternAry.push(t),this.lastElm=e},addLine:function(e){var t=this.patternAry,n=this.option,i=n.lineOnMove,o=n.margin,r=n.radius,a=(e.i-1)*(2*o+2*r)+2*o+r,s=(e.j-1)*(2*o+2*r)+2*o+r;if(t.length>1){var c=u(this.lineX1,a,this.lineY1,s);this.line.css({width:c.length+"px",transform:"rotate("+c.angle+"deg)"}),i||this.line.show()}var l=$('<div class="patt-lines" style="top:'+(s-2)+"px; left:"+(a-2)+'px"></div>');this.line=l,this.lineX1=a,this.lineY1=s,this.holder.append(l),i||this.line.hide()},addDirectionClass:function(e){var t=this.lastElm,n=this.line,i=this.lastPosObj,o=[];e.j-i.j>0?o.push("s"):e.j-i.j<0&&o.push("n"),e.i-i.i>0?o.push("e"):e.i-i.i<0&&o.push("w"),(o=o.join("-"))&&t.add(n).addClass(o+" dir")}},t.PatternLock=h,h.prototype={constructor:h,option:function(e,t){var n=a[this.token],i=n.option;if(void 0===t)return i[e];i[e]=t,"margin"!=e&&"matrix"!=e&&"radius"!=e||s(n)},getPattern:function(){var e=a[this.token];return(e.patternAry||[]).join(e.option.delimiter)},setPattern:function(e){var t=a[this.token],n=t.option,i=n.matrix,o=n.margin,s=n.radius;if(n.enableSetPattern){"string"==typeof e&&(e=e.split(n.delimiter)),this.reset(),t.wrapLeft=0,t.wrapTop=0;for(var u=0;u<e.length;u++){var c=e[u]-1,d=c%i[1]*(2*o+2*s)+2*o+s,m=Math.floor(c/i[1])*(2*o+2*s)+2*o+s;l.call(null,{clientX:d,clientY:m,preventDefault:r},this)}}},enable:function(){a[this.token].disabled=!1},disable:function(){a[this.token].disabled=!0},reset:function(){var e=a[this.token];e.pattCircle.removeClass("hovered dir s n w e s-w s-e n-w n-e"),e.holder.find(".patt-lines").remove(),e.patternAry=[],e.lastPosObj=null,e.holder.removeClass("patt-error")},error:function(){a[this.token].holder.addClass("patt-error")},checkForPattern:function(e,t,n){var i=a[this.token];i.rightPattern=e,i.onSuccess=t||r,i.onError=n||r}},h.defaults={matrix:[3,3],margin:20,radius:25,patternVisible:!0,lineOnMove:!0,delimiter:"",enableSetPattern:!1,allowRepeat:!1}},function(e,t,n){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function r(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(t,"__esModule",{value:!0});var u,c=n(0);!function(e){e[e.TargetSelection=0]="TargetSelection",e[e.CodeInvalidated=1]="CodeInvalidated",e[e.Input=2]="Input"}(u||(u={}));var l=function(e){function t(e,n,i,o,s){var c;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(c=r(this,a(t).call(this,e,n,s))).supportsInlineError=!0,c.possibleTargets=i,c.autoExecedTarget=o,c.state=o?u.Input:u.TargetSelection,c}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(t,c.BaseAuthenticatorSession),function(e,t,n){t&&o(e.prototype,t),n&&o(e,n)}(t,[{key:"setAvailableTargets",value:function(e){this.possibleTargets=e}},{key:"setGeneratedOtp",value:function(e,t){this.generatedFormat=e,this.generatedForTarget=t,t||(null!=this.authError&&this.authError.getErrorCode()===com.ts.mobile.sdk.AuthenticationErrorCode.InvalidInput?this.state=u.CodeInvalidated:this.state=u.TargetSelection)}},{key:"promiseOtpInput",value:function(){var e=this,t=$('<div class="xmuiCore xmuiForm xmuiOtpForm"> <div class="xmuiPrompt"/> <div class="xmuiFullHeightContentBelowPrompt"> <form onsubmit="return false"> <input data-xmui-customstringtext-placeholder="otp.inputPlaceholder"/> <div style="align-items: center;"> <button class="xmuiLoginButton" type="submit" data-xmui-customstringtext="otp.loginButton"/><br> <button class="xmuiResendButton" type="button" data-xmui-customstringtext="otp.resendButton"/> </div> </form> </div> </div>'),n=t.find("input"),i=t.find(".xmuiLoginButton"),o=t.find(".xmuiResendButton"),r=t.find(".xmuiPrompt");return this.common.appendElement(t,this.clientContext),new Promise(function(a,s){e.authError?(r.text(e.authError.getMessage()),r.addClass("xmuiPromptError")):r.text(e.common.resolveString("otp.prompt")),n.val(""),i.click(function(){t.fadeOut(function(){var e=com.ts.mobile.sdk.OtpInputOtpSubmission.createOtpSubmission(n.val().toString()),t=com.ts.mobile.sdk.TargetBasedAuthenticatorInput.createAuthenticatorInput(e);a(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(t))})}),o.click(function(){t.fadeOut(function(){e.authError=null;var t=com.ts.mobile.sdk.OtpInputRequestResend.createOtpResendRequest(),n=com.ts.mobile.sdk.TargetBasedAuthenticatorInput.createAuthenticatorInput(t);a(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(n))})}),e.common.prependPageHeader(t,e.title,a)})}},{key:"promiseTargetSelectionInput",value:function(e){var t=this,n=$('<div class="xmuiCore xmuiForm xmuiOtpTargetSelectionForm"><div class="xmuiPrompt"/><div class="xmuiOtpTargetSelectionList"></div></div>'),i=n.find(".xmuiPrompt");e?(i.addClass("xmuiPromptError"),i.text(this.common.resolveString("otp.codeInvalidated"))):(i.text(this.common.resolveString("otpTargetSelection.selectTarget")),i.removeClass("xmuiPromptError"));var o=n.find(".xmuiOtpTargetSelectionList");return this.common.appendElement(n,this.clientContext),new Promise(function(e,i){$.each(t.possibleTargets,function(i,r){var a=com.ts.mobile.sdk.OtpChannel[r.getChannel()],s=t.common.resolveString("otpMethodChannel.".concat(a)).replace("$target",r.getDescription()),c=$('<div class="xmuiMenuItem xmuiOtpTargetSelectionItem">').text(s).click(function(){n.fadeOut(function(){t.authError=null,t.state=u.Input;var n=com.ts.mobile.sdk.TargetBasedAuthenticatorInput.createTargetSelectionRequest(r);e(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(n))})});o.append(c)}),t.common.prependPageHeader(n,t.title,e)})}},{key:"promiseAuthInput",value:function(){switch(this.state){case u.TargetSelection:return this.promiseTargetSelectionInput(!1);case u.CodeInvalidated:return this.promiseTargetSelectionInput(!0);case u.Input:return this.promiseOtpInput()}}},{key:"promiseRegInput",value:function(){return Promise.reject("Otp registration unsupported")}}]),t}();t.OtpAuthenticatorSession=l},function(e,t,n){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function a(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(t,"__esModule",{value:!0});var l=n(0),d=n(25),m=function(e){function t(e,n,i){var r;return o(this,t),(r=a(this,s(t).call(this,e,n,i))).supportsInlineError=!0,r}return u(t,l.BaseAuthenticatorSession),function(e,t,n){t&&r(e.prototype,t),n&&r(e,n)}(t,[{key:"newForm",value:function(){return $('<div class="xmuiCore xmuiForm xmuiVoiceForm"><div class="xmuiPrompt"/><div class="xmuiFullHeightContentBelowPrompt"><div class="xmuiVoicePassphrase"/><div class="xmuiAudioAnalyzer" hidden style="display:none"><canvas width="120" height="120"/></div><div class="xmuiAudioControls"><button type="button" data-xmui-customstringtext="voice.startButton"/></div></div></div>')}},{key:"promiseAuthInput",value:function(){var e=this,t=this.newForm(),n=t.find(".xmuiVoicePassphrase"),i=t.find("canvas"),o=t.find(".xmuiAudioControls button"),r=t.find(".xmuiAudioAnalyzer"),a=t.find(".xmuiPrompt"),s=null;o.click(function(){o.hide(),r.show(),s.record()}),i.click(function(){s.stop()}),this.common.appendElement(t,this.clientContext);return new Promise(function(r,u){e.authError?(a.text(e.authError.getMessage()),a.addClass("xmuiPromptError")):a.text(e.common.resolveString("voice.prompt")),n.text(e.currentStep.stepDescription.getPassphraseText());var c={vizCanvas:i.get(0)};s||(s=new d.VoiceRecorder(c,e.common.log.bind(e.common))),s.setOnEndRecording(function(t){e.common.showProgressForm(e.clientContext);var n=new p({sample:function(e){for(var t="",n=new Uint8Array(e),i=n.byteLength,o=0;o<i;o++)t+=String.fromCharCode(n[o]);return window.btoa(t)}(t.getPcm16().buffer),passphrase_text:e.currentStep.stepDescription.getPassphraseText()});r(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(n))}),o.show(),o.attr("role","Button").attr("aria-label",e.common.resolveString("aria.voiceRecordButton")),t.find(".xmuiAudioAnalyzer").hide(),e.common.prependPageHeader(t,e.title,r),e.common.hideProgressForm(e.clientContext)})}},{key:"promiseRegInput",value:function(){return Promise.reject("Voice registration unsupported")}},{key:"setInputStep",value:function(e,t,n){this.currentStep=new h(e,t,n)}}]),t}();t.VoiceAuthenticatorSession=m;var h=function e(t,n,i){o(this,e),this.stepNumber=t,this.maxStepNumber=n,this.stepDescription=i},p=function(e){function t(e){var n;return o(this,t),(n=a(this,s(t).call(this))).setAcquisitionResponse(e),n}return u(t,com.ts.mobile.sdk.AudioInputResponse),t}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VoiceRecorder=function(e,t){var n,i=window.AudioContext||window.webkitAudioContext,o=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia,r=(navigator.cancelAnimationFrame||navigator.webkitCancelAnimationFrame||navigator.mozCancelAnimationFrame,window.requestAnimationFrame||navigator.webkitRequestAnimationFrame||navigator.mozRequestAnimationFrame),a=e||{},s=a.bufferLen||4096,u=!1,c=[],l=[],d=0,m=function(){},h=a.vizCanvas,p=function(e,t,n){var i=new Uint8Array(g.analyserNode.fftSize);g.analyserNode.getByteFrequencyData(i);var o=i[0];e.clearRect(0,0,t,n),e.beginPath(),e.arc(t/2,n/2,o/255*t/2*.8,0,2*Math.PI,!1),e.fillStyle=a.vizPrimaryColor||"#F6D565",e.fill()},f=a.sampleRate||8e3;this.audioContext=new i,this.jsAudioNode=null,n=this.audioContext.sampleRate,this.audioContext.createScriptProcessor?this.jsAudioNode=this.audioContext.createScriptProcessor(s,2,2):this.jsAudioNode=this.audioContext.createJavaScriptNode(s,2,2),this.analyserNode=this.audioContext.createAnalyser(),this.analyserNode.fftSize=1024;var g=this;this.jsAudioNode.onaudioprocess=function(e){u&&(c.push(new Float32Array(e.inputBuffer.getChannelData(0))),l.push(new Float32Array(e.inputBuffer.getChannelData(1))),d+=e.inputBuffer.getChannelData(0).length)};var v={audio:{mandatory:{googEchoCancellation:"false",googAutoGainControl:"false",googNoiseSuppression:"false",googHighpassFilter:"false"},optional:[]}};function b(){if(h){var e=h.width,t=h.height,n=h.getContext("2d");p(n,e,t)}u&&r(b)}Object.assign(v,a.userMediaRequest||{}),o.call(navigator,v,function(e){g.setSourceStream(e)},function(e){t(e),g.setError(e)}),this.getPcm16=function(){for(var e=new ArrayBuffer(2*Math.ceil(d/n*f)),t=new DataView(e),i=0,o=0,r=0,a=Math.floor(n/f),s=n-f*a,u=0;r<c.length;){var l=Math.max(-1,Math.min(1,c[r][o]));t.setInt16(i,l<0?32768*l:32767*l,!0),i+=2,o+=a,(u+=s)>=f&&(u-=f,o++),o>=c[r].length&&(o-=c[r].length,r+=1)}return t},this.setOnEndRecording=function(e){m=e},this.record=function(){c=[],l=[],d=0,u=!0,b()},this.stop=function(){u=!1,m(this)},this.isRecording=function(){return u},this.setSourceStream=function(e){var t=this.audioContext.createMediaStreamSource(e);t.connect(this.jsAudioNode),t.connect(this.analyserNode),this.jsAudioNode.connect(this.audioContext.destination)},this.setError=function(e){this.lastError=e},this.isError=function(){return this.lastError},this.getError=this.isError}},function(e,t,n){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function r(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function a(e,t,n){return(a="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=s(e)););return e}(e,t);if(i){var o=Object.getOwnPropertyDescriptor(i,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(t,"__esModule",{value:!0});var c=n(0),l=function(e){function t(e,n,i){var o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(o=r(this,s(t).call(this,e,n,i))).supportsInlineError=!1,o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(t,c.BaseAuthenticatorSession),function(e,t,n){t&&o(e.prototype,t),n&&o(e,n)}(t,[{key:"newForm",value:function(){return $('<div class="xmuiCore xmuiForm xmuiSecurityQuestionForm"><div class="xmuiPrompt" data-xmui-customstringtext="question.prompt"/><div class="xmuiFullHeightContentBelowPrompt"><div class="xmuiSecurityQuestionList"></div><button class="xmuiSubmitButton" type="submit" data-xmui-customstringtext="question.submitButton"></button></div></div>')}},{key:"startSession",value:function(e,n,i,o){a(s(t.prototype),"startSession",this).call(this,e,n,i,o)}},{key:"promiseRecoveryForError",value:function(e,n,i){var o=this;return this.common.clearContainer(this.clientContext),a(s(t.prototype),"promiseRecoveryForError",this).call(this,e,n,i).finally(function(){o.questionForm=null})}},{key:"promiseInput",value:function(){var e;switch(this.common.setAriaBusy(this.clientContext),this.questionForm||(this.questionForm=this.newForm(),this.common.appendElement(this.questionForm,this.clientContext)),this.mode){case com.ts.mobile.sdk.AuthenticatorSessionMode.Authentication:this.common.log("Fetching authentication input; authenticator: [".concat(this.title,"]")),this.common.unsetAriaBusy(this.clientContext),e=this.promiseAuthInput();break;case com.ts.mobile.sdk.AuthenticatorSessionMode.Registration:this.common.log("Fetching registration input; authenticator: [".concat(this.title,"]")),this.common.unsetAriaBusy(this.clientContext),e=this.promiseRegInput()}return e}},{key:"endSession",value:function(){this.common.clearContainer(this.clientContext)}},{key:"promiseAuthInput",value:function(){return this.promiseQuestionsInput()}},{key:"promiseRegInput",value:function(){return this.promiseQuestionsInput()}},{key:"promiseQuestionsInput",value:function(){var e=this;return new Promise(function(t,n){var i=e;new Promise(function(t,n){e.common.prependPageHeader(e.questionForm,e.title,t)}).then(function(n){e.common.clearContainer(e.clientContext),e.questionForm=null,t(n)}),e.askQuestions(function(e){var n=[];i.currentStep.getSecurityQuestions().forEach(function(t){var i=e[t.getSecurityQuestionId()];i&&n.push(com.ts.mobile.sdk.SecurityQuestionAndAnswer.createAnswerToQuestion(t,com.ts.mobile.sdk.SecurityQuestionAnswer.createWithText(i)))}),i.questionForm.fadeOut(function(){t(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(com.ts.mobile.sdk.SecurityQuestionInputResponse.createSecurityQuestionAnswersInputResponse(n)))})})})}},{key:"setInputStep",value:function(e,t,n){this.currentStep=n}},{key:"askQuestions",value:function(e){var t=this,n=this.questionForm.find(".xmuiSecurityQuestionList"),i=this.currentStep.getMinAnswersNeeded();this.currentStep.getSecurityQuestions().forEach(function(e){n.append($('<div class="xmuiSecurityQuestion">'+" ".concat(e.getSecurityQuestionText(),"?")+" <br/>"+' <input id="xmui_secq_'.concat(e.getSecurityQuestionId(),'" placeholder="Answer here"/>')+"</div>"))});var o=this.questionForm.find(".xmuiSubmitButton");o.click(function(t){o.off("click");var i={};return n.find("input").each(function(e,t){var n=t;i[n.id.substring(10)]=n.value}),n.find("input").toArray().forEach(function(e){$(e).replaceWith($("<span>").text(e.value))}),e(i),!1}),o.attr("disabled","disabled"),this.questionForm.find("input").on("input",function(e){var n=0;t.questionForm.find("input").each(function(e,t){t.value.length>0&&n++}),n>=i?o.removeAttr("disabled"):o.attr("disabled","disabled")}),this.questionForm.fadeIn()}}]),t}();t.SecurityQuestionAuthenticatorSession=l},function(e,t,n){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function r(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function a(e,t,n){return(a="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=s(e)););return e}(e,t);if(i){var o=Object.getOwnPropertyDescriptor(i,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(t,"__esModule",{value:!0});var c,l=n(0);!function(e){e[e.TargetSelection=0]="TargetSelection",e[e.PollingRequested=1]="PollingRequested",e[e.PollingStarted=2]="PollingStarted"}(c||(c={}));var d=function(e){function t(e,n,i,o){var a;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(a=r(this,s(t).call(this,e,n,o))).state=c.TargetSelection,a.pollingIntervalMillis=3e3,a.instructions=i,a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(t,l.BaseAuthenticatorSession),function(e,t,n){t&&o(e.prototype,t),n&&o(e,n)}(t,[{key:"setPollingIntervalInMillis",value:function(e){this.pollingIntervalMillis=e}},{key:"setCreatedApprovalInfo",value:function(e,t){null!=e?(this.createdForTargets=e,this.otp=t,this.state=c.PollingRequested):(this.createdForTargets=null,this.otp=null,this.state=c.TargetSelection,clearTimeout(this.pollingTimer),this.hidePendingUi())}},{key:"setAvailableTargets",value:function(e){this.availableTargets=e}},{key:"endSession",value:function(){clearTimeout(this.pollingTimer),this.common.clearContainer(this.clientContext)}},{key:"promiseInput",value:function(){var e=this;switch(this.mode){case com.ts.mobile.sdk.AuthenticatorSessionMode.Authentication:switch(this.common.setAriaBusy(this.clientContext),this.common.log("Fetching Mobile Approve authentication input;"),this.state){case c.TargetSelection:return this.promiseTargetSelectionInput();case c.PollingRequested:return this.state=c.PollingStarted,this.promisePendingUI().then(function(t){clearTimeout(e.pollingTimer),e.hidePendingUi(),e.currentPollingResolver?(e.currentPollingResolver(t),e.currentPollingResolver=null):e.pendingCancelRequest=t}),this.startPolling();case c.PollingStarted:return this.startPolling();default:return Promise.reject("Illegal state")}case com.ts.mobile.sdk.AuthenticatorSessionMode.Registration:throw new Error("Method not implemented.")}}},{key:"promiseTargetSelectionInput",value:function(){var e=this,t=$('<div class="xmuiCore xmuiForm xmuiMobileAuthSelectDeviceForm"> <div class="xmuiPrompt" data-xmui-customstringtext="mobileAuthDeviceSelection.selectDevices"/> <div class="xmuiFullHeightContentBelowPrompt xmuiAuthMobileDeviceSelection"> <div class="xmuiAuthMobileDeviceSelectionList"></div> <div style="align-items: center;"> <button class="xmuiLoginButton" type="submit" data-xmui-customstringtext="mobileAuthDeviceSelection.select"/> </div> </div> </div>'),n=t.find(".xmuiAuthMobileDeviceSelectionList"),i=t.find(".xmuiLoginButton"),o=t.find(".xmuiPrompt");return this.common.appendElement(t,this.clientContext),new Promise(function(r,a){e.availableTargets.forEach(function(e){var t=e.getDescription(),i=$("<input/>").attr({id:"xmui_device_"+t,name:"xmui_device_"+t,type:"checkbox"}).data("xmui_device_id",e),o=$("<label/>").attr("htmlFor","xmui_device_"+t).text(t).css("font-size","10pt");n.append(i).append(o).append($("<br/>"))}),i.click(function(){var n=[];t.find("input:checkbox:checked").each(function(e,t){n.push($(t).data("xmui_device_id"))}),n.length<=0?(o.text(e.common.resolveString("mobileApprove.deviceSelection.noneError")),o.addClass("xmuiPromptError"),o.attr("role","alert").attr("aria-label",e.common.resolveString("aria.noDeviceSelected"))):t.fadeOut(function(){var e=com.ts.mobile.sdk.TargetBasedAuthenticatorInput.createTargetsSelectionRequest(n);r(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(e))})}),e.common.prependPageHeader(t,e.title,r)}).then(function(t){return e.common.unsetAriaBusy(e.clientContext),e.common.clearContainer(e.clientContext),t})}},{key:"promisePendingUI",value:function(){var e=this,t=$('<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(n,i){e.common.appendElement(t,e.clientContext),t.find(".xmuiLoginInstructionsLabel").text(e.instructions),e.updateOtp(),e.common.prependPageHeader(t,e.title,n),e.common.unsetAriaBusy(e.clientContext),t.fadeIn()})}},{key:"updateOtp",value:function(){if(this.otp)switch(this.otp.getFormat().getType()){case com.ts.mobile.sdk.OtpFormatType.Numeric:var e=$(".xmuiMobileAuthForm").find(".xmuiOtpText");e.text(this.otp.getValue()),e.show();break;case com.ts.mobile.sdk.OtpFormatType.QrCode:var t=$(".xmuiMobileAuthForm").find(".xmuiOtpImg");t.attr("src","data:image/jpeg;base64,"+this.otp.getValue()),t.show();break;default:throw this.common.log("Unsupported otp format"),new Error("Unsupported otp format")}}},{key:"hidePendingUi",value:function(){this.common.unsetAriaBusy(this.clientContext),$(".xmuiMobileAuthForm").hide()}},{key:"promiseRecoveryForError",value:function(e,n,i){var o=this;return new Promise(function(r,u){o.hidePendingUi(),r(a(s(t.prototype),"promiseRecoveryForError",o).call(o,e,n,i))})}},{key:"startPolling",value:function(){var e=this;return new Promise(function(t,n){e.updateOtp(),e.pollingTimer=setTimeout(function(){e.currentPollingResolver=null,e.pendingCancelRequest?t(e.pendingCancelRequest):t(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(com.ts.mobile.sdk.TargetBasedAuthenticatorInput.createAuthenticatorInput(com.ts.mobile.sdk.MobileApproveInputRequestPolling.createRequestPollingInput())))},e.pollingIntervalMillis),e.currentPollingResolver=t})}},{key:"promiseAuthInput",value:function(){throw new Error("Method not implemented")}},{key:"promiseRegInput",value:function(){throw new Error("Method not implemented")}}]),t}();t.MobileApproveAuthenticatorSession=d},function(e,t,n){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function r(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function a(e,t,n){return(a="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=s(e)););return e}(e,t);if(i){var o=Object.getOwnPropertyDescriptor(i,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(t,"__esModule",{value:!0});var c=n(0),l=function(e){function t(e,n,i){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),r(this,s(t).call(this,e,n,i))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(t,c.BaseAuthenticatorSession),function(e,t,n){t&&o(e.prototype,t),n&&o(e,n)}(t,[{key:"setAvailableTargets",value:function(e){this.availableTargets=e}},{key:"setTargetDevices",value:function(e){this.targetDevices=e}},{key:"setChallenge",value:function(e){this.challenge=e}},{key:"promiseAuthInput",value:function(){return this.availableTargets&&!this.targetDevices?this.promiseTargetSelectionInput():this.promiseCodeInput()}},{key:"promiseRecoveryForError",value:function(e,n,i){if(e.getErrorCode()==com.ts.mobile.sdk.AuthenticationErrorCode.InvalidInput&&n.indexOf(com.ts.mobile.sdk.AuthenticationErrorRecovery.RetryAuthenticator)>=0){if(e.getPublicSymbolicProperty(com.ts.mobile.sdk.AuthenticationErrorProperty.AuthenticatorInvalidInputErrorDescription)==com.ts.mobile.sdk.AuthenticationErrorPropertySymbol.AuthenticatorInvalidInputErrorDescriptionTotpIncorrectCheckDigit)return this.common.log("Totp authentication failed due to invalid check-digit, starting recovery"),this.errorTooltip=this.common.resolveString("totp.invalidCheckDigit"),Promise.resolve(com.ts.mobile.sdk.AuthenticationErrorRecovery.RetryAuthenticator);this.errorTooltip=this.common.resolveString("totp.invalidSecret")}return a(s(t.prototype),"promiseRecoveryForError",this).call(this,e,n,i)}},{key:"promiseTargetSelectionInput",value:function(){var e=this,t=$('<div class="xmuiCore xmuiForm xmuiTotpSelectDeviceForm"> <div class="xmuiPrompt" data-xmui-customstringtext="totpDeviceSelection.selectDevices"/> <div class="xmuiFullHeightContentBelowPrompt xmuiAuthMobileDeviceSelection"> <div class="xmuiTotpDeviceSelectionList"></div> <div style="align-items: center;"> <button class="xmuiLoginButton" type="submit" data-xmui-customstringtext="mobileAuthDeviceSelection.select"/> </div> </div> </div>'),n=t.find(".xmuiTotpDeviceSelectionList"),i=t.find(".xmuiLoginButton"),o=t.find(".xmuiPrompt");return this.common.appendElement(t,this.clientContext),new Promise(function(r,a){e.availableTargets.forEach(function(e){var t=e.getDescription(),i=$("<input/>").attr({id:"xmui_device_"+t,name:"xmui_device_"+t,type:"checkbox"}).data("xmui_device_id",e),o=$("<label/>").attr("htmlFor","xmui_device_"+t).text(t).css("font-size","10pt");n.append(i).append(o).append($("<br/>"))}),i.click(function(){var n=[];t.find("input:checkbox:checked").each(function(e,t){n.push($(t).data("xmui_device_id"))}),n.length<=0?(o.text(e.common.resolveString("totp.deviceSelection.noneError")),o.addClass("xmuiPromptError"),o.attr("role","alert").attr("aria-label",e.common.resolveString("aria.noDeviceSelected"))):t.fadeOut(function(){var e=com.ts.mobile.sdk.TargetBasedAuthenticatorInput.createTargetsSelectionRequest(n);r(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(e))})}),e.common.prependPageHeader(t,e.title,r)})}},{key:"promiseCodeInput",value:function(){var e=this,t=$('<div class="xmuiCore xmuiForm xmuiTotpForm"><div class="xmuiErrorTooltip xmuiPromptError"/><div class="xmuiPrompt"/><div class="xmuiFullHeightContentBelowPrompt"><form onsubmit="return false"><div class="xmuiTotpChallenge" style="display:none;"><h5 data-xmui-customstringtext="totp.challengeHeader"></h5></div><div class="xmuiTotpInput"><input data-xmui-customstringtext-placeholder="totp.inputPlaceholder"/></div><div><button class="xmuiLoginButton" type="button" data-xmui-customstringtext="totp.loginButton"/></div></form></div></div>'),n=t.find("input"),i=t.find("button"),o=t.find(".xmuiTotpChallenge");return this.common.appendElement(t,this.clientContext),new Promise(function(r,a){var s;if(e.challenge){switch(e.challenge.getFormat().getType()){case com.ts.mobile.sdk.TotpChallengeFormatType.Numeric:case com.ts.mobile.sdk.TotpChallengeFormatType.AlphaNumeric:var u=$('<div class="xmuiTotpNumericChallenge">');u.text(e.challenge.getValue()),o.append(u);break;case com.ts.mobile.sdk.TotpChallengeFormatType.QrCode:var c=$("<img>");c.attr("src","data:image/jpeg;base64,"+e.challenge.getValue()),o.append($("<div>").append(c))}s=e.common.resolveString("totp.instructionsWithChallenge"),o.show()}else s=e.common.resolveString("totp.instructions");e.errorTooltip&&t.find(".xmuiErrorTooltip").text(e.errorTooltip),t.find(".xmuiPrompt").text(s),n.val(""),i.click(function(){t.fadeOut(function(){var e=com.ts.mobile.sdk.impl.TotpInputCodeSubmissionImpl.createTotpCodeSubmission(n.val().toString()),t=com.ts.mobile.sdk.TargetBasedAuthenticatorInput.createAuthenticatorInput(e);r(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(t))})}),e.common.prependPageHeader(t,e.title,r)})}},{key:"promiseRegInput",value:function(){throw new Error("Method not implemented.")}}]),t}();t.TotpAuthenticatorSession=l},function(e,t,n){"use strict";function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.pollingIntervalMillis=3e3,this.common=t}return function(e,t,n){t&&i(e.prototype,t),n&&i(e,n)}(e,[{key:"setWaitingTicket",value:function(e){this.ticketWaitInfo=e,this.ui&&this.loadTicketInfoToUi()}},{key:"startSession",value:function(e,t){this.clientContext=t,this.common.setAriaBusy(this.clientContext),this.ui=this.createUi(),this.loadTicketInfoToUi(),this.common.unsetAriaBusy(this.clientContext),this.ui.fadeIn()}},{key:"endSession",value:function(){this.common.clearContainer(this.clientContext),this.ui=null,this.abortPolling()}},{key:"promiseInput",value:function(){var e=this;return new Promise(function(t,n){e.currentInputPromiseResolver=function(n){return e.currentInputPromiseResolver=null,t(n)},e.startPolling()})}},{key:"startPolling",value:function(){var e=this;this.pollingTimer=setTimeout(function(){e.currentInputPromiseResolver&&e.currentInputPromiseResolver(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(com.ts.mobile.sdk.TicketWaitInput.createPollRequest())),e.pollingTimer=null},this.pollingIntervalMillis)}},{key:"abortPolling",value:function(){this.pollingTimer&&(clearTimeout(this.pollingTimer),this.pollingTimer=null)}},{key:"createUi",value:function(){var e=this,t=$('<div class="xmuiCore xmuiForm xmuiMobileAuthForm" style="display:none;"> <div class="xmuiFullHeightContentBelowPrompt"> <div class="xmuiLoginInstructionsLabel"></div> <div class="xmuiTicketText" style="display:none;"></div> <div> <img class="xmuiTicketImg" style="display:none;"/></img> </div> <div class="xmuiSpinner xmuiInProgress"></div> </div> </div>');return this.common.prependPageHeader(t,"ticketWait",function(t){e.currentInputPromiseResolver(t)}),this.common.appendElement(t,this.clientContext),t}},{key:"loadTicketInfoToUi",value:function(){if(this.ticketWaitInfo){if(this.ticketWaitInfo.getTicketId())try{switch(this.ticketWaitInfo.getTicketId().getFormat()){case com.ts.mobile.sdk.TicketIdFormat.Alphanumeric:var e=this.ui.find(".xmuiTicketText");e.text(this.ticketWaitInfo.getTicketId().getValue()),e.show();break;case com.ts.mobile.sdk.TicketIdFormat.Qr:var t=this.ui.find(".xmuiTicketImg");t.attr("src","data:image/jpeg;base64,"+this.ticketWaitInfo.getTicketId().getValue()),t.show();break;default:throw this.common.log("Unsupported ticket ID format"),new Error("Unsupported ticket ID format")}}catch(e){this.common.log("Error in loadTicketInfoToUi(), not displaying ticket : "+e)}this.ui.find(".xmuiLoginInstructionsLabel").text(this.ticketWaitInfo.getText()),this.ui.find(".xmuiPageHeader span").text(this.ticketWaitInfo.getTitle())}}}]),e}();t.TicketWaitSession=o},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function r(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s,u=a(n(3)),c=a(n(4)),l=function(){function e(){i(this,e),this.isLogEnabled=!0}return r(e,[{key:"resolveString",value:function(e){var t={"progress.pleaseWait":"Please wait...","authMenu.title":"Authentication","authMenu.selectAuthenticator":"Please select authentication method:","authMenu.methodTitle":"Authenticate with $method","configMenu.instructions":"Add, edit or remove authenticators","configMenu.title":"Authentication Options","password.inputPlaceholder":"Password","password.loginButton":"Sign In","password.prompt":"Please type your password","password.registration.prompt":"Please type a new password","password.registration.promptAgain":"Please type the new password again","password.registration.noMatch":"Passwords did not match. Try again","password.registration.continueButton":"Continue","password.registration.registerButton":"Confirm","question.prompt":"Please answer the following","question.submitButton":"Submit","otp.prompt":"Input OTP code","otp.codeInvalidated":"The code is no longer valid, please request a new one","otp.inputPlaceholder":"Input code here","otp.loginButton":"Login","otp.resendButton":"Resend OTP","totp.inputPlaceholder":"Input Time-Based Token code","totp.challengeHeader":"Challenge:","totp.loginButton":"Login","totp.instructions":"Please enter generated time-based token code here","totp.instructionsWithChallenge":"Please generate code using below challenge and enter generated code below","totp.invalidSecret":"Incorrect code, please restart code generation","totp.invalidCheckDigit":"Typing error detected - retype code","enroll.prompt":"Please scan the QR code below to bind your device.","enroll.continue":"Continue","mobileAuth.approvalPending":"Approval pending...","mobileAuthDeviceSelection.selectDevices":"Select devices for mobile approve:","mobileAuthDeviceSelection.select":"Select","mobileApprove.deviceSelection.noneError":"No device selected - please select at least one to continue","totpDeviceSelection.selectDevices":"Select devices for Time-Based Token:","totpDeviceSelection.select":"Select","totp.deviceSelection.noneError":"No device selected - please select at least one to continue","mobilePin.authPending":"Authentication pending...","mobilePin.registrationPending":"Waiting for completion of registration on your mobile device.","mobilePin.registrationInstructions":"Please complete registration on your mobile device.","mobilePin.registerPrompt":"Please type your mobile phone number","mobilePin.registerInputPlaceholder":"Mobile phone number","mobilePin.registerSubmitButton":"Register","mobilePin.authTitle":"Login with Clickable SMS","mobilePin.authAskMobilePrompt":"Please input the last 4 digits of your mobile device phone number to login","mobilePin.authAskMobileInputPlaceholder":"","mobilePin.authAskSubmitButton":"Continue","mobilePin.authCfmMobilePrompt":"Confirm login with your mobile device","mobilePin.loginWith":"Login with ******","otpTargetSelection.selectTarget":"Please select how you want us to deliver an OTP to you","error.xmapiError.invalidPassword":"Invalid password provided","error.xmapiError.invalidTotp":"Invalid code provided","error.xmapiError.invalidPattern":"Invalid pattern provided","error.xmapiError.invalidPin":"Invalid PIN provided","error.xmapiError.invalidOtp":"Invalid OTP provided","error.xmapiError.invalidVoice":"Invalid voice provided","error.xmapiError.approvalDenied":"Mobile approval denied","error.xmapiError.approvalExpired":"Mobile approval expired","error.xmapiError.allAuthenticatorsLocked":"All authenticators are locked","error.xmapiError.noRegisteredAuthenticator":"No registered authenticator is available","error.xmapiError.commError":"Protocol error","error.xmapiError.authRejected":"Access was rejected by server","error.xmapiError.authActionError":"Error occured while handling authentication assertion action","error.xmapiError.secretAlreadyUsed":"Secret has already been used","error.xmapiError.notEnoughAnswers":"Must have at least $count answers","error.xmapiError.corsOrInvalidHost":"Destination server is invalid or the server does not support access-control-allow-origin","error.xmapiError.sessionExpired":"Session has expired","methodName.password":"Password","methodName.voice_server":"Voice Passphrase","methodName.otp":"OTP","methodName.totp":"Time-Based Token","methodName.mobile_approve":"Mobile Approve","methodName.mobile_pin":"Clickable SMS","methodName.question":"Memorable Question","methodName.pattern_centralized":"Pattern","methodName.pin_centralized":"Pin","methodName.fido2":"FIDO2","otpMethodChannel.Sms":"SMS $target","otpMethodChannel.Email":"Email $target","otpMethodChannel.VoiceCall":"Voice call $target","otpMethodChannel.PushNotification":"Push Notification to $target","otpMethodChannel.Unknown":"External Provider $target","pattern.prompt":"Draw your pattern below","pattern.registerDrawPrompt":"Please draw a new pattern","pattern.registerDrawAgainPrompt":"Please draw the pattern again to confirm","pattern.registerTooShortErrorPrompt":"Pattern must be at least $length points long","pattern.registerNoMatchErrorPrompt":"Pattern do not match, please try again","pattern.registerRestartButton":"Start Over","pattern.registerContinueButton":"Continue","pin.prompt":"Input Pin code","pin.inputPlaceholder":"Input Pin code","pin.loginButton":"Login","pin.registration.prompt":"Please type a new PIN","pin.registration.promptAgain":"Please type the new PIN again","pin.registration.noMatch":"PINs did not match. Try again","pin.registration.badLength":"PIN should be $length digits long","pin.registration.digitsOnly":"PIN should contain digits only","pin.registration.continueButton":"Continue","pin.registration.registerButton":"Confirm","recoveryMenu.failed":"Authentication failed: $reason","recoveryMenu.locked":"Authenticator locked.","recoveryMenu.title":"Recovery","failureAction.Fail":"Cancel","failureAction.ChangeAuthenticator":"Change Authentication Method","failureAction.SelectAuthenticator":"Select Authentication Method","failureAction.RetryAuthenticator":"Retry","voice.prompt":"Please click the button below and speak the following phrase:","login.cancelButton":"Cancel","cancelMenu.title":"Cancel Action","cancelMenu.instructions":"Are you sure you want to cancel and go back?","cancelMenu.AbortAuthentication":"Yes","cancelMenu.RetryAuthenticator":"Try Again","cancelMenu.ChangeMethod":"Change Authentication Method","cancelMenu.SelectMethod":"Select Authentication Method","unregister.confirmation.title":"Unregister Authenticator","unregister.confirmation.instructions":"Are you sure you want to unregister $method authentication?","unregister.confirmation.summary":"Authenticator $method unregistered.","unregister.confirmation.continue":"Yes","unregister.confirmation.cancel":"Cancel","configMenu.error.title":"Configuration action failed","configMenu.error.continue":"Reload Menu","device.management.remove.title":"Remove Device","device.management.remove.instructions":"Are you sure you want to remove this device?","device.management.remove.summary":"Device $device has been removed","device.management.remove.continue":"Yes","device.management.remove.cancel":"Cancel","device.management.current.remove.instructions":"Please note you are about to remove the currently logged in device, this will terminate the current session, are you sure you want to continue?","user.management.title":"User Management","user.management.cancelButton":"Cancel","newUser.title":"New User","newUser.cancelButton":"Cancel","newUser.remember":"Remember me on this computer","fallbackMenu.instructions":"We have other authentication options you can choose from. If you continue failing you may get locked out so switching to another option is recommended.","fallbackMenu.title":"Having trouble logging in?","fallbackMenu.Fallback":"Switch to authentication with $method","fallbackMenu.AuthMenu":"Choose a different authenticator","fallbackMenu.Retry":"Go back and let me try again","fallbackMenu.Cancel":"Cancel authentication","removeUser.title":"Remove User","removeUser.text":"Are you sure you want to remove user: $user","removeUser.continue":"Yes","removeUser.cancel":"Cancel","promotion.skipButton":"Skip","aria.unregisterMethod":"Unregister $name","aria.reRegisterMethod":"Re-register $name","aria.registerMethod":"Register $name","aria.lockedMethod":"$name is locked","aria.expiredMethod":"$name has expired","aria.defaultMethod":"$name is set as default authentication method","aria.setDefaultMethod":"click to set $name as default authentication method","aria.existingUser":"Select existing user named: $name","aria.deleteExistingUser":"Delete saved user named: $name","aria.newUser":"Add a new user","aria.enterPassword":"Enter a new password","aria.enterPasswordAgain":"Enter new password again","aria.passwordsDontMatch":"Passwords don't match. Try again","aria.voiceRecordButton":"Start recording voice","aria.enterPin":"Enter a new PIN","aria.enterPinAgain":"Enter new PIN again","aria.pinsDontMatch":"Passwords don't match. Try again","aria.badPinLength":"Pin should be $length digits long","aria.noDeviceSelected":"No device selected"};return null!=t[e]?t[e]:e}},{key:"resolveRtStrings",value:function(){var e=this.resolveString;$("[data-xmui-customstringtext]").each(function(t,n){var i=$(n),o=i.attr("data-xmui-customstringtext"),r=e(o);i.text(r)}),["placeholder"].forEach(function(t){var n="data-xmui-customstringtext-"+t;$("["+n+"]").each(function(i,o){var r=$(o),a=r.attr(n),s=e(a);r.attr(t,s)})})}},{key:"reBind",value:function(e,t){(e.off||e.unbind).call(e,"click"),(e.on||e.bind).call(e,"click",t)}},{key:"setAriaBusy",value:function(t){e.getContainer(t).attr("aria-busy","true")}},{key:"unsetAriaBusy",value:function(t){e.getContainer(t).removeAttr("aria-busy")}},{key:"showProgressForm",value:function(t){var n=e.getContainer(t);if(!n.find(".xmuiInProgress").length){var i=$('<div class="xmuiCore xmuiForm xmuiProgressForm" aria-busy="true" role="alert"> <div class="xmuiSpinner"/> <span style="vertical-align:middle" data-xmui-customstringtext="progress.pleaseWait"></span> </div>');n.append(i),this.resolveRtStrings()}}},{key:"hideProgressForm",value:function(t){e.getContainer(t).find(".xmuiProgressForm").hide()}},{key:"prependPageHeader",value:function(e,t,n){var i=e.find(".xmuiPageHeader");i.length||(i=$('<div class="xmuiPageHeader"> <div> <span></span> <button role="button" data-xmui-customstringtext="login.cancelButton"></button> </div> </div>'),e.prepend(i)),i.find("span").text(this.resolveString("methodName.".concat(t))),i.find("button").click(function(){var e=com.ts.mobile.sdk.ControlRequest.create(com.ts.mobile.sdk.ControlRequestType.CancelAuthenticator);n(com.ts.mobile.sdk.InputOrControlResponse.createControlResponse(e))}),this.resolveRtStrings()}},{key:"promiseCancelAction",value:function(e,t){var n=this;e.indexOf(com.ts.mobile.sdk.ControlRequestType.ChangeMethod)>=0&&e.indexOf(com.ts.mobile.sdk.ControlRequestType.SelectMethod)>=0&&(e=e.filter(function(e){return e!=com.ts.mobile.sdk.ControlRequestType.ChangeMethod}));var i=e.map(function(e){var t=com.ts.mobile.sdk.ControlRequestType[e],i=com.ts.mobile.sdk.ControlRequest.create(e);return{classes:["xmuiCancelActionMenuItem","xmuiCancelMenu_"+t],title:n.resolveString("cancelMenu."+t),resp:i}});return this.promiseMenuInput(i,this.resolveString("cancelMenu.title"),this.resolveString("cancelMenu.instructions"),t).then(function(e){return e.resp})}},{key:"loadForms",value:function(e){var t=$('<div class="xmuiLoginTiles">');this.allFormElements.forEach(function(e){e.appendTo(t)}),t.appendTo(e),this.resolveRtStrings()}},{key:"resolveMethodTitle",value:function(e){return e.getAuthenticatorId().startsWith("placeholder_")||"fido2"===e.getAuthenticatorId()?e.getName():this.resolveString("methodName."+e.getAuthenticatorId())}},{key:"resolveMethodAuthenticateTitle",value:function(e){return this.resolveString("authMenu.methodTitle").replace("$method",this.resolveMethodTitle(e))}},{key:"clearContainer",value:function(t){var n=e.getContainer(t),i=n.html();return n.empty(),i}},{key:"restoreContainer",value:function(t,n){e.getContainer(t).html(n)}},{key:"appendElement",value:function(t,n){e.getContainer(n).append(t),this.resolveRtStrings()}},{key:"promiseMenuInput",value:function(e,t,n,i,o,r,a,u){var c=this,l=$('<div class="xmuiCore xmuiForm xmuiMenuForm" role="dialog" aria-labelledby="xmuiMenuTitle" aria-describedby="xmuiMenuInstructions" aria-hidden="true"> <div class="xmuiPageHeader"> <div> <span id="xmuiMenuTitle"></span> <button></button> </div> </div> <h1 id="xmuiMenuInstructions" class="xmuiPrompt"/> <div class="xmuiFullHeightContentBelowPrompt"> <div class="xmuiMenuItems" role="menu"></div> </div> </div>'),d=l.find(".xmuiPageHeader"),m=d.find("span"),h=d.find("button"),p=l.find(".xmuiPrompt"),f=function(e,t,n,o){var a=function(e,t,n,i,o){e.attr("aria-label",c.resolveString(n).replace("$name",t)),e.attr("role",i),e.attr("tabindex",o)},u=e.annunciators||[],d=$("<div>").addClass("xmuiMenuItemAnnunciators").appendTo(t);return u.forEach(function(t){var u=$("<div>").addClass("xmuiMenuItemAnnunciator").addClass(t);r&&function(e,t,n,o,r){var u={authenticator:e.authenticator};switch(t){case"xmuiMethodMenuAnnUnregister":u.action=s.Unregister,a(n,e.title,"aria.unregisterMethod","Button",o);break;case"xmuiMethodMenuAnnReRegister":u.action=s.Reregister,a(n,e.title,"aria.reRegisterMethod","Button",o);break;case"xmuiMehtodMenuAnnRegister":u.action=s.Register,a(n,e.title,"aria.registerMethod","Button",o);break;case"xmuiMethodMenuAnnLocked":a(n,e.title,"aria.lockedMethod","status",o);break;case"xmuiMehtodMenuAnnExpired":a(n,e.title,"aria.expiredMethod","status",o);break;case"xmuiMethodMenuAnnDefault":a(n,e.title,"aria.defaultMethod","status",o)}u.action&&n.click(function(){l.attr("aria-hidden","true"),l.fadeOut(function(){c.clearContainer(i),r(u)})})}(e,t,u,n,o),u.html(" "),d.append(u)}),t};return l.attr("aria-hidden","false"),this.appendElement(l,i),new Promise(function(d,g){l.find(".xmuiMenuItems").empty(),o?(p.text(o),p.addClass("xmuiPromptError")):(p.text(n),p.removeClass("xmuiPromptError")),m.text(t);var v=0;e.forEach(function(e){var t=$('<div class="xmuiMenuItem xmuiAuthenticatorMenuItem">'),n=$('<span class="xmuiMethodMenuItemText" role="button"></span>');n.text(e.title),t.append(n),e.classes.forEach(function(e){t.addClass(e)}),v+=1,n.attr("tabindex",v),e.disabled?function(e,t){e.addClass("xmuiMenuItemDisabled"),t.attr("aria-disabled","true")}(t,n):(n.attr("aria-label",r?c.resolveString("aria.setDefaultMethod").replace("$name",e.title):e.title),n.click(function(){l.attr("aria-hidden","true"),l.fadeOut(function(){c.clearContainer(i),d(r?{authenticator:e.authenticator,action:s.SetDefault}:e)})})),e.annunciators&&(t=f(e,t,v,d)),l.find(".xmuiMenuItems").append(t)}),a?(h.text(u||c.resolveString("login.cancelButton")),h.click(function(){l.attr("aria-hidden","true"),c.clearContainer(i),d({abortSelection:!0})})):h.hide(),c.unsetAriaBusy(i)})}},{key:"promiseRecoveryForError",value:function(e,t,n,i){var o=this,r=e.getMessage(),a=e.getData();a&&a.additional_data&&a.additional_data.locked&&(r="Authenticator locked: ".concat(r)),t.indexOf(com.ts.mobile.sdk.AuthenticationErrorRecovery.ChangeAuthenticator)>=0&&t.indexOf(com.ts.mobile.sdk.AuthenticationErrorRecovery.SelectAuthenticator)>=0&&(t=t.filter(function(e){return e!=com.ts.mobile.sdk.AuthenticationErrorRecovery.ChangeAuthenticator}));var s=t.map(function(e){var t=com.ts.mobile.sdk.AuthenticationErrorRecovery[e];return{classes:["xmuiAuthRecoveryMenuItem","xmuiRecoveryMenu_"+t],title:o.resolveString("failureAction."+t),resp:e}});return this.promiseMenuInput(s,this.resolveString("recoveryMenu.title"),null,i,r).then(function(e){return e.resp})}},{key:"methodMenuPromise",value:function(e,t){var n=this;return new Promise(function(i,o){var r=e.map(function(e){var t=e.getAuthenticator();return{disabled:!t.getEnabled()||t.getLocked()||!t.getRegistered(),classes:["xmuiMethodMenuItem","xmuiMethodMenu_"+t.getType()],annunciators:function(e){var t=[];return e.getDefaultAuthenticator()&&t.push("xmuiMethodMenuAnnDefault"),e.getLocked()&&t.push("xmuiMethodMenuAnnLocked"),t}(t),title:n.resolveMethodAuthenticateTitle(t),method:t}});return n.promiseMenuInput(r,n.resolveString("authMenu.title"),n.resolveString("authMenu.selectAuthenticator"),t,null,!1,!0).then(function(e){e.abortSelection?i(com.ts.mobile.sdk.AuthenticatorSelectionResult.createAbortRequest()):i(com.ts.mobile.sdk.AuthenticatorSelectionResult.createSelectionRequest(e.method))})})}},{key:"registrationPromotionMethodSelectionPromise",value:function(e,t){var n=this,i=e.map(function(e){return{classes:["xmuiMethodMenuItem","xmuiMethodMenu_"+e.getType()],title:n.resolveMethodTitle(e),method:e}});return this.promiseMenuInput(i,this.resolveString("authMenu.title"),this.resolveString("authMenu.selectAuthenticator"),t,null,!1,!0,this.resolveString("promotion.skipButton")).then(function(e){return e.abortSelection?com.ts.mobile.sdk.PromotionInput.createControlResponse(com.ts.mobile.sdk.PromotionControlRequest.Skip):com.ts.mobile.sdk.PromotionInput.createAuthenticatorDescription(e.method)})}},{key:"methodFallbackPromise",value:function(e,t,n){var i=this,o=e.map(function(e){var n=i.resolveString("fallbackMenu."+com.ts.mobile.sdk.AuthenticatorFallbackAction[e]);if(e===com.ts.mobile.sdk.AuthenticatorFallbackAction.Fallback){if(!t)throw new Error("Fallback is an option for fallback but no fallback authenticator is defined on action");n=n.replace("$method",t.getName())}return{classes:["xmuiFallbackOptionsMenuItem","xmuiFallbackMenu_"+com.ts.mobile.sdk.AuthenticatorFallbackAction[e]],title:n,resp:e}});return this.promiseMenuInput(o,this.resolveString("fallbackMenu.title"),this.resolveString("fallbackMenu.instructions"),n).then(function(e){return e.resp})}},{key:"configurationSession",value:function(e){var t=this;return new(function(){function e(t){i(this,e),this.common=t}return r(e,[{key:"setAuthenticatorsList",value:function(e){var n=this,i=e.map(function(e){var n=e.getDescription();return{method:n,title:t.resolveMethodTitle(n),classes:["xmuiMethodMenuItem","xmuiMethodMenu_"+n.getAuthenticatorId()],annunciators:function(e,t){var n=[];return e.getDefaultAuthenticator()&&n.push("xmuiMethodMenuAnnDefault"),e.getLocked()&&n.push("xmuiMethodMenuAnnLocked"),e.getRegistered()?(t.indexOf(com.ts.mobile.sdk.AuthenticatorConfigurationAction.Reregister)>-1&&n.push("xmuiMethodMenuAnnReRegister"),t.indexOf(com.ts.mobile.sdk.AuthenticatorConfigurationAction.Unregister)>-1&&n.push("xmuiMethodMenuAnnUnregister")):t.indexOf(com.ts.mobile.sdk.AuthenticatorConfigurationAction.Register)>-1&&n.push("xmuiMehtodMenuAnnRegister"),e.getExpired()&&n.push("xmuiMehtodMenuAnnExpired"),n}(n,e.getAvailableActions()),authenticator:e}});t.promiseMenuInput(i,t.resolveString("configMenu.title"),t.resolveString("configMenu.instructions"),this.clientContext,null,!0).then(function(e){if(!e.abortSelection){var i;switch(e.action){case s.SetDefault:i=n.authentiocationConfigurationSessionServices.setDefaultAuthenticator(e.authenticator);break;case s.Register:i=n.authentiocationConfigurationSessionServices.registerAuthenticator(e.authenticator,n.clientContext).then(function(){n.authentiocationConfigurationSessionServices.setDefaultAuthenticator(e.authenticator)});break;case s.Reregister:i=n.authentiocationConfigurationSessionServices.reregisterAuthenticator(e.authenticator,n.clientContext).then(function(){n.authentiocationConfigurationSessionServices.setDefaultAuthenticator(e.authenticator)});break;case s.Unregister:i=u.default(n.common.resolveString("unregister.confirmation.title"),n.common.resolveString("unregister.confirmation.instructions").replace("$method",n.common.resolveMethodTitle(e.authenticator.getDescription())),n.common.resolveString("unregister.confirmation.continue"),n.common.resolveString("unregister.confirmation.cancel"),n.actionContext,n.clientContext,t).then(function(t){return 0===t.getUserChoice()?n.authentiocationConfigurationSessionServices.unregisterAuthenticator(e.authenticator,n.clientContext):Promise.resolve(!0)})}return i.then(function(){t.clearContainer(n.clientContext),n.authentiocationConfigurationSessionServices.requestRefreshAuthenticators()})}n.authentiocationConfigurationSessionServices.finishSession()}).catch(function(e){c.default(n.common.resolveString("configMenu.error.title"),e.getMessage(),n.common.resolveString("configMenu.error.continue"),n.actionContext,n.clientContext,t).then(function(t){-1===t.getUserChoice()&&(e.getErrorCode()==com.ts.mobile.sdk.AuthenticationErrorCode.PolicyRejection?(n.authentiocationConfigurationSessionServices.finishSession(),window.location.reload()):n.authentiocationConfigurationSessionServices.requestRefreshAuthenticators())})})}},{key:"startSession",value:function(e,n,i){this.authentiocationConfigurationSessionServices=e,this.actionContext=n,this.clientContext=i,t.log("Starting configuration session")}},{key:"endSession",value:function(){t.log("Ending configuration session")}}]),e}())(this)}},{key:"deviceManagementPromise",value:function(e,t){var n=this,i=$('<div class="xmuiCore xmuiForm xmuiMenuForm" role="dialog" aria-labelledby="xmuiMenuTitle" aria-describedby="xmuiMenuInstructions" aria-hidden="false"> <div class="xmuiPageHeader"> <div> <span id="xmuiMenuTitle">Device Management</span> </div> </div> <h1 id="xmuiMenuInstructions" class="xmuiPrompt">Name, Remove and view device details</h1> <div class="xmuiFullHeightContentBelowPrompt"> <div class="xmuiMenuItems" role="menu"></div> </div> </div>'),o=0;return this.appendElement(i,t),new Promise(function(r,a){e.forEach(function(e){var a=$('<div class="xmuiDeviceItemBackground xmuiDeviceInfoItem">'),s=function(){return $('<span class="xmuiMethodMenuItemText" role="button"></span>')},u=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return $('<div class="xmuiDeviceAction" tabindex="'.concat(e,'"> </div>'))},c=function(e){return new Date(e).toISOString().split("T")[0]},l=e.getInfo();a.append(s().addClass("xmuiDeviceInfoMain").text(l.getName())),a.append(s().addClass("xmuiDeviceInfoSecondary").text("Last access: ".concat(c(l.getLastAccess())))),a.append(s().addClass("xmuiDeviceInfoSecondary").text("Registered at: ".concat(c(l.getRegistered()))));var d=$('<div class="xmuiDeviceItemActions">');l.getIsCurrent()&&d.append($('<span class="xmuiDeviceActive">current</span>'));var m=u(o).addClass("xmuiDeviceItemRemove").click(function(){i.fadeOut(function(){n.clearContainer(t),r({action:com.ts.mobile.sdk.DeviceManagementAction.Remove,device:e})})}),h=u(o).addClass("xmuiDeviceItemRename").click(function(){i.fadeOut(function(){n.clearContainer(t),r({action:com.ts.mobile.sdk.DeviceManagementAction.Rename,device:e})})});d.append(m),d.append(h),a.append(d),a.attr("tabindex",o),o+=1,i.find(".xmuiMenuItems").append(a)})})}},{key:"deviceRename",value:function(e,t){var n=this,i=$('<div class="xmuiCore xmuiForm xmuiConfirmationForm"> <div class="xmuiPageHeader"> <div> <span class="xmuiConfirmationTitle">Rename Device</span> </div> </div> <div class="xmuiFullHeightContentBelowPrompt"> <div class="xmuiConfirmationText"/>Please enter new device name<br/> <div> <input class="xmuiDeviceName" type="text" placeholder="New device name"/><br/> <button class="xmuiConfirmationContinueButton" type="button">Save</button> <button class="xmuiConfirmationCancelButton" type="button">Cancel</button> </div> </div> </div>');return this.appendElement(i,t),this.setAriaBusy(t),new Promise(function(e,o){i.find(".xmuiConfirmationContinueButton").click(function(){i.fadeOut(function(){n.clearContainer(t);var o=i.find(".xmuiDeviceName").val();e({save:!0,newDeviceName:o})})}),i.find(".xmuiConfirmationCancelButton").click(function(){i.fadeOut(function(){n.clearContainer(t),e({save:!1})})}),n.unsetAriaBusy(t)})}},{key:"deviceManagementSession",value:function(e){var t=this;return new(function(){function e(t){i(this,e),this.common=t}return r(e,[{key:"setSessionDevicesList",value:function(e){this.devices=e}},{key:"viewDevices",value:function(){var e,n=this;t.deviceManagementPromise(this.devices,this.clientContext).then(function(i){switch(i.action){case com.ts.mobile.sdk.DeviceManagementAction.Remove:var o=i.device.getInfo().getIsCurrent(),r=o?r=n.common.resolveString("device.management.current.remove.instructions"):n.common.resolveString("device.management.remove.instructions").replace("$device",i.device.getInfo().getName());e=u.default(n.common.resolveString("device.management.remove.title"),r,n.common.resolveString("device.management.remove.continue"),n.common.resolveString("device.management.remove.cancel"),n.actionContext,n.clientContext,t).then(function(e){return 0===e.getUserChoice()?o?n.deviceManagementSessionService.removeCurrentDeviceAndFinishSession(n.clientContext):n.deviceManagementSessionService.removeDevice(i.device,n.clientContext):Promise.resolve(!0)});break;case com.ts.mobile.sdk.DeviceManagementAction.Rename:e=t.deviceRename(i.device,n.clientContext).then(function(e){return e.save?n.deviceManagementSessionService.renameDevice(i.device,e.newDeviceName,n.clientContext):Promise.resolve(!0)})}return e.then(function(){t.clearContainer(n.clientContext),n.deviceManagementSessionService.requestRefreshDevices().then(function(){return n.viewDevices()})})}).catch(function(e){c.default(n.common.resolveString("configMenu.error.title"),e.getMessage(),n.common.resolveString("configMenu.error.continue"),n.actionContext,n.clientContext,t).then(function(t){-1===t.getUserChoice()&&(e.getErrorCode()==com.ts.mobile.sdk.AuthenticationErrorCode.PolicyRejection?(n.deviceManagementSessionService.finishSession(),window.location.reload()):n.deviceManagementSessionService.requestRefreshDevices().then(function(){return n.viewDevices()}))})})}},{key:"startSession",value:function(e,t,n){this.deviceManagementSessionService=e,this.actionContext=t,this.clientContext=n,this.viewDevices()}},{key:"endSession",value:function(){t.log("Ending device management session")}}]),e}())(this)}},{key:"setLogEnabled",value:function(e){this.isLogEnabled=e}},{key:"log",value:function(e){this.isLogEnabled&&console.log(e)}}],[{key:"getContainer",value:function(e){var t;return t=e&&e.uiContainer?e.uiContainer:$("#transmitContainer").length?$("#transmitContainer").first():$(document.documentElement).append($('<div id="transmitContainer" style="position: absolute; left: 0; top: 0;"></div>')),(t=$(t)).attr("aria-live","assertive"),t}}]),e}();t.XmUiCommon=l,function(e){e[e.SetDefault=0]="SetDefault",e[e.Register=1]="Register",e[e.Reregister=2]="Reregister",e[e.Unregister=3]="Unregister"}(s||(s={}))}])}); ;var KeyBindIdAuthSession=function(){function e(e,t,n,o,i,r){this._window=window,this.qrCodeHandler=new KeyBindIdQRCodeHandler}return e.prototype.startSession=function(e,t,n,o){this.description=e,this.mode=t,this.actionContext=n,this.clientContext=o},e.prototype.changeSessionModeToRegistrationAfterExpiration=function(){},e.prototype.promiseRecoveryForError=function(e,t,n){return new Promise(function(t,o){n===this._window.com.ts.mobile.sdk.AuthenticationErrorRecovery.RetryAuthenticator?confirm(e.getMessage()+", would you like to try again ??")?t(n):t(this._window.com.ts.mobile.sdk.AuthenticationErrorRecovery.Fail):t(n)})},e.prototype.promiseInput=function(){var e=this,t=e.mode==this._window.com.ts.mobile.sdk.AuthenticatorSessionMode.Authentication?"authentication":"registration";return new Promise(function(n,o){var i=this;this._window.sendMessageToHandler(JSON.stringify({session:"BINDID_STEPUP",message:{sessionId:KeyUIHandler.sessionId,uiHandlerConfig:KeyUIHandler.uiHandlerConfig,mode:t,error:this.error},channel:"WEB"})),"authentication"==t&&(e._window.KeyJSInterface={},e._window.KeyJSInterface.onOpenBindId=function(t){e.renderQRCodeWithPopUpBlockerHandling()},e._window.KeyJSInterface.bindCodeErrorResponse=function(e){var t={message:"Answer does not match to what we have on file",errorCode:453,failure_data:{reason:{data:{policyResponseStatus:"BINDID_AUTH_FAILURE"}}}},o=i._window.com.ts.mobile.sdk.AuthenticationError.createApplicationGeneratedCommunicationError(t.toString(),t),r=i._window.com.ts.mobile.sdk.PlaceholderInputResponse.createdFailedResponse(i.description,o);n(i._window.com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(r))},e._window.KeyJSInterface.submitBindIdCode=function(t){e._window.resetUiHandler(),console.log("Sending this response -> ",t);var o=e._window.com.ts.mobile.sdk.PlaceholderInputResponse.createSuccessResponse(t),i=e._window.com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(o);n(i)},e._window.KeyJSInterface.onBindIDCancel=function(t){console.log("Bind ID cancel "),e._window.resetUiHandler(),e._window.amtWebSdk.additionalResponse="";var o=e._window.com.ts.mobile.sdk.ControlRequest.create(e._window.com.ts.mobile.sdk.ControlRequestType.SelectMethod);n(e._window.com.ts.mobile.sdk.InputOrControlResponse.createControlResponse(o))},e.renderQRCodeWithPopUpBlockerHandling())})},e.prototype.renderQRCodeWithPopUpBlockerHandling=function(){var e=this;this.qrCodeHandler||(this.qrCodeHandler=new KeyBindIdQRCodeHandler),this.qrCodeHandler.renderKeyBindIdQRCodeWindow().then(function(t){console.log("BindID success response ",t),e._window.KeyJSInterface.submitBindIdCode(t)},function(t){console.log("BindID Failure response ",t),e._window.KeyJSInterface.bindCodeErrorResponse(t)})},e.prototype.endSession=function(){},e}(),KeyBindIdQRCodeHandler=function(){function e(){}return e.prototype.isQROnDisplay=function(){return!(!this.qrCodeWindowRef||this.qrCodeWindowRef.closed)},e.prototype.uuidv4=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})},e.prototype.isFoundIn=function(e,t){var n=void 0;return e&&Array.isArray(e)&&(n=e.find(function(e){return e.toLowerCase()==t.toLowerCase()})),!!n},e.prototype.isProdBindId=function(){return!!this.isFoundIn(["ibx.key.com","ibxpreview.key.com","laurelroad.key.com","laurelroadpreview.key.com"],window.location.hostname)},e.prototype.onlrdDomain=function(){return window.location.hostname.indexOf("laurelroad")>=0},e.prototype.constructBindIdWindowUrl=function(){var e=this.uuidv4(),t=this.uuidv4(),n="signin.bindid-sandbox.io",o="4bf94dee.f78ba78e.tid_d811f983.bindid.io";this.onlrdDomain()&&(o="32fd796d.9f200d38.tid_d811f983.bindid.io"),this.isProdBindId()&&(n="signin.identity.security",o="5561faa5.36e8cf34.KeyBank.bindid.io",this.onlrdDomain()&&(o="c1185d07.f7d0d828.KeyBank.bindid.io"));return"https://"+n+"/authorize?client_id="+o+"&redirect_uri=https%3A%2F%2F"+window.location.hostname+"%2Fibxolb%2Flogin%2Findex.html%3Fauthstatus%3Dbindidcompleted&response_type=code&scope=openid%20email%20bindid_network_info%20phone&state="+e+"&nonce="+t+"&display=page&prompt=login&response_mode=query&acr_values=ts.bindid.iac.phone_number%20ts.bindid.iac.email"},e.prototype.renderKeyBindIdQRCodeWindow=function(){var e=this;return new Promise(function(t,n){var o=e.constructBindIdWindowUrl();function i(e){console.log("receiveMessage called"),console.log(e),e.origin&&(e.origin.indexOf("key.com")>0||e.origin.indexOf("keybank.com")>0)?("success"==e.data.status?t(e.data.code):(console.log("ERROR ************ "),console.log("Bind ID response error ",e),n(e)),window.removeEventListener("message",i,!1)):console.log("Unknown origin .. ignoring",e.origin)}this.qrCodeWindowRef=window.open(o,"KeyAuthentication","location=no,toolbar=no, menubar=no, width=600, height=750, top=150, left=20"),this.qrCodeWindowRef&&this.qrCodeWindowRef.focus(),window.removeEventListener("message",i,!1),window.addEventListener("message",function(e){return i(e)},!1)})},e}(),KeyCommon=function(){function e(){}return e.prototype.resolveString=function(e){var t={"progress.pleaseWait":"Please wait...","authMenu.title":"Authentication","authMenu.selectAuthenticator":"Please select authentication method:","authMenu.methodTitle":"Authenticate with $method","configMenu.instructions":"Add, edit or remove authenticators","configMenu.title":"Authentication Options","password.inputPlaceholder":"Password","password.loginButton":"Sign In","password.prompt":"Please type your password","password.registration.prompt":"Please type a new password","password.registration.promptAgain":"Please type the new password again","password.registration.noMatch":"Passwords did not match. Try again","password.registration.continueButton":"Continue","password.registration.registerButton":"Confirm","question.prompt":"Please answer the following","question.submitButton":"Submit","otp.prompt":"Input OTP code","otp.inputPlaceholder":"Input code here","otp.loginButton":"Login","otp.resendButton":"Resend OTP","totp.inputPlaceholder":"Input Time-Based Token code","totp.challengeHeader":"Challenge:","totp.loginButton":"Login","totp.instructions":"Please enter generated time-based token code here","totp.instructionsWithChallenge":"Please generate code using below challenge and enter generated code below","enroll.prompt":"Please scan the QR code below to bind your device.","enroll.continue":"Continue","mobileAuth.approvalPending":"Approval pending...","mobileAuthDeviceSelection.selectDevices":"Select devices for mobile approve:","mobileAuthDeviceSelection.select":"Select","mobileApprove.deviceSelection.noneError":"No device selected - please select at least one to continue","totpDeviceSelection.selectDevices":"Select devices for Time-Based Token:","totpDeviceSelection.select":"Select","totp.deviceSelection.noneError":"No device selected - please select at least one to continue","mobilePin.authPending":"Authentication pending...","mobilePin.registrationPending":"Waiting for completion of registration on your mobile device.","mobilePin.registrationInstructions":"Please complete registration on your mobile device.","mobilePin.registerPrompt":"Please type your mobile phone number","mobilePin.registerInputPlaceholder":"Mobile phone number","mobilePin.registerSubmitButton":"Register","mobilePin.authTitle":"Login with Clickable SMS","mobilePin.authAskMobilePrompt":"Please input the last 4 digits of your mobile device phone number to login","mobilePin.authAskMobileInputPlaceholder":"","mobilePin.authAskSubmitButton":"Continue","mobilePin.authCfmMobilePrompt":"Confirm login with your mobile device","mobilePin.loginWith":"Login with ******","otpTargetSelection.selectTarget":"Select target for OTP:","error.xmapiError.invalidPassword":"Invalid password provided","error.xmapiError.invalidTotp":"Invalid code provided","error.xmapiError.invalidPattern":"Invalid pattern provided","error.xmapiError.invalidPin":"Invalid PIN provided","error.xmapiError.invalidOtp":"Invalid OTP provided","error.xmapiError.invalidVoice":"Invalid voice provided","error.xmapiError.approvalDenied":"Mobile approval denied","error.xmapiError.approvalExpired":"Mobile approval expired","error.xmapiError.allAuthenticatorsLocked":"All authenticators are locked","error.xmapiError.noRegisteredAuthenticator":"No registered authenticator is available","error.xmapiError.commError":"Protocol error","error.xmapiError.authRejected":"Access was rejected by server","error.xmapiError.authActionError":"Error occured while handling authentication assertion action","error.xmapiError.secretAlreadyUsed":"Secret has already been used","error.xmapiError.notEnoughAnswers":"Must have at least $count answers","error.xmapiError.corsOrInvalidHost":"Destination server is invalid or the server does not support access-control-allow-origin","error.xmapiError.sessionExpired":"Session has expired","methodName.password":"Password","methodName.voice_server":"Voice Passphrase","methodName.otp":"OTP","methodName.totp":"Time-Based Token","methodName.mobile_approve":"Mobile Approve","methodName.mobile_pin":"Clickable SMS","methodName.question":"Memorable Question","methodName.pattern_centralized":"Pattern","methodName.pin_centralized":"Pin","otpMethodChannel.Sms":"SMS $target","otpMethodChannel.Email":"Email $target","otpMethodChannel.VoiceCall":"Voice call $target","otpMethodChannel.Unknown":"External Provider $target","pattern.prompt":"Draw your pattern below","pattern.registerDrawPrompt":"Please draw a new pattern","pattern.registerDrawAgainPrompt":"Please draw the pattern again to confirm","pattern.registerTooShortErrorPrompt":"Pattern must be at least $length points long","pattern.registerNoMatchErrorPrompt":"Pattern do not match, please try again","pattern.registerRestartButton":"Start Over","pattern.registerContinueButton":"Continue","pin.prompt":"Input Pin code","pin.inputPlaceholder":"Input Pin code","pin.loginButton":"Login","pin.registration.prompt":"Please type a new PIN","pin.registration.promptAgain":"Please type the new PIN again","pin.registration.noMatch":"PINs did not match. Try again","pin.registration.badLength":"PIN should be $length digits long","pin.registration.digitsOnly":"PIN should contain digits only","pin.registration.continueButton":"Continue","pin.registration.registerButton":"Confirm","recoveryMenu.failed":"Authentication failed: $reason","recoveryMenu.locked":"Authenticator locked.","recoveryMenu.title":"Recovery","failureAction.Fail":"Cancel","failureAction.ChangeAuthenticator":"Change Authentication Method","failureAction.SelectAuthenticator":"Select Authentication Method","failureAction.RetryAuthenticator":"Retry","voice.prompt":"Please click the button below and speak the following phrase:","login.cancelButton":"Cancel","cancelMenu.title":"Cancel Action","cancelMenu.instructions":"Are you sure you want to cancel and go back?","cancelMenu.AbortAuthentication":"Yes","cancelMenu.RetryAuthenticator":"Try Again","cancelMenu.ChangeMethod":"Change Authentication Method","cancelMenu.SelectMethod":"Select Authentication Method","unregister.confirmation.title":"Unregister Authenticator","unregister.confirmation.instructions":"Are you sure you want to unregister $method authentication?","unregister.confirmation.continue":"Yes","unregister.confirmation.cancel":"Cancel","configMenu.error.title":"Configuration action failed","configMenu.error.continue":"Reload Menu","user.management.title":"User Management","user.management.cancelButton":"Cancel","newUser.title":"New User","newUser.cancelButton":"Cancel","newUser.remember":"Remember me on this computer","fallbackMenu.instructions":"We have other authentication options you can choose from. If you continue failing you may get locked out so switching to another option is recommended.","fallbackMenu.title":"Having trouble logging in?","fallbackMenu.Fallback":"Switch to authentication with $method","fallbackMenu.AuthMenu":"Choose a different authenticator","fallbackMenu.Retry":"Go back and let me try again","fallbackMenu.Cancel":"Cancel authentication","removeUser.title":"Remove User","removeUser.text":"Are you sure you want to remove user: $user","removeUser.continue":"Yes","removeUser.cancel":"Cancel","promotion.skipButton":"Skip","aria.unregisterMethod":"Unregister $name","aria.reRegisterMethod":"Re-register $name","aria.registerMethod":"Register $name","aria.lockedMethod":"$name is locked","aria.expiredMethod":"$name has expired","aria.defaultMethod":"$name is set as default authentication method","aria.setDefaultMethod":"click to set $name as default authentication method","aria.existingUser":"Select existing user named: $name","aria.deleteExistingUser":"Delete saved user named: $name","aria.newUser":"Add a new user","aria.enterPassword":"Enter a new password","aria.enterPasswordAgain":"Enter new password again","aria.passwordsDontMatch":"Passwords don't match. Try again","aria.voiceRecordButton":"Start recording voice","aria.enterPin":"Enter a new PIN","aria.enterPinAgain":"Enter new PIN again","aria.pinsDontMatch":"Passwords don't match. Try again","aria.badPinLength":"Pin should be $length digits long","aria.noDeviceSelected":"No device selected"};return null!=t[e]?t[e]:e},e}(),KeyConfirmationDialogSession=function(){function e(e,t,n,o,i,r){this._window=window,this.title=e,this.dialogText=t,this.continueLabel=n,this.cancelLabel=o,this.actionContext=i,this.clientContext=r}return e.prototype.showConfirmationDialog=function(){var e=this;this._window.amtUiContainer=this.clientContext.uiContainer;var t={title:this.title,dialogText:this.dialogText,continueLabel:this.continueLabel,cancelLabel:this.cancelLabel};return new Promise(function(n,o){e._window.sendMessageToHandler(JSON.stringify({session:"CONFIRMATION_DIALOG",message:{dialog:t,uiHandlerConfig:KeyUIHandler.uiHandlerConfig},channel:"WEB"})),e._window.KeyJSInterface={},e._window.KeyJSInterface.onContinue=function(t){e._window.resetUiHandler(),n(e._window.com.ts.mobile.sdk.ConfirmationInput.create(0))},e._window.KeyJSInterface.onCancel=function(t){e._window.resetUiHandler(),n(e._window.com.ts.mobile.sdk.ConfirmationInput.create(1))}})},e}(),KeyFormInputSession=function(){function e(e,t){this._window=window,this.errorCount=0,this.formContext=e,this.userName=t.userId,this.payload=t}return e.prototype.startSession=function(e,t){this.clientContext=e,this.actionContext=t},e.prototype.endSession=function(){this._window.resetUiHandler()},e.prototype.onContinue=function(e){},e.prototype.onError=function(e){this.errorCount=this.errorCount+1,this.error=e},e.prototype.promiseFormInput=function(){var e=this,t=this.clientContext.uiContainer;this._window.amtUiContainer=t;var n="CHANGE_PASSWORD";switch(this.formContext){case"Bind_Id_Registration_Form":case"bindid":n="BINDID_REGISTRATION";break;case"Forgot_UserId_Session":n="FORGOT_USERID";break;case"phone_dob_auth":n="PHONE_DOB_AUTH";break;case"Prospect_Create_Account":n="PROSPECT_CREATE";break;default:n="CHANGE_PASSWORD"}return"PHONE_DOB_AUTH"==n&&this.errorCount>2||"PROSPECT_CREATE"==n&&this.errorCount>4?(this._window.resetUiHandler(),this._window.amtWebSdk.additionalResponse=0,new Promise(function(t,n){t(e._window.com.ts.mobile.sdk.FormInput.createFormCancellationRequest())})):new Promise(function(t,o){e._window.sendMessageToHandler(JSON.stringify({session:n,message:{appId:KeyUIHandler.appId,formContext:e.formContext,userId:e.userName,sessionId:KeyUIHandler.sessionId,uiHandlerConfig:KeyUIHandler.uiHandlerConfig,error:e.error},channel:"WEB"})),e.error="",e._window.KeyJSInterface={},e._window.KeyJSInterface.onOpenBindId=function(t){e.renderQRCodeForRegistration()},e._window.KeyJSInterface.bindIdRegisterFormSessionSubmit=function(n){t(e._window.com.ts.mobile.sdk.FormInput.createFormInputSubmissionRequest(n))},e._window.KeyJSInterface.bindIdRegisterError=function(n){e._window.resetUiHandler(),console.log("TODO: handle this as error ",n),t(e._window.com.ts.mobile.sdk.FormInput.createFormCancellationRequest())},e._window.KeyJSInterface.bindIdRegisterFormSessionCancel=function(n){e._window.resetUiHandler(),e._window.amtWebSdk.additionalResponse=0,t(e._window.com.ts.mobile.sdk.FormInput.createFormCancellationRequest())},e._window.KeyJSInterface.pwdChangeFormSessionSubmit=function(n){n=JSON.parse(n),t(e._window.com.ts.mobile.sdk.FormInput.createFormInputSubmissionRequest({oldPassword:n.currentPassword,newPassword:n.password}))},e._window.KeyJSInterface.pwdChangeFormSessionCancel=function(n){e._window.resetUiHandler(),e._window.amtWebSdk.additionalResponse=0,t(e._window.com.ts.mobile.sdk.FormInput.createFormCancellationRequest())},e._window.KeyJSInterface.forgotUserIdFormSessionSubmit=function(n){var o=JSON.parse(n);t(e._window.com.ts.mobile.sdk.FormInput.createFormInputSubmissionRequest(o))},e._window.KeyJSInterface.forgotUserIdFormSessionCancel=function(n){e._window.resetUiHandler(),e._window.amtWebSdk.additionalResponse=0,t(e._window.com.ts.mobile.sdk.FormInput.createFormCancellationRequest())},e._window.KeyJSInterface.phoneDOBAuthFormSessionSubmit=function(n){n=JSON.parse(n),t(e._window.com.ts.mobile.sdk.FormInput.createFormInputSubmissionRequest(n))},e._window.KeyJSInterface.phoneDOBAuthFormSessionCancel=function(n){e._window.resetUiHandler(),e._window.amtWebSdk.additionalResponse=0,t(e._window.com.ts.mobile.sdk.FormInput.createFormCancellationRequest())},e._window.KeyJSInterface.prospectCreateFormSessionSubmit=function(n){n=JSON.parse(n),t(e._window.com.ts.mobile.sdk.FormInput.createFormInputSubmissionRequest(n))},e._window.KeyJSInterface.prospectCreateFormSessionCancel=function(n){e._window.resetUiHandler(),e._window.amtWebSdk.additionalResponse=0,t(e._window.com.ts.mobile.sdk.FormInput.createFormCancellationRequest())}})},e.prototype.renderQRCodeForRegistration=function(){var e=this;this.qrCodeHandler||(this.qrCodeHandler=new KeyBindIdQRCodeHandler),this.qrCodeHandler.renderKeyBindIdQRCodeWindow().then(function(t){console.log("BindID success response ",t),e._window.KeyJSInterface.bindIdRegisterFormSessionSubmit({code:t})},function(t){console.log("BindID Failure response ",t),e._window.KeyJSInterface.bindIdRegisterError(t)})},e}(),KeyOtpAuthSession=function(){function e(e,t,n,o,i){this._window=window,this.cancelOtp=!1,this.authType="otp",this.targetList=n,this.autoExcedTarget=o,this.userName=t,this.title=e,this.clientContext=i}return e.prototype.setAvailableTargets=function(e){this.targetList=e},e.prototype.startSession=function(e,t,n,o){this.description=e,this.mode=this._window.com.ts.mobile.sdk.AuthenticatorSessionMode.registration,this.actionContext=n,this.clientContext=o,this.isNewSession=!0,this.isOtacEntryType(this.description)&&(this.authType="otac")},e.prototype.changeSessionModeToRegistrationAfterExpiration=function(){},e.prototype.endSession=function(){this._window.resetUiHandler()},e.prototype.isOtacEntryType=function(e){return!(!e._authenticatorMethodConfig||!e._authenticatorMethodConfig.otp_format)},e.prototype.setGeneratedOtp=function(e,t){this.generatedFormat=e,this.generatedForTarget=t;var n="OTP_LIST",o="OTP";"otp"==this.authType&&t&&!this.isNewSession?n="OTP_ENTRY":"otac"==this.authType&&(o="OTAC"),this.isNewSession=!1,this._window.sendMessageToHandler(JSON.stringify({session:o,message:{userName:this.userName,step:n,appId:KeyUIHandler.appId,sessionId:KeyUIHandler.sessionId,uiHandlerConfig:KeyUIHandler.uiHandlerConfig,possibleTargets:this.targetList,error:this.error?this.error:"",authType:this.authType},channel:"WEB"})),this.error=""},e.prototype.promiseInput=function(){var e=this,t=this.clientContext.uiContainer;return this._window.amtUiContainer=t,new Promise(function(t,n){e._window.KeyJSInterface={},e._window.KeyJSInterface.otpAuthCancel=function(n){n=JSON.parse(n),e._window.resetUiHandler();var o=e._window.com.ts.mobile.sdk.ControlRequest.create(e._window.com.ts.mobile.sdk.ControlRequestType.SelectMethod);t(e._window.com.ts.mobile.sdk.InputOrControlResponse.createControlResponse(o))},e._window.KeyJSInterface.otpSubmitAuthCode=function(n){n=JSON.parse(n);var o=e._window.com.ts.mobile.sdk.OtpInputOtpSubmission.createOtpSubmission(n.otp),i=e._window.com.ts.mobile.sdk.TargetBasedAuthenticatorInput.createAuthenticatorInput(o);t(e._window.com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(i))},e._window.KeyJSInterface.otpResendCode=function(){var n=e._window.com.ts.mobile.sdk.OtpInputRequestResend.createOtpResendRequest(),o=e._window.com.ts.mobile.sdk.TargetBasedAuthenticatorInput.createAuthenticatorInput(n);t(e._window.com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(o))},e._window.KeyJSInterface.otpSendCode=function(n){n=JSON.parse(n);for(var o=0;o<e.targetList.length;o++){var i=e.targetList[o];if(n._channelAssertionId==i._channelAssertionId&&n._channelIndex==i._channelIndex){n=i;break}}var r=e._window.com.ts.mobile.sdk.TargetBasedAuthenticatorInput.createTargetSelectionRequest(n);t(e._window.com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(r))}})},e.prototype.promiseRecoveryForError=function(e,t,n){return this.error=e,Promise.resolve(n)},e}(),KeyPasswordAuthSession=function(){function e(e,t){this._window=window,this.userObj=t}return e.prototype.startSession=function(e,t,n,o){this.description=e,this.mode=this._window.com.ts.mobile.sdk.AuthenticatorSessionMode.registration,this.actionContext=n,this.clientContext=o},e.prototype.changeSessionModeToRegistrationAfterExpiration=function(){},e.prototype.endSession=function(){this._window.resetUiHandler()},e.prototype.promiseRecoveryForError=function(e,t,n){return this.error=e,this.userObj&&this.userObj.password?Promise.resolve(this._window.com.ts.mobile.sdk.AuthenticationErrorRecovery.Fail):"LOCKED"==e._data.additional_data.policyResponseStatus.toUpperCase()?Promise.resolve(this._window.com.ts.mobile.sdk.AuthenticationErrorRecovery.Fail):n===this._window.com.ts.mobile.sdk.AuthenticationErrorRecovery.RetryAuthenticator?(console.log("e--",e),Promise.resolve(n)):n===this._window.com.ts.mobile.sdk.AuthenticationErrorRecovery.Fail?(console.log("e-- ",e),Promise.resolve(n)):void t.forEach(function(t){return console.log("e-- validRecoveries",e),Promise.resolve(t)})},e.prototype.promiseInput=function(){var e=this,t=this.clientContext.uiContainer;return this._window.amtUiContainer=t,new Promise(function(t,n){if(e.userObj&&e.userObj.password){var o=e._window.com.ts.mobile.sdk.PasswordInput.create(e.userObj.password);t(e._window.com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(o))}else e._window.sendMessageToHandler(JSON.stringify({session:"PASSWORD",message:{appId:KeyUIHandler.appId,sessionId:KeyUIHandler.sessionId,uiHandlerConfig:KeyUIHandler.uiHandlerConfig,error:e.error},channel:"WEB"})),e._window.KeyJSInterface={},e._window.KeyJSInterface.pwdSubmit=function(n){n=JSON.parse(n);var o=e._window.com.ts.mobile.sdk.PasswordInput.create(n.password);t(e._window.com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(o))},e._window.KeyJSInterface.pwdCancel=function(n){e._window.resetUiHandler(),n=JSON.parse(n),e._window.amtWebSdk.additionalResponse=0;var o=e._window.com.ts.mobile.sdk.ControlRequest.create(e._window.com.ts.mobile.sdk.ControlRequestType.AbortAuthentication);t(e._window.com.ts.mobile.sdk.InputOrControlResponse.createControlResponse(o))}})},e}(),KeyPatternAuthSession=function(){function e(e,t,n,o){this._window=window,this.title=e,this.userId=t,this.width=o,this.height=o}return e.prototype.startSession=function(e,t,n,o){switch(console.log("Dont know whos who.. description",e),console.log("Dont know whos who.. mode",t),console.log("Dont know whos who..action",n),console.log("Dont know whos who.. clientContext",o),this.authInfo=e,this.actionContext=n,this.clientContext=o,this.authInfo._authenticatorMethodConfig.method){case"pattern_centralized":console.log("We now know that this is pattern"),"unregistered"===this.authInfo._serverReportedRegistrationStatus&&console.log("New pattern registration"),console.log("Pattern session lock count ",this.authInfo._session._lockCount);break;default:console.log("This should not happen!!")}},e.prototype.promiseRecoveryForError=function(e,t,n){return console.log("Here is the error from submitted pattern ",e),n===this._window.com.ts.mobile.sdk.AuthenticationErrorRecovery.RetryAuthenticator?(console.log("Default retry case: TODO: Handle this error"),Promise.resolve(n)):n===this._window.com.ts.mobile.sdk.AuthenticationErrorRecovery.Fail?(console.log("failed recovery case: TODO: Handle this error"),Promise.resolve(n)):(console.log("Other Recovery options: TODO: Handle this error"),Promise.resolve(t))},e.prototype.endSession=function(){console.log("Authenticator session ending")},e.prototype.promiseInput=function(){var e=this,t=this.clientContext.uiContainer;return this._window.amtUiContainer=t,new Promise(function(t,n){e._window.KeyJSInterface={},console.log("Pattern methods"),console.log(Object.getOwnPropertyNames(e._window.com.ts.mobile.sdk.PatternInput)),e._window.sendMessageToHandler(JSON.stringify({session:"PATTERN_AUTH_SESSION",message:{userName:e.userId,appId:KeyUIHandler.appId,sessionId:KeyUIHandler.sessionId,minimuPaternLength:e.authInfo._authenticatorMethodConfig.min_length,uiHandlerConfig:KeyUIHandler.uiHandlerConfig},channel:"WEB"})),e._window.KeyJSInterface.patternSubmit=function(n){console.log("Pattern received ",n);var o=JSON.parse(n).pattern;t(e._window.com.ts.mobile.sdk.PatternInput.create(e._window.com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(o)))},e._window.KeyJSInterface.patternAuthCancel=function(n){e._window.resetUiHandler();var o=e._window.com.ts.mobile.sdk.ControlRequest.create(e._window.com.ts.mobile.sdk.ControlRequestType.CancelAuthenticator);t(e._window.com.ts.mobile.sdk.InputOrControlResponse.createControlResponse(o))}})},e}(),KeyPinAuthSession=function(){return function(e,t,n){this._window=window,this.title=e,this.userId=t,this.pinLength=n}}(),KeySecurityQuestionsAuthSession=function(){function e(e,t,n,o,i,r){this._window=window,this.cancelSecurityQuestions=!1,this.configureData=i,this.userName=o,this.serverPayload=r}return e.prototype.startSession=function(e,t,n,o){this.description=e,this.mode=this._window.com.ts.mobile.sdk.AuthenticatorSessionMode.registration,this.actionContext=n,this.clientContext=o},e.prototype.changeSessionModeToRegistrationAfterExpiration=function(){},e.prototype.endSession=function(){this._window.resetUiHandler()},e.prototype.promiseRecoveryForError=function(e,t,n){return 423==this.recentErrorCode?Promise.resolve(this._window.com.ts.mobile.sdk.AuthenticationErrorRecovery.Fail):Promise.resolve(this._window.com.ts.mobile.sdk.AuthenticationErrorRecovery.RetryAuthenticator)},e.prototype.promiseInput=function(){var e=this,t=this.clientContext.uiContainer;return this._window.amtUiContainer=t,new Promise(function(t,n){e._window.sendMessageToHandler(JSON.stringify({session:"SECURITY_QUESTIONS",message:{userName:e.userName,placeholderToken:e.serverPayload,appId:KeyUIHandler.appId,sessionId:KeyUIHandler.sessionId,securePlaceholderHash:KeyUIHandler.securePlaceholderHash,uiHandlerConfig:KeyUIHandler.uiHandlerConfig,recentErrorCode:e.recentErrorCode},channel:"WEB"})),e.recentErrorCode=0,e._window.KeyJSInterface={},e._window.KeyJSInterface.secAuthSuccess=function(n){var o=JSON.parse(n).placeholderToken;t(e._window.com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(e._window.com.ts.mobile.sdk.PlaceholderInputResponse.createSuccessResponse(o)))},e._window.KeyJSInterface.secAuthFailure=function(n){var o=JSON.parse(n);e.recentErrorCode=o.errorCode,e._window.amtWebSdk.additionalResponse=e.recentErrorCode;var i="Answer does not match to what we have on file";423==e.recentErrorCode&&(i="LOCKED");var r={message:"Answer does not match to what we have on file",errorCode:e.recentErrorCode,failure_data:{reason:{data:{policyResponseStatus:i}}}},s=e._window.com.ts.mobile.sdk.AuthenticationError.createApplicationGeneratedCommunicationError(r.toString(),r),a=e._window.com.ts.mobile.sdk.PlaceholderInputResponse.createdFailedResponse(e.description,s);t(e._window.com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(a))},e._window.KeyJSInterface.secSelAnotherAuth=function(){e._window.resetUiHandler(),e._window.amtWebSdk.additionalResponse="";var n=e._window.com.ts.mobile.sdk.ControlRequest.create(e._window.com.ts.mobile.sdk.ControlRequestType.SelectMethod);t(e._window.com.ts.mobile.sdk.InputOrControlResponse.createControlResponse(n))},e._window.KeyJSInterface.secAuthCancel=function(n){e._window.resetUiHandler(),e._window.amtWebSdk.additionalResponse="",e.cancelSecurityQuestions=!0;var o=e._window.com.ts.mobile.sdk.ControlRequest.create(e._window.com.ts.mobile.sdk.ControlRequestType.SelectMethod);t(e._window.com.ts.mobile.sdk.InputOrControlResponse.createControlResponse(o))}})},e}(),KeySelectAuthenticator=function(){function e(e,t,n){this._window=window,this.optionsJson=[],this.options=e,this.uiContainer=n.uiContainer,this.actionContext=t}return e.prototype.getSelectedAuthenticator=function(e){for(var t=0;t<this.options.length;t++)if(t==e)return this.options[t].getAuthenticator()},e.prototype.getAuthenticators=function(){this.optionsJson=[];for(var e=0;e<this.options.length;e++)"otac"==this.otpAuthSessionType(this.options[e].getAuthenticator())?this.optionsJson.push("OTAC"):this.optionsJson.push(this.options[e].getAuthenticator()._authetnicationMethodTypeName);return this.optionsJson},e.prototype.otpAuthSessionType=function(e){return e._authetnicationMethodTypeName&&"otp"==e._authetnicationMethodTypeName.toLowerCase()&&e._authenticatorMethodConfig&&e._authenticatorMethodConfig.otp_format?"otac":"none"},e.prototype.getHandler=function(){var e=this;return this._window.amtUiContainer=this.uiContainer,new Promise(function(t,n){e._window.KeyJSInterface={},e._window.KeyJSInterface.getAuthenticatorsList=function(){return e.getAuthenticators()},e._window.KeyJSInterface.selectAuthenticator=function(n){e._window.resetUiHandler(),t(e._window.com.ts.mobile.sdk.AuthenticatorSelectionResult.createSelectionRequest(e.getSelectedAuthenticator(n)))},e._window.KeyJSInterface.cancelAuthenticator=function(n){e._window.resetUiHandler(),n=JSON.parse(n),e._window.amtWebSdk.additionalResponse=n.status,t(e._window.com.ts.mobile.sdk.AuthenticatorSelectionResult.createAbortRequest())},e._window.sendMessageToHandler(JSON.stringify({session:"AUTHENTICATOR_LIST",message:{appId:KeyUIHandler.appId,sessionId:KeyUIHandler.sessionId,uiHandlerConfig:KeyUIHandler.uiHandlerConfig,isLoginFlowOn:KeyUIHandler.isLoginFlowOn,authList:e.getAuthenticators()},channel:"WEB"}))})},e}(),KeyUIHandler=function(){function e(){this._window=window}return e.prototype.setUserObj=function(e){this.userObj=e},e.prototype.setCustomUiHandlerSessions=function(t){var n=this;t.currentUiHandler.processJsonData=function(t){return e.sessionId=t&&t.sessionId?t.sessionId:e.sessionId,e.authToken=t&&t.auth_jwt?t.auth_jwt:e.authToken,e.securePlaceholderHash=t&&t.securePlaceholderHash?t.securePlaceholderHash:e.securePlaceholderHash,e.isMigratedForgotUser=!(!t||!t.isMigrated),e.userId=t&&t.userId?t.userId:"",e.eligibleAuthList=t&&t.elgauth?t.elgauth:e.eligibleAuthList,e.registeredAuthList=t&&t.regAuthList?t.regAuthList:e.registeredAuthList,e.authActionToken=t&&t.auth_action_jwt?t.auth_action_jwt:e.authActionToken,e.postLoginActionList=t&&t.auth_action?t.auth_action:e.postLoginActionList,Promise.resolve(n._window.com.ts.mobile.sdk.JsonDataProcessingResult.create(!0))},t.currentUiHandler.common.resolveString=function(e){return(new KeyCommon).resolveString(e)},t.currentUiHandler.createPasswordAuthSession=function(e,t){return new KeyPasswordAuthSession(e,n.userObj)},t.currentUiHandler.createPlaceholderAuthSession=function(e,t,n,o,i,r){if("bindid"==e)return new KeyBindIdAuthSession(e,t,n,o,i,r);if("security_questions"==e)return new KeySecurityQuestionsAuthSession(e,t,n,o,i,r);throw"Unknown placeholder session!"},t.currentUiHandler.createOtpAuthSession=function(e,t,n,o,i){return new KeyOtpAuthSession(e,t,n,o,i)},t.currentUiHandler.createFormSession=function(e,t){return new KeyFormInputSession(e,t)},t.currentUiHandler.getConfirmationInput=function(e,t,n,o,i,r){return new KeyConfirmationDialogSession(e,t,n,o,i,r).showConfirmationDialog()},t.currentUiHandler.selectAuthenticator=function(e,t,n){return new KeySelectAuthenticator(e,t,n).getHandler()},t.currentUiHandler.startActivityIndicator=function(e,t){n._window.amtUiContainer=t.uiContainer,n._window.setSpinnerStatus("ON")},t.currentUiHandler.endActivityIndicator=function(e,t){n._window.amtUiContainer=t.uiContainer,n._window.setSpinnerStatus("OFF")}},e.sessionId="",e.authToken="",e.securePlaceholderHash="",e.isLoginFlowOn=!1,e.isMigratedForgotUser=!1,e.userId="",e.eligibleAuthList=[],e.registeredAuthList=[],e.authActionToken="",e.postLoginActionList=[],e}(),AmtWebSdk=function(){function e(){this._window=window}return e.prototype.prep=function(){var e=this;this._window.amtWebSdk={},this._window.amtWebSdk.additionalResponse={},this._window.amtWebSdk.initialize=function(t,n,o,i,r,s,a,d,c){e._window.$(document).ready(function(){e.amtWebSdk=new e._window.xmsdk.XmSdk;var l=e._window.com.ts.mobile.sdk.SDKConnectionSettings.create(t,n,o,i);e.amtWebSdk.setConnectionSettings(l),e.keyUiHandler=new KeyUIHandler,KeyUIHandler.appId=n,KeyUIHandler.uiHandlerConfig=r,KeyUIHandler.securePlaceholderHash=s||KeyUIHandler.securePlaceholderHash,KeyUIHandler.sessionId=a||KeyUIHandler.sessionId,KeyUIHandler.userId="",e.keyUiHandler.setCustomUiHandlerSessions(e.amtWebSdk),e.amtWebSdk.initialize().then(function(e){d(e)},function(e){c(e)})})},this._window.amtWebSdk.checkAndCancelRunningFlowIfAny=function(t,n,o){t?(e.amtWebSdk.cancelCurrentRunningControlFlow(),setTimeout(function(){n({})},200)):n({})},this._window.amtWebSdk.cancelButtonOnAuthList=function(e){KeyUIHandler.isLoginFlowOn=e},this._window.amtWebSdk.updateConfig=function(e,t,n){KeyUIHandler.uiHandlerConfig=e,t({})},this._window.amtWebSdk.getSessionInfo=function(e,t){e({sessionId:KeyUIHandler.sessionId,authToken:KeyUIHandler.authToken,securePlaceholderHash:KeyUIHandler.securePlaceholderHash,isMigratedForgotUser:KeyUIHandler.isMigratedForgotUser,eligibleAuthList:KeyUIHandler.eligibleAuthList,registeredAuthList:KeyUIHandler.registeredAuthList,postLoginActions:KeyUIHandler.postLoginActionList,authActionToken:KeyUIHandler.authActionToken})},this._window.amtWebSdk.getBoundUserIds=function(t,n){t(e.amtWebSdk.getBoundUserIds())},this._window.amtWebSdk.getKnownUserIds=function(t,n){t(e.amtWebSdk.getKnownUserIds())},this._window.amtWebSdk.authenticate=function(t,n,o,i,r,s,a){e.keyUiHandler.setUserObj({userName:t,password:n}),KeyUIHandler.isLoginFlowOn=!0;var d=JSON.parse(e._window.atob(KeyUIHandler.uiHandlerConfig));d.labelsAndMessages&&d.labelsAndMessages.callCenterOptionLbl&&(d.labelsAndMessages.callCenterOptionLbl=i&&i.isBusiness?d.labelsAndMessages.callCenterOptionLbl.replace(new RegExp("1-800-539-1539","g"),"1-888-588-3977"):d.labelsAndMessages.callCenterOptionLbl,e._window.amtWebSdk.updateConfig(e._window.btoa(JSON.stringify(d)),function(e){},function(e){})),e.amtWebSdk.authenticate(t,o,i,r).then(function(e){KeyUIHandler.isLoginFlowOn=!1,s(e)},function(e){KeyUIHandler.isLoginFlowOn=!1,a(e)})},this._window.amtWebSdk.invokePolicy=function(t,n,o,i,r){e.amtWebSdk.invokePolicy(t,n,o).then(function(e){i(e)},function(e){r(e)})},this._window.amtWebSdk.invokeAnonymousPolicy=function(t,n,o,i,r){KeyUIHandler.isLoginFlowOn=!0,e.amtWebSdk.invokeAnonymousPolicy(t,n,o).then(function(e){KeyUIHandler.isLoginFlowOn=!1;var t=KeyUIHandler.userId.toUpperCase();t.length<=13&&0===t.indexOf("MERGER")&&(t=t.split("MERGER")[1]),e.userId=t,i(e)},function(e){KeyUIHandler.isLoginFlowOn=!1,r(e)})},this._window.amtWebSdk.authenticateUsingIdv=function(t,n,o,i,r,s){KeyUIHandler.isLoginFlowOn=!0,e.amtWebSdk.authenticate(t,n,o,i).then(function(e){KeyUIHandler.isLoginFlowOn=!1,r(e)},function(e){KeyUIHandler.isLoginFlowOn=!1,s(e)})},this._window.amtWebSdk.logout=function(t,n){try{e.amtWebSdk.logout().then(function(e){},function(e){})}catch(e){}t&&t()},this._window.amtWebSdk.clearAllData=function(t,n){try{e.amtWebSdk.clearAllData()}catch(e){}t&&t()},this._window.amtWebSdk.jsInterfaceTest=function(t,n){e.amtWebSdk.jsInterfaceTest().then(function(e){t(e)},function(e){n(e)})}},e}(),amtWebSdk=new AmtWebSdk;amtWebSdk.prep();