1(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-120eebe5"],{"14b9":function(e,t,r){var i=r("5ca1");i(i.P,"String",{repeat:r("97446")})},"14d2":function(e,t,r){"use strict";r.r(t);var i,n,s=function(){var e=this,t=e.$createElement,r=e._self._c||t;return e.isVisible?r("section",{staticClass:"section-form",class:[e.hasPadding,e.hasBackground,e.hasVisibility],attrs:{id:e.hasAnchor}},[r("div",{staticClass:"container"},[r("div",{staticClass:"row align-items-center"},[e.media_gallery&&e.show_image_preview.length?r("div",{staticClass:"col-sm-6 pb-3 pb-sm-0",class:[e.hasMediasPosition]},[r("media",{staticClass:"img-fluid",attrs:{src:e.media_gallery,ratio:"3:2"}})],1):e._e(),r("div",{class:e.media_gallery&&e.show_image_preview.length?"col-sm-5":"col-sm-12"},[r("div",{staticClass:"row"},[r("div",{staticClass:"wysiwyg col-12",class:{"col-sm-10":!e.media_gallery||!e.show_image_preview.length},domProps:{innerHTML:e._s(e.localProps.wysiwyg)}}),r("div",{staticClass:"mt-3 col-12"},[e.$account.getData()||e.not_logged_form?["modal"==e.form_format?r("btn",{attrs:{color:e.hasBtnColor},on:{click:function(t){return e.$refs["form-modal"].show()}}},[e._v(e._s(e.submit_text?e.submit_text:e.$t("proceed_with_the_request")))]):[r("loading-spinner",{attrs:{visible:e.loading}}),e.submitted?r("alert",{attrs:{variant:"success"}},[r("icon",{staticClass:"aui-icon-2x",attrs:{name:"system-select"}}),r("div",{domProps:{innerHTML:e._s(e.localProps.result_wysiwyg)}})],1):[e.showLinkedin?r("btn",{staticClass:"btn-social px-1 mb-3",attrs:{outline:"",block:""},on:{click:e.getLinkedinData}},[r("icon",{staticClass:"d-inline-block align-middle mr-1",attrs:{name:"linkedin"}}),r("span",{staticClass:"d-inline-block align-middle"},[e._v(e._s(e.$t("complete_with_linkedin")))])],1):e.$account.getData()?r("div",{staticClass:"card mb-5"},[r("div",{staticClass:"card-body text-primary"},[r("h5",{staticClass:"card-title pl-4 position-relative"},[r("icon",{staticClass:"card-icon",attrs:{name:"user"}}),e._v("\n\t\t\t\t\t\t\t\t\t\t\t\t"+e._s(e.$t("welcome"))+",\n\t\t\t\t\t\t\t\t\t\t\t\t"),r("strong",[e._v(e._s(e.$account.getData().claims.name))])],1),r("span",[e._v("\n\t\t\t\t\t\t\t\t\t\t\t\t"+e._s(e.$t("not_you"))+"\n\t\t\t\t\t\t\t\t\t\t\t\t"),r("a",{staticClass:"text-danger",attrs:{href:"javascript:;"},on:{click:function(t){return e.changeAccount()}}},[r("u",[e._v(e._s(e.$t("change_account")))])])])])]):e._e(),r("form-generator",{key:e.getForm,attrs:{schema_id:e.getForm,label_submit:e.submit_text?e.submit_text:e.$t("proceed_with_the_request"),request_types:e.hasRequestTypes,test_drive_models:e.hasTestDriveModels,additional_data:e.additionalData,fill_user:"",show_submit:""},on:{submit_request:e.submitRequest,submit_response:e.submitResponse,submit_error:e.submitError},model:{value:e.form_data,callback:function(t){e.form_data=t},expression:"form_data"}})]]]:r("btn",{attrs:{color:e.hasBtnColor},on:{click:e.login}},[e._v(e._s(e.$t("login")))])],2)])])]),"modal"==e.form_format?r("modal",{ref:"form-modal",attrs:{id:String(e._uid),centered:!1,fullscreen:"",color:"light"}},[r("template",{slot:"body"},[r("div",{staticClass:"modal-container"},[e.media_gallery?r("media",{staticClass:"section-form__background",attrs:{src:e.media_gallery,ratio:["md","lg","xl"].includes(e.breakpoint)?"3:4":"16:9",cover:""}}):e._e(),r("div",{staticClass:"container-fluid"},[r("div",{staticClass:"row"},[r("div",{staticClass:"col-md-7 col-lg-6 py-4 py-md-6 px-md-6 section-form__panel"},[r("loading-spinner",{attrs:{visible:e.loading}}),e.localProps.form_wysiwyg.length?r("div",{staticClass:"mb-4",domProps:{innerHTML:e._s(e.localProps.form_wysiwyg)}}):e._e(),e.showLinkedin?r("btn",{staticClass:"btn-social px-1 mb-3",attrs:{outline:"",block:""},on:{click:e.getLinkedinData}},[r("icon",{staticClass:"d-inline-block align-middle mr-1",attrs:{name:"linkedin"}}),r("span",{staticClass:"d-inline-block align-middle"},[e._v(e._s(e.$t("complete_with_linkedin")))])],1):e.$account.getData()?r("div",{staticClass:"card mb-5"},[r("div",{staticClass:"card-body text-primary"},[e.$account.getData()?r("h5",{staticClass:"card-title pl-4 position-relative"},[r("btn",{staticClass:"card-icon",attrs:{icon:"user",disabled:""}}),e._v("\n\t\t\t\t\t\t\t\t\t\t\t"+e._s(e.$t("welcome"))+",\n\t\t\t\t\t\t\t\t\t\t\t"),r("strong",[e._v(e._s(e.$account.getData().claims.name))])],1):e._e(
1),r("span",[e._v("\n\t\t\t\t\t\t\t\t\t\t\t"+e._s(e.$t("not_you"))+"\n\t\t\t\t\t\t\t\t\t\t\t"),r("a",{staticClass:"text-danger",attrs:{href:"javascript:;"},on:{click:function(t){return e.changeAccount()}}},[r("u",[e._v(e._s(e.$t("change_account")))])])])])]):e._e(),r("form-generator",{attrs:{schema_id:e.getForm,request_types:e.hasRequestTypes,test_drive_models:e.hasTestDriveModels,additional_data:e.additionalData,fill_user:"",show_submit:""},on:{submit_request:e.submitRequest,submit_response:e.submitResponse,submit_error:e.submitError},model:{value:e.form_data,callback:function(t){e.form_data=t},expression:"form_data"}})],1)])])],1)])],2):e._e()],1)]):e._e()},o=[],a=(r("8e6e"),r("ac6a"),r("456d"),r("6762"),r("2fdb"),r("bd86")),u=(r("673e"),r("d225")),c=r("b0b4"),h=r("308d"),l=r("6bb5"),d=r("013f"),f=r("4e2b"),g=(r("5df3"),r("1c4c"),{debug:function(){},info:function(){},warn:function(){},error:function(){}}),p=0,v=1,y=2,m=3,_=4,F=function(){function e(){Object(u["a"])(this,e)}return Object(c["a"])(e,null,[{key:"reset",value:function(){n=m,i=g}},{key:"debug",value:function(){if(n>=_){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i.debug.apply(i,Array.from(t))}}},{key:"info",value:function(){if(n>=m){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i.info.apply(i,Array.from(t))}}},{key:"warn",value:function(){if(n>=y){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i.warn.apply(i,Array.from(t))}}},{key:"error",value:function(){if(n>=v){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i.error.apply(i,Array.from(t))}}},{key:"NONE",get:function(){return p}},{key:"ERROR",get:function(){return v}},{key:"WARN",get:function(){return y}},{key:"INFO",get:function(){return m}},{key:"DEBUG",get:function(){return _}},{key:"level",get:function(){return n},set:function(e){if(!(p<=e&&e<=_))throw new Error("Invalid log level");n=e}},{key:"logger",get:function(){return i},set:function(e){if(!e.debug&&e.info&&(e.debug=e.info),!(e.debug&&e.info&&e.warn&&e.error))throw new Error("Invalid logger");i=e}}]),e}();F.reset();var S=r("7618"),b=(r("6b54"),{setInterval:function(e){function t(t,r){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e,t){return setInterval(e,t)})),clearInterval:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){return clearInterval(e)}))}),w=!1,k=null,E=function(){function e(){Object(u["a"])(this,e)}return Object(c["a"])(e,null,[{key:"_testing",value:function(){w=!0}},{key:"setXMLHttpRequest",value:function(e){k=e}},{key:"location",get:function(){if(!w)return location}},{key:"localStorage",get:function(){if(!w&&"undefined"!==typeof window)return localStorage}},{key:"sessionStorage",get:function(){if(!w&&"undefined"!==typeof window)return sessionStorage}},{key:"XMLHttpRequest",get:function(){if(!w&&"undefined"!==typeof window)return k||XMLHttpRequest}},{key:"timer",get:function(){if(!w)return b}}]),e}(),x=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.prefix,i=void 0===r?"oidc.":r,n=t.store,s=void 0===n?E.localStorage:n;Object(u["a"])(this,e),this._store=s,this._prefix=i}return Object(c["a"])(e,[{key:"set",value:function(e,t){return F.debug("WebStorageStateStore.set",e),e=this._prefix+e,this._store&&this._store.setItem(e,t),Promise.resolve()}},{key:"get",value:function(e){F.debug("WebStorageStateStore.get",e),e=this._prefix+e;var t=this._store?this._store.getItem(e):null;return Promise.resolve(t)}},{key:"remove",value:function(e){F.debug("WebStorageStateStore.remove",e),e=this._prefix+e;var t=this._store?this._store.getItem(e):null;return this._store&&this._store.removeItem(e),Promise.resolve(t)}},{key:"getAllKeys",value:function(){F.debug("WebStorageStateStore.getAllKeys");for(var e=[],t=0;t<this._store.length;t++){var r=this._store.key(t);0===r.indexOf(this._prefix)&&e.push(r.substr(this._prefix.length))}return Promise.resolve(e)}}]),e}(),A=(r("f559"),r("7f7f"),r("7514"),function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:E.XMLHttpRequest,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;Object(u["a"])(this,e),t&&Array.isArray(t)?this._contentTypes=t.slice():this._contentTypes=[],this._contentTypes.push("application/json"),i&&this._contentTypes.push("application/jwt"),this._XMLHttpRequest=r,this._jwtHandler=i}return Object(c["a"])(e,[{key:"getJson",value:function(e,t){var r=this;if(!e)throw F.error("JsonService.getJson: No url passed"),new Error("url");return F.debug("JsonService.getJson, url: ",e),new Promise((function(i,n){var s=new r._XMLHttpRequest;s.open("GET",e);var o=r._contentTypes,a=r._jwtHandler;s.onload=function(){if(F.debug("JsonService.getJson: HTTP response received, status",s.status),200===s.status){var t=s.getResponseHeader("Content-Type");if(t){var r=o.find((function(e){if(t.startsWith(e))return!0}));if("application/jwt"==r)return void a(s).then(i,n);if(r)try{return void i(JSON.parse(s.responseText))}catch(u){return F.error("JsonService.getJson: Error parsing JSON response",u.message),void n(u)}}n(Error("Invalid response Content-Type: "+t+", from URL: "+e))}else n(Error(s.statusText+" ("+s.status+")"))},s.onerror=function(){F.error("JsonService.getJson: network error"),n(Error("Network Error"))},t&&(F.debug("JsonService.getJson: token passed, setting Authorization header"),s.setRequestHeader("Authorization","Bearer "+t)),s.send()}))}},{key:"postForm",value:function(e,t){var r=this;if(!e)throw F.error("JsonService.postForm: No url passed"),new Error("url");return F.debug("JsonService.postForm, url: ",e),new Promise((function(i,n){var s=new r._XMLHttpRequest;s.open("POST",e);var o=r._contentTypes;s.onload=function(){if(F.debug("JsonService.postForm: HTTP response received, status",s.status),200!==s.status){if(400===s.status&&(r=s.getResponseHeader("Content-Type"),r&&(a=o.find((function(e){if(r.startsWith(e))return!0})),a)))try{var t=JSON.parse(s.responseText);if(t&&t.error)return F.error("JsonService.postForm: Error from server: ",t.error),void n(new Error(t.error))}catch(u){return F.error("JsonService.postForm: Error parsing JSON response",u.message),void n(u)}n(Error(s.statusText+" ("+s.status+")"))}else{var r=s.getResponseHeader("Content-Type");if(r){var a=o.find((function(e){if(r.startsWith(e))return!0}));if(a)try{return void i(JSON.parse(s.responseText))}catch(u){return F.error("JsonService.postForm: Error parsing JSON response",u.message),void n(u)}}
1n(Error("Invalid response Content-Type: "+r+", from URL: "+e))}},s.onerror=function(){F.error("JsonService.postForm: network error"),n(Error("Network Error"))};var a="";for(var u in t){var c=t[u];c&&(a.length>0&&(a+="&"),a+=encodeURIComponent(u),a+="=",a+=encodeURIComponent(c))}s.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),s.send(a)}))}}]),e}()),P=".well-known/openid-configuration",C=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:A;if(Object(u["a"])(this,e),!t)throw F.error("MetadataService: No settings passed to MetadataService"),new Error("settings");this._settings=t,this._jsonService=new r(["application/jwk-set+json"])}return Object(c["a"])(e,[{key:"getMetadata",value:function(){var e=this;return this._settings.metadata?(F.debug("MetadataService.getMetadata: Returning metadata from settings"),Promise.resolve(this._settings.metadata)):this.metadataUrl?(F.debug("MetadataService.getMetadata: getting metadata from",this.metadataUrl),this._jsonService.getJson(this.metadataUrl).then((function(t){return F.debug("MetadataService.getMetadata: json received"),e._settings.metadata=t,t}))):(F.error("MetadataService.getMetadata: No authority or metadataUrl configured on settings"),Promise.reject(new Error("No authority or metadataUrl configured on settings")))}},{key:"getIssuer",value:function(){return this._getMetadataProperty("issuer")}},{key:"getAuthorizationEndpoint",value:function(){return this._getMetadataProperty("authorization_endpoint")}},{key:"getUserInfoEndpoint",value:function(){return this._getMetadataProperty("userinfo_endpoint")}},{key:"getTokenEndpoint",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._getMetadataProperty("token_endpoint",e)}},{key:"getCheckSessionIframe",value:function(){return this._getMetadataProperty("check_session_iframe",!0)}},{key:"getEndSessionEndpoint",value:function(){return this._getMetadataProperty("end_session_endpoint",!0)}},{key:"getRevocationEndpoint",value:function(){return this._getMetadataProperty("revocation_endpoint",!0)}},{key:"getKeysEndpoint",value:function(){return this._getMetadataProperty("jwks_uri",!0)}},{key:"_getMetadataProperty",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return F.debug("MetadataService.getMetadataProperty for: "+e),this.getMetadata().then((function(r){if(F.debug("MetadataService.getMetadataProperty: metadata recieved"),void 0===r[e]){if(!0===t)return void F.warn("MetadataService.getMetadataProperty: Metadata does not contain optional property "+e);throw F.error("MetadataService.getMetadataProperty: Metadata does not contain property "+e),new Error("Metadata does not contain property "+e)}return r[e]}))}},{key:"getSigningKeys",value:function(){var e=this;return this._settings.signingKeys?(F.debug("MetadataService.getSigningKeys: Returning signingKeys from settings"),Promise.resolve(this._settings.signingKeys)):this._getMetadataProperty("jwks_uri").then((function(t){return F.debug("MetadataService.getSigningKeys: jwks_uri received",t),e._jsonService.getJson(t).then((function(t){if(F.debug("MetadataService.getSigningKeys: key set received",t),!t.keys)throw F.error("MetadataService.getSigningKeys: Missing keys on keyset"),new Error("Missing keys on keyset");return e._settings.signingKeys=t.keys,e._settings.signingKeys}))}))}},{key:"metadataUrl",get:function(){return this._metadataUrl||(this._settings.metadataUrl?this._metadataUrl=this._settings.metadataUrl:(this._metadataUrl=this._settings.authority,this._metadataUrl&&this._metadataUrl.indexOf(P)<0&&("/"!==this._metadataUrl[this._metadataUrl.length-1]&&(this._metadataUrl+="/"),this._metadataUrl+=P))),this._metadataUrl}}]),e}(),T=(r("14b9"),r("55dd"),r("28a5"),r("a481"),r("4917"),r("3b2b"),r("34ef"),{userAgent:!1}),R={}; 2/*! 3Copyright (c) 2011, Yahoo! Inc. All rights reserved. 4Code licensed under the BSD License: 5http://developer.yahoo.com/yui/license.html 6version: 2.9.0 7*/ 8if(void 0===I)var I={};I.lang={extend:function(e,t,r){if(!t||!e)throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.");var i=function(){};if(i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e,e.superclass=t.prototype,t.prototype.constructor==Object.prototype.constructor&&(t.prototype.constructor=t),r){var n;for(n in r)e.prototype[n]=r[n];var s=function(){},o=["toString","valueOf"];try{/MSIE/.test(T.userAgent)&&(s=function(e,t){for(n=0;n<o.length;n+=1){var r=o[n],i=t[r];"function"===typeof i&&i!=Object.prototype[r]&&(e[r]=i)}})}catch(a){}s(e.prototype,r)}}};
vendor: 4,237 bytes, lines 9-17
9/*! CryptoJS v3.1.2 core-fix.js 10 * code.google.com/p/crypto-js 11 * (c) 2009-2013 by Jeff Mott. All rights reserved. 12 * code.google.com/p/crypto-js/wiki/License 13 * THIS IS FIX of 'core.js' to fix Hmac issue. 14 * https://code.google.com/p/crypto-js/issues/detail?id=84 15 * https://crypto-js.googlecode.com/svn-history/r667/branches/3.x/src/core.js 16 */ 17var D=D||function(e,t){var r={},i=r.lib={},n=i.Base=function(){function e(){}return{extend:function(t){e.prototype=this;var r=new e;return t&&r.mixIn(t),r.hasOwnProperty("init")||(r.init=function(){r.$super.init.apply(this,arguments)}),r.init.prototype=r,r.$super=this,r},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),s=i.WordArray=n.extend({init:function(e,r){e=this.words=e||[],this.sigBytes=r!=t?r:4*e.length},toString:function(e){return(e||a).stringify(this)},concat:function(e){var t=this.words,r=e.words,i=this.sigBytes,n=e.sigBytes;if(this.clamp(),i%4)for(var s=0;s<n;s++){var o=r[s>>>2]>>>24-s%4*8&255;t[i+s>>>2]|=o<<24-(i+s)%4*8}else for(s=0;s<n;s+=4)t[i+s>>>2]=r[s>>>2];return this.sigBytes+=n,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=n.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var r=[],i=0;i<t;i+=4)r.push(4294967296*e.random()|0);return new s.init(r,t)}}),o=r.enc={},a=o.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,i=[],n=0;n<r;n++){var s=t[n>>>2]>>>24-n%4*8&255;i.push((s>>>4).toString(16)),i.push((15&s).toString(16))}return i.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i<t;i+=2)r[i>>>3]|=parseInt(e.substr(i,2),16)<<24-i%8*4;return new s.init(r,t/2)}},u=o.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,i=[],n=0;n<r;n++){var s=t[n>>>2]>>>24-n%4*8&255;i.push(String.fromCharCode(s))}return i.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i<t;i++)r[i>>>2]|=(255&e.charCodeAt(i))<<24-i%4*8;return new s.init(r,t)}},c=o.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},h=i.BufferedBlockAlgorithm=n.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=c.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r=this._data,i=r.words,n=r.sigBytes,o=this.blockSize,a=4*o,u=n/a;u=t?e.ceil(u):e.max((0|u)-this._minBufferSize,0);var c=u*o,h=e.min(4*c,n);if(c){for(var l=0;l<c;l+=o)this._doProcessBlock(i,l);var d=i.splice(0,c);r.sigBytes-=h}return new s.init(d,h)},clone:function(){var e=n.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),l=(i.Hasher=h.extend({cfg:n.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){h.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){e&&this._append(e);var t=this._doFinalize();return t},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new l.HMAC.init(e,r).finalize(t)}}}),r.algo={});return r}(Math);(function(e){var t=D,r=t.lib,i=r.Base,n=r.WordArray;t=t.x64={};t.Word=i.extend({init:function(e,t){this.high=e,this.low=t}}),t.WordArray=i.extend({init:function(t,r){t=this.words=t||[],this.sigBytes=r!=e?r:8*t.length},toX32:function(){for(var e=this.words,t=e.length,r=[],i=0;i<t;i++){var s=e[i];r.push(s.high),r.push(s.low)}return n.create(r,this.sigBytes)},clone:function(){for(var e=i.clone.call(this),t=e.words=this.words.slice(0),r=t.length,n=0;n<r;n++)t[n]=t[n].clone();return e}})})(),function(){var e=D,t=e.lib.WordArray;e.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,i=this._map;e.clamp(),e=[];for(var n=0;n<r;n+=3)for(var s=(t[n>>>2]>>>24-n%4*8&255)<<16|(t[n+1>>>2]>>>24-(n+1)%4*8&255)<<8|t[n+2>>>2]>>>24-(n+2)%4*8&255,o=0;4>o&&n+.75*o<r;
17o++)e.push(i.charAt(s>>>6*(3-o)&63));if(t=i.charAt(64))for(;e.length%4;)e.push(t);return e.join("")},parse:function(e){var r=e.length,i=this._map,n=i.charAt(64);n&&(n=e.indexOf(n),-1!=n&&(r=n));n=[];for(var s=0,o=0;o<r;o++)if(o%4){var a=i.indexOf(e.charAt(o-1))<<o%4*2,u=i.indexOf(e.charAt(o))>>>6-o%4*2;n[s>>>2]|=(a|u)<<24-s%4*8,s++}return t.create(n,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(e){for(var t=D,r=t.lib,i=r.WordArray,n=r.Hasher,s=(r=t.algo,[]),o=[],a=function(e){return 4294967296*(e-(0|e))|0},u=2,c=0;64>c;){var h;e:{h=u;for(var l=e.sqrt(h),d=2;d<=l;d++)if(!(h%d)){h=!1;break e}h=!0}h&&(8>c&&(s[c]=a(e.pow(u,.5))),o[c]=a(e.pow(u,1/3)),c++),u++}var f=[];r=r.SHA256=n.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,i=r[0],n=r[1],s=r[2],a=r[3],u=r[4],c=r[5],h=r[6],l=r[7],d=0;64>d;d++){if(16>d)f[d]=0|e[t+d];else{var g=f[d-15],p=f[d-2];f[d]=((g<<25|g>>>7)^(g<<14|g>>>18)^g>>>3)+f[d-7]+((p<<15|p>>>17)^(p<<13|p>>>19)^p>>>10)+f[d-16]}g=l+((u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25))+(u&c^~u&h)+o[d]+f[d],p=((i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22))+(i&n^i&s^n&s),l=h,h=c,c=u,u=a+g|0,a=s,s=n,n=i,i=g+p|0}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+s|0,r[3]=r[3]+a|0,r[4]=r[4]+u|0,r[5]=r[5]+c|0,r[6]=r[6]+h|0,r[7]=r[7]+l|0},_doFinalize:function(){var t=this._data,r=t.words,i=8*this._nDataBytes,n=8*t.sigBytes;return r[n>>>5]|=128<<24-n%32,r[14+(n+64>>>9<<4)]=e.floor(i/4294967296),r[15+(n+64>>>9<<4)]=i,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=n._createHelper(r),t.HmacSHA256=n._createHmacHelper(r)}(Math),function(){function e(){return n.create.apply(n,arguments)}for(var t=D,r=t.lib.Hasher,i=t.x64,n=i.Word,s=i.WordArray,o=(i=t.algo,[e(1116352408,3609767458),e(1899447441,602891725),e(3049323471,3964484399),e(3921009573,2173295548),e(961987163,4081628472),e(1508970993,3053834265),e(2453635748,2937671579),e(2870763221,3664609560),e(3624381080,2734883394),e(310598401,1164996542),e(607225278,1323610764),e(1426881987,3590304994),e(1925078388,4068182383),e(2162078206,991336113),e(2614888103,633803317),e(3248222580,3479774868),e(3835390401,2666613458),e(4022224774,944711139),e(264347078,2341262773),e(604807628,2007800933),e(770255983,1495990901),e(1249150122,1856431235),e(1555081692,3175218132),e(1996064986,2198950837),e(2554220882,3999719339),e(2821834349,766784016),e(2952996808,2566594879),e(3210313671,3203337956),e(3336571891,1034457026),e(3584528711,2466948901),e(113926993,3758326383),e(338241895,168717936),e(666307205,1188179964),e(773529912,1546045734),e(1294757372,1522805485),e(1396182291,2643833823),e(1695183700,2343527390),e(1986661051,1014477480),e(2177026350,1206759142),e(2456956037,344077627),e(2730485921,1290863460),e(2820302411,3158454273),e(3259730800,3505952657),e(3345764771,106217008),e(3516065817,3606008344),e(3600352804,1432725776),e(4094571909,1467031594),e(275423344,851169720),e(430227734,3100823752),e(506948616,1363258195),e(659060556,3750685593),e(883997877,3785050280),e(958139571,3318307427),e(1322822218,3812723403),e(1537002063,2003034995),e(1747873779,3602036899),e(1955562222,1575990012),e(2024104815,1125592928),e(2227730452,2716904306),e(2361852424,442776044),e(2428436474,593698344),e(2756734187,3733110249),e(3204031479,2999351573),e(3329325298,3815920427),e(3391569614,3928383900),e(3515267271,566280711),e(3940187606,3454069534),e(4118630271,4000239992),e(116418474,1914138554),e(174292421,2731055270),e(289380356,3203993006),e(460393269,320620315),e(685471733,587496836),e(852142971,1086792851),e(1017036298,365543100),e(1126000580,2618297676),e(1288033470,3409855158),e(1501505948,4234509866),e(1607167915,987167468),e(1816402316,1246189591)]),a=[],u=0;80>u;u++)a[u]=e();i=i.SHA512=r.extend({_doReset:function(){this._hash=new s.init([new n.init(1779033703,4089235720),new n.init(3144134277,2227873595),new n.init(1013904242,4271175723),new n.init(2773480762,1595750129),new n.init(1359893119,2917565137),new n.init(2600822924,725511199),new n.init(528734635,4215389547),new n.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,i=r[0],n=r[1],s=r[2],u=r[3],c=r[4],h=r[5],l=r[6],d=(r=r[7],i.high),f=i.low,g=n.high,p=n.low,v=s.high,y=s.low,m=u.high,_=u.low,F=c.high,S=c.low,b=h.high,w=h.low,k=l.high,E=l.low,x=r.high,A=r.low,P=d,C=f,T=g,R=p,I=v,D=y,j=m,N=_,O=F,H=S,B=b,U=w,M=k,V=E,K=x,q=A,L=0;80>L;L++){var J=a[L];if(16>L)var W=J.high=0|e[t+2*L],z=J.low=0|e[t+2*L+1];else{W=a[L-15],z=W.high;var $=W.low,G=(W=(z>>>1|$<<31)^(z>>>8|$<<24)^z>>>7,$=($>>>1|z<<31)^($>>>8|z<<24)^($>>>7|z<<25),a[L-2]),Y=(z=G.high,G.low),Q=(G=(z>>>19|Y<<13)^(z<<3|Y>>>29)^z>>>6,Y=(Y>>>19|z<<13)^(Y<<3|z>>>29)^(Y>>>6|z<<26),z=a[L-7],z.high),X=a[L-16],Z=X.high;X=X.low,z=$+z.low,W=W+Q+(z>>>0<$>>>0?1:0),z=z+Y,W=W+G+(z>>>0<Y>>>0?1:0),z=z+X,W=W+Z+(z>>>0<X>>>0?1:0);J.high=W,J.low=z}Q=O&B^~O&M,X=H&U^~H&V,J=P&T^P&I^T&I;var ee=C&R^C&D^R&D,te=($=(P>>>28|C<<4)^(P<<30|C>>>2)^(P<<25|C>>>7),G=(C>>>28|P<<4)^(C<<30|P>>>2)^(C<<25|P>>>7),Y=o[L],Y.high),re=Y.low;Y=q+((H>>>14|O<<18)^(H>>>18|O<<14)^(H<<23|O>>>9)),Z=K+((O>>>14|H<<18)^(O>>
17>18|H<<14)^(O<<23|H>>>9))+(Y>>>0<q>>>0?1:0),Y=Y+X,Z=Z+Q+(Y>>>0<X>>>0?1:0),Y=Y+re,Z=Z+te+(Y>>>0<re>>>0?1:0),Y=Y+z,Z=Z+W+(Y>>>0<z>>>0?1:0),z=G+ee,J=$+J+(z>>>0<G>>>0?1:0),K=M,q=V,M=B,V=U,B=O,U=H,H=N+Y|0,O=j+Z+(H>>>0<N>>>0?1:0)|0,j=I,N=D,I=T,D=R,T=P,R=C,C=Y+z|0,P=Z+J+(C>>>0<Y>>>0?1:0)|0}f=i.low=f+C,i.high=d+P+(f>>>0<C>>>0?1:0),p=n.low=p+R,n.high=g+T+(p>>>0<R>>>0?1:0),y=s.low=y+D,s.high=v+I+(y>>>0<D>>>0?1:0),_=u.low=_+N,u.high=m+j+(_>>>0<N>>>0?1:0),S=c.low=S+H,c.high=F+O+(S>>>0<H>>>0?1:0),w=h.low=w+U,h.high=b+B+(w>>>0<U>>>0?1:0),E=l.low=E+V,l.high=k+M+(E>>>0<V>>>0?1:0),A=r.low=A+q,r.high=x+K+(A>>>0<q>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;return t[i>>>5]|=128<<24-i%32,t[30+(i+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(i+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32}),t.SHA512=r._createHelper(i),t.HmacSHA512=r._createHmacHelper(i)}(),function(){var e=D,t=e.x64,r=t.Word,i=t.WordArray,n=(t=e.algo,t.SHA512);t=t.SHA384=n.extend({_doReset:function(){this._hash=new i.init([new r.init(3418070365,3238371032),new r.init(1654270250,914150663),new r.init(2438529370,812702999),new r.init(355462360,4144912697),new r.init(1731405415,4290775857),new r.init(2394180231,1750603025),new r.init(3675008525,1694076839),new r.init(1203062813,3204075428)])},_doFinalize:function(){var e=n._doFinalize.call(this);return e.sigBytes-=16,e}});e.SHA384=n._createHelper(t),e.HmacSHA384=n._createHmacHelper(t)}(); 18/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ 19 */ 20var j,N="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",O="=";function H(e){var t,r,i="";for(t=0;t+3<=e.length;t+=3)r=parseInt(e.substring(t,t+3),16),i+=N.charAt(r>>6)+N.charAt(63&r);if(t+1==e.length?(r=parseInt(e.substring(t,t+1),16),i+=N.charAt(r<<2)):t+2==e.length&&(r=parseInt(e.substring(t,t+2),16),i+=N.charAt(r>>2)+N.charAt((3&r)<<4)),O)while((3&i.length)>0)i+=O;return i}function B(e){var t,r,i,n="",s=0;for(t=0;t<e.length;++t){if(e.charAt(t)==O)break;
20i=N.indexOf(e.charAt(t)),i<0||(0==s?(n+=Q(i>>2),r=3&i,s=1):1==s?(n+=Q(r<<2|i>>4),r=15&i,s=2):2==s?(n+=Q(r),n+=Q(i>>2),r=3&i,s=3):(n+=Q(r<<2|i>>4),n+=Q(15&i),s=0))}return 1==s&&(n+=Q(r<<2)),n}var U=0xdeadbeefcafe,M=15715070==(16777215&U);function V(e,t,r){null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function K(){return new V(null)}function q(e,t,r,i,n,s){while(--s>=0){var o=t*this[e++]+r[i]+n;n=Math.floor(o/67108864),r[i++]=67108863&o}return n}function L(e,t,r,i,n,s){var o=32767&t,a=t>>15;while(--s>=0){var u=32767&this[e],c=this[e++]>>15,h=a*u+c*o;u=o*u+((32767&h)<<15)+r[i]+(1073741823&n),n=(u>>>30)+(h>>>15)+a*c+(n>>>30),r[i++]=1073741823&u}return n}function J(e,t,r,i,n,s){var o=16383&t,a=t>>14;while(--s>=0){var u=16383&this[e],c=this[e++]>>14,h=a*u+c*o;u=o*u+((16383&h)<<14)+r[i]+n,n=(u>>28)+(h>>14)+a*c,r[i++]=268435455&u}return n}M&&"Microsoft Internet Explorer"==T.appName?(V.prototype.am=L,j=30):M&&"Netscape"!=T.appName?(V.prototype.am=q,j=26):(V.prototype.am=J,j=28),V.prototype.DB=j,V.prototype.DM=(1<<j)-1,V.prototype.DV=1<<j;var W=52;V.prototype.FV=Math.pow(2,W),V.prototype.F1=W-j,V.prototype.F2=2*j-W;var z,$,G="0123456789abcdefghijklmnopqrstuvwxyz",Y=new Array;for(z="0".charCodeAt(0),$=0;$<=9;++$)Y[z++]=$;for(z="a".charCodeAt(0),$=10;$<36;++$)Y[z++]=$;for(z="A".charCodeAt(0),$=10;$<36;++$)Y[z++]=$;function Q(e){return G.charAt(e)}function X(e,t){var r=Y[e.charCodeAt(t)];return null==r?-1:r}function Z(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s}function ee(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0}function te(e){var t=K();return t.fromInt(e),t}function re(e,t){var r;if(16==t)r=4;else if(8==t)r=3;else if(256==t)r=8;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return void this.fromRadix(e,t);r=2}this.t=0,this.s=0;var i=e.length,n=!1,s=0;while(--i>=0){var o=8==r?255&e[i]:X(e,i);o<0?"-"==e.charAt(i)&&(n=!0):(n=!1,0==s?this[this.t++]=o:s+r>this.DB?(this[this.t-1]|=(o&(1<<this.DB-s)-1)<<s,this[this.t++]=o>>this.DB-s):this[this.t-1]|=o<<s,s+=r,s>=this.DB&&(s-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,s>0&&(this[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),n&&V.ZERO.subTo(this,this)}function ie(){var e=this.s&this.DM;while(this.t>0&&this[this.t-1]==e)--this.t}function ne(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,i=(1<<t)-1,n=!1,s="",o=this.t,a=this.DB-o*this.DB%t;if(o-- >0){a<this.DB&&(r=this[o]>>a)>0&&(n=!0,s=Q(r));while(o>=0)a<t?(r=(this[o]&(1<<a)-1)<<t-a,r|=this[--o]>>(a+=this.DB-t)):(r=this[o]>>(a-=t)&i,a<=0&&(a+=this.DB,--o)),r>0&&(n=!0),n&&(s+=Q(r))}return n?s:"0"}function se(){var e=K();return V.ZERO.subTo(this,e),e}function oe(){return this.s<0?this.negate():this}function ae(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(t=r-e.t,0!=t)return this.s<0?-t:t;while(--r>=0)if(0!=(t=this[r]-e[r]))return t;return 0}function ue(e){var t,r=1;return 0!=(t=e>>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function ce(){return this.t<=0?0:this.DB*(this.t-1)+ue(this[this.t-1]^this.s&this.DM)}function he(e,t){var r;for(r=this.t-1;r>=0;--r)t[r+e]=this[r];for(r=e-1;r>=0;--r)t[r]=0;t.t=this.t+e,t.s=this.s}function le(e,t){for(var r=e;r<this.t;++r)t[r-e]=this[r];t.t=Math.max(this.t-e,0),t.s=this.s}function de(e,t){var r,i=e%this.DB,n=this.DB-i,s=(1<<n)-1,o=Math.floor(e/this.DB),a=this.s<<i&this.DM;for(r=this.t-1;r>=0;--r)t[r+o+1]=this[r]>>n|a,a=(this[r]&s)<<i;for(r=o-1;r>=0;--r)t[r]=0;t[o]=a,t.t=this.t+o+1,t.s=this.s,t.clamp()}function fe(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var i=e%this.DB,n=this.DB-i,s=(1<<i)-1;t[0]=this[r]>>i;for(var o=r+1;o<this.t;++o)t[o-r-1]|=(this[o]&s)<<n,t[o-r]=this[o]>>i;i>0&&(t[this.t-r-1]|=(this.s&s)<<n),t.t=this.t-r,t.clamp()}}function ge(e,t){var r=0,i=0,n=Math.min(e.t,this.t);while(r<n)i+=this[r]-e[r],t[r++]=i&this.DM,i>>=this.DB;if(e.t<this.t){i-=e.s;while(r<this.t)i+=this[r],t[r++]=i&this.DM,i>>=this.DB;i+=this.s}else{i+=this.s;while(r<e.t)i-=e[r],t[r++]=i&this.DM,i>>=this.DB;i-=e.s}t.s=i<0?-1:0,i<-1?t[r++]=this.DV+i:i>0&&(t[r++]=i),t.t=r,t.clamp()}function pe(e,t){var r=this.abs(),i=e.abs(),n=r.t;t.t=n+i.t;while(--n>=0)t[n]=0;for(n=0;n<i.t;++n)t[n+r.t]=r.am(0,i[n],t,n,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&V.ZERO.subTo(t,t)}function ve(e){var t=this.abs(),r=e.t=2*t.t;while(--r>=0)e[r]=0;for(r=0;r<t.t-1;++r){var i=t.am(r,t[r],e,2*r,0,1);(e[r+t.t]+=t.am(r+1,2*t[r],e,2*r+1,i,t.t-r-1))>=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(r,t[r],e,2*r,0,1)),e.s=0,e.clamp()}function ye(e,t,r){var i=e.abs();if(!(i.t<=0)){var n=this.abs();if(n.t<i.t)return null!=t&&t.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=K());var s=K(),o=this.s,a=e.s,u=this.DB-ue(i[i.t-1]);u>0?(i.lShiftTo(u,s),n.lShiftTo(u,r)):(i.copyTo(s),n.copyTo(r));var c=s.t,h=s[c-1];if(0!=h){var l=h*(1<<this.F1)+(c>1?s[c-2]>>this.F2:0),d=this.FV/l,f=(1<<this.F1)/l,g=1<<this.F2,p=r.t,v=p-c,y=null==t?K():t;s.dlShiftTo(v,y),r.compareTo(y)>=0&&(r[r.t++]=1,r.subTo(y,r)),V.ONE.dlShiftTo(c,y),y.subTo(s,s);while(s.t<c)s[s.t++]=0;while(--v>=0){var m=r[--p]==h?this.DM:Math.floor(r[p]*d+(r[p-1]+g)*f);if((r[p]+=s.am(0,m,r,v,0,c))<m){s.dlShiftTo(v,y),r.subTo(y,r);
20while(r[p]<--m)r.subTo(y,r)}}null!=t&&(r.drShiftTo(c,t),o!=a&&V.ZERO.subTo(t,t)),r.t=c,r.clamp(),u>0&&r.rShiftTo(u,r),o<0&&V.ZERO.subTo(r,r)}}}function me(e){var t=K();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(V.ZERO)>0&&e.subTo(t,t),t}function _e(e){this.m=e}function Fe(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}function Se(e){return e}function be(e){e.divRemTo(this.m,null,e)}function we(e,t,r){e.multiplyTo(t,r),this.reduce(r)}function ke(e,t){e.squareTo(t),this.reduce(t)}function Ee(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return t=t*(2-(15&e)*t)&15,t=t*(2-(255&e)*t)&255,t=t*(2-((65535&e)*t&65535))&65535,t=t*(2-e*t%this.DV)%this.DV,t>0?this.DV-t:-t}function xe(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function Ae(e){var t=K();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(V.ZERO)>0&&this.m.subTo(t,t),t}function Pe(e){var t=K();return e.copyTo(t),this.reduce(t),t}function Ce(e){while(e.t<=this.mt2)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&e[t],i=r*this.mpl+((r*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;r=t+this.m.t,e[r]+=this.m.am(0,i,e,t,0,this.m.t);while(e[r]>=e.DV)e[r]-=e.DV,e[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)}function Te(e,t){e.squareTo(t),this.reduce(t)}function Re(e,t,r){e.multiplyTo(t,r),this.reduce(r)}function Ie(){return 0==(this.t>0?1&this[0]:this.s)}function De(e,t){if(e>4294967295||e<1)return V.ONE;var r=K(),i=K(),n=t.convert(this),s=ue(e)-1;n.copyTo(r);while(--s>=0)if(t.sqrTo(r,i),(e&1<<s)>0)t.mulTo(i,n,r);else{var o=r;r=i,i=o}return t.revert(r)}function je(e,t){var r;return r=e<256||t.isEven()?new _e(t):new xe(t),this.exp(e,r)} 21/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ 22 */ 23function Ne(){var e=K();return this.copyTo(e),e}function Oe(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function He(){return 0==this.t?this.s:this[0]<<24>>24}function Be(){return 0==this.t?this.s:this[0]<<16>>16}function Ue(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}function Me(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1}function Ve(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),i=te(r),n=K(),s=K(),o="";this.divRemTo(i,n,s);while(n.signum()>0)o=(r+s.intValue()).toString(e).substr(1)+o,n.divRemTo(i,n,s);return s.intValue().toString(e)+o}function Ke(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),i=Math.pow(t,r),n=!1,s=0,o=0,a=0;a<e.length;++a){var u=X(e,a);u<0?"-"==e.charAt(a)&&0==this.signum()&&(n=!0):(o=t*o+u,++s>=r&&(this.dMultiply(i),this.dAddOffset(o,0),s=0,o=0))}s>0&&(this.dMultiply(Math.pow(t,s)),this.dAddOffset(o,0)),n&&V.ZERO.subTo(this,this)}function qe(e,t,r){if("number"==typeof t)if(e<2)this.fromInt(1);else{this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(V.ONE.shiftLeft(e-1),Qe,this),this.isEven()&&this.dAddOffset(1,0);while(!this.isProbablePrime(t))this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(V.ONE.shiftLeft(e-1),this)}else{var i=new Array,n=7&e;i.length=1+(e>>3),t.nextBytes(i),n>0?i[0]&=(1<<n)-1:i[0]=0,this.fromString(i,256)}}function Le(){var e=this.t,t=new Array;t[0]=this.s;var r,i=this.DB-e*this.DB%8,n=0;if(e-- >0){i<this.DB&&(r=this[e]>>i)!=(this.s&this.DM)>>i&&(t[n++]=r|this.s<<this.DB-i);while(e>=0)i<8?(r=(this[e]&(1<<i)-1)<<8-i,r|=this[--e]>>(i+=this.DB-8)):(r=this[e]>>(i-=8)&255,i<=0&&(i+=this.DB,--e)),0!=(128&r)&&(r|=-256),0==n&&(128&this.s)!=(128&r)&&++n,(n>0||r!=this.s)&&(t[n++]=r)}return t}function Je(e){return 0==this.compareTo(e)}function We(e){return this.compareTo(e)<0?this:e}function ze(e){return this.compareTo(e)>0?this:e}function $e(e,t,r){var i,n,s=Math.min(e.t,this.t);for(i=0;i<s;++i)r[i]=t(this[i],e[i]);if(e.t<this.t){for(n=e.s&this.DM,i=s;i<this.t;++i)r[i]=t(this[i],n);r.t=this.t}else{for(n=this.s&this.DM,i=s;i<e.t;++i)r[i]=t(n,e[i]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()}function Ge(e,t){return e&t}function Ye(e){var t=K();return this.bitwiseTo(e,Ge,t),t}function Qe(e,t){return e|t}function Xe(e){var t=K();return this.bitwiseTo(e,Qe,t),t}function Ze(e,t){return e^t}function et(e){var t=K();return this.bitwiseTo(e,Ze,t),t}function tt(e,t){return e&~t}function rt(e){var t=K();return this.bitwiseTo(e,tt,t),t}function it(){for(var e=K(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e}function nt(e){var t=K();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}function st(e){var t=K();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}function ot(e){if(0==e)return-1;var t=0;return 0==(65535&e)&&(e>>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function at(){for(var e=0;e<this.t;++e)if(0!=this[e])return e*this.DB+ot(this[e]);return this.s<0?this.t*this.DB:-1}function ut(e){var t=0;while(0!=e)e&=e-1,++t;return t}function ct(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=ut(this[r]^t);return e}function ht(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:0!=(this[t]&1<<e%this.DB)}function lt(e,t){var r=V.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r}function dt(e){return this.changeBit(e,Qe)}function ft(e){return this.changeBit(e,tt)}function gt(e){return this.changeBit(e,Ze)}function pt(e,t){var r=0,i=0,n=Math.min(e.t,this.t);while(r<n)i+=this[r]+e[r],t[r++]=i&this.DM,i>>=this.DB;if(e.t<this.t){i+=e.s;while(r<this.t)i+=this[r],t[r++]=i&this.DM,i>>=this.DB;i+=this.s}else{i+=this.s;while(r<e.t)i+=e[r],t[r++]=i&this.DM,i>>=this.DB;i+=e.s}t.s=i<0?-1:0,i>0?t[r++]=i:i<-1&&(t[r++]=this.DV+i),t.t=r,t.clamp()}function vt(e){var t=K();return this.addTo(e,t),t}function yt(e){var t=K();return this.subTo(e,t),t}function mt(e){var t=K();return this.multiplyTo(e,t),t}function _t(){var e=K();return this.squareTo(e),e}function Ft(e){var t=K();return this.divRemTo(e,t,null),t}function St(e){var t=K();return this.divRemTo(e,null,t),t}function bt(e){var t=K(),r=K();return this.divRemTo(e,t,r),new Array(t,r)}function wt(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}function kt(e,t){if(0!=e){while(this.t<=t)this[this.t++]=0;this[t]+=e;while(this[t]>=this.DV)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}}function Et(){}function xt(e){return e}function At(e,t,r){e.multiplyTo(t,r)}function Pt(e,t){e.squareTo(t)}function Ct(e){return this.exp(e,new Et)}
23function Tt(e,t,r){var i,n=Math.min(this.t+e.t,t);r.s=0,r.t=n;while(n>0)r[--n]=0;for(i=r.t-this.t;n<i;++n)r[n+this.t]=this.am(0,e[n],r,n,0,this.t);for(i=Math.min(e.t,t);n<i;++n)this.am(0,e[n],r,n,0,t-n);r.clamp()}function Rt(e,t,r){--t;var i=r.t=this.t+e.t-t;r.s=0;while(--i>=0)r[i]=0;for(i=Math.max(t-this.t,0);i<e.t;++i)r[this.t+i-t]=this.am(t-i,e[i],r,0,0,this.t+i-t);r.clamp(),r.drShiftTo(1,r)}function It(e){this.r2=K(),this.q3=K(),V.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}function Dt(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=K();return e.copyTo(t),this.reduce(t),t}function jt(e){return e}function Nt(e){e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);while(e.compareTo(this.r2)<0)e.dAddOffset(1,this.m.t+1);e.subTo(this.r2,e);while(e.compareTo(this.m)>=0)e.subTo(this.m,e)}function Ot(e,t){e.squareTo(t),this.reduce(t)}function Ht(e,t,r){e.multiplyTo(t,r),this.reduce(r)}function Bt(e,t){var r,i,n=e.bitLength(),s=te(1);if(n<=0)return s;r=n<18?1:n<48?3:n<144?4:n<768?5:6,i=n<8?new _e(t):t.isEven()?new It(t):new xe(t);var o=new Array,a=3,u=r-1,c=(1<<r)-1;if(o[1]=i.convert(this),r>1){var h=K();i.sqrTo(o[1],h);while(a<=c)o[a]=K(),i.mulTo(h,o[a-2],o[a]),a+=2}var l,d,f=e.t-1,g=!0,p=K();n=ue(e[f])-1;while(f>=0){n>=u?l=e[f]>>n-u&c:(l=(e[f]&(1<<n+1)-1)<<u-n,f>0&&(l|=e[f-1]>>this.DB+n-u)),a=r;while(0==(1&l))l>>=1,--a;if((n-=a)<0&&(n+=this.DB,--f),g)o[l].copyTo(s),g=!1;else{while(a>1)i.sqrTo(s,p),i.sqrTo(p,s),a-=2;a>0?i.sqrTo(s,p):(d=s,s=p,p=d),i.mulTo(p,o[l],s)}while(f>=0&&0==(e[f]&1<<n))i.sqrTo(s,p),d=s,s=p,p=d,--n<0&&(n=this.DB-1,--f)}return i.revert(s)}function Ut(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var i=t;t=r,r=i}var n=t.getLowestSetBit(),s=r.getLowestSetBit();if(s<0)return t;n<s&&(s=n),s>0&&(t.rShiftTo(s,t),r.rShiftTo(s,r));while(t.signum()>0)(n=t.getLowestSetBit())>
230&&t.rShiftTo(n,t),(n=r.getLowestSetBit())>0&&r.rShiftTo(n,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return s>0&&r.lShiftTo(s,r),r}function Mt(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(0==t)r=this[0]%e;else for(var i=this.t-1;i>=0;--i)r=(t*r+this[i])%e;return r}function Vt(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return V.ZERO;var r=e.clone(),i=this.clone(),n=te(1),s=te(0),o=te(0),a=te(1);while(0!=r.signum()){while(r.isEven())r.rShiftTo(1,r),t?(n.isEven()&&s.isEven()||(n.addTo(this,n),s.subTo(e,s)),n.rShiftTo(1,n)):s.isEven()||s.subTo(e,s),s.rShiftTo(1,s);while(i.isEven())i.rShiftTo(1,i),t?(o.isEven()&&a.isEven()||(o.addTo(this,o),a.subTo(e,a)),o.rShiftTo(1,o)):a.isEven()||a.subTo(e,a),a.rShiftTo(1,a);r.compareTo(i)>=0?(r.subTo(i,r),t&&n.subTo(o,n),s.subTo(a,s)):(i.subTo(r,i),t&&o.subTo(n,o),a.subTo(s,a))}return 0!=i.compareTo(V.ONE)?V.ZERO:a.compareTo(e)>=0?a.subtract(e):a.signum()<0?(a.addTo(e,a),a.signum()<0?a.add(e):a):a}_e.prototype.convert=Fe,_e.prototype.revert=Se,_e.prototype.reduce=be,_e.prototype.mulTo=we,_e.prototype.sqrTo=ke,xe.prototype.convert=Ae,xe.prototype.revert=Pe,xe.prototype.reduce=Ce,xe.prototype.mulTo=Re,xe.prototype.sqrTo=Te,V.prototype.copyTo=Z,V.prototype.fromInt=ee,V.prototype.fromString=re,V.prototype.clamp=ie,V.prototype.dlShiftTo=he,V.prototype.drShiftTo=le,V.prototype.lShiftTo=de,V.prototype.rShiftTo=fe,V.prototype.subTo=ge,V.prototype.multiplyTo=pe,V.prototype.squareTo=ve,V.prototype.divRemTo=ye,V.prototype.invDigit=Ee,V.prototype.isEven=Ie,V.prototype.exp=De,V.prototype.toString=ne,V.prototype.negate=se,V.prototype.abs=oe,V.prototype.compareTo=ae,V.prototype.bitLength=ce,V.prototype.mod=me,V.prototype.modPowInt=je,V.ZERO=te(0),V.ONE=te(1),Et.prototype.convert=xt,Et.prototype.revert=xt,Et.prototype.mulTo=At,Et.prototype.sqrTo=Pt,It.prototype.convert=Dt,It.prototype.revert=jt,It.prototype.reduce=Nt,It.prototype.mulTo=Ht,It.prototype.sqrTo=Ot;var Kt=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],qt=(1<<26)/Kt[Kt.length-1];function Lt(e){var t,r=this.abs();if(1==r.t&&r[0]<=Kt[Kt.length-1]){for(t=0;t<Kt.length;++t)if(r[0]==Kt[t])return!0;return!1}if(r.isEven())return!1;t=1;while(t<Kt.length){var i=Kt[t],n=t+1;while(n<Kt.length&&i<qt)i*=Kt[n++];i=r.modInt(i);while(t<n)if(i%Kt[t++]==0)return!1}return r.millerRabin(e)}function Jt(e){var t=this.subtract(V.ONE),r=t.getLowestSetBit();if(r<=0)return!1;var i=t.shiftRight(r);e=e+1>>1,e>Kt.length&&(e=Kt.length);for(var n=K(),s=0;s<e;++s){n.fromInt(Kt[Math.floor(Math.random()*Kt.length)]);var o=n.modPow(i,this);if(0!=o.compareTo(V.ONE)&&0!=o.compareTo(t)){var a=1;while(a++<r&&0!=o.compareTo(t))if(o=o.modPowInt(2,this),0==o.compareTo(V.ONE))return!1;if(0!=o.compareTo(t))return!1}}return!0} 24/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ 25 */ 26function Wt(){this.i=0,this.j=0,this.S=new Array}function zt(e){var t,r,i;for(t=0;t<256;++t)this.S[t]=t;for(r=0,t=0;t<256;++t)r=r+this.S[t]+e[t%e.length]&255,i=this.S[t],this.S[t]=this.S[r],this.S[r]=i;this.i=0,this.j=0}function $t(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]}function Gt(){return new Wt}V.prototype.chunkSize=Ue,V.prototype.toRadix=Ve,V.prototype.fromRadix=Ke,V.prototype.fromNumber=qe,V.prototype.bitwiseTo=$e,V.prototype.changeBit=lt,V.prototype.addTo=pt,V.prototype.dMultiply=wt,V.prototype.dAddOffset=kt,V.prototype.multiplyLowerTo=Tt,V.prototype.multiplyUpperTo=Rt,V.prototype.modInt=Mt,V.prototype.millerRabin=Jt,V.prototype.clone=Ne,V.prototype.intValue=Oe,V.prototype.byteValue=He,V.prototype.shortValue=Be,V.prototype.signum=Me,V.prototype.toByteArray=Le,V.prototype.equals=Je,V.prototype.min=We,V.prototype.max=ze,V.prototype.and=Ye,V.prototype.or=Xe,V.prototype.xor=et,V.prototype.andNot=rt,V.prototype.not=it,V.prototype.shiftLeft=nt,V.prototype.shiftRight=st,V.prototype.getLowestSetBit=at,V.prototype.bitCount=ct,V.prototype.testBit=ht,V.prototype.setBit=dt,V.prototype.clearBit=ft,V.prototype.flip
26Bit=gt,V.prototype.add=vt,V.prototype.subtract=yt,V.prototype.multiply=mt,V.prototype.divide=Ft,V.prototype.remainder=St,V.prototype.divideAndRemainder=bt,V.prototype.modPow=Bt,V.prototype.modInverse=Vt,V.prototype.pow=Ct,V.prototype.gcd=Ut,V.prototype.isProbablePrime=Lt,V.prototype.square=_t,Wt.prototype.init=zt,Wt.prototype.next=$t;var Yt,Qt,Xt,Zt=256; 27/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ 28 */function er(e){Qt[Xt++]^=255&e,Qt[Xt++]^=e>>8&255,Qt[Xt++]^=e>>16&255,Qt[Xt++]^=e>>24&255,Xt>=Zt&&(Xt-=Zt)}function tr(){er((new Date).getTime())}if(null==Qt){var rr;if(Qt=new Array,Xt=0,void 0!==R&&(void 0!==R.crypto||void 0!==R.msCrypto)){var ir=R.crypto||R.msCrypto;if(ir.getRandomValues){var nr=new Uint8Array(32);for(ir.getRandomValues(nr),rr=0;rr<32;++rr)Qt[Xt++]=nr[rr]}else if("Netscape"==T.appName&&T.appVersion<"5"){var sr=R.crypto.random(32);for(rr=0;rr<sr.length;++rr)Qt[Xt++]=255&sr.charCodeAt(rr)}}while(Xt<Zt)rr=Math.floor(65536*Math.random()),Qt[Xt++]=rr>>>8,Qt[Xt++]=255&rr;Xt=0,tr()}function or(){if(null==Yt){for(tr(),Yt=Gt(),Yt.init(Qt),Xt=0;Xt<Qt.length;++Xt)Qt[Xt]=0;Xt=0}return Yt.next()}function ar(e){var t;for(t=0;t<e.length;++t)e[t]=or()}function ur(){} 29/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ 30 */ 31function cr(e,t){return new V(e,t)}function hr(e,t){if(t<e.length+11)throw"Message too long for RSA";var r=new Array,i=e.length-1;while(i>=0&&t>0){var n=e.charCodeAt(i--);n<128?r[--t]=n:n>127&&n<2048?(r[--t]=63&n|128,r[--t]=n>>6|192):(r[--t]=63&n|128,r[--t]=n>>6&63|128,r[--t]=n>>12|224)}r[--t]=0;var s=new ur,o=new Array;while(t>2){o[0]=0;while(0==o[0])s.nextBytes(o);r[--t]=o[0]}return r[--t]=2,r[--t]=0,new V(r)}function lr(e,t,r){var i="",n=0;while(i.length<t)i+=r(String.fromCharCode.apply(String,e.concat([(4278190080&n)>>24,(16711680&n)>>16,(65280&n)>>8,255&n]))),n+=1;return i}function dr(e,t,r,i){var n=Wr.crypto.MessageDigest,s=Wr.crypto.Util,o=null;if(r||(r="sha1"),"string"===typeof r&&(o=n.getCanonicalAlgName(r),i=n.getHashLength(o),r=function(e){return si(s.hashHex(oi(e),o))}),e.length+2*i+2>t)throw"Message too long for RSA";var a,u="";for(a=0;a<t-e.length-2*i-2;a+=1)u+="\0";var c=r("")+u+"�"+e,h=new Array(i);(new ur).nextBytes(h);var l=lr(h,c.length,r),d=[];for(a=0;a<c.length;a+=1)d[a]=c.charCodeAt(a)^l.charCodeAt(a);var f=lr(d,h.length,r),g=[0];for(a=0;a<h.length;a+=1)g[a+1]=h[a]^f.charCodeAt(a);return new V(g.concat(d))}function fr(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}function gr(e,t){if(this.isPublic=!0,this.isPrivate=!1,"string"!==typeof e)this.n=e,this.e=t;else{if(!(null!=e&&null!=t&&e.length>0&&t.length>0))throw"Invalid RSA public key";this.n=cr(e,16),this.e=parseInt(t,16)}}function pr(e){return e.modPowInt(this.e,this.n)}function vr(e){var t=hr(e,this.n.bitLength()+7>>3);if(null==t)return null;var r=this.doPublic(t);if(null==r)return null;var i=r.toString(16);return 0==(1&i.length)?i:"0"+i}function yr(e,t,r){var i=dr(e,this.n.bitLength()+7>>3,t,r);if(null==i)return null;var n=this.doPublic(i);if(null==n)return null;var s=n.toString(16);return 0==(1&s.length)?s:"0"+s} 32/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ 33 */ 34function mr(e,t){this.x=t,this.q=e}function _r(e){return e==this||this.q.equals(e.q)&&this.x.equals(e.x)}function Fr(){return this.x}function Sr(){return new mr(this.q,this.x.negate().mod(this.q))}function br(e){return new mr(this.q,this.x.add(e.toBigInteger()).mod(this.q))}function wr(e){return new mr(this.q,this.x.subtract(e.toBigInteger()).mod(this.q))}function kr(e){return new mr(this.q,this.x.multiply(e.toBigInteger()).mod(this.q))}function Er(){return new mr(this.q,this.x.square().mod(this.q))}function xr(e){return new mr(this.q,this.x.multiply(e.toBigInteger().modInverse(this.q)).mod(this.q))}function Ar(e,t,r,i){this.curve=e,this.x=t,this.y=r,this.z=null==i?V.ONE:i,this.zinv=null}function Pr(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))}function Cr(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))}function Tr(e){return e==this||(this.isInfinity()?e.isInfinity():e.isInfinity()?this.isInfinity():(t=e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q),!!t.equals(V.ZERO)&&(r=e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q),r.equals(V.ZERO))));var t,r}function Rr(){return null==this.x&&null==this.y||this.z.equals(V.ZERO)&&!this.y.toBigInteger().equals(V.ZERO)}function Ir(){return new Ar(this.curve,this.x,this.y.negate(),this.z)}function Dr(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q),r=e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q);if(V.ZERO.equals(r))return V.ZERO.equals(t)?this.twice():this.curve.getInfinity();var i=new V("3"),n=this.x.toBigInteger(),s=this.y.toBigInteger(),o=(e.x.toBigInteger(),e.y.toBigInteger(),r.square()),a=o.multiply(r),u=n.multiply(o),c=t.square().multiply(this.z),h=c.subtract(u.shiftLeft(1)).multiply(e.z).subtract(a).multiply(r).mod(this.curve.q),l=u.multiply(i).multiply(t).subtract(s.multiply(a)).subtract(c.multiply(t)).multiply(e.z).add(t.multiply(a)).mod(this.curve.q),d=a.multiply(this.z).multiply(e.z).mod(this.curve.q);return new Ar(this.curve,this.curve.fromBigInteger(h),this.curve.fromBigInteger(l),d)}function jr(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var e=new V("3"),t=this.x.toBigInteger(),r=this.y.toBigInteger(),i=r.multiply(this.z),n=i.multiply(r).mod(this.curve.q),s=this.curve.a.toBigInteger(),o=t.square().multiply(e);V.ZERO.equals(s)||(o=o.add(this.z.square().multiply(s))),o=o.mod(this.curve.q);var a=o.square().subtract(t.shiftLeft(3).multiply(n)).shiftLeft(1).multiply(i).mod(this.curve.q),u=o.multiply(e).multiply(t).subtract(n.shiftLeft(1)).shiftLeft(2).multiply(n).subtract(o.square().multiply(o)).mod(this.curve.q),c=i.square().multiply(i).shiftLeft(3).mod(this.curve.q);return new Ar(this.curve,this.curve.fromBigInteger(a),this.curve.fromBigInteger(u),c)}function Nr(e){if(this.isInfinity())return this;if(0==e.signum())return this.curve.getInfinity();var t,r=e,i=r.multiply(new V("3")),n=this.negate(),s=this;for(t=i.bitLength()-2;t>0;--t){s=s.twice();var o=i.testBit(t),a=r.testBit(t);o!=a&&(s=s.add(o?this:n))}return s}function Or(e,t,r){var i;i=e.bitLength()>r.bitLength()?e.bitLength()-1:r.bitLength()-1;var n=this.curve.getInfinity(),s=this.add(t);while(i>=0)n=n.twice(),e.testBit(i)?n=r.testBit(i)?n.add(s):n.add(this):r.testBit(i)&&(n=n.add(t)),--i;return n}function Hr(e,t,r){this.q=e,this.a=this.fromBigInteger(t),this.b=this.fromBigInteger(r),this.infinity=new Ar(this,null,null)}function Br(){return this.q}function Ur(){return this.a}function Mr(){return this.b}function Vr(e){return e==this||this.q.equals(e.q)&&this.a.equals(e.a)&&this.b.equals(e.b)}function Kr(){return this.infinity}function qr(e){return new mr(this.q,e)}function Lr(e){switch(parseInt(e.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:return null;case 4:case 6:case 7:var t=(e.length-2)/2,r=e.substr(2,t),i=e.substr(t+2,t);return new Ar(this,this.fromBigInteger(new V(r,16)),this.fromBigInteger(new V(i,16)));default:return null}}ur.prototype.nextBytes=ar,fr.prototype.doPublic=pr,fr.prototype.setPublic=gr,fr.prototype.encrypt=vr,fr.prototype.encryptOAEP=yr,fr.prototype.type="RSA",mr.prototype.equals=_r,mr.prototype.toBigInteger=Fr,mr.prototype.negate=Sr,mr.prototype.add=br,mr.prototype.subtract=wr,mr.prototype.multiply=kr,mr.prototype.square=Er,mr.prototype.divide=xr,Ar.prototype.getX=Pr,Ar.prototype.getY=Cr,Ar.prototype.equals=Tr,Ar.prototype.isInfinity=Rr,Ar.prototype.negate=Ir,Ar.prototype.add=Dr,Ar.prototype.twice=jr,Ar.prototype.multiply=Nr,Ar.prototype.multiplyTwo=Or,Hr.prototype.getQ=Br,Hr.prototype.getA=Ur,Hr.prototype.getB=Mr,Hr.prototype.equals=Vr,Hr.prototype.getInfinity=Kr,Hr.prototype.fromBigInteger=qr,Hr.prototype.decodePointHex=Lr, 35/*! (c) Stefan Thomas | https://github.com/bitcoinjs/bitcoinjs-lib 36 */ 37mr.prototype.getByteLength=function(){return Math.floor((this.toBigInteger().bitLength()+7)/8)},Ar.prototype.getEncoded=function(e){var t=function(e,t){var r=e.toByteArrayUnsigned();if(t<r.length)r=r.slice(r.length-t);else while(t>r.length)r.unshift(0);return r},r=this.getX().toBigInteger(),i=this.getY().toBigInteger(),n=t(r,32);return e?i.isEven()?n.unshift(2):n.unshift(3):(n.unshift(4),n=n.concat(t(i,32))),n},Ar.decodeFrom=function(e,t){t[0];var r=t.length-1,i=t.slice(1,1+r/2),n=t.slice(1+r/2,1+r);i.unshift(0),n.unshift(0);var s=new V(i),o=new V(n);return new Ar(e,e.fromBigInteger(s),e.fromBigInteger(o))},Ar.decodeFromHex=function(e,t){t.substr(0,2);var r=t.length-2,i=t.substr(2,r/2),n=t.substr(2+r/2,r/2),s=new V(i,16),o=new V(n,16);return new Ar(e,e.fromBigInteger(s),e.fromBigInteger(o))},Ar.prototype.add2D=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;if(this.x.equals(e.x))return this.y.equals(e.y)?this.twice():this.curve.getInfinity();var t=e.x.subtract(this.x),r=e.y.subtract(this.y),i=r.divide(t),n=i.square().subtract(this.x).subtract(e.x),s=i.multiply(this.x.subtract(n)).subtract(this.y);return new Ar(this.curve,n,s)},Ar.prototype.twice2D=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var e=this.curve.fromBigInteger(V.valueOf(2)),t=this.curve.fromBigInteger(V.valueOf(3)),r=this.x.square().multiply(t).add(this.curve.a).divide(this.y.multiply(e)),i=r.square().subtract(this.x.multiply(e)),n=r.multiply(this.x.subtract(i)).subtract(this.y);return new Ar(this.curve,i,n)},Ar.prototype.multiply2D=function(e){if(this.isInfinity())return this;if(0==e.signum())return this.curve.getInfinity();var t,r=e,i=r.multiply(new V("3")),n=this.negate(),s=this;for(t=i.bitLength()-2;t>0;--t){s=s.twice();var o=i.testBit(t),a=r.testBit(t);o!=a&&(s=s.add2D(o?this:n))}return s},Ar.prototype.isOnCurve=function(){var e=this.getX().toBigInteger(),t=this.getY().toBigInteger(),r=this.curve.getA
37().toBigInteger(),i=this.curve.getB().toBigInteger(),n=this.curve.getQ(),s=t.multiply(t).mod(n),o=e.multiply(e).multiply(e).add(r.multiply(e)).add(i).mod(n);return s.equals(o)},Ar.prototype.toString=function(){return"("+this.getX().toBigInteger().toString()+","+this.getY().toBigInteger().toString()+")"},Ar.prototype.validate=function(){var e=this.curve.getQ();if(this.isInfinity())throw new Error("Point is at infinity.");var t=this.getX().toBigInteger(),r=this.getY().toBigInteger();if(t.compareTo(V.ONE)<0||t.compareTo(e.subtract(V.ONE))>0)throw new Error("x coordinate out of bounds");if(r.compareTo(V.ONE)<0||r.compareTo(e.subtract(V.ONE))>0)throw new Error("y coordinate out of bounds");if(!this.isOnCurve())throw new Error("Point is not on the curve.");if(this.multiply(e).isInfinity())throw new Error("Point is not a scalar multiple of G.");return!0}; 38/*! Mike Samuel (c) 2009 | code.google.com/p/json-sans-eval 39 */ 40var Jr=function(){var e="(?:-?\\b(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\\b)",t='(?:[^\\0-\\x08\\x0a-\\x1f"\\\\]|\\\\(?:["/\\\\bfnrt]|u[0-9A-Fa-f]{4}))',r='(?:"'+t+'*")',i=new RegExp("(?:false|true|null|[\\{\\}\\[\\]]|"+e+"|"+r+")","g"),n=new RegExp("\\\\(?:([^u])|u(.{4}))","g"),s={'"':'"',"/":"/","\\":"\\",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function o(e,t,r){return t?s[t]:String.fromCharCode(parseInt(r,16))}var a=new String(""),u="\\",c=Object.hasOwnProperty;return function(e,t){var r,s,h=e.match(i),l=h[0],d=!1;"{"===l?r={}:"["===l?r=[]:(r=[],d=!0);for(var f=[r],g=1-d,p=h.length;g<p;++g){var v;switch(l=h[g],l.charCodeAt(0)){default:v=f[0],v[s||v.length]=+l,s=void 0;break;case 34:if(l=l.substring(1,l.length-1),-1!==l.indexOf(u)&&(l=l.replace(n,o)),v=f[0],!s){if(!(v instanceof Array)){s=l||a;break}s=v.length}v[s]=l,s=void 0;break;case 91:v=f[0],f.unshift(v[s||v.length]=[]),s=void 0;break;case 93:f.shift();break;case 102:v=f[0],v[s||v.length]=!1,s=void 0;break;case 110:v=f[0],v[s||v.length]=null,s=void 0;break;case 116:v=f[0],v[s||v.length]=!0,s=void 0;break;case 123:v=f[0],f.unshift(v[s||v.length]={}),s=void 0;break;case 125:f.shift();break}}if(d){if(1!==f.length)throw new Error;r=r[0]}else if(f.length)throw new Error;if(t){var y=function e(r,i){var n=r[i];if(n&&"object"===Object(S["a"])(n)){var s=null;for(var o in n)if(c.call(n,o)&&n!==r){var a=e(n,o);void 0!==a?n[o]=a:(s||(s=[]),s.push(o))}if(s)for(var u=s.length;--u>=0;)delete n[s[u]]}return t.call(r,i,n)};r=y({"":r},"")}return r}}();"undefined"!=typeof Wr&&Wr||(Wr={}),"undefined"!=typeof Wr.asn1&&Wr.asn1||(Wr.asn1={}),Wr.asn1.ASN1Util=new function(){this.integerToByteHex=function(e){var t=e.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(e){var t=e.toString(16);if("-"!=t.substr(0,1))t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{var r=t.substr(1),i=r.length;i%2==1?i+=1:t.match(/^[0-7]/)||(i+=2);for(var n="",s=0;s<i;s++)n+="f";var o=new V(n,16),a=o.xor(e).add(V.ONE);t=a.toString(16).replace(/^-/,"")}return t},this.getPEMStringFromHex=function(e,t){return hi(e,t)},this.newObject=function(e){var t=Wr,r=t.asn1,i=r.DERBoolean,n=r.DERInteger,s=r.DERBitString,o=r.DEROctetString,a=r.DERNull,u=r.DERObjectIdentifier,c=r.DEREnumerated,h=r.DERUTF8String,l=r.DERNumericString,d=r.DERPrintableString,f=r.DERTeletexString,g=r.DERIA5String,p=r.DERUTCTime,v=r.DERGeneralizedTime,y=r.DERSequence,m=r.DERSet,_=r.DERTaggedObject,F=r.ASN1Util.newObject,S=Object.keys(e);if(1!=S.length)throw"key of param shall be only one.";var b=S[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+b+":"))throw"undefined key: "+b;if("bool"==b)return new i(e[b]);if("int"==b)return new n(e[b]);if("bitstr"==b)return new s(e[b]);if("octstr"==b)return new o(e[b]);if("null"==b)return new a(e[b]);if("oid"==b)return new u(e[b]);if("enum"==b)return new c(e[b]);if("utf8str"==b)return new h(e[b]);if("numstr"==b)return new l(e[b]);if("prnstr"==b)return new d(e[b]);if("telstr"==b)return new f(e[b]);if("ia5str"==b)return new g(e[b]);if("utctime"==b)return new p(e[b]);if("gentime"==b)return new v(e[b]);if("seq"==b){for(var w=e[b],k=[],E=0;E<w.length;E++){var x=F(w[E]);k.push(x)}return new y({array:k})}if("set"==b){for(w=e[b],k=[],E=0;E<w.length;E++){x=F(w[E]);k.push(x)}return new m({array:k})}if("tag"==b){var A=e[b];if("[object Array]"===Object.prototype.toString.call(A)&&3==A.length){var P=F(A[2]);return new _({tag:A[0],explicit:A[1],obj:P})}var C={};if(void 0!==A.explicit&&(C.explicit=A.explicit),void 0!==A.tag&&(C.tag=A.tag),void 0===A.obj)throw"obj shall be specified for 'tag'.";return C.obj=F(A.obj),new _(C)}},this.jsonToASN1HEX=function(e){var t=this.newObject(e);return t.getEncodedHex()}},Wr.asn1.ASN1Util.oidHexToInt=function(e){for(var t="",r=parseInt(e.substr(0,2),16),i=Math.floor(r/40),n=r%40,s=(t=i+"."+n,""),o=2;o<e.length;o+=2){var a=parseInt(e.substr(o,2),16),u=("00000000"+a.toString(2)).slice(-8);if(s+=u.substr(1,7),"0"==u.substr(0,1)){var c=new V(s,2);t=t+"."+c.toString(10),s=""}}return t},Wr.asn1.ASN1Util.oidIntToHex=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},r=function(e){var r="",i=new V(e,10),n=i.toString(2),s=7-n.length%7;7==s&&(s=0);for(var o="",a=0;a<s;a++)o+="0";n=o+n;for(a=0;a<n.length-1;a+=7){var u=n.substr(a,7);a!=n.length-7&&(u="1"+u),r+=t(parseInt(u,2))}return r};if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var i="",n=e.split("."),s=40*parseInt(n[0])+parseInt(n[1]);i+=t(s),n.splice(0,2);for(var o=0;o<n.length;o++)i+=r(n[o]);return i},Wr.asn1.ASN1Object=function(){var e="";this.getLengthHexFromValue=function(){if("undefined"==typeof this.hV||null==this.hV)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n="+e.length+",v="+this.hV;var t=this.hV.length/2,r=t.toString(16);if(r.length%2==1&&(r="0"+r),t<128)return r;var i=r.length/2;if(i>15)throw"ASN.1 length too long to represent by 8x: n = "+t.toString(16);var n=128+i;return n.toString(16)+r},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}},Wr.asn1.DERAbstractString=function(e){Wr.asn1.DERAbstractString.superclass.constructor.call(this);
40this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=ii(this.s).toLowerCase()},this.setStringHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof e&&("string"==typeof e?this.setString(e):"undefined"!=typeof e.str?this.setString(e.str):"undefined"!=typeof e.hex&&this.setStringHex(e.hex))},I.lang.extend(Wr.asn1.DERAbstractString,Wr.asn1.ASN1Object),Wr.asn1.DERAbstractTime=function(e){Wr.asn1.DERAbstractTime.superclass.constructor.call(this);this.localDateToUTC=function(e){utc=e.getTime()+6e4*e.getTimezoneOffset();var t=new Date(utc);return t},this.formatDate=function(e,t,r){var i=this.zeroPadding,n=this.localDateToUTC(e),s=String(n.getFullYear());"utc"==t&&(s=s.substr(2,2));var o=i(String(n.getMonth()+1),2),a=i(String(n.getDate()),2),u=i(String(n.getHours()),2),c=i(String(n.getMinutes()),2),h=i(String(n.getSeconds()),2),l=s+o+a+u+c+h;if(!0===r){var d=n.getMilliseconds();if(0!=d){var f=i(String(d),3);f=f.replace(/[0]+$/,""),l=l+"."+f}}return l+"Z"},this.zeroPadding=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=Xr(e)},this.setByDateValue=function(e,t,r,i,n,s){var o=new Date(Date.UTC(e,t-1,r,i,n,s,0));this.setByDate(o)},this.getFreshValueHex=function(){return this.hV}},I.lang.extend(Wr.asn1.DERAbstractTime,Wr.asn1.ASN1Object),Wr.asn1.DERAbstractStructured=function(e){Wr.asn1.DERAbstractString.superclass.constructor.call(this);this.setByASN1ObjectArray=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array=e},this.appendASN1Object=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array.push(e)},this.asn1Array=new Array,"undefined"!=typeof e&&"undefined"!=typeof e.array&&(this.asn1Array=e.array)},I.lang.extend(Wr.asn1.DERAbstractStructured,Wr.asn1.ASN1Object),Wr.asn1.DERBoolean=function(){Wr.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},I.lang.extend(Wr.asn1.DERBoolean,Wr.asn1.ASN1Object),Wr.asn1.DERInteger=function(e){Wr.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=Wr.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new V(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof e&&("undefined"!=typeof e.bigint?this.setByBigInteger(e.bigint):"undefined"!=typeof e["int"]?this.setByInteger(e["int"]):"number"==typeof e?this.setByInteger(e):"undefined"!=typeof e.hex&&this.setValueHex(e.hex))},I.lang.extend(Wr.asn1.DERInteger,Wr.asn1.ASN1Object),Wr.asn1.DERBitString=function(e){if(void 0!==e&&"undefined"!==typeof e.obj){var t=Wr.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.getEncodedHex()}Wr.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(e){this.hTLV=null,this.isModified=!0,this.hV=e},this.setUnusedBitsAndHexValue=function(e,t){if(e<0||7<e)throw"unused bits shall be from 0 to 7: u = "+e;var r="0"+e;this.hTLV=null,this.isModified=!0,this.hV=r+t},this.setByBinaryString=function(e){e=e.replace(/0+$/,"");var t=8-e.length%8;8==t&&(t=0);for(var r=0;r<=t;r++)e+="0";var i="";for(r=0;r<e.length-1;r+=8){var n=e.substr(r,8),s=parseInt(n,2).toString(16);1==s.length&&(s="0"+s),i+=s}this.hTLV=null,this.isModified=!0,this.hV="0"+t+i},this.setByBooleanArray=function(e){for(var t="",r=0;r<e.length;r++)1==e[r]?t+="1":t+="0";this.setByBinaryString(t)},this.newFalseArray=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=!1;return t},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof e&&("string"==typeof e&&e.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(e):"undefined"!=typeof e.hex?this.setHexValueIncludingUnusedBits(e.hex):"undefined"!=typeof e.bin?this.setByBinaryString(e.bin):"undefined"!=typeof e.array&&this.setByBo
40oleanArray(e.array))},I.lang.extend(Wr.asn1.DERBitString,Wr.asn1.ASN1Object),Wr.asn1.DEROctetString=function(e){if(void 0!==e&&"undefined"!==typeof e.obj){var t=Wr.asn1.ASN1Util.newObject(e.obj);e.hex=t.getEncodedHex()}Wr.asn1.DEROctetString.superclass.constructor.call(this,e),this.hT="04"},I.lang.extend(Wr.asn1.DEROctetString,Wr.asn1.DERAbstractString),Wr.asn1.DERNull=function(){Wr.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},I.lang.extend(Wr.asn1.DERNull,Wr.asn1.ASN1Object),Wr.asn1.DERObjectIdentifier=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},r=function(e){var r="",i=new V(e,10),n=i.toString(2),s=7-n.length%7;7==s&&(s=0);for(var o="",a=0;a<s;a++)o+="0";n=o+n;for(a=0;a<n.length-1;a+=7){var u=n.substr(a,7);a!=n.length-7&&(u="1"+u),r+=t(parseInt(u,2))}return r};Wr.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.setValueOidString=function(e){if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var i="",n=e.split("."),s=40*parseInt(n[0])+parseInt(n[1]);i+=t(s),n.splice(0,2);for(var o=0;o<n.length;o++)i+=r(n[o]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=i},this.setValueName=function(e){var t=Wr.asn1.x509.OID.name2oid(e);if(""===t)throw"DERObjectIdentifier oidName undefined: "+e;this.setValueOidString(t)},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"===typeof e?e.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(e):this.setValueName(e):void 0!==e.oid?this.setValueOidString(e.oid):void 0!==e.hex?this.setValueHex(e.hex):void 0!==e.name&&this.setValueName(e.name))},I.lang.extend(Wr.asn1.DERObjectIdentifier,Wr.asn1.ASN1Object),Wr.asn1.DEREnumerated=function(e){Wr.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=Wr.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new V(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof e&&("undefined"!=typeof e["int"]?this.setByInteger(e["int"]):"number"==typeof e?this.setByInteger(e):"undefined"!=typeof e.hex&&this.setValueHex(e.hex))},I.lang.extend(Wr.asn1.DEREnumerated,Wr.asn1.ASN1Object),Wr.asn1.DERUTF8String=function(e){Wr.asn1.DERUTF8String.superclass.constructor.call(this,e),this.hT="0c"},I.lang.extend(Wr.asn1.DERUTF8String,Wr.asn1.DERAbstractString),Wr.asn1.DERNumericString=function(e){Wr.asn1.DERNumericString.superclass.constructor.call(this,e),this.hT="12"},I.lang.extend(Wr.asn1.DERNumericString,Wr.asn1.DERAbstractString),Wr.asn1.DERPrintableString=function(e){Wr.asn1.DERPrintableString.superclass.constructor.call(this,e),this.hT="13"},I.lang.extend(Wr.asn1.DERPrintableString,Wr.asn1.DERAbstractString),Wr.asn1.DERTeletexString=function(e){Wr.asn1.DERTeletexString.superclass.constructor.call(this,e),this.hT="14"},I.lang.extend(Wr.asn1.DERTeletexString,Wr.asn1.DERAbstractString),Wr.asn1.DERIA5String=function(e){Wr.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="16"},I.lang.extend(Wr.asn1.DERIA5String,Wr.asn1.DERAbstractString),Wr.asn1.DERUTCTime=function(e){Wr.asn1.DERUTCTime.superclass.constructor.call(this,e),this.hT="17",this.setByDate=function(e){this.hTLV=null,this.isModified=!0,this.date=e,this.s=this.formatDate(this.date,"utc"),this.hV=Xr(this.s)},this.getFreshValueHex=function(){return"undefined"==typeof this.date&&"undefined"==typeof this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=Xr(this.s)),this.hV},void 0!==e&&(void 0!==e.str?this.setString(e.str):"string"==typeof e&&e.match(/^[0-9]{12}Z$/)?this.setString(e):void 0!==e.hex?this.setStringHex(e.hex):void 0!==e.date&&this.setByDate(e.date))},I.lang.extend(Wr.asn1.DERUTCTime,Wr.asn1.DERAbstractTime),Wr.asn1.DERGeneralizedTime=function(e){Wr.asn1.DERGeneralizedTime.superclass.constructor.call(this,e),this.hT="18",this.withMillis=!1,this.setByDate=function(e){this.hTLV=null,this.isModified=!0,this.date=e,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=Xr(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=Xr(this.s)),this.hV},void 0!==e&&(void 0!==e.str?this.setString(e.str):"string"==typeof e&&e.match(/^[0-9]{14}Z$/)?this.setString(e):void 0!==e.hex?this.setStringHex(e.hex):void 0!==e.date&&this.setByDate(e.date),!0===e.millis&&(this.withMillis=!0))},I.lang.extend(Wr.asn1.DERGeneralizedTime,Wr.asn1.DERAbstractTime),Wr.asn1.DERSequence=function(e){Wr.asn1.DERSequence.superclass.constructor.call(this,e),this.hT="30",this.getFreshValueHex=function(){for(var e="",t=0;t<this.asn1Array.length;t++){var r=this.asn1Array[t];e+=r.getEncodedHex()}return this.hV=e,this.hV}},I.lang.extend(Wr.asn1.DERSequence,Wr.asn1.DERAbstractStructured),Wr.asn1.DERSet=function(e){Wr.asn1.DERSet.superclass.constructor.call(this,e),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var e=new Array,t=0;t<this.asn1Array.length;t++){var r=this.asn1Array[t];e.push(r.getEncodedHex())}return 1==this.sortFlag&&e.sort(),this.hV=e.join(""),this.hV},"undefined"!=typeof e&&"undefined"!=typeof e.sortflag&&0==e.sortflag&&(this.sortFlag=!1)},I.lang.extend(Wr.asn1.DERSet,Wr.asn1.DERAbstractStructured),Wr.asn1.DERTaggedObject=function(e){Wr.asn1.DERTaggedObject.
40superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(e,t,r){this.hT=t,this.isExplicit=e,this.asn1Object=r,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=r.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,t),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof e&&("undefined"!=typeof e.tag&&(this.hT=e.tag),"undefined"!=typeof e.explicit&&(this.isExplicit=e.explicit),"undefined"!=typeof e.obj&&(this.asn1Object=e.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},I.lang.extend(Wr.asn1.DERTaggedObject,Wr.asn1.ASN1Object);var Wr,zr,$r,Gr=new function(){};function Yr(e){for(var t=new Array,r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}function Qr(e){for(var t="",r=0;r<e.length;r++){var i=e[r].toString(16);1==i.length&&(i="0"+i),t+=i}return t}function Xr(e){return Qr(Yr(e))}function Zr(e){return e=e.replace(/\=/g,""),e=e.replace(/\+/g,"-"),e=e.replace(/\//g,"_"),e}function ei(e){return e.length%4==2?e+="==":e.length%4==3&&(e+="="),e=e.replace(/-/g,"+"),e=e.replace(/_/g,"/"),e}function ti(e){return e.length%2==1&&(e="0"+e),Zr(H(e))}function ri(e){return B(ei(e))}function ii(e){return gi(mi(e))}function ni(e){return decodeURIComponent(pi(e))}function si(e){for(var t="",r=0;r<e.length-1;r+=2)t+=String.fromCharCode(parseInt(e.substr(r,2),16));return t}function oi(e){for(var t="",r=0;r<e.length;r++)t+=("0"+e.charCodeAt(r).toString(16)).slice(-2);return t}function ai(e){return H(e)}function ui(e){var t=ai(e),r=t.replace(/(.{64})/g,"$1\r\n");return r=r.replace(/\r\n$/,""),r}function ci(e){var t=e.replace(/[^0-9A-Za-z\/+=]*/g,""),r=B(t);return r}function hi(e,t){var r=ui(e);return"-----BEGIN "+t+"-----\r\n"+r+"\r\n-----END "+t+"-----\r\n"}function li(e,t){if(-1==e.indexOf("-----BEGIN "))throw"can't find PEM header: "+t;return void 0!==t?(e=e.replace("-----BEGIN "+t+"-----",""),e=e.replace("-----END "+t+"-----","")):(e=e.replace(/-----BEGIN [^-]+-----/,""),e=e.replace(/-----END [^-]+-----/,"")),ci(e)}function di(e){var t,r,i,n,s,o,a,u,c,h,l;if(l=e.match(/^(\d{2}|\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(|\.\d+)Z$/),l)return u=l[1],t=parseInt(u),2===u.length&&(50<=t&&t<100?t=1900+t:0<=t&&t<50&&(t=2e3+t)),r=parseInt(l[2])-1,i=parseInt(l[3]),n=parseInt(l[4]),s=parseInt(l[5]),o=parseInt(l[6]),a=0,c=l[7],""!==c&&(h=(c.substr(1)+"00").substr(0,3),a=parseInt(h)),Date.UTC(t,r,i,n,s,o,a);throw"unsupported zulu format: "+e}function fi(e){var t=di(e);return~~(t/1e3)}function gi(e){return e.replace(/%/g,"")}function pi(e){return e.replace(/(..)/g,"%$1")}function vi(e){if(!e.match(/^[0-9A-Fa-f]{32}$/))throw"malformed IPv6 address octet";e=e.toLowerCase();for(var t=e.match(/.{1,4}/g),r=0;r<8;r++)t[r]=t[r].replace(/^0+/,""),""==t[r]&&(t[r]="0");e=":"+t.join(":")+":";var i=e.match(/:(0:){2,}/g);if(null===i)return e.slice(1,-1);var n="";for(r=0;r<i.length;r++)i[r].length>n.length&&(n=i[r]);return e=e.replace(n,"::"),e.slice(1,-1)}function yi(e){var t,r="malformed hex value";if(!e.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw r;if(8!=e.length)return 32==e.length?vi(e):e;try{return t=parseInt(e.substr(0,2),16)+"."+parseInt(e.substr(2,2),16)+"."+parseInt(e.substr(4,2),16)+"."+parseInt(e.substr(6,2),16),t}catch(i){throw r}}function mi(e){for(var t=encodeURIComponent(e),r="",i=0;i<t.length;i++)"%"==t[i]?(r+=t.substr(i,3),i+=2):r=r+"%"+Xr(t[i]);return r}function _i(e){return e.length%2==1?"0"+e:e.substr(0,1)>"7"?"00"+e:e}Gr.getLblen=function(e,t){if("8"!=e.substr(t+2,1))return 1;var r=parseInt(e.substr(t+3,1));return 0==r?-1:0<r&&r<10?r+1:-2},Gr.getL=function(e,t){var r=Gr.getLblen(e,t);return r<1?"":e.substr(t+2,2*r)},Gr.getVblen=function(e,t){var r,i;return r=Gr.getL(e,t),""==r?-1:(i="8"===r.substr(0,1)?new V(r.substr(2),16):new V(r,16),i.intValue())},Gr.getVidx=function(e,t){var r=Gr.getLblen(e,t);return r<0?r:t+2*(r+1)},Gr.getV=function(e,t){var r=Gr.getVidx(e,t),i=Gr.getVblen(e,t);return e.substr(r,2*i)},Gr.getTLV=function(e,t){return e.substr(t,2)+Gr.getL(e,t)+Gr.getV(e,t)},Gr.getNextSiblingIdx=function(e,t){var r=Gr.getVidx(e,t),i=Gr.getVblen(e,t);return r+2*i},Gr.getChildIdx=function(e,t){var r=Gr,i=new Array,n=r.getVidx(e,t);"03"==e.substr(t,2)?i.push(n+2):i.push(n);var s=r.getVblen(e,t),o=n,a=0;while(1){var u=r.getNextSiblingIdx(e,o);if(null==u||u-n>=2*s)break;if(a>=200)break;i.push(u),o=u,a++}return i},Gr.getNthChildIdx=function(e,t,r){var i=Gr.getChildIdx(e,t);return i[r]},Gr.getIdxbyList=function(e,t,r,i){var n,s,o=Gr;if(0==r.length){if(void 0!==i&&e.substr(t,2)!==i)throw"checking tag doesn't match: "+e.substr(t,2)+"!="+i;return t}return n=r.shift(),s=o.getChildIdx(e,t),o.getIdxbyList(e,s[n],r,i)},Gr.getTLVbyList=function(e,t,r,i){var n=Gr,s=n.getIdxbyList(e,t,r);if(void 0===s)throw"can't find nthList object";if(void 0!==i&&e.substr(s,2)!=i)throw"checking tag doesn't match: "+e.substr(s,2)+"!="+i;return n.getTLV(e,s)},Gr.getVbyList=function(e,t,r,i,n){var s,o,a=Gr;
40if(s=a.getIdxbyList(e,t,r,i),void 0===s)throw"can't find nthList object";return o=a.getV(e,s),!0===n&&(o=o.substr(2)),o},Gr.hextooidstr=function(e){var t=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},r=[],i=e.substr(0,2),n=parseInt(i,16);r[0]=new String(Math.floor(n/40)),r[1]=new String(n%40);for(var s=e.substr(2),o=[],a=0;a<s.length/2;a++)o.push(parseInt(s.substr(2*a,2),16));var u=[],c="";for(a=0;a<o.length;a++)128&o[a]?c+=t((127&o[a]).toString(2),7):(c+=t((127&o[a]).toString(2),7),u.push(new String(parseInt(c,2))),c="");var h=r.join(".");return u.length>0&&(h=h+"."+u.join(".")),h},Gr.dump=function(e,t,r,i){var n=Gr,s=n.getV,o=n.dump,a=n.getChildIdx,u=e;e instanceof Wr.asn1.ASN1Object&&(u=e.getEncodedHex());var c=function(e,t){if(e.length<=2*t)return e;var r=e.substr(0,t)+"..(total "+e.length/2+"bytes).."+e.substr(e.length-t,t);return r};void 0===t&&(t={ommit_long_octet:32}),void 0===r&&(r=0),void 0===i&&(i="");var h=t.ommit_long_octet;if("01"==u.substr(r,2)){var l=s(u,r);return"00"==l?i+"BOOLEAN FALSE\n":i+"BOOLEAN TRUE\n"}if("02"==u.substr(r,2)){l=s(u,r);return i+"INTEGER "+c(l,h)+"\n"}if("03"==u.substr(r,2)){l=s(u,r);return i+"BITSTRING "+c(l,h)+"\n"}if("04"==u.substr(r,2)){l=s(u,r);if(n.isASN1HEX(l)){var d=i+"OCTETSTRING, encapsulates\n";return d+=o(l,t,0,i+" "),d}return i+"OCTETSTRING "+c(l,h)+"\n"}if("05"==u.substr(r,2))return i+"NULL\n";if("06"==u.substr(r,2)){var f=s(u,r),g=Wr.asn1.ASN1Util.oidHexToInt(f),p=Wr.asn1.x509.OID.oid2name(g),v=g.replace(/\./g," ");return""!=p?i+"ObjectIdentifier "+p+" ("+v+")\n":i+"ObjectIdentifier ("+v+")\n"}if("0c"==u.substr(r,2))return i+"UTF8String '"+ni(s(u,r))+"'\n";if("13"==u.substr(r,2))return i+"PrintableString '"+ni(s(u,r))+"'\n";if("14"==u.substr(r,2))return i+"TeletexString '"+ni(s(u,r))+"'\n";if("16"==u.substr(r,2))return i+"IA5String '"+ni(s(u,r))+"'\n";if("17"==u.substr(r,2))return i+"UTCTime "+ni(s(u,r))+"\n";if("18"==u.substr(r,2))return i+"GeneralizedTime "+ni(s(u,r))+"\n";if("30"==u.substr(r,2)){if("3000"==u.substr(r,4))return i+"SEQUENCE {}\n";d=i+"SEQUENCE\n";var y=a(u,r),m=t;if((2==y.length||3==y.length)&&"06"==u.substr(y[0],2)&&"04"==u.substr(y[y.length-1],2)){p=n.oidname(s(u,y[0]));var _=JSON.parse(JSON.stringify(t));_.x509ExtName=p,m=_}for(var F=0;F<y.length;F++)d+=o(u,m,y[F],i+" ");return d}if("31"==u.substr(r,2)){for(d=i+"SET\n",y=a(u,r),F=0;F<y.length;F++)d+=o(u,t,y[F],i+" ");return d}var S=parseInt(u.substr(r,2),16);if(0!=(128&S)){var b=31&S;if(0!=(32&S)){for(d=i+"["+b+"]\n",y=a(u,r),F=0;F<y.length;F++)d+=o(u,t,y[F],i+" ");return d}l=s(u,r);"68747470"==l.substr(0,8)&&(l=ni(l)),"subjectAltName"===t.x509ExtName&&2==b&&(l=ni(l));d=i+"["+b+"] "+l+"\n";return d}return i+"UNKNOWN("+u.substr(r,2)+") "+s(u,r)+"\n"},Gr.isASN1HEX=function(e){var t=Gr;if(e.length%2==1)return!1;var r=t.getVblen(e,0),i=e.substr(0,2),n=t.getL(e,0),s=e.length-i.length-n.length;return s==2*r},Gr.oidname=function(e){var t=Wr.asn1;Wr.lang.String.isHex(e)&&(e=t.ASN1Util.oidHexToInt(e));var r=t.x509.OID.oid2name(e);return""===r&&(r=e),r},"undefined"!=typeof Wr&&Wr||(Wr={}),"undefined"!=typeof Wr.lang&&Wr.lang||(Wr.lang={}),Wr.lang.String=function(){},"function"===typeof Buffer?(zr=function(e){return Zr(new Buffer(e,"utf8").toString("base64"))},$r=function(e){return new Buffer(ei(e),"base64").toString("utf8")}):(zr=function(e){return ti(gi(mi(e)))},$r=function(e){return decodeURIComponent(pi(ri(e)))}),Wr.lang.String.isInteger=function(e){return!!e.match(/^[0-9]+$/)||!!e.match(/^-[0-9]+$/)},Wr.lang.String.isHex=function(e){return!(e.length%2!=0||!e.match(/^[0-9a-f]+$/)&&!e.match(/^[0-9A-F]+$/))},Wr.lang.String.isBase64=function(e){return e=e.replace(/\s+/g,""),!(!e.match(/^[0-9A-Za-z+\/]+={0,3}$/)||e.length%4!=0)},Wr.lang.String.isBase64URL=function(e){return!e.match(/[+/=]/)&&(e=ei(e),Wr.lang.String.isBase64(e))},Wr.lang.String.isIntegerArray=function(e){return e=e.replace(/\s+/g,""),!!e.match(/^\[[0-9,]+\]$/)};"undefined"!=typeof Wr&&Wr||(Wr={}),"undefined"!=typeof Wr.crypto&&Wr.crypto||(Wr.crypto={}),Wr.crypto.Util=new function(){this.DIGESTINFOHEAD={sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",ripemd160:"3021300906052b2403020105000414"},this.DEFAULTPROVIDER={md5:"cryptojs",sha1:"cryptojs",sha224:"cryptojs",sha256:"cryptojs",sha384:"cryptojs",sha512:"cryptojs",ripemd160:"cryptojs",hmacmd5:"cryptojs",hmacsha1:"cryptojs",hmacsha224:"cryptojs",hmacsha256:"cryptojs",hmacsha384:"cryptojs",hmacsha512:"cryptojs",hmacripemd160:"cryptojs",MD5withRSA:"cryptojs/jsrsa",SHA1withRSA:"cryptojs/jsrsa",SHA224withRSA:"cryptojs/jsrsa",SHA256withRSA:"cryptojs/jsrsa",SHA384withRSA:"cryptojs/jsrsa",SHA512withRSA:"cryptojs/jsrsa",RIPEMD160withRSA:"cryptojs/jsrsa",MD5withECDSA:"cryptojs/jsrsa",SHA1withECDSA:"cryptojs/jsrsa",SHA224withECDSA:"cryptojs/jsrsa",SHA256withECDSA:"cryptojs/jsrsa",SHA384withECDSA:"cryptojs/jsrsa",SHA512withECDSA:"cryptojs/jsrsa",RIPEMD160withECDSA:"cryptojs/jsrsa",SHA1withDSA:"cryptojs/jsrsa",SHA224withDSA:"cryptojs/jsrsa",SHA256withDSA:"cryptojs/jsrsa",MD5withRSAandMGF1:"cryptojs/jsrsa",SHA1withRSAandMGF1:"cryptojs/jsrsa",SHA224withRSAandMGF1:"cryptojs/jsrsa",SHA256withRSAandMGF1:"cryptojs/jsrsa",SHA384withRSAandMGF1:"cryptojs/jsrsa",SHA512withRSAandMGF1:"cryptojs/jsrsa",RIPEMD160withRSAandMGF1:"cryptojs/jsrsa"},this.CRYPTOJSMESSAGEDIGESTNAME={md5:D.algo.MD5,sha1:D.algo.SHA1,sha224:D.algo.SHA224,sha256:D.algo.SHA256,sha384:D.algo.SHA384,sha512:D.algo.SHA512,ripemd160:D.algo.RIPEMD160},this.getDigestInfoHex=function(e,t){if("undefined"==typeof this.DIGESTINFOHEAD[t])throw"alg not supported in Util.DIGESTINFOHEAD: "+t;return this.DIGESTINFOHEAD[t]+e},this.getPaddedDigestInfoHex=function(e,t,r){var i=this.getDigestInfoHex(e,t),n=r/4;if(i.length+22>n)throw"key is too short for SigAlg: keylen="+r+","+t;for(var s="0001",o="00"+i,a="",u=n-s.length-o.length,c=0;c<u;c+=2)a+="ff";var h=s+a+o;return h},this.hashString=function(e,t){var r=new Wr.crypto.MessageDigest({alg:t});return r.digestString(e)},this.hashHex=function(e,t){var r=new Wr.crypto.MessageDigest({alg:t});return r.digestHex(e)},this.sha1=function(e){var t=new Wr.crypto.MessageDigest({alg:"sha1",prov:"cryptojs"});return t.digestString(e)},this.sha256=function(e){var t=new Wr.crypto.MessageDigest({alg:"sha256",prov:"cryptojs"});return t.digestString(e)},this.sha256Hex=function(e){var t=new Wr.crypto.MessageDigest({alg:"sha256",prov:"cryptojs"});return t.digestHex(e)},this.sha512=function(e){var t=new Wr.crypto.MessageDigest({alg:"sha512",prov:"cryptojs"});return t.digestString(e)},this.sha512Hex=function(e){var t=new Wr.crypto.MessageDigest({alg:"sha512",prov:"cryptojs"});return t.digestHex(e)}},Wr.crypto.Util.md5=function(e){var t=new Wr.crypto.MessageDigest({alg:"md5",prov:"cryptojs"});return t.digestString(e)},Wr.crypto.Util.ripemd160=function(e){var t=new Wr.crypto.MessageDigest({alg:"ripemd160",prov:"cryptojs"});return t.digestString(e)}
40,Wr.crypto.Util.SECURERANDOMGEN=new ur,Wr.crypto.Util.getRandomHexOfNbytes=function(e){var t=new Array(e);return Wr.crypto.Util.SECURERANDOMGEN.nextBytes(t),Qr(t)},Wr.crypto.Util.getRandomBigIntegerOfNbytes=function(e){return new V(Wr.crypto.Util.getRandomHexOfNbytes(e),16)},Wr.crypto.Util.getRandomHexOfNbits=function(e){var t=e%8,r=(e-t)/8,i=new Array(r+1);return Wr.crypto.Util.SECURERANDOMGEN.nextBytes(i),i[0]=(255<<t&255^255)&i[0],Qr(i)},Wr.crypto.Util.getRandomBigIntegerOfNbits=function(e){return new V(Wr.crypto.Util.getRandomHexOfNbits(e),16)},Wr.crypto.Util.getRandomBigIntegerZeroToMax=function(e){var t=e.bitLength();while(1){var r=Wr.crypto.Util.getRandomBigIntegerOfNbits(t);if(-1!=e.compareTo(r))return r}},Wr.crypto.Util.getRandomBigIntegerMinToMax=function(e,t){var r=e.compareTo(t);if(1==r)throw"biMin is greater than biMax";if(0==r)return e;var i=t.subtract(e),n=Wr.crypto.Util.getRandomBigIntegerZeroToMax(i);return n.add(e)},Wr.crypto.MessageDigest=function(e){this.setAlgAndProvider=function(e,t){if(e=Wr.crypto.MessageDigest.getCanonicalAlgName(e),null!==e&&void 0===t&&(t=Wr.crypto.Util.DEFAULTPROVIDER[e]),-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(e)&&"cryptojs"==t){try{this.md=Wr.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[e].create()}catch(r){throw"setAlgAndProvider hash alg set fail alg="+e+"/"+r}this.updateString=function(e){this.md.update(e)},this.updateHex=function(e){var t=D.enc.Hex.parse(e);this.md.update(t)},this.digest=function(){var e=this.md.finalize();return e.toString(D.enc.Hex)},this.digestString=function(e){return this.updateString(e),this.digest()},this.digestHex=function(e){return this.updateHex(e),this.digest()}}if(-1!=":sha256:".indexOf(e)&&"sjcl"==t){try{this.md=new sjcl.hash.sha256}catch(r){throw"setAlgAndProvider hash alg set fail alg="+e+"/"+r}this.updateString=function(e){this.md.update(e)},this.updateHex=function(e){var t=sjcl.codec.hex.toBits(e);this.md.update(t)},this.digest=function(){var e=this.md.finalize();return sjcl.codec.hex.fromBits(e)},this.digestString=function(e){return this.updateString(e),this.digest()},this.digestHex=function(e){return this.updateHex(e),this.digest()}}},this.updateString=function(e){throw"updateString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.updateHex=function(e){throw"updateHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digest=function(){throw"digest() not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestString=function(e){throw"digestString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestHex=function(e){throw"digestHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},void 0!==e&&void 0!==e.alg&&(this.algName=e.alg,void 0===e.prov&&(this.provName=Wr.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))},Wr.crypto.MessageDigest.getCanonicalAlgName=function(e){return"string"===typeof e&&(e=e.toLowerCase(),e=e.replace(/-/,"")),e},Wr.crypto.MessageDigest.getHashLength=function(e){var t=Wr.crypto.MessageDigest,r=t.getCanonicalAlgName(e);if(void 0===t.HASHLENGTH[r])throw"not supported algorithm: "+e;return t.HASHLENGTH[r]},Wr.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20},Wr.crypto.Mac=function(e){this.setAlgAndProvider=function(e,t){if(e=e.toLowerCase(),null==e&&(e="hmacsha1"),e=e.toLowerCase(),"hmac"!=e.substr(0,4))throw"setAlgAndProvider unsupported HMAC alg: "+e;void 0===t&&(t=Wr.crypto.Util.DEFAULTPROVIDER[e]),this.algProv=e+"/"+t;var r=e.substr(4);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(r)&&"cryptojs"==t){try{var i=Wr.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[r];this.mac=D.algo.HMAC.create(i,this.pass)}catch(n){throw"setAlgAndProvider hash alg set fail hashAlg="+r+"/"+n}this.updateString=function(e){this.mac.update(e)},this.updateHex=function(e){var t=D.enc.Hex.parse(e);this.mac.update(t)},this.doFinal=function(){var e=this.mac.finalize();return e.toString(D.enc.Hex)},this.doFinalString=function(e){return this.updateString(e),this.doFinal()},this.doFinalHex=function(e){return this.updateHex(e),this.doFinal()}}},this.updateString=function(e){throw"updateString(str) not supported for this alg/prov: "+this.algProv},this.updateHex=function(e){throw"updateHex(hex) not supported for this alg/prov: "+this.algProv},this.doFinal=function(){throw"digest() not supported for this alg/prov: "+this.algProv},this.doFinalString=function(e){throw"digestString(str) not supported for this alg/prov: "+this.algProv},this.doFinalHex=function(e){throw"digestHex(hex) not supported for this alg/prov: "+this.algProv},this.setPassword=function(e){if("string"==typeof e){var t=e;return e.length%2!=1&&e.match(/^[0-9A-Fa-f]+$/)||(t=oi(e)),void(this.pass=D.enc.Hex.parse(t))}if("object"!=Object(S["a"])(e))throw"KJUR.crypto.Mac unsupported password type: "+e;t=null;if(void 0!==e.hex){if(e.hex.length%2!=0||!e.hex.match(/^[0-9A-Fa-f]+$/))throw"Mac: wrong hex password: "+e.hex;t=e.hex}if(void 0!==e.utf8&&(t=ii(e.utf8)),void 0!==e.rstr&&(t=oi(e.rstr)),void 0!==e.b64&&(t=B(e.b64)),void 0!==e.b64u&&(t=ri(e.b64u)),null==t)throw"KJUR.crypto.Mac unsupported password type: "+e;this.pass=D.enc.Hex.parse(t)},void 0!==e&&(void 0!==e.pass&&this.setPassword(e.pass),void 0!==e.alg&&(this.algName=e.alg,void 0===e.prov&&(this.provName=Wr.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName)))},Wr.crypto.Signature=function(e){var t=null;if(this._setAlgNames=function(){var e=this.algName.match(/^(.+)with(.+)$/);e&&(this.mdAlgName=e[1].toLowerCase(),this.pubkeyAlgName=e[2].toLowerCase())},this._zeroPaddingOfSignature=function(e,t){for(var r="",i=t/4-e.length,n=0;n<i;n++)r+="0";return r+e},this.setAlgAndProvider=function(e,t){if(this._setAlgNames(),"cryptojs/jsrsa"!=t)throw"provider not supported: "+t;if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(this.mdAlgName)){try{this.md=new Wr.crypto.MessageDigest({alg:this.mdAlgName})}catch(r){throw"setAlgAndProvider hash alg set fail alg="+this.mdAlgName+"/"+r}this.init=function(e,t){var r=null;try{r=void 0===t?Fi.getKey(e):Fi.getKey(e,t)}catch(i){throw"init failed:"+i}if(!0===r.isPrivate)this.prvKey=r,this.state="SIGN";else{if(!0!==r.isPublic)throw"init failed.:"+r;this.pubKey=r,this.state="VERIFY"}},this.updateString=function(e){this.md.updateString(e)},this.updateHex=function(e){this.md.updateHex(e)},this.sign=function(){if(this.sHashHex=this.md.digest(),"undefined"!=typeof this.ecprvhex&&"undefined"!=typeof this.eccurvename){var e=new Wr.crypto.ECDSA({curve:this.eccurvename});this.hSign=e.signHex(this.sHashHex,this.ecprvhex)}else if(this.prvKey instanceof fr&&"rsaandmgf1"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHashPSS(this.sHashHex,this.mdAlgName,this.pssSaltLen);else if(this.prvKey instanceof fr&&"rsa"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex,this.mdAlgName);else if(this.prvKey instanceof Wr.crypto.ECDSA)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex);else{if(!(this.prvKey instanceof Wr.crypto.DSA))throw"Signature: unsupported private key alg: "+this.pubkeyAlgName;this.hSign=this.prvKey.signWithMessageHash(this.sHashHex)}return this.hSign},this.signString=function(e){return this.updateString(e),this.sign()},this.signHex=function(e){return this.updateHex(e),this.sign()},this.verify=function(e){if(this.sHashHex=this.md.digest(),"undefined"!=typeof this.ecpubhex&&"undefined"!=typeof this.eccurvename){var t=new Wr.crypto.ECDSA({curve:this.eccurvename});return t.verifyHex(this.sHashHex,e,this.ecpubhex)}if(this.pubKey instanceof fr&&"rsaandmgf1"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,e,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof fr&&"rsa"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHash(this.sHashHex,e);if(void 0!==Wr.crypto.ECDSA&&this.pubKey instanceof Wr.crypto.ECDSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,e);if(void 0!==Wr.crypto.DSA&&this.pubKey instanceof Wr.crypto.DSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,e);throw"Signature: unsupported public key alg: "+this.pubkeyAlgName}}},this.init=function(e,t){throw"init(key, pass) not supported for this alg:prov="+this.algProvName},this.updateString=function(e){throw"updateString(str) not supported for this alg:prov="+this.algProvName},this.updateHex=function(e){throw"updateHex(hex) not supported for this alg:prov="+this.algProvName},this.sign=function(){throw"sign() not supported for this alg:prov="+this.algProvName},this.signString=function(e){throw"digestString(str) not supported for this alg:prov="+this.algProvName},this.signHex=function(e){throw"digestHex(hex) not supported for this alg:prov="+this.algProvName},this.verify=function(e){throw"verify(hSigVal) not supported for this alg:prov="+this.algProvName},this.initParams=e,void 0!==e&&(void 0!==e.alg&&(this.algName=e.alg,void 0===e.prov?this.provName=Wr.crypto.Util.DEFAULTPROVIDER[this.algName]:this.provName=e.prov,this.algProvName=this.algName+":"+this.provName,this.setAlgAndProvider(this.algName,this.provName),this._setAlgNames()),void 0!==e.psssaltlen&&(this.pssSaltLen=e.psssaltlen),void 0!==e.prvkeypem)){if(void 0!==e.prvkeypas)throw"both prvkeypem and prvkeypas parameters not supported";try{t=Fi.getKey(e.prvkeypem);this.init(t)}catch(r){throw"fatal error to load pem private key: "+r}}},Wr.crypto.Cipher=function(e){},Wr.crypto.Cipher.encrypt=function(e,t,r){if(t instanceof fr&&t.isPublic){var i=Wr.crypto.Cipher.getAlgByKeyAndName(t,r);
40if("RSA"===i)return t.encrypt(e);if("RSAOAEP"===i)return t.encryptOAEP(e,"sha1");var n=i.match(/^RSAOAEP(\d+)$/);if(null!==n)return t.encryptOAEP(e,"sha"+n[1]);throw"Cipher.encrypt: unsupported algorithm for RSAKey: "+r}throw"Cipher.encrypt: unsupported key or algorithm"},Wr.crypto.Cipher.decrypt=function(e,t,r){if(t instanceof fr&&t.isPrivate){var i=Wr.crypto.Cipher.getAlgByKeyAndName(t,r);if("RSA"===i)return t.decrypt(e);if("RSAOAEP"===i)return t.decryptOAEP(e,"sha1");var n=i.match(/^RSAOAEP(\d+)$/);if(null!==n)return t.decryptOAEP(e,"sha"+n[1]);throw"Cipher.decrypt: unsupported algorithm for RSAKey: "+r}throw"Cipher.decrypt: unsupported key or algorithm"},Wr.crypto.Cipher.getAlgByKeyAndName=function(e,t){if(e instanceof fr){if(-1!=":RSA:RSAOAEP:RSAOAEP224:RSAOAEP256:RSAOAEP384:RSAOAEP512:".indexOf(t))return t;if(null===t||void 0===t)return"RSA";throw"getAlgByKeyAndName: not supported algorithm name for RSAKey: "+t}throw"getAlgByKeyAndName: not supported algorithm name: "+t},Wr.crypto.OID=new function(){this.oidhex2name={"2a864886f70d010101":"rsaEncryption","2a8648ce3d0201":"ecPublicKey","2a8648ce380401":"dsa","2a8648ce3d030107":"secp256r1","2b8104001f":"secp192k1","2b81040021":"secp224r1","2b8104000a":"secp256k1","2b81040023":"secp521r1","2b81040022":"secp384r1","2a8648ce380403":"SHA1withDSA","608648016503040301":"SHA224withDSA","608648016503040302":"SHA256withDSA"}},"undefined"!=typeof Wr&&Wr||(Wr={}),"undefined"!=typeof Wr.crypto&&Wr.crypto||(Wr.crypto={}),Wr.crypto.ECDSA=function(e){var t="secp256r1",r=new ur;this.type="EC",this.isPrivate=!1,this.isPublic=!1,this.getBigRandom=function(e){return new V(e.bitLength(),r).mod(e.subtract(V.ONE)).add(V.ONE)},this.setNamedCurve=function(e){this.ecparams=Wr.crypto.ECParameterDB.getByName(e),this.prvKeyHex=null,this.pubKeyHex=null,this.curveName=e},this.setPrivateKeyHex=function(e){this.isPrivate=!0,this.prvKeyHex=e},this.setPublicKeyHex=function(e){this.isPublic=!0,this.pubKeyHex=e},this.getPublicKeyXYHex=function(){var e=this.pubKeyHex;if("04"!==e.substr(0,2))throw"this method supports uncompressed format(04) only";var t=this.ecparams.keylen/4;if(e.length!==2+2*t)throw"malformed public key hex length";var r={};return r.x=e.substr(2,t),r.y=e.substr(2+t),r},this.getShortNISTPCurveName=function(){var e=this.curveName;return"secp256r1"===e||"NIST P-256"===e||"P-256"===e||"prime256v1"===e?"P-256":"secp384r1"===e||"NIST P-384"===e||"P-384"===e?"P-384":null},this.generateKeyPairHex=function(){var e=this.ecparams.n,t=this.getBigRandom(e),r=this.ecparams.G.multiply(t),i=r.getX().toBigInteger(),n=r.getY().toBigInteger(),s=this.ecparams.keylen/4,o=("0000000000"+t.toString(16)).slice(-s),a=("0000000000"+i.toString(16)).slice(-s),u=("0000000000"+n.toString(16)).slice(-s),c="04"+a+u;return this.setPrivateKeyHex(o),this.setPublicKeyHex(c),{ecprvhex:o,ecpubhex:c}},this.signWithMessageHash=function(e){return this.signHex(e,this.prvKeyHex)},this.signHex=function(e,t){var r=new V(t,16),i=this.ecparams.n,n=new V(e,16);do{var s=this.getBigRandom(i),o=this.ecparams.G,a=o.multiply(s),u=a.getX().toBigInteger().mod(i)}while(u.compareTo(V.ZERO)<=0);var c=s.modInverse(i).multiply(n.add(r.multiply(u))).mod(i);return Wr.crypto.ECDSA.biRSSigToASN1Sig(u,c)},this.sign=function(e,t){var r=t,i=this.ecparams.n,n=V.fromByteArrayUnsigned(e);do{var s=this.getBigRandom(i),o=this.ecparams.G,a=o.multiply(s),u=a.getX().toBigInteger().mod(i)}while(u.compareTo(V.ZERO)<=0);var c=s.modInverse(i).multiply(n.add(r.multiply(u))).mod(i);return this.serializeSig(u,c)},this.verifyWithMessageHash=function(e,t){return this.verifyHex(e,t,this.pubKeyHex)},this.verifyHex=function(e,t,r){var i,n,s,o=Wr.crypto.ECDSA.parseSigHex(t);i=o.r,n=o.s,s=Ar.decodeFromHex(this.ecparams.curve,r);var a=new V(e,16);return this.verifyRaw(a,i,n,s)},this.verify=function(e,t,r){var i,n,s;if(Bitcoin.Util.isArray(t)){var o=this.parseSig(t);i=o.r,n=o.s}else{if("object"!==Object(S["a"])(t)||!t.r||!t.s)throw"Invalid value for signature";i=t.r,n=t.s}if(r instanceof Ar)s=r;else{if(!Bitcoin.Util.isArray(r))throw"Invalid format for pubkey value, must be byte array or ECPointFp";s=Ar.decodeFrom(this.ecparams.curve,r)}var a=V.fromByteArrayUnsigned(e);return this.verifyRaw(a,i,n,s)},this.verifyRaw=function(e,t,r,i){var n=this.ecparams.n,s=this.ecparams.G;if(t.compareTo(V.ONE)<0||t.compareTo(n)>=0)return!1;if(r.compareTo(V.ONE)<0||r.compareTo(n)>=0)return!1;var o=r.modInverse(n),a=e.multiply(o).mod(n),u=t.multiply(o).mod(n),c=s.multiply(a).add(i.multiply(u)),h=c.getX().toBigInteger().mod(n);return h.equals(t)},this.serializeSig=function(e,t){var r=e.toByteArraySigned(),i=t.toByteArraySigned(),n=[];return n.push(2),n.push(r.length),n=n.concat(r),n.push(2),n.push(i.length),n=n.concat(i),n.unshift(n.length),n.unshift(48),n},this.parseSig=function(e){var t;if(48!=e[0])throw new Error("Signature not a valid DERSequence");if(t=2,2!=e[t])throw new Error("First element in signature must be a DERInteger");var r=e.slice(t+2,t+2+e[t+1]);if(t+=2+e[t+1],2!=e[t])throw new Error("Second element in signature must be a DERInteger");var i=e.slice(t+2,t+2+e[t+1]);t+=2+e[t+1];var n=V.fromByteArrayUnsigned(r),s=V.fromByteArrayUnsigned(i);return{r:n,s:s}},this.parseSigCompact=function(e){if(65!==e.length)throw"Signature has the wrong length";var t=e[0]-27;if(t<0||t>7)throw"Invalid signature type";var r=this.ecparams.n,i=V.fromByteArrayUnsigned(e.slice(1,33)).mod(r),n=V.fromByteArrayUnsigned(e.slice(33,65)).mod(r);return{r:i,s:n,i:t}},this.readPKCS5PrvKeyHex=function(e){var t,r,i,n=Gr,s=Wr.crypto.ECDSA.getName,o=n.getVbyList;if(!1===n.isASN1HEX(e))throw"not ASN.1 hex string";try{t=o(e,0,[2,0],"06"),r=o(e,0,[1],"04");try{i=o(e,0,[3,0],"03").substr(2)}catch(a){}}catch(a){throw"malformed PKCS#1/5 plain ECC private key"}if(this.curveName=s(t),void 0===this.curveName)throw"unsupported curve name";this.setNamedCurve(this.curveName),this.setPublicKeyHex(i),this.setPrivateKeyHex(r),this.isPublic=!1},this.readPKCS8PrvKeyHex=function(e){var t,r,i,n=Gr,s=Wr.crypto.ECDSA.getName,o=n.getVbyList;if(!1===n.isASN1HEX(e))throw"not ASN.1 hex string";try{o(e,0,[1,0],"06"),t=o(e,0,[1,1],"06"),r=o(e,0,[2,0,1],"04");try{i=o(e,0,[2,0,2,0],"03").substr(2)}catch(a){}}catch(a){throw"malformed PKCS#8 plain ECC private key"}if(this.curveName=s(t),void 0===this.curveName)throw"unsupported curve name";this.setNamedCurve(this.curveName),this.setPublicKeyHex(i),this.setPrivateKeyHex(r),this.isPublic=!1},this.readPKCS8PubKeyHex=function(e){var t,r,i=Gr,n=Wr.crypto.ECDSA.getName,s=i.getVbyList;if(!1===i.isASN1HEX(e))throw"not ASN.1 hex string";try{s(e,0,[0,0],"06"),t=s(e,0,[0,1],"06"),r=s(e,0,[1],"03").substr(2)}catch(o){throw"malformed PKCS#8 ECC public key"}if(this.curveName=n(t),null===this.curveName)throw"unsupported curve name";this.setNamedCurve(this.curveName),this.setPublicKeyHex(r)},this.readCertPubKeyHex=function(e,t){5!==t&&(t=6);var r,i,n=Gr,s=Wr.crypto.ECDSA.getName,o=n.getVbyList;if(!1===n.isASN1HEX(e))throw"not ASN.1 hex string";try{r=o(e,0,[0,t,0,1],"06"),i=o(e,0,[0,t,1],"03").substr(2)}catch(a){throw"malformed X.509 certificate ECC public key"}if(this.curveName=s(r),null===this.curveName)throw"unsupported curve name";this.setNamedCurve(this.curveName),this.setPublicKeyHex(i)},void 0!==e&&void 0!==e.curve&&(this.curveName=e.curve),void 0===this.curveName&&(this.curveName=t),this.setNamedCurve(this.curveName),void 0!==e&&(void 0!==e.prv&&this.setPrivateKeyHex(e.prv),void 0!==e.pub&&this.setPublicKeyHex(e.pub))},Wr.crypto.ECDSA.parseSigHex=function(e){var t=Wr.crypto.ECDSA.parseSigHexInHexRS(e),r=new V(t.r,16),i=new V(t.s,16);return{r:r,s:i}},Wr.crypto.ECDSA.parseSigHexInHexRS=function(e){var t=Gr,r=t.getChildIdx,i=t.getV;if("30"!=e.substr(0,2))throw"signature is not a ASN.1 sequence";var n=r(e,0);if(2!=n.length)throw"number of signature ASN.1 sequence elements seem wrong";var s=n[0],o=n[1];if("02"!=e.substr(s,2))throw"1st item of sequene of signature is not ASN.1 integer";if("02"!=e.substr(o,2))throw"2nd item of sequene of signature is not ASN.1 integer";var a=i(e,s),u=i(e,o);return{r:a,s:u}},Wr.crypto.ECDSA.asn1SigToConcatSig=function(e){var t=Wr.crypto.ECDSA.parseSigHexInHexRS(e),r=t.r,i=t.s;if("00"==r.substr(0,2)&&r.length%32==2&&(r=r.substr(2)),"00"==i.substr(0,2)&&i.length%32==2&&(i=i.substr(2)),r.length%32==30&&(r="00"+r),i.length%32==30&&(i="00"+i),r.length%32!=0)throw"unknown ECDSA sig r length error";if(i.length%32!=0)throw"unknown ECDSA sig s length error";return r+i},Wr.crypto.ECDSA.concatSigToASN1Sig=function(e){if(e.length/2*8%128!=0)throw"unknown ECDSA concatinated r-s sig length error";var t=e.substr(0,e.length/2),r=e.substr(e.length/2);return Wr.crypto.ECDSA.hexRSSigToASN1Sig(t,r)},Wr.crypto.ECDSA.hexRSSigToASN1Sig=function(e,t){var r=new V(e,16),i=new V(t,16);return Wr.crypto.ECDSA.biRSSigToASN1Sig(r,i)},Wr.crypto.ECDSA.biRSSigToASN1Sig=function(e,t){var r=Wr.asn1,i=new r.DERInteger({bigint:e}),n=new r.DERInteger({bigint:t}),s=new r.DERSequence({array:[i,n]});return s.getEncodedHex()},Wr.crypto.ECDSA.getName=function(e){return"2a8648ce3d030107"===e?"secp256r1":"2b8104000a"===e?"secp256k1":"2b81040022"===e?"secp384r1":-1!=="|secp256r1|NIST P-256|P-256|prime256v1|".indexOf(e)?"secp256r1":-1!=="|secp256k1|".indexOf(e)?"secp256k1":-1!=="|secp384r1|NIST P-384|P-384|".indexOf(e)?"secp384r1":null},"undefined"!=typeof Wr&&Wr||(Wr={}),"undefined"!=typeof Wr.crypto&&Wr.crypto||(Wr.crypto={}),Wr.crypto.ECParameterDB=new function(){var e={},t={};function r(e){return new V(e,16)}this.getByName=function(r){var i=r;if("undefined"!=typeof t[i]&&(i=t[r]),"undefined"!=typeof e[i])return e[i];throw"unregistered EC curve name: "+i},this.regist=function(i,n,s,o,a,u,c,h,l,d,f,g){e[i]={};var p=r(s),v=r(o),y=r(a),m=r(u),_=r(c),F=new Hr(p,v,y),S=F.decodePointHex("04"+h+l);e[i]["name"]=i,e[i]["keylen"]=n,e[i]["curve"]=F,e[i]["G"]=S,e[i]["n"]=m,e[i]["h"]=_,e[i]["oid"]=f,e[i]["info"]=g;for(var b=0;b<d.length;b++)t[d[b]]=i}},Wr.crypto.ECParameterDB.regist("secp128r1",128,"FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC","E87579C11079F43DD824993C2CEE5ED3","FFFFFFFE0000000075A30D1B9038A115","1","161FF7528B899B2D0C28607CA52C5B86","CF5AC8395BAFEB13C02DA292DDED7A83",[],"","secp128r1 : SECG curve over a 128 bit prime field"),Wr.crypto.ECParameterDB.regist("secp160k1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73","0","7","0100000000000000000001B8FA16DFAB9ACA16B6B3","1","3B4C382CE37AA192A4019E763036F4F5DD4D7EBB","938CF935318FDCED6BC28286531733C3F03C4FEE",[],"","secp160k1 : SECG curve over a 160 bit prime field"),Wr.crypto.ECParameterDB.regist("secp160r1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC","1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45","0100000000000000000001F4C8F927AED3CA752257","1","4A96B5688EF573284664698968C38BB913CBFC82","23A628553168947D59DCC912042351377AC5FB32",[],"","secp160r1 : SECG curve over a 160 bit prime field"),Wr.crypto.ECParameterDB.regist("secp192k1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37","0","3","FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D","1","DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D","9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D",[]),Wr.crypto.ECParameterDB.regist("secp192r1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC","64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1","FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831","1","188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012","07192B95FFC8DA78631011ED6B24CDD573F977A11E794811",[]),Wr.crypto.ECParameterDB.regist("secp224r1",224,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE","B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4","FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D","1","B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21","BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34",[]),Wr.crypto.ECParameterDB.regist("secp256k1",256,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F","0","7","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","1","79BE667EF9DCB
40BAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798","483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8",[]),Wr.crypto.ECParameterDB.regist("secp256r1",256,"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC","5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B","FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551","1","6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296","4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5",["NIST P-256","P-256","prime256v1"]),Wr.crypto.ECParameterDB.regist("secp384r1",384,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC","B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973","1","AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7","3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f",["NIST P-384","P-384"]),Wr.crypto.ECParameterDB.regist("secp521r1",521,"1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC","051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409","1","C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66","011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650",["NIST P-521","P-521"]);var Fi=function(){var e=function(e,t,r){return i(D.AES,e,t,r)},t=function(e,t,r){return i(D.TripleDES,e,t,r)},r=function(e,t,r){return i(D.DES,e,t,r)},i=function(e,t,r,i){var n=D.enc.Hex.parse(t),s=D.enc.Hex.parse(r),o=D.enc.Hex.parse(i),a={};a.key=s,a.iv=o,a.ciphertext=n;var u=e.decrypt(a,s,{iv:o});return D.enc.Hex.stringify(u)},n=function(e,t,r){return a(D.AES,e,t,r)},s=function(e,t,r){return a(D.TripleDES,e,t,r)},o=function(e,t,r){return a(D.DES,e,t,r)},a=function(e,t,r,i){var n=D.enc.Hex.parse(t),s=D.enc.Hex.parse(r),o=D.enc.Hex.parse(i),a=e.encrypt(n,s,{iv:o}),u=D.enc.Hex.parse(a.toString()),c=D.enc.Base64.stringify(u);return c},u={"AES-256-CBC":{proc:e,eproc:n,keylen:32,ivlen:16},"AES-192-CBC":{proc:e,eproc:n,keylen:24,ivlen:16},"AES-128-CBC":{proc:e,eproc:n,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:t,eproc:s,keylen:24,ivlen:8},"DES-CBC":{proc:r,eproc:o,keylen:8,ivlen:8}},c=function(e){var t=D.lib.WordArray.random(e),r=D.enc.Hex.stringify(t);return r},h=function(e){var t={},r=e.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));r&&(t.cipher=r[1],t.ivsalt=r[2]);var i=e.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));i&&(t.type=i[1]);var n=-1,s=0;-1!=e.indexOf("\r\n\r\n")&&(n=e.indexOf("\r\n\r\n"),s=2),-1!=e.indexOf("\n\n")&&(n=e.indexOf("\n\n"),s=1);var o=e.indexOf("-----END");if(-1!=n&&-1!=o){var a=e.substring(n+2*s,o-s);a=a.replace(/\s+/g,""),t.data=a}return t},l=function(e,t,r){for(var i=r.substring(0,16),n=D.enc.Hex.parse(i),s=D.enc.Utf8.parse(t),o=u[e]["keylen"]+u[e]["ivlen"],a="",c=null;;){var h=D.algo.MD5.create();if(null!=c&&h.update(c),h.update(s),h.update(n),c=h.finalize(),a+=D.enc.Hex.stringify(c),a.length>=2*o)break}var l={};return l.keyhex=a.substr(0,2*u[e]["keylen"]),l.ivhex=a.substr(2*u[e]["keylen"],2*u[e]["ivlen"]),l},d=function(e,t,r,i){var n=D.enc.Base64.parse(e),s=D.enc.Hex.stringify(n),o=u[t]["proc"],a=o(s,r,i);return a},f=function(e,t,r,i){var n=u[t]["eproc"],s=n(e,r,i);return s};return{version:"1.0.0",parsePKCS5PEM:function(e){return h(e)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(e,t,r){return l(e,t,r)},decryptKeyB64:function(e,t,r,i){return d(e,t,r,i)},getDecryptedKeyHex:function(e,t){var r=h(e),i=(r.type,r.cipher),n=r.ivsalt,s=r.data,o=l(i,t,n),a=o.keyhex,u=d(s,i,a,n);return u},getEncryptedPKCS5PEMFromPrvKeyHex:function(e,t,r,i,n){var s="";if("undefined"!=typeof i&&null!=i||(i="AES-256-CBC"),"undefined"==typeof u[i])throw"KEYUTIL unsupported algorithm: "+i;if("undefined"==typeof n||null==n){var o=u[i]["ivlen"],a=c(o);n=a.toUpperCase()}var h=l(i,r,n),d=h.keyhex,g=f(t,i,d,n),p=g.replace(/(.{64})/g,"$1\r\n");s="-----BEGIN "+e+" PRIVATE KEY-----\r\n";return s+="Proc-Type: 4,ENCRYPTED\r\n",s+="DEK-Info: "+i+","+n+"\r\n",s+="\r\n",s+=p,s+="\r\n-----END "+e+" PRIVATE KEY-----\r\n",s},parseHexOfEncryptedPKCS8:function(e){var t=Gr,r=t.getChildIdx,i=t.getV,n={},s=r(e,0);if(2!=s.length)throw"malformed format: SEQUENCE(0).items != 2: "+s.length;n.ciphertext=i(e,s[1]);var o=r(e,s[0]);if(2!=o.length)throw"malformed format: SEQUENCE(0.0).items != 2: "+o.length;if("2a864886f70d01050d"!=i(e,o[0]))throw"this only supports pkcs5PBES2";var a=r(e,o[1]);if(2!=o.length)throw"malformed format: SEQUENCE(0.0.1).items != 2: "+a.length;var u=r(e,a[1]);if(2!=u.length)throw"malformed format: SEQUENCE(0.0.1.1).items != 2: "+u.length;if("2a864886f70d0307"!=i(e,u[0]))throw"this only supports TripleDES";n.encryptionSchemeAlg="TripleDES",n.encryptionSchemeIV=i(e,u[1]);var c=r(e,a[0]);if(2!=c.length)throw"malformed format: SEQUENCE(0.0.1.0).items != 2: "+c.length;if("2a864886f70d01050c"!=i(e,c[0]))throw"this only supports pkcs5PBKDF2";var h=r(e,c[1]);if(h.length<2)throw"malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+h.length;n.pbkdf2Salt=i(e,h[0]);var l=i(e,h[1]);try{n.pbkdf2Iter=parseInt(l,16)}catch(d){throw"malformed format pbkdf2Iter: "+l}return n},getPBKDF2KeyHexFromParam:function(e,t){var r=D.enc.Hex.parse(e.pbkdf2Salt),i=e.pbkdf2Iter,n=D.PBKDF2(t,r,{keySize:6,iterations:i}),s=D.enc.Hex.stringify(n);return s},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(e,t){var r=li(e,"ENCRYPTED PRIVATE KEY"),i=this.parseHexOfEncryptedPKCS8(r),n=Fi.getPBKDF2KeyHexFromParam(i,t),s={};s.ciphertext=D.enc.Hex.parse(i.ciphertext);var o=D.enc.Hex.parse(n),a=D.enc.Hex.parse(i.encryptionSchemeIV),u=D.TripleDES.decrypt(s,o,{iv:a}),c=D.enc.Hex.stringify(u);return c},getKeyFromEncryptedPKCS8PEM:function(e,t){var r=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(e,t),i=this.getKeyFromPlainPrivateP
40KCS8Hex(r);return i},parsePlainPrivatePKCS8Hex:function(e){var t=Gr,r=t.getChildIdx,i=t.getV,n={algparam:null};if("30"!=e.substr(0,2))throw"malformed plain PKCS8 private key(code:001)";var s=r(e,0);if(3!=s.length)throw"malformed plain PKCS8 private key(code:002)";if("30"!=e.substr(s[1],2))throw"malformed PKCS8 private key(code:003)";var o=r(e,s[1]);if(2!=o.length)throw"malformed PKCS8 private key(code:004)";if("06"!=e.substr(o[0],2))throw"malformed PKCS8 private key(code:005)";if(n.algoid=i(e,o[0]),"06"==e.substr(o[1],2)&&(n.algparam=i(e,o[1])),"04"!=e.substr(s[2],2))throw"malformed PKCS8 private key(code:006)";return n.keyidx=t.getVidx(e,s[2]),n},getKeyFromPlainPrivatePKCS8PEM:function(e){var t=li(e,"PRIVATE KEY"),r=this.getKeyFromPlainPrivatePKCS8Hex(t);return r},getKeyFromPlainPrivatePKCS8Hex:function(e){var t,r=this.parsePlainPrivatePKCS8Hex(e);if("2a864886f70d010101"==r.algoid)t=new fr;else if("2a8648ce380401"==r.algoid)t=new Wr.crypto.DSA;else{if("2a8648ce3d0201"!=r.algoid)throw"unsupported private key algorithm";t=new Wr.crypto.ECDSA}return t.readPKCS8PrvKeyHex(e),t},_getKeyFromPublicPKCS8Hex:function(e){var t,r=Gr.getVbyList(e,0,[0,0],"06");if("2a864886f70d010101"===r)t=new fr;else if("2a8648ce380401"===r)t=new Wr.crypto.DSA;else{if("2a8648ce3d0201"!==r)throw"unsupported PKCS#8 public key hex";t=new Wr.crypto.ECDSA}return t.readPKCS8PubKeyHex(e),t},parsePublicRawRSAKeyHex:function(e){var t=Gr,r=t.getChildIdx,i=t.getV,n={};if("30"!=e.substr(0,2))throw"malformed RSA key(code:001)";var s=r(e,0);if(2!=s.length)throw"malformed RSA key(code:002)";if("02"!=e.substr(s[0],2))throw"malformed RSA key(code:003)";if(n.n=i(e,s[0]),"02"!=e.substr(s[1],2))throw"malformed RSA key(code:004)";return n.e=i(e,s[1]),n},parsePublicPKCS8Hex:function(e){var t=Gr,r=t.getChildIdx,i=t.getV,n={algparam:null},s=r(e,0);if(2!=s.length)throw"outer DERSequence shall have 2 elements: "+s.length;var o=s[0];if("30"!=e.substr(o,2))throw"malformed PKCS8 public key(code:001)";var a=r(e,o);if(2!=a.length)throw"malformed PKCS8 public key(code:002)";if("06"!=e.substr(a[0],2))throw"malformed PKCS8 public key(code:003)";if(n.algoid=i(e,a[0]),"06"==e.substr(a[1],2)?n.algparam=i(e,a[1]):"30"==e.substr(a[1],2)&&(n.algparam={},n.algparam.p=t.getVbyList(e,a[1],[0],"02"),n.algparam.q=t.getVbyList(e,a[1],[1],"02"),n.algparam.g=t.getVbyList(e,a[1],[2],"02")),"03"!=e.substr(s[1],2))throw"malformed PKCS8 public key(code:004)";return n.key=i(e,s[1]).substr(2),n}}}();Fi.getKey=function(e,t,r){var i=Gr,n=i.getChildIdx,s=(i.getV,i.getVbyList),o=Wr.crypto,a=o.ECDSA,u=o.DSA,c=fr,h=li,l=Fi;if("undefined"!=typeof c&&e instanceof c)return e;if("undefined"!=typeof a&&e instanceof a)return e;if("undefined"!=typeof u&&e instanceof u)return e;if(void 0!==e.curve&&void 0!==e.xy&&void 0===e.d)return new a({pub:e.xy,curve:e.curve});if(void 0!==e.curve&&void 0!==e.d)return new a({prv:e.d,curve:e.curve});if(void 0===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0===e.d){var d=new c;return d.setPublic(e.n,e.e),d}if(void 0===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d&&void 0!==e.p&&void 0!==e.q&&void 0!==e.dp&&void 0!==e.dq&&void 0!==e.co&&void 0===e.qi){d=new c;return d.setPrivateEx(e.n,e.e,e.d,e.p,e.q,e.dp,e.dq,e.co),d}if(void 0===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d&&void 0===e.p){d=new c;return d.setPrivate(e.n,e.e,e.d),d}if(void 0!==e.p&&void 0!==e.q&&void 0!==e.g&&void 0!==e.y&&void 0===e.x){d=new u;return d.setPublic(e.p,e.q,e.g,e.y),d}if(void 0!==e.p&&void 0!==e.q&&void 0!==e.g&&void 0!==e.y&&void 0!==e.x){d=new u;return d.setPrivate(e.p,e.q,e.g,e.y,e.x),d}if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0===e.d){d=new c;return d.setPublic(ri(e.n),ri(e.e)),d}if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d&&void 0!==e.p&&void 0!==e.q&&void 0!==e.dp&&void 0!==e.dq&&void 0!==e.qi){d=new c;return d.setPrivateEx(ri(e.n),ri(e.e),ri(e.d),ri(e.p),ri(e.q),ri(e.dp),ri(e.dq),ri(e.qi)),d}if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d){d=new c;return d.setPrivate(ri(e.n),ri(e.e),ri(e.d)),d}if("EC"===e.kty&&void 0!==e.crv&&void 0!==e.x&&void 0!==e.y&&void 0===e.d){var f=new a({curve:e.crv}),g=f.ecparams.keylen/4,p=("0000000000"+ri(e.x)).slice(-g),v=("0000000000"+ri(e.y)).slice(-g),y="04"+p+v;return f.setPublicKeyHex(y),f}if("EC"===e.kty&&void 0!==e.crv&&void 0!==e.x&&void 0!==e.y&&void 0!==e.d){f=new a({curve:e.crv}),g=f.ecparams.keylen/4,p=("0000000000"+ri(e.x)).slice(-g),v=("0000000000"+ri(e.y)).slice(-g),y="04"+p+v;var m=("0000000000"+ri(e.d)).slice(-g);return f.setPublicKeyHex(y),f.setPrivateKeyHex(m),f}if("pkcs5prv"===r){var _,F=e;i=Gr;if(_=n(F,0),9===_.length)d=new c,d.readPKCS5PrvKeyHex(F);else if(6===_.length)d=new u,d.readPKCS5PrvKeyHex(F);else{if(!(_.length>2&&"04"===F.substr(_[1],2)))throw"unsupported PKCS#1/5 hexadecimal key";d=new a,d.readPKCS5PrvKeyHex(F)}return d}
40if("pkcs8prv"===r){d=l.getKeyFromPlainPrivatePKCS8Hex(e);return d}if("pkcs8pub"===r)return l._getKeyFromPublicPKCS8Hex(e);if("x509pub"===r)return Ei.getPublicKeyFromCertHex(e);if(-1!=e.indexOf("-END CERTIFICATE-",0)||-1!=e.indexOf("-END X509 CERTIFICATE-",0)||-1!=e.indexOf("-END TRUSTED CERTIFICATE-",0))return Ei.getPublicKeyFromCertPEM(e);if(-1!=e.indexOf("-END PUBLIC KEY-")){var S=li(e,"PUBLIC KEY");return l._getKeyFromPublicPKCS8Hex(S)}if(-1!=e.indexOf("-END RSA PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){var b=h(e,"RSA PRIVATE KEY");return l.getKey(b,null,"pkcs5prv")}if(-1!=e.indexOf("-END DSA PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){var w=h(e,"DSA PRIVATE KEY"),k=s(w,0,[1],"02"),E=s(w,0,[2],"02"),x=s(w,0,[3],"02"),A=s(w,0,[4],"02"),P=s(w,0,[5],"02");d=new u;return d.setPrivate(new V(k,16),new V(E,16),new V(x,16),new V(A,16),new V(P,16)),d}if(-1!=e.indexOf("-END PRIVATE KEY-"))return l.getKeyFromPlainPrivatePKCS8PEM(e);if(-1!=e.indexOf("-END RSA PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var C=l.getDecryptedKeyHex(e,t),T=new fr;return T.readPKCS5PrvKeyHex(C),T}if(-1!=e.indexOf("-END EC PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){w=l.getDecryptedKeyHex(e,t),d=s(w,0,[1],"04");var R=s(w,0,[2,0],"06"),I=s(w,0,[3,0],"03").substr(2),D="";if(void 0===Wr.crypto.OID.oidhex2name[R])throw"undefined OID(hex) in KJUR.crypto.OID: "+R;D=Wr.crypto.OID.oidhex2name[R];f=new a({curve:D});return f.setPublicKeyHex(I),f.setPrivateKeyHex(d),f.isPublic=!1,f}if(-1!=e.indexOf("-END DSA PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){w=l.getDecryptedKeyHex(e,t),k=s(w,0,[1],"02"),E=s(w,0,[2],"02"),x=s(w,0,[3],"02"),A=s(w,0,[4],"02"),P=s(w,0,[5],"02"),d=new u;return d.setPrivate(new V(k,16),new V(E,16),new V(x,16),new V(A,16),new V(P,16)),d}if(-1!=e.indexOf("-END ENCRYPTED PRIVATE KEY-"))return l.getKeyFromEncryptedPKCS8PEM(e,t);throw"not supported argument"},Fi.generateKeypair=function(e,t){if("RSA"==e){var r=t,i=new fr;i.generate(r,"10001"),i.isPrivate=!0,i.isPublic=!0;var n=new fr,s=i.n.toString(16),o=i.e.toString(16);n.setPublic(s,o),n.isPrivate=!1,n.isPublic=!0;var a={};return a.prvKeyObj=i,a.pubKeyObj=n,a}if("EC"==e){var u=t,c=new Wr.crypto.ECDSA({curve:u}),h=c.generateKeyPairHex();i=new Wr.crypto.ECDSA({curve:u});i.setPublicKeyHex(h.ecpubhex),i.setPrivateKeyHex(h.ecprvhex),i.isPrivate=!0,i.isPublic=!1;n=new Wr.crypto.ECDSA({curve:u});n.setPublicKeyHex(h.ecpubhex),n.isPrivate=!1,n.isPublic=!0;a={};return a.prvKeyObj=i,a.pubKeyObj=n,a}throw"unknown algorithm: "+e},Fi.getPEM=function(e,t,r,i,n,s){var o=Wr,a=o.asn1,u=a.DERObjectIdentifier,c=a.DERInteger,h=a.ASN1Util.newObject,l=a.x509,d=l.SubjectPublicKeyInfo,f=o.crypto,g=f.DSA,p=f.ECDSA,v=fr;function y(e){var t=h({seq:[{int:0},{int:{bigint:e.n}},{int:e.e},{int:{bigint:e.d}},{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.dmp1}},{int:{bigint:e.dmq1}},{int:{bigint:e.coeff}}]});return t}function m(e){var t=h({seq:[{int:1},{octstr:{hex:e.prvKeyHex}},{tag:["a0",!0,{oid:{name:e.curveName}}]},{tag:["a1",!0,{bitstr:{hex:"00"+e.pubKeyHex}}]}]});return t}function _(e){var t=h({seq:[{int:0},{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}},{int:{bigint:e.y}},{int:{bigint:e.x}}]});return t}if((void 0!==v&&e instanceof v||void 0!==g&&e instanceof g||void 0!==p&&e instanceof p)&&1==e.isPublic&&(void 0===t||"PKCS8PUB"==t)){var F=new d(e),S=F.getEncodedHex();return hi(S,"PUBLIC KEY")}if("PKCS1PRV"==t&&void 0!==v&&e instanceof v&&(void 0===r||null==r)&&1==e.isPrivate){F=y(e),S=F.getEncodedHex();return hi(S,"RSA PRIVATE KEY")}if("PKCS1PRV"==t&&void 0!==p&&e instanceof p&&(void 0===r||null==r)&&1==e.isPrivate){var b=new u({name:e.curveName}),w=b.getEncodedHex(),k=m(e),E=k.getEncodedHex(),x="";return x+=hi(w,"EC PARAMETERS"),x+=hi(E,"EC PRIVATE KEY"),x}if("PKCS1PRV"==t&&void 0!==g&&e instanceof g&&(void 0===r||null==r)&&1==e.isPrivate){F=_(e),S=F.getEncodedHex();return hi(S,"DSA PRIVATE KEY")}if("PKCS5PRV"==t&&void 0!==v&&e instanceof v&&void 0!==r&&null!=r&&1==e.isPrivate){F=y(e),S=F.getEncodedHex();return void 0===i&&(i="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",S,r,i,s)}if("PKCS5PRV"==t&&void 0!==p&&e instanceof p&&void 0!==r&&null!=r&&1==e.isPrivate){F=m(e),S=F.getEncodedHex();return void 0===i&&(i="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("EC",S,r,i,s)}if("PKCS5PRV"==t&&void 0!==g&&e instanceof g&&void 0!==r&&null!=r&&1==e.isPrivate){F=_(e),S=F.getEncodedHex();return void 0===i&&(i="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA",S,r,i,s)}var A=function(e,t){var r=P(e,t),i=new h({seq:[{seq:[{oid:{name:"pkcs5PBES2"}},{seq:[{seq:[{oid:{name:"pkcs5PBKDF2"}},{seq:[{octstr:{hex:r.pbkdf2Salt}},{int:r.pbkdf2Iter}]}]},{seq:[{oid:{name:"des-EDE3-CBC"}},{octstr:{hex:r.encryptionSchemeIV}}]}]}]},{octstr:{hex:r.ciphertext}}]});return i.getEncodedHex()},P=function(e,t){var r=100,i=D.lib.WordArray.random(8),n="DES-EDE3-CBC",s=D.lib.WordArray.random(8),o=D.PBKDF2(t,i,{keySize:6,iterations:r}
40),a=D.enc.Hex.parse(e),u=D.TripleDES.encrypt(a,o,{iv:s})+"",c={};return c.ciphertext=u,c.pbkdf2Salt=D.enc.Hex.stringify(i),c.pbkdf2Iter=r,c.encryptionSchemeAlg=n,c.encryptionSchemeIV=D.enc.Hex.stringify(s),c};if("PKCS8PRV"==t&&void 0!=v&&e instanceof v&&1==e.isPrivate){var C=y(e),T=C.getEncodedHex();F=h({seq:[{int:0},{seq:[{oid:{name:"rsaEncryption"}},{null:!0}]},{octstr:{hex:T}}]}),S=F.getEncodedHex();if(void 0===r||null==r)return hi(S,"PRIVATE KEY");E=A(S,r);return hi(E,"ENCRYPTED PRIVATE KEY")}if("PKCS8PRV"==t&&void 0!==p&&e instanceof p&&1==e.isPrivate){C=new h({seq:[{int:1},{octstr:{hex:e.prvKeyHex}},{tag:["a1",!0,{bitstr:{hex:"00"+e.pubKeyHex}}]}]}),T=C.getEncodedHex(),F=h({seq:[{int:0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:e.curveName}}]},{octstr:{hex:T}}]}),S=F.getEncodedHex();if(void 0===r||null==r)return hi(S,"PRIVATE KEY");E=A(S,r);return hi(E,"ENCRYPTED PRIVATE KEY")}if("PKCS8PRV"==t&&void 0!==g&&e instanceof g&&1==e.isPrivate){C=new c({bigint:e.x}),T=C.getEncodedHex(),F=h({seq:[{int:0},{seq:[{oid:{name:"dsa"}},{seq:[{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}}]}]},{octstr:{hex:T}}]}),S=F.getEncodedHex();if(void 0===r||null==r)return hi(S,"PRIVATE KEY");E=A(S,r);return hi(E,"ENCRYPTED PRIVATE KEY")}throw"unsupported object nor format"},Fi.getKeyFromCSRPEM=function(e){var t=li(e,"CERTIFICATE REQUEST"),r=Fi.getKeyFromCSRHex(t);return r},Fi.getKeyFromCSRHex=function(e){var t=Fi.parseCSRHex(e),r=Fi.getKey(t.p8pubkeyhex,null,"pkcs8pub");return r},Fi.parseCSRHex=function(e){var t=Gr,r=t.getChildIdx,i=t.getTLV,n={},s=e;if("30"!=s.substr(0,2))throw"malformed CSR(code:001)";var o=r(s,0);if(o.length<1)throw"malformed CSR(code:002)";if("30"!=s.substr(o[0],2))throw"malformed CSR(code:003)";var a=r(s,o[0]);if(a.length<3)throw"malformed CSR(code:004)";return n.p8pubkeyhex=i(s,a[2]),n},Fi.getJWKFromKey=function(e){var t={};if(e instanceof fr&&e.isPrivate)return t.kty="RSA",t.n=ti(e.n.toString(16)),t.e=ti(e.e.toString(16)),t.d=ti(e.d.toString(16)),t.p=ti(e.p.toString(16)),t.q=ti(e.q.toString(16)),t.dp=ti(e.dmp1.toString(16)),t.dq=ti(e.dmq1.toString(16)),t.qi=ti(e.coeff.toString(16)),t;if(e instanceof fr&&e.isPublic)return t.kty="RSA",t.n=ti(e.n.toString(16)),t.e=ti(e.e.toString(16)),t;if(e instanceof Wr.crypto.ECDSA&&e.isPrivate){var r=e.getShortNISTPCurveName();if("P-256"!==r&&"P-384"!==r)throw"unsupported curve name for JWT: "+r;var i=e.getPublicKeyXYHex();return t.kty="EC",t.crv=r,t.x=ti(i.x),t.y=ti(i.y),t.d=ti(e.prvKeyHex),t}if(e instanceof Wr.crypto.ECDSA&&e.isPublic){r=e.getShortNISTPCurveName();if("P-256"!==r&&"P-384"!==r)throw"unsupported curve name for JWT: "+r;i=e.getPublicKeyXYHex();return t.kty="EC",t.crv=r,t.x=ti(i.x),t.y=ti(i.y),t}throw"not supported key object"},fr.getPosArrayOfChildrenFromHex=function(e){return Gr.getChildIdx(e,0)},fr.getHexValueArrayOfChildrenFromHex=function(e){var t=Gr,r=t.getV,i=fr.getPosArrayOfChildrenFromHex(e),n=r(e,i[0]),s=r(e,i[1]),o=r(e,i[2]),a=r(e,i[3]),u=r(e,i[4]),c=r(e,i[5]),h=r(e,i[6]),l=r(e,i[7]),d=r(e,i[8]);i=new Array;return i.push(n,s,o,a,u,c,h,l,d),i},fr.prototype.readPrivateKeyFromPEMString=function(e){var t=li(e),r=fr.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8])},fr.prototype.readPKCS5PrvKeyHex=function(e){var t=fr.getHexValueArrayOfChildrenFromHex(e);this.setPrivateEx(t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},fr.prototype.readPKCS8PrvKeyHex=function(e){var t,r,i,n,s,o,a,u,c=Gr,h=c.getVbyList;if(!1===c.isASN1HEX(e))throw"not ASN.1 hex string";try{t=h(e,0,[2,0,1],"02"),r=h(e,0,[2,0,2],"02"),i=h(e,0,[2,0,3],"02"),n=h(e,0,[2,0,4],"02"),s=h(e,0,[2,0,5],"02"),o=h(e,0,[2,0,6],"02"),a=h(e,0,[2,0,7],"02"),u=h(e,0,[2,0,8],"02")}catch(l){throw"malformed PKCS#8 plain RSA private key"}this.setPrivateEx(t,r,i,n,s,o,a,u)},fr.prototype.readPKCS5PubKeyHex=function(e){var t=Gr,r=t.getV;if(!1===t.isASN1HEX(e))throw"keyHex is not ASN.1 hex string";var i=t.getChildIdx(e,0);if(2!==i.length||"02"!==e.substr(i[0],2)||"02"!==e.substr(i[1],2))throw"wrong hex for PKCS#5 public key";var n=r(e,i[0]),s=r(e,i[1]);this.setPublic(n,s)},fr.prototype.readPKCS8PubKeyHex=function(e){var t=Gr;if(!1===t.isASN1HEX(e))throw"not ASN.1 hex string";if("06092a864886f70d010101"!==t.getTLVbyList(e,0,[0,0]))throw"not PKCS8 RSA public key";var r=t.getTLVbyList(e,0,[1,0]);this.readPKCS5PubKeyHex(r)},fr.prototype.readCertPubKeyHex=function(e,t){var r,i;r=new Ei,r.readCertHex(e),i=r.getPublicKeyHex(),this.readPKCS8PubKeyHex(i)};var Si=new RegExp("");function bi(e,t){for(var r="",i=t/4-e.length,n=0;n<i;n++)r+="0";return r+e}function wi(e,t,r){var i="",n=0;while(i.length<t)i+=si(r(oi(e+String.fromCharCode.apply(String,[(4278190080&n)>>24,(16711680&n)>>16,(65280&n)>>8,255&n])))),n+=1;return i}function ki(e){for(var t in Wr.crypto.Util.DIGESTINFOHEAD){var r=Wr.crypto.Util.DIGESTINFOHEAD[t],i=r.length;if(e.substring(0,i)==r){var n=[t,e.substring(i)];return n}}return[]}
40function Ei(){var e=Gr,t=e.getChildIdx,r=e.getV,i=e.getTLV,n=e.getVbyList,s=e.getTLVbyList,o=e.getIdxbyList,a=e.getVidx,u=e.oidname,c=Ei,h=li;this.hex=null,this.version=0,this.foffset=0,this.aExtInfo=null,this.getVersion=function(){return null===this.hex||0!==this.version?this.version:"a003020102"!==s(this.hex,0,[0,0])?(this.version=1,this.foffset=-1,1):(this.version=3,3)},this.getSerialNumberHex=function(){return n(this.hex,0,[0,1+this.foffset],"02")},this.getSignatureAlgorithmField=function(){return u(n(this.hex,0,[0,2+this.foffset,0],"06"))},this.getIssuerHex=function(){return s(this.hex,0,[0,3+this.foffset],"30")},this.getIssuerString=function(){return c.hex2dn(this.getIssuerHex())},this.getSubjectHex=function(){return s(this.hex,0,[0,5+this.foffset],"30")},this.getSubjectString=function(){return c.hex2dn(this.getSubjectHex())},this.getNotBefore=function(){var e=n(this.hex,0,[0,4+this.foffset,0]);return e=e.replace(/(..)/g,"%$1"),e=decodeURIComponent(e),e},this.getNotAfter=function(){var e=n(this.hex,0,[0,4+this.foffset,1]);return e=e.replace(/(..)/g,"%$1"),e=decodeURIComponent(e),e},this.getPublicKeyHex=function(){return e.getTLVbyList(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyIdx=function(){return o(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyContentIdx=function(){var e=this.getPublicKeyIdx();return o(this.hex,e,[1,0],"30")},this.getPublicKey=function(){return Fi.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){return u(n(this.hex,0,[1,0],"06"))}
40,this.getSignatureValueHex=function(){return n(this.hex,0,[2],"03",!0)},this.verifySignature=function(e){var t=this.getSignatureAlgorithmName(),r=this.getSignatureValueHex(),i=s(this.hex,0,[0],"30"),n=new Wr.crypto.Signature({alg:t});return n.init(e),n.updateHex(i),n.verify(r)},this.parseExt=function(){if(3!==this.version)return-1;var r=o(this.hex,0,[0,7,0],"30"),i=t(this.hex,r);this.aExtInfo=new Array;for(var s=0;s<i.length;s++){var u={critical:!1},c=t(this.hex,i[s]),h=0;3===c.length&&(u.critical=!0,h=1),u.oid=e.hextooidstr(n(this.hex,i[s],[0],"06"));var l=o(this.hex,i[s],[1+h]);u.vidx=a(this.hex,l),this.aExtInfo.push(u)}},this.getExtInfo=function(e){var t=this.aExtInfo,r=e;if(e.match(/^[0-9.]+$/)||(r=Wr.asn1.x509.OID.name2oid(e)),""!==r)for(var i=0;i<t.length;i++)if(t[i].oid===r)return t[i]},this.getExtBasicConstraints=function(){var e=this.getExtInfo("basicConstraints");if(void 0===e)return e;var t=r(this.hex,e.vidx);if(""===t)return{};if("0101ff"===t)return{cA:!0};if("0101ff02"===t.substr(0,8)){var i=r(t,6),n=parseInt(i,16);return{cA:!0,pathLen:n}}throw"basicConstraints parse error"},this.getExtKeyUsageBin=function(){var e=this.getExtInfo("keyUsage");if(void 0===e)return"";var t=r(this.hex,e.vidx);if(t.length%2!=0||t.length<=2)throw"malformed key usage value";var i=parseInt(t.substr(0,2)),n=parseInt(t.substr(2),16).toString(2);return n.substr(0,n.length-i)},this.getExtKeyUsageString=function(){for(var e=this.getExtKeyUsageBin(),t=new Array,r=0;r<e.length;r++)"1"==e.substr(r,1)&&t.push(Ei.KEYUSAGE_NAME[r]);return t.join(",")},this.getExtSubjectKeyIdentifier=function(){var e=this.getExtInfo("subjectKeyIdentifier");return void 0===e?e:r(this.hex,e.vidx)},this.getExtAuthorityKeyIdentifier=function(){var e=this.getExtInfo("authorityKeyIdentifier");if(void 0===e)return e;for(var n={},s=i(this.hex,e.vidx),o=t(s,0),a=0;a<o.length;a++)"80"===s.substr(o[a],2)&&(n.kid=r(s,o[a]));return n},this.getExtExtKeyUsageName=function(){var e=this.getExtInfo("extKeyUsage");if(void 0===e)return e;var n=new Array,s=i(this.hex,e.vidx);if(""===s)return n;for(var o=t(s,0),a=0;a<o.length;a++)n.push(u(r(s,o[a])));return n},this.getExtSubjectAltName=function(){for(var e=this.getExtSubjectAltName2(),t=new Array,r=0;r<e.length;r++)"DNS"===e[r][0]&&t.push(e[r][1]);return t},this.getExtSubjectAltName2=function(){var e,n,s,o=this.getExtInfo("subjectAltName");if(void 0===o)return o;for(var a=new Array,u=i(this.hex,o.vidx),c=t(u,0),h=0;h<c.length;h++)s=u.substr(c[h],2),e=r(u,c[h]),"81"===s&&(n=ni(e),a.push(["MAIL",n])),"82"===s&&(n=ni(e),a.push(["DNS",n])),"84"===s&&(n=Ei.hex2dn(e,0),a.push(["DN",n])),"86"===s&&(n=ni(e),a.push(["URI",n])),"87"===s&&(n=yi(e),a.push(["IP",n]));return a},this.getExtCRLDistributionPointsURI=function(){var e=this.getExtInfo("cRLDistributionPoints");if(void 0===e)return e;for(var r=new Array,i=t(this.hex,e.vidx),s=0;s<i.length;s++)try{var o=n(this.hex,i[s],[0,0,0],"86"),a=ni(o);r.push(a)}catch(u){}return r},this.getExtAIAInfo=function(){var e=this.getExtInfo("authorityInfoAccess");if(void 0===e)return e;for(var r={ocsp:[],caissuer:[]},i=t(this.hex,e.vidx),s=0;s<i.length;s++){var o=n(this.hex,i[s],[0],"06"),a=n(this.hex,i[s],[1],"86");"2b06010505073001"===o&&r.ocsp.push(ni(a)),"2b06010505073002"===o&&r.caissuer.push(ni(a))}return r},this.getExtCertificatePolicies=function(){var e=this.getExtInfo("certificatePolicies");if(void 0===e)return e;for(var s=i(this.hex,e.vidx),o=[],a=t(s,0),c=0;c<a.length;c++){var h={},l=t(s,a[c]);if(h.id=u(r(s,l[0])),2===l.length)for(var d=t(s,l[1]),f=0;f<d.length;f++){var g=n(s,d[f],[0],"06");"2b06010505070201"===g?h.cps=ni(n(s,d[f],[1])):"2b06010505070202"===g&&(h.unotice=ni(n(s,d[f],[1,0])))}o.push(h)}return o},this.readCertPEM=function(e){this.readCertHex(h(e))},this.readCertHex=function(e){this.hex=e,this.getVersion();try{o(this.hex,0,[0,7],"a3"),this.parseExt()}catch(t){}},this.getInfo=function(){var e,t,r;if(e="Basic Fields\n",e+=" serial number: "+this.getSerialNumberHex()+"\n",e+=" signature algorithm: "+this.getSignatureAlgorithmField()+"\n",e+=" issuer: "+this.getIssuerString()+"\n",e+=" notBefore: "+this.getNotBefore()+"\n",e+=" notAfter: "+this.getNotAfter()+"\n",e+=" subject: "+this.getSubjectString()+"\n",e+=" subject public key info: \n",t=this.getPublicKey(),e+=" key algorithm: "+t.type+"\n","RSA"===t.type&&(e+=" n="+_i(t.n.toString(16)).substr(0,16)+"...\n",e+=" e="+_i(t.e.toString(16))+"\n"),r=this.aExtInfo,void 0!==r&&null!==r){e+="X509v3 Extensions:\n";for(var i=0;i<r.length;i++){var n=r[i],s=Wr.asn1.x509.OID.oid2name(n.oid);""===s&&(s=n.oid);var o="";if(!0===n.critical&&(o="CRITICAL"),e+=" "+s+" "+o+":\n","basicConstraints"===s){var a=this.getExtBasicConstraints();void 0===a.cA?e+=" {}\n":(e+=" cA=true",void 0!==a.pathLen&&(e+=", pathLen="+a.pathLen),e+="\n")}else if("keyUsage"===s)e+=" "+this.getExtKeyUsageString()+"\n";else if("subjectKeyIdentifier"===s)e+=" "+this.getExtSubjectKeyIdentifier()+"\n";else if("authorityKeyIdentifier"===s){var u=this.getExtAuthorityKeyIdentifier();void 0!==u.kid&&(e+=" kid="+u.kid+"\n")}else if("extKeyUsage"===s){var c=this.getExtExtKeyUsageName();e+=" "+c.join(", ")+"\n"}else if("subjectAltName"===s){var h=this.getExtSubjectAltName2();e+=" "+h+"\n"}else if("cRLDistributionPoints"===s){var l=this.getExtCRLDistributionPointsURI();e+=" "+l+"\n"}else if("authorityInfoAccess"===s){var d=this.getExtAIAInfo();void 0!==d.ocsp&&(e+=" ocsp: "+d.ocsp.join(",")+"\n"),void 0!==d.caissuer&&(e+=" caissuer: "+d.caissuer.join(",")+"\n")}else if("certificatePolicies"===s)for(var f=this.getExtCertificatePolicies(),g=0;g<f.length;g++)void 0!==f[g].id&&(e+=" policy oid: "+f[g].id+"\n"),void 0!==f[g].cps&&(e+=" cps: "+f[g].cps+"\n")}}return e+="signature algorithm: "+this.getSignatureAlgorithmName()+"\n",e+="signature: "+this.getSignatureValueHex().substr(0,16)+"...\n",e}}
40Si.compile("[^0-9a-f]","gi"),fr.prototype.sign=function(e,t){var r=function(e){return Wr.crypto.Util.hashString(e,t)},i=r(e);return this.signWithMessageHash(i,t)},fr.prototype.signWithMessageHash=function(e,t){var r=Wr.crypto.Util.getPaddedDigestInfoHex(e,t,this.n.bitLength()),i=cr(r,16),n=this.doPrivate(i),s=n.toString(16);return bi(s,this.n.bitLength())},fr.prototype.signPSS=function(e,t,r){var i=function(e){return Wr.crypto.Util.hashHex(e,t)},n=i(oi(e));return void 0===r&&(r=-1),this.signWithMessageHashPSS(n,t,r)},fr.prototype.signWithMessageHashPSS=function(e,t,r){var i,n=si(e),s=n.length,o=this.n.bitLength()-1,a=Math.ceil(o/8),u=function(e){return Wr.crypto.Util.hashHex(e,t)};if(-1===r||void 0===r)r=s;else if(-2===r)r=a-s-2;else if(r<-2)throw"invalid salt length";if(a<s+r+2)throw"data too long";var c="";r>0&&(c=new Array(r),(new ur).nextBytes(c),c=String.fromCharCode.apply(String,c));var h=si(u(oi("\0\0\0\0\0\0\0\0"+n+c))),l=[];for(i=0;i<a-r-s-2;i+=1)l[i]=0;var d=String.fromCharCode.apply(String,l)+"�"+c,f=wi(h,d.length,u),g=[];for(i=0;i<d.length;i+=1)g[i]=d.charCodeAt(i)^f.charCodeAt(i);var p=65280>>8*a-o&255;for(g[0]&=~p,i=0;i<s;
40i++)g.push(h.charCodeAt(i));return g.push(188),bi(this.doPrivate(new V(g)).toString(16),this.n.bitLength())},fr.prototype.verify=function(e,t){t=t.replace(Si,""),t=t.replace(/[ \n]+/g,"");var r=cr(t,16);if(r.bitLength()>this.n.bitLength())return 0;var i=this.doPublic(r),n=i.toString(16).replace(/^1f+00/,""),s=ki(n);if(0==s.length)return!1;var o=s[0],a=s[1],u=function(e){return Wr.crypto.Util.hashString(e,o)},c=u(e);return a==c},fr.prototype.verifyWithMessageHash=function(e,t){t=t.replace(Si,""),t=t.replace(/[ \n]+/g,"");var r=cr(t,16);if(r.bitLength()>this.n.bitLength())return 0;var i=this.doPublic(r),n=i.toString(16).replace(/^1f+00/,""),s=ki(n);if(0==s.length)return!1;s[0];var o=s[1];return o==e},fr.prototype.verifyPSS=function(e,t,r,i){var n=function(e){return Wr.crypto.Util.hashHex(e,r)},s=n(oi(e));return void 0===i&&(i=-1),this.verifyWithMessageHashPSS(s,t,r,i)},fr.prototype.verifyWithMessageHashPSS=function(e,t,r,i){var n=new V(t,16);if(n.bitLength()>this.n.bitLength())return!1;var s,o=function(e){return Wr.crypto.Util.hashHex(e,r)},a=si(e),u=a.length,c=this.n.bitLength()-1,h=Math.ceil(c/8);if(-1===i||void 0===i)i=u;else if(-2===i)i=h-u-2;else if(i<-2)throw"invalid salt length";if(h<u+i+2)throw"data too long";var l=this.doPublic(n).toByteArray();for(s=0;s<l.length;s+=1)l[s]&=255;while(l.length<h)l.unshift(0);if(188!==l[h-1])throw"encoded message does not end in 0xbc";l=String.fromCharCode.apply(String,l);var d=l.substr(0,h-u-1),f=l.substr(d.length,u),g=65280>>8*h-c&255;if(0!==(d.charCodeAt(0)&g))throw"bits beyond keysize not zero";var p=wi(f,d.length,o),v=[];for(s=0;s<d.length;s+=1)v[s]=d.charCodeAt(s)^p.charCodeAt(s);v[0]&=~g;var y=h-u-i-2;for(s=0;s<y;s+=1)if(0!==v[s])throw"leftmost octets not zero";if(1!==v[y])throw"0x01 marker not found";return f===si(o(oi("\0\0\0\0\0\0\0\0"+a+String.fromCharCode.apply(String,v.slice(-i)))))},fr.SALT_LEN_HLEN=-1,fr.SALT_LEN_MAX=-2,fr.SALT_LEN_RECOVER=-2,Ei.hex2dn=function(e,t){if(void 0===t&&(t=0),"30"!==e.substr(t,2))throw"malformed DN";for(var r=new Array,i=Gr.getChildIdx(e,t),n=0;n<i.length;n++)r.push(Ei.hex2rdn(e,i[n]));return r=r.map((function(e){return e.replace("/","\\/")})),"/"+r.join("/")},Ei.hex2rdn=function(e,t){if(void 0===t&&(t=0),"31"!==e.substr(t,2))throw"malformed RDN";for(var r=new Array,i=Gr.getChildIdx(e,t),n=0;n<i.length;n++)r.push(Ei.hex2attrTypeValue(e,i[n]));return r=r.map((function(e){return e.replace("+","\\+")})),r.join("+")},Ei.hex2attrTypeValue=function(e,t){var r=Gr,i=r.getV;if(void 0===t&&(t=0),"30"!==e.substr(t,2))throw"malformed attribute type and value";var n=r.getChildIdx(e,t);2!==n.length||e.substr(n[0],2);var s=i(e,n[0]),o=Wr.asn1.ASN1Util.oidHexToInt(s),a=Wr.asn1.x509.OID.oid2atype(o),u=i(e,n[1]),c=si(u);return a+"="+c},Ei.getPublicKeyFromCertHex=function(e){var t=new Ei;return t.readCertHex(e),t.getPublicKey()},Ei.getPublicKeyFromCertPEM=function(e){var t=new Ei;return t.readCertPEM(e),t.getPublicKey()},Ei.getPublicKeyInfoPropOfCertPEM=function(e){var t,r,i=Gr,n=i.getVbyList,s={};return s.algparam=null,t=new Ei,t.readCertPEM(e),r=t.getPublicKeyHex(),s.keyhex=n(r,0,[1],"03").substr(2),s.algoid=n(r,0,[0,0],"06"),"2a8648ce3d0201"===s.algoid&&(s.algparam=n(r,0,[0,1],"06")),s},Ei.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"],"undefined"!=typeof Wr&&Wr||(Wr={}),"undefined"!=typeof Wr.jws&&Wr.jws||(Wr.jws={}),Wr.jws.JWS=function(){var e=Wr,t=e.jws.JWS,r=t.isSafeJSONString;this.parseJWS=function(e,t){if(void 0===this.parsedJWS||!t&&void 0===this.parsedJWS.sigvalH){var i=e.match(/^([^.]+)\.([^.]+)\.([^.]+)$/);if(null==i)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";var n=i[1],s=i[2],o=i[3],a=n+"."+s;if(this.parsedJWS={},this.parsedJWS.headB64U=n,this.parsedJWS.payloadB64U=s,this.parsedJWS.sigvalB64U=o,this.parsedJWS.si=a,!t){var u=ri(o),c=cr(u,16);this.parsedJWS.sigvalH=u,this.parsedJWS.sigvalBI=c}var h=$r(n),l=$r(s);if(this.parsedJWS.headS=h,this.parsedJWS.payloadS=l,!r(h,this.parsedJWS,"headP"))throw"malformed JSON string for JWS Head: "+h}}},Wr.jws.JWS.sign=function(e,t,r,i,n){var s,o,a,u=Wr,c=u.jws,h=c.JWS,l=h.readSafeJSONString,d=h.isSafeJSONString,f=u.crypto,g=(f.ECDSA,f.Mac),p=f.Signature,v=JSON;if("string"!=typeof t&&"object"!=Object(S["a"])(t))throw"spHeader must be JSON string or object: "+t;if("object"==Object(S["a"])(t)&&(o=t,s=v.stringify(o)),"string"==typeof t){if(s=t,!d(s))throw"JWS Head is not safe JSON string: "+s;o=l(s)}if(a=r,"object"==Object(S["a"])(r)&&(a=v.stringify(r)),""!=e&&null!=e||void 0===o.alg||(e=o.alg),""!=e&&null!=e&&void 0===o.alg&&(o.alg=e,s=v.stringify(o)),e!==o.alg)throw"alg and sHeader.alg doesn't match: "+e+"!="+o.alg;var y=null;if(void 0===h.jwsalg2sigalg[e])throw"unsupported alg name: "+e;y=h.jwsalg2sigalg[e];var m=zr(s),_=zr(a),F=m+"."+_,b="";if("Hmac"==y.substr(0,4)){if(void 0===i)throw"mac key shall be specified for HS* alg";var w=new g({alg:y,prov:"cryptojs",pass:i});w.updateString(F),b=w.doFinal()}else if(-1!=y.indexOf("withECDSA")){var k=new p({alg:y});k.init(i,n),k.updateString(F),hASN1Sig=k.sign(),b=Wr.crypto.ECDSA.asn1SigToConcatSig(hASN1Sig)}else if("none"!=y){k=new p({alg:y});k.init(i,n),k.updateString(F),b=k.sign()}var E=ti(b);return F+"."+E},Wr.jws.JWS.verify=function(e,t,r){var i,n=Wr,s=n.jws,o=s.JWS,a=o.readSafeJSONString,u=n.crypto,c=u.ECDSA,h=u.Mac,l=u.Signature;void 0!==Object(S["a"])(fr)&&(i=fr);var d=e.split(".");if(3!==d.length)return!1;
40var f=d[0],g=d[1],p=f+"."+g,v=ri(d[2]),y=a($r(d[0])),m=null,_=null;if(void 0===y.alg)throw"algorithm not specified in header";if(m=y.alg,_=m.substr(0,2),null!=r&&"[object Array]"===Object.prototype.toString.call(r)&&r.length>0){var F=":"+r.join(":")+":";if(-1==F.indexOf(":"+m+":"))throw"algorithm '"+m+"' not accepted in the list"}if("none"!=m&&null===t)throw"key shall be specified to verify.";if("string"==typeof t&&-1!=t.indexOf("-----BEGIN ")&&(t=Fi.getKey(t)),("RS"==_||"PS"==_)&&!(t instanceof i))throw"key shall be a RSAKey obj for RS* and PS* algs";if("ES"==_&&!(t instanceof c))throw"key shall be a ECDSA obj for ES* algs";var b=null;if(void 0===o.jwsalg2sigalg[y.alg])throw"unsupported alg name: "+m;if(b=o.jwsalg2sigalg[m],"none"==b)throw"not supported";if("Hmac"==b.substr(0,4)){var w=null;if(void 0===t)throw"hexadecimal key shall be specified for HMAC";var k=new h({alg:b,pass:t});return k.updateString(p),w=k.doFinal(),v==w}if(-1!=b.indexOf("withECDSA")){var E=null;try{E=c.concatSigToASN1Sig(v)}catch(A){return!1}var x=new l({alg:b});return x.init(t),x.updateString(p),x.verify(E)}x=new l({alg:b});return x.init(t),x.updateString(p),x.verify(v)},Wr.jws.JWS.parse=function(e){var t,r,i,n=e.split("."),s={};if(2!=n.length&&3!=n.length)throw"malformed sJWS: wrong number of '.' splitted elements";return t=n[0],r=n[1],3==n.length&&(i=n[2]),s.headerObj=Wr.jws.JWS.readSafeJSONString($r(t)),s.payloadObj=Wr.jws.JWS.readSafeJSONString($r(r)),s.headerPP=JSON.stringify(s.headerObj,null," "),null==s.payloadObj?s.payloadPP=$r(r):s.payloadPP=JSON.stringify(s.payloadObj,null," "),void 0!==i&&(s.sigHex=ri(i)),s},Wr.jws.JWS.verifyJWT=function(e,t,r){var i=Wr,n=i.jws,s=n.JWS,o=s.readSafeJSONString,a=s.inArray,u=s.includedArray,c=e.split("."),h=c[0],l=c[1],d=(ri(c[2]),o($r(h))),f=o($r(l));if(void 0===d.alg)return!1;if(void 0===r.alg)throw"acceptField.alg shall be specified";if(!a(d.alg,r.alg))return!1;if(void 0!==f.iss&&"object"===Object(S["a"])(r.iss)&&!a(f.iss,r.iss))return!1;if(void 0!==f.sub&&"object"===Object(S["a"])(r.sub)&&!a(f.sub,r.sub))return!1;if(void 0!==f.aud&&"object"===Object(S["a"])(r.aud))if("string"==typeof f.aud){if(!a(f.aud,r.aud))return!1}else if("object"==Object(S["a"])(f.aud)&&!u(f.aud,r.aud))return!1;var g=n.IntDate.getNow();return void 0!==r.verifyAt&&"number"===typeof r.verifyAt&&(g=r.verifyAt),void 0!==r.gracePeriod&&"number"===typeof r.gracePeriod||(r.gracePeriod=0),!(void 0!==f.exp&&"number"==typeof f.exp&&f.exp+r.gracePeriod<g)&&(!(void 0!==f.nbf&&"number"==typeof f.nbf&&g<f.nbf-r.gracePeriod)&&(!(void 0!==f.iat&&"number"==typeof f.iat&&g<f.iat-r.gracePeriod)&&((void 0===f.jti||void 0===r.jti||f.jti===r.jti)&&!!s.verify(e,t,r.alg))))},Wr.jws.JWS.includedArray=function(e,t){var r=Wr.jws.JWS.inArray;if(null===e)return!1;if("object"!==Object(S["a"])(e))return!1;if("number"!==typeof e.length)return!1;for(var i=0;i<e.length;i++)if(!r(e[i],t))return!1;return!0},Wr.jws.JWS.inArray=function(e,t){if(null===t)return!1;if("object"!==Object(S["a"])(t))return!1;if("number"!==typeof t.length)return!1;for(var r=0;r<t.length;r++)if(t[r]==e)return!0;return!1},Wr.jws.JWS.jwsalg2sigalg={HS256:"HmacSHA256",HS384:"HmacSHA384",HS512:"HmacSHA512",RS256:"SHA256withRSA",RS384:"SHA384withRSA",RS512:"SHA512withRSA",ES256:"SHA256withECDSA",ES384:"SHA384withECDSA",PS256:"SHA256withRSAandMGF1",PS384:"SHA384withRSAandMGF1",PS512:"SHA512withRSAandMGF1",none:"none"},Wr.jws.JWS.isSafeJSONString=function(e,t,r){var i=null;try{return i=Jr(e),"object"!=Object(S["a"])(i)?0:i.constructor===Array?0:(t&&(t[r]=i),1)}catch(n){return 0}},Wr.jws.JWS.readSafeJSONString=function(e){var t=null;try{return t=Jr(e),"object"!=Object(S["a"])(t)||t.constructor===Array?null:t}catch(r){return null}},Wr.jws.JWS.getEncodedSignatureValueFromJWS=function(e){var t=e.match(/^[^.]+\.[^.]+\.([^.]+)$/);if(null==t)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";return t[1]},Wr.jws.JWS.getJWKthumbprint=function(e){if("RSA"!==e.kty&&"EC"!==e.kty&&"oct"!==e.kty)throw"unsupported algorithm for JWK Thumprint";var t="{";if("RSA"===e.kty){if("string"!=typeof e.n||"string"!=typeof e.e)throw"wrong n and e value for RSA key";t+='"e":"'+e.e+'",',t+='"kty":"'+e.kty+'",',t+='"n":"'+e.n+'"}'}else if("EC"===e.kty){if("string"!=typeof e.crv||"string"!=typeof e.x||"string"!=typeof e.y)throw"wrong crv, x and y value for EC key";t+='"crv":"'+e.crv+'",',t+='"kty":"'+e.kty+'",',t+='"x":"'+e.x+'",',t+='"y":"'+e.y+'"}'}else if("oct"===e.kty){if("string"!=typeof e.k)throw"wrong k value for oct(symmetric) key";t+='"kty":"'+e.kty+'",',t+='"k":"'+e.k+'"}'}var r=oi(t),i=Wr.crypto.Util.hashHex(r,"sha256"),n=ti(i);return n},Wr.jws.IntDate={},Wr.jws.IntDate.get=function(e){var t=Wr.jws.IntDate,r=t.getNow,i=t.getZulu;if("now"==e)return r();if("now + 1hour"==e)return r()+3600;if("now + 1day"==e)return r()+86400;if("now + 1month"==e)return r()+2592e3;if("now + 1year"==e)return r()+31536e3;if(e.match(/Z$/))return i(e);if(e.match(/^[0-9]+$/))return parseInt(e);throw"unsupported format: "+e},Wr.jws.IntDate.getZulu=function(e){return fi(e)},Wr.jws.IntDate.getNow=function(){var e=~~(new Date/1e3);return e},Wr.jws.IntDate.intDate2UTCString=function(e){var t=new Date(1e3*e);return t.toUTCString()},Wr.jws.IntDate.intDate2Zulu=function(e){var t=new Date(1e3*e),r=("0000"+t.getUTCFullYear()).slice(-4),i=("00"+(t.getUTCMonth()+1)).slice(-2),n=("00"+t.getUTCDate()).slice(-2),s=("00"+t.getUTCHours()).slice(-2),o=("00"+t.getUTCMinutes()).slice(-2),a=("00"+t.getUTCSeconds()).slice(-2);return r+i+n+s+o+a+"Z"};Wr.crypto.EDSA,Wr.crypto.DSA,Wr.crypto.Signature,Wr.crypto.MessageDigest,Wr.crypto.Mac,Wr.crypto.Cipher;var xi=Wr.crypto,Ai=Wr,Pi=(Ai.asn1,Wr),Ci=Pi.jws,Ti=Wr,Ri=(Ti.lang,["RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"]);function Ii(e){var t=e.jws,r=e.KeyUtil,i=e.X509,n=e.crypto,s=e.hextob64u,o=e.b64tohex,a=e.AllowedSigningAlgs;return function(){function e(){Object(u["a"])(this,e)}return Object(c["a"])(e,null,[{key:"parseJwt",value:function(e){F.debug("JoseUtil.parseJwt");try{var r=t.JWS.parse(e);return{header:r.headerObj,payload:r.payloadObj}}catch(i){F.error(i)}}},{key:"validateJwt",value:function(t,n,s,a,u,c,h){F.debug("JoseUtil.validateJwt");try{if("RSA"===n.kty)if(n.e&&n.n)n=r.getKey(n);else{if(!n.x5c||!n.x5c.length)return F.error("JoseUtil.validateJwt: RSA key missing key material",n),Promise.reject(new Error("RSA key missing key material"));var l=o(n.x5c[0]);n=i.getPublicKeyFromCertHex(l)}else{if("EC"!==n.kty)return F.error("JoseUtil.validateJwt: Unsupported key type",n&&n.kty),Promise.reject(new Error(n.kty));if(!(n.crv&&n.x&&n.y))return F.error("JoseUtil.validateJwt: EC key missing key material",n),Promise.reject(new Error("EC key missing key material"));n=r.getKey(n)}return e._validateJwt(t,n,s,a,u,c,h)}catch(d){return F.error(d&&d.message||d),Promise.reject("JWT validation failed")}}},{key:"validateJwtAttributes",value:function(t,r,i,n,s,o){n||(n=0),s||(s=parseInt(Date.now()/1e3));var a=e.parseJwt(t).payload;if(!a.iss)return F.error("JoseUtil._validateJwt: issuer was not provided"),Promise.reject(new Error("issuer was not provided"));if(a.iss!==r)return F.error("JoseUtil._validateJwt: Invalid issuer in token",a.iss),Promise.reject(new Error("Invalid issuer in token: "+a.iss));if(!a.aud)return F.error("JoseUtil._validateJwt: aud was not provided"),Promise.reject(new Error("aud was not provided"));var u=a.aud===i||Array.isArray(a.aud)&&a.aud.indexOf(i)>=0;if(!u)return F.error("JoseUtil._validateJwt: Invalid audience in token",a.aud),Promise.reject(new Error("Invalid audience in token: "+a.aud));if(a.azp&&a.azp!==i)return F.error("JoseUtil._validateJwt: Invalid azp in token",a.azp),Promise.reject(new Error("Invalid azp in token: "+a.azp));if(!o){var c=s+n,h=s-n;if(!a.iat)return F.error("JoseUtil._validateJwt: iat was not provided"),Promise.reject(new Error("iat was not provided"));if(c<a.iat)return F.error("JoseUtil._validateJwt: iat is in the future",a.iat),Promise.reject(new Error("iat is in the future: "+a.iat));if(a.nbf&&c<a.nbf)return F.error("JoseUtil._validateJwt: nbf is in the future",a.nbf),Promise.reject(new Error("nbf is in the future: "+a.nbf));if(!a.exp)return F.error("JoseUtil._validateJwt: exp was not provided"),Promise.reject(new Error("exp was not provided"));if(a.exp<h)return F.error("JoseUtil._validateJwt: exp is in the past",a.exp
40),Promise.reject(new Error("exp is in the past:"+a.exp))}return Promise.resolve(a)}},{key:"_validateJwt",value:function(r,i,n,s,o,u,c){return e.validateJwtAttributes(r,n,s,o,u,c).then((function(e){try{return t.JWS.verify(r,i,a)?e:(F.error("JoseUtil._validateJwt: signature validation failed"),Promise.reject(new Error("signature validation failed")))}catch(n){return F.error(n&&n.message||n),Promise.reject(new Error("signature validation failed"))}}))}},{key:"hashString",value:function(e,t){try{return n.Util.hashString(e,t)}catch(r){F.error(r)}}},{key:"hexToBase64Url",value:function(e){try{return s(e)}catch(t){F.error(t)}}}]),e}()}var Di=Ii({jws:Ci,KeyUtil:Fi,X509:Ei,crypto:xi,hextob64u:ti,b64tohex:B,AllowedSigningAlgs:Ri}),ji=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:A,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:C,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Di;if(Object(u["a"])(this,e),!t)throw F.error("UserInfoService.ctor: No settings passed"),new Error("settings");this._settings=t,this._jsonService=new r(void 0,void 0,this._getClaimsFromJwt.bind(this)),this._metadataService=new i(this._settings),this._joseUtil=n}return Object(c["a"])(e,[{key:"getClaims",value:function(e){var t=this;return e?this._metadataService.getUserInfoEndpoint().then((function(r){return F.debug("UserInfoService.getClaims: received userinfo url",r),t._jsonService.getJson(r,e).then((function(e){return F.debug("UserInfoService.getClaims: claims received",e),e}))})):(F.error("UserInfoService.getClaims: No token passed"),Promise.reject(new Error("A token is required")))}},{key:"_getClaimsFromJwt",value:function(e){var t=this;try{var r=this._joseUtil.parseJwt(e.responseText);if(!r||!r.header||!r.payload)return F.error("UserInfoService._getClaimsFromJwt: Failed to parse JWT",r),Promise.reject(new Error("Failed to parse id_token"));var i,n=r.header.kid;switch(this._settings.userInfoJwtIssuer){case"OP":i=this._metadataService.getIssuer();break;case"ANY":i=Promise.resolve(r.payload.iss);break;default:i=Promise.resolve(this._settings.userInfoJwtIssuer);break}return i.then((function(i){return F.debug("UserInfoService._getClaimsFromJwt: Received issuer:"+i),t._metadataService.getSigningKeys().then((function(s){if(!s)return F.error("UserInfoService._getClaimsFromJwt: No signing keys from metadata"),Promise.reject(new Error("No signing keys from metadata"));var o;if(F.debug("UserInfoService._getClaimsFromJwt: Received signing keys"),n)o=s.filter((function(e){return e.kid===n}))[0];else{if(s=t._filterByAlg(s,r.header.alg),s.length>1)return F.error("UserInfoService._getClaimsFromJwt: No kid found in id_token and more than one key found in metadata"),Promise.reject(new Error("No kid found in id_token and more than one key found in metadata"));o=s[0]}if(!o)return F.error("UserInfoService._getClaimsFromJwt: No key matching kid or alg found in signing keys"),Promise.reject(new Error("No key matching kid or alg found in signing keys"));var a=t._settings.client_id,u=t._settings.clockSkew;return F.debug("UserInfoService._getClaimsFromJwt: Validaing JWT; using clock skew (in seconds) of: ",u),t._joseUtil.validateJwt(e.responseText,o,i,a,u,void 0,!0).then((function(){return F.debug("UserInfoService._getClaimsFromJwt: JWT validation successful"),r.payload}))}))}))}catch(s){return void F.error("UserInfoService._getClaimsFromJwt: Error parsing JWT response",s.message)}}},{key:"_filterByAlg",value:function(e,t){var r=null;if(t.startsWith("RS"))r="RSA";else if(t.startsWith("PS"))r="PS";else{if(!t.startsWith("ES"))return F.debug("UserInfoService._filterByAlg: alg not supported: ",t),[];r="EC"}return F.debug("UserInfoService._filterByAlg: Looking for keys that match kty: ",r),e=e.filter((function(e){return e.kty===r})),F.debug("UserInfoService._filterByAlg: Number of keys that match kty: ",r,e.length),e}}]),e}(),Ni=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:A,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:C;if(Object(u["a"])(this,e),!t)throw F.error("TokenClient.ctor: No settings passed"),new Error("settings");this._settings=t,this._jsonService=new r,this._metadataService=new i(this._settings)}
40return Object(c["a"])(e,[{key:"exchangeCode",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.grant_type=t.grant_type||"authorization_code",t.client_id=t.client_id||this._settings.client_id,t.redirect_uri=t.redirect_uri||this._settings.redirect_uri,t.code?t.redirect_uri?t.code_verifier?t.client_id?this._metadataService.getTokenEndpoint(!1).then((function(r){return F.debug("TokenClient.exchangeCode: Received token endpoint"),e._jsonService.postForm(r,t).then((function(e){return F.debug("TokenClient.exchangeCode: response received"),e}))})):(F.error("TokenClient.exchangeCode: No client_id passed"),Promise.reject(new Error("A client_id is required"))):(F.error("TokenClient.exchangeCode: No code_verifier passed"),Promise.reject(new Error("A code_verifier is required"))):(F.error("TokenClient.exchangeCode: No redirect_uri passed"),Promise.reject(new Error("A redirect_uri is required"))):(F.error("TokenClient.exchangeCode: No code passed"),Promise.reject(new Error("A code is required")))}},{key:"exchangeRefreshToken",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.grant_type=t.grant_type||"refresh_token",t.client_id=t.client_id||this._settings.client_id,t.refresh_token?t.client_id?this._metadataService.getTokenEndpoint(!1).then((function(r){return F.debug("TokenClient.exchangeRefreshToken: Received token endpoint"),e._jsonService.postForm(r,t).then((function(e){return F.debug("TokenClient.exchangeRefreshToken: response received"),e}))})):(F.error("TokenClient.exchangeRefreshToken: No client_id passed"),Promise.reject(new Error("A client_id is required"))):(F.error("TokenClient.exchangeRefreshToken: No refresh_token passed"),Promise.reject(new Error("A refresh_token is required")))}}]),e}(),Oi=r("f28b"),Hi=function(e){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=r.error,n=r.error_description,s=r.error_uri,o=r.state;if(Object(u["a"])(this,t),!i)throw F.error("No error passed to ErrorResponse"),new Error("error");return e=Object(h["a"])(this,Object(l["a"])(t).call(this,n||i)),e.name="ErrorResponse",e.error=i,e.error_description=n,e.error_uri=s,e.state=o,e}return Object(f["a"])(t,e),t}(Object(Oi["a"])(Error)),Bi=["nonce","at_hash","iat","nbf","exp","aud","iss","c_hash"],Ui=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:C,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ji,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Di,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Ni;if(Object(u["a"])(this,e),!t)throw F.error("ResponseValidator.ctor: No settings passed to ResponseValidator"),new Error("settings");this._settings=t,this._metadataService=new r(this._settings),this._userInfoService=new i(this._settings),this._joseUtil=n,this._tokenClient=new s(this._settings)}return Object(c["a"])(e,[{key:"validateSigninResponse",value:function(e,t){var r=this;return F.debug("ResponseValidator.validateSigninResponse"),this._processSigninParams(e,t).then((function(t){return F.debug("ResponseValidator.validateSigninResponse: state processed"),r._validateTokens(e,t).then((function(e){return F.debug("ResponseValidator.validateSigninResponse: tokens validated"),r._processClaims(e).then((function(e){return F.debug("ResponseValidator.validateSigninResponse: claims processed"),e}))}))}))}},{key:"validateSignoutResponse",value:function(e,t){return e.id!==t.state?(F.error("ResponseValidator.validateSignoutResponse: State does not match"),Promise.reject(new Error("State does not match"))):(F.debug("ResponseValidator.validateSignoutResponse: state validated"),t.state=e.data,t.error?(F.warn("ResponseValidator.validateSignoutResponse: Response was error",t.error),Promise.reject(new Hi(t))):Promise.resolve(t))}},{key:"_processSigninParams",value:function(e,t){if(e.id!==t.state)return F.error("ResponseValidator._processSigninParams: State does not match"),Promise.reject(new Error("State does not match"));if(!e.client_id)return F.error("ResponseValidator._processSigninParams: No client_id on
40state"),Promise.reject(new Error("No client_id on state"));if(!e.authority)return F.error("ResponseValidator._processSigninParams: No authority on state"),Promise.reject(new Error("No authority on state"));if(this._settings.authority){if(this._settings.authority&&this._settings.authority!==e.authority)return F.error("ResponseValidator._processSigninParams: authority mismatch on settings vs. signin state"),Promise.reject(new Error("authority mismatch on settings vs. signin state"))}else this._settings.authority=e.authority;if(this._settings.client_id){if(this._settings.client_id&&this._settings.client_id!==e.client_id)return F.error("ResponseValidator._processSigninParams: client_id mismatch on settings vs. signin state"),Promise.reject(new Error("client_id mismatch on settings vs. signin state"))}else this._settings.client_id=e.client_id;return F.debug("ResponseValidator._processSigninParams: state validated"),t.state=e.data,t.error?(F.warn("ResponseValidator._processSigninParams: Response was error",t.error),Promise.reject(new Hi(t))):e.nonce&&!t.id_token?(F.error("ResponseValidator._processSigninParams: Expecting id_token in response"),Promise.reject(new Error("No id_token in response"))):!e.nonce&&t.id_token?(F.error("ResponseValidator._processSigninParams: Not expecting id_token in response"),Promise.reject(new Error("Unexpected id_token in response"))):e.code_verifier&&!t.code?(F.error("ResponseValidator._processSigninParams: Expecting code in response"),Promise.reject(new Error("No code in response"))):!e.code_verifier&&t.code?(F.error("ResponseValidator._processSigninParams: Not expecting code in response"),Promise.reject(new Error("Unexpected code in response"))):Promise.resolve(t)}},{key:"_processClaims",value:function(e){var t=this;if(e.isOpenIdConnect){if(F.debug("ResponseValidator._processClaims: response is OIDC, processing claims"),e.profile=this._filterProtocolClaims(e.profile),this._settings.loadUserInfo&&e.access_token)return F.debug("ResponseValidator._processClaims: loading user info"),this._userInfoService.getClaims(e.access_token).then((function(r){return F.debug("ResponseValidator._processClaims: user info claims received from user info endpoint"),r.sub!==e.profile.sub?(F.error("ResponseValidator._processClaims: sub from user info endpoint does not match sub in access_token"),Promise.reject(new Error("sub from user info endpoint does not match sub in access_token"))):(e.profile=t._mergeClaims(e.profile,r),F.debug("ResponseValidator._processClaims: user info claims received, updated profile:",e.profile),e)}));F.debug("ResponseValidator._processClaims: not loading user info")}else F.debug("ResponseValidator._processClaims: response is not OIDC, not processing claims");return Promise.resolve(e)}},{key:"_mergeClaims",value:function(e,t){var r=Object.assign({},e);for(var i in t){var n=t[i];Array.isArray(n)||(n=[n]);for(var s=0;s<n.length;s++){var o=n[s];r[i]?Array.isArray(r[i])?r[i].indexOf(o)<0&&r[i].push(o):r[i]!==o&&("object"===Object(S["a"])(o)?r[i]=this._mergeClaims(r[i],o):r[i]=[r[i],o]):r[i]=o}}return r}},{key:"_filterProtocolClaims",value:function(e){F.debug("ResponseValidator._filterProtocolClaims, incoming claims:",e);var t=Object.assign({},e);return this._settings._filterProtocolClaims?(Bi.forEach((function(e){delete t[e]})),F.debug("ResponseValidator._filterProtocolClaims: protocol claims filtered",t)):F.debug("ResponseValidator._filterProtocolClaims: protocol claims not filtered"),t}},{key:"_validateTokens",value:function(e,t){return t.code?(F.debug("ResponseValidator._validateTokens: Validating code"),this._processCode(e,t)):t.id_token?t.access_token?(F.debug("ResponseValidator._validateTokens: Validating id_token and access_token"),this._validateIdTokenAndAccessToken(e,t)):(F.debug("ResponseValidator._validateTokens: Validating id_token"),this._validateIdToken(e,t)):(F.debug("ResponseValidator._validateTokens: No code to process or id_token to validate"),Promise.resolve(t))}},{key:"_processCode",value:function(e,t){var r=this,i={client_id:e.client_id,client_secret:this._settings.client_secret,code:t.code,redirect_uri:e.redirect_uri,code_verifier:e.code_verifier};return this._tokenClient.exchangeCode(i).then((function(i){for(var n in i)t[n]=i[n];return t.id_token?(F.debug("ResponseValidator._processCode: token response successful, processing id_token"),r._validateIdTokenAttributes(e,t)):(F.debug("ResponseValidator._processCode: token response successful, returning response"),t)}))}},{key:"_validateIdTokenAttributes",value:function(e,t){var r=this;return this._metadataService.getIssuer().then((function(i){var n=e.client_id,s=r._settings.clockSkew;return F.debug("ResponseValidator._validateIdTokenAttributes: Validaing JWT attributes; using clock skew (in seconds) of: ",s),r._joseUtil.validateJwtAttributes(t.id_token,i,n,s).then((function(r){return e.nonce&&e.nonce!==r.
40nonce?(F.error("ResponseValidator._validateIdTokenAttributes: Invalid nonce in id_token"),Promise.reject(new Error("Invalid nonce in id_token"))):r.sub?(t.profile=r,t):(F.error("ResponseValidator._validateIdTokenAttributes: No sub present in id_token"),Promise.reject(new Error("No sub present in id_token")))}))}))}},{key:"_validateIdTokenAndAccessToken",value:function(e,t){var r=this;return this._validateIdToken(e,t).then((function(e){return r._validateAccessToken(e)}))}},{key:"_validateIdToken",value:function(e,t){var r=this;if(!e.nonce)return F.error("ResponseValidator._validateIdToken: No nonce on state"),Promise.reject(new Error("No nonce on state"));var i=this._joseUtil.parseJwt(t.id_token);if(!i||!i.header||!i.payload)return F.error("ResponseValidator._validateIdToken: Failed to parse id_token",i),Promise.reject(new Error("Failed to parse id_token"));if(e.nonce!==i.payload.nonce)return F.error("ResponseValidator._validateIdToken: Invalid nonce in id_token"),Promise.reject(new Error("Invalid nonce in id_token"));var n=i.header.kid;return this._metadataService.getIssuer().then((function(s){return F.debug("ResponseValidator._validateIdToken: Received issuer"),r._metadataService.getSigningKeys().then((function(o){if(!o)return F.error("ResponseValidator._validateIdToken: No signing keys from metadata"),Promise.reject(new Error("No signing keys from metadata"));var a;if(F.debug("ResponseValidator._validateIdToken: Received signing keys"),n)a=o.filter((function(e){return e.kid===n}))[0];else{if(o=r._filterByAlg(o,i.header.alg),o.length>1)return F.error("ResponseValidator._validateIdToken: No kid found in id_token and more than one key found in metadata"),Promise.reject(new Error("No kid found in id_token and more than one key found in metadata"));a=o[0]}if(!a)return F.error("ResponseValidator._validateIdToken: No key matching kid or alg found in signing keys"),Promise.reject(new Error("No key matching kid or alg found in signing keys"));var u=e.client_id,c=r._settings.clockSkew;return F.debug("ResponseValidator._validateIdToken: Validaing JWT; using clock skew (in seconds) of: ",c),r._joseUtil.validateJwt(t.id_token,a,s,u,c).then((function(){return F.debug("ResponseValidator._validateIdToken: JWT validation successful"),i.payload.sub?(t.profile=i.payload,t):(F.error("ResponseValidator._validateIdToken: No sub present in id_token"),Promise.reject(new Error("No sub present in id_token")))}))}))}))}},{key:"_filterByAlg",value:function(e,t){var r=null;if(t.startsWith("RS"))r="RSA";else if(t.startsWith("PS"))r="PS";else{if(!t.startsWith("ES"))return F.debug("ResponseValidator._filterByAlg: alg not supported: ",t),[];r="EC"}return F.debug("ResponseValidator._filterByAlg: Looking for keys that match kty: ",r),e=e.filter((function(e){return e.kty===r})),F.debug("ResponseValidator._filterByAlg: Number of keys that match kty: ",r,e.length),e}},{key:"_validateAccessToken",value:function(e){if(!e.profile)return F.error("ResponseValidator._validateAccessToken: No profile loaded from id_token"),Promise.reject(new Error("No profile loaded from id_token"));if(!e.profile.at_hash)return F.error("ResponseValidator._validateAccessToken: No at_hash in id_token"),Promise.reject(new Error("No at_hash in id_token"));if(!e.id_token)return F.error("ResponseValidator._validateAccessToken: No id_token"),Promise.reject(new Error("No id_token"));var t=this._joseUtil.parseJwt(e.id_token);if(!t||!t.header)return F.error("ResponseValidator._validateAccessToken: Failed to parse id_token",t),Promise.reject(new Error("Failed to parse id_token"));var r=t.header.alg;if(!r||5!==r.length)return F.error("ResponseValidator._validateAccessToken: Unsupported alg:",r),Promise.reject(new Error("Unsupported alg: "+r));var i=r.substr(2,3);if(!i)return F.error("ResponseValidator._validateAccessToken: Unsupported alg:",r,i),Promise.reject(new Error("Unsupported alg: "+r));if(i=parseInt(i),256!==i&&384!==i&&512!==i)return F.error("ResponseValidator._validateAccessToken: Unsupported alg:",r,i),Promise.reject(new Error("Unsupported alg: "+r));var n="sha"+i,s=this._joseUtil.hashString(e.access_token,n);if(!s)return F.error("ResponseValidator._validateAccessToken: access_token hash failed:",n),Promise.reject(new Error("Failed to validate at_hash"));var o=s.substr(0,s.length/2),a=this._joseUtil.hexToBase64Url(o);return a!==e.profile.at_hash?(F.error("ResponseValidator._validateAccessToken: Failed to validate at_hash",a,e.profile.at_hash),Promise.reject(new Error("Failed to validate at_hash"))):(F.debug("ResponseValidator._validateAccessToken: success"),Promise.resolve(e))}}]),e}(),Mi=".well-known/openid-configuration",Vi="id_token",Ki="openid",qi=900,Li=300,Ji=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.authority,i=t.metadataUrl,n=t.metadata,s=t.signingKeys,o=t.client_id,a=t.client_secret,c=t.response_type,h=void 0===c?Vi:c,l=t.scope,d=void 0===l?Ki:l,f=t.redirect_uri,g=t.post_logout_redirect_uri,p=t.prompt,v=t.display,y=t.max_age,m=t.ui_locales,_=t.acr_values,F=t.resource,b=t.response_mode,w=t.filterProtocolClaims,k=void 0===w||w,E=t.loadUserInfo,A=void 0===E||E,P=t.staleStateAge,T=void 0===P?qi:P,R=t.clockSkew,I=void 0===R?Li:R,D=t.userInfoJwtIssuer,j=void 0===D?"OP":D,N=t.stateStore,O=void 0===N?new x:N,H=t.ResponseValidatorCtor,B=void 0===H?Ui:H,U=t.MetadataServiceCtor,M=void 0===U?C:U,V=t.extraQueryParams,K=void 0===V?{}:V;Object(u["a"])(this,e),this._authority=r,this._metadataUrl=i,this._metadata=n,this._signingKeys=s,this._client_id=o,this._client_secret=a,this._response_type=h,this._scope=d,this._redirect_uri=f,this._post_logout_redirect_uri=g,this._prompt=p,this._display=v,this._max_age=y,this._ui_locales=m,this._acr_values=_,this._resource=F,this._response_mode=b,this._filterProtocolClaims=!!k,this._loadUserInfo=!!A,this._staleStateAge=T,this._clockSkew=I,this._userInfoJwtIssuer=j,this._stateStore=O,this._val
40idator=new B(this),this._metadataService=new M(this),this._extraQueryParams="object"===Object(S["a"])(K)?K:{}}return Object(c["a"])(e,[{key:"client_id",get:function(){return this._client_id},set:function(e){if(this._client_id)throw F.error("OidcClientSettings.set_client_id: client_id has already been assigned."),new Error("client_id has already been assigned.");this._client_id=e}},{key:"client_secret",get:function(){return this._client_secret}},{key:"response_type",get:function(){return this._response_type}},{key:"scope",get:function(){return this._scope}},{key:"redirect_uri",get:function(){return this._redirect_uri}},{key:"post_logout_redirect_uri",get:function(){return this._post_logout_redirect_uri}},{key:"prompt",get:function(){return this._prompt}},{key:"display",get:function(){return this._display}},{key:"max_age",get:function(){return this._max_age}},{key:"ui_locales",get:function(){return this._ui_locales}},{key:"acr_values",get:function(){return this._acr_values}},{key:"resource",get:function(){return this._resource}},{key:"response_mode",get:function(){return this._response_mode}},{key:"authority",get:function(){return this._authority},set:function(e){if(this._authority)throw F.error("OidcClientSettings.set_authority: authority has already been assigned."),new Error("authority has already been assigned.");this._authority=e}},{key:"metadataUrl",get:function(){return this._metadataUrl||(this._metadataUrl=this.authority,this._metadataUrl&&this._metadataUrl.indexOf(Mi)<0&&("/"!==this._metadataUrl[this._metadataUrl.length-1]&&(this._metadataUrl+="/"),this._metadataUrl+=Mi)),this._metadataUrl}},{key:"metadata",get:function(){return this._metadata},set:function(e){this._metadata=e}},{key:"signingKeys",get:function(){return this._signingKeys},set:function(e){this._signingKeys=e}},{key:"filterProtocolClaims",get:function(){return this._filterProtocolClaims}},{key:"loadUserInfo",get:function(){return this._loadUserInfo}},{key:"staleStateAge",get:function(){return this._staleStateAge}},{key:"clockSkew",get:function(){return this._clockSkew}},{key:"userInfoJwtIssuer",get:function(){return this._userInfoJwtIssuer}},{key:"stateStore",get:function(){return this._stateStore}},{key:"validator",get:function(){return this._validator}},{key:"metadataService",get:function(){return this._metadataService}},{key:"extraQueryParams",get:function(){return this._extraQueryParams},set:function(e){"object"===Object(S["a"])(e)?this._extraQueryParams=e:this._extraQueryParams={}}}]),e}(),Wi=function(){function e(){Object(u["a"])(this,e)}return Object(c["a"])(e,null,[{key:"addQueryParam",value:function(e,t,r){return e.indexOf("?")<0&&(e+="?"),"?"!==e[e.length-1]&&(e+="&"),e+=encodeURIComponent(t),e+="=",e+=encodeURIComponent(r),e}},{key:"parseUrlFragment",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:E;"string"!==typeof e&&(e=r.location.href);var i=e.lastIndexOf(t);i>=0&&(e=e.substr(i+1)),"?"===t&&(i=e.indexOf("#"),i>=0&&(e=e.substr(0,i)));var n,s={},o=/([^&=]+)=([^&]*)/g,a=0;while(n=o.exec(e))if(s[decodeURIComponent(n[1])]=decodeURIComponent(n[2]),a++>50)return F.error("UrlUtility.parseUrlFragment: response exceeded expected number of parameters",e),{error:"Response exceeded expected number of parameters"};return s}}]),e}(),zi=r("c64e"),$i=r.n(zi);function Gi(){return $i()().replace(/-/g,"")}var Yi=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.id,i=t.data,n=t.created;Object(u["a"])(this,e),this._id=r||Gi(),this._data=i,this._created="number"===typeof n&&n>0?n:parseInt(Date.now()/1e3)}return Object(c["a"])(e,[{key:"toStorageString",value:function(){return F.debug("State.toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created})}},{key:"id",get:function(){return this._id}},{key:"data",get:function(){return this._data}},{key:"created",get:function(){return this._created}}],[{key:"fromStorageString",value:function(t){return F.debug("State.fromStorageString"),new e(JSON.parse(t))}},{key:"clearStaleState",value:function(t,r){var i=Date.now()/1e3-r;return t.getAllKeys().then((function(r){F.debug("State.clearStaleState: got keys",r);for(var n=[],s=function(s){var o=r[s];a=t.get(o).then((function(r){var n=!1;if(r)try{var s=e.fromStorageString(r);F.debug("State.clearStaleState: got item from key: ",o,s.created),s.created<=i&&(n=!0)}catch(a){F.error("State.clearStaleState: Error parsing state for key",o,a.message),n=!0}else F.debug("State.clearStaleState: no item in storage for key: ",o),n=!0;if(n)return F.debug("State.clearStaleState: removed item for key: ",o),t.remove(o)})),n.push(a)},o=0;o<r.length;o++){var a;s(o)}return F.debug("State.clearStaleState: waiting on promise count:",n.length),Promise.all(n)}))}}]),e}(),Qi=function(e){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=r.nonce,n=r.authority,s=r.client_id,o=r.redirect_uri,a=r.code_verifier;if(Object(u["a"])(this,t),e=Object(h["a"])(this,Object(l["a"])(t).call(this,arguments[0])),!0===i?e._nonce=Gi():i&&(e._nonce=i),!0===a?e._code_verifier=Gi()+Gi()+Gi():a&&(e._code_verifier=a),e.code_verifier){var c=Di.hashString(e.code_verifier,"SHA256");e._code_challenge=Di.hexToBase64Url(c)}return e._redirect_uri=o,e._authority=n,e._client_id=s,e}return Object(f["a"])(t,e),Object(c["a"])(t,[{key:"toStorageString",value:function(){return F.debug("SigninState.toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,nonce:this.nonce,code_verifier:this.code_verifier,redirect_uri:this.redirect_uri,authority:this.authority,client_id:this.client_id})}},{key:"nonce",get:function(){return this._nonce}},{key:"authority",get:function(){return this._authority}},{key:"client_id",get:function(){return this._client_id}},{key:"redirect_uri",get:function(){return this._redirect_uri}},{key:"code_verifier",get:function(){return this._code_verifier}},{key:"code_challenge",get:function(){return this._code_challenge}}],[{key:"fromStorageString",value:function(e){F.debug("SigninState.fromStorageString");var r=JSON.parse(e);return new t(r)}}]),t}(Yi),Xi=function(){function e(t){var r=t.url,i=t.client_id,n=t.redirect_uri,s=t.response_type,o=t.scope,a=t.authority,c=t.data,h=t.prompt,l=t.display,d=t.max_age,f=t.ui_locales,g=t.id_token_hint,p=t.login_hint,v=t.acr_values,y=t.resource,m=t.response_mode,_=t.request,S=t.request_uri,b=t.extraQueryParams;if(Object(u["a"])(this,e),!r)throw F.error("SigninRequest.ctor: No url passed"),new Error("url");
40if(!i)throw F.error("SigninRequest.ctor: No client_id passed"),new Error("client_id");if(!n)throw F.error("SigninRequest.ctor: No redirect_uri passed"),new Error("redirect_uri");if(!s)throw F.error("SigninRequest.ctor: No response_type passed"),new Error("response_type");if(!o)throw F.error("SigninRequest.ctor: No scope passed"),new Error("scope");if(!a)throw F.error("SigninRequest.ctor: No authority passed"),new Error("authority");var w=e.isOidc(s),k=e.isCode(s);this.state=new Qi({nonce:w,data:c,client_id:i,authority:a,redirect_uri:n,code_verifier:k}),r=Wi.addQueryParam(r,"client_id",i),r=Wi.addQueryParam(r,"redirect_uri",n),r=Wi.addQueryParam(r,"response_type",s),r=Wi.addQueryParam(r,"scope",o),r=Wi.addQueryParam(r,"state",this.state.id),w&&(r=Wi.addQueryParam(r,"nonce",this.state.nonce)),k&&(r=Wi.addQueryParam(r,"code_challenge",this.state.code_challenge),r=Wi.addQueryParam(r,"code_challenge_method","S256"));var E={prompt:h,display:l,max_age:d,ui_locales:f,id_token_hint:g,login_hint:p,acr_values:v,resource:y,request:_,request_uri:S,response_mode:m};for(var x in E)E[x]&&(r=Wi.addQueryParam(r,x,E[x]));for(var A in b)r=Wi.addQueryParam(r,A,b[A]);this.url=r}return Object(c["a"])(e,null,[{key:"isOidc",value:function(e){var t=e.split(/\s+/g).filter((function(e){return"id_token"===e}));return!!t[0]}},{key:"isOAuth",value:function(e){var t=e.split(/\s+/g).filter((function(e){return"token"===e}));return!!t[0]}},{key:"isCode",value:function(e){var t=e.split(/\s+/g).filter((function(e){return"code"===e}));return!!t[0]}}]),e}(),Zi="openid",en=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#";Object(u["a"])(this,e);var i=Wi.parseUrlFragment(t,r);this.error=i.error,this.error_description=i.error_description,this.error_uri=i.error_uri,this.code=i.code,this.state=i.state,this.id_token=i.id_token,this.session_state=i.session_state,this.access_token=i.access_token,this.token_type=i.token_type,this.scope=i.scope,this.profile=void 0,this.expires_in=i.expires_in}return Object(c["a"])(e,[{key:"expires_in",get:function(){if(this.expires_at){var e=parseInt(Date.now()/1e3);return this.expires_at-e}},set:function(e){var t=parseInt(e);if("number"===typeof t&&t>0){var r=parseInt(Date.now()/1e3);this.expires_at=r+t}}},{key:"expired",get:function(){var e=this.expires_in;if(void 0!==e)return e<=0}},{key:"scopes",get:function(){return(this.scope||"").split(" ")}},{key:"isOpenIdConnect",get:function(){return this.scopes.indexOf(Zi)>=0||!!this.id_token}}]),e}(),tn=function e(t){var r=t.url,i=t.id_token_hint,n=t.post_logout_redirect_uri,s=t.data,o=t.extraQueryParams;if(Object(u["a"])(this,e),!r)throw F.error("SignoutRequest.ctor: No url passed"),new Error("url");for(var a in i&&(r=Wi.addQueryParam(r,"id_token_hint",i)),n&&(r=Wi.addQueryParam(r,"post_logout_redirect_uri",n),s&&(this.state=new Yi({data:s}),r=Wi.addQueryParam(r,"state",this.state.id))),o)r=Wi.addQueryParam(r,a,o[a]);this.url=r},rn=function e(t){Object(u["a"])(this,e);var r=Wi.parseUrlFragment(t,"?");this.error=r.error,this.error_description=r.error_description,this.error_uri=r.error_uri,this.state=r.state},nn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(u["a"])(this,e),this._settings=t instanceof Ji?t:new Ji(t)}return Object(c["a"])(e,[{key:"createSigninRequest",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.response_type,i=t.scope,n=t.redirect_uri,s=t.data,o=t.state,a=t.prompt,u=t.display,c=t.max_age,h=t.ui_locales,l=t.id_token_hint,d=t.login_hint,f=t.acr_values,g=t.resource,p=t.request,v=t.request_uri,y=t.response_mode,m=t.extraQueryParams,_=arguments.length>1?arguments[1]:void 0;F.debug("OidcClient.createSigninRequest");var S=this._settings.client_id;r=r||this._settings.response_type,i=i||this._settings.scope,n=n||this._settings.redirect_uri,a=a||this._settings.prompt,u=u||this._settings.display,c=c||this._settings.max_age,h=h||this._settings.ui_locales,f=f||this._settings.acr_values,g=g||this._settings.resource,y=y||this._settings.response_mode,m=m||this._settings.extraQueryParams;var b=this._settings.authority;return Xi.isCode(r)&&"code"!==r?Promise.reject(new Error("OpenID Connect hybrid flow is not supported")):this._metadataService.getAuthorizationEndpoint().then((function(t){F.debug("OidcClient.createSigninRequest: Received authorization endpoint",t);var w=new Xi({url:t,client_id:S,redirect_uri:n,response_type:r,scope:i,data:s||o,authority:b,prompt:a,display:u,max_age:c,ui_locales:h,id_token_hint:l,login_hint:d,acr_values:f,resource:g,request:p,request_uri:v,extraQueryParams:m,response_mode:y}),k=w.state;return _=_||e._stateStore,_.set(k.id,k.toStorageString()).then((function(){return w}))}))}},{key:"processSigninResponse",value:function(e,t){var r=this;F.debug("OidcClient.processSigninResponse");var i="query"===this._settings.response_mode||!this._settings.response_mode&&Xi.isCode(this._settings.response_type),n=i?"?":"#",s=new en(e,n);return s.state?(t=t||this._stateStore,t.remove(s.state).then((function(e){if(!e)throw F.error("OidcClient.processSigninResponse: No matching state found in storage"),new Error("No matching state found in storage");var t=Qi.fromStorageString(e);return F.debug("OidcClient.processSigninResponse: Received state from storage; validating response"),r._validator.validateSigninResponse(t,s)}
40))):(F.error("OidcClient.processSigninResponse: No state in response"),Promise.reject(new Error("No state in response")))}},{key:"createSignoutRequest",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.id_token_hint,i=t.data,n=t.state,s=t.post_logout_redirect_uri,o=t.extraQueryParams,a=arguments.length>1?arguments[1]:void 0;return F.debug("OidcClient.createSignoutRequest"),s=s||this._settings.post_logout_redirect_uri,o=o||this._settings.extraQueryParams,this._metadataService.getEndSessionEndpoint().then((function(t){if(!t)throw F.error("OidcClient.createSignoutRequest: No end session endpoint url returned"),new Error("no end session endpoint");F.debug("OidcClient.createSignoutRequest: Received end session endpoint",t);var u=new tn({url:t,id_token_hint:r,post_logout_redirect_uri:s,data:i||n,extraQueryParams:o}),c=u.state;return c&&(F.debug("OidcClient.createSignoutRequest: Signout request has state to persist"),a=a||e._stateStore,a.set(c.id,c.toStorageString())),u}))}},{key:"processSignoutResponse",value:function(e,t){var r=this;F.debug("OidcClient.processSignoutResponse");var i=new rn(e);if(!i.state)return F.debug("OidcClient.processSignoutResponse: No state in response"),i.error?(F.warn("OidcClient.processSignoutResponse: Response was error: ",i.error),Promise.reject(new Hi(i))):Promise.resolve(i);var n=i.state;return t=t||this._stateStore,t.remove(n).then((function(e){if(!e)throw F.error("OidcClient.processSignoutResponse: No matching state found in storage"),new Error("No matching state found in storage");var t=Yi.fromStorageString(e);return F.debug("OidcClient.processSignoutResponse: Received state from storage; validating response"),r._validator.validateSignoutResponse(t,i)}))}},{key:"clearStaleState",value:function(e){return F.debug("OidcClient.clearStaleState"),e=e||this._stateStore,Yi.clearStaleState(e,this.settings.staleStateAge)}},{key:"_stateStore",get:function(){return this.settings.stateStore}},{key:"_validator",get:function(){return this.settings.validator}},{key:"_metadataService",get:function(){return this.settings.metadataService}},{key:"settings",get:function(){return this._settings}},{key:"metadataService",get:function(){return this._metadataService}}]),e}(),sn=function(){function e(){Object(u["a"])(this,e)}return Object(c["a"])(e,[{key:"prepare",value:function(){return Promise.resolve(this)}},{key:"navigate",value:function(e){return e&&e.url?(window.location=e.url,Promise.resolve()):(F.error("RedirectNavigator.navigate: No url provided"),Promise.reject(new Error("No url provided")))}},{key:"url",get:function(){return window.location.href}}]),e}(),on=500,an="location=no,toolbar=no,width=500,height=500,left=100,top=100;",un="_blank",cn=function(){function e(t){var r=this;Object(u["a"])(this,e),this._promise=new Promise((function(e,t){r._resolve=e,r._reject=t}));var i=t.popupWindowTarget||un,n=t.popupWindowFeatures||an;this._popup=window.open("",i,n),this._popup&&(F.debug("PopupWindow.ctor: popup successfully created"),this._checkForPopupClosedTimer=window.setInterval(this._checkForPopupClosed.bind(this),on))}return Object(c["a"])(e,[{key:"navigate",value:function(e){return this._popup?e&&e.url?(F.debug("PopupWindow.navigate: Setting URL in popup"),this._id=e.id,this._id&&(window["popupCallback_"+e.id]=this._callback.bind(this)),this._popup.focus(),this._popup.window.location=e.url):(this._error("PopupWindow.navigate: no url provided"),this._error("No url provided")):this._error("PopupWindow.navigate: Error opening popup window"),this.promise}},{key:"_success",value:function(e){F.debug("PopupWindow.callback: Successful response from popup window"),this._cleanup(),this._resolve(e)}},{key:"_error",value:function(e){F.error("PopupWindow.error: ",e),this._cleanup(),this._reject(new Error(e))}},{key:"close",value:function(){this._cleanup(!1)}},{key:"_cleanup",value:function(e){F.debug("PopupWindow.cleanup"),window.clearInterval(this._checkForPopupClosedTimer),this._checkForPopupClosedTimer=null,delete window["popupCallback_"+this._id],this._popup&&!e&&this._popup.close(),this._popup=null}},{key:"_checkForPopupClosed",value:function(){this._popup&&!this._popup.closed||this._error("Popup window closed")}},{key:"_callback",value:function(e,t){this._cleanup(t),e?(F.debug("PopupWindow.callback success"),this._success({url:e})):(F.debug("PopupWindow.callback: Invalid response from popup"),this._error("Invalid response from popup"))}},{key:"promise",get:function(){return this._promise}}],[{key:"notifyOpener",value:function(e,t,r){if(window.opener){if(e=e||window.location.href,e){var i=Wi.parseUrlFragment(e,r);if(i.state){var n="popupCallback_"+i.state,s=window.opener[n];s?(F.debug("PopupWindow.notifyOpener: passing url message to opener"),s(e,t)):F.warn("PopupWindow.notifyOpener: no matching callback found on opener")}else F.warn("PopupWindow.notifyOpener: no state found in response url")}}else F.warn("PopupWindow.notifyOpener: no window.opener. Can't complete notification.")}}]),e}(),hn=function(){function e(){Object(u["a"])(this,e)}return Object(c["a"])(e,[{key:"prepare",value:function(e){var t=new cn(e);return Promise.resolve(t)}},{key:"callback",value:function(e,t,r){F.debug("PopupNavigator.callback");try{return cn.notifyOpener(e,t,r),Promise.resolve()}catch(i){return Promise.reject(i)}}}]),e}(),ln=1e4,dn=function(){function e(){var t=this;Object(u["a"])(this,e),this._promise=new Promise((function(e,r){t._resolve=e,t._reject=r})),this._boundMessageEvent=this._message.bind(this),window.addEventListener("message",this._boundMessageEvent,!1),this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="absolute",this._frame.style.display="none",this._frame.style.width=0,this._frame.style.height=0,window.document.body.appendChild(this._frame)}return Object(c["a"])(e,[{key:"navigate",value:function(e){if(e&&e.url){var t=e.silentRequestTimeout||ln;F.debug("IFrameWindow.navigate: Using timeout of:",t),this._timer=window.setTimeout(this._timeout.bind(this),t),this._frame.src=e.url}else this._error("No url provided");return this.promise}},{key:"_success",value:function(e){this._cleanup(),F.debug("IFrameWindow: Successful response from frame window"),this._resolve(e)}},{key:"_error",value:function(e){this._cleanup(),F.error(e),this._reject(new Error(e))}},{key:"close",value:function(){this._cleanup()}},{key:"_cleanup",value:function(){this._frame&&(F.debug("IFrameWindow: cleanup"),window.removeEventListener("message",this._boundMessageEvent,!1),window.clearTimeout(this._timer),window.document.body.removeChild(this._frame),this._timer=null,this._frame=null,this._boundMessageEvent=null)}},{key:"_timeout",value:function(){F.debug("IFrameWindow.timeout"),this._error("Frame window timed out")}},{key:"_message",value:function(e){if(F.debug("IFrameWindow.message"),this._timer&&e.origin===this._origin&&e.source===this._frame.contentWindow){var t=e.data;t?this._success({url:t}):this._error("Invalid response from frame")}}},{key:"promise",get:function(){return this._promise}},{key:"_origin",get:function(){return location.protocol+"//"+location.host}}],[{key:"notifyParent",value:function(e){F.debug("IFrameWindow.notifyParent"),window.frameElement&&(e=e||window.location.href,e&&(F.debug("IFrameWindow.notifyParent: posting url message to parent"),window.parent.postMessage(e,location.protocol+"//"+location.host)))}}]),e}(),fn=function(){function e(){Object(u["a"])(this,e)}return Object(c["a"])(e,[{key:"prepare",value:function(e){var t=new dn(e);return Promise.resolve(t)}},{key:"callback",value:function(e){F.debug("IFrameNavigator.callback");try{return dn.notifyParent(e),Promise.resolve()}catch(t){return Promise.reject(t)}}}]),e}(),gn=60,pn=2e3,vn=function(e){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=r.popup_redirect_uri,n=r.popup_post_logout_redirect_uri,s=r.popupWindowFeatures,o=r.popupWindowTarget,a=r.silent_redirect_uri,c=r.silentRequestTimeout,d=r.automaticSilentRenew,f=void 0!==d&&d,g=r.includeIdTokenInSilentRenew,p=void 0===g||g,v=r.monitorSession,y=void 0===v||v,m=r.checkSessionInterval,_=void 0===m?pn:m,F=r.stopCheckSessionOnError,S=void 0===F||F,b=r.query_status_response_type,w=r.revokeAccessTokenOnSignout,k=void 0!==w&&w,A=r.accessTokenExpiringNotificationTime,P=void 0===A?gn:A,C=r.redirectNavigator,T=void 0===C?new sn:C,R=r.popupNavigator,I=void 0===R?new hn:R,D=r.iframeNavigator,j=void 0===D?new fn:D,N=r.userStore,O=void 0===N?new x({store:E.sessionStorage}):N;return Object(u["a"])(this,t),e=Object(h["a"])(this,Object(l["a"])(t).call(this,arguments[0])),e._popup_redirect_uri=i,e._popup_post_logout_redirect_uri=n,e._popupWindowFeatures=s,e._popupWindowTarget=
40o,e._silent_redirect_uri=a,e._silentRequestTimeout=c,e._automaticSilentRenew=f,e._includeIdTokenInSilentRenew=p,e._accessTokenExpiringNotificationTime=P,e._monitorSession=y,e._checkSessionInterval=_,e._stopCheckSessionOnError=S,b?e._query_status_response_type=b:arguments[0]&&arguments[0].response_type?e._query_status_response_type=Xi.isOidc(arguments[0].response_type)?"id_token":"code":e._query_status_response_type="id_token",e._revokeAccessTokenOnSignout=k,e._redirectNavigator=T,e._popupNavigator=I,e._iframeNavigator=j,e._userStore=O,e}return Object(f["a"])(t,e),Object(c["a"])(t,[{key:"popup_redirect_uri",get:function(){return this._popup_redirect_uri}},{key:"popup_post_logout_redirect_uri",get:function(){return this._popup_post_logout_redirect_uri}},{key:"popupWindowFeatures",get:function(){return this._popupWindowFeatures}},{key:"popupWindowTarget",get:function(){return this._popupWindowTarget}},{key:"silent_redirect_uri",get:function(){return this._silent_redirect_uri}},{key:"silentRequestTimeout",get:function(){return this._silentRequestTimeout}},{key:"automaticSilentRenew",get:function(){return this._automaticSilentRenew}},{key:"includeIdTokenInSilentRenew",get:function(){return this._includeIdTokenInSilentRenew}},{key:"accessTokenExpiringNotificationTime",get:function(){return this._accessTokenExpiringNotificationTime}},{key:"monitorSession",get:function(){return this._monitorSession}},{key:"checkSessionInterval",get:function(){return this._checkSessionInterval}},{key:"stopCheckSessionOnError",get:function(){return this._stopCheckSessionOnError}},{key:"query_status_response_type",get:function(){return this._query_status_response_type}},{key:"revokeAccessTokenOnSignout",get:function(){return this._revokeAccessTokenOnSignout}},{key:"redirectNavigator",get:function(){return this._redirectNavigator}},{key:"popupNavigator",get:function(){return this._popupNavigator}},{key:"iframeNavigator",get:function(){return this._iframeNavigator}},{key:"userStore",get:function(){return this._userStore}}]),t}(Ji),yn=function(){function e(t){var r=t.id_token,i=t.session_state,n=t.access_token,s=t.refresh_token,o=t.token_type,a=t.scope,c=t.profile,h=t.expires_at,l=t.state;Object(u["a"])(this,e),this.id_token=r,this.session_state=i,this.access_token=n,this.refresh_token=s,this.token_type=o,this.scope=a,this.profile=c,this.expires_at=h,this.state=l}return Object(c["a"])(e,[{key:"toStorageString",value:function(){return F.debug("User.toStorageString"),JSON.stringify({id_token:this.id_token,session_state:this.session_state,access_token:this.access_token,refresh_token:this.refresh_token,token_type:this.token_type,scope:this.scope,profile:this.profile,expires_at:this.expires_at})}},{key:"expires_in",get:function(){if(this.expires_at){var e=parseInt(Date.now()/1e3);return this.expires_at-e}},set:function(e){var t=parseInt(e);if("number"===typeof t&&t>0){var r=parseInt(Date.now()/1e3);this.expires_at=r+t}}},{key:"expired",get:function(){var e=this.expires_in;if(void 0!==e)return e<=0}},{key:"scopes",get:function(){return(this.scope||"").split(" ")}}],[{key:"fromStorageString",value:function(t){return F.debug("User.fromStorageString"),new e(JSON.parse(t))}}]),e}(),mn=r("268f"),_n=r.n(mn),Fn=r("8feb"),Sn=r.n(Fn);function bn(e,t){while(!Object.prototype.hasOwnProperty.call(e,t))if(e=Object(l["a"])(e),null===e)break;return e}function wn(e,t,r){return wn="undefined"!==typeof Reflect&&Sn.a?Sn.a:function(e,t,r){var i=bn(e,t);if(i){var n=_n()(i,t);return n.get?n.get.call(r):n.value}},wn(e,t,r||e)}r("20d6");var kn,En=function(){function e(t){Object(u["a"])(this,e),this._name=t,this._callbacks=[]}return Object(c["a"])(e,[{key:"addHandler",value:function(e){this._callbacks.push(e)}},{key:"removeHandler",value:function(e){var t=this._callbacks.findIndex((function(t){return t===e}));t>=0&&this._callbacks.splice(t,1)}},{key:"raise",value:function(){F.debug("Event: Raising event: "+this._name);for(var e=0;e<this._callbacks.length;e++){var t;(t=this._callbacks)[e].apply(t,arguments)}}}]),e}(),xn=5,An=function(e){function t(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:E.timer,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return Object(u["a"])(this,t),r=Object(h["a"])(this,Object(l["a"])(t).call(this,e)),r._timer=i,r._nowFunc=n||function(){return Date.now()/1e3},r}return Object(f["a"])(t,e),Object(c["a"])(t,[{key:"init",value:function(e){e<=0&&(e=1),e=parseInt(e);var t=this.now+e;if(this.expiration===t&&this._timerHandle)F.debug("Timer.init timer "+this._name+" skipping initialization since already initialized for expiration:",this.expiration);else{this.cancel(),F.debug("Timer.init timer "+this._name+" for duration:",e),this._expiration=t;var r=xn;e<r&&(r=e),this._timerHandle=this._timer.setInterval(this._callback.bind(this),1e3*r)}}},{key:"cancel",value:function(){this._timerHandle&&(F.debug("Timer.cancel: ",this._name),this._timer.clearInterval(this._timerHandle),this._timerHandle=null)}},{key:"_callback",value:function(){var e=this._expiration-this.now;F.debug("Timer.callback; "+this._name+" timer expires in:",e),this._expiration<=this.now&&(this.cancel(),wn(Object(l["a"])(t.prototype),"raise",this).call(this))}}
40,{key:"now",get:function(){return parseInt(this._nowFunc())}},{key:"expiration",get:function(){return this._expiration}}]),t}(En),Pn=60,Cn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.accessTokenExpiringNotificationTime,i=void 0===r?Pn:r,n=t.accessTokenExpiringTimer,s=void 0===n?new An("Access token expiring"):n,o=t.accessTokenExpiredTimer,a=void 0===o?new An("Access token expired"):o;Object(u["a"])(this,e),this._accessTokenExpiringNotificationTime=i,this._accessTokenExpiring=s,this._accessTokenExpired=a}return Object(c["a"])(e,[{key:"load",value:function(e){if(e.access_token&&void 0!==e.expires_in){var t=e.expires_in;if(F.debug("AccessTokenEvents.load: access token present, remaining duration:",t),t>0){var r=t-this._accessTokenExpiringNotificationTime;r<=0&&(r=1),F.debug("AccessTokenEvents.load: registering expiring timer in:",r),this._accessTokenExpiring.init(r)}else F.debug("AccessTokenEvents.load: canceling existing expiring timer becase we're past expiration."),this._accessTokenExpiring.cancel();var i=t+1;F.debug("AccessTokenEvents.load: registering expired timer in:",i),this._accessTokenExpired.init(i)}else this._accessTokenExpiring.cancel(),this._accessTokenExpired.cancel()}},{key:"unload",value:function(){F.debug("AccessTokenEvents.unload: canceling existing access token timers"),this._accessTokenExpiring.cancel(),this._accessTokenExpired.cancel()}},{key:"addAccessTokenExpiring",value:function(e){this._accessTokenExpiring.addHandler(e)}},{key:"removeAccessTokenExpiring",value:function(e){this._accessTokenExpiring.removeHandler(e)}},{key:"addAccessTokenExpired",value:function(e){this._accessTokenExpired.addHandler(e)}},{key:"removeAccessTokenExpired",value:function(e){this._accessTokenExpired.removeHandler(e)}}]),e}(),Tn=function(e){function t(e){var r;return Object(u["a"])(this,t),r=Object(h["a"])(this,Object(l["a"])(t).call(this,e)),r._userLoaded=new En("User loaded"),r._userUnloaded=new En("User unloaded"),r._silentRenewError=ne
40w En("Silent renew error"),r._userSignedOut=new En("User signed out"),r._userSessionChanged=new En("User session changed"),r}return Object(f["a"])(t,e),Object(c["a"])(t,[{key:"load",value:function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];F.debug("UserManagerEvents.load"),wn(Object(l["a"])(t.prototype),"load",this).call(this,e),r&&this._userLoaded.raise(e)}},{key:"unload",value:function(){F.debug("UserManagerEvents.unload"),wn(Object(l["a"])(t.prototype),"unload",this).call(this),this._userUnloaded.raise()}},{key:"addUserLoaded",value:function(e){this._userLoaded.addHandler(e)}},{key:"removeUserLoaded",value:function(e){this._userLoaded.removeHandler(e)}},{key:"addUserUnloaded",value:function(e){this._userUnloaded.addHandler(e)}},{key:"removeUserUnloaded",value:function(e){this._userUnloaded.removeHandler(e)}},{key:"addSilentRenewError",value:function(e){this._silentRenewError.addHandler(e)}},{key:"removeSilentRenewError",value:function(e){this._silentRenewError.removeHandler(e)}},{key:"_raiseSilentRenewError",value:function(e){F.debug("UserManagerEvents._raiseSilentRenewError",e.message),this._silentRenewError.raise(e)}},{key:"addUserSignedOut",value:function(e){this._userSignedOut.addHandler(e)}},{key:"removeUserSignedOut",value:function(e){this._userSignedOut.removeHandler(e)}},{key:"_raiseUserSignedOut",value:function(e){F.debug("UserManagerEvents._raiseUserSignedOut"),this._userSignedOut.raise(e)}},{key:"addUserSessionChanged",value:function(e){this._userSessionChanged.addHandler(e)}},{key:"removeUserSessionChanged",value:function(e){this._userSessionChanged.removeHandler(e)}},{key:"_raiseUserSessionChanged",value:function(e){F.debug("UserManagerEvents._raiseUserSessionChanged"),this._userSessionChanged.raise(e)}}]),t}(Cn),Rn=function(){function e(t){Object(u["a"])(this,e),this._userManager=t}return Object(c["a"])(e,[{key:"start",value:function(){this._callback||(this._callback=this._tokenExpiring.bind(this),this._userManager.events.addAccessTokenExpiring(this._callback),this._userManager.getUser().then((function(){})).catch((function(e){F.error("SilentRenewService.start: Error from getUser:",e.message)})))}},{key:"stop",value:function(){this._callback&&(this._userManager.events.removeAccessTokenExpiring(this._callback),delete this._callback)}},{key:"_tokenExpiring",value:function(){var e=this;this._userManager.signinSilent().then((function(){F.debug("SilentRenewService._tokenExpiring: Silent token renewal successful")}),(function(t){F.error("SilentRenewService._tokenExpiring: Error from signinSilent:",t.message),e._userManager.events._raiseSilentRenewError(t)}))}}]),e}(),In=2e3,Dn=function(){function e(t,r,i,n){var s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];Object(u["a"])(this,e),this._callback=t,this._client_id=r,this._url=i,this._interval=n||In,this._stopOnError=s;var o=i.indexOf("/",i.indexOf("//")+2);this._frame_origin=i.substr(0,o),this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="absolute",this._frame.style.display="none",this._frame.style.width=0,this._frame.style.height=0,this._frame.src=i}return Object(c["a"])(e,[{key:"load",value:function(){var e=this;return new Promise((function(t){e._frame.onload=function(){t()},window.document.body.appendChild(e._frame),e._boundMessageEvent=e._message.bind(e),window.addEventListener("message",e._boundMessageEvent,!1)}))}},{key:"_message",value:function(e){e.origin===this._frame_origin&&e.source===this._frame.contentWindow&&("error"===e.data?(F.error("CheckSessionIFrame: error message from check session op iframe"),this._stopOnError&&this.stop()):"changed"===e.data?(F.debug("CheckSessionIFrame: changed message from check session op iframe"),this.stop(),this._callback()):F.debug("CheckSessionIFrame: "+e.data+" message from check session op iframe"))}},{key:"start",value:function(e){var t=this;if(this._session_state!==e){F.debug("CheckSessionIFrame.start"),this.stop(),this._session_state=e;var r=function(){t._frame.contentWindow.postMessage(t._client_id+" "+t._session_state,t._frame_origin)};r(),this._timer=window.setInterval(r,this._interval)}}},{key:"stop",value:function(){this._session_state=null,this._timer&&(F.debug("CheckSessionIFrame.stop"),window.clearInterval(this._timer),this._timer=null)}}]),e}(),jn=function(){function e(t){var r=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Dn;if(Object(u["a"])(this,e),!t)throw F.error("SessionMonitor.ctor: No user manager passed to SessionMonitor"),new Error("userManager");this._userManager=t,this._CheckSessionIFrameCtor=i,this._userManager.events.addUserLoaded(this._start.bind(this)),this._userManager.events.addUserUnloaded(this._stop.bind(this)),this._userManager.getUser().then((function(e){e&&r._start(e)})).catch((function(e){F.error("SessionMonitor ctor: error from getUser:",e.message)}))}return Object(c["a"])(e,[{key:"_start",value:function(e){var t=this,r=e.session_state;r&&(this._sub=e.profile.sub,this._sid=e.profile.sid,F.debug("SessionMonitor._start: session_state:",r,", sub:",this._sub),this._checkSessionIFrame?this._checkSessionIFrame.start(r):this._metadataService.getCheckSessionIframe().then((function(e){if(e){F.debug("SessionMonitor._start: Initializing check session iframe");var i=t._client_id,n=t._checkSessionInterval,s=t._stopCheckSessionOnError;t._checkSessionIFrame=new t._CheckSessionIFrameCtor(t._callback.bind(t),i,e,n,s),t._checkSessionIFrame.load().then((function(){t._checkSessionIFrame.start(r)}))}else F.warn("SessionMonitor._start: No check session iframe found in the metadata")})).catch((function(e){F.error("SessionMonitor._start: Error from getCheckSessionIframe:",e.message)})))}},{key:"_stop",value:function(){this._sub=null,this._sid=null,this._checkSessionIFrame&&(F.debug("SessionMonitor._stop"),this._checkSessionIFrame.stop())}},{key:"_callback",value:function(){var e=this;this._userManager.querySessionStatus().then((function(t){var r=!0;t?t.sub===e._sub?(r=!1,e._checkSessionIFrame.start(t.session_state),t.sid===e._sid?F.debug("SessionMonitor._callback: Same sub still logged in at OP, restarting check session iframe; session_state:",t.session_state):(F.debug("SessionMonitor._callback: Same sub still logged in at OP, session state has changed, restarting check session iframe; session_state:",t.session_state),e._userManager.events._raiseUserSessionChanged())):F.debug("SessionMonitor._callback: Different subject signed into OP:",t.sub):F.debug("SessionMonitor._callback: Subject no longer signed into OP"),r&&(F.debug("SessionMonitor._callback: SessionMonitor._callback; raising signed out event"),e._userManager.events._raiseUserSignedOut())})).catch((function(t){F.debug("SessionMonitor._callback: Error calling queryCurrentSigninSession; raising signed out event",t.message),e._userManager.events._raiseUserSignedOut()}))}},{key:"_settings",get:function(){return this._userManager.settings}},{key:"_metadataService",get:function(){return this._userManager.metadataService}},{key:"_client_id",get:function(){return this._settings.client_id}},{key:"_checkSessionInterval",get:function(){return this._settings.checkSessionInterval}},{key:"_stopCheckSessionOnError",get:function(){return this._settings.stopCheckSessionOnError}}]),e}(),Nn="access_token",On="refresh_token",Hn=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:E.XMLHttpRequest,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:C;if(Object(u["a"])(this,e),!t)throw F.error("TokenRevocationClient.ctor: No settings provided"),new Error("No settings provided.");this._settings=t,this._XMLHttpRequestCtor=r,this._metadataService=new i(this._settings)}return Object(c["a"])(e,[{key:"revoke",value:function(e,t){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"access_token";if(!e)throw F.error("TokenRevocationClient.revoke: No token provided"),new Error("No token provided.");if(i!==Nn&&i!=On)throw F.error("TokenRevocationClient.revoke: Invalid token type"),new Error("Invalid token type.");return this._metadataService.getRevocationEndpoint().then((function(n){if(n){F.debug("TokenRevocationClient.revoke: Revoking "+i);var s=r._settings.client_id,o=r._settings.client_secret;return r._revoke(n,s,o,e,i)}if(t)throw F.error("TokenRevocationClient.revoke: Revocation not supported"),new Error("Revocation not supported")}))}},{key:"_revoke",value:function(e,t,r,i,n){var s=this;return new Promise((function(o,a){var u=new s._XMLHttpRequestCtor;u.open("POST",e),u.onload=function(){F.debug("TokenRevocationClient.revoke: HTTP response received, status",u.status),200===u.status?o():a(Error(u.statusText+" ("+u.status+")"))},u.onerror=function(){F.debug("TokenRevocationClient.revoke: Network Error."),a("Network Error")};var c="client_id="+encodeURIComponent(t);r&&(c+="&client_secret="+encodeURIComponent(r)),c+="&token_type_hint="+encodeURIComponent(n),c+="&token="+encodeURIComponent(i),u.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),u.send(c)}))}}]),e}(),Bn=function(e){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Rn,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:jn,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Hn,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Ni,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Di;return Object(u["a"])(this,t),r instanceof vn||(r=new vn(r)),e=Object(h["a"])(this,Object(l["a"])(t).call(this,r)),e._events=new Tn(r),e._silentRenewService=new i(Object(d["a"])(e)),e.settings.automaticSilentRenew&&(F.debug("UserManager.ctor: automaticSilentRenew is configured, setting up silent renew"),e.startSilentRenew()),e.settings.monitorSession&&(F.debug("UserManager.ctor: monitorSession is configured, setting up session monitor"),e._sessionMonitor=new n(Object(d["a"])(e))),e._token
40RevocationClient=new s(e._settings),e._tokenClient=new o(e._settings),e._joseUtil=a,e}return Object(f["a"])(t,e),Object(c["a"])(t,[{key:"getUser",value:function(){var e=this;return this._loadUser().then((function(t){return t?(F.info("UserManager.getUser: user loaded"),e._events.load(t,!1),t):(F.info("UserManager.getUser: user not found in storage"),null)}))}},{key:"removeUser",value:function(){var e=this;return this.storeUser(null).then((function(){F.info("UserManager.removeUser: user removed from storage"),e._events.unload()}))}},{key:"signinRedirect",value:function(e){return this._signinStart(e,this._redirectNavigator).then((function(){F.info("UserManager.signinRedirect: successful")}))}},{key:"signinRedirectCallback",value:function(e){return this._signinEnd(e||this._redirectNavigator.url).then((function(e){return e&&(e.profile&&e.profile.sub?F.info("UserManager.signinRedirectCallback: successful, signed in sub: ",e.profile.sub):F.info("UserManager.signinRedirectCallback: no sub")),e}))}},{key:"signinPopup",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.redirect_uri||this.settings.popup_redirect_uri||this.settings.redirect_uri;return t?(e.redirect_uri=t,e.display="popup",this._signin(e,this._popupNavigator,{startUrl:t,popupWindowFeatures:e.popupWindowFeatures||this.settings.popupWindowFeatures,popupWindowTarget:e.popupWindowTarget||this.settings.popupWindowTarget}).then((function(e){return e&&(e.profile&&e.profile.sub?F.info("UserManager.signinPopup: signinPopup successful, signed in sub: ",e.profile.sub):F.info("UserManager.signinPopup: no sub")),e}))):(F.error("UserManager.signinPopup: No popup_redirect_uri or redirect_uri configured"),Promise.reject(new Error("No popup_redirect_uri or redirect_uri configured")))}},{key:"signinPopupCallback",value:function(e){return this._signinCallback(e,this._popupNavigator).then((function(e){return e&&(e.profile&&e.profile.sub?F.info("UserManager.signinPopupCallback: successful, signed in sub: ",e.profile.sub):F.info("UserManager.signinPopupCallback: no sub")),e})).catch((function(e){F.error(e.message)}))}},{key:"signinSilent",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._loadUser().then((function(r){return r&&r.refresh_token?(t.refresh_token=r.refresh_token,e._useRefreshToken(t)):(t.id_token_hint=t.id_token_hint||e.settings.includeIdTokenInSilentRenew&&r&&r.id_token,e._signinSilentIframe(t))}))}},{key:"_useRefreshToken",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._tokenClient.exchangeRefreshToken(t).then((function(t){return t?t.access_token?e._loadUser().then((function(r){if(r){var i=Promise.resolve();return t.id_token&&(i=e._validateIdTokenFromTokenRefreshToken(r.profile,t.id_token)),i.then((function(){return F.debug("UserManager._useRefreshToken: refresh token response success"),r.access_token=t.access_token,r.refresh_token=t.refresh_token||r.refresh_token,r.expires_in=t.expires_in,e.storeUser(r).then((function(){return e._events.load(r),r}))}))}return null})):(F.error("UserManager._useRefreshToken: No access token returned from token endpoint"),Promise.reject("No access token returned from token endpoint")):(F.error("UserManager._useRefreshToken: No response returned from token endpoint"),Promise.reject("No response returned from token endpoint"))}))}},{key:"_validateIdTokenFromTokenRefreshToken",value:function(e,t){var r=this;return this._metadataService.getIssuer().then((function(i){return r._joseUtil.validateJwtAttributes(t,i,r._settings.client_id,r._settings.clockSkew).then((function(t){return t?t.sub!==e.sub?(F.error("UserManager._validateIdTokenFromTokenRefreshToken: sub in id_token does not match current sub"),Promise.reject(new Error("sub in id_token does not match current sub"))):t.auth_time&&t.auth_time!==e.auth_time?(F.error("UserManager._validateIdTokenFromTokenRefreshToken: auth_time in id_token does not match original auth_time"),Promise.reject(new Error("auth_time in id_token does not match original auth_time"))):t.azp&&t.azp!==e.azp?(F.error("UserManager._validateIdTokenFromTokenRefreshToken: azp in id_token does not match original azp"),Promise.reject(new Error("azp in id_token does not match original azp"))):!t.azp&&e.azp?(F.error("UserManager._validateIdTokenFromTokenRefreshToken: azp not in id_token, but present in original id_token"),Promise.reject(new Error("azp not in id_token, but present in original id_token"))):void 0:(F.error("UserManager._validateIdTokenFromTokenRefreshToken: Failed to validate id_token"),Promise.reject(new Error("Failed to validate id_token")))}))}))}},{key:"_signinSilentIframe",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.redirect_uri||this.settings.silent_redirect_uri;return t?(e.redirect_uri=t,e.prompt=e.prompt||"none",this._signin(e,this._iframeNavigator,{startUrl:t,silentRequestTimeout:e.silentRequestTimeout||this.settings.silentRequestTimeout}).then((function(e){return e&&(e.profile&&e.profile.sub?F.info("UserManager.signinSilent: successful, signed in sub: ",e.profile.sub):F.info("UserManager.signinSilent: no sub")),e}))):(F.error("UserManager.signinSilent: No silent_redirect_uri configured"),Promise.reject(new Error("No silent_redirect_uri configured")))}},{key:"signinSilentCallback",value:function(e){return this._signinCallback(e,this._iframeNavigator).then((function(e){return e&&(e.profile&&e.profile.sub?F.info("UserManager.signinSilentCallback: successful, signed in sub: ",e.profile.sub):F.info("UserManager.signinSilentCallback: no sub")),e}))}},{key:"querySessionStatus",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.redirect_uri||this.settings.silent_redirect_uri;return r?(t.redirect_uri=r,t.prompt="none",t.response_type=t.response_type||this.settings.query_status_response_type,t.scope="openid",this._signinStart(t,this._iframeNavigator,{startUrl:r,silentRequestTimeout:t.silentRequestTimeout||this.settings.silentRequestTimeout}).then((function(t){return e.processSigninResponse(t.url).then((function(e){if(F.debug("UserManager.querySessionStatus: got signin response"),e.session_state&&e.profile.sub)return F.info("UserManager.querySessionStatus: querySessionStatus success for sub: ",e.profile.sub),{session_state:e.session_state,sub:e.profile.sub,sid:e.profile.sid};F.info("querySessionStatus successful, user not authenticated")}))}))):(F.error("UserManager.querySessionStatus: No silent_redirect_uri configured"),Promise.reject(new Error("No silent_redirect_uri configured")))}},{key:"_signin",value:function(e,t){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._signinStart(e,t,i).then((function(e){return r._signinEnd(e.url)}))}},{key:"_signinStart",value:function(e,t){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.prepare(i).then((function(t){return F.debug("UserManager._signinStart: got navigator window handle"),r.createSigninRequest(e).then((function(e){return F.debug("UserManager._signinStart: got signin request"),i.url=e.url,i.id=e.state.id,t.navigate(i)})).catch((function(e){throw t.close&&(F.debug("UserManager._signinStart: Error after preparing navigator, closing navigator window"),t.close()),e}))}))}},{key:"_signinEnd",value:function(e){var t=this;return this.processSigninResponse(e).then((function(e){F.debug("UserManager._signinEnd: got signin response");var r=new yn(e);return t.storeUser(r).then((function(){return F.debug("UserManager._signinEnd: user stored"),t._events.load(r),e}))}))}},{key:"_signinCallback",value:function(e,t){return F.debug("UserManager._signinCallback"),t.callback(e)}},{key:"signoutRedirect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.post_logout_redirect_uri||this.settings.post_logout_redirect_uri;return t&&(e.post_logout_redirect_uri=t),this._signoutStart(e,this._redirectNavigator).then((function(){F.info("UserManager.signoutRedirect: successful")}))}},{key:"signoutRedirectCallback",value:function(e){return this._signoutEnd(e||this._redirectNavigator.url).then((function(e){return F.info("UserManager.signoutRedirectCallback: successful"),e}))}},{key:"signoutPopup",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.post_logout_redirect_uri||this.settings.popup_post_logout_redirect_uri||this.settings.post_logout_redirect_uri;return e.post_logout_redirect_uri=t,e.display="popup",e.post_logout_redirect_uri&&(e.state=e.state||{}),this._signout(e,this._popupNavigator,{startUrl:t,popupWindowFeatures:e.popupWindowFeatures||this.settings.popupWindowFeatures,popupWindowTarget:e.popupWindowTarget||this.settings.popupWindowTarget}).then((function(){F.info("UserManager.signoutPopup: successful")}))}},{key:"signoutPopupCallback",value:function(e,t){"undefined"===typeof t&&"boolean"===typeof e&&(t=e,e=null);var r="?";return this._popupNavigator.callback(e,t,r).then((function(){F.info("UserManager.signoutPopupCallback: successful")}))}},{key:"_signout",value:function(e,t){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._signoutStart(e,t,i).then((function(e){return r._signoutEnd(e.url)}))}},{key:"_signoutStart",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r.prepare(i).then((function(r){return F.debug("UserManager._signoutStart: got navigator window handle"),e._loadUser().then((function(n){F.debug("UserManager._signoutStart: loaded current user from storage");var s=e._settings.revokeAccessTokenOnSignout?e._revokeInternal(n):Promise.resolve();return s.then((function(){var s=t.id_token_hint||n&&n.id_token;return s&&(F.debug("UserManager._signoutStart: Setting id_token into signout request"),t.id_token_hint=s),e.removeUser().then((function(){return F.debug("UserManager._signoutStart: user removed, creating signout request"),e.createSignoutRequest
40(t).then((function(e){return F.debug("UserManager._signoutStart: got signout request"),i.url=e.url,e.state&&(i.id=e.state.id),r.navigate(i)}))}))}))})).catch((function(e){throw r.close&&(F.debug("UserManager._signoutStart: Error after preparing navigator, closing navigator window"),r.close()),e}))}))}},{key:"_signoutEnd",value:function(e){return this.processSignoutResponse(e).then((function(e){return F.debug("UserManager._signoutEnd: got signout response"),e}))}},{key:"revokeAccessToken",value:function(){var e=this;return this._loadUser().then((function(t){return e._revokeInternal(t,!0).then((function(r){if(r)return F.debug("UserManager.revokeAccessToken: removing token properties from user and re-storing"),t.access_token=null,t.refresh_token=null,t.expires_at=null,t.token_type=null,e.storeUser(t).then((function(){F.debug("UserManager.revokeAccessToken: user stored"),e._events.load(t)}))}))})).then((function(){F.info("UserManager.revokeAccessToken: access token revoked successfully")}))}},{key:"_revokeInternal",value:function(e,t){var r=this;if(e){var i=e.access_token,n=e.refresh_token;return this._revokeAccessTokenInternal(i,t).then((function(e){return r._revokeRefreshTokenInternal(n,t).then((function(t){return e||t||F.debug("UserManager.revokeAccessToken: no need to revoke due to no token(s), or JWT format"),e||t}))}))}return Promise.resolve(!1)}},{key:"_revokeAccessTokenInternal",value:function(e,t){return!e||e.indexOf(".")>=0?Promise.resolve(!1):this._tokenRevocationClient.revoke(e,t).then((function(){return!0}))}},{key:"_revokeRefreshTokenInternal",value:function(e,t){return e?this._tokenRevocationClient.revoke(e,t,"refresh_token").then((function(){return!0})):Promise.resolve(!1)}},{key:"startSilentRenew",value:function(){this._silentRenewService.start()}},{key:"stopSilentRenew",value:function(){this._silentRenewService.stop()}},{key:"_loadUser",value:function(){return this._userStore.get(this._userStoreKey).then((function(e){return e?(F.debug("UserManager._loadUser: user storageString loaded"),yn.fromStorageString(e)):(F.debug("UserManager._loadUser: no user storageString"),null)}))}},{key:"storeUser",value:function(e){if(e){F.debug("UserManager.storeUser: storing user");var t=e.toStorageString();return this._userStore.set(this._userStoreKey,t)}return F.debug("storeUser.storeUser: removing user"),this._userStore.remove(this._userStoreKey)}},{key:"_redirectNavigator",get:function(){return this.settings.redirectNavigator}},{key:"_popupNavigator",get:function(){return this.settings.popupNavigator}},{key:"_iframeNavigator",get:function(){return this.settings.iframeNavigator}},{key:"_userStore",get:function(){return this.settings.userStore}},{key:"_customUser",get:function(){return this.settings.customUser}},{key:"events",get:function(){return this._events}},{key:"_userStoreKey",get:function(){return"user:".concat(this.settings.authority,":").concat(this.settings.client_id)}}]),t}(nn),Un="modal",Mn="inline",Vn="test_drive_and_quotation",Kn="test-drive",qn="newsletter",Ln=r("7efb"),Jn=r("452e"),Wn=r("d59f"),zn=r("2dd8"),$n=r("39a0"),Gn=r("ccc5");function Yn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function Qn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Yn(Object(r),!0).forEach((function(t){Object(a["a"])(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Xn={authorization_endpoint:"https://www.linkedin.com/oauth/v2/authorization",token_endpoint:"https://myaudi-api-fd-egg6hqgde3c0dzaz.a02.azurefd.net/api/v1/login/linkedinUserInfo"},Zn={extends:Ln["default"],name:"SectionForm",data:function(){return{loading:!1,submitted:!1,form_data:{},user_manager:new Bn({authority:"https://www.linkedin.com/oauth/v2/",client_id:"77hi01xxmr8hnq",redirect_uri:"".concat("https://myaudi.it").concat("/callback-oauth2/"),scope:"r_emailaddress r_liteprofile",metadata:Xn,response_type:"code",popupWindowFeatures:!0,customUser:!0})}},props:{anchor:Gn["PROP_ANCHOR"],locales:Gn["PROP_LOCALES"],visibility:Gn["PROP_VISIBILITY"],background:Gn["PROP_BACKGROUND"],padding:Gn["PROP_PADDING"],form_format:{type:String,editor:"EditorSingleOption",label:"prop_form_format",options:(kn={},Object(a["a"])(kn,Un,"option_modal"),Object(a["a"])(kn,Mn,"option_inline"),kn),default:Un,raw:!0},submit_text:{id:null,type:String,editor:"EditorText",label:"prop_submit_title",default:"",raw:!0},wysiwyg:Gn["PROP_WYSIWYG"],form_wysiwyg:{type:Object,editor:"EditorWysiwyg",label:"prop_wysiwyg_form",default:function(){return Object(Jn["m"])(Gn["DEFAULT_TEXT_HTML"])},conditions:{form_format:Un},lcontent:!0},result_wysiwyg:{type:Object,editor:"EditorWysiwyg",label:"prop_wysiwyg_result",default:function(){return Object(Jn["m"])(Gn["DEFAULT_TEXT_HTML"])},conditions:{form_format:Mn},lcontent:!0},form:{type:String,editor:"EditorForm",label:"prop_forms",raw:!0,default:""},request_types:{id:null,type:Array,editor:"EditorToggle",options:{ask_test_drive:"ask_test_drive",ask_offer:"ask_offer"},default:function(){return["ask_test_drive","ask_offer"]},conditions:{form:Vn},raw:!0},test_drive_models:{type:Array,label:"prop_models",editor:"EditorModels",default:function(){return[]},conditions:{form:[Vn,Kn]},raw:!0},newsletter_event_id:{type:String,editor:"EditorText",label:"props_newsletter_event_id",default:"",raw:!0,conditions:{form:[qn]}},not_logged_form:{type:String,editor:"EditorForm",label:"prop_not_logged_forms",raw:!0,default:""},not_logged_request_types:{id:null,type:Array,editor:"EditorToggle",options:{ask_test_drive:"ask_test_drive",ask_offer:"ask_offer"},default:function(){return["ask_test_drive","ask_offer"]},conditions:{not_logged_form:Vn},raw:!0},not_logged_test_drive_models:{type:Array,label:"prop_models",editor:"EditorModels",default:function(){return[]},conditions:{not_logged_form:[Vn,Kn]},raw:!0},not_logged_newsletter_event_id:{type:String,editor:"EditorText",label:"props_not_logged_newsletter_event_id",default:"",raw:!0,conditions:{not_logged_form:[qn]}},media_gallery:Qn({},Gn["PROP_MEDIA_GALLERY"],{type:String,default:function(){return""},conditions:{form_format:Un}}),show_image_preview:{id:null,type:Array,editor:"EditorToggle",options:{image_preview:"option_show_image_preview"},default:function(){return[]},conditions:{form_format:Un},raw:!0},media_gallery_position:{type:String,editor:"EditorSingleOption",label:"prop_media_gallery_position",options:{left:"option_left",right:"option_right"},default:"left",conditions:{show_image_preview:"image_preview"},raw:!0}},computed:{hasRequestTypes:function(){return this.$account.getData()?this.request_types:this.not_logged_request_types},hasTestDriveModels:function(){return[Vn,Kn].includes(this.getForm)?this.$account.getData()?this.test_drive_models:this.not_logged_test_drive_models:[]},hasMediasPosition:function(){return"right"==this.media_gallery_position?"order-sm-last ml-auto":"mr-auto"},routerQuery:function(){var e={};return"test-drive-business"==this.form&&(e["business"]=!0),e},getForm:function(){return this.$account.getData()&&this.form.length?this.form:this.not_logged_form},showLinkedin:function(){return!this.$account.getData()&&this.getForm===Vn},additionalData:function(){if(this.getForm===qn){if(this.$account.getData()&&this.newsletter_event_id)return{event:this.newsletter_event_id};if(this.not_logged_newsletter_event_id)return{event:this.not_logged_newsletter_event_id}}return{}}},methods:{login:function(){var e={};"test-drive-business"==this.form&&(e["business"]=null),this.$router.push({name:"account-login",query:e,params:{locale:this.$route.params.locale}})},getLinkedinData:function(){var e=this;!this.$ssr&&localStorage.setItem($n["b"],!0),!this.$ssr&&localStorage.setItem($n["a"],JSON.stringify(Xn)),this.user_manager.signinPopup().then((function(t){t&&(e.form_data.givenname=t.givenName,e.form_data.surname=t.surName,e.form_data.email=t.email,e.form_data.vat=t.vatNumber)}))},submitRequest:function(){this.loading=!0},submitError:function(){this.loading=!1,this.$alert.danger({content:this.$t("alert_submit_danger"),notification:!0,duration:3e3})},submitResponse:function(){this.loading=!1,this.submitted=!0,this.$alert.success({content:this.$t("alert_submit_success"),notification:!0,duration:3e3}),this.$refs["form-modal"]&&this.$refs["form-modal"].hide(),this.$account.getData()&&this.$store.dispatch("".concat(Wn["b"],"/").concat(zn["p"]),{token:this.$account.getData().token}),this.$analytics&&this.$analytics.trackEvent(this.form)},changeAccount:function(){this.$account.logout(),this.$router.push({name:"account-login",params:{locale:this.$route.params.locale}})},editAccount:function(){this.$router.push({name:"home",params:{locale:this.$route.params.locale}})}},components:{LoadingSpinner:function(){return r.e("chunk-5582be50").then(r.bind(null,"4a99"))},Btn:function(){return r.e("chunk-4059eaa8").then(r.bind(null,"3e3d"))},Media:function(){return r.e("chunk-18426515").then(r.bind(null,"cb30"))},FormGenerator:function(){return Promise.all([r.e("chunk-8c1779c4"),r.e("chunk-1f84750e")]).then(r.bind(null,"d93
401"))},Modal:function(){return r.e("chunk-0f1a0cd4").then(r.bind(null,"47a8"))},Icon:function(){return r.e("chunk-2d0da8d1").then(r.bind(null,"6ba0"))},Alert:function(){return r.e("chunk-23fc5210").then(r.bind(null,"775d"))}}},es=Zn,ts=r("2877");function rs(e){var t=r("a16a");t.__inject__&&t.__inject__(e)}var is=Object(ts["a"])(es,s,o,!1,rs,null,"33189098");t["default"]=is.exports},"1cb7":function(e,t,r){var i=r("bf0b"),n=r("53e2"),s=r("07e3"),o=r("63b6"),a=r("f772"),u=r("e4ae");function c(e,t){var r,o,h=arguments.length<3?e:arguments[2];return u(e)===h?e[t]:(r=i.f(e,t))?s(r,"value")?r.value:void 0!==r.get?r.get.call(h):void 0:a(o=n(e))?c(o,t,h):void 0}o(o.S,"Reflect",{get:c})},2366:function(e,t){for(var r=[],i=0;i<256;++i)r[i]=(i+256).toString(16).substr(1);function n(e,t){var i=t||0,n=r;return[n[e[i++]],n[e[i++]],n[e[i++]],n[e[i++]],"-",n[e[i++]],n[e[i++]],"-",n[e[i++]],n[e[i++]],"-",n[e[i++]],n[e[i++]],"-",n[e[i++]],n[e[i++]],n[e[i++]],n[e[i++]],n[e[i++]],n[e[i++]]].join("")}e.exports=n},"268f":function(e,t,r){e.exports=r("fde4")},2819:function(e,t,r){},4910:function(e,t,r){r("1cb7"),e.exports=r("584a").Reflect.get},"8feb":function(e,t,r){e.exports=r("4910")},97446:function(e,t,r){"use strict";var i=r("4588"),n=r("be13");e.exports=function(e){var t=String(n(this)),r="",s=i(e);if(s<0||s==1/0)throw RangeError("Count can't be negative");for(;s>0;(s>>>=1)&&(t+=t))1&s&&(r+=t);return r}},a16a:function(e,t,r){"use strict";r.r(t);var i=r("2819"),n=r.n(i);for(var s in i)["default"].indexOf(s)<0&&function(e){r.d(t,e,(function(){return i[e]}))}(s);t["default"]=n.a},bf90:function(e,t,r){var i=r("36c3"),n=r("bf0b").f;r("ce7e")("getOwnPropertyDescriptor",(function(){return function(e,t){return n(i(e),t)}}))},c64e:function(e,t,r){var i=r("e1f4"),n=r("2366");function s(e,t,r){var s=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null),e=e||{};var o=e.random||(e.rng||i)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t)for(var a=0;a<16;++a)t[s+a]=o[a];return t||n(o)}e.exports=s},e1f4:function(e,t){var r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(r){var i=new Uint8Array(16);e.exports=function(){return r(i),i}}else{var n=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0===(3&t)&&(e=4294967296*Math.random()),n[t]=e>>>((3&t)<<3)&255;return n}}},f559:function(e,t,r){"use strict";var i=r("5ca1"),n=r("9def"),s=r("d2c8"),o="startsWith",a=""[o];i(i.P+i.F*r("5147")(o),"String",{startsWith:function(e){var t=s(this,e,o),r=n(Math.min(arguments.length>1?arguments[1]:void 0,t.length)),i=String(e);return a?a.call(t,i,r):t.slice(r,r+i.length)===i}})},fde4:function(e,t,r){r("bf90");var i=r("584a").Object;e.exports=function(e,t){return i.getOwnPropertyDescriptor(e,t)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.