Files
zzz-signal-search-export/src/main/module/node-mitmproxy.js
2023-05-01 15:52:32 +08:00

32 lines
381 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// The MIT License (MIT)
// Copyright (c) 2016 wuchangming
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
var t=require("fs"),e=require("path"),r=require("crypto"),n=require("http"),i=require("util"),a=require("os"),o=require("https"),s=require("url"),u=require("net"),c=require("events"),f=require("tls"),l=require("assert");function h(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var p=h(t),d=h(e),y=h(r),g=h(n),v=h(i),m=h(a),C=h(o),E=h(s),S=h(u),b=h(c),T=h(f),I=h(l),A="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function w(t){var e={exports:{}};return t(e,e.exports),e.exports}var _=w((function(t){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)})),B={}.hasOwnProperty,N=function(t,e){return B.call(t,e)},k=function(t){try{return!!t()}catch(t){return!0}},R=!k((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})),O=w((function(t){var e=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=e)})),L=function(t){return"object"==typeof t?null!==t:"function"==typeof t},P=function(t){if(!L(t))throw TypeError(t+" is not an object!");return t},U=_.document,x=L(U)&&L(U.createElement),D=function(t){return x?U.createElement(t):{}},V=!R&&!k((function(){return 7!=Object.defineProperty(D("div"),"a",{get:function(){return 7}}).a})),M=function(t,e){if(!L(t))return t;var r,n;if(e&&"function"==typeof(r=t.toString)&&!L(n=r.call(t)))return n;if("function"==typeof(r=t.valueOf)&&!L(n=r.call(t)))return n;if(!e&&"function"==typeof(r=t.toString)&&!L(n=r.call(t)))return n;throw TypeError("Can't convert object to primitive value")},j=Object.defineProperty,F={f:R?Object.defineProperty:function(t,e,r){if(P(t),e=M(e,!0),P(r),V)try{return j(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(t[e]=r.value),t}},K=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},q=R?function(t,e,r){return F.f(t,e,K(1,r))}:function(t,e,r){return t[e]=r,t},G=0,z=Math.random(),W=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++G+z).toString(36))},H=w((function(t){var e="__core-js_shared__",r=_[e]||(_[e]={});(t.exports=function(t,e){return r[t]||(r[t]=void 0!==e?e:{})})("versions",[]).push({version:O.version,mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),Q=H("native-function-to-string",Function.toString),Y=w((function(t){var e=W("src"),r="toString",n=(""+Q).split(r);O.inspectSource=function(t){return Q.call(t)},(t.exports=function(t,r,i,a){var o="function"==typeof i;o&&(N(i,"name")||q(i,"name",r)),t[r]!==i&&(o&&(N(i,e)||q(i,e,t[r]?""+t[r]:n.join(String(r)))),t===_?t[r]=i:a?t[r]?t[r]=i:q(t,r,i):(delete t[r],q(t,r,i)))})(Function.prototype,r,(function(){return"function"==typeof this&&this[e]||Q.call(this)}))})),X=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t},$=function(t,e,r){if(X(t),void 0===e)return t;switch(r){case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,i){return t.call(e,r,n,i)}}return function(){return t.apply(e,arguments)}},Z=function(t,e,r){var n,i,a,o,s=t&Z.F,u=t&Z.G,c=t&Z.S,f=t&Z.P,l=t&Z.B,h=u?_:c?_[e]||(_[e]={}):(_[e]||{}).prototype,p=u?O:O[e]||(O[e]={}),d=p.prototype||(p.prototype={});for(n in u&&(r=e),r)a=((i=!s&&h&&void 0!==h[n])?h:r)[n],o=l&&i?$(a,_):f&&"function"==typeof a?$(Function.call,a):a,h&&Y(h,n,a,t&Z.U),p[n]!=a&&q(p,n,o),f&&d[n]!=a&&(d[n]=a)};_.core=O,Z.F=1,Z.G=2,Z.S=4,Z.P=8,Z.B=16,Z.W=32,Z.U=64,Z.R=128;var J=Z,tt=w((function(t){var e=W("meta"),r=F.f,n=0,i=Object.isExtensible||function(){return!0},a=!k((function(){return i(Object.preventExtensions({}))})),o=function(t){r(t,e,{value:{i:"O"+ ++n,w:{}}})},s=t.exports={KEY:e,NEED:!1,fastKey:function(t,r){if(!L(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!N(t,e)){if(!i(t))return"F";if(!r)return"E";o(t)}return t[e].i},getWeak:function(t,r){if(!N(t,e)){if(!i(t))return!0;if(!r)return!1;o(t)}return t[e].w},onFreeze:function(t){return a&&s.NEED&&i(t)&&!N(t,e)&&o(t),t}}})),et=w((function(t){var e=H("wks"),r=_.Symbol,n="function"==typeof r;(t.exports=function(t){return e[t]||(e[t]=n&&r[t]||(n?r:W)("Symbol."+t))}).store=e})),rt=F.f,nt=et("toStringTag"),it=function(t,e,r){t&&!N(t=r?t:t.prototype,nt)&&rt(t,nt,{configurable:!0,value:e})},at={f:et},ot=F.f,st=function(t){var e=O.Symbol||(O.Symbol=_.Symbol||{});"_"==t.charAt(0)||t in e||ot(e,t,{value:at.f(t)})},ut={}.toString,ct=function(t){return ut.call(t).slice(8,-1)},ft=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==ct(t)?t.split(""):Object(t)},lt=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},ht=function(t){return ft(lt(t))},pt=Math.ceil,dt=Math.floor,yt=function(t){return isNaN(t=+t)?0:(t>0?dt:pt)(t)},gt=Math.min,vt=function(t){return t>0?gt(yt(t),9007199254740991):0},mt=Math.max,Ct=Math.min,Et=function(t,e){return(t=yt(t))<0?mt(t+e,0):Ct(t,e)},St=function(t){return function(e,r,n){var i,a=ht(e),o=vt(a.length),s=Et(n,o);if(t&&r!=r){for(;o>s;)if((i=a[s++])!=i)return!0}else for(;o>s;s++)if((t||s in a)&&a[s]===r)return t||s||0;return!t&&-1}},bt=H("keys"),Tt=function(t){return bt[t]||(bt[t]=W(t))},It=St(!1),At=Tt("IE_PROTO"),wt=function(t,e){var r,n=ht(t),i=0,a=[];for(r in n)r!=At&&N(n,r)&&a.push(r);for(;e.length>i;)N(n,r=e[i++])&&(~It(a,r)||a.push(r));return a},_t="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),Bt=Object.keys||function(t){return wt(t,_t)},Nt={f:Object.getOwnPropertySymbols},kt={f:{}.propertyIsEnumerable},Rt=Array.isArray||function(t){return"Array"==ct(t)},Ot=function(t){return Object(lt(t))},Lt=R?Object.defineProperties:function(t,e){P(t);for(var r,n=Bt(e),i=n.length,a=0;i>a;)F.f(t,r=n[a++],e[r]);return t},Pt=_.document,Ut=Pt&&Pt.documentElement,xt=Tt("IE_PROTO"),Dt=function(){},Vt=function(){var t,e=D("iframe"),r=_t.length;for(e.style.display="none",Ut.appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),Vt=t.F;r--;)delete Vt.prototype[_t[r]];return Vt()},Mt=Object.create||function(t,e){var r;return null!==t?(Dt.prototype=P(t),r=new Dt,Dt.prototype=null,r[xt]=t):r=Vt(),void 0===e?r:Lt(r,e)},jt=_t.concat("length","prototype"),Ft={f:Object.getOwnPropertyNames||function(t){return wt(t,jt)}},Kt=Ft.f,qt={}.toString,Gt="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],zt={f:function(t){return Gt&&"[object Window]"==qt.call(t)?function(t){try{return Kt(t)}catch(t){return Gt.slice()}}(t):Kt(ht(t))}},Wt=Object.getOwnPropertyDescriptor,Ht={f:R?Wt:function(t,e){if(t=ht(t),e=M(e,!0),V)try{return Wt(t,e)}catch(t){}if(N(t,e))return K(!kt.f.call(t,e),t[e])}},Qt=tt.KEY,Yt=Ht.f,Xt=F.f,$t=zt.f,Zt=_.Symbol,Jt=_.JSON,te=Jt&&Jt.stringify,ee=et("_hidden"),re=et("toPrimitive"),ne={}.propertyIsEnumerable,ie=H("symbol-registry"),ae=H("symbols"),oe=H("op-symbols"),se=Object.prototype,ue="function"==typeof Zt&&!!Nt.f,ce=_.QObject,fe=!ce||!ce.prototype||!ce.prototype.findChild,le=R&&k((function(){return 7!=Mt(Xt({},"a",{get:function(){return Xt(this,"a",{value:7}).a}})).a}))?function(t,e,r){var n=Yt(se,e);n&&delete se[e],Xt(t,e,r),n&&t!==se&&Xt(se,e,n)}:Xt,he=function(t){var e=ae[t]=Mt(Zt.prototype);return e._k=t,e},pe=ue&&"symbol"==typeof Zt.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof Zt},de=function(t,e,r){return t===se&&de(oe,e,r),P(t),e=M(e,!0),P(r),N(ae,e)?(r.enumerable?(N(t,ee)&&t[ee][e]&&(t[ee][e]=!1),r=Mt(r,{enumerable:K(0,!1)})):(N(t,ee)||Xt(t,ee,K(1,{})),t[ee][e]=!0),le(t,e,r)):Xt(t,e,r)},ye=function(t,e){P(t);for(var r,n=function(t){var e=Bt(t),r=Nt.f;if(r)for(var n,i=r(t),a=kt.f,o=0;i.length>o;)a.call(t,n=i[o++])&&e.push(n);return e}(e=ht(e)),i=0,a=n.length;a>i;)de(t,r=n[i++],e[r]);return t},ge=function(t){var e=ne.call(this,t=M(t,!0));return!(this===se&&N(ae,t)&&!N(oe,t))&&(!(e||!N(this,t)||!N(ae,t)||N(this,ee)&&this[ee][t])||e)},ve=function(t,e){if(t=ht(t),e=M(e,!0),t!==se||!N(ae,e)||N(oe,e)){var r=Yt(t,e);return!r||!N(ae,e)||N(t,ee)&&t[ee][e]||(r.enumerable=!0),r}},me=function(t){for(var e,r=$t(ht(t)),n=[],i=0;r.length>i;)N(ae,e=r[i++])||e==ee||e==Qt||n.push(e);return n},Ce=function(t){for(var e,r=t===se,n=$t(r?oe:ht(t)),i=[],a=0;n.length>a;)!N(ae,e=n[a++])||r&&!N(se,e)||i.push(ae[e]);return i};ue||(Y((Zt=function(){if(this instanceof Zt)throw TypeError("Symbol is not a constructor!");var t=W(arguments.length>0?arguments[0]:void 0),e=function(r){this===se&&e.call(oe,r),N(this,ee)&&N(this[ee],t)&&(this[ee][t]=!1),le(this,t,K(1,r))};return R&&fe&&le(se,t,{configurable:!0,set:e}),he(t)}).prototype,"toString",(function(){return this._k})),Ht.f=ve,F.f=de,Ft.f=zt.f=me,kt.f=ge,Nt.f=Ce,R&&Y(se,"propertyIsEnumerable",ge,!0),at.f=function(t){return he(et(t))}),J(J.G+J.W+J.F*!ue,{Symbol:Zt});for(var Ee="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),Se=0;Ee.length>Se;)et(Ee[Se++]);for(var be=Bt(et.store),Te=0;be.length>Te;)st(be[Te++]);J(J.S+J.F*!ue,"Symbol",{for:function(t){return N(ie,t+="")?ie[t]:ie[t]=Zt(t)},keyFor:function(t){if(!pe(t))throw TypeError(t+" is not a symbol!");for(var e in ie)if(ie[e]===t)return e},useSetter:function(){fe=!0},useSimple:function(){fe=!1}}),J(J.S+J.F*!ue,"Object",{create:function(t,e){return void 0===e?Mt(t):ye(Mt(t),e)},defineProperty:de,defineProperties:ye,getOwnPropertyDescriptor:ve,getOwnPropertyNames:me,getOwnPropertySymbols:Ce});var Ie=k((function(){Nt.f(1)}));J(J.S+J.F*Ie,"Object",{getOwnPropertySymbols:function(t){return Nt.f(Ot(t))}}),Jt&&J(J.S+J.F*(!ue||k((function(){var t=Zt();return"[null]"!=te([t])||"{}"!=te({a:t})||"{}"!=te(Object(t))}))),"JSON",{stringify:function(t){for(var e,r,n=[t],i=1;arguments.length>i;)n.push(arguments[i++]);if(r=e=n[1],(L(e)||void 0!==t)&&!pe(t))return Rt(e)||(e=function(t,e){if("function"==typeof r&&(e=r.call(this,t,e)),!pe(e))return e}),n[1]=e,te.apply(Jt,n)}}),Zt.prototype[re]||q(Zt.prototype,re,Zt.prototype.valueOf),it(Zt,"Symbol"),it(Math,"Math",!0),it(_.JSON,"JSON",!0),J(J.S,"Object",{create:Mt}),J(J.S+J.F*!R,"Object",{defineProperty:F.f}),J(J.S+J.F*!R,"Object",{defineProperties:Lt});var Ae=function(t,e){var r=(O.Object||{})[t]||Object[t],n={};n[t]=e(r),J(J.S+J.F*k((function(){r(1)})),"Object",n)},we=Ht.f;Ae("getOwnPropertyDescriptor",(function(){return function(t,e){return we(ht(t),e)}}));var _e=Tt("IE_PROTO"),Be=Object.prototype,Ne=Object.getPrototypeOf||function(t){return t=Ot(t),N(t,_e)?t[_e]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?Be:null};Ae("getPrototypeOf",(function(){return function(t){return Ne(Ot(t))}})),Ae("keys",(function(){return function(t){return Bt(Ot(t))}})),Ae("getOwnPropertyNames",(function(){return zt.f}));var ke=tt.onFreeze;Ae("freeze",(function(t){return function(e){return t&&L(e)?t(ke(e)):e}}));var Re=tt.onFreeze;Ae("seal",(function(t){return function(e){return t&&L(e)?t(Re(e)):e}}));var Oe=tt.onFreeze;Ae("preventExtensions",(function(t){return function(e){return t&&L(e)?t(Oe(e)):e}})),Ae("isFrozen",(function(t){return function(e){return!L(e)||!!t&&t(e)}})),Ae("isSealed",(function(t){return function(e){return!L(e)||!!t&&t(e)}})),Ae("isExtensible",(function(t){return function(e){return!!L(e)&&(!t||t(e))}}));var Le=Object.assign,Pe=!Le||k((function(){var t={},e={},r=Symbol(),n="abcdefghijklmnopqrst";return t[r]=7,n.split("").forEach((function(t){e[t]=t})),7!=Le({},t)[r]||Object.keys(Le({},e)).join("")!=n}))?function(t,e){for(var r=Ot(t),n=arguments.length,i=1,a=Nt.f,o=kt.f;n>i;)for(var s,u=ft(arguments[i++]),c=a?Bt(u).concat(a(u)):Bt(u),f=c.length,l=0;f>l;)s=c[l++],R&&!o.call(u,s)||(r[s]=u[s]);return r}:Le;J(J.S+J.F,"Object",{assign:Pe});var Ue=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e};J(J.S,"Object",{is:Ue});var xe=function(t,e){if(P(t),!L(e)&&null!==e)throw TypeError(e+": can't set as prototype!")},De={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,r){try{(r=$(Function.call,Ht.f(Object.prototype,"__proto__").set,2))(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,n){return xe(t,n),e?t.__proto__=n:r(t,n),t}}({},!1):void 0),check:xe};J(J.S,"Object",{setPrototypeOf:De.set});var Ve=et("toStringTag"),Me="Arguments"==ct(function(){return arguments}()),je=function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),Ve))?r:Me?ct(e):"Object"==(n=ct(e))&&"function"==typeof e.callee?"Arguments":n},Fe={};Fe[et("toStringTag")]="z",Fe+""!="[object z]"&&Y(Object.prototype,"toString",(function(){return"[object "+je(this)+"]"}),!0);var Ke=function(t,e,r){var n=void 0===r;switch(e.length){case 0:return n?t():t.call(r);case 1:return n?t(e[0]):t.call(r,e[0]);case 2:return n?t(e[0],e[1]):t.call(r,e[0],e[1]);case 3:return n?t(e[0],e[1],e[2]):t.call(r,e[0],e[1],e[2]);case 4:return n?t(e[0],e[1],e[2],e[3]):t.call(r,e[0],e[1],e[2],e[3])}return t.apply(r,e)},qe=[].slice,Ge={},ze=function(t,e,r){if(!(e in Ge)){for(var n=[],i=0;i<e;i++)n[i]="a["+i+"]";Ge[e]=Function("F,a","return new F("+n.join(",")+")")}return Ge[e](t,r)},We=Function.bind||function(t){var e=X(this),r=qe.call(arguments,1),n=function(){var i=r.concat(qe.call(arguments));return this instanceof n?ze(e,i.length,i):Ke(e,i,t)};return L(e.prototype)&&(n.prototype=e.prototype),n};J(J.P,"Function",{bind:We});var He=F.f,Qe=Function.prototype,Ye=/^\s*function ([^ (]*)/;"name"in Qe||R&&He(Qe,"name",{configurable:!0,get:function(){try{return(""+this).match(Ye)[1]}catch(t){return""}}});var Xe=et("hasInstance"),$e=Function.prototype;Xe in $e||F.f($e,Xe,{value:function(t){if("function"!=typeof this||!L(t))return!1;if(!L(this.prototype))return t instanceof this;for(;t=Ne(t);)if(this.prototype===t)return!0;return!1}});var Ze="\t\n\v\f\r    \u2028\u2029\ufeff",Je="["+Ze+"]",tr=RegExp("^"+Je+Je+"*"),er=RegExp(Je+Je+"*$"),rr=function(t,e,r){var n={},i=k((function(){return!!Ze[t]()||"…"!="…"[t]()})),a=n[t]=i?e(nr):Ze[t];r&&(n[r]=a),J(J.P+J.F*i,"String",n)},nr=rr.trim=function(t,e){return t=String(lt(t)),1&e&&(t=t.replace(tr,"")),2&e&&(t=t.replace(er,"")),t},ir=rr,ar=_.parseInt,or=ir.trim,sr=/^[-+]?0[xX]/,ur=8!==ar(Ze+"08")||22!==ar(Ze+"0x16")?function(t,e){var r=or(String(t),3);return ar(r,e>>>0||(sr.test(r)?16:10))}:ar;J(J.G+J.F*(parseInt!=ur),{parseInt:ur});var cr=_.parseFloat,fr=ir.trim,lr=1/cr(Ze+"-0")!=-1/0?function(t){var e=fr(String(t),3),r=cr(e);return 0===r&&"-"==e.charAt(0)?-0:r}:cr;J(J.G+J.F*(parseFloat!=lr),{parseFloat:lr});var hr=De.set,pr=function(t,e,r){var n,i=e.constructor;return i!==r&&"function"==typeof i&&(n=i.prototype)!==r.prototype&&L(n)&&hr&&hr(t,n),t},dr=Ft.f,yr=Ht.f,gr=F.f,vr=ir.trim,mr=_.Number,Cr=mr,Er=mr.prototype,Sr="Number"==ct(Mt(Er)),br="trim"in String.prototype,Tr=function(t){var e=M(t,!1);if("string"==typeof e&&e.length>2){var r,n,i,a=(e=br?e.trim():vr(e,3)).charCodeAt(0);if(43===a||45===a){if(88===(r=e.charCodeAt(2))||120===r)return NaN}else if(48===a){switch(e.charCodeAt(1)){case 66:case 98:n=2,i=49;break;case 79:case 111:n=8,i=55;break;default:return+e}for(var o,s=e.slice(2),u=0,c=s.length;u<c;u++)if((o=s.charCodeAt(u))<48||o>i)return NaN;return parseInt(s,n)}}return+e};if(!mr(" 0o1")||!mr("0b1")||mr("+0x1")){mr=function(t){var e=arguments.length<1?0:t,r=this;return r instanceof mr&&(Sr?k((function(){Er.valueOf.call(r)})):"Number"!=ct(r))?pr(new Cr(Tr(e)),r,mr):Tr(e)};for(var Ir,Ar=R?dr(Cr):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),wr=0;Ar.length>wr;wr++)N(Cr,Ir=Ar[wr])&&!N(mr,Ir)&&gr(mr,Ir,yr(Cr,Ir));mr.prototype=Er,Er.constructor=mr,Y(_,"Number",mr)}var _r=function(t,e){if("number"!=typeof t&&"Number"!=ct(t))throw TypeError(e);return+t},Br=function(t){var e=String(lt(this)),r="",n=yt(t);if(n<0||n==1/0)throw RangeError("Count can't be negative");for(;n>0;(n>>>=1)&&(e+=e))1&n&&(r+=e);return r},Nr=1..toFixed,kr=Math.floor,Rr=[0,0,0,0,0,0],Or="Number.toFixed: incorrect invocation!",Lr=function(t,e){for(var r=-1,n=e;++r<6;)n+=t*Rr[r],Rr[r]=n%1e7,n=kr(n/1e7)},Pr=function(t){for(var e=6,r=0;--e>=0;)r+=Rr[e],Rr[e]=kr(r/t),r=r%t*1e7},Ur=function(){for(var t=6,e="";--t>=0;)if(""!==e||0===t||0!==Rr[t]){var r=String(Rr[t]);e=""===e?r:e+Br.call("0",7-r.length)+r}return e},xr=function(t,e,r){return 0===e?r:e%2==1?xr(t,e-1,r*t):xr(t*t,e/2,r)};J(J.P+J.F*(!!Nr&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!k((function(){Nr.call({})}))),"Number",{toFixed:function(t){var e,r,n,i,a=_r(this,Or),o=yt(t),s="",u="0";if(o<0||o>20)throw RangeError(Or);if(a!=a)return"NaN";if(a<=-1e21||a>=1e21)return String(a);if(a<0&&(s="-",a=-a),a>1e-21)if(r=(e=function(t){for(var e=0,r=t;r>=4096;)e+=12,r/=4096;for(;r>=2;)e+=1,r/=2;return e}(a*xr(2,69,1))-69)<0?a*xr(2,-e,1):a/xr(2,e,1),r*=4503599627370496,(e=52-e)>0){for(Lr(0,r),n=o;n>=7;)Lr(1e7,0),n-=7;for(Lr(xr(10,n,1),0),n=e-1;n>=23;)Pr(1<<23),n-=23;Pr(1<<n),Lr(1,1),Pr(2),u=Ur()}else Lr(0,r),Lr(1<<-e,0),u=Ur()+Br.call("0",o);return u=o>0?s+((i=u.length)<=o?"0."+Br.call("0",o-i)+u:u.slice(0,i-o)+"."+u.slice(i-o)):s+u}});var Dr=1..toPrecision;J(J.P+J.F*(k((function(){return"1"!==Dr.call(1,void 0)}))||!k((function(){Dr.call({})}))),"Number",{toPrecision:function(t){var e=_r(this,"Number#toPrecision: incorrect invocation!");return void 0===t?Dr.call(e):Dr.call(e,t)}}),J(J.S,"Number",{EPSILON:Math.pow(2,-52)});var Vr=_.isFinite;J(J.S,"Number",{isFinite:function(t){return"number"==typeof t&&Vr(t)}});var Mr=Math.floor,jr=function(t){return!L(t)&&isFinite(t)&&Mr(t)===t};J(J.S,"Number",{isInteger:jr}),J(J.S,"Number",{isNaN:function(t){return t!=t}});var Fr=Math.abs;J(J.S,"Number",{isSafeInteger:function(t){return jr(t)&&Fr(t)<=9007199254740991}}),J(J.S,"Number",{MAX_SAFE_INTEGER:9007199254740991}),J(J.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991}),J(J.S+J.F*(Number.parseFloat!=lr),"Number",{parseFloat:lr}),J(J.S+J.F*(Number.parseInt!=ur),"Number",{parseInt:ur});var Kr=Math.log1p||function(t){return(t=+t)>-1e-8&&t<1e-8?t-t*t/2:Math.log(1+t)},qr=Math.sqrt,Gr=Math.acosh;J(J.S+J.F*!(Gr&&710==Math.floor(Gr(Number.MAX_VALUE))&&Gr(1/0)==1/0),"Math",{acosh:function(t){return(t=+t)<1?NaN:t>94906265.62425156?Math.log(t)+Math.LN2:Kr(t-1+qr(t-1)*qr(t+1))}});var zr=Math.asinh;J(J.S+J.F*!(zr&&1/zr(0)>0),"Math",{asinh:function t(e){return isFinite(e=+e)&&0!=e?e<0?-t(-e):Math.log(e+Math.sqrt(e*e+1)):e}});var Wr=Math.atanh;J(J.S+J.F*!(Wr&&1/Wr(-0)<0),"Math",{atanh:function(t){return 0==(t=+t)?t:Math.log((1+t)/(1-t))/2}});var Hr=Math.sign||function(t){return 0==(t=+t)||t!=t?t:t<0?-1:1};J(J.S,"Math",{cbrt:function(t){return Hr(t=+t)*Math.pow(Math.abs(t),1/3)}}),J(J.S,"Math",{clz32:function(t){return(t>>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}});var Qr=Math.exp;J(J.S,"Math",{cosh:function(t){return(Qr(t=+t)+Qr(-t))/2}});var Yr=Math.expm1,Xr=!Yr||Yr(10)>22025.465794806718||Yr(10)<22025.465794806718||-2e-17!=Yr(-2e-17)?function(t){return 0==(t=+t)?t:t>-1e-6&&t<1e-6?t+t*t/2:Math.exp(t)-1}:Yr;J(J.S+J.F*(Xr!=Math.expm1),"Math",{expm1:Xr});var $r=Math.pow,Zr=$r(2,-52),Jr=$r(2,-23),tn=$r(2,127)*(2-Jr),en=$r(2,-126),rn=Math.fround||function(t){var e,r,n=Math.abs(t),i=Hr(t);return n<en?i*(n/en/Jr+1/Zr-1/Zr)*en*Jr:(r=(e=(1+Jr/Zr)*n)-(e-n))>tn||r!=r?i*(1/0):i*r};J(J.S,"Math",{fround:rn});var nn=Math.abs;J(J.S,"Math",{hypot:function(t,e){for(var r,n,i=0,a=0,o=arguments.length,s=0;a<o;)s<(r=nn(arguments[a++]))?(i=i*(n=s/r)*n+1,s=r):i+=r>0?(n=r/s)*n:r;return s===1/0?1/0:s*Math.sqrt(i)}});var an=Math.imul;J(J.S+J.F*k((function(){return-5!=an(4294967295,5)||2!=an.length})),"Math",{imul:function(t,e){var r=65535,n=+t,i=+e,a=r&n,o=r&i;return 0|a*o+((r&n>>>16)*o+a*(r&i>>>16)<<16>>>0)}}),J(J.S,"Math",{log10:function(t){return Math.log(t)*Math.LOG10E}}),J(J.S,"Math",{log1p:Kr}),J(J.S,"Math",{log2:function(t){return Math.log(t)/Math.LN2}}),J(J.S,"Math",{sign:Hr});var on=Math.exp;J(J.S+J.F*k((function(){return-2e-17!=!Math.sinh(-2e-17)})),"Math",{sinh:function(t){return Math.abs(t=+t)<1?(Xr(t)-Xr(-t))/2:(on(t-1)-on(-t-1))*(Math.E/2)}});var sn=Math.exp;J(J.S,"Math",{tanh:function(t){var e=Xr(t=+t),r=Xr(-t);return e==1/0?1:r==1/0?-1:(e-r)/(sn(t)+sn(-t))}}),J(J.S,"Math",{trunc:function(t){return(t>0?Math.floor:Math.ceil)(t)}});var un=String.fromCharCode,cn=String.fromCodePoint;J(J.S+J.F*(!!cn&&1!=cn.length),"String",{fromCodePoint:function(t){for(var e,r=[],n=arguments.length,i=0;n>i;){if(e=+arguments[i++],Et(e,1114111)!==e)throw RangeError(e+" is not a valid code point");r.push(e<65536?un(e):un(55296+((e-=65536)>>10),e%1024+56320))}return r.join("")}}),J(J.S,"String",{raw:function(t){for(var e=ht(t.raw),r=vt(e.length),n=arguments.length,i=[],a=0;r>a;)i.push(String(e[a++])),a<n&&i.push(String(arguments[a]));return i.join("")}}),ir("trim",(function(t){return function(){return t(this,3)}}));var fn=function(t){return function(e,r){var n,i,a=String(lt(e)),o=yt(r),s=a.length;return o<0||o>=s?t?"":void 0:(n=a.charCodeAt(o))<55296||n>56319||o+1===s||(i=a.charCodeAt(o+1))<56320||i>57343?t?a.charAt(o):n:t?a.slice(o,o+2):i-56320+(n-55296<<10)+65536}},ln={},hn={};q(hn,et("iterator"),(function(){return this}));var pn=function(t,e,r){t.prototype=Mt(hn,{next:K(1,r)}),it(t,e+" Iterator")},dn=et("iterator"),yn=!([].keys&&"next"in[].keys()),gn=function(){return this},vn=function(t,e,r,n,i,a,o){pn(r,e,n);var s,u,c,f=function(t){if(!yn&&t in d)return d[t];switch(t){case"keys":case"values":return function(){return new r(this,t)}}return function(){return new r(this,t)}},l=e+" Iterator",h="values"==i,p=!1,d=t.prototype,y=d[dn]||d["@@iterator"]||i&&d[i],g=y||f(i),v=i?h?f("entries"):g:void 0,m="Array"==e&&d.entries||y;if(m&&(c=Ne(m.call(new t)))!==Object.prototype&&c.next&&(it(c,l,!0),"function"!=typeof c[dn]&&q(c,dn,gn)),h&&y&&"values"!==y.name&&(p=!0,g=function(){return y.call(this)}),(yn||p||!d[dn])&&q(d,dn,g),ln[e]=g,ln[l]=gn,i)if(s={values:h?g:f("values"),keys:a?g:f("keys"),entries:v},o)for(u in s)u in d||Y(d,u,s[u]);else J(J.P+J.F*(yn||p),e,s);return s},mn=fn(!0);vn(String,"String",(function(t){this._t=String(t),this._i=0}),(function(){var t,e=this._t,r=this._i;return r>=e.length?{value:void 0,done:!0}:(t=mn(e,r),this._i+=t.length,{value:t,done:!1})}));var Cn=fn(!1);J(J.P,"String",{codePointAt:function(t){return Cn(this,t)}});var En=et("match"),Sn=function(t){var e;return L(t)&&(void 0!==(e=t[En])?!!e:"RegExp"==ct(t))},bn=function(t,e,r){if(Sn(e))throw TypeError("String#"+r+" doesn't accept regex!");return String(lt(t))},Tn=et("match"),In=function(t){var e=/./;try{"/./"[t](e)}catch(r){try{return e[Tn]=!1,!"/./"[t](e)}catch(t){}}return!0},An="".endsWith;J(J.P+J.F*In("endsWith"),"String",{endsWith:function(t){var e=bn(this,t,"endsWith"),r=arguments.length>1?arguments[1]:void 0,n=vt(e.length),i=void 0===r?n:Math.min(vt(r),n),a=String(t);return An?An.call(e,a,i):e.slice(i-a.length,i)===a}});J(J.P+J.F*In("includes"),"String",{includes:function(t){return!!~bn(this,t,"includes").indexOf(t,arguments.length>1?arguments[1]:void 0)}}),J(J.P,"String",{repeat:Br});var wn="".startsWith;J(J.P+J.F*In("startsWith"),"String",{startsWith:function(t){var e=bn(this,t,"startsWith"),r=vt(Math.min(arguments.length>1?arguments[1]:void 0,e.length)),n=String(t);return wn?wn.call(e,n,r):e.slice(r,r+n.length)===n}});var _n=/"/g,Bn=function(t,e,r,n){var i=String(lt(t)),a="<"+e;return""!==r&&(a+=" "+r+'="'+String(n).replace(_n,"&quot;")+'"'),a+">"+i+"</"+e+">"},Nn=function(t,e){var r={};r[t]=e(Bn),J(J.P+J.F*k((function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3})),"String",r)};Nn("anchor",(function(t){return function(e){return t(this,"a","name",e)}})),Nn("big",(function(t){return function(){return t(this,"big","","")}})),Nn("blink",(function(t){return function(){return t(this,"blink","","")}})),Nn("bold",(function(t){return function(){return t(this,"b","","")}})),Nn("fixed",(function(t){return function(){return t(this,"tt","","")}})),Nn("fontcolor",(function(t){return function(e){return t(this,"font","color",e)}})),Nn("fontsize",(function(t){return function(e){return t(this,"font","size",e)}})),Nn("italics",(function(t){return function(){return t(this,"i","","")}})),Nn("link",(function(t){return function(e){return t(this,"a","href",e)}})),Nn("small",(function(t){return function(){return t(this,"small","","")}})),Nn("strike",(function(t){return function(){return t(this,"strike","","")}})),Nn("sub",(function(t){return function(){return t(this,"sub","","")}})),Nn("sup",(function(t){return function(){return t(this,"sup","","")}})),J(J.S,"Date",{now:function(){return(new Date).getTime()}}),J(J.P+J.F*k((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})})),"Date",{toJSON:function(t){var e=Ot(this),r=M(e);return"number"!=typeof r||isFinite(r)?e.toISOString():null}});var kn=Date.prototype.getTime,Rn=Date.prototype.toISOString,On=function(t){return t>9?t:"0"+t},Ln=k((function(){return"0385-07-25T07:06:39.999Z"!=Rn.call(new Date(-50000000000001))}))||!k((function(){Rn.call(new Date(NaN))}))?function(){if(!isFinite(kn.call(this)))throw RangeError("Invalid time value");var t=this,e=t.getUTCFullYear(),r=t.getUTCMilliseconds(),n=e<0?"-":e>9999?"+":"";return n+("00000"+Math.abs(e)).slice(n?-6:-4)+"-"+On(t.getUTCMonth()+1)+"-"+On(t.getUTCDate())+"T"+On(t.getUTCHours())+":"+On(t.getUTCMinutes())+":"+On(t.getUTCSeconds())+"."+(r>99?r:"0"+On(r))+"Z"}:Rn;J(J.P+J.F*(Date.prototype.toISOString!==Ln),"Date",{toISOString:Ln});var Pn=Date.prototype,Un=Pn.toString,xn=Pn.getTime;new Date(NaN)+""!="Invalid Date"&&Y(Pn,"toString",(function(){var t=xn.call(this);return t==t?Un.call(this):"Invalid Date"}));var Dn=et("toPrimitive"),Vn=Date.prototype;Dn in Vn||q(Vn,Dn,(function(t){if("string"!==t&&"number"!==t&&"default"!==t)throw TypeError("Incorrect hint");return M(P(this),"number"!=t)})),J(J.S,"Array",{isArray:Rt});var Mn=function(t,e,r,n){try{return n?e(P(r)[0],r[1]):e(r)}catch(e){var i=t.return;throw void 0!==i&&P(i.call(t)),e}},jn=et("iterator"),Fn=Array.prototype,Kn=function(t){return void 0!==t&&(ln.Array===t||Fn[jn]===t)},qn=function(t,e,r){e in t?F.f(t,e,K(0,r)):t[e]=r},Gn=et("iterator"),zn=O.getIteratorMethod=function(t){if(null!=t)return t[Gn]||t["@@iterator"]||ln[je(t)]},Wn=et("iterator"),Hn=!1;try{var Qn=[7][Wn]();Qn.return=function(){Hn=!0},Array.from(Qn,(function(){throw 2}))}catch(t){}var Yn=function(t,e){if(!e&&!Hn)return!1;var r=!1;try{var n=[7],i=n[Wn]();i.next=function(){return{done:r=!0}},n[Wn]=function(){return i},t(n)}catch(t){}return r};J(J.S+J.F*!Yn((function(t){Array.from(t)})),"Array",{from:function(t){var e,r,n,i,a=Ot(t),o="function"==typeof this?this:Array,s=arguments.length,u=s>1?arguments[1]:void 0,c=void 0!==u,f=0,l=zn(a);if(c&&(u=$(u,s>2?arguments[2]:void 0,2)),null==l||o==Array&&Kn(l))for(r=new o(e=vt(a.length));e>f;f++)qn(r,f,c?u(a[f],f):a[f]);else for(i=l.call(a),r=new o;!(n=i.next()).done;f++)qn(r,f,c?Mn(i,u,[n.value,f],!0):n.value);return r.length=f,r}}),J(J.S+J.F*k((function(){function t(){}return!(Array.of.call(t)instanceof t)})),"Array",{of:function(){for(var t=0,e=arguments.length,r=new("function"==typeof this?this:Array)(e);e>t;)qn(r,t,arguments[t++]);return r.length=e,r}});var Xn=function(t,e){return!!t&&k((function(){e?t.call(null,(function(){}),1):t.call(null)}))},$n=[].join;J(J.P+J.F*(ft!=Object||!Xn($n)),"Array",{join:function(t){return $n.call(ht(this),void 0===t?",":t)}});var Zn=[].slice;J(J.P+J.F*k((function(){Ut&&Zn.call(Ut)})),"Array",{slice:function(t,e){var r=vt(this.length),n=ct(this);if(e=void 0===e?r:e,"Array"==n)return Zn.call(this,t,e);for(var i=Et(t,r),a=Et(e,r),o=vt(a-i),s=new Array(o),u=0;u<o;u++)s[u]="String"==n?this.charAt(i+u):this[i+u];return s}});var Jn=[].sort,ti=[1,2,3];J(J.P+J.F*(k((function(){ti.sort(void 0)}))||!k((function(){ti.sort(null)}))||!Xn(Jn)),"Array",{sort:function(t){return void 0===t?Jn.call(Ot(this)):Jn.call(Ot(this),X(t))}});var ei=et("species"),ri=function(t,e){return new(function(t){var e;return Rt(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!Rt(e.prototype)||(e=void 0),L(e)&&null===(e=e[ei])&&(e=void 0)),void 0===e?Array:e}(t))(e)},ni=function(t,e){var r=1==t,n=2==t,i=3==t,a=4==t,o=6==t,s=5==t||o,u=e||ri;return function(e,c,f){for(var l,h,p=Ot(e),d=ft(p),y=$(c,f,3),g=vt(d.length),v=0,m=r?u(e,g):n?u(e,0):void 0;g>v;v++)if((s||v in d)&&(h=y(l=d[v],v,p),t))if(r)m[v]=h;else if(h)switch(t){case 3:return!0;case 5:return l;case 6:return v;case 2:m.push(l)}else if(a)return!1;return o?-1:i||a?a:m}},ii=ni(0),ai=Xn([].forEach,!0);J(J.P+J.F*!ai,"Array",{forEach:function(t){return ii(this,t,arguments[1])}});var oi=ni(1);J(J.P+J.F*!Xn([].map,!0),"Array",{map:function(t){return oi(this,t,arguments[1])}});var si=ni(2);J(J.P+J.F*!Xn([].filter,!0),"Array",{filter:function(t){return si(this,t,arguments[1])}});var ui=ni(3);J(J.P+J.F*!Xn([].some,!0),"Array",{some:function(t){return ui(this,t,arguments[1])}});var ci=ni(4);J(J.P+J.F*!Xn([].every,!0),"Array",{every:function(t){return ci(this,t,arguments[1])}});var fi=function(t,e,r,n,i){X(e);var a=Ot(t),o=ft(a),s=vt(a.length),u=i?s-1:0,c=i?-1:1;if(r<2)for(;;){if(u in o){n=o[u],u+=c;break}if(u+=c,i?u<0:s<=u)throw TypeError("Reduce of empty array with no initial value")}for(;i?u>=0:s>u;u+=c)u in o&&(n=e(n,o[u],u,a));return n};J(J.P+J.F*!Xn([].reduce,!0),"Array",{reduce:function(t){return fi(this,t,arguments.length,arguments[1],!1)}}),J(J.P+J.F*!Xn([].reduceRight,!0),"Array",{reduceRight:function(t){return fi(this,t,arguments.length,arguments[1],!0)}});var li=St(!1),hi=[].indexOf,pi=!!hi&&1/[1].indexOf(1,-0)<0;J(J.P+J.F*(pi||!Xn(hi)),"Array",{indexOf:function(t){return pi?hi.apply(this,arguments)||0:li(this,t,arguments[1])}});var di=[].lastIndexOf,yi=!!di&&1/[1].lastIndexOf(1,-0)<0;J(J.P+J.F*(yi||!Xn(di)),"Array",{lastIndexOf:function(t){if(yi)return di.apply(this,arguments)||0;var e=ht(this),r=vt(e.length),n=r-1;for(arguments.length>1&&(n=Math.min(n,yt(arguments[1]))),n<0&&(n=r+n);n>=0;n--)if(n in e&&e[n]===t)return n||0;return-1}});var gi=[].copyWithin||function(t,e){var r=Ot(this),n=vt(r.length),i=Et(t,n),a=Et(e,n),o=arguments.length>2?arguments[2]:void 0,s=Math.min((void 0===o?n:Et(o,n))-a,n-i),u=1;for(a<i&&i<a+s&&(u=-1,a+=s-1,i+=s-1);s-- >0;)a in r?r[i]=r[a]:delete r[i],i+=u,a+=u;return r},vi=et("unscopables"),mi=Array.prototype;null==mi[vi]&&q(mi,vi,{});var Ci=function(t){mi[vi][t]=!0};J(J.P,"Array",{copyWithin:gi}),Ci("copyWithin");var Ei=function(t){for(var e=Ot(this),r=vt(e.length),n=arguments.length,i=Et(n>1?arguments[1]:void 0,r),a=n>2?arguments[2]:void 0,o=void 0===a?r:Et(a,r);o>i;)e[i++]=t;return e};J(J.P,"Array",{fill:Ei}),Ci("fill");var Si=ni(5),bi=!0;"find"in[]&&Array(1).find((function(){bi=!1})),J(J.P+J.F*bi,"Array",{find:function(t){return Si(this,t,arguments.length>1?arguments[1]:void 0)}}),Ci("find");var Ti=ni(6),Ii=!0;"findIndex"in[]&&Array(1).findIndex((function(){Ii=!1})),J(J.P+J.F*Ii,"Array",{findIndex:function(t){return Ti(this,t,arguments.length>1?arguments[1]:void 0)}}),Ci("findIndex");var Ai=et("species"),wi=function(t){var e=_[t];R&&e&&!e[Ai]&&F.f(e,Ai,{configurable:!0,get:function(){return this}})};wi("Array");var _i=function(t,e){return{value:e,done:!!t}},Bi=vn(Array,"Array",(function(t,e){this._t=ht(t),this._i=0,this._k=e}),(function(){var t=this._t,e=this._k,r=this._i++;return!t||r>=t.length?(this._t=void 0,_i(1)):_i(0,"keys"==e?r:"values"==e?t[r]:[r,t[r]])}),"values");ln.Arguments=ln.Array,Ci("keys"),Ci("values"),Ci("entries");var Ni=function(){var t=P(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e},ki=F.f,Ri=Ft.f,Oi=_.RegExp,Li=Oi,Pi=Oi.prototype,Ui=/a/g,xi=/a/g,Di=new Oi(Ui)!==Ui;if(R&&(!Di||k((function(){return xi[et("match")]=!1,Oi(Ui)!=Ui||Oi(xi)==xi||"/a/i"!=Oi(Ui,"i")})))){Oi=function(t,e){var r=this instanceof Oi,n=Sn(t),i=void 0===e;return!r&&n&&t.constructor===Oi&&i?t:pr(Di?new Li(n&&!i?t.source:t,e):Li((n=t instanceof Oi)?t.source:t,n&&i?Ni.call(t):e),r?this:Pi,Oi)};for(var Vi=function(t){t in Oi||ki(Oi,t,{configurable:!0,get:function(){return Li[t]},set:function(e){Li[t]=e}})},Mi=Ri(Li),ji=0;Mi.length>ji;)Vi(Mi[ji++]);Pi.constructor=Oi,Oi.prototype=Pi,Y(_,"RegExp",Oi)}wi("RegExp");var Fi=RegExp.prototype.exec,Ki=String.prototype.replace,qi=Fi,Gi=function(){var t=/a/,e=/b*/g;return Fi.call(t,"a"),Fi.call(e,"a"),0!==t.lastIndex||0!==e.lastIndex}(),zi=void 0!==/()??/.exec("")[1];(Gi||zi)&&(qi=function(t){var e,r,n,i,a=this;return zi&&(r=new RegExp("^"+a.source+"$(?!\\s)",Ni.call(a))),Gi&&(e=a.lastIndex),n=Fi.call(a,t),Gi&&n&&(a.lastIndex=a.global?n.index+n[0].length:e),zi&&n&&n.length>1&&Ki.call(n[0],r,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(n[i]=void 0)})),n});var Wi=qi;J({target:"RegExp",proto:!0,forced:Wi!==/./.exec},{exec:Wi}),R&&"g"!=/./g.flags&&F.f(RegExp.prototype,"flags",{configurable:!0,get:Ni});var Hi=/./.toString,Qi=function(t){Y(RegExp.prototype,"toString",t,!0)};k((function(){return"/a/b"!=Hi.call({source:"a",flags:"b"})}))?Qi((function(){var t=P(this);return"/".concat(t.source,"/","flags"in t?t.flags:!R&&t instanceof RegExp?Ni.call(t):void 0)})):"toString"!=Hi.name&&Qi((function(){return Hi.call(this)}));var Yi=fn(!0),Xi=function(t,e,r){return e+(r?Yi(t,e).length:1)},$i=RegExp.prototype.exec,Zi=function(t,e){var r=t.exec;if("function"==typeof r){var n=r.call(t,e);if("object"!=typeof n)throw new TypeError("RegExp exec method returned something other than an Object or null");return n}if("RegExp"!==je(t))throw new TypeError("RegExp#exec called on incompatible receiver");return $i.call(t,e)},Ji=et("species"),ta=!k((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),ea=function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var r="ab".split(t);return 2===r.length&&"a"===r[0]&&"b"===r[1]}(),ra=function(t,e,r){var n=et(t),i=!k((function(){var e={};return e[n]=function(){return 7},7!=""[t](e)})),a=i?!k((function(){var e=!1,r=/a/;return r.exec=function(){return e=!0,null},"split"===t&&(r.constructor={},r.constructor[Ji]=function(){return r}),r[n](""),!e})):void 0;if(!i||!a||"replace"===t&&!ta||"split"===t&&!ea){var o=/./[n],s=r(lt,n,""[t],(function(t,e,r,n,a){return e.exec===Wi?i&&!a?{done:!0,value:o.call(e,r,n)}:{done:!0,value:t.call(r,e,n)}:{done:!1}})),u=s[0],c=s[1];Y(String.prototype,t,u),q(RegExp.prototype,n,2==e?function(t,e){return c.call(t,this,e)}:function(t){return c.call(t,this)})}};ra("match",1,(function(t,e,r,n){return[function(r){var n=t(this),i=null==r?void 0:r[e];return void 0!==i?i.call(r,n):new RegExp(r)[e](String(n))},function(t){var e=n(r,t,this);if(e.done)return e.value;var i=P(t),a=String(this);if(!i.global)return Zi(i,a);var o=i.unicode;i.lastIndex=0;for(var s,u=[],c=0;null!==(s=Zi(i,a));){var f=String(s[0]);u[c]=f,""===f&&(i.lastIndex=Xi(a,vt(i.lastIndex),o)),c++}return 0===c?null:u}]}));var na=Math.max,ia=Math.min,aa=Math.floor,oa=/\$([$&`']|\d\d?|<[^>]*>)/g,sa=/\$([$&`']|\d\d?)/g;ra("replace",2,(function(t,e,r,n){return[function(n,i){var a=t(this),o=null==n?void 0:n[e];return void 0!==o?o.call(n,a,i):r.call(String(a),n,i)},function(t,e){var a=n(r,t,this,e);if(a.done)return a.value;var o=P(t),s=String(this),u="function"==typeof e;u||(e=String(e));var c=o.global;if(c){var f=o.unicode;o.lastIndex=0}for(var l=[];;){var h=Zi(o,s);if(null===h)break;if(l.push(h),!c)break;""===String(h[0])&&(o.lastIndex=Xi(s,vt(o.lastIndex),f))}for(var p,d="",y=0,g=0;g<l.length;g++){h=l[g];for(var v=String(h[0]),m=na(ia(yt(h.index),s.length),0),C=[],E=1;E<h.length;E++)C.push(void 0===(p=h[E])?p:String(p));var S=h.groups;if(u){var b=[v].concat(C,m,s);void 0!==S&&b.push(S);var T=String(e.apply(void 0,b))}else T=i(v,s,m,C,S,e);m>=y&&(d+=s.slice(y,m)+T,y=m+v.length)}return d+s.slice(y)}];function i(t,e,n,i,a,o){var s=n+t.length,u=i.length,c=sa;return void 0!==a&&(a=Ot(a),c=oa),r.call(o,c,(function(r,o){var c;switch(o.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,n);case"'":return e.slice(s);case"<":c=a[o.slice(1,-1)];break;default:var f=+o;if(0===f)return r;if(f>u){var l=aa(f/10);return 0===l?r:l<=u?void 0===i[l-1]?o.charAt(1):i[l-1]+o.charAt(1):r}c=i[f-1]}return void 0===c?"":c}))}})),ra("search",1,(function(t,e,r,n){return[function(r){var n=t(this),i=null==r?void 0:r[e];return void 0!==i?i.call(r,n):new RegExp(r)[e](String(n))},function(t){var e=n(r,t,this);if(e.done)return e.value;var i=P(t),a=String(this),o=i.lastIndex;Ue(o,0)||(i.lastIndex=0);var s=Zi(i,a);return Ue(i.lastIndex,o)||(i.lastIndex=o),null===s?-1:s.index}]}));var ua=et("species"),ca=function(t,e){var r,n=P(t).constructor;return void 0===n||null==(r=P(n)[ua])?e:X(r)},fa=Math.min,la=[].push,ha=!k((function(){RegExp(4294967295,"y")}));ra("split",2,(function(t,e,r,n){var i;return i="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,e){var n=String(this);if(void 0===t&&0===e)return[];if(!Sn(t))return r.call(n,t,e);for(var i,a,o,s=[],u=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),c=0,f=void 0===e?4294967295:e>>>0,l=new RegExp(t.source,u+"g");(i=Wi.call(l,n))&&!((a=l.lastIndex)>c&&(s.push(n.slice(c,i.index)),i.length>1&&i.index<n.length&&la.apply(s,i.slice(1)),o=i[0].length,c=a,s.length>=f));)l.lastIndex===i.index&&l.lastIndex++;return c===n.length?!o&&l.test("")||s.push(""):s.push(n.slice(c)),s.length>f?s.slice(0,f):s}:"0".split(void 0,0).length?function(t,e){return void 0===t&&0===e?[]:r.call(this,t,e)}:r,[function(r,n){var a=t(this),o=null==r?void 0:r[e];return void 0!==o?o.call(r,a,n):i.call(String(a),r,n)},function(t,e){var a=n(i,t,this,e,i!==r);if(a.done)return a.value;var o=P(t),s=String(this),u=ca(o,RegExp),c=o.unicode,f=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(ha?"y":"g"),l=new u(ha?o:"^(?:"+o.source+")",f),h=void 0===e?4294967295:e>>>0;if(0===h)return[];if(0===s.length)return null===Zi(l,s)?[s]:[];for(var p=0,d=0,y=[];d<s.length;){l.lastIndex=ha?d:0;var g,v=Zi(l,ha?s:s.slice(d));if(null===v||(g=fa(vt(l.lastIndex+(ha?0:d)),s.length))===p)d=Xi(s,d,c);else{if(y.push(s.slice(p,d)),y.length===h)return y;for(var m=1;m<=v.length-1;m++)if(y.push(v[m]),y.length===h)return y;d=p=g}}return y.push(s.slice(p)),y}]}));var pa,da,ya,ga=function(t,e,r,n){if(!(t instanceof e)||void 0!==n&&n in t)throw TypeError(r+": incorrect invocation!");return t},va=w((function(t){var e={},r={},n=t.exports=function(t,n,i,a,o){var s,u,c,f,l=o?function(){return t}:zn(t),h=$(i,a,n?2:1),p=0;if("function"!=typeof l)throw TypeError(t+" is not iterable!");if(Kn(l)){for(s=vt(t.length);s>p;p++)if((f=n?h(P(u=t[p])[0],u[1]):h(t[p]))===e||f===r)return f}else for(c=l.call(t);!(u=c.next()).done;)if((f=Mn(c,h,u.value,n))===e||f===r)return f};n.BREAK=e,n.RETURN=r})),ma=_.process,Ca=_.setImmediate,Ea=_.clearImmediate,Sa=_.MessageChannel,ba=_.Dispatch,Ta=0,Ia={},Aa=function(){var t=+this;if(Ia.hasOwnProperty(t)){var e=Ia[t];delete Ia[t],e()}},wa=function(t){Aa.call(t.data)};Ca&&Ea||(Ca=function(t){for(var e=[],r=1;arguments.length>r;)e.push(arguments[r++]);return Ia[++Ta]=function(){Ke("function"==typeof t?t:Function(t),e)},pa(Ta),Ta},Ea=function(t){delete Ia[t]},"process"==ct(ma)?pa=function(t){ma.nextTick($(Aa,t,1))}:ba&&ba.now?pa=function(t){ba.now($(Aa,t,1))}:Sa?(ya=(da=new Sa).port2,da.port1.onmessage=wa,pa=$(ya.postMessage,ya,1)):_.addEventListener&&"function"==typeof postMessage&&!_.importScripts?(pa=function(t){_.postMessage(t+"","*")},_.addEventListener("message",wa,!1)):pa="onreadystatechange"in D("script")?function(t){Ut.appendChild(D("script")).onreadystatechange=function(){Ut.removeChild(this),Aa.call(t)}}:function(t){setTimeout($(Aa,t,1),0)});var _a={set:Ca,clear:Ea},Ba=_a.set,Na=_.MutationObserver||_.WebKitMutationObserver,ka=_.process,Ra=_.Promise,Oa="process"==ct(ka),La=function(){var t,e,r,n=function(){var n,i;for(Oa&&(n=ka.domain)&&n.exit();t;){i=t.fn,t=t.next;try{i()}catch(n){throw t?r():e=void 0,n}}e=void 0,n&&n.enter()};if(Oa)r=function(){ka.nextTick(n)};else if(!Na||_.navigator&&_.navigator.standalone)if(Ra&&Ra.resolve){var i=Ra.resolve(void 0);r=function(){i.then(n)}}else r=function(){Ba.call(_,n)};else{var a=!0,o=document.createTextNode("");new Na(n).observe(o,{characterData:!0}),r=function(){o.data=a=!a}}return function(n){var i={fn:n,next:void 0};e&&(e.next=i),t||(t=i,r()),e=i}};function Pa(t){var e,r;this.promise=new t((function(t,n){if(void 0!==e||void 0!==r)throw TypeError("Bad Promise constructor");e=t,r=n})),this.resolve=X(e),this.reject=X(r)}var Ua,xa,Da,Va,Ma={f:function(t){return new Pa(t)}},ja=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}},Fa=_.navigator,Ka=Fa&&Fa.userAgent||"",qa=function(t,e){if(P(t),L(e)&&e.constructor===t)return e;var r=Ma.f(t);return(0,r.resolve)(e),r.promise},Ga=function(t,e,r){for(var n in e)Y(t,n,e[n],r);return t},za=_a.set,Wa=La(),Ha=_.TypeError,Qa=_.process,Ya=Qa&&Qa.versions,Xa=Ya&&Ya.v8||"",$a=_.Promise,Za="process"==je(Qa),Ja=function(){},to=xa=Ma.f,eo=!!function(){try{var t=$a.resolve(1),e=(t.constructor={})[et("species")]=function(t){t(Ja,Ja)};return(Za||"function"==typeof PromiseRejectionEvent)&&t.then(Ja)instanceof e&&0!==Xa.indexOf("6.6")&&-1===Ka.indexOf("Chrome/66")}catch(t){}}(),ro=function(t){var e;return!(!L(t)||"function"!=typeof(e=t.then))&&e},no=function(t,e){if(!t._n){t._n=!0;var r=t._c;Wa((function(){for(var n=t._v,i=1==t._s,a=0,o=function(e){var r,a,o,s=i?e.ok:e.fail,u=e.resolve,c=e.reject,f=e.domain;try{s?(i||(2==t._h&&oo(t),t._h=1),!0===s?r=n:(f&&f.enter(),r=s(n),f&&(f.exit(),o=!0)),r===e.promise?c(Ha("Promise-chain cycle")):(a=ro(r))?a.call(r,u,c):u(r)):c(n)}catch(t){f&&!o&&f.exit(),c(t)}};r.length>a;)o(r[a++]);t._c=[],t._n=!1,e&&!t._h&&io(t)}))}},io=function(t){za.call(_,(function(){var e,r,n,i=t._v,a=ao(t);if(a&&(e=ja((function(){Za?Qa.emit("unhandledRejection",i,t):(r=_.onunhandledrejection)?r({promise:t,reason:i}):(n=_.console)&&n.error&&n.error("Unhandled promise rejection",i)})),t._h=Za||ao(t)?2:1),t._a=void 0,a&&e.e)throw e.v}))},ao=function(t){return 1!==t._h&&0===(t._a||t._c).length},oo=function(t){za.call(_,(function(){var e;Za?Qa.emit("rejectionHandled",t):(e=_.onrejectionhandled)&&e({promise:t,reason:t._v})}))},so=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),no(e,!0))},uo=function(t){var e,r=this;if(!r._d){r._d=!0,r=r._w||r;try{if(r===t)throw Ha("Promise can't be resolved itself");(e=ro(t))?Wa((function(){var n={_w:r,_d:!1};try{e.call(t,$(uo,n,1),$(so,n,1))}catch(t){so.call(n,t)}})):(r._v=t,r._s=1,no(r,!1))}catch(t){so.call({_w:r,_d:!1},t)}}};eo||($a=function(t){ga(this,$a,"Promise","_h"),X(t),Ua.call(this);try{t($(uo,this,1),$(so,this,1))}catch(t){so.call(this,t)}},(Ua=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=Ga($a.prototype,{then:function(t,e){var r=to(ca(this,$a));return r.ok="function"!=typeof t||t,r.fail="function"==typeof e&&e,r.domain=Za?Qa.domain:void 0,this._c.push(r),this._a&&this._a.push(r),this._s&&no(this,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),Da=function(){var t=new Ua;this.promise=t,this.resolve=$(uo,t,1),this.reject=$(so,t,1)},Ma.f=to=function(t){return t===$a||t===Va?new Da(t):xa(t)}),J(J.G+J.W+J.F*!eo,{Promise:$a}),it($a,"Promise"),wi("Promise"),Va=O.Promise,J(J.S+J.F*!eo,"Promise",{reject:function(t){var e=to(this);return(0,e.reject)(t),e.promise}}),J(J.S+J.F*!eo,"Promise",{resolve:function(t){return qa(this,t)}}),J(J.S+J.F*!(eo&&Yn((function(t){$a.all(t).catch(Ja)}))),"Promise",{all:function(t){var e=this,r=to(e),n=r.resolve,i=r.reject,a=ja((function(){var r=[],a=0,o=1;va(t,!1,(function(t){var s=a++,u=!1;r.push(void 0),o++,e.resolve(t).then((function(t){u||(u=!0,r[s]=t,--o||n(r))}),i)})),--o||n(r)}));return a.e&&i(a.v),r.promise},race:function(t){var e=this,r=to(e),n=r.reject,i=ja((function(){va(t,!1,(function(t){e.resolve(t).then(r.resolve,n)}))}));return i.e&&n(i.v),r.promise}});var co=function(t,e){if(!L(t)||t._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return t},fo=F.f,lo=tt.fastKey,ho=R?"_s":"size",po=function(t,e){var r,n=lo(e);if("F"!==n)return t._i[n];for(r=t._f;r;r=r.n)if(r.k==e)return r},yo={getConstructor:function(t,e,r,n){var i=t((function(t,a){ga(t,i,e,"_i"),t._t=e,t._i=Mt(null),t._f=void 0,t._l=void 0,t[ho]=0,null!=a&&va(a,r,t[n],t)}));return Ga(i.prototype,{clear:function(){for(var t=co(this,e),r=t._i,n=t._f;n;n=n.n)n.r=!0,n.p&&(n.p=n.p.n=void 0),delete r[n.i];t._f=t._l=void 0,t[ho]=0},delete:function(t){var r=co(this,e),n=po(r,t);if(n){var i=n.n,a=n.p;delete r._i[n.i],n.r=!0,a&&(a.n=i),i&&(i.p=a),r._f==n&&(r._f=i),r._l==n&&(r._l=a),r[ho]--}return!!n},forEach:function(t){co(this,e);for(var r,n=$(t,arguments.length>1?arguments[1]:void 0,3);r=r?r.n:this._f;)for(n(r.v,r.k,this);r&&r.r;)r=r.p},has:function(t){return!!po(co(this,e),t)}}),R&&fo(i.prototype,"size",{get:function(){return co(this,e)[ho]}}),i},def:function(t,e,r){var n,i,a=po(t,e);return a?a.v=r:(t._l=a={i:i=lo(e,!0),k:e,v:r,p:n=t._l,n:void 0,r:!1},t._f||(t._f=a),n&&(n.n=a),t[ho]++,"F"!==i&&(t._i[i]=a)),t},getEntry:po,setStrong:function(t,e,r){vn(t,e,(function(t,r){this._t=co(t,e),this._k=r,this._l=void 0}),(function(){for(var t=this,e=t._k,r=t._l;r&&r.r;)r=r.p;return t._t&&(t._l=r=r?r.n:t._t._f)?_i(0,"keys"==e?r.k:"values"==e?r.v:[r.k,r.v]):(t._t=void 0,_i(1))}),r?"entries":"values",!r,!0),wi(e)}},go=function(t,e,r,n,i,a){var o=_[t],s=o,u=i?"set":"add",c=s&&s.prototype,f={},l=function(t){var e=c[t];Y(c,t,"delete"==t||"has"==t?function(t){return!(a&&!L(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return a&&!L(t)?void 0:e.call(this,0===t?0:t)}:"add"==t?function(t){return e.call(this,0===t?0:t),this}:function(t,r){return e.call(this,0===t?0:t,r),this})};if("function"==typeof s&&(a||c.forEach&&!k((function(){(new s).entries().next()})))){var h=new s,p=h[u](a?{}:-0,1)!=h,d=k((function(){h.has(1)})),y=Yn((function(t){new s(t)})),g=!a&&k((function(){for(var t=new s,e=5;e--;)t[u](e,e);return!t.has(-0)}));y||((s=e((function(e,r){ga(e,s,t);var n=pr(new o,e,s);return null!=r&&va(r,i,n[u],n),n}))).prototype=c,c.constructor=s),(d||g)&&(l("delete"),l("has"),i&&l("get")),(g||p)&&l(u),a&&c.clear&&delete c.clear}else s=n.getConstructor(e,t,i,u),Ga(s.prototype,r),tt.NEED=!0;return it(s,t),f[t]=s,J(J.G+J.W+J.F*(s!=o),f),a||n.setStrong(s,t,i),s},vo=go("Map",(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{get:function(t){var e=yo.getEntry(co(this,"Map"),t);return e&&e.v},set:function(t,e){return yo.def(co(this,"Map"),0===t?0:t,e)}},yo,!0),mo=go("Set",(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(t){return yo.def(co(this,"Set"),t=0===t?0:t,t)}},yo),Co=tt.getWeak,Eo=ni(5),So=ni(6),bo=0,To=function(t){return t._l||(t._l=new Io)},Io=function(){this.a=[]},Ao=function(t,e){return Eo(t.a,(function(t){return t[0]===e}))};Io.prototype={get:function(t){var e=Ao(this,t);if(e)return e[1]},has:function(t){return!!Ao(this,t)},set:function(t,e){var r=Ao(this,t);r?r[1]=e:this.a.push([t,e])},delete:function(t){var e=So(this.a,(function(e){return e[0]===t}));return~e&&this.a.splice(e,1),!!~e}};var wo={getConstructor:function(t,e,r,n){var i=t((function(t,a){ga(t,i,e,"_i"),t._t=e,t._i=bo++,t._l=void 0,null!=a&&va(a,r,t[n],t)}));return Ga(i.prototype,{delete:function(t){if(!L(t))return!1;var r=Co(t);return!0===r?To(co(this,e)).delete(t):r&&N(r,this._i)&&delete r[this._i]},has:function(t){if(!L(t))return!1;var r=Co(t);return!0===r?To(co(this,e)).has(t):r&&N(r,this._i)}}),i},def:function(t,e,r){var n=Co(P(e),!0);return!0===n?To(t).set(e,r):n[t._i]=r,t},ufstore:To},_o=w((function(t){var e,r=ni(0),n=co,i=!_.ActiveXObject&&"ActiveXObject"in _,a="WeakMap",o=tt.getWeak,s=Object.isExtensible,u=wo.ufstore,c=function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},f={get:function(t){if(L(t)){var e=o(t);return!0===e?u(co(this,a)).get(t):e?e[this._i]:void 0}},set:function(t,e){return wo.def(co(this,a),t,e)}},l=t.exports=go(a,c,f,wo,!0,!0);n&&i&&(e=wo.getConstructor(c,a),Pe(e.prototype,f),tt.NEED=!0,r(["delete","has","get","set"],(function(t){var r=l.prototype,n=r[t];Y(r,t,(function(r,i){if(L(r)&&!s(r)){this._f||(this._f=new e);var a=this._f[t](r,i);return"set"==t?this:a}return n.call(this,r,i)}))})))}));go("WeakSet",(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(t){return wo.def(co(this,"WeakSet"),t,!0)}},wo,!1,!0);for(var Bo,No=W("typed_array"),ko=W("view"),Ro=!(!_.ArrayBuffer||!_.DataView),Oo=Ro,Lo=0,Po="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");Lo<9;)(Bo=_[Po[Lo++]])?(q(Bo.prototype,No,!0),q(Bo.prototype,ko,!0)):Oo=!1;var Uo={ABV:Ro,CONSTR:Oo,TYPED:No,VIEW:ko},xo=function(t){if(void 0===t)return 0;var e=yt(t),r=vt(e);if(e!==r)throw RangeError("Wrong length!");return r},Do=w((function(t,e){var r=Ft.f,n=F.f,i="ArrayBuffer",a="DataView",o="Wrong index!",s=_.ArrayBuffer,u=_.DataView,c=_.Math,f=_.RangeError,l=_.Infinity,h=s,p=c.abs,d=c.pow,y=c.floor,g=c.log,v=c.LN2,m="buffer",C="byteLength",E="byteOffset",S=R?"_b":m,b=R?"_l":C,T=R?"_o":E;function I(t,e,r){var n,i,a,o=new Array(r),s=8*r-e-1,u=(1<<s)-1,c=u>>1,f=23===e?d(2,-24)-d(2,-77):0,h=0,m=t<0||0===t&&1/t<0?1:0;for((t=p(t))!=t||t===l?(i=t!=t?1:0,n=u):(n=y(g(t)/v),t*(a=d(2,-n))<1&&(n--,a*=2),(t+=n+c>=1?f/a:f*d(2,1-c))*a>=2&&(n++,a/=2),n+c>=u?(i=0,n=u):n+c>=1?(i=(t*a-1)*d(2,e),n+=c):(i=t*d(2,c-1)*d(2,e),n=0));e>=8;o[h++]=255&i,i/=256,e-=8);for(n=n<<e|i,s+=e;s>0;o[h++]=255&n,n/=256,s-=8);return o[--h]|=128*m,o}function A(t,e,r){var n,i=8*r-e-1,a=(1<<i)-1,o=a>>1,s=i-7,u=r-1,c=t[u--],f=127&c;for(c>>=7;s>0;f=256*f+t[u],u--,s-=8);for(n=f&(1<<-s)-1,f>>=-s,s+=e;s>0;n=256*n+t[u],u--,s-=8);if(0===f)f=1-o;else{if(f===a)return n?NaN:c?-l:l;n+=d(2,e),f-=o}return(c?-1:1)*n*d(2,f-e)}function w(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]}function B(t){return[255&t]}function N(t){return[255&t,t>>8&255]}function O(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function L(t){return I(t,52,8)}function P(t){return I(t,23,4)}function U(t,e,r){n(t.prototype,e,{get:function(){return this[r]}})}function x(t,e,r,n){var i=xo(+r);if(i+e>t[b])throw f(o);var a=t[S]._b,s=i+t[T],u=a.slice(s,s+e);return n?u:u.reverse()}function D(t,e,r,n,i,a){var s=xo(+r);if(s+e>t[b])throw f(o);for(var u=t[S]._b,c=s+t[T],l=n(+i),h=0;h<e;h++)u[c+h]=l[a?h:e-h-1]}if(Uo.ABV){if(!k((function(){s(1)}))||!k((function(){new s(-1)}))||k((function(){return new s,new s(1.5),new s(NaN),s.name!=i}))){for(var V,M=(s=function(t){return ga(this,s),new h(xo(t))}).prototype=h.prototype,j=r(h),K=0;j.length>K;)(V=j[K++])in s||q(s,V,h[V]);M.constructor=s}var G=new u(new s(2)),z=u.prototype.setInt8;G.setInt8(0,2147483648),G.setInt8(1,2147483649),!G.getInt8(0)&&G.getInt8(1)||Ga(u.prototype,{setInt8:function(t,e){z.call(this,t,e<<24>>24)},setUint8:function(t,e){z.call(this,t,e<<24>>24)}},!0)}else s=function(t){ga(this,s,i);var e=xo(t);this._b=Ei.call(new Array(e),0),this[b]=e},u=function(t,e,r){ga(this,u,a),ga(t,s,a);var n=t[b],i=yt(e);if(i<0||i>n)throw f("Wrong offset!");if(i+(r=void 0===r?n-i:vt(r))>n)throw f("Wrong length!");this[S]=t,this[T]=i,this[b]=r},R&&(U(s,C,"_l"),U(u,m,"_b"),U(u,C,"_l"),U(u,E,"_o")),Ga(u.prototype,{getInt8:function(t){return x(this,1,t)[0]<<24>>24},getUint8:function(t){return x(this,1,t)[0]},getInt16:function(t){var e=x(this,2,t,arguments[1]);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=x(this,2,t,arguments[1]);return e[1]<<8|e[0]},getInt32:function(t){return w(x(this,4,t,arguments[1]))},getUint32:function(t){return w(x(this,4,t,arguments[1]))>>>0},getFloat32:function(t){return A(x(this,4,t,arguments[1]),23,4)},getFloat64:function(t){return A(x(this,8,t,arguments[1]),52,8)},setInt8:function(t,e){D(this,1,t,B,e)},setUint8:function(t,e){D(this,1,t,B,e)},setInt16:function(t,e){D(this,2,t,N,e,arguments[2])},setUint16:function(t,e){D(this,2,t,N,e,arguments[2])},setInt32:function(t,e){D(this,4,t,O,e,arguments[2])},setUint32:function(t,e){D(this,4,t,O,e,arguments[2])},setFloat32:function(t,e){D(this,4,t,P,e,arguments[2])},setFloat64:function(t,e){D(this,8,t,L,e,arguments[2])}});it(s,i),it(u,a),q(u.prototype,Uo.VIEW,!0),e.ArrayBuffer=s,e.DataView=u})),Vo=_.ArrayBuffer,Mo=Do.ArrayBuffer,jo=Do.DataView,Fo=Uo.ABV&&Vo.isView,Ko=Mo.prototype.slice,qo=Uo.VIEW;J(J.G+J.W+J.F*(Vo!==Mo),{ArrayBuffer:Mo}),J(J.S+J.F*!Uo.CONSTR,"ArrayBuffer",{isView:function(t){return Fo&&Fo(t)||L(t)&&qo in t}}),J(J.P+J.U+J.F*k((function(){return!new Mo(2).slice(1,void 0).byteLength})),"ArrayBuffer",{slice:function(t,e){if(void 0!==Ko&&void 0===e)return Ko.call(P(this),t);for(var r=P(this).byteLength,n=Et(t,r),i=Et(void 0===e?r:e,r),a=new(ca(this,Mo))(vt(i-n)),o=new jo(this),s=new jo(a),u=0;n<i;)s.setUint8(u++,o.getUint8(n++));return a}}),wi("ArrayBuffer"),J(J.G+J.W+J.F*!Uo.ABV,{DataView:Do.DataView});var Go=w((function(t){if(R){var e=_,r=k,n=J,i=Uo,a=Do,o=$,s=ga,u=K,c=q,f=Ga,l=yt,h=vt,p=xo,d=Et,y=M,g=N,v=je,m=L,C=Ot,E=Kn,S=Mt,b=Ne,T=Ft.f,I=zn,A=W,w=et,B=ni,O=St,P=ca,U=Bi,x=ln,D=Yn,V=wi,j=Ei,G=gi,z=F,H=Ht,Q=z.f,Y=H.f,X=e.RangeError,Z=e.TypeError,tt=e.Uint8Array,rt="ArrayBuffer",nt="SharedArrayBuffer",it="BYTES_PER_ELEMENT",at=Array.prototype,ot=a.ArrayBuffer,st=a.DataView,ut=B(0),ct=B(2),ft=B(3),lt=B(4),ht=B(5),pt=B(6),dt=O(!0),gt=O(!1),mt=U.values,Ct=U.keys,bt=U.entries,Tt=at.lastIndexOf,It=at.reduce,At=at.reduceRight,wt=at.join,_t=at.sort,Bt=at.slice,Nt=at.toString,kt=at.toLocaleString,Rt=w("iterator"),Lt=w("toStringTag"),Pt=A("typed_constructor"),Ut=A("def_constructor"),xt=i.CONSTR,Dt=i.TYPED,Vt=i.VIEW,jt="Wrong length!",Kt=B(1,(function(t,e){return Qt(P(t,t[Ut]),e)})),qt=r((function(){return 1===new tt(new Uint16Array([1]).buffer)[0]})),Gt=!!tt&&!!tt.prototype.set&&r((function(){new tt(1).set({})})),zt=function(t,e){var r=l(t);if(r<0||r%e)throw X("Wrong offset!");return r},Wt=function(t){if(m(t)&&Dt in t)return t;throw Z(t+" is not a typed array!")},Qt=function(t,e){if(!m(t)||!(Pt in t))throw Z("It is not a typed array constructor!");return new t(e)},Yt=function(t,e){return Xt(P(t,t[Ut]),e)},Xt=function(t,e){for(var r=0,n=e.length,i=Qt(t,n);n>r;)i[r]=e[r++];return i},$t=function(t,e,r){Q(t,e,{get:function(){return this._d[r]}})},Zt=function(t){var e,r,n,i,a,s,u=C(t),c=arguments.length,f=c>1?arguments[1]:void 0,l=void 0!==f,p=I(u);if(null!=p&&!E(p)){for(s=p.call(u),n=[],e=0;!(a=s.next()).done;e++)n.push(a.value);u=n}for(l&&c>2&&(f=o(f,arguments[2],2)),e=0,r=h(u.length),i=Qt(this,r);r>e;e++)i[e]=l?f(u[e],e):u[e];return i},Jt=function(){for(var t=0,e=arguments.length,r=Qt(this,e);e>t;)r[t]=arguments[t++];return r},te=!!tt&&r((function(){kt.call(new tt(1))})),ee=function(){return kt.apply(te?Bt.call(Wt(this)):Wt(this),arguments)},re={copyWithin:function(t,e){return G.call(Wt(this),t,e,arguments.length>2?arguments[2]:void 0)},every:function(t){return lt(Wt(this),t,arguments.length>1?arguments[1]:void 0)},fill:function(t){return j.apply(Wt(this),arguments)},filter:function(t){return Yt(this,ct(Wt(this),t,arguments.length>1?arguments[1]:void 0))},find:function(t){return ht(Wt(this),t,arguments.length>1?arguments[1]:void 0)},findIndex:function(t){return pt(Wt(this),t,arguments.length>1?arguments[1]:void 0)},forEach:function(t){ut(Wt(this),t,arguments.length>1?arguments[1]:void 0)},indexOf:function(t){return gt(Wt(this),t,arguments.length>1?arguments[1]:void 0)},includes:function(t){return dt(Wt(this),t,arguments.length>1?arguments[1]:void 0)},join:function(t){return wt.apply(Wt(this),arguments)},lastIndexOf:function(t){return Tt.apply(Wt(this),arguments)},map:function(t){return Kt(Wt(this),t,arguments.length>1?arguments[1]:void 0)},reduce:function(t){return It.apply(Wt(this),arguments)},reduceRight:function(t){return At.apply(Wt(this),arguments)},reverse:function(){for(var t,e=this,r=Wt(e).length,n=Math.floor(r/2),i=0;i<n;)t=e[i],e[i++]=e[--r],e[r]=t;return e},some:function(t){return ft(Wt(this),t,arguments.length>1?arguments[1]:void 0)},sort:function(t){return _t.call(Wt(this),t)},subarray:function(t,e){var r=Wt(this),n=r.length,i=d(t,n);return new(P(r,r[Ut]))(r.buffer,r.byteOffset+i*r.BYTES_PER_ELEMENT,h((void 0===e?n:d(e,n))-i))}},ne=function(t,e){return Yt(this,Bt.call(Wt(this),t,e))},ie=function(t){Wt(this);var e=zt(arguments[1],1),r=this.length,n=C(t),i=h(n.length),a=0;if(i+e>r)throw X(jt);for(;a<i;)this[e+a]=n[a++]},ae={entries:function(){return bt.call(Wt(this))},keys:function(){return Ct.call(Wt(this))},values:function(){return mt.call(Wt(this))}},oe=function(t,e){return m(t)&&t[Dt]&&"symbol"!=typeof e&&e in t&&String(+e)==String(e)},se=function(t,e){return oe(t,e=y(e,!0))?u(2,t[e]):Y(t,e)},ue=function(t,e,r){return!(oe(t,e=y(e,!0))&&m(r)&&g(r,"value"))||g(r,"get")||g(r,"set")||r.configurable||g(r,"writable")&&!r.writable||g(r,"enumerable")&&!r.enumerable?Q(t,e,r):(t[e]=r.value,t)};xt||(H.f=se,z.f=ue),n(n.S+n.F*!xt,"Object",{getOwnPropertyDescriptor:se,defineProperty:ue}),r((function(){Nt.call({})}))&&(Nt=kt=function(){return wt.call(this)});var ce=f({},re);f(ce,ae),c(ce,Rt,ae.values),f(ce,{slice:ne,set:ie,constructor:function(){},toString:Nt,toLocaleString:ee}),$t(ce,"buffer","b"),$t(ce,"byteOffset","o"),$t(ce,"byteLength","l"),$t(ce,"length","e"),Q(ce,Lt,{get:function(){return this[Dt]}}),t.exports=function(t,a,o,u){var f=t+((u=!!u)?"Clamped":"")+"Array",l="get"+t,d="set"+t,y=e[f],g=y||{},C=y&&b(y),E=!y||!i.ABV,I={},A=y&&y.prototype,w=function(t,e){Q(t,e,{get:function(){return function(t,e){var r=t._d;return r.v[l](e*a+r.o,qt)}(this,e)},set:function(t){return function(t,e,r){var n=t._d;u&&(r=(r=Math.round(r))<0?0:r>255?255:255&r),n.v[d](e*a+n.o,r,qt)}(this,e,t)},enumerable:!0})};E?(y=o((function(t,e,r,n){s(t,y,f,"_d");var i,o,u,l,d=0,g=0;if(m(e)){if(!(e instanceof ot||(l=v(e))==rt||l==nt))return Dt in e?Xt(y,e):Zt.call(y,e);i=e,g=zt(r,a);var C=e.byteLength;if(void 0===n){if(C%a)throw X(jt);if((o=C-g)<0)throw X(jt)}else if((o=h(n)*a)+g>C)throw X(jt);u=o/a}else u=p(e),i=new ot(o=u*a);for(c(t,"_d",{b:i,o:g,l:o,e:u,v:new st(i)});d<u;)w(t,d++)})),A=y.prototype=S(ce),c(A,"constructor",y)):r((function(){y(1)}))&&r((function(){new y(-1)}))&&D((function(t){new y,new y(null),new y(1.5),new y(t)}),!0)||(y=o((function(t,e,r,n){var i;return s(t,y,f),m(e)?e instanceof ot||(i=v(e))==rt||i==nt?void 0!==n?new g(e,zt(r,a),n):void 0!==r?new g(e,zt(r,a)):new g(e):Dt in e?Xt(y,e):Zt.call(y,e):new g(p(e))})),ut(C!==Function.prototype?T(g).concat(T(C)):T(g),(function(t){t in y||c(y,t,g[t])})),y.prototype=A,A.constructor=y);var _=A[Rt],B=!!_&&("values"==_.name||null==_.name),N=ae.values;c(y,Pt,!0),c(A,Dt,f),c(A,Vt,!0),c(A,Ut,y),(u?new y(1)[Lt]==f:Lt in A)||Q(A,Lt,{get:function(){return f}}),I[f]=y,n(n.G+n.W+n.F*(y!=g),I),n(n.S,f,{BYTES_PER_ELEMENT:a}),n(n.S+n.F*r((function(){g.of.call(y,1)})),f,{from:Zt,of:Jt}),it in A||c(A,it,a),n(n.P,f,re),V(f),n(n.P+n.F*Gt,f,{set:ie}),n(n.P+n.F*!B,f,ae),A.toString!=Nt&&(A.toString=Nt),n(n.P+n.F*r((function(){new y(1).slice()})),f,{slice:ne}),n(n.P+n.F*(r((function(){return[1,2].toLocaleString()!=new y([1,2]).toLocaleString()}))||!r((function(){A.toLocaleString.call([1,2])}))),f,{toLocaleString:ee}),x[f]=B?_:N,B||c(A,Rt,N)}}else t.exports=function(){}}));Go("Int8",1,(function(t){return function(e,r,n){return t(this,e,r,n)}})),Go("Uint8",1,(function(t){return function(e,r,n){return t(this,e,r,n)}})),Go("Uint8",1,(function(t){return function(e,r,n){return t(this,e,r,n)}}),!0),Go("Int16",2,(function(t){return function(e,r,n){return t(this,e,r,n)}})),Go("Uint16",2,(function(t){return function(e,r,n){return t(this,e,r,n)}})),Go("Int32",4,(function(t){return function(e,r,n){return t(this,e,r,n)}})),Go("Uint32",4,(function(t){return function(e,r,n){return t(this,e,r,n)}})),Go("Float32",4,(function(t){return function(e,r,n){return t(this,e,r,n)}})),Go("Float64",8,(function(t){return function(e,r,n){return t(this,e,r,n)}}));var zo=(_.Reflect||{}).apply,Wo=Function.apply;J(J.S+J.F*!k((function(){zo((function(){}))})),"Reflect",{apply:function(t,e,r){var n=X(t),i=P(r);return zo?zo(n,e,i):Wo.call(n,e,i)}});var Ho=(_.Reflect||{}).construct,Qo=k((function(){function t(){}return!(Ho((function(){}),[],t)instanceof t)})),Yo=!k((function(){Ho((function(){}))}));J(J.S+J.F*(Qo||Yo),"Reflect",{construct:function(t,e){X(t),P(e);var r=arguments.length<3?t:X(arguments[2]);if(Yo&&!Qo)return Ho(t,e,r);if(t==r){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var n=[null];return n.push.apply(n,e),new(We.apply(t,n))}var i=r.prototype,a=Mt(L(i)?i:Object.prototype),o=Function.apply.call(t,a,e);return L(o)?o:a}}),J(J.S+J.F*k((function(){Reflect.defineProperty(F.f({},1,{value:1}),1,{value:2})})),"Reflect",{defineProperty:function(t,e,r){P(t),e=M(e,!0),P(r);try{return F.f(t,e,r),!0}catch(t){return!1}}});var Xo=Ht.f;J(J.S,"Reflect",{deleteProperty:function(t,e){var r=Xo(P(t),e);return!(r&&!r.configurable)&&delete t[e]}});var $o=function(t){this._t=P(t),this._i=0;var e,r=this._k=[];for(e in t)r.push(e)};pn($o,"Object",(function(){var t,e=this,r=e._k;do{if(e._i>=r.length)return{value:void 0,done:!0}}while(!((t=r[e._i++])in e._t));return{value:t,done:!1}})),J(J.S,"Reflect",{enumerate:function(t){return new $o(t)}}),J(J.S,"Reflect",{get:function t(e,r){var n,i,a=arguments.length<3?e:arguments[2];return P(e)===a?e[r]:(n=Ht.f(e,r))?N(n,"value")?n.value:void 0!==n.get?n.get.call(a):void 0:L(i=Ne(e))?t(i,r,a):void 0}}),J(J.S,"Reflect",{getOwnPropertyDescriptor:function(t,e){return Ht.f(P(t),e)}}),J(J.S,"Reflect",{getPrototypeOf:function(t){return Ne(P(t))}}),J(J.S,"Reflect",{has:function(t,e){return e in t}});var Zo=Object.isExtensible;J(J.S,"Reflect",{isExtensible:function(t){return P(t),!Zo||Zo(t)}});var Jo=_.Reflect,ts=Jo&&Jo.ownKeys||function(t){var e=Ft.f(P(t)),r=Nt.f;return r?e.concat(r(t)):e};J(J.S,"Reflect",{ownKeys:ts});var es=Object.preventExtensions;J(J.S,"Reflect",{preventExtensions:function(t){P(t);try{return es&&es(t),!0}catch(t){return!1}}}),J(J.S,"Reflect",{set:function t(e,r,n){var i,a,o=arguments.length<4?e:arguments[3],s=Ht.f(P(e),r);if(!s){if(L(a=Ne(e)))return t(a,r,n,o);s=K(0)}if(N(s,"value")){if(!1===s.writable||!L(o))return!1;if(i=Ht.f(o,r)){if(i.get||i.set||!1===i.writable)return!1;i.value=n,F.f(o,r,i)}else F.f(o,r,K(0,n));return!0}return void 0!==s.set&&(s.set.call(o,n),!0)}}),De&&J(J.S,"Reflect",{setPrototypeOf:function(t,e){De.check(t,e);try{return De.set(t,e),!0}catch(t){return!1}}});var rs=St(!0);J(J.P,"Array",{includes:function(t){return rs(this,t,arguments.length>1?arguments[1]:void 0)}}),Ci("includes");var ns=et("isConcatSpreadable");var is=function t(e,r,n,i,a,o,s,u){for(var c,f,l=a,h=0,p=!!s&&$(s,u,3);h<i;){if(h in n){if(c=p?p(n[h],h,r):n[h],f=!1,L(c)&&(f=void 0!==(f=c[ns])?!!f:Rt(c)),f&&o>0)l=t(e,r,c,vt(c.length),l,o-1)-1;else{if(l>=9007199254740991)throw TypeError();e[l]=c}l++}h++}return l};J(J.P,"Array",{flatMap:function(t){var e,r,n=Ot(this);return X(t),e=vt(n.length),r=ri(n,0),is(r,n,n,e,0,1,t,arguments[1]),r}}),Ci("flatMap"),J(J.P,"Array",{flatten:function(){var t=arguments[0],e=Ot(this),r=vt(e.length),n=ri(e,0);return is(n,e,e,r,0,void 0===t?1:yt(t)),n}}),Ci("flatten");var as=fn(!0),os=k((function(){return"𠮷"!=="𠮷".at(0)}));J(J.P+J.F*os,"String",{at:function(t){return as(this,t)}});var ss=function(t,e,r,n){var i=String(lt(t)),a=i.length,o=void 0===r?" ":String(r),s=vt(e);if(s<=a||""==o)return i;var u=s-a,c=Br.call(o,Math.ceil(u/o.length));return c.length>u&&(c=c.slice(0,u)),n?c+i:i+c},us=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(Ka);J(J.P+J.F*us,"String",{padStart:function(t){return ss(this,t,arguments.length>1?arguments[1]:void 0,!0)}});var cs=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(Ka);J(J.P+J.F*cs,"String",{padEnd:function(t){return ss(this,t,arguments.length>1?arguments[1]:void 0,!1)}}),ir("trimLeft",(function(t){return function(){return t(this,1)}}),"trimStart"),ir("trimRight",(function(t){return function(){return t(this,2)}}),"trimEnd");var fs=RegExp.prototype,ls=function(t,e){this._r=t,this._s=e};pn(ls,"RegExp String",(function(){var t=this._r.exec(this._s);return{value:t,done:null===t}})),J(J.P,"String",{matchAll:function(t){if(lt(this),!Sn(t))throw TypeError(t+" is not a regexp!");var e=String(this),r="flags"in fs?String(t.flags):Ni.call(t),n=new RegExp(t.source,~r.indexOf("g")?r:"g"+r);return n.lastIndex=vt(t.lastIndex),new ls(n,e)}}),st("asyncIterator"),st("observable"),J(J.S,"Object",{getOwnPropertyDescriptors:function(t){for(var e,r,n=ht(t),i=Ht.f,a=ts(n),o={},s=0;a.length>s;)void 0!==(r=i(n,e=a[s++]))&&qn(o,e,r);return o}});var hs=kt.f,ps=function(t){return function(e){for(var r,n=ht(e),i=Bt(n),a=i.length,o=0,s=[];a>o;)r=i[o++],R&&!hs.call(n,r)||s.push(t?[r,n[r]]:n[r]);return s}},ds=ps(!1);J(J.S,"Object",{values:function(t){return ds(t)}});var ys=ps(!0);J(J.S,"Object",{entries:function(t){return ys(t)}});var gs=!k((function(){var t=Math.random();__defineSetter__.call(null,t,(function(){})),delete _[t]}));R&&J(J.P+gs,"Object",{__defineGetter__:function(t,e){F.f(Ot(this),t,{get:X(e),enumerable:!0,configurable:!0})}}),R&&J(J.P+gs,"Object",{__defineSetter__:function(t,e){F.f(Ot(this),t,{set:X(e),enumerable:!0,configurable:!0})}});var vs=Ht.f;R&&J(J.P+gs,"Object",{__lookupGetter__:function(t){var e,r=Ot(this),n=M(t,!0);do{if(e=vs(r,n))return e.get}while(r=Ne(r))}});var ms=Ht.f;R&&J(J.P+gs,"Object",{__lookupSetter__:function(t){var e,r=Ot(this),n=M(t,!0);do{if(e=ms(r,n))return e.set}while(r=Ne(r))}});var Cs=function(t,e){var r=[];return va(t,!1,r.push,r,e),r},Es=function(t){return function(){if(je(this)!=t)throw TypeError(t+"#toJSON isn't generic");return Cs(this)}};J(J.P+J.R,"Map",{toJSON:Es("Map")}),J(J.P+J.R,"Set",{toJSON:Es("Set")});var Ss=function(t){J(J.S,t,{of:function(){for(var t=arguments.length,e=new Array(t);t--;)e[t]=arguments[t];return new this(e)}})};Ss("Map"),Ss("Set"),Ss("WeakMap"),Ss("WeakSet");var bs=function(t){J(J.S,t,{from:function(t){var e,r,n,i,a=arguments[1];return X(this),(e=void 0!==a)&&X(a),null==t?new this:(r=[],e?(n=0,i=$(a,arguments[2],2),va(t,!1,(function(t){r.push(i(t,n++))}))):va(t,!1,r.push,r),new this(r))}})};bs("Map"),bs("Set"),bs("WeakMap"),bs("WeakSet"),J(J.G,{global:_}),J(J.S,"System",{global:_}),J(J.S,"Error",{isError:function(t){return"Error"===ct(t)}}),J(J.S,"Math",{clamp:function(t,e,r){return Math.min(r,Math.max(e,t))}}),J(J.S,"Math",{DEG_PER_RAD:Math.PI/180});var Ts=180/Math.PI;J(J.S,"Math",{degrees:function(t){return t*Ts}});var Is=Math.scale||function(t,e,r,n,i){return 0===arguments.length||t!=t||e!=e||r!=r||n!=n||i!=i?NaN:t===1/0||t===-1/0?t:(t-e)*(i-n)/(r-e)+n};J(J.S,"Math",{fscale:function(t,e,r,n,i){return rn(Is(t,e,r,n,i))}}),J(J.S,"Math",{iaddh:function(t,e,r,n){var i=t>>>0,a=r>>>0;return(e>>>0)+(n>>>0)+((i&a|(i|a)&~(i+a>>>0))>>>31)|0}}),J(J.S,"Math",{isubh:function(t,e,r,n){var i=t>>>0,a=r>>>0;return(e>>>0)-(n>>>0)-((~i&a|~(i^a)&i-a>>>0)>>>31)|0}}),J(J.S,"Math",{imulh:function(t,e){var r=65535,n=+t,i=+e,a=n&r,o=i&r,s=n>>16,u=i>>16,c=(s*o>>>0)+(a*o>>>16);return s*u+(c>>16)+((a*u>>>0)+(c&r)>>16)}}),J(J.S,"Math",{RAD_PER_DEG:180/Math.PI});var As=Math.PI/180;J(J.S,"Math",{radians:function(t){return t*As}}),J(J.S,"Math",{scale:Is}),J(J.S,"Math",{umulh:function(t,e){var r=65535,n=+t,i=+e,a=n&r,o=i&r,s=n>>>16,u=i>>>16,c=(s*o>>>0)+(a*o>>>16);return s*u+(c>>>16)+((a*u>>>0)+(c&r)>>>16)}}),J(J.S,"Math",{signbit:function(t){return(t=+t)!=t?t:0==t?1/t==1/0:t>0}}),J(J.P+J.R,"Promise",{finally:function(t){var e=ca(this,O.Promise||_.Promise),r="function"==typeof t;return this.then(r?function(r){return qa(e,t()).then((function(){return r}))}:t,r?function(r){return qa(e,t()).then((function(){throw r}))}:t)}}),J(J.S,"Promise",{try:function(t){var e=Ma.f(this),r=ja(t);return(r.e?e.reject:e.resolve)(r.v),e.promise}});var ws=H("metadata"),_s=ws.store||(ws.store=new _o),Bs=function(t,e,r){var n=_s.get(t);if(!n){if(!r)return;_s.set(t,n=new vo)}var i=n.get(e);if(!i){if(!r)return;n.set(e,i=new vo)}return i},Ns={store:_s,map:Bs,has:function(t,e,r){var n=Bs(e,r,!1);return void 0!==n&&n.has(t)},get:function(t,e,r){var n=Bs(e,r,!1);return void 0===n?void 0:n.get(t)},set:function(t,e,r,n){Bs(r,n,!0).set(t,e)},keys:function(t,e){var r=Bs(t,e,!1),n=[];return r&&r.forEach((function(t,e){n.push(e)})),n},key:function(t){return void 0===t||"symbol"==typeof t?t:String(t)},exp:function(t){J(J.S,"Reflect",t)}},ks=Ns.key,Rs=Ns.set;Ns.exp({defineMetadata:function(t,e,r,n){Rs(t,e,P(r),ks(n))}});var Os=Ns.key,Ls=Ns.map,Ps=Ns.store;Ns.exp({deleteMetadata:function(t,e){var r=arguments.length<3?void 0:Os(arguments[2]),n=Ls(P(e),r,!1);if(void 0===n||!n.delete(t))return!1;if(n.size)return!0;var i=Ps.get(e);return i.delete(r),!!i.size||Ps.delete(e)}});var Us=Ns.has,xs=Ns.get,Ds=Ns.key,Vs=function(t,e,r){if(Us(t,e,r))return xs(t,e,r);var n=Ne(e);return null!==n?Vs(t,n,r):void 0};Ns.exp({getMetadata:function(t,e){return Vs(t,P(e),arguments.length<3?void 0:Ds(arguments[2]))}});var Ms=Ns.keys,js=Ns.key,Fs=function(t,e){var r=Ms(t,e),n=Ne(t);if(null===n)return r;var i=Fs(n,e);return i.length?r.length?Cs(new mo(r.concat(i))):i:r};Ns.exp({getMetadataKeys:function(t){return Fs(P(t),arguments.length<2?void 0:js(arguments[1]))}});var Ks=Ns.get,qs=Ns.key;Ns.exp({getOwnMetadata:function(t,e){return Ks(t,P(e),arguments.length<3?void 0:qs(arguments[2]))}});var Gs=Ns.keys,zs=Ns.key;Ns.exp({getOwnMetadataKeys:function(t){return Gs(P(t),arguments.length<2?void 0:zs(arguments[1]))}});var Ws=Ns.has,Hs=Ns.key,Qs=function(t,e,r){if(Ws(t,e,r))return!0;var n=Ne(e);return null!==n&&Qs(t,n,r)};Ns.exp({hasMetadata:function(t,e){return Qs(t,P(e),arguments.length<3?void 0:Hs(arguments[2]))}});var Ys=Ns.has,Xs=Ns.key;Ns.exp({hasOwnMetadata:function(t,e){return Ys(t,P(e),arguments.length<3?void 0:Xs(arguments[2]))}});var $s=Ns.key,Zs=Ns.set;Ns.exp({metadata:function(t,e){return function(r,n){Zs(t,e,(void 0!==n?P:X)(r),$s(n))}}});var Js=La(),tu=_.process,eu="process"==ct(tu);J(J.G,{asap:function(t){var e=eu&&tu.domain;Js(e?e.bind(t):t)}});var ru=La(),nu=et("observable"),iu=va.RETURN,au=function(t){return null==t?void 0:X(t)},ou=function(t){var e=t._c;e&&(t._c=void 0,e())},su=function(t){return void 0===t._o},uu=function(t){su(t)||(t._o=void 0,ou(t))},cu=function(t,e){P(t),this._c=void 0,this._o=t,t=new fu(this);try{var r=e(t),n=r;null!=r&&("function"==typeof r.unsubscribe?r=function(){n.unsubscribe()}:X(r),this._c=r)}catch(e){return void t.error(e)}su(this)&&ou(this)};cu.prototype=Ga({},{unsubscribe:function(){uu(this)}});var fu=function(t){this._s=t};fu.prototype=Ga({},{next:function(t){var e=this._s;if(!su(e)){var r=e._o;try{var n=au(r.next);if(n)return n.call(r,t)}catch(t){try{uu(e)}finally{throw t}}}},error:function(t){var e=this._s;if(su(e))throw t;var r=e._o;e._o=void 0;try{var n=au(r.error);if(!n)throw t;t=n.call(r,t)}catch(t){try{ou(e)}finally{throw t}}return ou(e),t},complete:function(t){var e=this._s;if(!su(e)){var r=e._o;e._o=void 0;try{var n=au(r.complete);t=n?n.call(r,t):void 0}catch(t){try{ou(e)}finally{throw t}}return ou(e),t}}});var lu=function(t){ga(this,lu,"Observable","_f")._f=X(t)};Ga(lu.prototype,{subscribe:function(t){return new cu(t,this._f)},forEach:function(t){var e=this;return new(O.Promise||_.Promise)((function(r,n){X(t);var i=e.subscribe({next:function(e){try{return t(e)}catch(t){n(t),i.unsubscribe()}},error:n,complete:r})}))}}),Ga(lu,{from:function(t){var e="function"==typeof this?this:lu,r=au(P(t)[nu]);if(r){var n=P(r.call(t));return n.constructor===e?n:new e((function(t){return n.subscribe(t)}))}return new e((function(e){var r=!1;return ru((function(){if(!r){try{if(va(t,!1,(function(t){if(e.next(t),r)return iu}))===iu)return}catch(t){if(r)throw t;return void e.error(t)}e.complete()}})),function(){r=!0}}))},of:function(){for(var t=0,e=arguments.length,r=new Array(e);t<e;)r[t]=arguments[t++];return new("function"==typeof this?this:lu)((function(t){var e=!1;return ru((function(){if(!e){for(var n=0;n<r.length;++n)if(t.next(r[n]),e)return;t.complete()}})),function(){e=!0}}))}}),q(lu.prototype,nu,(function(){return this})),J(J.G,{Observable:lu}),wi("Observable");var hu=[].slice,pu=/MSIE .\./.test(Ka),du=function(t){return function(e,r){var n=arguments.length>2,i=!!n&&hu.call(arguments,2);return t(n?function(){("function"==typeof e?e:Function(e)).apply(this,i)}:e,r)}};J(J.G+J.B+J.F*pu,{setTimeout:du(_.setTimeout),setInterval:du(_.setInterval)}),J(J.G+J.B,{setImmediate:_a.set,clearImmediate:_a.clear});for(var yu=et("iterator"),gu=et("toStringTag"),vu=ln.Array,mu={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},Cu=Bt(mu),Eu=0;Eu<Cu.length;Eu++){var Su,bu=Cu[Eu],Tu=mu[bu],Iu=_[bu],Au=Iu&&Iu.prototype;if(Au&&(Au[yu]||q(Au,yu,vu),Au[gu]||q(Au,gu,bu),ln[bu]=vu,Tu))for(Su in Bi)Au[Su]||Y(Au,Su,Bi[Su],!0)}w((function(t){!function(e){var r,n=Object.prototype,i=n.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag",c=e.regeneratorRuntime;if(c)t.exports=c;else{(c=e.regeneratorRuntime=t.exports).wrap=C;var f="suspendedStart",l="suspendedYield",h="executing",p="completed",d={},y={};y[o]=function(){return this};var g=Object.getPrototypeOf,v=g&&g(g(k([])));v&&v!==n&&i.call(v,o)&&(y=v);var m=T.prototype=S.prototype=Object.create(y);b.prototype=m.constructor=T,T.constructor=b,T[u]=b.displayName="GeneratorFunction",c.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},c.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,T):(t.__proto__=T,u in t||(t[u]="GeneratorFunction")),t.prototype=Object.create(m),t},c.awrap=function(t){return{__await:t}},I(A.prototype),A.prototype[s]=function(){return this},c.AsyncIterator=A,c.async=function(t,e,r,n){var i=new A(C(t,e,r,n));return c.isGeneratorFunction(e)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},I(m),m[u]="Generator",m[o]=function(){return this},m.toString=function(){return"[object Generator]"},c.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},c.values=k,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(B),!t)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,i){return s.type="throw",s.arg=t,e.next=n,i&&(e.method="next",e.arg=r),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var u=i.call(o,"catchLoc"),c=i.call(o,"finallyLoc");if(u&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,d):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),B(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;B(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),d}}}function C(t,e,r,n){var i=e&&e.prototype instanceof S?e:S,a=Object.create(i.prototype),o=new N(n||[]);return a._invoke=function(t,e,r){var n=f;return function(i,a){if(n===h)throw new Error("Generator is already running");if(n===p){if("throw"===i)throw a;return R()}for(r.method=i,r.arg=a;;){var o=r.delegate;if(o){var s=w(o,r);if(s){if(s===d)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=h;var u=E(t,e,r);if("normal"===u.type){if(n=r.done?p:l,u.arg===d)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=p,r.method="throw",r.arg=u.arg)}}}(t,r,o),a}function E(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}function S(){}function b(){}function T(){}function I(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function A(t){function r(e,n,a,o){var s=E(t[e],t,n);if("throw"!==s.type){var u=s.arg,c=u.value;return c&&"object"==typeof c&&i.call(c,"__await")?Promise.resolve(c.__await).then((function(t){r("next",t,a,o)}),(function(t){r("throw",t,a,o)})):Promise.resolve(c).then((function(t){u.value=t,a(u)}),o)}o(s.arg)}var n;"object"==typeof e.process&&e.process.domain&&(r=e.process.domain.bind(r)),this._invoke=function(t,e){function i(){return new Promise((function(n,i){r(t,e,n,i)}))}return n=n?n.then(i,i):i()}}function w(t,e){var n=t.iterator[e.method];if(n===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=r,w(t,e),"throw"===e.method))return d;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var i=E(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,d;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,d):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function B(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function k(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,a=function e(){for(;++n<t.length;)if(i.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=r,e.done=!0,e};return a.next=a}}return{next:R}}function R(){return{value:r,done:!0}}}("object"==typeof A?A:"object"==typeof window?window:"object"==typeof self?self:A)}));var wu,_u,Bu,Nu=(wu=/[\\^$*+?.()|[\]{}]/g,Bu=(_u="\\$&")===Object(_u)?function(t){return _u[t]}:_u,function(t){return String(t).replace(wu,Bu)});if(J(J.S,"RegExp",{escape:function(t){return Nu(t)}}),O.RegExp.escape,A._babelPolyfill)throw new Error("only one instance of babel-polyfill is allowed");A._babelPolyfill=!0;function ku(t,e,r){t[e]||Object.defineProperty(t,e,{writable:!0,configurable:!0,value:r})}ku(String.prototype,"padLeft","".padStart),ku(String.prototype,"padRight","".padEnd),"pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill".split(",").forEach((function(t){[][t]&&ku(Array,t,Function.call.bind([][t]))}));var Ru=w((function(t,e){var r=e;r.caCertFileName="node-mitmproxy.ca.crt",r.caKeyFileName="node-mitmproxy.ca.key.pem",r.defaultPort=6789,r.caName="node-mitmproxy CA",r.getDefaultCABasePath=function(){var t=process.env.HOME||process.env.USERPROFILE;return d.default.resolve(t,"./.node-mitmproxy")},r.getDefaultCACertPath=function(){return d.default.resolve(r.getDefaultCABasePath(),r.caCertFileName)},r.getDefaultCACertPath=function(){return d.default.resolve(r.getDefaultCABasePath(),r.caKeyFileName)}})),Ou=w((function(t,e){(function(){var r,n="Expected a function",i="__lodash_hash_undefined__",a="__lodash_placeholder__",o=16,s=32,u=64,c=128,f=256,l=1/0,h=9007199254740991,p=NaN,d=4294967295,y=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",o],["flip",512],["partial",s],["partialRight",u],["rearg",f]],g="[object Arguments]",v="[object Array]",m="[object Boolean]",C="[object Date]",E="[object Error]",S="[object Function]",b="[object GeneratorFunction]",T="[object Map]",I="[object Number]",w="[object Object]",_="[object Promise]",B="[object RegExp]",N="[object Set]",k="[object String]",R="[object Symbol]",O="[object WeakMap]",L="[object ArrayBuffer]",P="[object DataView]",U="[object Float32Array]",x="[object Float64Array]",D="[object Int8Array]",V="[object Int16Array]",M="[object Int32Array]",j="[object Uint8Array]",F="[object Uint8ClampedArray]",K="[object Uint16Array]",q="[object Uint32Array]",G=/\b__p \+= '';/g,z=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,H=/&(?:amp|lt|gt|quot|#39);/g,Q=/[&<>"']/g,Y=RegExp(H.source),X=RegExp(Q.source),$=/<%-([\s\S]+?)%>/g,Z=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,tt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,et=/^\w*$/,rt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nt=/[\\^$.*+?()[\]{}|]/g,it=RegExp(nt.source),at=/^\s+/,ot=/\s/,st=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ut=/\{\n\/\* \[wrapped with (.+)\] \*/,ct=/,? & /,ft=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,lt=/[()=,{}\[\]\/\s]/,ht=/\\(\\)?/g,pt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,dt=/\w*$/,yt=/^[-+]0x[0-9a-f]+$/i,gt=/^0b[01]+$/i,vt=/^\[object .+?Constructor\]$/,mt=/^0o[0-7]+$/i,Ct=/^(?:0|[1-9]\d*)$/,Et=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,St=/($^)/,bt=/['\n\r\u2028\u2029\\]/g,Tt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",It="\\u2700-\\u27bf",At="a-z\\xdf-\\xf6\\xf8-\\xff",wt="A-Z\\xc0-\\xd6\\xd8-\\xde",_t="\\ufe0e\\ufe0f",Bt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Nt="[']",kt="[\\ud800-\\udfff]",Rt="["+Bt+"]",Ot="["+Tt+"]",Lt="\\d+",Pt="[\\u2700-\\u27bf]",Ut="["+At+"]",xt="[^\\ud800-\\udfff"+Bt+Lt+It+At+wt+"]",Dt="\\ud83c[\\udffb-\\udfff]",Vt="[^\\ud800-\\udfff]",Mt="(?:\\ud83c[\\udde6-\\uddff]){2}",jt="[\\ud800-\\udbff][\\udc00-\\udfff]",Ft="["+wt+"]",Kt="(?:"+Ut+"|"+xt+")",qt="(?:"+Ft+"|"+xt+")",Gt="(?:['](?:d|ll|m|re|s|t|ve))?",zt="(?:['](?:D|LL|M|RE|S|T|VE))?",Wt="(?:"+Ot+"|"+Dt+")"+"?",Ht="[\\ufe0e\\ufe0f]?",Qt=Ht+Wt+("(?:\\u200d(?:"+[Vt,Mt,jt].join("|")+")"+Ht+Wt+")*"),Yt="(?:"+[Pt,Mt,jt].join("|")+")"+Qt,Xt="(?:"+[Vt+Ot+"?",Ot,Mt,jt,kt].join("|")+")",$t=RegExp(Nt,"g"),Zt=RegExp(Ot,"g"),Jt=RegExp(Dt+"(?="+Dt+")|"+Xt+Qt,"g"),te=RegExp([Ft+"?"+Ut+"+"+Gt+"(?="+[Rt,Ft,"$"].join("|")+")",qt+"+"+zt+"(?="+[Rt,Ft+Kt,"$"].join("|")+")",Ft+"?"+Kt+"+"+Gt,Ft+"+"+zt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Lt,Yt].join("|"),"g"),ee=RegExp("[\\u200d\\ud800-\\udfff"+Tt+_t+"]"),re=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ne=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ie=-1,ae={};ae[U]=ae[x]=ae[D]=ae[V]=ae[M]=ae[j]=ae[F]=ae[K]=ae[q]=!0,ae[g]=ae[v]=ae[L]=ae[m]=ae[P]=ae[C]=ae[E]=ae[S]=ae[T]=ae[I]=ae[w]=ae[B]=ae[N]=ae[k]=ae[O]=!1;var oe={};oe[g]=oe[v]=oe[L]=oe[P]=oe[m]=oe[C]=oe[U]=oe[x]=oe[D]=oe[V]=oe[M]=oe[T]=oe[I]=oe[w]=oe[B]=oe[N]=oe[k]=oe[R]=oe[j]=oe[F]=oe[K]=oe[q]=!0,oe[E]=oe[S]=oe[O]=!1;var se={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ue=parseFloat,ce=parseInt,fe="object"==typeof A&&A&&A.Object===Object&&A,le="object"==typeof self&&self&&self.Object===Object&&self,he=fe||le||Function("return this")(),pe=e&&!e.nodeType&&e,de=pe&&t&&!t.nodeType&&t,ye=de&&de.exports===pe,ge=ye&&fe.process,ve=function(){try{var t=de&&de.require&&de.require("util").types;return t||ge&&ge.binding&&ge.binding("util")}catch(t){}}(),me=ve&&ve.isArrayBuffer,Ce=ve&&ve.isDate,Ee=ve&&ve.isMap,Se=ve&&ve.isRegExp,be=ve&&ve.isSet,Te=ve&&ve.isTypedArray;function Ie(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Ae(t,e,r,n){for(var i=-1,a=null==t?0:t.length;++i<a;){var o=t[i];e(n,o,r(o),t)}return n}function we(t,e){for(var r=-1,n=null==t?0:t.length;++r<n&&!1!==e(t[r],r,t););return t}function _e(t,e){for(var r=null==t?0:t.length;r--&&!1!==e(t[r],r,t););return t}function Be(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(!e(t[r],r,t))return!1;return!0}function Ne(t,e){for(var r=-1,n=null==t?0:t.length,i=0,a=[];++r<n;){var o=t[r];e(o,r,t)&&(a[i++]=o)}return a}function ke(t,e){return!!(null==t?0:t.length)&&je(t,e,0)>-1}function Re(t,e,r){for(var n=-1,i=null==t?0:t.length;++n<i;)if(r(e,t[n]))return!0;return!1}function Oe(t,e){for(var r=-1,n=null==t?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}function Le(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}function Pe(t,e,r,n){var i=-1,a=null==t?0:t.length;for(n&&a&&(r=t[++i]);++i<a;)r=e(r,t[i],i,t);return r}function Ue(t,e,r,n){var i=null==t?0:t.length;for(n&&i&&(r=t[--i]);i--;)r=e(r,t[i],i,t);return r}function xe(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}var De=Ge("length");function Ve(t,e,r){var n;return r(t,(function(t,r,i){if(e(t,r,i))return n=r,!1})),n}function Me(t,e,r,n){for(var i=t.length,a=r+(n?1:-1);n?a--:++a<i;)if(e(t[a],a,t))return a;return-1}function je(t,e,r){return e==e?function(t,e,r){var n=r-1,i=t.length;for(;++n<i;)if(t[n]===e)return n;return-1}(t,e,r):Me(t,Ke,r)}function Fe(t,e,r,n){for(var i=r-1,a=t.length;++i<a;)if(n(t[i],e))return i;return-1}function Ke(t){return t!=t}function qe(t,e){var r=null==t?0:t.length;return r?He(t,e)/r:p}function Ge(t){return function(e){return null==e?r:e[t]}}function ze(t){return function(e){return null==t?r:t[e]}}function We(t,e,r,n,i){return i(t,(function(t,i,a){r=n?(n=!1,t):e(r,t,i,a)})),r}function He(t,e){for(var n,i=-1,a=t.length;++i<a;){var o=e(t[i]);o!==r&&(n=n===r?o:n+o)}return n}function Qe(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function Ye(t){return t?t.slice(0,pr(t)+1).replace(at,""):t}function Xe(t){return function(e){return t(e)}}function $e(t,e){return Oe(e,(function(e){return t[e]}))}function Ze(t,e){return t.has(e)}function Je(t,e){for(var r=-1,n=t.length;++r<n&&je(e,t[r],0)>-1;);return r}function tr(t,e){for(var r=t.length;r--&&je(e,t[r],0)>-1;);return r}function er(t,e){for(var r=t.length,n=0;r--;)t[r]===e&&++n;return n}var rr=ze({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),nr=ze({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function ir(t){return"\\"+se[t]}function ar(t){return ee.test(t)}function or(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function sr(t,e){return function(r){return t(e(r))}}function ur(t,e){for(var r=-1,n=t.length,i=0,o=[];++r<n;){var s=t[r];s!==e&&s!==a||(t[r]=a,o[i++]=r)}return o}function cr(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}function fr(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=[t,t]})),r}function lr(t){return ar(t)?function(t){var e=Jt.lastIndex=0;for(;Jt.test(t);)++e;return e}(t):De(t)}function hr(t){return ar(t)?function(t){return t.match(Jt)||[]}(t):function(t){return t.split("")}(t)}function pr(t){for(var e=t.length;e--&&ot.test(t.charAt(e)););return e}var dr=ze({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var yr=function t(e){var A,ot=(e=null==e?he:yr.defaults(he.Object(),e,yr.pick(he,ne))).Array,Tt=e.Date,It=e.Error,At=e.Function,wt=e.Math,_t=e.Object,Bt=e.RegExp,Nt=e.String,kt=e.TypeError,Rt=ot.prototype,Ot=At.prototype,Lt=_t.prototype,Pt=e["__core-js_shared__"],Ut=Ot.toString,xt=Lt.hasOwnProperty,Dt=0,Vt=(A=/[^.]+$/.exec(Pt&&Pt.keys&&Pt.keys.IE_PROTO||""))?"Symbol(src)_1."+A:"",Mt=Lt.toString,jt=Ut.call(_t),Ft=he._,Kt=Bt("^"+Ut.call(xt).replace(nt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qt=ye?e.Buffer:r,Gt=e.Symbol,zt=e.Uint8Array,Wt=qt?qt.allocUnsafe:r,Ht=sr(_t.getPrototypeOf,_t),Qt=_t.create,Yt=Lt.propertyIsEnumerable,Xt=Rt.splice,Jt=Gt?Gt.isConcatSpreadable:r,ee=Gt?Gt.iterator:r,se=Gt?Gt.toStringTag:r,fe=function(){try{var t=pa(_t,"defineProperty");return t({},"",{}),t}catch(t){}}(),le=e.clearTimeout!==he.clearTimeout&&e.clearTimeout,pe=Tt&&Tt.now!==he.Date.now&&Tt.now,de=e.setTimeout!==he.setTimeout&&e.setTimeout,ge=wt.ceil,ve=wt.floor,De=_t.getOwnPropertySymbols,ze=qt?qt.isBuffer:r,gr=e.isFinite,vr=Rt.join,mr=sr(_t.keys,_t),Cr=wt.max,Er=wt.min,Sr=Tt.now,br=e.parseInt,Tr=wt.random,Ir=Rt.reverse,Ar=pa(e,"DataView"),wr=pa(e,"Map"),_r=pa(e,"Promise"),Br=pa(e,"Set"),Nr=pa(e,"WeakMap"),kr=pa(_t,"create"),Rr=Nr&&new Nr,Or={},Lr=ja(Ar),Pr=ja(wr),Ur=ja(_r),xr=ja(Br),Dr=ja(Nr),Vr=Gt?Gt.prototype:r,Mr=Vr?Vr.valueOf:r,jr=Vr?Vr.toString:r;function Fr(t){if(is(t)&&!Ho(t)&&!(t instanceof zr)){if(t instanceof Gr)return t;if(xt.call(t,"__wrapped__"))return Fa(t)}return new Gr(t)}var Kr=function(){function t(){}return function(e){if(!ns(e))return{};if(Qt)return Qt(e);t.prototype=e;var n=new t;return t.prototype=r,n}}();function qr(){}function Gr(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=r}function zr(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function Wr(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Hr(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Qr(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Yr(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new Qr;++e<r;)this.add(t[e])}function Xr(t){var e=this.__data__=new Hr(t);this.size=e.size}function $r(t,e){var r=Ho(t),n=!r&&Wo(t),i=!r&&!n&&$o(t),a=!r&&!n&&!i&&hs(t),o=r||n||i||a,s=o?Qe(t.length,Nt):[],u=s.length;for(var c in t)!e&&!xt.call(t,c)||o&&("length"==c||i&&("offset"==c||"parent"==c)||a&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Ea(c,u))||s.push(c);return s}function Zr(t){var e=t.length;return e?t[Xn(0,e-1)]:r}function Jr(t,e){return Da(Ri(t),cn(e,0,t.length))}function tn(t){return Da(Ri(t))}function en(t,e,n){(n!==r&&!qo(t[e],n)||n===r&&!(e in t))&&sn(t,e,n)}function rn(t,e,n){var i=t[e];xt.call(t,e)&&qo(i,n)&&(n!==r||e in t)||sn(t,e,n)}function nn(t,e){for(var r=t.length;r--;)if(qo(t[r][0],e))return r;return-1}function an(t,e,r,n){return dn(t,(function(t,i,a){e(n,t,r(t),a)})),n}function on(t,e){return t&&Oi(e,Ps(e),t)}function sn(t,e,r){"__proto__"==e&&fe?fe(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function un(t,e){for(var n=-1,i=e.length,a=ot(i),o=null==t;++n<i;)a[n]=o?r:Ns(t,e[n]);return a}function cn(t,e,n){return t==t&&(n!==r&&(t=t<=n?t:n),e!==r&&(t=t>=e?t:e)),t}function fn(t,e,n,i,a,o){var s,u=1&e,c=2&e,f=4&e;if(n&&(s=a?n(t,i,a,o):n(t)),s!==r)return s;if(!ns(t))return t;var l=Ho(t);if(l){if(s=function(t){var e=t.length,r=new t.constructor(e);e&&"string"==typeof t[0]&&xt.call(t,"index")&&(r.index=t.index,r.input=t.input);return r}(t),!u)return Ri(t,s)}else{var h=ga(t),p=h==S||h==b;if($o(t))return Ai(t,u);if(h==w||h==g||p&&!a){if(s=c||p?{}:ma(t),!u)return c?function(t,e){return Oi(t,ya(t),e)}(t,function(t,e){return t&&Oi(e,Us(e),t)}(s,t)):function(t,e){return Oi(t,da(t),e)}(t,on(s,t))}else{if(!oe[h])return a?t:{};s=function(t,e,r){var n=t.constructor;switch(e){case L:return wi(t);case m:case C:return new n(+t);case P:return function(t,e){var r=e?wi(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case U:case x:case D:case V:case M:case j:case F:case K:case q:return _i(t,r);case T:return new n;case I:case k:return new n(t);case B:return function(t){var e=new t.constructor(t.source,dt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case N:return new n;case R:return i=t,Mr?_t(Mr.call(i)):{}}var i}(t,h,u)}}o||(o=new Xr);var d=o.get(t);if(d)return d;o.set(t,s),cs(t)?t.forEach((function(r){s.add(fn(r,e,n,r,t,o))})):as(t)&&t.forEach((function(r,i){s.set(i,fn(r,e,n,i,t,o))}));var y=l?r:(f?c?oa:aa:c?Us:Ps)(t);return we(y||t,(function(r,i){y&&(r=t[i=r]),rn(s,i,fn(r,e,n,i,t,o))})),s}function ln(t,e,n){var i=n.length;if(null==t)return!i;for(t=_t(t);i--;){var a=n[i],o=e[a],s=t[a];if(s===r&&!(a in t)||!o(s))return!1}return!0}function hn(t,e,i){if("function"!=typeof t)throw new kt(n);return La((function(){t.apply(r,i)}),e)}function pn(t,e,r,n){var i=-1,a=ke,o=!0,s=t.length,u=[],c=e.length;if(!s)return u;r&&(e=Oe(e,Xe(r))),n?(a=Re,o=!1):e.length>=200&&(a=Ze,o=!1,e=new Yr(e));t:for(;++i<s;){var f=t[i],l=null==r?f:r(f);if(f=n||0!==f?f:0,o&&l==l){for(var h=c;h--;)if(e[h]===l)continue t;u.push(f)}else a(e,l,n)||u.push(f)}return u}Fr.templateSettings={escape:$,evaluate:Z,interpolate:J,variable:"",imports:{_:Fr}},Fr.prototype=qr.prototype,Fr.prototype.constructor=Fr,Gr.prototype=Kr(qr.prototype),Gr.prototype.constructor=Gr,zr.prototype=Kr(qr.prototype),zr.prototype.constructor=zr,Wr.prototype.clear=function(){this.__data__=kr?kr(null):{},this.size=0},Wr.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Wr.prototype.get=function(t){var e=this.__data__;if(kr){var n=e[t];return n===i?r:n}return xt.call(e,t)?e[t]:r},Wr.prototype.has=function(t){var e=this.__data__;return kr?e[t]!==r:xt.call(e,t)},Wr.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=kr&&e===r?i:e,this},Hr.prototype.clear=function(){this.__data__=[],this.size=0},Hr.prototype.delete=function(t){var e=this.__data__,r=nn(e,t);return!(r<0)&&(r==e.length-1?e.pop():Xt.call(e,r,1),--this.size,!0)},Hr.prototype.get=function(t){var e=this.__data__,n=nn(e,t);return n<0?r:e[n][1]},Hr.prototype.has=function(t){return nn(this.__data__,t)>-1},Hr.prototype.set=function(t,e){var r=this.__data__,n=nn(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},Qr.prototype.clear=function(){this.size=0,this.__data__={hash:new Wr,map:new(wr||Hr),string:new Wr}},Qr.prototype.delete=function(t){var e=la(this,t).delete(t);return this.size-=e?1:0,e},Qr.prototype.get=function(t){return la(this,t).get(t)},Qr.prototype.has=function(t){return la(this,t).has(t)},Qr.prototype.set=function(t,e){var r=la(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},Yr.prototype.add=Yr.prototype.push=function(t){return this.__data__.set(t,i),this},Yr.prototype.has=function(t){return this.__data__.has(t)},Xr.prototype.clear=function(){this.__data__=new Hr,this.size=0},Xr.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},Xr.prototype.get=function(t){return this.__data__.get(t)},Xr.prototype.has=function(t){return this.__data__.has(t)},Xr.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Hr){var n=r.__data__;if(!wr||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Qr(n)}return r.set(t,e),this.size=r.size,this};var dn=Ui(bn),yn=Ui(Tn,!0);function gn(t,e){var r=!0;return dn(t,(function(t,n,i){return r=!!e(t,n,i)})),r}function vn(t,e,n){for(var i=-1,a=t.length;++i<a;){var o=t[i],s=e(o);if(null!=s&&(u===r?s==s&&!ls(s):n(s,u)))var u=s,c=o}return c}function mn(t,e){var r=[];return dn(t,(function(t,n,i){e(t,n,i)&&r.push(t)})),r}function Cn(t,e,r,n,i){var a=-1,o=t.length;for(r||(r=Ca),i||(i=[]);++a<o;){var s=t[a];e>0&&r(s)?e>1?Cn(s,e-1,r,n,i):Le(i,s):n||(i[i.length]=s)}return i}var En=xi(),Sn=xi(!0);function bn(t,e){return t&&En(t,e,Ps)}function Tn(t,e){return t&&Sn(t,e,Ps)}function In(t,e){return Ne(e,(function(e){return ts(t[e])}))}function An(t,e){for(var n=0,i=(e=Si(e,t)).length;null!=t&&n<i;)t=t[Ma(e[n++])];return n&&n==i?t:r}function wn(t,e,r){var n=e(t);return Ho(t)?n:Le(n,r(t))}function _n(t){return null==t?t===r?"[object Undefined]":"[object Null]":se&&se in _t(t)?function(t){var e=xt.call(t,se),n=t[se];try{t[se]=r;var i=!0}catch(t){}var a=Mt.call(t);i&&(e?t[se]=n:delete t[se]);return a}(t):function(t){return Mt.call(t)}(t)}function Bn(t,e){return t>e}function Nn(t,e){return null!=t&&xt.call(t,e)}function kn(t,e){return null!=t&&e in _t(t)}function Rn(t,e,n){for(var i=n?Re:ke,a=t[0].length,o=t.length,s=o,u=ot(o),c=1/0,f=[];s--;){var l=t[s];s&&e&&(l=Oe(l,Xe(e))),c=Er(l.length,c),u[s]=!n&&(e||a>=120&&l.length>=120)?new Yr(s&&l):r}l=t[0];var h=-1,p=u[0];t:for(;++h<a&&f.length<c;){var d=l[h],y=e?e(d):d;if(d=n||0!==d?d:0,!(p?Ze(p,y):i(f,y,n))){for(s=o;--s;){var g=u[s];if(!(g?Ze(g,y):i(t[s],y,n)))continue t}p&&p.push(y),f.push(d)}}return f}function On(t,e,n){var i=null==(t=Na(t,e=Si(e,t)))?t:t[Ma(Za(e))];return null==i?r:Ie(i,t,n)}function Ln(t){return is(t)&&_n(t)==g}function Pn(t,e,n,i,a){return t===e||(null==t||null==e||!is(t)&&!is(e)?t!=t&&e!=e:function(t,e,n,i,a,o){var s=Ho(t),u=Ho(e),c=s?v:ga(t),f=u?v:ga(e),l=(c=c==g?w:c)==w,h=(f=f==g?w:f)==w,p=c==f;if(p&&$o(t)){if(!$o(e))return!1;s=!0,l=!1}if(p&&!l)return o||(o=new Xr),s||hs(t)?na(t,e,n,i,a,o):function(t,e,r,n,i,a,o){switch(r){case P:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case L:return!(t.byteLength!=e.byteLength||!a(new zt(t),new zt(e)));case m:case C:case I:return qo(+t,+e);case E:return t.name==e.name&&t.message==e.message;case B:case k:return t==e+"";case T:var s=or;case N:var u=1&n;if(s||(s=cr),t.size!=e.size&&!u)return!1;var c=o.get(t);if(c)return c==e;n|=2,o.set(t,e);var f=na(s(t),s(e),n,i,a,o);return o.delete(t),f;case R:if(Mr)return Mr.call(t)==Mr.call(e)}return!1}(t,e,c,n,i,a,o);if(!(1&n)){var d=l&&xt.call(t,"__wrapped__"),y=h&&xt.call(e,"__wrapped__");if(d||y){var S=d?t.value():t,b=y?e.value():e;return o||(o=new Xr),a(S,b,n,i,o)}}if(!p)return!1;return o||(o=new Xr),function(t,e,n,i,a,o){var s=1&n,u=aa(t),c=u.length,f=aa(e).length;if(c!=f&&!s)return!1;var l=c;for(;l--;){var h=u[l];if(!(s?h in e:xt.call(e,h)))return!1}var p=o.get(t),d=o.get(e);if(p&&d)return p==e&&d==t;var y=!0;o.set(t,e),o.set(e,t);var g=s;for(;++l<c;){var v=t[h=u[l]],m=e[h];if(i)var C=s?i(m,v,h,e,t,o):i(v,m,h,t,e,o);if(!(C===r?v===m||a(v,m,n,i,o):C)){y=!1;break}g||(g="constructor"==h)}if(y&&!g){var E=t.constructor,S=e.constructor;E==S||!("constructor"in t)||!("constructor"in e)||"function"==typeof E&&E instanceof E&&"function"==typeof S&&S instanceof S||(y=!1)}return o.delete(t),o.delete(e),y}(t,e,n,i,a,o)}(t,e,n,i,Pn,a))}function Un(t,e,n,i){var a=n.length,o=a,s=!i;if(null==t)return!o;for(t=_t(t);a--;){var u=n[a];if(s&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++a<o;){var c=(u=n[a])[0],f=t[c],l=u[1];if(s&&u[2]){if(f===r&&!(c in t))return!1}else{var h=new Xr;if(i)var p=i(f,l,c,t,e,h);if(!(p===r?Pn(l,f,3,i,h):p))return!1}}return!0}function xn(t){return!(!ns(t)||(e=t,Vt&&Vt in e))&&(ts(t)?Kt:vt).test(ja(t));var e}function Dn(t){return"function"==typeof t?t:null==t?ou:"object"==typeof t?Ho(t)?qn(t[0],t[1]):Kn(t):yu(t)}function Vn(t){if(!Aa(t))return mr(t);var e=[];for(var r in _t(t))xt.call(t,r)&&"constructor"!=r&&e.push(r);return e}function Mn(t){if(!ns(t))return function(t){var e=[];if(null!=t)for(var r in _t(t))e.push(r);return e}(t);var e=Aa(t),r=[];for(var n in t)("constructor"!=n||!e&&xt.call(t,n))&&r.push(n);return r}function jn(t,e){return t<e}function Fn(t,e){var r=-1,n=Yo(t)?ot(t.length):[];return dn(t,(function(t,i,a){n[++r]=e(t,i,a)})),n}function Kn(t){var e=ha(t);return 1==e.length&&e[0][2]?_a(e[0][0],e[0][1]):function(r){return r===t||Un(r,t,e)}}function qn(t,e){return ba(t)&&wa(e)?_a(Ma(t),e):function(n){var i=Ns(n,t);return i===r&&i===e?ks(n,t):Pn(e,i,3)}}function Gn(t,e,n,i,a){t!==e&&En(e,(function(o,s){if(a||(a=new Xr),ns(o))!function(t,e,n,i,a,o,s){var u=Ra(t,n),c=Ra(e,n),f=s.get(c);if(f)return void en(t,n,f);var l=o?o(u,c,n+"",t,e,s):r,h=l===r;if(h){var p=Ho(c),d=!p&&$o(c),y=!p&&!d&&hs(c);l=c,p||d||y?Ho(u)?l=u:Xo(u)?l=Ri(u):d?(h=!1,l=Ai(c,!0)):y?(h=!1,l=_i(c,!0)):l=[]:ss(c)||Wo(c)?(l=u,Wo(u)?l=Es(u):ns(u)&&!ts(u)||(l=ma(c))):h=!1}h&&(s.set(c,l),a(l,c,i,o,s),s.delete(c));en(t,n,l)}(t,e,s,n,Gn,i,a);else{var u=i?i(Ra(t,s),o,s+"",t,e,a):r;u===r&&(u=o),en(t,s,u)}}),Us)}function zn(t,e){var n=t.length;if(n)return Ea(e+=e<0?n:0,n)?t[e]:r}function Wn(t,e,r){e=e.length?Oe(e,(function(t){return Ho(t)?function(e){return An(e,1===t.length?t[0]:t)}:t})):[ou];var n=-1;return e=Oe(e,Xe(fa())),function(t,e){var r=t.length;for(t.sort(e);r--;)t[r]=t[r].value;return t}(Fn(t,(function(t,r,i){return{criteria:Oe(e,(function(e){return e(t)})),index:++n,value:t}})),(function(t,e){return function(t,e,r){var n=-1,i=t.criteria,a=e.criteria,o=i.length,s=r.length;for(;++n<o;){var u=Bi(i[n],a[n]);if(u)return n>=s?u:u*("desc"==r[n]?-1:1)}return t.index-e.index}(t,e,r)}))}function Hn(t,e,r){for(var n=-1,i=e.length,a={};++n<i;){var o=e[n],s=An(t,o);r(s,o)&&ei(a,Si(o,t),s)}return a}function Qn(t,e,r,n){var i=n?Fe:je,a=-1,o=e.length,s=t;for(t===e&&(e=Ri(e)),r&&(s=Oe(t,Xe(r)));++a<o;)for(var u=0,c=e[a],f=r?r(c):c;(u=i(s,f,u,n))>-1;)s!==t&&Xt.call(s,u,1),Xt.call(t,u,1);return t}function Yn(t,e){for(var r=t?e.length:0,n=r-1;r--;){var i=e[r];if(r==n||i!==a){var a=i;Ea(i)?Xt.call(t,i,1):pi(t,i)}}return t}function Xn(t,e){return t+ve(Tr()*(e-t+1))}function $n(t,e){var r="";if(!t||e<1||e>h)return r;do{e%2&&(r+=t),(e=ve(e/2))&&(t+=t)}while(e);return r}function Zn(t,e){return Pa(Ba(t,e,ou),t+"")}function Jn(t){return Zr(qs(t))}function ti(t,e){var r=qs(t);return Da(r,cn(e,0,r.length))}function ei(t,e,n,i){if(!ns(t))return t;for(var a=-1,o=(e=Si(e,t)).length,s=o-1,u=t;null!=u&&++a<o;){var c=Ma(e[a]),f=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return t;if(a!=s){var l=u[c];(f=i?i(l,c,u):r)===r&&(f=ns(l)?l:Ea(e[a+1])?[]:{})}rn(u,c,f),u=u[c]}return t}var ri=Rr?function(t,e){return Rr.set(t,e),t}:ou,ni=fe?function(t,e){return fe(t,"toString",{configurable:!0,enumerable:!1,value:nu(e),writable:!0})}:ou;function ii(t){return Da(qs(t))}function ai(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(r=r>i?i:r)<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var a=ot(i);++n<i;)a[n]=t[n+e];return a}function oi(t,e){var r;return dn(t,(function(t,n,i){return!(r=e(t,n,i))})),!!r}function si(t,e,r){var n=0,i=null==t?n:t.length;if("number"==typeof e&&e==e&&i<=2147483647){for(;n<i;){var a=n+i>>>1,o=t[a];null!==o&&!ls(o)&&(r?o<=e:o<e)?n=a+1:i=a}return i}return ui(t,e,ou,r)}function ui(t,e,n,i){var a=0,o=null==t?0:t.length;if(0===o)return 0;for(var s=(e=n(e))!=e,u=null===e,c=ls(e),f=e===r;a<o;){var l=ve((a+o)/2),h=n(t[l]),p=h!==r,d=null===h,y=h==h,g=ls(h);if(s)var v=i||y;else v=f?y&&(i||p):u?y&&p&&(i||!d):c?y&&p&&!d&&(i||!g):!d&&!g&&(i?h<=e:h<e);v?a=l+1:o=l}return Er(o,4294967294)}function ci(t,e){for(var r=-1,n=t.length,i=0,a=[];++r<n;){var o=t[r],s=e?e(o):o;if(!r||!qo(s,u)){var u=s;a[i++]=0===o?0:o}}return a}function fi(t){return"number"==typeof t?t:ls(t)?p:+t}function li(t){if("string"==typeof t)return t;if(Ho(t))return Oe(t,li)+"";if(ls(t))return jr?jr.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function hi(t,e,r){var n=-1,i=ke,a=t.length,o=!0,s=[],u=s;if(r)o=!1,i=Re;else if(a>=200){var c=e?null:$i(t);if(c)return cr(c);o=!1,i=Ze,u=new Yr}else u=e?[]:s;t:for(;++n<a;){var f=t[n],l=e?e(f):f;if(f=r||0!==f?f:0,o&&l==l){for(var h=u.length;h--;)if(u[h]===l)continue t;e&&u.push(l),s.push(f)}else i(u,l,r)||(u!==s&&u.push(l),s.push(f))}return s}function pi(t,e){return null==(t=Na(t,e=Si(e,t)))||delete t[Ma(Za(e))]}function di(t,e,r,n){return ei(t,e,r(An(t,e)),n)}function yi(t,e,r,n){for(var i=t.length,a=n?i:-1;(n?a--:++a<i)&&e(t[a],a,t););return r?ai(t,n?0:a,n?a+1:i):ai(t,n?a+1:0,n?i:a)}function gi(t,e){var r=t;return r instanceof zr&&(r=r.value()),Pe(e,(function(t,e){return e.func.apply(e.thisArg,Le([t],e.args))}),r)}function vi(t,e,r){var n=t.length;if(n<2)return n?hi(t[0]):[];for(var i=-1,a=ot(n);++i<n;)for(var o=t[i],s=-1;++s<n;)s!=i&&(a[i]=pn(a[i]||o,t[s],e,r));return hi(Cn(a,1),e,r)}function mi(t,e,n){for(var i=-1,a=t.length,o=e.length,s={};++i<a;){var u=i<o?e[i]:r;n(s,t[i],u)}return s}function Ci(t){return Xo(t)?t:[]}function Ei(t){return"function"==typeof t?t:ou}function Si(t,e){return Ho(t)?t:ba(t,e)?[t]:Va(Ss(t))}var bi=Zn;function Ti(t,e,n){var i=t.length;return n=n===r?i:n,!e&&n>=i?t:ai(t,e,n)}var Ii=le||function(t){return he.clearTimeout(t)};function Ai(t,e){if(e)return t.slice();var r=t.length,n=Wt?Wt(r):new t.constructor(r);return t.copy(n),n}function wi(t){var e=new t.constructor(t.byteLength);return new zt(e).set(new zt(t)),e}function _i(t,e){var r=e?wi(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function Bi(t,e){if(t!==e){var n=t!==r,i=null===t,a=t==t,o=ls(t),s=e!==r,u=null===e,c=e==e,f=ls(e);if(!u&&!f&&!o&&t>e||o&&s&&c&&!u&&!f||i&&s&&c||!n&&c||!a)return 1;if(!i&&!o&&!f&&t<e||f&&n&&a&&!i&&!o||u&&n&&a||!s&&a||!c)return-1}return 0}function Ni(t,e,r,n){for(var i=-1,a=t.length,o=r.length,s=-1,u=e.length,c=Cr(a-o,0),f=ot(u+c),l=!n;++s<u;)f[s]=e[s];for(;++i<o;)(l||i<a)&&(f[r[i]]=t[i]);for(;c--;)f[s++]=t[i++];return f}function ki(t,e,r,n){for(var i=-1,a=t.length,o=-1,s=r.length,u=-1,c=e.length,f=Cr(a-s,0),l=ot(f+c),h=!n;++i<f;)l[i]=t[i];for(var p=i;++u<c;)l[p+u]=e[u];for(;++o<s;)(h||i<a)&&(l[p+r[o]]=t[i++]);return l}function Ri(t,e){var r=-1,n=t.length;for(e||(e=ot(n));++r<n;)e[r]=t[r];return e}function Oi(t,e,n,i){var a=!n;n||(n={});for(var o=-1,s=e.length;++o<s;){var u=e[o],c=i?i(n[u],t[u],u,n,t):r;c===r&&(c=t[u]),a?sn(n,u,c):rn(n,u,c)}return n}function Li(t,e){return function(r,n){var i=Ho(r)?Ae:an,a=e?e():{};return i(r,t,fa(n,2),a)}}function Pi(t){return Zn((function(e,n){var i=-1,a=n.length,o=a>1?n[a-1]:r,s=a>2?n[2]:r;for(o=t.length>3&&"function"==typeof o?(a--,o):r,s&&Sa(n[0],n[1],s)&&(o=a<3?r:o,a=1),e=_t(e);++i<a;){var u=n[i];u&&t(e,u,i,o)}return e}))}function Ui(t,e){return function(r,n){if(null==r)return r;if(!Yo(r))return t(r,n);for(var i=r.length,a=e?i:-1,o=_t(r);(e?a--:++a<i)&&!1!==n(o[a],a,o););return r}}function xi(t){return function(e,r,n){for(var i=-1,a=_t(e),o=n(e),s=o.length;s--;){var u=o[t?s:++i];if(!1===r(a[u],u,a))break}return e}}function Di(t){return function(e){var n=ar(e=Ss(e))?hr(e):r,i=n?n[0]:e.charAt(0),a=n?Ti(n,1).join(""):e.slice(1);return i[t]()+a}}function Vi(t){return function(e){return Pe(tu(Ws(e).replace($t,"")),t,"")}}function Mi(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var r=Kr(t.prototype),n=t.apply(r,e);return ns(n)?n:r}}function ji(t){return function(e,n,i){var a=_t(e);if(!Yo(e)){var o=fa(n,3);e=Ps(e),n=function(t){return o(a[t],t,a)}}var s=t(e,n,i);return s>-1?a[o?e[s]:s]:r}}function Fi(t){return ia((function(e){var i=e.length,a=i,o=Gr.prototype.thru;for(t&&e.reverse();a--;){var s=e[a];if("function"!=typeof s)throw new kt(n);if(o&&!u&&"wrapper"==ua(s))var u=new Gr([],!0)}for(a=u?a:i;++a<i;){var c=ua(s=e[a]),f="wrapper"==c?sa(s):r;u=f&&Ta(f[0])&&424==f[1]&&!f[4].length&&1==f[9]?u[ua(f[0])].apply(u,f[3]):1==s.length&&Ta(s)?u[c]():u.thru(s)}return function(){var t=arguments,r=t[0];if(u&&1==t.length&&Ho(r))return u.plant(r).value();for(var n=0,a=i?e[n].apply(this,t):r;++n<i;)a=e[n].call(this,a);return a}}))}function Ki(t,e,n,i,a,o,s,u,f,l){var h=e&c,p=1&e,d=2&e,y=24&e,g=512&e,v=d?r:Mi(t);return function r(){for(var c=arguments.length,m=ot(c),C=c;C--;)m[C]=arguments[C];if(y)var E=ca(r),S=er(m,E);if(i&&(m=Ni(m,i,a,y)),o&&(m=ki(m,o,s,y)),c-=S,y&&c<l){var b=ur(m,E);return Yi(t,e,Ki,r.placeholder,n,m,b,u,f,l-c)}var T=p?n:this,I=d?T[t]:t;return c=m.length,u?m=ka(m,u):g&&c>1&&m.reverse(),h&&f<c&&(m.length=f),this&&this!==he&&this instanceof r&&(I=v||Mi(I)),I.apply(T,m)}}function qi(t,e){return function(r,n){return function(t,e,r,n){return bn(t,(function(t,i,a){e(n,r(t),i,a)})),n}(r,t,e(n),{})}}function Gi(t,e){return function(n,i){var a;if(n===r&&i===r)return e;if(n!==r&&(a=n),i!==r){if(a===r)return i;"string"==typeof n||"string"==typeof i?(n=li(n),i=li(i)):(n=fi(n),i=fi(i)),a=t(n,i)}return a}}function zi(t){return ia((function(e){return e=Oe(e,Xe(fa())),Zn((function(r){var n=this;return t(e,(function(t){return Ie(t,n,r)}))}))}))}function Wi(t,e){var n=(e=e===r?" ":li(e)).length;if(n<2)return n?$n(e,t):e;var i=$n(e,ge(t/lr(e)));return ar(e)?Ti(hr(i),0,t).join(""):i.slice(0,t)}function Hi(t){return function(e,n,i){return i&&"number"!=typeof i&&Sa(e,n,i)&&(n=i=r),e=gs(e),n===r?(n=e,e=0):n=gs(n),function(t,e,r,n){for(var i=-1,a=Cr(ge((e-t)/(r||1)),0),o=ot(a);a--;)o[n?a:++i]=t,t+=r;return o}(e,n,i=i===r?e<n?1:-1:gs(i),t)}}function Qi(t){return function(e,r){return"string"==typeof e&&"string"==typeof r||(e=Cs(e),r=Cs(r)),t(e,r)}}function Yi(t,e,n,i,a,o,c,f,l,h){var p=8&e;e|=p?s:u,4&(e&=~(p?u:s))||(e&=-4);var d=[t,e,a,p?o:r,p?c:r,p?r:o,p?r:c,f,l,h],y=n.apply(r,d);return Ta(t)&&Oa(y,d),y.placeholder=i,Ua(y,t,e)}function Xi(t){var e=wt[t];return function(t,r){if(t=Cs(t),(r=null==r?0:Er(vs(r),292))&&gr(t)){var n=(Ss(t)+"e").split("e");return+((n=(Ss(e(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return e(t)}}var $i=Br&&1/cr(new Br([,-0]))[1]==l?function(t){return new Br(t)}:lu;function Zi(t){return function(e){var r=ga(e);return r==T?or(e):r==N?fr(e):function(t,e){return Oe(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Ji(t,e,i,l,h,p,d,y){var g=2&e;if(!g&&"function"!=typeof t)throw new kt(n);var v=l?l.length:0;if(v||(e&=-97,l=h=r),d=d===r?d:Cr(vs(d),0),y=y===r?y:vs(y),v-=h?h.length:0,e&u){var m=l,C=h;l=h=r}var E=g?r:sa(t),S=[t,e,i,l,h,m,C,p,d,y];if(E&&function(t,e){var r=t[1],n=e[1],i=r|n,o=i<131,s=n==c&&8==r||n==c&&r==f&&t[7].length<=e[8]||384==n&&e[7].length<=e[8]&&8==r;if(!o&&!s)return t;1&n&&(t[2]=e[2],i|=1&r?0:4);var u=e[3];if(u){var l=t[3];t[3]=l?Ni(l,u,e[4]):u,t[4]=l?ur(t[3],a):e[4]}(u=e[5])&&(l=t[5],t[5]=l?ki(l,u,e[6]):u,t[6]=l?ur(t[5],a):e[6]);(u=e[7])&&(t[7]=u);n&c&&(t[8]=null==t[8]?e[8]:Er(t[8],e[8]));null==t[9]&&(t[9]=e[9]);t[0]=e[0],t[1]=i}(S,E),t=S[0],e=S[1],i=S[2],l=S[3],h=S[4],!(y=S[9]=S[9]===r?g?0:t.length:Cr(S[9]-v,0))&&24&e&&(e&=-25),e&&1!=e)b=8==e||e==o?function(t,e,n){var i=Mi(t);return function a(){for(var o=arguments.length,s=ot(o),u=o,c=ca(a);u--;)s[u]=arguments[u];var f=o<3&&s[0]!==c&&s[o-1]!==c?[]:ur(s,c);return(o-=f.length)<n?Yi(t,e,Ki,a.placeholder,r,s,f,r,r,n-o):Ie(this&&this!==he&&this instanceof a?i:t,this,s)}}(t,e,y):e!=s&&33!=e||h.length?Ki.apply(r,S):function(t,e,r,n){var i=1&e,a=Mi(t);return function e(){for(var o=-1,s=arguments.length,u=-1,c=n.length,f=ot(c+s),l=this&&this!==he&&this instanceof e?a:t;++u<c;)f[u]=n[u];for(;s--;)f[u++]=arguments[++o];return Ie(l,i?r:this,f)}}(t,e,i,l);else var b=function(t,e,r){var n=1&e,i=Mi(t);return function e(){return(this&&this!==he&&this instanceof e?i:t).apply(n?r:this,arguments)}}(t,e,i);return Ua((E?ri:Oa)(b,S),t,e)}function ta(t,e,n,i){return t===r||qo(t,Lt[n])&&!xt.call(i,n)?e:t}function ea(t,e,n,i,a,o){return ns(t)&&ns(e)&&(o.set(e,t),Gn(t,e,r,ea,o),o.delete(e)),t}function ra(t){return ss(t)?r:t}function na(t,e,n,i,a,o){var s=1&n,u=t.length,c=e.length;if(u!=c&&!(s&&c>u))return!1;var f=o.get(t),l=o.get(e);if(f&&l)return f==e&&l==t;var h=-1,p=!0,d=2&n?new Yr:r;for(o.set(t,e),o.set(e,t);++h<u;){var y=t[h],g=e[h];if(i)var v=s?i(g,y,h,e,t,o):i(y,g,h,t,e,o);if(v!==r){if(v)continue;p=!1;break}if(d){if(!xe(e,(function(t,e){if(!Ze(d,e)&&(y===t||a(y,t,n,i,o)))return d.push(e)}))){p=!1;break}}else if(y!==g&&!a(y,g,n,i,o)){p=!1;break}}return o.delete(t),o.delete(e),p}function ia(t){return Pa(Ba(t,r,Ha),t+"")}function aa(t){return wn(t,Ps,da)}function oa(t){return wn(t,Us,ya)}var sa=Rr?function(t){return Rr.get(t)}:lu;function ua(t){for(var e=t.name+"",r=Or[e],n=xt.call(Or,e)?r.length:0;n--;){var i=r[n],a=i.func;if(null==a||a==t)return i.name}return e}function ca(t){return(xt.call(Fr,"placeholder")?Fr:t).placeholder}function fa(){var t=Fr.iteratee||su;return t=t===su?Dn:t,arguments.length?t(arguments[0],arguments[1]):t}function la(t,e){var r,n,i=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof e?"string":"hash"]:i.map}function ha(t){for(var e=Ps(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,wa(i)]}return e}function pa(t,e){var n=function(t,e){return null==t?r:t[e]}(t,e);return xn(n)?n:r}var da=De?function(t){return null==t?[]:(t=_t(t),Ne(De(t),(function(e){return Yt.call(t,e)})))}:mu,ya=De?function(t){for(var e=[];t;)Le(e,da(t)),t=Ht(t);return e}:mu,ga=_n;function va(t,e,r){for(var n=-1,i=(e=Si(e,t)).length,a=!1;++n<i;){var o=Ma(e[n]);if(!(a=null!=t&&r(t,o)))break;t=t[o]}return a||++n!=i?a:!!(i=null==t?0:t.length)&&rs(i)&&Ea(o,i)&&(Ho(t)||Wo(t))}function ma(t){return"function"!=typeof t.constructor||Aa(t)?{}:Kr(Ht(t))}function Ca(t){return Ho(t)||Wo(t)||!!(Jt&&t&&t[Jt])}function Ea(t,e){var r=typeof t;return!!(e=null==e?h:e)&&("number"==r||"symbol"!=r&&Ct.test(t))&&t>-1&&t%1==0&&t<e}function Sa(t,e,r){if(!ns(r))return!1;var n=typeof e;return!!("number"==n?Yo(r)&&Ea(e,r.length):"string"==n&&e in r)&&qo(r[e],t)}function ba(t,e){if(Ho(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!ls(t))||(et.test(t)||!tt.test(t)||null!=e&&t in _t(e))}function Ta(t){var e=ua(t),r=Fr[e];if("function"!=typeof r||!(e in zr.prototype))return!1;if(t===r)return!0;var n=sa(r);return!!n&&t===n[0]}(Ar&&ga(new Ar(new ArrayBuffer(1)))!=P||wr&&ga(new wr)!=T||_r&&ga(_r.resolve())!=_||Br&&ga(new Br)!=N||Nr&&ga(new Nr)!=O)&&(ga=function(t){var e=_n(t),n=e==w?t.constructor:r,i=n?ja(n):"";if(i)switch(i){case Lr:return P;case Pr:return T;case Ur:return _;case xr:return N;case Dr:return O}return e});var Ia=Pt?ts:Cu;function Aa(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Lt)}function wa(t){return t==t&&!ns(t)}function _a(t,e){return function(n){return null!=n&&(n[t]===e&&(e!==r||t in _t(n)))}}function Ba(t,e,n){return e=Cr(e===r?t.length-1:e,0),function(){for(var r=arguments,i=-1,a=Cr(r.length-e,0),o=ot(a);++i<a;)o[i]=r[e+i];i=-1;for(var s=ot(e+1);++i<e;)s[i]=r[i];return s[e]=n(o),Ie(t,this,s)}}function Na(t,e){return e.length<2?t:An(t,ai(e,0,-1))}function ka(t,e){for(var n=t.length,i=Er(e.length,n),a=Ri(t);i--;){var o=e[i];t[i]=Ea(o,n)?a[o]:r}return t}function Ra(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Oa=xa(ri),La=de||function(t,e){return he.setTimeout(t,e)},Pa=xa(ni);function Ua(t,e,r){var n=e+"";return Pa(t,function(t,e){var r=e.length;if(!r)return t;var n=r-1;return e[n]=(r>1?"& ":"")+e[n],e=e.join(r>2?", ":" "),t.replace(st,"{\n/* [wrapped with "+e+"] */\n")}(n,function(t,e){return we(y,(function(r){var n="_."+r[0];e&r[1]&&!ke(t,n)&&t.push(n)})),t.sort()}(function(t){var e=t.match(ut);return e?e[1].split(ct):[]}(n),r)))}function xa(t){var e=0,n=0;return function(){var i=Sr(),a=16-(i-n);if(n=i,a>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(r,arguments)}}function Da(t,e){var n=-1,i=t.length,a=i-1;for(e=e===r?i:e;++n<e;){var o=Xn(n,a),s=t[o];t[o]=t[n],t[n]=s}return t.length=e,t}var Va=function(t){var e=Do(t,(function(t){return 500===r.size&&r.clear(),t})),r=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(rt,(function(t,r,n,i){e.push(n?i.replace(ht,"$1"):r||t)})),e}));function Ma(t){if("string"==typeof t||ls(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function ja(t){if(null!=t){try{return Ut.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Fa(t){if(t instanceof zr)return t.clone();var e=new Gr(t.__wrapped__,t.__chain__);return e.__actions__=Ri(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Ka=Zn((function(t,e){return Xo(t)?pn(t,Cn(e,1,Xo,!0)):[]})),qa=Zn((function(t,e){var n=Za(e);return Xo(n)&&(n=r),Xo(t)?pn(t,Cn(e,1,Xo,!0),fa(n,2)):[]})),Ga=Zn((function(t,e){var n=Za(e);return Xo(n)&&(n=r),Xo(t)?pn(t,Cn(e,1,Xo,!0),r,n):[]}));function za(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=null==r?0:vs(r);return i<0&&(i=Cr(n+i,0)),Me(t,fa(e,3),i)}function Wa(t,e,n){var i=null==t?0:t.length;if(!i)return-1;var a=i-1;return n!==r&&(a=vs(n),a=n<0?Cr(i+a,0):Er(a,i-1)),Me(t,fa(e,3),a,!0)}function Ha(t){return(null==t?0:t.length)?Cn(t,1):[]}function Qa(t){return t&&t.length?t[0]:r}var Ya=Zn((function(t){var e=Oe(t,Ci);return e.length&&e[0]===t[0]?Rn(e):[]})),Xa=Zn((function(t){var e=Za(t),n=Oe(t,Ci);return e===Za(n)?e=r:n.pop(),n.length&&n[0]===t[0]?Rn(n,fa(e,2)):[]})),$a=Zn((function(t){var e=Za(t),n=Oe(t,Ci);return(e="function"==typeof e?e:r)&&n.pop(),n.length&&n[0]===t[0]?Rn(n,r,e):[]}));function Za(t){var e=null==t?0:t.length;return e?t[e-1]:r}var Ja=Zn(to);function to(t,e){return t&&t.length&&e&&e.length?Qn(t,e):t}var eo=ia((function(t,e){var r=null==t?0:t.length,n=un(t,e);return Yn(t,Oe(e,(function(t){return Ea(t,r)?+t:t})).sort(Bi)),n}));function ro(t){return null==t?t:Ir.call(t)}var no=Zn((function(t){return hi(Cn(t,1,Xo,!0))})),io=Zn((function(t){var e=Za(t);return Xo(e)&&(e=r),hi(Cn(t,1,Xo,!0),fa(e,2))})),ao=Zn((function(t){var e=Za(t);return e="function"==typeof e?e:r,hi(Cn(t,1,Xo,!0),r,e)}));function oo(t){if(!t||!t.length)return[];var e=0;return t=Ne(t,(function(t){if(Xo(t))return e=Cr(t.length,e),!0})),Qe(e,(function(e){return Oe(t,Ge(e))}))}function so(t,e){if(!t||!t.length)return[];var n=oo(t);return null==e?n:Oe(n,(function(t){return Ie(e,r,t)}))}var uo=Zn((function(t,e){return Xo(t)?pn(t,e):[]})),co=Zn((function(t){return vi(Ne(t,Xo))})),fo=Zn((function(t){var e=Za(t);return Xo(e)&&(e=r),vi(Ne(t,Xo),fa(e,2))})),lo=Zn((function(t){var e=Za(t);return e="function"==typeof e?e:r,vi(Ne(t,Xo),r,e)})),ho=Zn(oo);var po=Zn((function(t){var e=t.length,n=e>1?t[e-1]:r;return n="function"==typeof n?(t.pop(),n):r,so(t,n)}));function yo(t){var e=Fr(t);return e.__chain__=!0,e}function go(t,e){return e(t)}var vo=ia((function(t){var e=t.length,n=e?t[0]:0,i=this.__wrapped__,a=function(e){return un(e,t)};return!(e>1||this.__actions__.length)&&i instanceof zr&&Ea(n)?((i=i.slice(n,+n+(e?1:0))).__actions__.push({func:go,args:[a],thisArg:r}),new Gr(i,this.__chain__).thru((function(t){return e&&!t.length&&t.push(r),t}))):this.thru(a)}));var mo=Li((function(t,e,r){xt.call(t,r)?++t[r]:sn(t,r,1)}));var Co=ji(za),Eo=ji(Wa);function So(t,e){return(Ho(t)?we:dn)(t,fa(e,3))}function bo(t,e){return(Ho(t)?_e:yn)(t,fa(e,3))}var To=Li((function(t,e,r){xt.call(t,r)?t[r].push(e):sn(t,r,[e])}));var Io=Zn((function(t,e,r){var n=-1,i="function"==typeof e,a=Yo(t)?ot(t.length):[];return dn(t,(function(t){a[++n]=i?Ie(e,t,r):On(t,e,r)})),a})),Ao=Li((function(t,e,r){sn(t,r,e)}));function wo(t,e){return(Ho(t)?Oe:Fn)(t,fa(e,3))}var _o=Li((function(t,e,r){t[r?0:1].push(e)}),(function(){return[[],[]]}));var Bo=Zn((function(t,e){if(null==t)return[];var r=e.length;return r>1&&Sa(t,e[0],e[1])?e=[]:r>2&&Sa(e[0],e[1],e[2])&&(e=[e[0]]),Wn(t,Cn(e,1),[])})),No=pe||function(){return he.Date.now()};function ko(t,e,n){return e=n?r:e,e=t&&null==e?t.length:e,Ji(t,c,r,r,r,r,e)}function Ro(t,e){var i;if("function"!=typeof e)throw new kt(n);return t=vs(t),function(){return--t>0&&(i=e.apply(this,arguments)),t<=1&&(e=r),i}}var Oo=Zn((function(t,e,r){var n=1;if(r.length){var i=ur(r,ca(Oo));n|=s}return Ji(t,n,e,r,i)})),Lo=Zn((function(t,e,r){var n=3;if(r.length){var i=ur(r,ca(Lo));n|=s}return Ji(e,n,t,r,i)}));function Po(t,e,i){var a,o,s,u,c,f,l=0,h=!1,p=!1,d=!0;if("function"!=typeof t)throw new kt(n);function y(e){var n=a,i=o;return a=o=r,l=e,u=t.apply(i,n)}function g(t){return l=t,c=La(m,e),h?y(t):u}function v(t){var n=t-f;return f===r||n>=e||n<0||p&&t-l>=s}function m(){var t=No();if(v(t))return C(t);c=La(m,function(t){var r=e-(t-f);return p?Er(r,s-(t-l)):r}(t))}function C(t){return c=r,d&&a?y(t):(a=o=r,u)}function E(){var t=No(),n=v(t);if(a=arguments,o=this,f=t,n){if(c===r)return g(f);if(p)return Ii(c),c=La(m,e),y(f)}return c===r&&(c=La(m,e)),u}return e=Cs(e)||0,ns(i)&&(h=!!i.leading,s=(p="maxWait"in i)?Cr(Cs(i.maxWait)||0,e):s,d="trailing"in i?!!i.trailing:d),E.cancel=function(){c!==r&&Ii(c),l=0,a=f=o=c=r},E.flush=function(){return c===r?u:C(No())},E}var Uo=Zn((function(t,e){return hn(t,1,e)})),xo=Zn((function(t,e,r){return hn(t,Cs(e)||0,r)}));function Do(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new kt(n);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=t.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(Do.Cache||Qr),r}function Vo(t){if("function"!=typeof t)throw new kt(n);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Do.Cache=Qr;var Mo=bi((function(t,e){var r=(e=1==e.length&&Ho(e[0])?Oe(e[0],Xe(fa())):Oe(Cn(e,1),Xe(fa()))).length;return Zn((function(n){for(var i=-1,a=Er(n.length,r);++i<a;)n[i]=e[i].call(this,n[i]);return Ie(t,this,n)}))})),jo=Zn((function(t,e){var n=ur(e,ca(jo));return Ji(t,s,r,e,n)})),Fo=Zn((function(t,e){var n=ur(e,ca(Fo));return Ji(t,u,r,e,n)})),Ko=ia((function(t,e){return Ji(t,f,r,r,r,e)}));function qo(t,e){return t===e||t!=t&&e!=e}var Go=Qi(Bn),zo=Qi((function(t,e){return t>=e})),Wo=Ln(function(){return arguments}())?Ln:function(t){return is(t)&&xt.call(t,"callee")&&!Yt.call(t,"callee")},Ho=ot.isArray,Qo=me?Xe(me):function(t){return is(t)&&_n(t)==L};function Yo(t){return null!=t&&rs(t.length)&&!ts(t)}function Xo(t){return is(t)&&Yo(t)}var $o=ze||Cu,Zo=Ce?Xe(Ce):function(t){return is(t)&&_n(t)==C};function Jo(t){if(!is(t))return!1;var e=_n(t);return e==E||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!ss(t)}function ts(t){if(!ns(t))return!1;var e=_n(t);return e==S||e==b||"[object AsyncFunction]"==e||"[object Proxy]"==e}function es(t){return"number"==typeof t&&t==vs(t)}function rs(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=h}function ns(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function is(t){return null!=t&&"object"==typeof t}var as=Ee?Xe(Ee):function(t){return is(t)&&ga(t)==T};function os(t){return"number"==typeof t||is(t)&&_n(t)==I}function ss(t){if(!is(t)||_n(t)!=w)return!1;var e=Ht(t);if(null===e)return!0;var r=xt.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&Ut.call(r)==jt}var us=Se?Xe(Se):function(t){return is(t)&&_n(t)==B};var cs=be?Xe(be):function(t){return is(t)&&ga(t)==N};function fs(t){return"string"==typeof t||!Ho(t)&&is(t)&&_n(t)==k}function ls(t){return"symbol"==typeof t||is(t)&&_n(t)==R}var hs=Te?Xe(Te):function(t){return is(t)&&rs(t.length)&&!!ae[_n(t)]};var ps=Qi(jn),ds=Qi((function(t,e){return t<=e}));function ys(t){if(!t)return[];if(Yo(t))return fs(t)?hr(t):Ri(t);if(ee&&t[ee])return function(t){for(var e,r=[];!(e=t.next()).done;)r.push(e.value);return r}(t[ee]());var e=ga(t);return(e==T?or:e==N?cr:qs)(t)}function gs(t){return t?(t=Cs(t))===l||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function vs(t){var e=gs(t),r=e%1;return e==e?r?e-r:e:0}function ms(t){return t?cn(vs(t),0,d):0}function Cs(t){if("number"==typeof t)return t;if(ls(t))return p;if(ns(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=ns(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ye(t);var r=gt.test(t);return r||mt.test(t)?ce(t.slice(2),r?2:8):yt.test(t)?p:+t}function Es(t){return Oi(t,Us(t))}function Ss(t){return null==t?"":li(t)}var bs=Pi((function(t,e){if(Aa(e)||Yo(e))Oi(e,Ps(e),t);else for(var r in e)xt.call(e,r)&&rn(t,r,e[r])})),Ts=Pi((function(t,e){Oi(e,Us(e),t)})),Is=Pi((function(t,e,r,n){Oi(e,Us(e),t,n)})),As=Pi((function(t,e,r,n){Oi(e,Ps(e),t,n)})),ws=ia(un);var _s=Zn((function(t,e){t=_t(t);var n=-1,i=e.length,a=i>2?e[2]:r;for(a&&Sa(e[0],e[1],a)&&(i=1);++n<i;)for(var o=e[n],s=Us(o),u=-1,c=s.length;++u<c;){var f=s[u],l=t[f];(l===r||qo(l,Lt[f])&&!xt.call(t,f))&&(t[f]=o[f])}return t})),Bs=Zn((function(t){return t.push(r,ea),Ie(Ds,r,t)}));function Ns(t,e,n){var i=null==t?r:An(t,e);return i===r?n:i}function ks(t,e){return null!=t&&va(t,e,kn)}var Rs=qi((function(t,e,r){null!=e&&"function"!=typeof e.toString&&(e=Mt.call(e)),t[e]=r}),nu(ou)),Os=qi((function(t,e,r){null!=e&&"function"!=typeof e.toString&&(e=Mt.call(e)),xt.call(t,e)?t[e].push(r):t[e]=[r]}),fa),Ls=Zn(On);function Ps(t){return Yo(t)?$r(t):Vn(t)}function Us(t){return Yo(t)?$r(t,!0):Mn(t)}var xs=Pi((function(t,e,r){Gn(t,e,r)})),Ds=Pi((function(t,e,r,n){Gn(t,e,r,n)})),Vs=ia((function(t,e){var r={};if(null==t)return r;var n=!1;e=Oe(e,(function(e){return e=Si(e,t),n||(n=e.length>1),e})),Oi(t,oa(t),r),n&&(r=fn(r,7,ra));for(var i=e.length;i--;)pi(r,e[i]);return r}));var Ms=ia((function(t,e){return null==t?{}:function(t,e){return Hn(t,e,(function(e,r){return ks(t,r)}))}(t,e)}));function js(t,e){if(null==t)return{};var r=Oe(oa(t),(function(t){return[t]}));return e=fa(e),Hn(t,r,(function(t,r){return e(t,r[0])}))}var Fs=Zi(Ps),Ks=Zi(Us);function qs(t){return null==t?[]:$e(t,Ps(t))}var Gs=Vi((function(t,e,r){return e=e.toLowerCase(),t+(r?zs(e):e)}));function zs(t){return Js(Ss(t).toLowerCase())}function Ws(t){return(t=Ss(t))&&t.replace(Et,rr).replace(Zt,"")}var Hs=Vi((function(t,e,r){return t+(r?"-":"")+e.toLowerCase()})),Qs=Vi((function(t,e,r){return t+(r?" ":"")+e.toLowerCase()})),Ys=Di("toLowerCase");var Xs=Vi((function(t,e,r){return t+(r?"_":"")+e.toLowerCase()}));var $s=Vi((function(t,e,r){return t+(r?" ":"")+Js(e)}));var Zs=Vi((function(t,e,r){return t+(r?" ":"")+e.toUpperCase()})),Js=Di("toUpperCase");function tu(t,e,n){return t=Ss(t),(e=n?r:e)===r?function(t){return re.test(t)}(t)?function(t){return t.match(te)||[]}(t):function(t){return t.match(ft)||[]}(t):t.match(e)||[]}var eu=Zn((function(t,e){try{return Ie(t,r,e)}catch(t){return Jo(t)?t:new It(t)}})),ru=ia((function(t,e){return we(e,(function(e){e=Ma(e),sn(t,e,Oo(t[e],t))})),t}));function nu(t){return function(){return t}}var iu=Fi(),au=Fi(!0);function ou(t){return t}function su(t){return Dn("function"==typeof t?t:fn(t,1))}var uu=Zn((function(t,e){return function(r){return On(r,t,e)}})),cu=Zn((function(t,e){return function(r){return On(t,r,e)}}));function fu(t,e,r){var n=Ps(e),i=In(e,n);null!=r||ns(e)&&(i.length||!n.length)||(r=e,e=t,t=this,i=In(e,Ps(e)));var a=!(ns(r)&&"chain"in r&&!r.chain),o=ts(t);return we(i,(function(r){var n=e[r];t[r]=n,o&&(t.prototype[r]=function(){var e=this.__chain__;if(a||e){var r=t(this.__wrapped__),i=r.__actions__=Ri(this.__actions__);return i.push({func:n,args:arguments,thisArg:t}),r.__chain__=e,r}return n.apply(t,Le([this.value()],arguments))})})),t}function lu(){}var hu=zi(Oe),pu=zi(Be),du=zi(xe);function yu(t){return ba(t)?Ge(Ma(t)):function(t){return function(e){return An(e,t)}}(t)}var gu=Hi(),vu=Hi(!0);function mu(){return[]}function Cu(){return!1}var Eu=Gi((function(t,e){return t+e}),0),Su=Xi("ceil"),bu=Gi((function(t,e){return t/e}),1),Tu=Xi("floor");var Iu,Au=Gi((function(t,e){return t*e}),1),wu=Xi("round"),_u=Gi((function(t,e){return t-e}),0);return Fr.after=function(t,e){if("function"!=typeof e)throw new kt(n);return t=vs(t),function(){if(--t<1)return e.apply(this,arguments)}},Fr.ary=ko,Fr.assign=bs,Fr.assignIn=Ts,Fr.assignInWith=Is,Fr.assignWith=As,Fr.at=ws,Fr.before=Ro,Fr.bind=Oo,Fr.bindAll=ru,Fr.bindKey=Lo,Fr.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Ho(t)?t:[t]},Fr.chain=yo,Fr.chunk=function(t,e,n){e=(n?Sa(t,e,n):e===r)?1:Cr(vs(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var a=0,o=0,s=ot(ge(i/e));a<i;)s[o++]=ai(t,a,a+=e);return s},Fr.compact=function(t){for(var e=-1,r=null==t?0:t.length,n=0,i=[];++e<r;){var a=t[e];a&&(i[n++]=a)}return i},Fr.concat=function(){var t=arguments.length;if(!t)return[];for(var e=ot(t-1),r=arguments[0],n=t;n--;)e[n-1]=arguments[n];return Le(Ho(r)?Ri(r):[r],Cn(e,1))},Fr.cond=function(t){var e=null==t?0:t.length,r=fa();return t=e?Oe(t,(function(t){if("function"!=typeof t[1])throw new kt(n);return[r(t[0]),t[1]]})):[],Zn((function(r){for(var n=-1;++n<e;){var i=t[n];if(Ie(i[0],this,r))return Ie(i[1],this,r)}}))},Fr.conforms=function(t){return function(t){var e=Ps(t);return function(r){return ln(r,t,e)}}(fn(t,1))},Fr.constant=nu,Fr.countBy=mo,Fr.create=function(t,e){var r=Kr(t);return null==e?r:on(r,e)},Fr.curry=function t(e,n,i){var a=Ji(e,8,r,r,r,r,r,n=i?r:n);return a.placeholder=t.placeholder,a},Fr.curryRight=function t(e,n,i){var a=Ji(e,o,r,r,r,r,r,n=i?r:n);return a.placeholder=t.placeholder,a},Fr.debounce=Po,Fr.defaults=_s,Fr.defaultsDeep=Bs,Fr.defer=Uo,Fr.delay=xo,Fr.difference=Ka,Fr.differenceBy=qa,Fr.differenceWith=Ga,Fr.drop=function(t,e,n){var i=null==t?0:t.length;return i?ai(t,(e=n||e===r?1:vs(e))<0?0:e,i):[]},Fr.dropRight=function(t,e,n){var i=null==t?0:t.length;return i?ai(t,0,(e=i-(e=n||e===r?1:vs(e)))<0?0:e):[]},Fr.dropRightWhile=function(t,e){return t&&t.length?yi(t,fa(e,3),!0,!0):[]},Fr.dropWhile=function(t,e){return t&&t.length?yi(t,fa(e,3),!0):[]},Fr.fill=function(t,e,n,i){var a=null==t?0:t.length;return a?(n&&"number"!=typeof n&&Sa(t,e,n)&&(n=0,i=a),function(t,e,n,i){var a=t.length;for((n=vs(n))<0&&(n=-n>a?0:a+n),(i=i===r||i>a?a:vs(i))<0&&(i+=a),i=n>i?0:ms(i);n<i;)t[n++]=e;return t}(t,e,n,i)):[]},Fr.filter=function(t,e){return(Ho(t)?Ne:mn)(t,fa(e,3))},Fr.flatMap=function(t,e){return Cn(wo(t,e),1)},Fr.flatMapDeep=function(t,e){return Cn(wo(t,e),l)},Fr.flatMapDepth=function(t,e,n){return n=n===r?1:vs(n),Cn(wo(t,e),n)},Fr.flatten=Ha,Fr.flattenDeep=function(t){return(null==t?0:t.length)?Cn(t,l):[]},Fr.flattenDepth=function(t,e){return(null==t?0:t.length)?Cn(t,e=e===r?1:vs(e)):[]},Fr.flip=function(t){return Ji(t,512)},Fr.flow=iu,Fr.flowRight=au,Fr.fromPairs=function(t){for(var e=-1,r=null==t?0:t.length,n={};++e<r;){var i=t[e];n[i[0]]=i[1]}return n},Fr.functions=function(t){return null==t?[]:In(t,Ps(t))},Fr.functionsIn=function(t){return null==t?[]:In(t,Us(t))},Fr.groupBy=To,Fr.initial=function(t){return(null==t?0:t.length)?ai(t,0,-1):[]},Fr.intersection=Ya,Fr.intersectionBy=Xa,Fr.intersectionWith=$a,Fr.invert=Rs,Fr.invertBy=Os,Fr.invokeMap=Io,Fr.iteratee=su,Fr.keyBy=Ao,Fr.keys=Ps,Fr.keysIn=Us,Fr.map=wo,Fr.mapKeys=function(t,e){var r={};return e=fa(e,3),bn(t,(function(t,n,i){sn(r,e(t,n,i),t)})),r},Fr.mapValues=function(t,e){var r={};return e=fa(e,3),bn(t,(function(t,n,i){sn(r,n,e(t,n,i))})),r},Fr.matches=function(t){return Kn(fn(t,1))},Fr.matchesProperty=function(t,e){return qn(t,fn(e,1))},Fr.memoize=Do,Fr.merge=xs,Fr.mergeWith=Ds,Fr.method=uu,Fr.methodOf=cu,Fr.mixin=fu,Fr.negate=Vo,Fr.nthArg=function(t){return t=vs(t),Zn((function(e){return zn(e,t)}))},Fr.omit=Vs,Fr.omitBy=function(t,e){return js(t,Vo(fa(e)))},Fr.once=function(t){return Ro(2,t)},Fr.orderBy=function(t,e,n,i){return null==t?[]:(Ho(e)||(e=null==e?[]:[e]),Ho(n=i?r:n)||(n=null==n?[]:[n]),Wn(t,e,n))},Fr.over=hu,Fr.overArgs=Mo,Fr.overEvery=pu,Fr.overSome=du,Fr.partial=jo,Fr.partialRight=Fo,Fr.partition=_o,Fr.pick=Ms,Fr.pickBy=js,Fr.property=yu,Fr.propertyOf=function(t){return function(e){return null==t?r:An(t,e)}},Fr.pull=Ja,Fr.pullAll=to,Fr.pullAllBy=function(t,e,r){return t&&t.length&&e&&e.length?Qn(t,e,fa(r,2)):t},Fr.pullAllWith=function(t,e,n){return t&&t.length&&e&&e.length?Qn(t,e,r,n):t},Fr.pullAt=eo,Fr.range=gu,Fr.rangeRight=vu,Fr.rearg=Ko,Fr.reject=function(t,e){return(Ho(t)?Ne:mn)(t,Vo(fa(e,3)))},Fr.remove=function(t,e){var r=[];if(!t||!t.length)return r;var n=-1,i=[],a=t.length;for(e=fa(e,3);++n<a;){var o=t[n];e(o,n,t)&&(r.push(o),i.push(n))}return Yn(t,i),r},Fr.rest=function(t,e){if("function"!=typeof t)throw new kt(n);return Zn(t,e=e===r?e:vs(e))},Fr.reverse=ro,Fr.sampleSize=function(t,e,n){return e=(n?Sa(t,e,n):e===r)?1:vs(e),(Ho(t)?Jr:ti)(t,e)},Fr.set=function(t,e,r){return null==t?t:ei(t,e,r)},Fr.setWith=function(t,e,n,i){return i="function"==typeof i?i:r,null==t?t:ei(t,e,n,i)},Fr.shuffle=function(t){return(Ho(t)?tn:ii)(t)},Fr.slice=function(t,e,n){var i=null==t?0:t.length;return i?(n&&"number"!=typeof n&&Sa(t,e,n)?(e=0,n=i):(e=null==e?0:vs(e),n=n===r?i:vs(n)),ai(t,e,n)):[]},Fr.sortBy=Bo,Fr.sortedUniq=function(t){return t&&t.length?ci(t):[]},Fr.sortedUniqBy=function(t,e){return t&&t.length?ci(t,fa(e,2)):[]},Fr.split=function(t,e,n){return n&&"number"!=typeof n&&Sa(t,e,n)&&(e=n=r),(n=n===r?d:n>>>0)?(t=Ss(t))&&("string"==typeof e||null!=e&&!us(e))&&!(e=li(e))&&ar(t)?Ti(hr(t),0,n):t.split(e,n):[]},Fr.spread=function(t,e){if("function"!=typeof t)throw new kt(n);return e=null==e?0:Cr(vs(e),0),Zn((function(r){var n=r[e],i=Ti(r,0,e);return n&&Le(i,n),Ie(t,this,i)}))},Fr.tail=function(t){var e=null==t?0:t.length;return e?ai(t,1,e):[]},Fr.take=function(t,e,n){return t&&t.length?ai(t,0,(e=n||e===r?1:vs(e))<0?0:e):[]},Fr.takeRight=function(t,e,n){var i=null==t?0:t.length;return i?ai(t,(e=i-(e=n||e===r?1:vs(e)))<0?0:e,i):[]},Fr.takeRightWhile=function(t,e){return t&&t.length?yi(t,fa(e,3),!1,!0):[]},Fr.takeWhile=function(t,e){return t&&t.length?yi(t,fa(e,3)):[]},Fr.tap=function(t,e){return e(t),t},Fr.throttle=function(t,e,r){var i=!0,a=!0;if("function"!=typeof t)throw new kt(n);return ns(r)&&(i="leading"in r?!!r.leading:i,a="trailing"in r?!!r.trailing:a),Po(t,e,{leading:i,maxWait:e,trailing:a})},Fr.thru=go,Fr.toArray=ys,Fr.toPairs=Fs,Fr.toPairsIn=Ks,Fr.toPath=function(t){return Ho(t)?Oe(t,Ma):ls(t)?[t]:Ri(Va(Ss(t)))},Fr.toPlainObject=Es,Fr.transform=function(t,e,r){var n=Ho(t),i=n||$o(t)||hs(t);if(e=fa(e,4),null==r){var a=t&&t.constructor;r=i?n?new a:[]:ns(t)&&ts(a)?Kr(Ht(t)):{}}return(i?we:bn)(t,(function(t,n,i){return e(r,t,n,i)})),r},Fr.unary=function(t){return ko(t,1)},Fr.union=no,Fr.unionBy=io,Fr.unionWith=ao,Fr.uniq=function(t){return t&&t.length?hi(t):[]},Fr.uniqBy=function(t,e){return t&&t.length?hi(t,fa(e,2)):[]},Fr.uniqWith=function(t,e){return e="function"==typeof e?e:r,t&&t.length?hi(t,r,e):[]},Fr.unset=function(t,e){return null==t||pi(t,e)},Fr.unzip=oo,Fr.unzipWith=so,Fr.update=function(t,e,r){return null==t?t:di(t,e,Ei(r))},Fr.updateWith=function(t,e,n,i){return i="function"==typeof i?i:r,null==t?t:di(t,e,Ei(n),i)},Fr.values=qs,Fr.valuesIn=function(t){return null==t?[]:$e(t,Us(t))},Fr.without=uo,Fr.words=tu,Fr.wrap=function(t,e){return jo(Ei(e),t)},Fr.xor=co,Fr.xorBy=fo,Fr.xorWith=lo,Fr.zip=ho,Fr.zipObject=function(t,e){return mi(t||[],e||[],rn)},Fr.zipObjectDeep=function(t,e){return mi(t||[],e||[],ei)},Fr.zipWith=po,Fr.entries=Fs,Fr.entriesIn=Ks,Fr.extend=Ts,Fr.extendWith=Is,fu(Fr,Fr),Fr.add=Eu,Fr.attempt=eu,Fr.camelCase=Gs,Fr.capitalize=zs,Fr.ceil=Su,Fr.clamp=function(t,e,n){return n===r&&(n=e,e=r),n!==r&&(n=(n=Cs(n))==n?n:0),e!==r&&(e=(e=Cs(e))==e?e:0),cn(Cs(t),e,n)},Fr.clone=function(t){return fn(t,4)},Fr.cloneDeep=function(t){return fn(t,5)},Fr.cloneDeepWith=function(t,e){return fn(t,5,e="function"==typeof e?e:r)},Fr.cloneWith=function(t,e){return fn(t,4,e="function"==typeof e?e:r)},Fr.conformsTo=function(t,e){return null==e||ln(t,e,Ps(e))},Fr.deburr=Ws,Fr.defaultTo=function(t,e){return null==t||t!=t?e:t},Fr.divide=bu,Fr.endsWith=function(t,e,n){t=Ss(t),e=li(e);var i=t.length,a=n=n===r?i:cn(vs(n),0,i);return(n-=e.length)>=0&&t.slice(n,a)==e},Fr.eq=qo,Fr.escape=function(t){return(t=Ss(t))&&X.test(t)?t.replace(Q,nr):t},Fr.escapeRegExp=function(t){return(t=Ss(t))&&it.test(t)?t.replace(nt,"\\$&"):t},Fr.every=function(t,e,n){var i=Ho(t)?Be:gn;return n&&Sa(t,e,n)&&(e=r),i(t,fa(e,3))},Fr.find=Co,Fr.findIndex=za,Fr.findKey=function(t,e){return Ve(t,fa(e,3),bn)},Fr.findLast=Eo,Fr.findLastIndex=Wa,Fr.findLastKey=function(t,e){return Ve(t,fa(e,3),Tn)},Fr.floor=Tu,Fr.forEach=So,Fr.forEachRight=bo,Fr.forIn=function(t,e){return null==t?t:En(t,fa(e,3),Us)},Fr.forInRight=function(t,e){return null==t?t:Sn(t,fa(e,3),Us)},Fr.forOwn=function(t,e){return t&&bn(t,fa(e,3))},Fr.forOwnRight=function(t,e){return t&&Tn(t,fa(e,3))},Fr.get=Ns,Fr.gt=Go,Fr.gte=zo,Fr.has=function(t,e){return null!=t&&va(t,e,Nn)},Fr.hasIn=ks,Fr.head=Qa,Fr.identity=ou,Fr.includes=function(t,e,r,n){t=Yo(t)?t:qs(t),r=r&&!n?vs(r):0;var i=t.length;return r<0&&(r=Cr(i+r,0)),fs(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&je(t,e,r)>-1},Fr.indexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=null==r?0:vs(r);return i<0&&(i=Cr(n+i,0)),je(t,e,i)},Fr.inRange=function(t,e,n){return e=gs(e),n===r?(n=e,e=0):n=gs(n),function(t,e,r){return t>=Er(e,r)&&t<Cr(e,r)}(t=Cs(t),e,n)},Fr.invoke=Ls,Fr.isArguments=Wo,Fr.isArray=Ho,Fr.isArrayBuffer=Qo,Fr.isArrayLike=Yo,Fr.isArrayLikeObject=Xo,Fr.isBoolean=function(t){return!0===t||!1===t||is(t)&&_n(t)==m},Fr.isBuffer=$o,Fr.isDate=Zo,Fr.isElement=function(t){return is(t)&&1===t.nodeType&&!ss(t)},Fr.isEmpty=function(t){if(null==t)return!0;if(Yo(t)&&(Ho(t)||"string"==typeof t||"function"==typeof t.splice||$o(t)||hs(t)||Wo(t)))return!t.length;var e=ga(t);if(e==T||e==N)return!t.size;if(Aa(t))return!Vn(t).length;for(var r in t)if(xt.call(t,r))return!1;return!0},Fr.isEqual=function(t,e){return Pn(t,e)},Fr.isEqualWith=function(t,e,n){var i=(n="function"==typeof n?n:r)?n(t,e):r;return i===r?Pn(t,e,r,n):!!i},Fr.isError=Jo,Fr.isFinite=function(t){return"number"==typeof t&&gr(t)},Fr.isFunction=ts,Fr.isInteger=es,Fr.isLength=rs,Fr.isMap=as,Fr.isMatch=function(t,e){return t===e||Un(t,e,ha(e))},Fr.isMatchWith=function(t,e,n){return n="function"==typeof n?n:r,Un(t,e,ha(e),n)},Fr.isNaN=function(t){return os(t)&&t!=+t},Fr.isNative=function(t){if(Ia(t))throw new It("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return xn(t)},Fr.isNil=function(t){return null==t},Fr.isNull=function(t){return null===t},Fr.isNumber=os,Fr.isObject=ns,Fr.isObjectLike=is,Fr.isPlainObject=ss,Fr.isRegExp=us,Fr.isSafeInteger=function(t){return es(t)&&t>=-9007199254740991&&t<=h},Fr.isSet=cs,Fr.isString=fs,Fr.isSymbol=ls,Fr.isTypedArray=hs,Fr.isUndefined=function(t){return t===r},Fr.isWeakMap=function(t){return is(t)&&ga(t)==O},Fr.isWeakSet=function(t){return is(t)&&"[object WeakSet]"==_n(t)},Fr.join=function(t,e){return null==t?"":vr.call(t,e)},Fr.kebabCase=Hs,Fr.last=Za,Fr.lastIndexOf=function(t,e,n){var i=null==t?0:t.length;if(!i)return-1;var a=i;return n!==r&&(a=(a=vs(n))<0?Cr(i+a,0):Er(a,i-1)),e==e?function(t,e,r){for(var n=r+1;n--;)if(t[n]===e)return n;return n}(t,e,a):Me(t,Ke,a,!0)},Fr.lowerCase=Qs,Fr.lowerFirst=Ys,Fr.lt=ps,Fr.lte=ds,Fr.max=function(t){return t&&t.length?vn(t,ou,Bn):r},Fr.maxBy=function(t,e){return t&&t.length?vn(t,fa(e,2),Bn):r},Fr.mean=function(t){return qe(t,ou)},Fr.meanBy=function(t,e){return qe(t,fa(e,2))},Fr.min=function(t){return t&&t.length?vn(t,ou,jn):r},Fr.minBy=function(t,e){return t&&t.length?vn(t,fa(e,2),jn):r},Fr.stubArray=mu,Fr.stubFalse=Cu,Fr.stubObject=function(){return{}},Fr.stubString=function(){return""},Fr.stubTrue=function(){return!0},Fr.multiply=Au,Fr.nth=function(t,e){return t&&t.length?zn(t,vs(e)):r},Fr.noConflict=function(){return he._===this&&(he._=Ft),this},Fr.noop=lu,Fr.now=No,Fr.pad=function(t,e,r){t=Ss(t);var n=(e=vs(e))?lr(t):0;if(!e||n>=e)return t;var i=(e-n)/2;return Wi(ve(i),r)+t+Wi(ge(i),r)},Fr.padEnd=function(t,e,r){t=Ss(t);var n=(e=vs(e))?lr(t):0;return e&&n<e?t+Wi(e-n,r):t},Fr.padStart=function(t,e,r){t=Ss(t);var n=(e=vs(e))?lr(t):0;return e&&n<e?Wi(e-n,r)+t:t},Fr.parseInt=function(t,e,r){return r||null==e?e=0:e&&(e=+e),br(Ss(t).replace(at,""),e||0)},Fr.random=function(t,e,n){if(n&&"boolean"!=typeof n&&Sa(t,e,n)&&(e=n=r),n===r&&("boolean"==typeof e?(n=e,e=r):"boolean"==typeof t&&(n=t,t=r)),t===r&&e===r?(t=0,e=1):(t=gs(t),e===r?(e=t,t=0):e=gs(e)),t>e){var i=t;t=e,e=i}if(n||t%1||e%1){var a=Tr();return Er(t+a*(e-t+ue("1e-"+((a+"").length-1))),e)}return Xn(t,e)},Fr.reduce=function(t,e,r){var n=Ho(t)?Pe:We,i=arguments.length<3;return n(t,fa(e,4),r,i,dn)},Fr.reduceRight=function(t,e,r){var n=Ho(t)?Ue:We,i=arguments.length<3;return n(t,fa(e,4),r,i,yn)},Fr.repeat=function(t,e,n){return e=(n?Sa(t,e,n):e===r)?1:vs(e),$n(Ss(t),e)},Fr.replace=function(){var t=arguments,e=Ss(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Fr.result=function(t,e,n){var i=-1,a=(e=Si(e,t)).length;for(a||(a=1,t=r);++i<a;){var o=null==t?r:t[Ma(e[i])];o===r&&(i=a,o=n),t=ts(o)?o.call(t):o}return t},Fr.round=wu,Fr.runInContext=t,Fr.sample=function(t){return(Ho(t)?Zr:Jn)(t)},Fr.size=function(t){if(null==t)return 0;if(Yo(t))return fs(t)?lr(t):t.length;var e=ga(t);return e==T||e==N?t.size:Vn(t).length},Fr.snakeCase=Xs,Fr.some=function(t,e,n){var i=Ho(t)?xe:oi;return n&&Sa(t,e,n)&&(e=r),i(t,fa(e,3))},Fr.sortedIndex=function(t,e){return si(t,e)},Fr.sortedIndexBy=function(t,e,r){return ui(t,e,fa(r,2))},Fr.sortedIndexOf=function(t,e){var r=null==t?0:t.length;if(r){var n=si(t,e);if(n<r&&qo(t[n],e))return n}return-1},Fr.sortedLastIndex=function(t,e){return si(t,e,!0)},Fr.sortedLastIndexBy=function(t,e,r){return ui(t,e,fa(r,2),!0)},Fr.sortedLastIndexOf=function(t,e){if(null==t?0:t.length){var r=si(t,e,!0)-1;if(qo(t[r],e))return r}return-1},Fr.startCase=$s,Fr.startsWith=function(t,e,r){return t=Ss(t),r=null==r?0:cn(vs(r),0,t.length),e=li(e),t.slice(r,r+e.length)==e},Fr.subtract=_u,Fr.sum=function(t){return t&&t.length?He(t,ou):0},Fr.sumBy=function(t,e){return t&&t.length?He(t,fa(e,2)):0},Fr.template=function(t,e,n){var i=Fr.templateSettings;n&&Sa(t,e,n)&&(e=r),t=Ss(t),e=Is({},e,i,ta);var a,o,s=Is({},e.imports,i.imports,ta),u=Ps(s),c=$e(s,u),f=0,l=e.interpolate||St,h="__p += '",p=Bt((e.escape||St).source+"|"+l.source+"|"+(l===J?pt:St).source+"|"+(e.evaluate||St).source+"|$","g"),d="//# sourceURL="+(xt.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ie+"]")+"\n";t.replace(p,(function(e,r,n,i,s,u){return n||(n=i),h+=t.slice(f,u).replace(bt,ir),r&&(a=!0,h+="' +\n__e("+r+") +\n'"),s&&(o=!0,h+="';\n"+s+";\n__p += '"),n&&(h+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),f=u+e.length,e})),h+="';\n";var y=xt.call(e,"variable")&&e.variable;if(y){if(lt.test(y))throw new It("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(o?h.replace(G,""):h).replace(z,"$1").replace(W,"$1;"),h="function("+(y||"obj")+") {\n"+(y?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(a?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var g=eu((function(){return At(u,d+"return "+h).apply(r,c)}));if(g.source=h,Jo(g))throw g;return g},Fr.times=function(t,e){if((t=vs(t))<1||t>h)return[];var r=d,n=Er(t,d);e=fa(e),t-=d;for(var i=Qe(n,e);++r<t;)e(r);return i},Fr.toFinite=gs,Fr.toInteger=vs,Fr.toLength=ms,Fr.toLower=function(t){return Ss(t).toLowerCase()},Fr.toNumber=Cs,Fr.toSafeInteger=function(t){return t?cn(vs(t),-9007199254740991,h):0===t?t:0},Fr.toString=Ss,Fr.toUpper=function(t){return Ss(t).toUpperCase()},Fr.trim=function(t,e,n){if((t=Ss(t))&&(n||e===r))return Ye(t);if(!t||!(e=li(e)))return t;var i=hr(t),a=hr(e);return Ti(i,Je(i,a),tr(i,a)+1).join("")},Fr.trimEnd=function(t,e,n){if((t=Ss(t))&&(n||e===r))return t.slice(0,pr(t)+1);if(!t||!(e=li(e)))return t;var i=hr(t);return Ti(i,0,tr(i,hr(e))+1).join("")},Fr.trimStart=function(t,e,n){if((t=Ss(t))&&(n||e===r))return t.replace(at,"");if(!t||!(e=li(e)))return t;var i=hr(t);return Ti(i,Je(i,hr(e))).join("")},Fr.truncate=function(t,e){var n=30,i="...";if(ns(e)){var a="separator"in e?e.separator:a;n="length"in e?vs(e.length):n,i="omission"in e?li(e.omission):i}var o=(t=Ss(t)).length;if(ar(t)){var s=hr(t);o=s.length}if(n>=o)return t;var u=n-lr(i);if(u<1)return i;var c=s?Ti(s,0,u).join(""):t.slice(0,u);if(a===r)return c+i;if(s&&(u+=c.length-u),us(a)){if(t.slice(u).search(a)){var f,l=c;for(a.global||(a=Bt(a.source,Ss(dt.exec(a))+"g")),a.lastIndex=0;f=a.exec(l);)var h=f.index;c=c.slice(0,h===r?u:h)}}else if(t.indexOf(li(a),u)!=u){var p=c.lastIndexOf(a);p>-1&&(c=c.slice(0,p))}return c+i},Fr.unescape=function(t){return(t=Ss(t))&&Y.test(t)?t.replace(H,dr):t},Fr.uniqueId=function(t){var e=++Dt;return Ss(t)+e},Fr.upperCase=Zs,Fr.upperFirst=Js,Fr.each=So,Fr.eachRight=bo,Fr.first=Qa,fu(Fr,(Iu={},bn(Fr,(function(t,e){xt.call(Fr.prototype,e)||(Iu[e]=t)})),Iu),{chain:!1}),Fr.VERSION="4.17.21",we(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Fr[t].placeholder=Fr})),we(["drop","take"],(function(t,e){zr.prototype[t]=function(n){n=n===r?1:Cr(vs(n),0);var i=this.__filtered__&&!e?new zr(this):this.clone();return i.__filtered__?i.__takeCount__=Er(n,i.__takeCount__):i.__views__.push({size:Er(n,d),type:t+(i.__dir__<0?"Right":"")}),i},zr.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),we(["filter","map","takeWhile"],(function(t,e){var r=e+1,n=1==r||3==r;zr.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:fa(t,3),type:r}),e.__filtered__=e.__filtered__||n,e}})),we(["head","last"],(function(t,e){var r="take"+(e?"Right":"");zr.prototype[t]=function(){return this[r](1).value()[0]}})),we(["initial","tail"],(function(t,e){var r="drop"+(e?"":"Right");zr.prototype[t]=function(){return this.__filtered__?new zr(this):this[r](1)}})),zr.prototype.compact=function(){return this.filter(ou)},zr.prototype.find=function(t){return this.filter(t).head()},zr.prototype.findLast=function(t){return this.reverse().find(t)},zr.prototype.invokeMap=Zn((function(t,e){return"function"==typeof t?new zr(this):this.map((function(r){return On(r,t,e)}))})),zr.prototype.reject=function(t){return this.filter(Vo(fa(t)))},zr.prototype.slice=function(t,e){t=vs(t);var n=this;return n.__filtered__&&(t>0||e<0)?new zr(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==r&&(n=(e=vs(e))<0?n.dropRight(-e):n.take(e-t)),n)},zr.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},zr.prototype.toArray=function(){return this.take(d)},bn(zr.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),i=/^(?:head|last)$/.test(e),a=Fr[i?"take"+("last"==e?"Right":""):e],o=i||/^find/.test(e);a&&(Fr.prototype[e]=function(){var e=this.__wrapped__,s=i?[1]:arguments,u=e instanceof zr,c=s[0],f=u||Ho(e),l=function(t){var e=a.apply(Fr,Le([t],s));return i&&h?e[0]:e};f&&n&&"function"==typeof c&&1!=c.length&&(u=f=!1);var h=this.__chain__,p=!!this.__actions__.length,d=o&&!h,y=u&&!p;if(!o&&f){e=y?e:new zr(this);var g=t.apply(e,s);return g.__actions__.push({func:go,args:[l],thisArg:r}),new Gr(g,h)}return d&&y?t.apply(this,s):(g=this.thru(l),d?i?g.value()[0]:g.value():g)})})),we(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Rt[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);Fr.prototype[t]=function(){var t=arguments;if(n&&!this.__chain__){var i=this.value();return e.apply(Ho(i)?i:[],t)}return this[r]((function(r){return e.apply(Ho(r)?r:[],t)}))}})),bn(zr.prototype,(function(t,e){var r=Fr[e];if(r){var n=r.name+"";xt.call(Or,n)||(Or[n]=[]),Or[n].push({name:e,func:r})}})),Or[Ki(r,2).name]=[{name:"wrapper",func:r}],zr.prototype.clone=function(){var t=new zr(this.__wrapped__);return t.__actions__=Ri(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Ri(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Ri(this.__views__),t},zr.prototype.reverse=function(){if(this.__filtered__){var t=new zr(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},zr.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,r=Ho(t),n=e<0,i=r?t.length:0,a=function(t,e,r){var n=-1,i=r.length;for(;++n<i;){var a=r[n],o=a.size;switch(a.type){case"drop":t+=o;break;case"dropRight":e-=o;break;case"take":e=Er(e,t+o);break;case"takeRight":t=Cr(t,e-o)}}return{start:t,end:e}}(0,i,this.__views__),o=a.start,s=a.end,u=s-o,c=n?s:o-1,f=this.__iteratees__,l=f.length,h=0,p=Er(u,this.__takeCount__);if(!r||!n&&i==u&&p==u)return gi(t,this.__actions__);var d=[];t:for(;u--&&h<p;){for(var y=-1,g=t[c+=e];++y<l;){var v=f[y],m=v.iteratee,C=v.type,E=m(g);if(2==C)g=E;else if(!E){if(1==C)continue t;break t}}d[h++]=g}return d},Fr.prototype.at=vo,Fr.prototype.chain=function(){return yo(this)},Fr.prototype.commit=function(){return new Gr(this.value(),this.__chain__)},Fr.prototype.next=function(){this.__values__===r&&(this.__values__=ys(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?r:this.__values__[this.__index__++]}},Fr.prototype.plant=function(t){for(var e,n=this;n instanceof qr;){var i=Fa(n);i.__index__=0,i.__values__=r,e?a.__wrapped__=i:e=i;var a=i;n=n.__wrapped__}return a.__wrapped__=t,e},Fr.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof zr){var e=t;return this.__actions__.length&&(e=new zr(this)),(e=e.reverse()).__actions__.push({func:go,args:[ro],thisArg:r}),new Gr(e,this.__chain__)}return this.thru(ro)},Fr.prototype.toJSON=Fr.prototype.valueOf=Fr.prototype.value=function(){return gi(this.__wrapped__,this.__actions__)},Fr.prototype.first=Fr.prototype.head,ee&&(Fr.prototype[ee]=function(){return this}),Fr}();de?((de.exports=yr)._=yr,pe._=yr):he._=yr}).call(A)})),Lu=parseInt("0777",8),Pu=Uu.mkdirp=Uu.mkdirP=Uu;
/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/function Uu(t,e,r,n){"function"==typeof e?(r=e,e={}):e&&"object"==typeof e||(e={mode:e});var i=e.mode,a=e.fs||p.default;void 0===i&&(i=Lu),n||(n=null);var o=r||function(){};t=d.default.resolve(t),a.mkdir(t,i,(function(r){if(!r)return o(null,n=n||t);switch(r.code){case"ENOENT":if(d.default.dirname(t)===t)return o(r);Uu(d.default.dirname(t),e,(function(r,n){r?o(r,n):Uu(t,e,o,n)}));break;default:a.stat(t,(function(t,e){t||!e.isDirectory()?o(r,n):o(null,n)}))}}))}Uu.sync=function t(e,r,n){r&&"object"==typeof r||(r={mode:r});var i=r.mode,a=r.fs||p.default;void 0===i&&(i=Lu),n||(n=null),e=d.default.resolve(e);try{a.mkdirSync(e,i),n=n||e}catch(i){switch(i.code){case"ENOENT":n=t(d.default.dirname(e),r,n),t(e,r,n);break;default:var o;try{o=a.statSync(e)}catch(t){throw i}if(!o.isDirectory())throw i}}return n};var xu={options:{usePureJavaScript:!1}},Du={},Vu=Du,Mu={};Du.encode=function(t,e,r){if("string"!=typeof e)throw new TypeError('"alphabet" must be a string.');if(void 0!==r&&"number"!=typeof r)throw new TypeError('"maxline" must be a number.');var n="";if(t instanceof Uint8Array){var i=0,a=e.length,o=e.charAt(0),s=[0];for(i=0;i<t.length;++i){for(var u=0,c=t[i];u<s.length;++u)c+=s[u]<<8,s[u]=c%a,c=c/a|0;for(;c>0;)s.push(c%a),c=c/a|0}for(i=0;0===t[i]&&i<t.length-1;++i)n+=o;for(i=s.length-1;i>=0;--i)n+=e[s[i]]}else n=function(t,e){var r=0,n=e.length,i=e.charAt(0),a=[0];for(r=0;r<t.length();++r){for(var o=0,s=t.at(r);o<a.length;++o)s+=a[o]<<8,a[o]=s%n,s=s/n|0;for(;s>0;)a.push(s%n),s=s/n|0}var u="";for(r=0;0===t.at(r)&&r<t.length()-1;++r)u+=i;for(r=a.length-1;r>=0;--r)u+=e[a[r]];return u}(t,e);if(r){var f=new RegExp(".{1,"+r+"}","g");n=n.match(f).join("\r\n")}return n},Du.decode=function(t,e){if("string"!=typeof t)throw new TypeError('"input" must be a string.');if("string"!=typeof e)throw new TypeError('"alphabet" must be a string.');var r=Mu[e];if(!r){r=Mu[e]=[];for(var n=0;n<e.length;++n)r[e.charCodeAt(n)]=n}t=t.replace(/\s/g,"");var i=e.length,a=e.charAt(0),o=[0];for(n=0;n<t.length;n++){var s=r[t.charCodeAt(n)];if(void 0===s)return;for(var u=0,c=s;u<o.length;++u)c+=o[u]*i,o[u]=255&c,c>>=8;for(;c>0;)o.push(255&c),c>>=8}for(var f=0;t[f]===a&&f<t.length-1;++f)o.push(0);return"undefined"!=typeof Buffer?Buffer.from(o.reverse()):new Uint8Array(o.reverse())},w((function(t){var e=t.exports=xu.util=xu.util||{};function r(t){if(8!==t&&16!==t&&24!==t&&32!==t)throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}function n(t){if(this.data="",this.read=0,"string"==typeof t)this.data=t;else if(e.isArrayBuffer(t)||e.isArrayBufferView(t))if("undefined"!=typeof Buffer&&t instanceof Buffer)this.data=t.toString("binary");else{var r=new Uint8Array(t);try{this.data=String.fromCharCode.apply(null,r)}catch(t){for(var i=0;i<r.length;++i)this.putByte(r[i])}}else(t instanceof n||"object"==typeof t&&"string"==typeof t.data&&"number"==typeof t.read)&&(this.data=t.data,this.read=t.read);this._constructedStringLength=0}!function(){if("undefined"!=typeof process&&process.nextTick&&!process.browser)return e.nextTick=process.nextTick,void("function"==typeof setImmediate?e.setImmediate=setImmediate:e.setImmediate=e.nextTick);if("function"==typeof setImmediate)return e.setImmediate=function(){return setImmediate.apply(void 0,arguments)},void(e.nextTick=function(t){return setImmediate(t)});if(e.setImmediate=function(t){setTimeout(t,0)},"undefined"!=typeof window&&"function"==typeof window.postMessage){var t="forge.setImmediate",r=[];e.setImmediate=function(e){r.push(e),1===r.length&&window.postMessage(t,"*")},window.addEventListener("message",(function(e){if(e.source===window&&e.data===t){e.stopPropagation();var n=r.slice();r.length=0,n.forEach((function(t){t()}))}}),!0)}if("undefined"!=typeof MutationObserver){var n=Date.now(),i=!0,a=document.createElement("div");r=[];new MutationObserver((function(){var t=r.slice();r.length=0,t.forEach((function(t){t()}))})).observe(a,{attributes:!0});var o=e.setImmediate;e.setImmediate=function(t){Date.now()-n>15?(n=Date.now(),o(t)):(r.push(t),1===r.length&&a.setAttribute("a",i=!i))}}e.nextTick=e.setImmediate}(),e.isNodejs="undefined"!=typeof process&&process.versions&&process.versions.node,e.globalScope=e.isNodejs?A:"undefined"==typeof self?window:self,e.isArray=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},e.isArrayBuffer=function(t){return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer},e.isArrayBufferView=function(t){return t&&e.isArrayBuffer(t.buffer)&&void 0!==t.byteLength},e.ByteBuffer=n,e.ByteStringBuffer=n;e.ByteStringBuffer.prototype._optimizeConstructedString=function(t){this._constructedStringLength+=t,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},e.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},e.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},e.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))},e.ByteStringBuffer.prototype.fillWithByte=function(t,e){t=String.fromCharCode(t);for(var r=this.data;e>0;)1&e&&(r+=t),(e>>>=1)>0&&(t+=t);return this.data=r,this._optimizeConstructedString(e),this},e.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this},e.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(e.encodeUtf8(t))},e.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},e.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},e.ByteStringBuffer.prototype.putInt32=function(t){return this.putBytes(String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},e.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255))},e.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))},e.ByteStringBuffer.prototype.putInt32Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>24&255))},e.ByteStringBuffer.prototype.putInt=function(t,e){r(e);var n="";do{e-=8,n+=String.fromCharCode(t>>e&255)}while(e>0);return this.putBytes(n)},e.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<<e-1),this.putInt(t,e)},e.ByteStringBuffer.prototype.putBuffer=function(t){return this.putBytes(t.getBytes())},e.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},e.ByteStringBuffer.prototype.getInt16=function(){var t=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,t},e.ByteStringBuffer.prototype.getInt24=function(){var t=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,t},e.ByteStringBuffer.prototype.getInt32=function(){var t=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,t},e.ByteStringBuffer.prototype.getInt16Le=function(){var t=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,t},e.ByteStringBuffer.prototype.getInt24Le=function(){var t=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,t},e.ByteStringBuffer.prototype.getInt32Le=function(){var t=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,t},e.ByteStringBuffer.prototype.getInt=function(t){r(t);var e=0;do{e=(e<<8)+this.data.charCodeAt(this.read++),t-=8}while(t>0);return e},e.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<<t-2;return e>=r&&(e-=r<<1),e},e.ByteStringBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):0===t?e="":(e=0===this.read?this.data:this.data.slice(this.read),this.clear()),e},e.ByteStringBuffer.prototype.bytes=function(t){return void 0===t?this.data.slice(this.read):this.data.slice(this.read,this.read+t)},e.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)},e.ByteStringBuffer.prototype.setAt=function(t,e){return this.data=this.data.substr(0,this.read+t)+String.fromCharCode(e)+this.data.substr(this.read+t+1),this},e.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},e.ByteStringBuffer.prototype.copy=function(){var t=e.createBuffer(this.data);return t.read=this.read,t},e.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},e.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},e.ByteStringBuffer.prototype.truncate=function(t){var e=Math.max(0,this.length()-t);return this.data=this.data.substr(this.read,e),this.read=0,this},e.ByteStringBuffer.prototype.toHex=function(){for(var t="",e=this.read;e<this.data.length;++e){var r=this.data.charCodeAt(e);r<16&&(t+="0"),t+=r.toString(16)}return t},e.ByteStringBuffer.prototype.toString=function(){return e.decodeUtf8(this.bytes())},e.DataBuffer=function(t,r){r=r||{},this.read=r.readOffset||0,this.growSize=r.growSize||1024;var n=e.isArrayBuffer(t),i=e.isArrayBufferView(t);if(n||i)return this.data=n?new DataView(t):new DataView(t.buffer,t.byteOffset,t.byteLength),void(this.write="writeOffset"in r?r.writeOffset:this.data.byteLength);this.data=new DataView(new ArrayBuffer(0)),this.write=0,null!=t&&this.putBytes(t),"writeOffset"in r&&(this.write=r.writeOffset)},e.DataBuffer.prototype.length=function(){return this.write-this.read},e.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},e.DataBuffer.prototype.accommodate=function(t,e){if(this.length()>=t)return this;e=Math.max(e||this.growSize,t);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+e);return n.set(r),this.data=new DataView(n.buffer),this},e.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this},e.DataBuffer.prototype.fillWithByte=function(t,e){this.accommodate(e);for(var r=0;r<e;++r)this.data.setUint8(t);return this},e.DataBuffer.prototype.putBytes=function(t,r){if(e.isArrayBufferView(t)){var n=(i=new Uint8Array(t.buffer,t.byteOffset,t.byteLength)).byteLength-i.byteOffset;return this.accommodate(n),new Uint8Array(this.data.buffer,this.write).set(i),this.write+=n,this}if(e.isArrayBuffer(t)){var i=new Uint8Array(t);return this.accommodate(i.byteLength),new Uint8Array(this.data.buffer).set(i,this.write),this.write+=i.byteLength,this}if(t instanceof e.DataBuffer||"object"==typeof t&&"number"==typeof t.read&&"number"==typeof t.write&&e.isArrayBufferView(t.data)){i=new Uint8Array(t.data.byteLength,t.read,t.length());return this.accommodate(i.byteLength),new Uint8Array(t.data.byteLength,this.write).set(i),this.write+=i.byteLength,this}if(t instanceof e.ByteStringBuffer&&(t=t.data,r="binary"),r=r||"binary","string"==typeof t){var a;if("hex"===r)return this.accommodate(Math.ceil(t.length/2)),a=new Uint8Array(this.data.buffer,this.write),this.write+=e.binary.hex.decode(t,a,this.write),this;if("base64"===r)return this.accommodate(3*Math.ceil(t.length/4)),a=new Uint8Array(this.data.buffer,this.write),this.write+=e.binary.base64.decode(t,a,this.write),this;if("utf8"===r&&(t=e.encodeUtf8(t),r="binary"),"binary"===r||"raw"===r)return this.accommodate(t.length),a=new Uint8Array(this.data.buffer,this.write),this.write+=e.binary.raw.decode(a),this;if("utf16"===r)return this.accommodate(2*t.length),a=new Uint16Array(this.data.buffer,this.write),this.write+=e.text.utf16.encode(a),this;throw new Error("Invalid encoding: "+r)}throw Error("Invalid parameter: "+t)},e.DataBuffer.prototype.putBuffer=function(t){return this.putBytes(t),t.clear(),this},e.DataBuffer.prototype.putString=function(t){return this.putBytes(t,"utf16")},e.DataBuffer.prototype.putInt16=function(t){return this.accommodate(2),this.data.setInt16(this.write,t),this.write+=2,this},e.DataBuffer.prototype.putInt24=function(t){return this.accommodate(3),this.data.setInt16(this.write,t>>8&65535),this.data.setInt8(this.write,t>>16&255),this.write+=3,this},e.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this},e.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this},e.DataBuffer.prototype.putInt24Le=function(t){return this.accommodate(3),this.data.setInt8(this.write,t>>16&255),this.data.setInt16(this.write,t>>8&65535,!0),this.write+=3,this},e.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this},e.DataBuffer.prototype.putInt=function(t,e){r(e),this.accommodate(e/8);do{e-=8,this.data.setInt8(this.write++,t>>e&255)}while(e>0);return this},e.DataBuffer.prototype.putSignedInt=function(t,e){return r(e),this.accommodate(e/8),t<0&&(t+=2<<e-1),this.putInt(t,e)},e.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},e.DataBuffer.prototype.getInt16=function(){var t=this.data.getInt16(this.read);return this.read+=2,t},e.DataBuffer.prototype.getInt24=function(){var t=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,t},e.DataBuffer.prototype.getInt32=function(){var t=this.data.getInt32(this.read);return this.read+=4,t},e.DataBuffer.prototype.getInt16Le=function(){var t=this.data.getInt16(this.read,!0);return this.read+=2,t},e.DataBuffer.prototype.getInt24Le=function(){var t=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,t},e.DataBuffer.prototype.getInt32Le=function(){var t=this.data.getInt32(this.read,!0);return this.read+=4,t},e.DataBuffer.prototype.getInt=function(t){r(t);var e=0;do{e=(e<<8)+this.data.getInt8(this.read++),t-=8}while(t>0);return e},e.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<<t-2;return e>=r&&(e-=r<<1),e},e.DataBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):0===t?e="":(e=0===this.read?this.data:this.data.slice(this.read),this.clear()),e},e.DataBuffer.prototype.bytes=function(t){return void 0===t?this.data.slice(this.read):this.data.slice(this.read,this.read+t)},e.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)},e.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this},e.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},e.DataBuffer.prototype.copy=function(){return new e.DataBuffer(this)},e.DataBuffer.prototype.compact=function(){if(this.read>0){var t=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(t.byteLength);e.set(t),this.data=new DataView(e),this.write-=this.read,this.read=0}return this},e.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},e.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this},e.DataBuffer.prototype.toHex=function(){for(var t="",e=this.read;e<this.data.byteLength;++e){var r=this.data.getUint8(e);r<16&&(t+="0"),t+=r.toString(16)}return t},e.DataBuffer.prototype.toString=function(t){var r=new Uint8Array(this.data,this.read,this.length());if("binary"===(t=t||"utf8")||"raw"===t)return e.binary.raw.encode(r);if("hex"===t)return e.binary.hex.encode(r);if("base64"===t)return e.binary.base64.encode(r);if("utf8"===t)return e.text.utf8.decode(r);if("utf16"===t)return e.text.utf16.decode(r);throw new Error("Invalid encoding: "+t)},e.createBuffer=function(t,r){return r=r||"raw",void 0!==t&&"utf8"===r&&(t=e.encodeUtf8(t)),new e.ByteBuffer(t)},e.fillString=function(t,e){for(var r="";e>0;)1&e&&(r+=t),(e>>>=1)>0&&(t+=t);return r},e.xorBytes=function(t,e,r){for(var n="",i="",a="",o=0,s=0;r>0;--r,++o)i=t.charCodeAt(o)^e.charCodeAt(o),s>=10&&(n+=a,a="",s=0),a+=String.fromCharCode(i),++s;return n+=a},e.hexToBytes=function(t){var e="",r=0;for(!0&t.length&&(r=1,e+=String.fromCharCode(parseInt(t[0],16)));r<t.length;r+=2)e+=String.fromCharCode(parseInt(t.substr(r,2),16));return e},e.bytesToHex=function(t){return e.createBuffer(t).toHex()},e.int32ToBytes=function(t){return String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t)};var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],o="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";e.encode64=function(t,e){for(var r,n,a,o="",s="",u=0;u<t.length;)r=t.charCodeAt(u++),n=t.charCodeAt(u++),a=t.charCodeAt(u++),o+=i.charAt(r>>2),o+=i.charAt((3&r)<<4|n>>4),isNaN(n)?o+="==":(o+=i.charAt((15&n)<<2|a>>6),o+=isNaN(a)?"=":i.charAt(63&a)),e&&o.length>e&&(s+=o.substr(0,e)+"\r\n",o=o.substr(e));return s+=o},e.decode64=function(t){t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e,r,n,i,o="",s=0;s<t.length;)e=a[t.charCodeAt(s++)-43],r=a[t.charCodeAt(s++)-43],n=a[t.charCodeAt(s++)-43],i=a[t.charCodeAt(s++)-43],o+=String.fromCharCode(e<<2|r>>4),64!==n&&(o+=String.fromCharCode((15&r)<<4|n>>2),64!==i&&(o+=String.fromCharCode((3&n)<<6|i)));return o},e.encodeUtf8=function(t){return unescape(encodeURIComponent(t))},e.decodeUtf8=function(t){return decodeURIComponent(escape(t))},e.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:Vu.encode,decode:Vu.decode}},e.binary.raw.encode=function(t){return String.fromCharCode.apply(null,t)},e.binary.raw.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(t.length));for(var i=r=r||0,a=0;a<t.length;++a)n[i++]=t.charCodeAt(a);return e?i-r:n},e.binary.hex.encode=e.bytesToHex,e.binary.hex.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(Math.ceil(t.length/2)));var i=0,a=r=r||0;for(1&t.length&&(i=1,n[a++]=parseInt(t[0],16));i<t.length;i+=2)n[a++]=parseInt(t.substr(i,2),16);return e?a-r:n},e.binary.base64.encode=function(t,e){for(var r,n,a,o="",s="",u=0;u<t.byteLength;)r=t[u++],n=t[u++],a=t[u++],o+=i.charAt(r>>2),o+=i.charAt((3&r)<<4|n>>4),isNaN(n)?o+="==":(o+=i.charAt((15&n)<<2|a>>6),o+=isNaN(a)?"=":i.charAt(63&a)),e&&o.length>e&&(s+=o.substr(0,e)+"\r\n",o=o.substr(e));return s+=o},e.binary.base64.decode=function(t,e,r){var n,i,o,s,u=e;u||(u=new Uint8Array(3*Math.ceil(t.length/4))),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var c=0,f=r=r||0;c<t.length;)n=a[t.charCodeAt(c++)-43],i=a[t.charCodeAt(c++)-43],o=a[t.charCodeAt(c++)-43],s=a[t.charCodeAt(c++)-43],u[f++]=n<<2|i>>4,64!==o&&(u[f++]=(15&i)<<4|o>>2,64!==s&&(u[f++]=(3&o)<<6|s));return e?f-r:u.subarray(0,f)},e.binary.base58.encode=function(t,r){return e.binary.baseN.encode(t,o,r)},e.binary.base58.decode=function(t,r){return e.binary.baseN.decode(t,o,r)},e.text={utf8:{},utf16:{}},e.text.utf8.encode=function(t,r,n){t=e.encodeUtf8(t);var i=r;i||(i=new Uint8Array(t.length));for(var a=n=n||0,o=0;o<t.length;++o)i[a++]=t.charCodeAt(o);return r?a-n:i},e.text.utf8.decode=function(t){return e.decodeUtf8(String.fromCharCode.apply(null,t))},e.text.utf16.encode=function(t,e,r){var n=e;n||(n=new Uint8Array(2*t.length));for(var i=new Uint16Array(n.buffer),a=r=r||0,o=r,s=0;s<t.length;++s)i[o++]=t.charCodeAt(s),a+=2;return e?a-r:n},e.text.utf16.decode=function(t){return String.fromCharCode.apply(null,new Uint16Array(t.buffer))},e.deflate=function(t,r,n){if(r=e.decode64(t.deflate(e.encode64(r)).rval),n){var i=2;32&r.charCodeAt(1)&&(i=6),r=r.substring(i,r.length-4)}return r},e.inflate=function(t,r,n){var i=t.inflate(e.encode64(r)).rval;return null===i?null:e.decode64(i)};var s=function(t,r,n){if(!t)throw new Error("WebStorage not available.");var i;if(null===n?i=t.removeItem(r):(n=e.encode64(JSON.stringify(n)),i=t.setItem(r,n)),void 0!==i&&!0!==i.rval){var a=new Error(i.error.message);throw a.id=i.error.id,a.name=i.error.name,a}},u=function(t,r){if(!t)throw new Error("WebStorage not available.");var n=t.getItem(r);if(t.init)if(null===n.rval){if(n.error){var i=new Error(n.error.message);throw i.id=n.error.id,i.name=n.error.name,i}n=null}else n=n.rval;return null!==n&&(n=JSON.parse(e.decode64(n))),n},c=function(t,e,r,n){var i=u(t,e);null===i&&(i={}),i[r]=n,s(t,e,i)},f=function(t,e,r){var n=u(t,e);return null!==n&&(n=r in n?n[r]:null),n},l=function(t,e,r){var n=u(t,e);if(null!==n&&r in n){delete n[r];var i=!0;for(var a in n){i=!1;break}i&&(n=null),s(t,e,n)}},h=function(t,e){s(t,e,null)},p=function(t,e,r){var n,i=null;void 0===r&&(r=["web","flash"]);var a=!1,o=null;for(var s in r){n=r[s];try{if("flash"===n||"both"===n){if(null===e[0])throw new Error("Flash local storage not available.");i=t.apply(this,e),a="flash"===n}"web"!==n&&"both"!==n||(e[0]=localStorage,i=t.apply(this,e),a=!0)}catch(t){o=t}if(a)break}if(!a)throw o;return i};e.setItem=function(t,e,r,n,i){p(c,arguments,i)},e.getItem=function(t,e,r,n){return p(f,arguments,n)},e.removeItem=function(t,e,r,n){p(l,arguments,n)},e.clearItems=function(t,e,r){p(h,arguments,r)},e.parseUrl=function(t){var e=/^(https?):\/\/([^:&^\/]*):?(\d*)(.*)$/g;e.lastIndex=0;var r=e.exec(t),n=null===r?null:{full:t,scheme:r[1],host:r[2],port:r[3],path:r[4]};return n&&(n.fullHost=n.host,n.port?(80!==n.port&&"http"===n.scheme||443!==n.port&&"https"===n.scheme)&&(n.fullHost+=":"+n.port):"http"===n.scheme?n.port=80:"https"===n.scheme&&(n.port=443),n.full=n.scheme+"://"+n.fullHost),n};var d=null;e.getQueryVariables=function(t){var e,r=function(t){for(var e={},r=t.split("&"),n=0;n<r.length;n++){var i,a,o=r[n].indexOf("=");o>0?(i=r[n].substring(0,o),a=r[n].substring(o+1)):(i=r[n],a=null),i in e||(e[i]=[]),i in Object.prototype||null===a||e[i].push(unescape(a))}return e};return void 0===t?(null===d&&(d="undefined"!=typeof window&&window.location&&window.location.search?r(window.location.search.substring(1)):{}),e=d):e=r(t),e},e.parseFragment=function(t){var r=t,n="",i=t.indexOf("?");i>0&&(r=t.substring(0,i),n=t.substring(i+1));var a=r.split("/");return a.length>0&&""===a[0]&&a.shift(),{pathString:r,queryString:n,path:a,query:""===n?{}:e.getQueryVariables(n)}},e.makeRequest=function(t){var r=e.parseFragment(t),n={path:r.pathString,query:r.queryString,getPath:function(t){return void 0===t?r.path:r.path[t]},getQuery:function(t,e){var n;return void 0===t?n=r.query:(n=r.query[t])&&void 0!==e&&(n=n[e]),n},getQueryLast:function(t,e){var r=n.getQuery(t);return r?r[r.length-1]:e}};return n},e.makeLink=function(t,e,r){t=jQuery.isArray(t)?t.join("/"):t;var n=jQuery.param(e||{});return r=r||"",t+(n.length>0?"?"+n:"")+(r.length>0?"#"+r:"")},e.isEmpty=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0},e.format=function(t){for(var e,r,n=/%./g,i=0,a=[],o=0;e=n.exec(t);){(r=t.substring(o,n.lastIndex-2)).length>0&&a.push(r),o=n.lastIndex;var s=e[0][1];switch(s){case"s":case"o":i<arguments.length?a.push(arguments[1+i++]):a.push("<?>");break;case"%":a.push("%");break;default:a.push("<%"+s+"?>")}}return a.push(t.substring(o)),a.join("")},e.formatNumber=function(t,e,r,n){var i=t,a=isNaN(e=Math.abs(e))?2:e,o=void 0===r?",":r,s=void 0===n?".":n,u=i<0?"-":"",c=parseInt(i=Math.abs(+i||0).toFixed(a),10)+"",f=c.length>3?c.length%3:0;return u+(f?c.substr(0,f)+s:"")+c.substr(f).replace(/(\d{3})(?=\d)/g,"$1"+s)+(a?o+Math.abs(i-c).toFixed(a).slice(2):"")},e.formatSize=function(t){return t=t>=1073741824?e.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?e.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?e.formatNumber(t/1024,0)+" KiB":e.formatNumber(t,0)+" bytes"},e.bytesFromIP=function(t){return-1!==t.indexOf(".")?e.bytesFromIPv4(t):-1!==t.indexOf(":")?e.bytesFromIPv6(t):null},e.bytesFromIPv4=function(t){if(4!==(t=t.split(".")).length)return null;for(var r=e.createBuffer(),n=0;n<t.length;++n){var i=parseInt(t[n],10);if(isNaN(i))return null;r.putByte(i)}return r.getBytes()},e.bytesFromIPv6=function(t){for(var r=0,n=2*(8-(t=t.split(":").filter((function(t){return 0===t.length&&++r,!0}))).length+r),i=e.createBuffer(),a=0;a<8;++a)if(t[a]&&0!==t[a].length){var o=e.hexToBytes(t[a]);o.length<2&&i.putByte(0),i.putBytes(o)}else i.fillWithByte(0,n),n=0;return i.getBytes()},e.bytesToIP=function(t){return 4===t.length?e.bytesToIPv4(t):16===t.length?e.bytesToIPv6(t):null},e.bytesToIPv4=function(t){if(4!==t.length)return null;for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r));return e.join(".")},e.bytesToIPv6=function(t){if(16!==t.length)return null;for(var r=[],n=[],i=0,a=0;a<t.length;a+=2){for(var o=e.bytesToHex(t[a]+t[a+1]);"0"===o[0]&&"0"!==o;)o=o.substr(1);if("0"===o){var s=n[n.length-1],u=r.length;s&&u===s.end+1?(s.end=u,s.end-s.start>n[i].end-n[i].start&&(i=n.length-1)):n.push({start:u,end:u})}r.push(o)}if(n.length>0){var c=n[i];c.end-c.start>0&&(r.splice(c.start,c.end-c.start+1,""),0===c.start&&r.unshift(""),7===c.end&&r.push(""))}return r.join(":")},e.estimateCores=function(t,r){if("function"==typeof t&&(r=t,t={}),t=t||{},"cores"in e&&!t.update)return r(null,e.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return e.cores=navigator.hardwareConcurrency,r(null,e.cores);if("undefined"==typeof Worker)return e.cores=1,r(null,e.cores);if("undefined"==typeof Blob)return e.cores=2,r(null,e.cores);var n=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",(function(t){var e=Date.now(),r=e+4;self.postMessage({st:e,et:r})}))}.toString(),")()"],{type:"application/javascript"}));!function t(i,a,o){if(0===a){var s=Math.floor(i.reduce((function(t,e){return t+e}),0)/i.length);return e.cores=Math.max(1,s),URL.revokeObjectURL(n),r(null,e.cores)}!function(t,e){for(var r=[],i=[],a=0;a<t;++a){var o=new Worker(n);o.addEventListener("message",(function(n){if(i.push(n.data),i.length===t){for(var a=0;a<t;++a)r[a].terminate();e(null,i)}})),r.push(o)}for(a=0;a<t;++a)r[a].postMessage(a)}(o,(function(e,r){i.push(function(t,e){for(var r=[],n=0;n<t;++n)for(var i=e[n],a=r[n]=[],o=0;o<t;++o)if(n!==o){var s=e[o];(i.st>s.st&&i.st<s.et||s.st>i.st&&s.st<i.et)&&a.push(o)}return r.reduce((function(t,e){return Math.max(t,e.length)}),0)}(o,r)),t(i,a-1,o)}))}([],5,16)}})),w((function(t){xu.pki=xu.pki||{};var e=t.exports=xu.pki.oids=xu.oids=xu.oids||{};function r(t,r){e[t]=r,e[r]=t}function n(t,r){e[t]=r}r("1.2.840.113549.1.1.1","rsaEncryption"),r("1.2.840.113549.1.1.4","md5WithRSAEncryption"),r("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),r("1.2.840.113549.1.1.7","RSAES-OAEP"),r("1.2.840.113549.1.1.8","mgf1"),r("1.2.840.113549.1.1.9","pSpecified"),r("1.2.840.113549.1.1.10","RSASSA-PSS"),r("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),r("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),r("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),r("1.3.101.112","EdDSA25519"),r("1.2.840.10040.4.3","dsa-with-sha1"),r("1.3.14.3.2.7","desCBC"),r("1.3.14.3.2.26","sha1"),r("2.16.840.1.101.3.4.2.1","sha256"),r("2.16.840.1.101.3.4.2.2","sha384"),r("2.16.840.1.101.3.4.2.3","sha512"),r("1.2.840.113549.2.5","md5"),r("1.2.840.113549.1.7.1","data"),r("1.2.840.113549.1.7.2","signedData"),r("1.2.840.113549.1.7.3","envelopedData"),r("1.2.840.113549.1.7.4","signedAndEnvelopedData"),r("1.2.840.113549.1.7.5","digestedData"),r("1.2.840.113549.1.7.6","encryptedData"),r("1.2.840.113549.1.9.1","emailAddress"),r("1.2.840.113549.1.9.2","unstructuredName"),r("1.2.840.113549.1.9.3","contentType"),r("1.2.840.113549.1.9.4","messageDigest"),r("1.2.840.113549.1.9.5","signingTime"),r("1.2.840.113549.1.9.6","counterSignature"),r("1.2.840.113549.1.9.7","challengePassword"),r("1.2.840.113549.1.9.8","unstructuredAddress"),r("1.2.840.113549.1.9.14","extensionRequest"),r("1.2.840.113549.1.9.20","friendlyName"),r("1.2.840.113549.1.9.21","localKeyId"),r("1.2.840.113549.1.9.22.1","x509Certificate"),r("1.2.840.113549.1.12.10.1.1","keyBag"),r("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),r("1.2.840.113549.1.12.10.1.3","certBag"),r("1.2.840.113549.1.12.10.1.4","crlBag"),r("1.2.840.113549.1.12.10.1.5","secretBag"),r("1.2.840.113549.1.12.10.1.6","safeContentsBag"),r("1.2.840.113549.1.5.13","pkcs5PBES2"),r("1.2.840.113549.1.5.12","pkcs5PBKDF2"),r("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),r("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),r("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),r("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),r("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),r("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),r("1.2.840.113549.2.7","hmacWithSHA1"),r("1.2.840.113549.2.8","hmacWithSHA224"),r("1.2.840.113549.2.9","hmacWithSHA256"),r("1.2.840.113549.2.10","hmacWithSHA384"),r("1.2.840.113549.2.11","hmacWithSHA512"),r("1.2.840.113549.3.7","des-EDE3-CBC"),r("2.16.840.1.101.3.4.1.2","aes128-CBC"),r("2.16.840.1.101.3.4.1.22","aes192-CBC"),r("2.16.840.1.101.3.4.1.42","aes256-CBC"),r("2.5.4.3","commonName"),r("2.5.4.5","serialName"),r("2.5.4.6","countryName"),r("2.5.4.7","localityName"),r("2.5.4.8","stateOrProvinceName"),r("2.5.4.9","streetAddress"),r("2.5.4.10","organizationName"),r("2.5.4.11","organizationalUnitName"),r("2.5.4.13","description"),r("2.5.4.15","businessCategory"),r("2.5.4.17","postalCode"),r("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),r("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),r("2.16.840.1.113730.1.1","nsCertType"),r("2.16.840.1.113730.1.13","nsComment"),n("2.5.29.1","authorityKeyIdentifier"),n("2.5.29.2","keyAttributes"),n("2.5.29.3","certificatePolicies"),n("2.5.29.4","keyUsageRestriction"),n("2.5.29.5","policyMapping"),n("2.5.29.6","subtreesConstraint"),n("2.5.29.7","subjectAltName"),n("2.5.29.8","issuerAltName"),n("2.5.29.9","subjectDirectoryAttributes"),n("2.5.29.10","basicConstraints"),n("2.5.29.11","nameConstraints"),n("2.5.29.12","policyConstraints"),n("2.5.29.13","basicConstraints"),r("2.5.29.14","subjectKeyIdentifier"),r("2.5.29.15","keyUsage"),n("2.5.29.16","privateKeyUsagePeriod"),r("2.5.29.17","subjectAltName"),r("2.5.29.18","issuerAltName"),r("2.5.29.19","basicConstraints"),n("2.5.29.20","cRLNumber"),n("2.5.29.21","cRLReason"),n("2.5.29.22","expirationDate"),n("2.5.29.23","instructionCode"),n("2.5.29.24","invalidityDate"),n("2.5.29.25","cRLDistributionPoints"),n("2.5.29.26","issuingDistributionPoint"),n("2.5.29.27","deltaCRLIndicator"),n("2.5.29.28","issuingDistributionPoint"),n("2.5.29.29","certificateIssuer"),n("2.5.29.30","nameConstraints"),r("2.5.29.31","cRLDistributionPoints"),r("2.5.29.32","certificatePolicies"),n("2.5.29.33","policyMappings"),n("2.5.29.34","policyConstraints"),r("2.5.29.35","authorityKeyIdentifier"),n("2.5.29.36","policyConstraints"),r("2.5.29.37","extKeyUsage"),n("2.5.29.46","freshestCRL"),n("2.5.29.54","inhibitAnyPolicy"),r("1.3.6.1.4.1.11129.2.4.2","timestampList"),r("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),r("1.3.6.1.5.5.7.3.1","serverAuth"),r("1.3.6.1.5.5.7.3.2","clientAuth"),r("1.3.6.1.5.5.7.3.3","codeSigning"),r("1.3.6.1.5.5.7.3.4","emailProtection"),r("1.3.6.1.5.5.7.3.8","timeStamping")}));var ju=w((function(t){var e=t.exports=xu.asn1=xu.asn1||{};function r(t,e,r){if(r>e){var n=new Error("Too few bytes to parse DER.");throw n.available=t.length(),n.remaining=e,n.requested=r,n}}e.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},e.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},e.create=function(t,r,n,i,a){if(xu.util.isArray(i)){for(var o=[],s=0;s<i.length;++s)void 0!==i[s]&&o.push(i[s]);i=o}var u={tagClass:t,type:r,constructed:n,composed:n||xu.util.isArray(i),value:i};return a&&"bitStringContents"in a&&(u.bitStringContents=a.bitStringContents,u.original=e.copy(u)),u},e.copy=function(t,r){var n;if(xu.util.isArray(t)){n=[];for(var i=0;i<t.length;++i)n.push(e.copy(t[i],r));return n}return"string"==typeof t?t:(n={tagClass:t.tagClass,type:t.type,constructed:t.constructed,composed:t.composed,value:e.copy(t.value,r)},r&&!r.excludeBitStringContents&&(n.bitStringContents=t.bitStringContents),n)},e.equals=function(t,r,n){if(xu.util.isArray(t)){if(!xu.util.isArray(r))return!1;if(t.length!==r.length)return!1;for(var i=0;i<t.length;++i)if(!e.equals(t[i],r[i]))return!1;return!0}if(typeof t!=typeof r)return!1;if("string"==typeof t)return t===r;var a=t.tagClass===r.tagClass&&t.type===r.type&&t.constructed===r.constructed&&t.composed===r.composed&&e.equals(t.value,r.value);return n&&n.includeBitStringContents&&(a=a&&t.bitStringContents===r.bitStringContents),a},e.getBerValueLength=function(t){var e=t.getByte();if(128!==e)return 128&e?t.getInt((127&e)<<3):e};function n(t,i,a,o){var s;r(t,i,2);var u=t.getByte();i--;var c=192&u,f=31&u;s=t.length();var l,h,p=function(t,e){var n=t.getByte();if(e--,128!==n){var i;if(128&n){var a=127&n;r(t,e,a),i=t.getInt(a<<3)}else i=n;if(i<0)throw new Error("Negative length: "+i);return i}}(t,i);if(i-=s-t.length(),void 0!==p&&p>i){if(o.strict){var d=new Error("Too few bytes to read ASN.1 value.");throw d.available=t.length(),d.remaining=i,d.requested=p,d}p=i}var y=32==(32&u);if(y)if(l=[],void 0===p)for(;;){if(r(t,i,2),t.bytes(2)===String.fromCharCode(0,0)){t.getBytes(2),i-=2;break}s=t.length(),l.push(n(t,i,a+1,o)),i-=s-t.length()}else for(;p>0;)s=t.length(),l.push(n(t,p,a+1,o)),i-=s-t.length(),p-=s-t.length();if(void 0===l&&c===e.Class.UNIVERSAL&&f===e.Type.BITSTRING&&(h=t.bytes(p)),void 0===l&&o.decodeBitStrings&&c===e.Class.UNIVERSAL&&f===e.Type.BITSTRING&&p>1){var g=t.read,v=i,m=0;if(f===e.Type.BITSTRING&&(r(t,i,1),m=t.getByte(),i--),0===m)try{s=t.length();var C=n(t,i,a+1,{verbose:o.verbose,strict:!0,decodeBitStrings:!0}),E=s-t.length();i-=E,f==e.Type.BITSTRING&&E++;var S=C.tagClass;E!==p||S!==e.Class.UNIVERSAL&&S!==e.Class.CONTEXT_SPECIFIC||(l=[C])}catch(t){}void 0===l&&(t.read=g,i=v)}if(void 0===l){if(void 0===p){if(o.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");p=i}if(f===e.Type.BMPSTRING)for(l="";p>0;p-=2)r(t,i,2),l+=String.fromCharCode(t.getInt16()),i-=2;else l=t.getBytes(p)}var b=void 0===h?null:{bitStringContents:h};return e.create(c,f,y,l,b)}e.fromDer=function(t,e){return void 0===e&&(e={strict:!0,decodeBitStrings:!0}),"boolean"==typeof e&&(e={strict:e,decodeBitStrings:!0}),"strict"in e||(e.strict=!0),"decodeBitStrings"in e||(e.decodeBitStrings=!0),"string"==typeof t&&(t=xu.util.createBuffer(t)),n(t,t.length(),0,e)},e.toDer=function(t){var r=xu.util.createBuffer(),n=t.tagClass|t.type,i=xu.util.createBuffer(),a=!1;if("bitStringContents"in t&&(a=!0,t.original&&(a=e.equals(t,t.original))),a)i.putBytes(t.bitStringContents);else if(t.composed){t.constructed?n|=32:i.putByte(0);for(var o=0;o<t.value.length;++o)void 0!==t.value[o]&&i.putBuffer(e.toDer(t.value[o]))}else if(t.type===e.Type.BMPSTRING)for(o=0;o<t.value.length;++o)i.putInt16(t.value.charCodeAt(o));else t.type===e.Type.INTEGER&&t.value.length>1&&(0===t.value.charCodeAt(0)&&0==(128&t.value.charCodeAt(1))||255===t.value.charCodeAt(0)&&128==(128&t.value.charCodeAt(1)))?i.putBytes(t.value.substr(1)):i.putBytes(t.value);if(r.putByte(n),i.length()<=127)r.putByte(127&i.length());else{var s=i.length(),u="";do{u+=String.fromCharCode(255&s),s>>>=8}while(s>0);r.putByte(128|u.length);for(o=u.length-1;o>=0;--o)r.putByte(u.charCodeAt(o))}return r.putBuffer(i),r},e.oidToDer=function(t){var e,r,n,i,a=t.split("."),o=xu.util.createBuffer();o.putByte(40*parseInt(a[0],10)+parseInt(a[1],10));for(var s=2;s<a.length;++s){e=!0,r=[],n=parseInt(a[s],10);do{i=127&n,n>>>=7,e||(i|=128),r.push(i),e=!1}while(n>0);for(var u=r.length-1;u>=0;--u)o.putByte(r[u])}return o},e.derToOid=function(t){var e;"string"==typeof t&&(t=xu.util.createBuffer(t));var r=t.getByte();e=Math.floor(r/40)+"."+r%40;for(var n=0;t.length()>0;)n<<=7,128&(r=t.getByte())?n+=127&r:(e+="."+(n+r),n=0);return e},e.utcTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(t.substr(2,2),10)-1,i=parseInt(t.substr(4,2),10),a=parseInt(t.substr(6,2),10),o=parseInt(t.substr(8,2),10),s=0;if(t.length>11){var u=t.charAt(10),c=10;"+"!==u&&"-"!==u&&(s=parseInt(t.substr(10,2),10),c+=2)}if(e.setUTCFullYear(r,n,i),e.setUTCHours(a,o,s,0),c&&("+"===(u=t.charAt(c))||"-"===u)){var f=60*parseInt(t.substr(c+1,2),10)+parseInt(t.substr(c+4,2),10);f*=6e4,"+"===u?e.setTime(+e-f):e.setTime(+e+f)}return e},e.generalizedTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,4),10),n=parseInt(t.substr(4,2),10)-1,i=parseInt(t.substr(6,2),10),a=parseInt(t.substr(8,2),10),o=parseInt(t.substr(10,2),10),s=parseInt(t.substr(12,2),10),u=0,c=0,f=!1;"Z"===t.charAt(t.length-1)&&(f=!0);var l=t.length-5,h=t.charAt(l);"+"!==h&&"-"!==h||(c=60*parseInt(t.substr(l+1,2),10)+parseInt(t.substr(l+4,2),10),c*=6e4,"+"===h&&(c*=-1),f=!0);return"."===t.charAt(14)&&(u=1e3*parseFloat(t.substr(14),10)),f?(e.setUTCFullYear(r,n,i),e.setUTCHours(a,o,s,u),e.setTime(+e+c)):(e.setFullYear(r,n,i),e.setHours(a,o,s,u)),e},e.dateToUtcTime=function(t){if("string"==typeof t)return t;var e="",r=[];r.push((""+t.getUTCFullYear()).substr(2)),r.push(""+(t.getUTCMonth()+1)),r.push(""+t.getUTCDate()),r.push(""+t.getUTCHours()),r.push(""+t.getUTCMinutes()),r.push(""+t.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(e+="0"),e+=r[n];return e+="Z"},e.dateToGeneralizedTime=function(t){if("string"==typeof t)return t;var e="",r=[];r.push(""+t.getUTCFullYear()),r.push(""+(t.getUTCMonth()+1)),r.push(""+t.getUTCDate()),r.push(""+t.getUTCHours()),r.push(""+t.getUTCMinutes()),r.push(""+t.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(e+="0"),e+=r[n];return e+="Z"},e.integerToDer=function(t){var e=xu.util.createBuffer();if(t>=-128&&t<128)return e.putSignedInt(t,8);if(t>=-32768&&t<32768)return e.putSignedInt(t,16);if(t>=-8388608&&t<8388608)return e.putSignedInt(t,24);if(t>=-2147483648&&t<2147483648)return e.putSignedInt(t,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=t,r},e.derToInteger=function(t){"string"==typeof t&&(t=xu.util.createBuffer(t));var e=8*t.length();if(e>32)throw new Error("Integer too large; max is 32-bits.");return t.getSignedInt(e)},e.validate=function(t,r,n,i){var a=!1;if(t.tagClass!==r.tagClass&&void 0!==r.tagClass||t.type!==r.type&&void 0!==r.type)i&&(t.tagClass!==r.tagClass&&i.push("["+r.name+'] Expected tag class "'+r.tagClass+'", got "'+t.tagClass+'"'),t.type!==r.type&&i.push("["+r.name+'] Expected type "'+r.type+'", got "'+t.type+'"'));else if(t.constructed===r.constructed||void 0===r.constructed){if(a=!0,r.value&&xu.util.isArray(r.value))for(var o=0,s=0;a&&s<r.value.length;++s)a=r.value[s].optional||!1,t.value[o]&&((a=e.validate(t.value[o],r.value[s],n,i))?++o:r.value[s].optional&&(a=!0)),!a&&i&&i.push("["+r.name+'] Tag class "'+r.tagClass+'", type "'+r.type+'" expected value length "'+r.value.length+'", got "'+t.value.length+'"');if(a&&n&&(r.capture&&(n[r.capture]=t.value),r.captureAsn1&&(n[r.captureAsn1]=t),r.captureBitStringContents&&"bitStringContents"in t&&(n[r.captureBitStringContents]=t.bitStringContents),r.captureBitStringValue&&"bitStringContents"in t))if(t.bitStringContents.length<2)n[r.captureBitStringValue]="";else{if(0!==t.bitStringContents.charCodeAt(0))throw new Error("captureBitStringValue only supported for zero unused bits");n[r.captureBitStringValue]=t.bitStringContents.slice(1)}}else i&&i.push("["+r.name+'] Expected constructed "'+r.constructed+'", got "'+t.constructed+'"');return a};var i=/[^\\u0000-\\u00ff]/;e.prettyPrint=function(t,r,n){var a="";n=n||2,(r=r||0)>0&&(a+="\n");for(var o="",s=0;s<r*n;++s)o+=" ";switch(a+=o+"Tag: ",t.tagClass){case e.Class.UNIVERSAL:a+="Universal:";break;case e.Class.APPLICATION:a+="Application:";break;case e.Class.CONTEXT_SPECIFIC:a+="Context-Specific:";break;case e.Class.PRIVATE:a+="Private:"}if(t.tagClass===e.Class.UNIVERSAL)switch(a+=t.type,t.type){case e.Type.NONE:a+=" (None)";break;case e.Type.BOOLEAN:a+=" (Boolean)";break;case e.Type.INTEGER:a+=" (Integer)";break;case e.Type.BITSTRING:a+=" (Bit string)";break;case e.Type.OCTETSTRING:a+=" (Octet string)";break;case e.Type.NULL:a+=" (Null)";break;case e.Type.OID:a+=" (Object Identifier)";break;case e.Type.ODESC:a+=" (Object Descriptor)";break;case e.Type.EXTERNAL:a+=" (External or Instance of)";break;case e.Type.REAL:a+=" (Real)";break;case e.Type.ENUMERATED:a+=" (Enumerated)";break;case e.Type.EMBEDDED:a+=" (Embedded PDV)";break;case e.Type.UTF8:a+=" (UTF8)";break;case e.Type.ROID:a+=" (Relative Object Identifier)";break;case e.Type.SEQUENCE:a+=" (Sequence)";break;case e.Type.SET:a+=" (Set)";break;case e.Type.PRINTABLESTRING:a+=" (Printable String)";break;case e.Type.IA5String:a+=" (IA5String (ASCII))";break;case e.Type.UTCTIME:a+=" (UTC time)";break;case e.Type.GENERALIZEDTIME:a+=" (Generalized time)";break;case e.Type.BMPSTRING:a+=" (BMP String)"}else a+=t.type;if(a+="\n",a+=o+"Constructed: "+t.constructed+"\n",t.composed){var u=0,c="";for(s=0;s<t.value.length;++s)void 0!==t.value[s]&&(u+=1,c+=e.prettyPrint(t.value[s],r+1,n),s+1<t.value.length&&(c+=","));a+=o+"Sub values: "+u+c}else{if(a+=o+"Value: ",t.type===e.Type.OID){var f=e.derToOid(t.value);a+=f,xu.pki&&xu.pki.oids&&f in xu.pki.oids&&(a+=" ("+xu.pki.oids[f]+") ")}if(t.type===e.Type.INTEGER)try{a+=e.derToInteger(t.value)}catch(e){a+="0x"+xu.util.bytesToHex(t.value)}else if(t.type===e.Type.BITSTRING){if(t.value.length>1?a+="0x"+xu.util.bytesToHex(t.value.slice(1)):a+="(none)",t.value.length>0){var l=t.value.charCodeAt(0);1==l?a+=" (1 unused bit shown)":l>1&&(a+=" ("+l+" unused bits shown)")}}else t.type===e.Type.OCTETSTRING?(i.test(t.value)||(a+="("+t.value+") "),a+="0x"+xu.util.bytesToHex(t.value)):t.type===e.Type.UTF8?a+=xu.util.decodeUtf8(t.value):t.type===e.Type.PRINTABLESTRING||t.type===e.Type.IA5String?a+=t.value:i.test(t.value)?a+="0x"+xu.util.bytesToHex(t.value):0===t.value.length?a+="[null]":a+=t.value}return a}}));xu.cipher=xu.cipher||{},xu.cipher.algorithms=xu.cipher.algorithms||{},xu.cipher.createCipher=function(t,e){var r=t;if("string"==typeof r&&(r=xu.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+t);return new xu.cipher.BlockCipher({algorithm:r,key:e,decrypt:!1})},xu.cipher.createDecipher=function(t,e){var r=t;if("string"==typeof r&&(r=xu.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+t);return new xu.cipher.BlockCipher({algorithm:r,key:e,decrypt:!0})},xu.cipher.registerAlgorithm=function(t,e){t=t.toUpperCase(),xu.cipher.algorithms[t]=e},xu.cipher.getAlgorithm=function(t){return(t=t.toUpperCase())in xu.cipher.algorithms?xu.cipher.algorithms[t]:null};var Fu=xu.cipher.BlockCipher=function(t){this.algorithm=t.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=t.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=t.decrypt,this.algorithm.initialize(t)};function Ku(t,e){xu.cipher.registerAlgorithm(t,(function(){return new xu.aes.Algorithm(t,e)}))}Fu.prototype.start=function(t){t=t||{};var e={};for(var r in t)e[r]=t[r];e.decrypt=this._decrypt,this._finish=!1,this._input=xu.util.createBuffer(),this.output=t.output||xu.util.createBuffer(),this.mode.start(e)},Fu.prototype.update=function(t){for(t&&this._input.putBuffer(t);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()},Fu.prototype.finish=function(t){!t||"ECB"!==this.mode.name&&"CBC"!==this.mode.name||(this.mode.pad=function(e){return t(this.blockSize,e,!1)},this.mode.unpad=function(e){return t(this.blockSize,e,!0)});var e={};return e.decrypt=this._decrypt,e.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,e))&&(this._finish=!0,this.update(),!(this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,e))&&!(this.mode.afterFinish&&!this.mode.afterFinish(this.output,e)))},w((function(t){xu.cipher=xu.cipher||{};var e=t.exports=xu.cipher.modes=xu.cipher.modes||{};function r(t,e){if("string"==typeof t&&(t=xu.util.createBuffer(t)),xu.util.isArray(t)&&t.length>4){var r=t;t=xu.util.createBuffer();for(var n=0;n<r.length;++n)t.putByte(r[n])}if(t.length()<e)throw new Error("Invalid IV length; got "+t.length()+" bytes and expected "+e+" bytes.");if(!xu.util.isArray(t)){var i=[],a=e/4;for(n=0;n<a;++n)i.push(t.getInt32());t=i}return t}function n(t){t[t.length-1]=t[t.length-1]+1&4294967295}function i(t){return[t/4294967296|0,4294967295&t]}e.ecb=function(t){t=t||{},this.name="ECB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},e.ecb.prototype.start=function(t){},e.ecb.prototype.encrypt=function(t,e,r){if(t.length()<this.blockSize&&!(r&&t.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=t.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)e.putInt32(this._outBlock[n])},e.ecb.prototype.decrypt=function(t,e,r){if(t.length()<this.blockSize&&!(r&&t.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=t.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)e.putInt32(this._outBlock[n])},e.ecb.prototype.pad=function(t,e){var r=t.length()===this.blockSize?this.blockSize:this.blockSize-t.length();return t.fillWithByte(r,r),!0},e.ecb.prototype.unpad=function(t,e){if(e.overflow>0)return!1;var r=t.length(),n=t.at(r-1);return!(n>this.blockSize<<2)&&(t.truncate(n),!0)},e.cbc=function(t){t=t||{},this.name="CBC",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},e.cbc.prototype.start=function(t){if(null===t.iv){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else{if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=r(t.iv,this.blockSize),this._prev=this._iv.slice(0)}},e.cbc.prototype.encrypt=function(t,e,r){if(t.length()<this.blockSize&&!(r&&t.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=this._prev[n]^t.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)e.putInt32(this._outBlock[n]);this._prev=this._outBlock},e.cbc.prototype.decrypt=function(t,e,r){if(t.length()<this.blockSize&&!(r&&t.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=t.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)e.putInt32(this._prev[n]^this._outBlock[n]);this._prev=this._inBlock.slice(0)},e.cbc.prototype.pad=function(t,e){var r=t.length()===this.blockSize?this.blockSize:this.blockSize-t.length();return t.fillWithByte(r,r),!0},e.cbc.prototype.unpad=function(t,e){if(e.overflow>0)return!1;var r=t.length(),n=t.at(r-1);return!(n>this.blockSize<<2)&&(t.truncate(n),!0)},e.cfb=function(t){t=t||{},this.name="CFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=xu.util.createBuffer(),this._partialBytes=0},e.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=r(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},e.cfb.prototype.encrypt=function(t,e,r){var n=t.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=t.getInt32()^this._outBlock[i],e.putInt32(this._inBlock[i]);else{var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialBlock[i]=t.getInt32()^this._outBlock[i],this._partialOutput.putInt32(this._partialBlock[i]);if(a>0)t.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return e.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},e.cfb.prototype.decrypt=function(t,e,r){var n=t.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=t.getInt32(),e.putInt32(this._inBlock[i]^this._outBlock[i]);else{var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialBlock[i]=t.getInt32(),this._partialOutput.putInt32(this._partialBlock[i]^this._outBlock[i]);if(a>0)t.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return e.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},e.ofb=function(t){t=t||{},this.name="OFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=xu.util.createBuffer(),this._partialBytes=0},e.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=r(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},e.ofb.prototype.encrypt=function(t,e,r){var n=t.length();if(0===t.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)e.putInt32(t.getInt32()^this._outBlock[i]),this._inBlock[i]=this._outBlock[i];else{var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(t.getInt32()^this._outBlock[i]);if(a>0)t.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._outBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return e.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},e.ofb.prototype.decrypt=e.ofb.prototype.encrypt,e.ctr=function(t){t=t||{},this.name="CTR",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=xu.util.createBuffer(),this._partialBytes=0},e.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=r(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},e.ctr.prototype.encrypt=function(t,e,r){var i=t.length();if(0===i)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&i>=this.blockSize)for(var a=0;a<this._ints;++a)e.putInt32(t.getInt32()^this._outBlock[a]);else{var o=(this.blockSize-i)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(a=0;a<this._ints;++a)this._partialOutput.putInt32(t.getInt32()^this._outBlock[a]);if(o>0&&(t.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=0}n(this._inBlock)},e.ctr.prototype.decrypt=e.ctr.prototype.encrypt,e.gcm=function(t){t=t||{},this.name="GCM",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=xu.util.createBuffer(),this._partialBytes=0,this._R=3774873600},e.gcm.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");var e,r=xu.util.createBuffer(t.iv);if(this._cipherLength=0,e="additionalData"in t?xu.util.createBuffer(t.additionalData):xu.util.createBuffer(),this._tagLength="tagLength"in t?t.tagLength:128,this._tag=null,t.decrypt&&(this._tag=xu.util.createBuffer(t.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var a=r.length();if(12===a)this._j0=[r.getInt32(),r.getInt32(),r.getInt32(),1];else{for(this._j0=[0,0,0,0];r.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(i(8*a)))}this._inBlock=this._j0.slice(0),n(this._inBlock),this._partialBytes=0,e=xu.util.createBuffer(e),this._aDataLength=i(8*e.length());var o=e.length()%this.blockSize;for(o&&e.fillWithByte(0,this.blockSize-o),this._s=[0,0,0,0];e.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[e.getInt32(),e.getInt32(),e.getInt32(),e.getInt32()])},e.gcm.prototype.encrypt=function(t,e,r){var i=t.length();if(0===i)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&i>=this.blockSize){for(var a=0;a<this._ints;++a)e.putInt32(this._outBlock[a]^=t.getInt32());this._cipherLength+=this.blockSize}else{var o=(this.blockSize-i)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(a=0;a<this._ints;++a)this._partialOutput.putInt32(t.getInt32()^this._outBlock[a]);if(o<=0||r){if(r){var s=i%this.blockSize;this._cipherLength+=s,this._partialOutput.truncate(this.blockSize-s)}else this._cipherLength+=this.blockSize;for(a=0;a<this._ints;++a)this._outBlock[a]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return t.read-=this.blockSize,e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),n(this._inBlock)},e.gcm.prototype.decrypt=function(t,e,r){var i=t.length();if(i<this.blockSize&&!(r&&i>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),n(this._inBlock),this._hashBlock[0]=t.getInt32(),this._hashBlock[1]=t.getInt32(),this._hashBlock[2]=t.getInt32(),this._hashBlock[3]=t.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var a=0;a<this._ints;++a)e.putInt32(this._outBlock[a]^this._hashBlock[a]);i<this.blockSize?this._cipherLength+=i%this.blockSize:this._cipherLength+=this.blockSize},e.gcm.prototype.afterFinish=function(t,e){var r=!0;e.decrypt&&e.overflow&&t.truncate(this.blockSize-e.overflow),this.tag=xu.util.createBuffer();var n=this._aDataLength.concat(i(8*this._cipherLength));this._s=this.ghash(this._hashSubkey,this._s,n);var a=[];this.cipher.encrypt(this._j0,a);for(var o=0;o<this._ints;++o)this.tag.putInt32(this._s[o]^a[o]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),e.decrypt&&this.tag.bytes()!==this._tag&&(r=!1),r},e.gcm.prototype.multiply=function(t,e){for(var r=[0,0,0,0],n=e.slice(0),i=0;i<128;++i){t[i/32|0]&1<<31-i%32&&(r[0]^=n[0],r[1]^=n[1],r[2]^=n[2],r[3]^=n[3]),this.pow(n,n)}return r},e.gcm.prototype.pow=function(t,e){for(var r=1&t[3],n=3;n>0;--n)e[n]=t[n]>>>1|(1&t[n-1])<<31;e[0]=t[0]>>>1,r&&(e[0]^=this._R)},e.gcm.prototype.tableMultiply=function(t){for(var e=[0,0,0,0],r=0;r<32;++r){var n=t[r/8|0]>>>4*(7-r%8)&15,i=this._m[r][n];e[0]^=i[0],e[1]^=i[1],e[2]^=i[2],e[3]^=i[3]}return e},e.gcm.prototype.ghash=function(t,e,r){return e[0]^=r[0],e[1]^=r[1],e[2]^=r[2],e[3]^=r[3],this.tableMultiply(e)},e.gcm.prototype.generateHashTable=function(t,e){for(var r=8/e,n=4*r,i=16*r,a=new Array(i),o=0;o<i;++o){var s=[0,0,0,0],u=(n-1-o%n)*e;s[o/n|0]=1<<e-1<<u,a[o]=this.generateSubHashTable(this.multiply(s,t),e)}return a},e.gcm.prototype.generateSubHashTable=function(t,e){var r=1<<e,n=r>>>1,i=new Array(r);i[n]=t.slice(0);for(var a=n>>>1;a>0;)this.pow(i[2*a],i[a]=[]),a>>=1;for(a=2;a<n;){for(var o=1;o<a;++o){var s=i[a],u=i[o];i[a+o]=[s[0]^u[0],s[1]^u[1],s[2]^u[2],s[3]^u[3]]}a*=2}for(i[0]=[0,0,0,0],a=n+1;a<r;++a){var c=i[a^n];i[a]=[t[0]^c[0],t[1]^c[1],t[2]^c[2],t[3]^c[3]]}return i}})),xu.aes=xu.aes||{},xu.aes.startEncrypting=function(t,e,r,n){var i=Zu({key:t,output:r,decrypt:!1,mode:n});return i.start(e),i},xu.aes.createEncryptionCipher=function(t,e){return Zu({key:t,output:null,decrypt:!1,mode:e})},xu.aes.startDecrypting=function(t,e,r,n){var i=Zu({key:t,output:r,decrypt:!0,mode:n});return i.start(e),i},xu.aes.createDecryptionCipher=function(t,e){return Zu({key:t,output:null,decrypt:!0,mode:e})},xu.aes.Algorithm=function(t,e){Qu||Yu();var r=this;r.name=t,r.mode=new e({blockSize:16,cipher:{encrypt:function(t,e){return $u(r._w,t,e,!1)},decrypt:function(t,e){return $u(r._w,t,e,!0)}}}),r._init=!1},xu.aes.Algorithm.prototype.initialize=function(t){if(!this._init){var e,r=t.key;if("string"!=typeof r||16!==r.length&&24!==r.length&&32!==r.length){if(xu.util.isArray(r)&&(16===r.length||24===r.length||32===r.length)){e=r,r=xu.util.createBuffer();for(var n=0;n<e.length;++n)r.putByte(e[n])}}else r=xu.util.createBuffer(r);if(!xu.util.isArray(r)){e=r,r=[];var i=e.length();if(16===i||24===i||32===i){i>>>=2;for(n=0;n<i;++n)r.push(e.getInt32())}}if(!xu.util.isArray(r)||4!==r.length&&6!==r.length&&8!==r.length)throw new Error("Invalid key parameter.");var a=this.mode.name,o=-1!==["CFB","OFB","CTR","GCM"].indexOf(a);this._w=Xu(r,t.decrypt&&!o),this._init=!0}},xu.aes._expandKey=function(t,e){return Qu||Yu(),Xu(t,e)},xu.aes._updateBlock=$u,Ku("AES-ECB",xu.cipher.modes.ecb),Ku("AES-CBC",xu.cipher.modes.cbc),Ku("AES-CFB",xu.cipher.modes.cfb),Ku("AES-OFB",xu.cipher.modes.ofb),Ku("AES-CTR",xu.cipher.modes.ctr),Ku("AES-GCM",xu.cipher.modes.gcm);var qu,Gu,zu,Wu,Hu,Qu=!1;function Yu(){Qu=!0,zu=[0,1,2,4,8,16,32,64,128,27,54];for(var t=new Array(256),e=0;e<128;++e)t[e]=e<<1,t[e+128]=e+128<<1^283;qu=new Array(256),Gu=new Array(256),Wu=new Array(4),Hu=new Array(4);for(e=0;e<4;++e)Wu[e]=new Array(256),Hu[e]=new Array(256);var r,n,i,a,o,s,u,c=0,f=0;for(e=0;e<256;++e){a=(a=f^f<<1^f<<2^f<<3^f<<4)>>8^255&a^99,qu[c]=a,Gu[a]=c,s=(o=t[a])<<24^a<<16^a<<8^a^o,u=((r=t[c])^(n=t[r])^(i=t[n]))<<24^(c^i)<<16^(c^n^i)<<8^c^r^i;for(var l=0;l<4;++l)Wu[l][c]=s,Hu[l][a]=u,s=s<<24|s>>>8,u=u<<24|u>>>8;0===c?c=f=1:(c=r^t[t[t[r^i]]],f^=t[t[f]])}}function Xu(t,e){for(var r,n=t.slice(0),i=1,a=n.length,o=4*(a+6+1),s=a;s<o;++s)r=n[s-1],s%a==0?(r=qu[r>>>16&255]<<24^qu[r>>>8&255]<<16^qu[255&r]<<8^qu[r>>>24]^zu[i]<<24,i++):a>6&&s%a==4&&(r=qu[r>>>24]<<24^qu[r>>>16&255]<<16^qu[r>>>8&255]<<8^qu[255&r]),n[s]=n[s-a]^r;if(e){for(var u,c=Hu[0],f=Hu[1],l=Hu[2],h=Hu[3],p=n.slice(0),d=(s=0,(o=n.length)-4);s<o;s+=4,d-=4)if(0===s||s===o-4)p[s]=n[d],p[s+1]=n[d+3],p[s+2]=n[d+2],p[s+3]=n[d+1];else for(var y=0;y<4;++y)u=n[d+y],p[s+(3&-y)]=c[qu[u>>>24]]^f[qu[u>>>16&255]]^l[qu[u>>>8&255]]^h[qu[255&u]];n=p}return n}function $u(t,e,r,n){var i,a,o,s,u,c,f,l,h,p,d,y,g=t.length/4-1;n?(i=Hu[0],a=Hu[1],o=Hu[2],s=Hu[3],u=Gu):(i=Wu[0],a=Wu[1],o=Wu[2],s=Wu[3],u=qu),c=e[0]^t[0],f=e[n?3:1]^t[1],l=e[2]^t[2],h=e[n?1:3]^t[3];for(var v=3,m=1;m<g;++m)p=i[c>>>24]^a[f>>>16&255]^o[l>>>8&255]^s[255&h]^t[++v],d=i[f>>>24]^a[l>>>16&255]^o[h>>>8&255]^s[255&c]^t[++v],y=i[l>>>24]^a[h>>>16&255]^o[c>>>8&255]^s[255&f]^t[++v],h=i[h>>>24]^a[c>>>16&255]^o[f>>>8&255]^s[255&l]^t[++v],c=p,f=d,l=y;r[0]=u[c>>>24]<<24^u[f>>>16&255]<<16^u[l>>>8&255]<<8^u[255&h]^t[++v],r[n?3:1]=u[f>>>24]<<24^u[l>>>16&255]<<16^u[h>>>8&255]<<8^u[255&c]^t[++v],r[2]=u[l>>>24]<<24^u[h>>>16&255]<<16^u[c>>>8&255]<<8^u[255&f]^t[++v],r[n?1:3]=u[h>>>24]<<24^u[c>>>16&255]<<16^u[f>>>8&255]<<8^u[255&l]^t[++v]}function Zu(t){var e,r="AES-"+((t=t||{}).mode||"CBC").toUpperCase(),n=(e=t.decrypt?xu.cipher.createDecipher(r,t.key):xu.cipher.createCipher(r,t.key)).start;return e.start=function(t,r){var i=null;r instanceof xu.util.ByteBuffer&&(i=r,r={}),(r=r||{}).output=i,r.iv=t,n.call(e,r)},e}function Ju(t,e){xu.cipher.registerAlgorithm(t,(function(){return new xu.des.Algorithm(t,e)}))}xu.des=xu.des||{},xu.des.startEncrypting=function(t,e,r,n){var i=cc({key:t,output:r,decrypt:!1,mode:n||(null===e?"ECB":"CBC")});return i.start(e),i},xu.des.createEncryptionCipher=function(t,e){return cc({key:t,output:null,decrypt:!1,mode:e})},xu.des.startDecrypting=function(t,e,r,n){var i=cc({key:t,output:r,decrypt:!0,mode:n||(null===e?"ECB":"CBC")});return i.start(e),i},xu.des.createDecryptionCipher=function(t,e){return cc({key:t,output:null,decrypt:!0,mode:e})},xu.des.Algorithm=function(t,e){var r=this;r.name=t,r.mode=new e({blockSize:8,cipher:{encrypt:function(t,e){return uc(r._keys,t,e,!1)},decrypt:function(t,e){return uc(r._keys,t,e,!0)}}}),r._init=!1},xu.des.Algorithm.prototype.initialize=function(t){if(!this._init){var e=xu.util.createBuffer(t.key);if(0===this.name.indexOf("3DES")&&24!==e.length())throw new Error("Invalid Triple-DES key size: "+8*e.length());this._keys=function(t){for(var e,r=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],n=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],i=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],a=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],o=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],s=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],u=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],c=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],f=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],l=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],h=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],p=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],d=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],y=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],g=t.length()>8?3:1,v=[],m=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],C=0,E=0;E<g;E++){var S=t.getInt32(),b=t.getInt32();S^=(e=252645135&(S>>>4^b))<<4,S^=e=65535&((b^=e)>>>-16^S),S^=(e=858993459&(S>>>2^(b^=e<<-16)))<<2,S^=e=65535&((b^=e)>>>-16^S),S^=(e=1431655765&(S>>>1^(b^=e<<-16)))<<1,S^=e=16711935&((b^=e)>>>8^S),e=(S^=(e=1431655765&(S>>>1^(b^=e<<8)))<<1)<<8|(b^=e)>>>20&240,S=b<<24|b<<8&16711680|b>>>8&65280|b>>>24&240,b=e;for(var T=0;T<m.length;++T){m[T]?(S=S<<2|S>>>26,b=b<<2|b>>>26):(S=S<<1|S>>>27,b=b<<1|b>>>27),b&=-15;var I=r[(S&=-15)>>>28]|n[S>>>24&15]|i[S>>>20&15]|a[S>>>16&15]|o[S>>>12&15]|s[S>>>8&15]|u[S>>>4&15],A=c[b>>>28]|f[b>>>24&15]|l[b>>>20&15]|h[b>>>16&15]|p[b>>>12&15]|d[b>>>8&15]|y[b>>>4&15];e=65535&(A>>>16^I),v[C++]=I^e,v[C++]=A^e<<16}}return v}(e),this._init=!0}},Ju("DES-ECB",xu.cipher.modes.ecb),Ju("DES-CBC",xu.cipher.modes.cbc),Ju("DES-CFB",xu.cipher.modes.cfb),Ju("DES-OFB",xu.cipher.modes.ofb),Ju("DES-CTR",xu.cipher.modes.ctr),Ju("3DES-ECB",xu.cipher.modes.ecb),Ju("3DES-CBC",xu.cipher.modes.cbc),Ju("3DES-CFB",xu.cipher.modes.cfb),Ju("3DES-OFB",xu.cipher.modes.ofb),Ju("3DES-CTR",xu.cipher.modes.ctr);var tc=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],ec=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],rc=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],nc=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],ic=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],ac=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],oc=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],sc=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function uc(t,e,r,n){var i,a,o=32===t.length?3:9;i=3===o?n?[30,-2,-2]:[0,32,2]:n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var s=e[0],u=e[1];s^=(a=252645135&(s>>>4^u))<<4,s^=(a=65535&(s>>>16^(u^=a)))<<16,s^=a=858993459&((u^=a)>>>2^s),s^=a=16711935&((u^=a<<2)>>>8^s),s=(s^=(a=1431655765&(s>>>1^(u^=a<<8)))<<1)<<1|s>>>31,u=(u^=a)<<1|u>>>31;for(var c=0;c<o;c+=3){for(var f=i[c+1],l=i[c+2],h=i[c];h!=f;h+=l){var p=u^t[h],d=(u>>>4|u<<28)^t[h+1];a=s,s=u,u=a^(ec[p>>>24&63]|nc[p>>>16&63]|ac[p>>>8&63]|sc[63&p]|tc[d>>>24&63]|rc[d>>>16&63]|ic[d>>>8&63]|oc[63&d])}a=s,s=u,u=a}u=u>>>1|u<<31,u^=a=1431655765&((s=s>>>1|s<<31)>>>1^u),u^=(a=16711935&(u>>>8^(s^=a<<1)))<<8,u^=(a=858993459&(u>>>2^(s^=a)))<<2,u^=a=65535&((s^=a)>>>16^u),u^=a=252645135&((s^=a<<16)>>>4^u),s^=a<<4,r[0]=s,r[1]=u}function cc(t){var e,r="DES-"+((t=t||{}).mode||"CBC").toUpperCase(),n=(e=t.decrypt?xu.cipher.createDecipher(r,t.key):xu.cipher.createCipher(r,t.key)).start;return e.start=function(t,r){var i=null;r instanceof xu.util.ByteBuffer&&(i=r,r={}),(r=r||{}).output=i,r.iv=t,n.call(e,r)},e}var fc=xu.md=xu.md||{};xu.md.algorithms=xu.md.algorithms||{},w((function(t){(t.exports=xu.hmac=xu.hmac||{}).create=function(){var t=null,e=null,r=null,n=null,i={start:function(i,a){if(null!==i)if("string"==typeof i){if(!((i=i.toLowerCase())in xu.md.algorithms))throw new Error('Unknown hash algorithm "'+i+'"');e=xu.md.algorithms[i].create()}else e=i;if(null===a)a=t;else{if("string"==typeof a)a=xu.util.createBuffer(a);else if(xu.util.isArray(a)){var o=a;a=xu.util.createBuffer();for(var s=0;s<o.length;++s)a.putByte(o[s])}var u=a.length();u>e.blockLength&&(e.start(),e.update(a.bytes()),a=e.digest()),r=xu.util.createBuffer(),n=xu.util.createBuffer(),u=a.length();for(s=0;s<u;++s){o=a.at(s);r.putByte(54^o),n.putByte(92^o)}if(u<e.blockLength)for(o=e.blockLength-u,s=0;s<o;++s)r.putByte(54),n.putByte(92);t=a,r=r.bytes(),n=n.bytes()}e.start(),e.update(r)},update:function(t){e.update(t)},getMac:function(){var t=e.digest().bytes();return e.start(),e.update(n),e.update(t),e.digest()}};return i.digest=i.getMac,i}}));var lc,hc=xu.pkcs5=xu.pkcs5||{};xu.util.isNodejs&&!xu.options.usePureJavaScript&&(lc=y.default),xu.pbkdf2=hc.pbkdf2=function(t,e,r,n,i,a){if("function"==typeof i&&(a=i,i=null),xu.util.isNodejs&&!xu.options.usePureJavaScript&&lc.pbkdf2&&(null===i||"object"!=typeof i)&&(lc.pbkdf2Sync.length>4||!i||"sha1"===i))return"string"!=typeof i&&(i="sha1"),t=Buffer.from(t,"binary"),e=Buffer.from(e,"binary"),a?4===lc.pbkdf2Sync.length?lc.pbkdf2(t,e,r,n,(function(t,e){if(t)return a(t);a(null,e.toString("binary"))})):lc.pbkdf2(t,e,r,n,i,(function(t,e){if(t)return a(t);a(null,e.toString("binary"))})):4===lc.pbkdf2Sync.length?lc.pbkdf2Sync(t,e,r,n).toString("binary"):lc.pbkdf2Sync(t,e,r,n,i).toString("binary");if(null==i&&(i="sha1"),"string"==typeof i){if(!(i in xu.md.algorithms))throw new Error("Unknown hash algorithm: "+i);i=xu.md[i].create()}var o=i.digestLength;if(n>4294967295*o){var s=new Error("Derived key is too long.");if(a)return a(s);throw s}var u=Math.ceil(n/o),c=n-(u-1)*o,f=xu.hmac.create();f.start(i,t);var l,h,p,d="";if(!a){for(var y=1;y<=u;++y){f.start(null,null),f.update(e),f.update(xu.util.int32ToBytes(y)),l=p=f.digest().getBytes();for(var g=2;g<=r;++g)f.start(null,null),f.update(p),h=f.digest().getBytes(),l=xu.util.xorBytes(l,h,o),p=h;d+=y<u?l:l.substr(0,c)}return d}y=1;function v(){if(y>u)return a(null,d);f.start(null,null),f.update(e),f.update(xu.util.int32ToBytes(y)),l=p=f.digest().getBytes(),g=2,m()}function m(){if(g<=r)return f.start(null,null),f.update(p),h=f.digest().getBytes(),l=xu.util.xorBytes(l,h,o),p=h,++g,xu.util.setImmediate(m);d+=y<u?l:l.substr(0,c),++y,v()}v()},w((function(t){var e=t.exports=xu.pem=xu.pem||{};function r(t){for(var e=t.name+": ",r=[],n=function(t,e){return" "+e},i=0;i<t.values.length;++i)r.push(t.values[i].replace(/^(\S+\r\n)/,n));e+=r.join(",")+"\r\n";var a=0,o=-1;for(i=0;i<e.length;++i,++a)if(a>65&&-1!==o){var s=e[o];","===s?(++o,e=e.substr(0,o)+"\r\n "+e.substr(o)):e=e.substr(0,o)+"\r\n"+s+e.substr(o+1),a=i-o-1,o=-1,++i}else" "!==e[i]&&"\t"!==e[i]&&","!==e[i]||(o=i);return e}function n(t){return t.replace(/^\s+/,"")}e.encode=function(t,e){e=e||{};var n,i="-----BEGIN "+t.type+"-----\r\n";if(t.procType&&(i+=r(n={name:"Proc-Type",values:[String(t.procType.version),t.procType.type]})),t.contentDomain&&(i+=r(n={name:"Content-Domain",values:[t.contentDomain]})),t.dekInfo&&(n={name:"DEK-Info",values:[t.dekInfo.algorithm]},t.dekInfo.parameters&&n.values.push(t.dekInfo.parameters),i+=r(n)),t.headers)for(var a=0;a<t.headers.length;++a)i+=r(t.headers[a]);return t.procType&&(i+="\r\n"),i+=xu.util.encode64(t.body,e.maxline||64)+"\r\n",i+="-----END "+t.type+"-----\r\n"},e.decode=function(t){for(var e,r=[],i=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,a=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,o=/\r?\n/;e=i.exec(t);){var s={type:e[1],procType:null,contentDomain:null,dekInfo:null,headers:[],body:xu.util.decode64(e[3])};if(r.push(s),e[2]){for(var u=e[2].split(o),c=0;e&&c<u.length;){for(var f=u[c].replace(/\s+$/,""),l=c+1;l<u.length;++l){var h=u[l];if(!/\s/.test(h[0]))break;f+=h,c=l}if(e=f.match(a)){for(var p={name:e[1],values:[]},d=e[2].split(","),y=0;y<d.length;++y)p.values.push(n(d[y]));if(s.procType)if(s.contentDomain||"Content-Domain"!==p.name)if(s.dekInfo||"DEK-Info"!==p.name)s.headers.push(p);else{if(0===p.values.length)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');s.dekInfo={algorithm:d[0],parameters:d[1]||null}}else s.contentDomain=d[0]||"";else{if("Proc-Type"!==p.name)throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(2!==p.values.length)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');s.procType={version:d[0],type:d[1]}}}++c}if("ENCRYPTED"===s.procType&&!s.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(0===r.length)throw new Error("Invalid PEM formatted message.");return r}})),w((function(t){var e=t.exports=xu.sha256=xu.sha256||{};xu.md.sha256=xu.md.algorithms.sha256=e,e.create=function(){n||(r=String.fromCharCode(128),r+=xu.util.fillString(String.fromCharCode(0),64),i=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],n=!0);var t=null,e=xu.util.createBuffer(),o=new Array(64),s={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){s.messageLength=0,s.fullMessageLength=s.messageLength64=[];for(var r=s.messageLengthSize/4,n=0;n<r;++n)s.fullMessageLength.push(0);return e=xu.util.createBuffer(),t={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},s}};return s.start(),s.update=function(r,n){"utf8"===n&&(r=xu.util.encodeUtf8(r));var i=r.length;s.messageLength+=i,i=[i/4294967296>>>0,i>>>0];for(var u=s.fullMessageLength.length-1;u>=0;--u)s.fullMessageLength[u]+=i[1],i[1]=i[0]+(s.fullMessageLength[u]/4294967296>>>0),s.fullMessageLength[u]=s.fullMessageLength[u]>>>0,i[0]=i[1]/4294967296>>>0;return e.putBytes(r),a(t,o,e),(e.read>2048||0===e.length())&&e.compact(),s},s.digest=function(){var n=xu.util.createBuffer();n.putBytes(e.bytes());var i,u=s.fullMessageLength[s.fullMessageLength.length-1]+s.messageLengthSize&s.blockLength-1;n.putBytes(r.substr(0,s.blockLength-u));for(var c=8*s.fullMessageLength[0],f=0;f<s.fullMessageLength.length-1;++f)c+=(i=8*s.fullMessageLength[f+1])/4294967296>>>0,n.putInt32(c>>>0),c=i>>>0;n.putInt32(c);var l={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4,h5:t.h5,h6:t.h6,h7:t.h7};a(l,o,n);var h=xu.util.createBuffer();return h.putInt32(l.h0),h.putInt32(l.h1),h.putInt32(l.h2),h.putInt32(l.h3),h.putInt32(l.h4),h.putInt32(l.h5),h.putInt32(l.h6),h.putInt32(l.h7),h},s};var r=null,n=!1,i=null;function a(t,e,r){for(var n,a,o,s,u,c,f,l,h,p,d,y,g,v=r.length();v>=64;){for(u=0;u<16;++u)e[u]=r.getInt32();for(;u<64;++u)n=((n=e[u-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,a=((a=e[u-15])>>>7|a<<25)^(a>>>18|a<<14)^a>>>3,e[u]=n+e[u-7]+a+e[u-16]|0;for(c=t.h0,f=t.h1,l=t.h2,h=t.h3,p=t.h4,d=t.h5,y=t.h6,g=t.h7,u=0;u<64;++u)o=(c>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),s=c&f|l&(c^f),n=g+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(y^p&(d^y))+i[u]+e[u],g=y,y=d,d=p,p=h+n>>>0,h=l,l=f,f=c,c=n+(a=o+s)>>>0;t.h0=t.h0+c|0,t.h1=t.h1+f|0,t.h2=t.h2+l|0,t.h3=t.h3+h|0,t.h4=t.h4+p|0,t.h5=t.h5+d|0,t.h6=t.h6+y|0,t.h7=t.h7+g|0,v-=64}}})),w((function(t){var e=null;!xu.util.isNodejs||xu.options.usePureJavaScript||process.versions["node-webkit"]||(e=y.default),(t.exports=xu.prng=xu.prng||{}).create=function(t){for(var r={plugin:t,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},n=t.md,i=new Array(32),a=0;a<32;++a)i[a]=n.create();function o(){if(r.pools[0].messageLength>=32)return s();var t=32-r.pools[0].messageLength<<5;r.collect(r.seedFileSync(t)),s()}function s(){r.reseeds=4294967295===r.reseeds?0:r.reseeds+1;var t=r.plugin.md.create();t.update(r.keyBytes);for(var e=1,n=0;n<32;++n)r.reseeds%e==0&&(t.update(r.pools[n].digest().getBytes()),r.pools[n].start()),e<<=1;r.keyBytes=t.digest().getBytes(),t.start(),t.update(r.keyBytes);var i=t.digest().getBytes();r.key=r.plugin.formatKey(r.keyBytes),r.seed=r.plugin.formatSeed(i),r.generated=0}function u(t){var e=null,r=xu.util.globalScope,n=r.crypto||r.msCrypto;n&&n.getRandomValues&&(e=function(t){return n.getRandomValues(t)});var i=xu.util.createBuffer();if(e)for(;i.length()<t;){var a=Math.max(1,Math.min(t-i.length(),65536)/4),o=new Uint32Array(Math.floor(a));try{e(o);for(var s=0;s<o.length;++s)i.putInt32(o[s])}catch(t){if(!("undefined"!=typeof QuotaExceededError&&t instanceof QuotaExceededError))throw t}}if(i.length()<t)for(var u,c,f,l=Math.floor(65536*Math.random());i.length()<t;){c=16807*(65535&l),c+=(32767&(u=16807*(l>>16)))<<16,l=4294967295&(c=(2147483647&(c+=u>>15))+(c>>31));for(s=0;s<3;++s)f=l>>>(s<<3),f^=Math.floor(256*Math.random()),i.putByte(String.fromCharCode(255&f))}return i.getBytes(t)}return r.pools=i,r.pool=0,r.generate=function(t,e){if(!e)return r.generateSync(t);var n=r.plugin.cipher,i=r.plugin.increment,a=r.plugin.formatKey,o=r.plugin.formatSeed,u=xu.util.createBuffer();r.key=null,function c(f){if(f)return e(f);if(u.length()>=t)return e(null,u.getBytes(t));r.generated>1048575&&(r.key=null);if(null===r.key)return xu.util.nextTick((function(){!function(t){if(r.pools[0].messageLength>=32)return s(),t();var e=32-r.pools[0].messageLength<<5;r.seedFile(e,(function(e,n){if(e)return t(e);r.collect(n),s(),t()}))}(c)}));var l=n(r.key,r.seed);r.generated+=l.length,u.putBytes(l),r.key=a(n(r.key,i(r.seed))),r.seed=o(n(r.key,r.seed)),xu.util.setImmediate(c)}()},r.generateSync=function(t){var e=r.plugin.cipher,n=r.plugin.increment,i=r.plugin.formatKey,a=r.plugin.formatSeed;r.key=null;for(var s=xu.util.createBuffer();s.length()<t;){r.generated>1048575&&(r.key=null),null===r.key&&o();var u=e(r.key,r.seed);r.generated+=u.length,s.putBytes(u),r.key=i(e(r.key,n(r.seed))),r.seed=a(e(r.key,r.seed))}return s.getBytes(t)},e?(r.seedFile=function(t,r){e.randomBytes(t,(function(t,e){if(t)return r(t);r(null,e.toString())}))},r.seedFileSync=function(t){return e.randomBytes(t).toString()}):(r.seedFile=function(t,e){try{e(null,u(t))}catch(t){e(t)}},r.seedFileSync=u),r.collect=function(t){for(var e=t.length,n=0;n<e;++n)r.pools[r.pool].update(t.substr(n,1)),r.pool=31===r.pool?0:r.pool+1},r.collectInt=function(t,e){for(var n="",i=0;i<e;i+=8)n+=String.fromCharCode(t>>i&255);r.collect(n)},r.registerWorker=function(t){if(t===self)r.seedFile=function(t,e){self.addEventListener("message",(function t(r){var n=r.data;n.forge&&n.forge.prng&&(self.removeEventListener("message",t),e(n.forge.prng.err,n.forge.prng.bytes))})),self.postMessage({forge:{prng:{needed:t}}})};else{t.addEventListener("message",(function(e){var n=e.data;n.forge&&n.forge.prng&&r.seedFile(n.forge.prng.needed,(function(e,r){t.postMessage({forge:{prng:{err:e,bytes:r}}})}))}))}},r}})),w((function(t){xu.random&&xu.random.getBytes?t.exports=xu.random:function(e){var r={},n=new Array(4),i=xu.util.createBuffer();function a(){var t=xu.prng.create(r);return t.getBytes=function(e,r){return t.generate(e,r)},t.getBytesSync=function(e){return t.generate(e)},t}r.formatKey=function(t){var e=xu.util.createBuffer(t);return(t=new Array(4))[0]=e.getInt32(),t[1]=e.getInt32(),t[2]=e.getInt32(),t[3]=e.getInt32(),xu.aes._expandKey(t,!1)},r.formatSeed=function(t){var e=xu.util.createBuffer(t);return(t=new Array(4))[0]=e.getInt32(),t[1]=e.getInt32(),t[2]=e.getInt32(),t[3]=e.getInt32(),t},r.cipher=function(t,e){return xu.aes._updateBlock(t,e,n,!1),i.putInt32(n[0]),i.putInt32(n[1]),i.putInt32(n[2]),i.putInt32(n[3]),i.getBytes()},r.increment=function(t){return++t[3],t},r.md=xu.md.sha256;var o=a(),s=null,u=xu.util.globalScope,c=u.crypto||u.msCrypto;if(c&&c.getRandomValues&&(s=function(t){return c.getRandomValues(t)}),!xu.util.isNodejs&&!s){if(o.collectInt(+new Date,32),"undefined"!=typeof navigator){var f="";for(var l in navigator)try{"string"==typeof navigator[l]&&(f+=navigator[l])}catch(t){}o.collect(f),f=null}e&&(e().mousemove((function(t){o.collectInt(t.clientX,16),o.collectInt(t.clientY,16)})),e().keypress((function(t){o.collectInt(t.charCode,8)})))}if(xu.random)for(var l in o)xu.random[l]=o[l];else xu.random=o;xu.random.createInstance=a,t.exports=xu.random}("undefined"!=typeof jQuery?jQuery:null)}));var pc=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],dc=[1,2,3,5],yc=function(t,e){return t<<e&65535|(65535&t)>>16-e},gc=function(t,e){return(65535&t)>>e|t<<16-e&65535};xu.rc2=xu.rc2||{},xu.rc2.expandKey=function(t,e){"string"==typeof t&&(t=xu.util.createBuffer(t)),e=e||128;var r,n=t,i=t.length(),a=e,o=Math.ceil(a/8),s=255>>(7&a);for(r=i;r<128;r++)n.putByte(pc[n.at(r-1)+n.at(r-i)&255]);for(n.setAt(128-o,pc[n.at(128-o)&s]),r=127-o;r>=0;r--)n.setAt(r,pc[n.at(r+1)^n.at(r+o)]);return n};var vc,mc=function(t,e,r){var n,i,a,o,s=!1,u=null,c=null,f=null,l=[];for(t=xu.rc2.expandKey(t,e),a=0;a<64;a++)l.push(t.getInt16Le());r?(n=function(t){for(a=0;a<4;a++)t[a]+=l[o]+(t[(a+3)%4]&t[(a+2)%4])+(~t[(a+3)%4]&t[(a+1)%4]),t[a]=yc(t[a],dc[a]),o++},i=function(t){for(a=0;a<4;a++)t[a]+=l[63&t[(a+3)%4]]}):(n=function(t){for(a=3;a>=0;a--)t[a]=gc(t[a],dc[a]),t[a]-=l[o]+(t[(a+3)%4]&t[(a+2)%4])+(~t[(a+3)%4]&t[(a+1)%4]),o--},i=function(t){for(a=3;a>=0;a--)t[a]-=l[63&t[(a+3)%4]]});var h=function(t){var e=[];for(a=0;a<4;a++){var n=u.getInt16Le();null!==f&&(r?n^=f.getInt16Le():f.putInt16Le(n)),e.push(65535&n)}o=r?0:63;for(var i=0;i<t.length;i++)for(var s=0;s<t[i][0];s++)t[i][1](e);for(a=0;a<4;a++)null!==f&&(r?f.putInt16Le(e[a]):e[a]^=f.getInt16Le()),c.putInt16Le(e[a])},p=null;return p={start:function(t,e){t&&"string"==typeof t&&(t=xu.util.createBuffer(t)),s=!1,u=xu.util.createBuffer(),c=e||new xu.util.createBuffer,f=t,p.output=c},update:function(t){for(s||u.putBuffer(t);u.length()>=8;)h([[5,n],[1,i],[6,n],[1,i],[5,n]])},finish:function(t){var e=!0;if(r)if(t)e=t(8,u,!r);else{var n=8===u.length()?8:8-u.length();u.fillWithByte(n,n)}if(e&&(s=!0,p.update()),!r&&(e=0===u.length()))if(t)e=t(8,c,!r);else{var i=c.length(),a=c.at(i-1);a>i?e=!1:c.truncate(a)}return e}}};function Cc(t,e,r){this.data=[],null!=t&&("number"==typeof t?this.fromNumber(t,e,r):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function Ec(){return new Cc(null)}function Sc(t,e,r,n,i,a){for(var o=16383&e,s=e>>14;--a>=0;){var u=16383&this.data[t],c=this.data[t++]>>14,f=s*u+c*o;i=((u=o*u+((16383&f)<<14)+r.data[n]+i)>>28)+(f>>14)+s*c,r.data[n++]=268435455&u}return i}xu.rc2.startEncrypting=function(t,e,r){var n=xu.rc2.createEncryptionCipher(t,128);return n.start(e,r),n},xu.rc2.createEncryptionCipher=function(t,e){return mc(t,e,!0)},xu.rc2.startDecrypting=function(t,e,r){var n=xu.rc2.createDecryptionCipher(t,128);return n.start(e,r),n},xu.rc2.createDecryptionCipher=function(t,e){return mc(t,e,!1)},xu.jsbn=xu.jsbn||{},xu.jsbn.BigInteger=Cc,"undefined"==typeof navigator?(Cc.prototype.am=Sc,vc=28):"Microsoft Internet Explorer"==navigator.appName?(Cc.prototype.am=function(t,e,r,n,i,a){for(var o=32767&e,s=e>>15;--a>=0;){var u=32767&this.data[t],c=this.data[t++]>>15,f=s*u+c*o;i=((u=o*u+((32767&f)<<15)+r.data[n]+(1073741823&i))>>>30)+(f>>>15)+s*c+(i>>>30),r.data[n++]=1073741823&u}return i},vc=30):"Netscape"!=navigator.appName?(Cc.prototype.am=function(t,e,r,n,i,a){for(;--a>=0;){var o=e*this.data[t++]+r.data[n]+i;i=Math.floor(o/67108864),r.data[n++]=67108863&o}return i},vc=26):(Cc.prototype.am=Sc,vc=28),Cc.prototype.DB=vc,Cc.prototype.DM=(1<<vc)-1,Cc.prototype.DV=1<<vc;Cc.prototype.FV=Math.pow(2,52),Cc.prototype.F1=52-vc,Cc.prototype.F2=2*vc-52;var bc,Tc,Ic=new Array;for(bc="0".charCodeAt(0),Tc=0;Tc<=9;++Tc)Ic[bc++]=Tc;for(bc="a".charCodeAt(0),Tc=10;Tc<36;++Tc)Ic[bc++]=Tc;for(bc="A".charCodeAt(0),Tc=10;Tc<36;++Tc)Ic[bc++]=Tc;function Ac(t){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(t)}function wc(t,e){var r=Ic[t.charCodeAt(e)];return null==r?-1:r}function _c(t){var e=Ec();return e.fromInt(t),e}function Bc(t){var e,r=1;return 0!=(e=t>>>16)&&(t=e,r+=16),0!=(e=t>>8)&&(t=e,r+=8),0!=(e=t>>4)&&(t=e,r+=4),0!=(e=t>>2)&&(t=e,r+=2),0!=(e=t>>1)&&(t=e,r+=1),r}function Nc(t){this.m=t}function kc(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function Rc(t,e){return t&e}function Oc(t,e){return t|e}function Lc(t,e){return t^e}function Pc(t,e){return t&~e}function Uc(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function xc(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function Dc(){}function Vc(t){return t}function Mc(t){this.r2=Ec(),this.q3=Ec(),Cc.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}Nc.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},Nc.prototype.revert=function(t){return t},Nc.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},Nc.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},Nc.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},kc.prototype.convert=function(t){var e=Ec();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(Cc.ZERO)>0&&this.m.subTo(e,e),e},kc.prototype.revert=function(t){var e=Ec();return t.copyTo(e),this.reduce(e),e},kc.prototype.reduce=function(t){for(;t.t<=this.mt2;)t.data[t.t++]=0;for(var e=0;e<this.m.t;++e){var r=32767&t.data[e],n=r*this.mpl+((r*this.mph+(t.data[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t.data[r]+=this.m.am(0,n,t,e,0,this.m.t);t.data[r]>=t.DV;)t.data[r]-=t.DV,t.data[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},kc.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},kc.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},Cc.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s},Cc.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this.data[0]=t:t<-1?this.data[0]=t+this.DV:this.t=0},Cc.prototype.fromString=function(t,e){var r;if(16==e)r=4;else if(8==e)r=3;else if(256==e)r=8;else if(2==e)r=1;else if(32==e)r=5;else{if(4!=e)return void this.fromRadix(t,e);r=2}this.t=0,this.s=0;for(var n=t.length,i=!1,a=0;--n>=0;){var o=8==r?255&t[n]:wc(t,n);o<0?"-"==t.charAt(n)&&(i=!0):(i=!1,0==a?this.data[this.t++]=o:a+r>this.DB?(this.data[this.t-1]|=(o&(1<<this.DB-a)-1)<<a,this.data[this.t++]=o>>this.DB-a):this.data[this.t-1]|=o<<a,(a+=r)>=this.DB&&(a-=this.DB))}8==r&&0!=(128&t[0])&&(this.s=-1,a>0&&(this.data[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),i&&Cc.ZERO.subTo(this,this)},Cc.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this.data[this.t-1]==t;)--this.t},Cc.prototype.dlShiftTo=function(t,e){var r;for(r=this.t-1;r>=0;--r)e.data[r+t]=this.data[r];for(r=t-1;r>=0;--r)e.data[r]=0;e.t=this.t+t,e.s=this.s},Cc.prototype.drShiftTo=function(t,e){for(var r=t;r<this.t;++r)e.data[r-t]=this.data[r];e.t=Math.max(this.t-t,0),e.s=this.s},Cc.prototype.lShiftTo=function(t,e){var r,n=t%this.DB,i=this.DB-n,a=(1<<i)-1,o=Math.floor(t/this.DB),s=this.s<<n&this.DM;for(r=this.t-1;r>=0;--r)e.data[r+o+1]=this.data[r]>>i|s,s=(this.data[r]&a)<<n;for(r=o-1;r>=0;--r)e.data[r]=0;e.data[o]=s,e.t=this.t+o+1,e.s=this.s,e.clamp()},Cc.prototype.rShiftTo=function(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t)e.t=0;else{var n=t%this.DB,i=this.DB-n,a=(1<<n)-1;e.data[0]=this.data[r]>>n;for(var o=r+1;o<this.t;++o)e.data[o-r-1]|=(this.data[o]&a)<<i,e.data[o-r]=this.data[o]>>n;n>0&&(e.data[this.t-r-1]|=(this.s&a)<<i),e.t=this.t-r,e.clamp()}},Cc.prototype.subTo=function(t,e){for(var r=0,n=0,i=Math.min(t.t,this.t);r<i;)n+=this.data[r]-t.data[r],e.data[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n-=t.s;r<this.t;)n+=this.data[r],e.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n-=t.data[r],e.data[r++]=n&this.DM,n>>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e.data[r++]=this.DV+n:n>0&&(e.data[r++]=n),e.t=r,e.clamp()},Cc.prototype.multiplyTo=function(t,e){var r=this.abs(),n=t.abs(),i=r.t;for(e.t=i+n.t;--i>=0;)e.data[i]=0;for(i=0;i<n.t;++i)e.data[i+r.t]=r.am(0,n.data[i],e,i,0,r.t);e.s=0,e.clamp(),this.s!=t.s&&Cc.ZERO.subTo(e,e)},Cc.prototype.squareTo=function(t){for(var e=this.abs(),r=t.t=2*e.t;--r>=0;)t.data[r]=0;for(r=0;r<e.t-1;++r){var n=e.am(r,e.data[r],t,2*r,0,1);(t.data[r+e.t]+=e.am(r+1,2*e.data[r],t,2*r+1,n,e.t-r-1))>=e.DV&&(t.data[r+e.t]-=e.DV,t.data[r+e.t+1]=1)}t.t>0&&(t.data[t.t-1]+=e.am(r,e.data[r],t,2*r,0,1)),t.s=0,t.clamp()},Cc.prototype.divRemTo=function(t,e,r){var n=t.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t)return null!=e&&e.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=Ec());var a=Ec(),o=this.s,s=t.s,u=this.DB-Bc(n.data[n.t-1]);u>0?(n.lShiftTo(u,a),i.lShiftTo(u,r)):(n.copyTo(a),i.copyTo(r));var c=a.t,f=a.data[c-1];if(0!=f){var l=f*(1<<this.F1)+(c>1?a.data[c-2]>>this.F2:0),h=this.FV/l,p=(1<<this.F1)/l,d=1<<this.F2,y=r.t,g=y-c,v=null==e?Ec():e;for(a.dlShiftTo(g,v),r.compareTo(v)>=0&&(r.data[r.t++]=1,r.subTo(v,r)),Cc.ONE.dlShiftTo(c,v),v.subTo(a,a);a.t<c;)a.data[a.t++]=0;for(;--g>=0;){var m=r.data[--y]==f?this.DM:Math.floor(r.data[y]*h+(r.data[y-1]+d)*p);if((r.data[y]+=a.am(0,m,r,g,0,c))<m)for(a.dlShiftTo(g,v),r.subTo(v,r);r.data[y]<--m;)r.subTo(v,r)}null!=e&&(r.drShiftTo(c,e),o!=s&&Cc.ZERO.subTo(e,e)),r.t=c,r.clamp(),u>0&&r.rShiftTo(u,r),o<0&&Cc.ZERO.subTo(r,r)}}},Cc.prototype.invDigit=function(){if(this.t<1)return 0;var t=this.data[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},Cc.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},Cc.prototype.exp=function(t,e){if(t>4294967295||t<1)return Cc.ONE;var r=Ec(),n=Ec(),i=e.convert(this),a=Bc(t)-1;for(i.copyTo(r);--a>=0;)if(e.sqrTo(r,n),(t&1<<a)>0)e.mulTo(n,i,r);else{var o=r;r=n,n=o}return e.revert(r)},Cc.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var r,n=(1<<e)-1,i=!1,a="",o=this.t,s=this.DB-o*this.DB%e;if(o-- >0)for(s<this.DB&&(r=this.data[o]>>s)>0&&(i=!0,a=Ac(r));o>=0;)s<e?(r=(this.data[o]&(1<<s)-1)<<e-s,r|=this.data[--o]>>(s+=this.DB-e)):(r=this.data[o]>>(s-=e)&n,s<=0&&(s+=this.DB,--o)),r>0&&(i=!0),i&&(a+=Ac(r));return i?a:"0"},Cc.prototype.negate=function(){var t=Ec();return Cc.ZERO.subTo(this,t),t},Cc.prototype.abs=function(){return this.s<0?this.negate():this},Cc.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;if(0!=(e=r-t.t))return this.s<0?-e:e;for(;--r>=0;)if(0!=(e=this.data[r]-t.data[r]))return e;return 0},Cc.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+Bc(this.data[this.t-1]^this.s&this.DM)},Cc.prototype.mod=function(t){var e=Ec();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(Cc.ZERO)>0&&t.subTo(e,e),e},Cc.prototype.modPowInt=function(t,e){var r;return r=t<256||e.isEven()?new Nc(e):new kc(e),this.exp(t,r)},Cc.ZERO=_c(0),Cc.ONE=_c(1),Dc.prototype.convert=Vc,Dc.prototype.revert=Vc,Dc.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r)},Dc.prototype.sqrTo=function(t,e){t.squareTo(e)},Mc.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=Ec();return t.copyTo(e),this.reduce(e),e},Mc.prototype.revert=function(t){return t},Mc.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},Mc.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},Mc.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var jc=[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],Fc=(1<<26)/jc[jc.length-1];if(Cc.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},Cc.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=_c(r),i=Ec(),a=Ec(),o="";for(this.divRemTo(n,i,a);i.signum()>0;)o=(r+a.intValue()).toString(t).substr(1)+o,i.divRemTo(n,i,a);return a.intValue().toString(t)+o},Cc.prototype.fromRadix=function(t,e){this.fromInt(0),null==e&&(e=10);for(var r=this.chunkSize(e),n=Math.pow(e,r),i=!1,a=0,o=0,s=0;s<t.length;++s){var u=wc(t,s);u<0?"-"==t.charAt(s)&&0==this.signum()&&(i=!0):(o=e*o+u,++a>=r&&(this.dMultiply(n),this.dAddOffset(o,0),a=0,o=0))}a>0&&(this.dMultiply(Math.pow(e,a)),this.dAddOffset(o,0)),i&&Cc.ZERO.subTo(this,this)},Cc.prototype.fromNumber=function(t,e,r){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(Cc.ONE.shiftLeft(t-1),Oc,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(Cc.ONE.shiftLeft(t-1),this);else{var n=new Array,i=7&t;n.length=1+(t>>3),e.nextBytes(n),i>0?n[0]&=(1<<i)-1:n[0]=0,this.fromString(n,256)}},Cc.prototype.bitwiseTo=function(t,e,r){var n,i,a=Math.min(t.t,this.t);for(n=0;n<a;++n)r.data[n]=e(this.data[n],t.data[n]);if(t.t<this.t){for(i=t.s&this.DM,n=a;n<this.t;++n)r.data[n]=e(this.data[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=a;n<t.t;++n)r.data[n]=e(i,t.data[n]);r.t=t.t}r.s=e(this.s,t.s),r.clamp()},Cc.prototype.changeBit=function(t,e){var r=Cc.ONE.shiftLeft(t);return this.bitwiseTo(r,e,r),r},Cc.prototype.addTo=function(t,e){for(var r=0,n=0,i=Math.min(t.t,this.t);r<i;)n+=this.data[r]+t.data[r],e.data[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n+=t.s;r<this.t;)n+=this.data[r],e.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n+=t.data[r],e.data[r++]=n&this.DM,n>>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e.data[r++]=n:n<-1&&(e.data[r++]=this.DV+n),e.t=r,e.clamp()},Cc.prototype.dMultiply=function(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},Cc.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this.data[this.t++]=0;for(this.data[e]+=t;this.data[e]>=this.DV;)this.data[e]-=this.DV,++e>=this.t&&(this.data[this.t++]=0),++this.data[e]}},Cc.prototype.multiplyLowerTo=function(t,e,r){var n,i=Math.min(this.t+t.t,e);for(r.s=0,r.t=i;i>0;)r.data[--i]=0;for(n=r.t-this.t;i<n;++i)r.data[i+this.t]=this.am(0,t.data[i],r,i,0,this.t);for(n=Math.min(t.t,e);i<n;++i)this.am(0,t.data[i],r,i,0,e-i);r.clamp()},Cc.prototype.multiplyUpperTo=function(t,e,r){--e;var n=r.t=this.t+t.t-e;for(r.s=0;--n>=0;)r.data[n]=0;for(n=Math.max(e-this.t,0);n<t.t;++n)r.data[this.t+n-e]=this.am(e-n,t.data[n],r,0,0,this.t+n-e);r.clamp(),r.drShiftTo(1,r)},Cc.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(0==e)r=this.data[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this.data[n])%t;return r},Cc.prototype.millerRabin=function(t){var e=this.subtract(Cc.ONE),r=e.getLowestSetBit();if(r<=0)return!1;for(var n,i=e.shiftRight(r),a={nextBytes:function(t){for(var e=0;e<t.length;++e)t[e]=Math.floor(256*Math.random())}},o=0;o<t;++o){do{n=new Cc(this.bitLength(),a)}while(n.compareTo(Cc.ONE)<=0||n.compareTo(e)>=0);var s=n.modPow(i,this);if(0!=s.compareTo(Cc.ONE)&&0!=s.compareTo(e)){for(var u=1;u++<r&&0!=s.compareTo(e);)if(0==(s=s.modPowInt(2,this)).compareTo(Cc.ONE))return!1;if(0!=s.compareTo(e))return!1}}return!0},Cc.prototype.clone=function(){var t=Ec();return this.copyTo(t),t},Cc.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this.data[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this.data[0];if(0==this.t)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]},Cc.prototype.byteValue=function(){return 0==this.t?this.s:this.data[0]<<24>>24},Cc.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},Cc.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},Cc.prototype.toByteArray=function(){var t=this.t,e=new Array;e[0]=this.s;var r,n=this.DB-t*this.DB%8,i=0;if(t-- >0)for(n<this.DB&&(r=this.data[t]>>n)!=(this.s&this.DM)>>n&&(e[i++]=r|this.s<<this.DB-n);t>=0;)n<8?(r=(this.data[t]&(1<<n)-1)<<8-n,r|=this.data[--t]>>(n+=this.DB-8)):(r=this.data[t]>>(n-=8)&255,n<=0&&(n+=this.DB,--t)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(e[i++]=r);return e},Cc.prototype.equals=function(t){return 0==this.compareTo(t)},Cc.prototype.min=function(t){return this.compareTo(t)<0?this:t},Cc.prototype.max=function(t){return this.compareTo(t)>0?this:t},Cc.prototype.and=function(t){var e=Ec();return this.bitwiseTo(t,Rc,e),e},Cc.prototype.or=function(t){var e=Ec();return this.bitwiseTo(t,Oc,e),e},Cc.prototype.xor=function(t){var e=Ec();return this.bitwiseTo(t,Lc,e),e},Cc.prototype.andNot=function(t){var e=Ec();return this.bitwiseTo(t,Pc,e),e},Cc.prototype.not=function(){for(var t=Ec(),e=0;e<this.t;++e)t.data[e]=this.DM&~this.data[e];return t.t=this.t,t.s=~this.s,t},Cc.prototype.shiftLeft=function(t){var e=Ec();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},Cc.prototype.shiftRight=function(t){var e=Ec();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},Cc.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this.data[t])return t*this.DB+Uc(this.data[t]);return this.s<0?this.t*this.DB:-1},Cc.prototype.bitCount=function(){for(var t=0,e=this.s&this.DM,r=0;r<this.t;++r)t+=xc(this.data[r]^e);return t},Cc.prototype.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this.data[e]&1<<t%this.DB)},Cc.prototype.setBit=function(t){return this.changeBit(t,Oc)},Cc.prototype.clearBit=function(t){return this.changeBit(t,Pc)},Cc.prototype.flipBit=function(t){return this.changeBit(t,Lc)},Cc.prototype.add=function(t){var e=Ec();return this.addTo(t,e),e},Cc.prototype.subtract=function(t){var e=Ec();return this.subTo(t,e),e},Cc.prototype.multiply=function(t){var e=Ec();return this.multiplyTo(t,e),e},Cc.prototype.divide=function(t){var e=Ec();return this.divRemTo(t,e,null),e},Cc.prototype.remainder=function(t){var e=Ec();return this.divRemTo(t,null,e),e},Cc.prototype.divideAndRemainder=function(t){var e=Ec(),r=Ec();return this.divRemTo(t,e,r),new Array(e,r)},Cc.prototype.modPow=function(t,e){var r,n,i=t.bitLength(),a=_c(1);if(i<=0)return a;r=i<18?1:i<48?3:i<144?4:i<768?5:6,n=i<8?new Nc(e):e.isEven()?new Mc(e):new kc(e);var o=new Array,s=3,u=r-1,c=(1<<r)-1;if(o[1]=n.convert(this),r>1){var f=Ec();for(n.sqrTo(o[1],f);s<=c;)o[s]=Ec(),n.mulTo(f,o[s-2],o[s]),s+=2}var l,h,p=t.t-1,d=!0,y=Ec();for(i=Bc(t.data[p])-1;p>=0;){for(i>=u?l=t.data[p]>>i-u&c:(l=(t.data[p]&(1<<i+1)-1)<<u-i,p>0&&(l|=t.data[p-1]>>this.DB+i-u)),s=r;0==(1&l);)l>>=1,--s;if((i-=s)<0&&(i+=this.DB,--p),d)o[l].copyTo(a),d=!1;else{for(;s>1;)n.sqrTo(a,y),n.sqrTo(y,a),s-=2;s>0?n.sqrTo(a,y):(h=a,a=y,y=h),n.mulTo(y,o[l],a)}for(;p>=0&&0==(t.data[p]&1<<i);)n.sqrTo(a,y),h=a,a=y,y=h,--i<0&&(i=this.DB-1,--p)}return n.revert(a)},Cc.prototype.modInverse=function(t){var e=t.isEven();if(this.isEven()&&e||0==t.signum())return Cc.ZERO;for(var r=t.clone(),n=this.clone(),i=_c(1),a=_c(0),o=_c(0),s=_c(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),e?(i.isEven()&&a.isEven()||(i.addTo(this,i),a.subTo(t,a)),i.rShiftTo(1,i)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);for(;n.isEven();)n.rShiftTo(1,n),e?(o.isEven()&&s.isEven()||(o.addTo(this,o),s.subTo(t,s)),o.rShiftTo(1,o)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);r.compareTo(n)>=0?(r.subTo(n,r),e&&i.subTo(o,i),a.subTo(s,a)):(n.subTo(r,n),e&&o.subTo(i,o),s.subTo(a,s))}return 0!=n.compareTo(Cc.ONE)?Cc.ZERO:s.compareTo(t)>=0?s.subtract(t):s.signum()<0?(s.addTo(t,s),s.signum()<0?s.add(t):s):s},Cc.prototype.pow=function(t){return this.exp(t,new Dc)},Cc.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(e.compareTo(r)<0){var n=e;e=r,r=n}var i=e.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)return e;for(i<a&&(a=i),a>0&&(e.rShiftTo(a,e),r.rShiftTo(a,r));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return a>0&&r.lShiftTo(a,r),r},Cc.prototype.isProbablePrime=function(t){var e,r=this.abs();if(1==r.t&&r.data[0]<=jc[jc.length-1]){for(e=0;e<jc.length;++e)if(r.data[0]==jc[e])return!0;return!1}if(r.isEven())return!1;for(e=1;e<jc.length;){for(var n=jc[e],i=e+1;i<jc.length&&n<Fc;)n*=jc[i++];for(n=r.modInt(n);e<i;)if(n%jc[e++]==0)return!1}return r.millerRabin(t)},w((function(t){var e=t.exports=xu.sha1=xu.sha1||{};xu.md.sha1=xu.md.algorithms.sha1=e,e.create=function(){n||(r=String.fromCharCode(128),r+=xu.util.fillString(String.fromCharCode(0),64),n=!0);var t=null,e=xu.util.createBuffer(),a=new Array(80),o={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){o.messageLength=0,o.fullMessageLength=o.messageLength64=[];for(var r=o.messageLengthSize/4,n=0;n<r;++n)o.fullMessageLength.push(0);return e=xu.util.createBuffer(),t={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},o}};return o.start(),o.update=function(r,n){"utf8"===n&&(r=xu.util.encodeUtf8(r));var s=r.length;o.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var u=o.fullMessageLength.length-1;u>=0;--u)o.fullMessageLength[u]+=s[1],s[1]=s[0]+(o.fullMessageLength[u]/4294967296>>>0),o.fullMessageLength[u]=o.fullMessageLength[u]>>>0,s[0]=s[1]/4294967296>>>0;return e.putBytes(r),i(t,a,e),(e.read>2048||0===e.length())&&e.compact(),o},o.digest=function(){var n=xu.util.createBuffer();n.putBytes(e.bytes());var s,u=o.fullMessageLength[o.fullMessageLength.length-1]+o.messageLengthSize&o.blockLength-1;n.putBytes(r.substr(0,o.blockLength-u));for(var c=8*o.fullMessageLength[0],f=0;f<o.fullMessageLength.length-1;++f)c+=(s=8*o.fullMessageLength[f+1])/4294967296>>>0,n.putInt32(c>>>0),c=s>>>0;n.putInt32(c);var l={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4};i(l,a,n);var h=xu.util.createBuffer();return h.putInt32(l.h0),h.putInt32(l.h1),h.putInt32(l.h2),h.putInt32(l.h3),h.putInt32(l.h4),h},o};var r=null,n=!1;function i(t,e,r){for(var n,i,a,o,s,u,c,f=r.length();f>=64;){for(i=t.h0,a=t.h1,o=t.h2,s=t.h3,u=t.h4,c=0;c<16;++c)n=r.getInt32(),e[c]=n,n=(i<<5|i>>>27)+(s^a&(o^s))+u+1518500249+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<20;++c)n=(n=e[c-3]^e[c-8]^e[c-14]^e[c-16])<<1|n>>>31,e[c]=n,n=(i<<5|i>>>27)+(s^a&(o^s))+u+1518500249+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<32;++c)n=(n=e[c-3]^e[c-8]^e[c-14]^e[c-16])<<1|n>>>31,e[c]=n,n=(i<<5|i>>>27)+(a^o^s)+u+1859775393+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<40;++c)n=(n=e[c-6]^e[c-16]^e[c-28]^e[c-32])<<2|n>>>30,e[c]=n,n=(i<<5|i>>>27)+(a^o^s)+u+1859775393+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<60;++c)n=(n=e[c-6]^e[c-16]^e[c-28]^e[c-32])<<2|n>>>30,e[c]=n,n=(i<<5|i>>>27)+(a&o|s&(a^o))+u+2400959708+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<80;++c)n=(n=e[c-6]^e[c-16]^e[c-28]^e[c-32])<<2|n>>>30,e[c]=n,n=(i<<5|i>>>27)+(a^o^s)+u+3395469782+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;t.h0=t.h0+i|0,t.h1=t.h1+a|0,t.h2=t.h2+o|0,t.h3=t.h3+s|0,t.h4=t.h4+u|0,f-=64}}})),w((function(t){var e=t.exports=xu.pkcs1=xu.pkcs1||{};function r(t,e,r){r||(r=xu.md.sha1.create());for(var n="",i=Math.ceil(e/r.digestLength),a=0;a<i;++a){var o=String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,255&a);r.start(),r.update(t+o),n+=r.digest().getBytes()}return n.substring(0,e)}e.encode_rsa_oaep=function(t,e,n){var i,a,o,s;"string"==typeof n?(i=n,a=arguments[3]||void 0,o=arguments[4]||void 0):n&&(i=n.label||void 0,a=n.seed||void 0,o=n.md||void 0,n.mgf1&&n.mgf1.md&&(s=n.mgf1.md)),o?o.start():o=xu.md.sha1.create(),s||(s=o);var u=Math.ceil(t.n.bitLength()/8),c=u-2*o.digestLength-2;if(e.length>c)throw(y=new Error("RSAES-OAEP input message length is too long.")).length=e.length,y.maxLength=c,y;i||(i=""),o.update(i,"raw");for(var f=o.digest(),l="",h=c-e.length,p=0;p<h;p++)l+="\0";var d=f.getBytes()+l+""+e;if(a){if(a.length!==o.digestLength){var y;throw(y=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.")).seedLength=a.length,y.digestLength=o.digestLength,y}}else a=xu.random.getBytes(o.digestLength);var g=r(a,u-o.digestLength-1,s),v=xu.util.xorBytes(d,g,d.length),m=r(v,o.digestLength,s),C=xu.util.xorBytes(a,m,a.length);return"\0"+C+v},e.decode_rsa_oaep=function(t,e,n){var i,a,o;"string"==typeof n?(i=n,a=arguments[3]||void 0):n&&(i=n.label||void 0,a=n.md||void 0,n.mgf1&&n.mgf1.md&&(o=n.mgf1.md));var s=Math.ceil(t.n.bitLength()/8);if(e.length!==s)throw(v=new Error("RSAES-OAEP encoded message length is invalid.")).length=e.length,v.expectedLength=s,v;if(void 0===a?a=xu.md.sha1.create():a.start(),o||(o=a),s<2*a.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");i||(i=""),a.update(i,"raw");for(var u=a.digest().getBytes(),c=e.charAt(0),f=e.substring(1,a.digestLength+1),l=e.substring(1+a.digestLength),h=r(l,a.digestLength,o),p=xu.util.xorBytes(f,h,f.length),d=r(p,s-a.digestLength-1,o),y=xu.util.xorBytes(l,d,l.length),g=y.substring(0,a.digestLength),v="\0"!==c,m=0;m<a.digestLength;++m)v|=u.charAt(m)!==g.charAt(m);for(var C=1,E=a.digestLength,S=a.digestLength;S<y.length;S++){var b=y.charCodeAt(S),T=1&b^1,I=C?65534:0;v|=b&I,E+=C&=T}if(v||1!==y.charCodeAt(E))throw new Error("Invalid RSAES-OAEP padding.");return y.substring(E+1)}})),w((function(t){!function(){if(xu.prime)t.exports=xu.prime;else{var e=t.exports=xu.prime=xu.prime||{},r=xu.jsbn.BigInteger,n=[6,4,2,4,2,4,6,2],i=new r(null);i.fromInt(30);var a=function(t,e){return t|e};e.generateProbablePrime=function(t,e,n){"function"==typeof e&&(n=e,e={});var i=(e=e||{}).algorithm||"PRIMEINC";"string"==typeof i&&(i={name:i}),i.options=i.options||{};var a=e.prng||xu.random,s={nextBytes:function(t){for(var e=a.getBytesSync(t.length),r=0;r<t.length;++r)t[r]=e.charCodeAt(r)}};if("PRIMEINC"===i.name)return function(t,e,n,i){if("workers"in n)return function(t,e,n,i){if("undefined"==typeof Worker)return o(t,e,n,i);var a=u(t,e),s=n.workers,c=n.workLoad||100,f=30*c/8,l=n.workerScript||"forge/prime.worker.js";if(-1===s)return xu.util.estimateCores((function(t,e){t&&(e=2),s=e-1,h()}));function h(){s=Math.max(1,s);for(var n=[],o=0;o<s;++o)n[o]=new Worker(l);for(o=0;o<s;++o)n[o].addEventListener("message",p);var h=!1;function p(o){if(!h){var s=o.data;if(s.found){for(var l=0;l<n.length;++l)n[l].terminate();return h=!0,i(null,new r(s.prime,16))}a.bitLength()>t&&(a=u(t,e));var p=a.toString(16);o.target.postMessage({hex:p,workLoad:c}),a.dAddOffset(f,0)}}}h()}(t,e,n,i);return o(t,e,n,i)}(t,s,i.options,n);throw new Error("Invalid prime generation algorithm: "+i.name)}}function o(t,e,r,n){var i=u(t,e),a=function(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}(i.bitLength());"millerRabinTests"in r&&(a=r.millerRabinTests);var o=10;"maxBlockTime"in r&&(o=r.maxBlockTime),s(i,t,e,0,a,o,n)}function s(t,e,r,i,a,o,c){var f=+new Date;do{if(t.bitLength()>e&&(t=u(e,r)),t.isProbablePrime(a))return c(null,t);t.dAddOffset(n[i++%8],0)}while(o<0||+new Date-f<o);xu.util.setImmediate((function(){s(t,e,r,i,a,o,c)}))}function u(t,e){var n=new r(t,e),o=t-1;return n.testBit(o)||n.bitwiseTo(r.ONE.shiftLeft(o),a,n),n.dAddOffset(31-n.mod(i).byteValue(),0),n}}()})),void 0===Kc)var Kc=xu.jsbn.BigInteger;var qc=xu.util.isNodejs?y.default:null,Gc=xu.asn1,zc=xu.util;xu.pki=xu.pki||{},xu.pki.rsa=xu.rsa=xu.rsa||{};var Wc=xu.pki,Hc=[6,4,2,4,2,4,6,2],Qc={name:"PrivateKeyInfo",tagClass:Gc.Class.UNIVERSAL,type:Gc.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:Gc.Class.UNIVERSAL,type:Gc.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:Gc.Class.UNIVERSAL,type:Gc.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Gc.Class.UNIVERSAL,type:Gc.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:Gc.Class.UNIVERSAL,type:Gc.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},Yc={name:"RSAPrivateKey",tagClass:Gc.Class.UNIVERSAL,type:Gc.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:Gc.Class.UNIVERSAL,type:Gc.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:Gc.Class.UNIVERSAL,type:Gc.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:Gc.Class.UNIVERSAL,type:Gc.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:Gc.Class.UNIVERSAL,type:Gc.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:Gc.Class.UNIVERSAL,type:Gc.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:Gc.Class.UNIVERSAL,type:Gc.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:Gc.Class.UNIVERSAL,type:Gc.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:Gc.Class.UNIVERSAL,type:Gc.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:Gc.Class.UNIVERSAL,type:Gc.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},Xc={name:"RSAPublicKey",tagClass:Gc.Class.UNIVERSAL,type:Gc.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:Gc.Class.UNIVERSAL,type:Gc.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:Gc.Class.UNIVERSAL,type:Gc.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},$c=xu.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:Gc.Class.UNIVERSAL,type:Gc.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:Gc.Class.UNIVERSAL,type:Gc.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Gc.Class.UNIVERSAL,type:Gc.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:Gc.Class.UNIVERSAL,type:Gc.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:Gc.Class.UNIVERSAL,type:Gc.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},Zc=function(t){var e;if(!(t.algorithm in Wc.oids)){var r=new Error("Unknown message digest algorithm.");throw r.algorithm=t.algorithm,r}e=Wc.oids[t.algorithm];var n=Gc.oidToDer(e).getBytes(),i=Gc.create(Gc.Class.UNIVERSAL,Gc.Type.SEQUENCE,!0,[]),a=Gc.create(Gc.Class.UNIVERSAL,Gc.Type.SEQUENCE,!0,[]);a.value.push(Gc.create(Gc.Class.UNIVERSAL,Gc.Type.OID,!1,n)),a.value.push(Gc.create(Gc.Class.UNIVERSAL,Gc.Type.NULL,!1,""));var o=Gc.create(Gc.Class.UNIVERSAL,Gc.Type.OCTETSTRING,!1,t.digest().getBytes());return i.value.push(a),i.value.push(o),Gc.toDer(i).getBytes()},Jc=function(t,e,r){if(r)return t.modPow(e.e,e.n);if(!e.p||!e.q)return t.modPow(e.d,e.n);var n;e.dP||(e.dP=e.d.mod(e.p.subtract(Kc.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(Kc.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));do{n=new Kc(xu.util.bytesToHex(xu.random.getBytes(e.n.bitLength()/8)),16)}while(n.compareTo(e.n)>=0||!n.gcd(e.n).equals(Kc.ONE));for(var i=(t=t.multiply(n.modPow(e.e,e.n)).mod(e.n)).mod(e.p).modPow(e.dP,e.p),a=t.mod(e.q).modPow(e.dQ,e.q);i.compareTo(a)<0;)i=i.add(e.p);var o=i.subtract(a).multiply(e.qInv).mod(e.p).multiply(e.q).add(a);return o=o.multiply(n.modInverse(e.n)).mod(e.n)};function tf(t,e,r){var n=xu.util.createBuffer(),i=Math.ceil(e.n.bitLength()/8);if(t.length>i-11){var a=new Error("Message is too long for PKCS#1 v1.5 padding.");throw a.length=t.length,a.max=i-11,a}n.putByte(0),n.putByte(r);var o,s=i-3-t.length;if(0===r||1===r){o=0===r?0:255;for(var u=0;u<s;++u)n.putByte(o)}else for(;s>0;){var c=0,f=xu.random.getBytes(s);for(u=0;u<s;++u)0===(o=f.charCodeAt(u))?++c:n.putByte(o);s=c}return n.putByte(0),n.putBytes(t),n}function ef(t,e,r,n){var i=Math.ceil(e.n.bitLength()/8),a=xu.util.createBuffer(t),o=a.getByte(),s=a.getByte();if(0!==o||r&&0!==s&&1!==s||!r&&2!=s||r&&0===s&&void 0===n)throw new Error("Encryption block is invalid.");var u=0;if(0===s){u=i-3-n;for(var c=0;c<u;++c)if(0!==a.getByte())throw new Error("Encryption block is invalid.")}else if(1===s)for(u=0;a.length()>1;){if(255!==a.getByte()){--a.read;break}++u}else if(2===s)for(u=0;a.length()>1;){if(0===a.getByte()){--a.read;break}++u}if(0!==a.getByte()||u!==i-3-a.length())throw new Error("Encryption block is invalid.");return a.getBytes()}function rf(t,e,r){"function"==typeof e&&(r=e,e={});var n={algorithm:{name:(e=e||{}).algorithm||"PRIMEINC",options:{workers:e.workers||2,workLoad:e.workLoad||100,workerScript:e.workerScript}}};function i(){a(t.pBits,(function(e,n){return e?r(e):(t.p=n,null!==t.q?o(e,t.q):void a(t.qBits,o))}))}function a(t,e){xu.prime.generateProbablePrime(t,n,e)}function o(e,n){if(e)return r(e);if(t.q=n,t.p.compareTo(t.q)<0){var s=t.p;t.p=t.q,t.q=s}if(0!==t.p.subtract(Kc.ONE).gcd(t.e).compareTo(Kc.ONE))return t.p=null,void i();if(0!==t.q.subtract(Kc.ONE).gcd(t.e).compareTo(Kc.ONE))return t.q=null,void a(t.qBits,o);if(t.p1=t.p.subtract(Kc.ONE),t.q1=t.q.subtract(Kc.ONE),t.phi=t.p1.multiply(t.q1),0!==t.phi.gcd(t.e).compareTo(Kc.ONE))return t.p=t.q=null,void i();if(t.n=t.p.multiply(t.q),t.n.bitLength()!==t.bits)return t.q=null,void a(t.qBits,o);var u=t.e.modInverse(t.phi);t.keys={privateKey:Wc.rsa.setPrivateKey(t.n,t.e,u,t.p,t.q,u.mod(t.p1),u.mod(t.q1),t.q.modInverse(t.p)),publicKey:Wc.rsa.setPublicKey(t.n,t.e)},r(null,t.keys)}"prng"in e&&(n.prng=e.prng),i()}function nf(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=xu.util.hexToBytes(e);return r.length>1&&(0===r.charCodeAt(0)&&0==(128&r.charCodeAt(1))||255===r.charCodeAt(0)&&128==(128&r.charCodeAt(1)))?r.substr(1):r}function af(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}function of(t){return xu.util.isNodejs&&"function"==typeof qc[t]}function sf(t){return void 0!==zc.globalScope&&"object"==typeof zc.globalScope.crypto&&"object"==typeof zc.globalScope.crypto.subtle&&"function"==typeof zc.globalScope.crypto.subtle[t]}function uf(t){return void 0!==zc.globalScope&&"object"==typeof zc.globalScope.msCrypto&&"object"==typeof zc.globalScope.msCrypto.subtle&&"function"==typeof zc.globalScope.msCrypto.subtle[t]}function cf(t){for(var e=xu.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),n=0;n<e.length;++n)r[n]=e.charCodeAt(n);return r}if(Wc.rsa.encrypt=function(t,e,r){var n,i=r,a=Math.ceil(e.n.bitLength()/8);!1!==r&&!0!==r?(i=2===r,n=tf(t,e,r)):(n=xu.util.createBuffer()).putBytes(t);for(var o=new Kc(n.toHex(),16),s=Jc(o,e,i).toString(16),u=xu.util.createBuffer(),c=a-Math.ceil(s.length/2);c>0;)u.putByte(0),--c;return u.putBytes(xu.util.hexToBytes(s)),u.getBytes()},Wc.rsa.decrypt=function(t,e,r,n){var i=Math.ceil(e.n.bitLength()/8);if(t.length!==i){var a=new Error("Encrypted message length is invalid.");throw a.length=t.length,a.expected=i,a}var o=new Kc(xu.util.createBuffer(t).toHex(),16);if(o.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var s=Jc(o,e,r).toString(16),u=xu.util.createBuffer(),c=i-Math.ceil(s.length/2);c>0;)u.putByte(0),--c;return u.putBytes(xu.util.hexToBytes(s)),!1!==n?ef(u.getBytes(),e,r):u.getBytes()},Wc.rsa.createKeyPairGenerationState=function(t,e,r){"string"==typeof t&&(t=parseInt(t,10)),t=t||2048;var n,i=(r=r||{}).prng||xu.random,a={nextBytes:function(t){for(var e=i.getBytesSync(t.length),r=0;r<t.length;++r)t[r]=e.charCodeAt(r)}},o=r.algorithm||"PRIMEINC";if("PRIMEINC"!==o)throw new Error("Invalid key generation algorithm: "+o);return(n={algorithm:o,state:0,bits:t,rng:a,eInt:e||65537,e:new Kc(null),p:null,q:null,qBits:t>>1,pBits:t-(t>>1),pqState:0,num:null,keys:null}).e.fromInt(n.eInt),n},Wc.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var r=new Kc(null);r.fromInt(30);for(var n,i=0,a=function(t,e){return t|e},o=+new Date,s=0;null===t.keys&&(e<=0||s<e);){if(0===t.state){var u=null===t.p?t.pBits:t.qBits,c=u-1;0===t.pqState?(t.num=new Kc(u,t.rng),t.num.testBit(c)||t.num.bitwiseTo(Kc.ONE.shiftLeft(c),a,t.num),t.num.dAddOffset(31-t.num.mod(r).byteValue(),0),i=0,++t.pqState):1===t.pqState?t.num.bitLength()>u?t.pqState=0:t.num.isProbablePrime(af(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(Hc[i++%8],0):2===t.pqState?t.pqState=0===t.num.subtract(Kc.ONE).gcd(t.e).compareTo(Kc.ONE)?3:0:3===t.pqState&&(t.pqState=0,null===t.p?t.p=t.num:t.q=t.num,null!==t.p&&null!==t.q&&++t.state,t.num=null)}else if(1===t.state)t.p.compareTo(t.q)<0&&(t.num=t.p,t.p=t.q,t.q=t.num),++t.state;else if(2===t.state)t.p1=t.p.subtract(Kc.ONE),t.q1=t.q.subtract(Kc.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(3===t.state)0===t.phi.gcd(t.e).compareTo(Kc.ONE)?++t.state:(t.p=null,t.q=null,t.state=0);else if(4===t.state)t.n=t.p.multiply(t.q),t.n.bitLength()===t.bits?++t.state:(t.q=null,t.state=0);else if(5===t.state){var f=t.e.modInverse(t.phi);t.keys={privateKey:Wc.rsa.setPrivateKey(t.n,t.e,f,t.p,t.q,f.mod(t.p1),f.mod(t.q1),t.q.modInverse(t.p)),publicKey:Wc.rsa.setPublicKey(t.n,t.e)}}s+=(n=+new Date)-o,o=n}return null!==t.keys},Wc.rsa.generateKeyPair=function(t,e,r,n){if(1===arguments.length?"object"==typeof t?(r=t,t=void 0):"function"==typeof t&&(n=t,t=void 0):2===arguments.length?"number"==typeof t?"function"==typeof e?(n=e,e=void 0):"number"!=typeof e&&(r=e,e=void 0):(r=t,n=e,t=void 0,e=void 0):3===arguments.length&&("number"==typeof e?"function"==typeof r&&(n=r,r=void 0):(n=r,r=e,e=void 0)),r=r||{},void 0===t&&(t=r.bits||2048),void 0===e&&(e=r.e||65537),!r.prng&&t>=256&&t<=16384&&(65537===e||3===e))if(n){if(of("generateKeyPair"))return qc.generateKeyPair("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},(function(t,e,r){if(t)return n(t);n(null,{privateKey:Wc.privateKeyFromPem(r),publicKey:Wc.publicKeyFromPem(e)})}));if(sf("generateKey")&&sf("exportKey"))return zc.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:cf(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then((function(t){return zc.globalScope.crypto.subtle.exportKey("pkcs8",t.privateKey)})).then(void 0,(function(t){n(t)})).then((function(t){if(t){var e=Wc.privateKeyFromAsn1(Gc.fromDer(xu.util.createBuffer(t)));n(null,{privateKey:e,publicKey:Wc.setRsaPublicKey(e.n,e.e)})}}));if(uf("generateKey")&&uf("exportKey")){var i=zc.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:cf(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);return i.oncomplete=function(t){var e=t.target.result,r=zc.globalScope.msCrypto.subtle.exportKey("pkcs8",e.privateKey);r.oncomplete=function(t){var e=t.target.result,r=Wc.privateKeyFromAsn1(Gc.fromDer(xu.util.createBuffer(e)));n(null,{privateKey:r,publicKey:Wc.setRsaPublicKey(r.n,r.e)})},r.onerror=function(t){n(t)}},void(i.onerror=function(t){n(t)})}}else if(of("generateKeyPairSync")){var a=qc.generateKeyPairSync("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:Wc.privateKeyFromPem(a.privateKey),publicKey:Wc.publicKeyFromPem(a.publicKey)}}var o=Wc.rsa.createKeyPairGenerationState(t,e,r);if(!n)return Wc.rsa.stepKeyPairGenerationState(o,0),o.keys;rf(o,r,n)},Wc.setRsaPublicKey=Wc.rsa.setPublicKey=function(t,e){var r={n:t,e:e,encrypt:function(t,e,n){if("string"==typeof e?e=e.toUpperCase():void 0===e&&(e="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===e)e={encode:function(t,e,r){return tf(t,e,2).getBytes()}};else if("RSA-OAEP"===e||"RSAES-OAEP"===e)e={encode:function(t,e){return xu.pkcs1.encode_rsa_oaep(e,t,n)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(e))e={encode:function(t){return t}};else if("string"==typeof e)throw new Error('Unsupported encryption scheme: "'+e+'".');var i=e.encode(t,r,!0);return Wc.rsa.encrypt(i,r,!0)},verify:function(t,e,n){"string"==typeof n?n=n.toUpperCase():void 0===n&&(n="RSASSA-PKCS1-V1_5"),"RSASSA-PKCS1-V1_5"===n?n={verify:function(t,e){return e=ef(e,r,!0),t===Gc.fromDer(e).value[1].value}}:"NONE"!==n&&"NULL"!==n&&null!==n||(n={verify:function(t,e){return t===(e=ef(e,r,!0))}});var i=Wc.rsa.decrypt(e,r,!0,!1);return n.verify(t,i,r.n.bitLength())}};return r},Wc.setRsaPrivateKey=Wc.rsa.setPrivateKey=function(t,e,r,n,i,a,o,s){var u={n:t,e:e,d:r,p:n,q:i,dP:a,dQ:o,qInv:s,decrypt:function(t,e,r){"string"==typeof e?e=e.toUpperCase():void 0===e&&(e="RSAES-PKCS1-V1_5");var n=Wc.rsa.decrypt(t,u,!1,!1);if("RSAES-PKCS1-V1_5"===e)e={decode:ef};else if("RSA-OAEP"===e||"RSAES-OAEP"===e)e={decode:function(t,e){return xu.pkcs1.decode_rsa_oaep(e,t,r)}};else{if(-1===["RAW","NONE","NULL",null].indexOf(e))throw new Error('Unsupported encryption scheme: "'+e+'".');e={decode:function(t){return t}}}return e.decode(n,u,!1)},sign:function(t,e){var r=!1;"string"==typeof e&&(e=e.toUpperCase()),void 0===e||"RSASSA-PKCS1-V1_5"===e?(e={encode:Zc},r=1):"NONE"!==e&&"NULL"!==e&&null!==e||(e={encode:function(){return t}},r=1);var n=e.encode(t,u.n.bitLength());return Wc.rsa.encrypt(n,u,r)}};return u},Wc.wrapRsaPrivateKey=function(t){return Gc.create(Gc.Class.UNIVERSAL,Gc.Type.SEQUENCE,!0,[Gc.create(Gc.Class.UNIVERSAL,Gc.Type.INTEGER,!1,Gc.integerToDer(0).getBytes()),Gc.create(Gc.Class.UNIVERSAL,Gc.Type.SEQUENCE,!0,[Gc.create(Gc.Class.UNIVERSAL,Gc.Type.OID,!1,Gc.oidToDer(Wc.oids.rsaEncryption).getBytes()),Gc.create(Gc.Class.UNIVERSAL,Gc.Type.NULL,!1,"")]),Gc.create(Gc.Class.UNIVERSAL,Gc.Type.OCTETSTRING,!1,Gc.toDer(t).getBytes())])},Wc.privateKeyFromAsn1=function(t){var e,r,n,i,a,o,s,u,c={},f=[];if(Gc.validate(t,Qc,c,f)&&(t=Gc.fromDer(xu.util.createBuffer(c.privateKey))),c={},f=[],!Gc.validate(t,Yc,c,f)){var l=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw l.errors=f,l}return e=xu.util.createBuffer(c.privateKeyModulus).toHex(),r=xu.util.createBuffer(c.privateKeyPublicExponent).toHex(),n=xu.util.createBuffer(c.privateKeyPrivateExponent).toHex(),i=xu.util.createBuffer(c.privateKeyPrime1).toHex(),a=xu.util.createBuffer(c.privateKeyPrime2).toHex(),o=xu.util.createBuffer(c.privateKeyExponent1).toHex(),s=xu.util.createBuffer(c.privateKeyExponent2).toHex(),u=xu.util.createBuffer(c.privateKeyCoefficient).toHex(),Wc.setRsaPrivateKey(new Kc(e,16),new Kc(r,16),new Kc(n,16),new Kc(i,16),new Kc(a,16),new Kc(o,16),new Kc(s,16),new Kc(u,16))},Wc.privateKeyToAsn1=Wc.privateKeyToRSAPrivateKey=function(t){return Gc.create(Gc.Class.UNIVERSAL,Gc.Type.SEQUENCE,!0,[Gc.create(Gc.Class.UNIVERSAL,Gc.Type.INTEGER,!1,Gc.integerToDer(0).getBytes()),Gc.create(Gc.Class.UNIVERSAL,Gc.Type.INTEGER,!1,nf(t.n)),Gc.create(Gc.Class.UNIVERSAL,Gc.Type.INTEGER,!1,nf(t.e)),Gc.create(Gc.Class.UNIVERSAL,Gc.Type.INTEGER,!1,nf(t.d)),Gc.create(Gc.Class.UNIVERSAL,Gc.Type.INTEGER,!1,nf(t.p)),Gc.create(Gc.Class.UNIVERSAL,Gc.Type.INTEGER,!1,nf(t.q)),Gc.create(Gc.Class.UNIVERSAL,Gc.Type.INTEGER,!1,nf(t.dP)),Gc.create(Gc.Class.UNIVERSAL,Gc.Type.INTEGER,!1,nf(t.dQ)),Gc.create(Gc.Class.UNIVERSAL,Gc.Type.INTEGER,!1,nf(t.qInv))])},Wc.publicKeyFromAsn1=function(t){var e={},r=[];if(Gc.validate(t,$c,e,r)){var n,i=Gc.derToOid(e.publicKeyOid);if(i!==Wc.oids.rsaEncryption)throw(n=new Error("Cannot read public key. Unknown OID.")).oid=i,n;t=e.rsaPublicKey}if(r=[],!Gc.validate(t,Xc,e,r))throw(n=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=r,n;var a=xu.util.createBuffer(e.publicKeyModulus).toHex(),o=xu.util.createBuffer(e.publicKeyExponent).toHex();return Wc.setRsaPublicKey(new Kc(a,16),new Kc(o,16))},Wc.publicKeyToAsn1=Wc.publicKeyToSubjectPublicKeyInfo=function(t){return Gc.create(Gc.Class.UNIVERSAL,Gc.Type.SEQUENCE,!0,[Gc.create(Gc.Class.UNIVERSAL,Gc.Type.SEQUENCE,!0,[Gc.create(Gc.Class.UNIVERSAL,Gc.Type.OID,!1,Gc.oidToDer(Wc.oids.rsaEncryption).getBytes()),Gc.create(Gc.Class.UNIVERSAL,Gc.Type.NULL,!1,"")]),Gc.create(Gc.Class.UNIVERSAL,Gc.Type.BITSTRING,!1,[Wc.publicKeyToRSAPublicKey(t)])])},Wc.publicKeyToRSAPublicKey=function(t){return Gc.create(Gc.Class.UNIVERSAL,Gc.Type.SEQUENCE,!0,[Gc.create(Gc.Class.UNIVERSAL,Gc.Type.INTEGER,!1,nf(t.n)),Gc.create(Gc.Class.UNIVERSAL,Gc.Type.INTEGER,!1,nf(t.e))])},void 0===ff)var ff=xu.jsbn.BigInteger;var lf=xu.asn1,hf=xu.pki=xu.pki||{};hf.pbe=xu.pbe=xu.pbe||{};var pf=hf.oids,df={name:"EncryptedPrivateKeyInfo",tagClass:lf.Class.UNIVERSAL,type:lf.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:lf.Class.UNIVERSAL,type:lf.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:lf.Class.UNIVERSAL,type:lf.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:lf.Class.UNIVERSAL,type:lf.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:lf.Class.UNIVERSAL,type:lf.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},yf={name:"PBES2Algorithms",tagClass:lf.Class.UNIVERSAL,type:lf.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:lf.Class.UNIVERSAL,type:lf.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:lf.Class.UNIVERSAL,type:lf.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:lf.Class.UNIVERSAL,type:lf.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:lf.Class.UNIVERSAL,type:lf.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:lf.Class.UNIVERSAL,type:lf.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:lf.Class.UNIVERSAL,type:lf.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:lf.Class.UNIVERSAL,type:lf.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:lf.Class.UNIVERSAL,type:lf.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:lf.Class.UNIVERSAL,type:lf.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:lf.Class.UNIVERSAL,type:lf.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:lf.Class.UNIVERSAL,type:lf.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},gf={name:"pkcs-12PbeParams",tagClass:lf.Class.UNIVERSAL,type:lf.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:lf.Class.UNIVERSAL,type:lf.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:lf.Class.UNIVERSAL,type:lf.Type.INTEGER,constructed:!1,capture:"iterations"}]};function vf(t,e){return t.start().update(e).digest().getBytes()}function mf(t){var e;if(t){if(!(e=hf.oids[lf.derToOid(t)])){var r=new Error("Unsupported PRF OID.");throw r.oid=t,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}}else e="hmacWithSHA1";return Cf(e)}function Cf(t){var e=xu.md;switch(t){case"hmacWithSHA224":e=xu.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":t=t.substr(8).toLowerCase();break;default:var r=new Error("Unsupported PRF algorithm.");throw r.algorithm=t,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}if(!e||!(t in e))throw new Error("Unknown hash algorithm: "+t);return e[t].create()}hf.encryptPrivateKeyInfo=function(t,e,r){(r=r||{}).saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var n,i,a,o=xu.random.getBytesSync(r.saltSize),s=r.count,u=lf.integerToDer(s);if(0===r.algorithm.indexOf("aes")||"des"===r.algorithm){var c,f,l;switch(r.algorithm){case"aes128":n=16,c=16,f=pf["aes128-CBC"],l=xu.aes.createEncryptionCipher;break;case"aes192":n=24,c=16,f=pf["aes192-CBC"],l=xu.aes.createEncryptionCipher;break;case"aes256":n=32,c=16,f=pf["aes256-CBC"],l=xu.aes.createEncryptionCipher;break;case"des":n=8,c=8,f=pf.desCBC,l=xu.des.createEncryptionCipher;break;default:throw(v=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,v}var h="hmacWith"+r.prfAlgorithm.toUpperCase(),p=Cf(h),d=xu.pkcs5.pbkdf2(e,o,s,n,p),y=xu.random.getBytesSync(c);(m=l(d)).start(y),m.update(lf.toDer(t)),m.finish(),a=m.output.getBytes();var g=function(t,e,r,n){var i=lf.create(lf.Class.UNIVERSAL,lf.Type.SEQUENCE,!0,[lf.create(lf.Class.UNIVERSAL,lf.Type.OCTETSTRING,!1,t),lf.create(lf.Class.UNIVERSAL,lf.Type.INTEGER,!1,e.getBytes())]);"hmacWithSHA1"!==n&&i.value.push(lf.create(lf.Class.UNIVERSAL,lf.Type.INTEGER,!1,xu.util.hexToBytes(r.toString(16))),lf.create(lf.Class.UNIVERSAL,lf.Type.SEQUENCE,!0,[lf.create(lf.Class.UNIVERSAL,lf.Type.OID,!1,lf.oidToDer(hf.oids[n]).getBytes()),lf.create(lf.Class.UNIVERSAL,lf.Type.NULL,!1,"")]));return i}(o,u,n,h);i=lf.create(lf.Class.UNIVERSAL,lf.Type.SEQUENCE,!0,[lf.create(lf.Class.UNIVERSAL,lf.Type.OID,!1,lf.oidToDer(pf.pkcs5PBES2).getBytes()),lf.create(lf.Class.UNIVERSAL,lf.Type.SEQUENCE,!0,[lf.create(lf.Class.UNIVERSAL,lf.Type.SEQUENCE,!0,[lf.create(lf.Class.UNIVERSAL,lf.Type.OID,!1,lf.oidToDer(pf.pkcs5PBKDF2).getBytes()),g]),lf.create(lf.Class.UNIVERSAL,lf.Type.SEQUENCE,!0,[lf.create(lf.Class.UNIVERSAL,lf.Type.OID,!1,lf.oidToDer(f).getBytes()),lf.create(lf.Class.UNIVERSAL,lf.Type.OCTETSTRING,!1,y)])])])}else{var v;if("3des"!==r.algorithm)throw(v=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,v;n=24;var m,C=new xu.util.ByteBuffer(o);d=hf.pbe.generatePkcs12Key(e,C,1,s,n),y=hf.pbe.generatePkcs12Key(e,C,2,s,n);(m=xu.des.createEncryptionCipher(d)).start(y),m.update(lf.toDer(t)),m.finish(),a=m.output.getBytes(),i=lf.create(lf.Class.UNIVERSAL,lf.Type.SEQUENCE,!0,[lf.create(lf.Class.UNIVERSAL,lf.Type.OID,!1,lf.oidToDer(pf["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),lf.create(lf.Class.UNIVERSAL,lf.Type.SEQUENCE,!0,[lf.create(lf.Class.UNIVERSAL,lf.Type.OCTETSTRING,!1,o),lf.create(lf.Class.UNIVERSAL,lf.Type.INTEGER,!1,u.getBytes())])])}return lf.create(lf.Class.UNIVERSAL,lf.Type.SEQUENCE,!0,[i,lf.create(lf.Class.UNIVERSAL,lf.Type.OCTETSTRING,!1,a)])},hf.decryptPrivateKeyInfo=function(t,e){var r=null,n={},i=[];if(!lf.validate(t,df,n,i)){var a=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw a.errors=i,a}var o=lf.derToOid(n.encryptionOid),s=hf.pbe.getCipher(o,n.encryptionParams,e),u=xu.util.createBuffer(n.encryptedData);return s.update(u),s.finish()&&(r=lf.fromDer(s.output)),r},hf.encryptedPrivateKeyToPem=function(t,e){var r={type:"ENCRYPTED PRIVATE KEY",body:lf.toDer(t).getBytes()};return xu.pem.encode(r,{maxline:e})},hf.encryptedPrivateKeyFromPem=function(t){var e=xu.pem.decode(t)[0];if("ENCRYPTED PRIVATE KEY"!==e.type){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=e.type,r}if(e.procType&&"ENCRYPTED"===e.procType.type)throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return lf.fromDer(e.body)},hf.encryptRsaPrivateKey=function(t,e,r){if(!(r=r||{}).legacy){var n=hf.wrapRsaPrivateKey(hf.privateKeyToAsn1(t));return n=hf.encryptPrivateKeyInfo(n,e,r),hf.encryptedPrivateKeyToPem(n)}var i,a,o,s;switch(r.algorithm){case"aes128":i="AES-128-CBC",o=16,a=xu.random.getBytesSync(16),s=xu.aes.createEncryptionCipher;break;case"aes192":i="AES-192-CBC",o=24,a=xu.random.getBytesSync(16),s=xu.aes.createEncryptionCipher;break;case"aes256":i="AES-256-CBC",o=32,a=xu.random.getBytesSync(16),s=xu.aes.createEncryptionCipher;break;case"3des":i="DES-EDE3-CBC",o=24,a=xu.random.getBytesSync(8),s=xu.des.createEncryptionCipher;break;case"des":i="DES-CBC",o=8,a=xu.random.getBytesSync(8),s=xu.des.createEncryptionCipher;break;default:var u=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw u.algorithm=r.algorithm,u}var c=s(xu.pbe.opensslDeriveBytes(e,a.substr(0,8),o));c.start(a),c.update(lf.toDer(hf.privateKeyToAsn1(t))),c.finish();var f={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:i,parameters:xu.util.bytesToHex(a).toUpperCase()},body:c.output.getBytes()};return xu.pem.encode(f)},hf.decryptRsaPrivateKey=function(t,e){var r=null,n=xu.pem.decode(t)[0];if("ENCRYPTED PRIVATE KEY"!==n.type&&"PRIVATE KEY"!==n.type&&"RSA PRIVATE KEY"!==n.type)throw(o=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".')).headerType=o,o;if(n.procType&&"ENCRYPTED"===n.procType.type){var i,a;switch(n.dekInfo.algorithm){case"DES-CBC":i=8,a=xu.des.createDecryptionCipher;break;case"DES-EDE3-CBC":i=24,a=xu.des.createDecryptionCipher;break;case"AES-128-CBC":i=16,a=xu.aes.createDecryptionCipher;break;case"AES-192-CBC":i=24,a=xu.aes.createDecryptionCipher;break;case"AES-256-CBC":i=32,a=xu.aes.createDecryptionCipher;break;case"RC2-40-CBC":i=5,a=function(t){return xu.rc2.createDecryptionCipher(t,40)};break;case"RC2-64-CBC":i=8,a=function(t){return xu.rc2.createDecryptionCipher(t,64)};break;case"RC2-128-CBC":i=16,a=function(t){return xu.rc2.createDecryptionCipher(t,128)};break;default:var o;throw(o=new Error('Could not decrypt private key; unsupported encryption algorithm "'+n.dekInfo.algorithm+'".')).algorithm=n.dekInfo.algorithm,o}var s=xu.util.hexToBytes(n.dekInfo.parameters),u=a(xu.pbe.opensslDeriveBytes(e,s.substr(0,8),i));if(u.start(s),u.update(xu.util.createBuffer(n.body)),!u.finish())return r;r=u.output.getBytes()}else r=n.body;return null!==(r="ENCRYPTED PRIVATE KEY"===n.type?hf.decryptPrivateKeyInfo(lf.fromDer(r),e):lf.fromDer(r))&&(r=hf.privateKeyFromAsn1(r)),r},hf.pbe.generatePkcs12Key=function(t,e,r,n,i,a){var o,s;if(null==a){if(!("sha1"in xu.md))throw new Error('"sha1" hash algorithm unavailable.');a=xu.md.sha1.create()}var u=a.digestLength,c=a.blockLength,f=new xu.util.ByteBuffer,l=new xu.util.ByteBuffer;if(null!=t){for(s=0;s<t.length;s++)l.putInt16(t.charCodeAt(s));l.putInt16(0)}var h=l.length(),p=e.length(),d=new xu.util.ByteBuffer;d.fillWithByte(r,c);var y=c*Math.ceil(p/c),g=new xu.util.ByteBuffer;for(s=0;s<y;s++)g.putByte(e.at(s%p));var v=c*Math.ceil(h/c),m=new xu.util.ByteBuffer;for(s=0;s<v;s++)m.putByte(l.at(s%h));var C=g;C.putBuffer(m);for(var E=Math.ceil(i/u),S=1;S<=E;S++){var b=new xu.util.ByteBuffer;b.putBytes(d.bytes()),b.putBytes(C.bytes());for(var T=0;T<n;T++)a.start(),a.update(b.getBytes()),b=a.digest();var I=new xu.util.ByteBuffer;for(s=0;s<c;s++)I.putByte(b.at(s%u));var A=Math.ceil(p/c)+Math.ceil(h/c),w=new xu.util.ByteBuffer;for(o=0;o<A;o++){var _=new xu.util.ByteBuffer(C.getBytes(c)),B=511;for(s=I.length()-1;s>=0;s--)B>>=8,B+=I.at(s)+_.at(s),_.setAt(s,255&B);w.putBuffer(_)}C=w,f.putBuffer(b)}return f.truncate(f.length()-i),f},hf.pbe.getCipher=function(t,e,r){switch(t){case hf.oids.pkcs5PBES2:return hf.pbe.getCipherForPBES2(t,e,r);case hf.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case hf.oids["pbewithSHAAnd40BitRC2-CBC"]:return hf.pbe.getCipherForPKCS12PBE(t,e,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=t,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}},hf.pbe.getCipherForPBES2=function(t,e,r){var n,i={},a=[];if(!lf.validate(e,yf,i,a))throw(n=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=a,n;if((t=lf.derToOid(i.kdfOid))!==hf.oids.pkcs5PBKDF2)throw(n=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.")).oid=t,n.supportedOids=["pkcs5PBKDF2"],n;if((t=lf.derToOid(i.encOid))!==hf.oids["aes128-CBC"]&&t!==hf.oids["aes192-CBC"]&&t!==hf.oids["aes256-CBC"]&&t!==hf.oids["des-EDE3-CBC"]&&t!==hf.oids.desCBC)throw(n=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.")).oid=t,n.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],n;var o,s,u=i.kdfSalt,c=xu.util.createBuffer(i.kdfIterationCount);switch(c=c.getInt(c.length()<<3),hf.oids[t]){case"aes128-CBC":o=16,s=xu.aes.createDecryptionCipher;break;case"aes192-CBC":o=24,s=xu.aes.createDecryptionCipher;break;case"aes256-CBC":o=32,s=xu.aes.createDecryptionCipher;break;case"des-EDE3-CBC":o=24,s=xu.des.createDecryptionCipher;break;case"desCBC":o=8,s=xu.des.createDecryptionCipher}var f=mf(i.prfOid),l=xu.pkcs5.pbkdf2(r,u,c,o,f),h=i.encIv,p=s(l);return p.start(h),p},hf.pbe.getCipherForPKCS12PBE=function(t,e,r){var n={},i=[];if(!lf.validate(e,gf,n,i))throw(f=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=i,f;var a,o,s,u=xu.util.createBuffer(n.salt),c=xu.util.createBuffer(n.iterations);switch(c=c.getInt(c.length()<<3),t){case hf.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:a=24,o=8,s=xu.des.startDecrypting;break;case hf.oids["pbewithSHAAnd40BitRC2-CBC"]:a=5,o=8,s=function(t,e){var r=xu.rc2.createDecryptionCipher(t,40);return r.start(e,null),r};break;default:var f;throw(f=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.")).oid=t,f}var l=mf(n.prfOid),h=hf.pbe.generatePkcs12Key(r,u,1,c,a,l);return l.start(),s(h,hf.pbe.generatePkcs12Key(r,u,2,c,o,l))},hf.pbe.opensslDeriveBytes=function(t,e,r,n){if(null==n){if(!("md5"in xu.md))throw new Error('"md5" hash algorithm unavailable.');n=xu.md.md5.create()}null===e&&(e="");for(var i=[vf(n,t+e)],a=16,o=1;a<r;++o,a+=16)i.push(vf(n,i[o-1]+t+e));return i.join("").substr(0,r)},w((function(t){var e=xu.asn1,r=t.exports=xu.pkcs7asn1=xu.pkcs7asn1||{};xu.pkcs7=xu.pkcs7||{},xu.pkcs7.asn1=r;var n={name:"ContentInfo",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:e.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};r.contentInfoValidator=n;var i={name:"EncryptedContentInfo",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:e.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:e.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};r.envelopedDataValidator={name:"EnvelopedData",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:e.Class.UNIVERSAL,type:e.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(i)},r.encryptedDataValidator={name:"EncryptedData",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1,capture:"version"}].concat(i)};var a={name:"SignerInfo",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:e.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:e.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:e.Class.UNIVERSAL,type:e.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:e.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};r.signedDataValidator={name:"SignedData",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:e.Class.UNIVERSAL,type:e.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},n,{name:"SignedData.Certificates",tagClass:e.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:e.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:e.Class.UNIVERSAL,type:e.Type.SET,capture:"signerInfos",optional:!0,value:[a]}]},r.recipientInfoValidator={name:"RecipientInfo",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:e.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter"}]},{name:"RecipientInfo.encryptedKey",tagClass:e.Class.UNIVERSAL,type:e.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}})),w((function(t){xu.mgf=xu.mgf||{},(t.exports=xu.mgf.mgf1=xu.mgf1=xu.mgf1||{}).create=function(t){return{generate:function(e,r){for(var n=new xu.util.ByteBuffer,i=Math.ceil(r/t.digestLength),a=0;a<i;a++){var o=new xu.util.ByteBuffer;o.putInt32(a),t.start(),t.update(e+o.getBytes()),n.putBuffer(t.digest())}return n.truncate(n.length()-r),n.getBytes()}}}})),xu.mgf=xu.mgf||{},xu.mgf.mgf1=xu.mgf1,w((function(t){(t.exports=xu.pss=xu.pss||{}).create=function(t){3===arguments.length&&(t={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var e,r=t.md,n=t.mgf,i=r.digestLength,a=t.salt||null;if("string"==typeof a&&(a=xu.util.createBuffer(a)),"saltLength"in t)e=t.saltLength;else{if(null===a)throw new Error("Salt length not specified or specific salt not given.");e=a.length()}if(null!==a&&a.length()!==e)throw new Error("Given salt length does not match length of given salt.");var o=t.prng||xu.random,s={encode:function(t,s){var u,c,f=s-1,l=Math.ceil(f/8),h=t.digest().getBytes();if(l<i+e+2)throw new Error("Message is too long to encrypt.");c=null===a?o.getBytesSync(e):a.bytes();var p=new xu.util.ByteBuffer;p.fillWithByte(0,8),p.putBytes(h),p.putBytes(c),r.start(),r.update(p.getBytes());var d=r.digest().getBytes(),y=new xu.util.ByteBuffer;y.fillWithByte(0,l-e-i-2),y.putByte(1),y.putBytes(c);var g=y.getBytes(),v=l-i-1,m=n.generate(d,v),C="";for(u=0;u<v;u++)C+=String.fromCharCode(g.charCodeAt(u)^m.charCodeAt(u));var E=65280>>8*l-f&255;return(C=String.fromCharCode(C.charCodeAt(0)&~E)+C.substr(1))+d+String.fromCharCode(188)},verify:function(t,a,o){var s,u=o-1,c=Math.ceil(u/8);if(a=a.substr(-c),c<i+e+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(188!==a.charCodeAt(c-1))throw new Error("Encoded message does not end in 0xBC.");var f=c-i-1,l=a.substr(0,f),h=a.substr(f,i),p=65280>>8*c-u&255;if(0!=(l.charCodeAt(0)&p))throw new Error("Bits beyond keysize not zero as expected.");var d=n.generate(h,f),y="";for(s=0;s<f;s++)y+=String.fromCharCode(l.charCodeAt(s)^d.charCodeAt(s));y=String.fromCharCode(y.charCodeAt(0)&~p)+y.substr(1);var g=c-i-e-2;for(s=0;s<g;s++)if(0!==y.charCodeAt(s))throw new Error("Leftmost octets not zero as expected");if(1!==y.charCodeAt(g))throw new Error("Inconsistent PSS signature, 0x01 marker not found");var v=y.substr(-e),m=new xu.util.ByteBuffer;return m.fillWithByte(0,8),m.putBytes(t),m.putBytes(v),r.start(),r.update(m.getBytes()),h===r.digest().getBytes()}};return s}})),w((function(t){var e=xu.asn1,r=t.exports=xu.pki=xu.pki||{},n=r.oids,i={};i.CN=n.commonName,i.commonName="CN",i.C=n.countryName,i.countryName="C",i.L=n.localityName,i.localityName="L",i.ST=n.stateOrProvinceName,i.stateOrProvinceName="ST",i.O=n.organizationName,i.organizationName="O",i.OU=n.organizationalUnitName,i.organizationalUnitName="OU",i.E=n.emailAddress,i.emailAddress="E";var a=xu.pki.rsa.publicKeyValidator,o={name:"Certificate",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:e.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:e.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:e.Class.UNIVERSAL,type:e.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:e.Class.UNIVERSAL,type:e.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:e.Class.UNIVERSAL,type:e.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:e.Class.UNIVERSAL,type:e.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},a,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:e.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:e.Class.UNIVERSAL,type:e.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:e.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:e.Class.UNIVERSAL,type:e.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:e.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:e.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:e.Class.UNIVERSAL,type:e.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},s={name:"rsapss",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:e.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:e.Class.UNIVERSAL,type:e.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:e.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:e.Class.UNIVERSAL,type:e.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:e.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:e.Class.UNIVERSAL,type:e.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:e.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:e.Class.UNIVERSAL,type:e.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},u={name:"CertificationRequestInfo",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},a,{name:"CertificationRequestInfo.attributes",tagClass:e.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:e.Class.UNIVERSAL,type:e.Type.SET,constructed:!0}]}]}]},c={name:"CertificationRequest",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[u,{name:"CertificationRequest.signatureAlgorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:e.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:e.Class.UNIVERSAL,type:e.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};function f(t,e){"string"==typeof e&&(e={shortName:e});for(var r,n=null,i=0;null===n&&i<t.attributes.length;++i)r=t.attributes[i],(e.type&&e.type===r.type||e.name&&e.name===r.name||e.shortName&&e.shortName===r.shortName)&&(n=r);return n}r.RDNAttributesAsArray=function(t,r){for(var a,o,s,u=[],c=0;c<t.value.length;++c){a=t.value[c];for(var f=0;f<a.value.length;++f)s={},o=a.value[f],s.type=e.derToOid(o.value[0].value),s.value=o.value[1].value,s.valueTagClass=o.value[1].type,s.type in n&&(s.name=n[s.type],s.name in i&&(s.shortName=i[s.name])),r&&(r.update(s.type),r.update(s.value)),u.push(s)}return u},r.CRIAttributesAsArray=function(t){for(var a=[],o=0;o<t.length;++o)for(var s=t[o],u=e.derToOid(s.value[0].value),c=s.value[1].value,f=0;f<c.length;++f){var l={};if(l.type=u,l.value=c[f].value,l.valueTagClass=c[f].type,l.type in n&&(l.name=n[l.type],l.name in i&&(l.shortName=i[l.name])),l.type===n.extensionRequest){l.extensions=[];for(var h=0;h<l.value.length;++h)l.extensions.push(r.certificateExtensionFromAsn1(l.value[h]))}a.push(l)}return a};var l=function(t,r,i){var a={};if(t!==n["RSASSA-PSS"])return a;i&&(a={hash:{algorithmOid:n.sha1},mgf:{algorithmOid:n.mgf1,hash:{algorithmOid:n.sha1}},saltLength:20});var o={},u=[];if(!e.validate(r,s,o,u)){var c=new Error("Cannot read RSASSA-PSS parameter block.");throw c.errors=u,c}return void 0!==o.hashOid&&(a.hash=a.hash||{},a.hash.algorithmOid=e.derToOid(o.hashOid)),void 0!==o.maskGenOid&&(a.mgf=a.mgf||{},a.mgf.algorithmOid=e.derToOid(o.maskGenOid),a.mgf.hash=a.mgf.hash||{},a.mgf.hash.algorithmOid=e.derToOid(o.maskGenHashOid)),void 0!==o.saltLength&&(a.saltLength=o.saltLength.charCodeAt(0)),a};function h(t){for(var r,n,i=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[]),a=t.attributes,o=0;o<a.length;++o){var s=(r=a[o]).value,u=e.Type.PRINTABLESTRING;"valueTagClass"in r&&(u=r.valueTagClass)===e.Type.UTF8&&(s=xu.util.encodeUtf8(s)),n=e.create(e.Class.UNIVERSAL,e.Type.SET,!0,[e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(r.type).getBytes()),e.create(e.Class.UNIVERSAL,u,!1,s)])]),i.value.push(n)}return i}function p(t){for(var a,o=0;o<t.length;++o){if(void 0===(a=t[o]).name&&(a.type&&a.type in r.oids?a.name=r.oids[a.type]:a.shortName&&a.shortName in i&&(a.name=r.oids[i[a.shortName]])),void 0===a.type){if(!a.name||!(a.name in r.oids))throw(u=new Error("Attribute type not specified.")).attribute=a,u;a.type=r.oids[a.name]}if(void 0===a.shortName&&a.name&&a.name in i&&(a.shortName=i[a.name]),a.type===n.extensionRequest&&(a.valueConstructed=!0,a.valueTagClass=e.Type.SEQUENCE,!a.value&&a.extensions)){a.value=[];for(var s=0;s<a.extensions.length;++s)a.value.push(r.certificateExtensionToAsn1(d(a.extensions[s])))}var u;if(void 0===a.value)throw(u=new Error("Attribute value not specified.")).attribute=a,u}}function d(t,i){if(i=i||{},void 0===t.name&&t.id&&t.id in r.oids&&(t.name=r.oids[t.id]),void 0===t.id){if(!t.name||!(t.name in r.oids))throw(E=new Error("Extension ID not specified.")).extension=t,E;t.id=r.oids[t.name]}if(void 0!==t.value)return t;if("keyUsage"===t.name){var a=0,o=0,s=0;t.digitalSignature&&(o|=128,a=7),t.nonRepudiation&&(o|=64,a=6),t.keyEncipherment&&(o|=32,a=5),t.dataEncipherment&&(o|=16,a=4),t.keyAgreement&&(o|=8,a=3),t.keyCertSign&&(o|=4,a=2),t.cRLSign&&(o|=2,a=1),t.encipherOnly&&(o|=1,a=0),t.decipherOnly&&(s|=128,a=7);var u=String.fromCharCode(a);0!==s?u+=String.fromCharCode(o)+String.fromCharCode(s):0!==o&&(u+=String.fromCharCode(o)),t.value=e.create(e.Class.UNIVERSAL,e.Type.BITSTRING,!1,u)}else if("basicConstraints"===t.name)t.value=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[]),t.cA&&t.value.value.push(e.create(e.Class.UNIVERSAL,e.Type.BOOLEAN,!1,String.fromCharCode(255))),"pathLenConstraint"in t&&t.value.value.push(e.create(e.Class.UNIVERSAL,e.Type.INTEGER,!1,e.integerToDer(t.pathLenConstraint).getBytes()));else if("extKeyUsage"===t.name){t.value=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[]);var c=t.value.value;for(var f in t)!0===t[f]&&(f in n?c.push(e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(n[f]).getBytes())):-1!==f.indexOf(".")&&c.push(e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(f).getBytes())))}else if("nsCertType"===t.name){a=0,o=0;t.client&&(o|=128,a=7),t.server&&(o|=64,a=6),t.email&&(o|=32,a=5),t.objsign&&(o|=16,a=4),t.reserved&&(o|=8,a=3),t.sslCA&&(o|=4,a=2),t.emailCA&&(o|=2,a=1),t.objCA&&(o|=1,a=0);u=String.fromCharCode(a);0!==o&&(u+=String.fromCharCode(o)),t.value=e.create(e.Class.UNIVERSAL,e.Type.BITSTRING,!1,u)}else if("subjectAltName"===t.name||"issuerAltName"===t.name){t.value=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[]);for(var l=0;l<t.altNames.length;++l){u=(v=t.altNames[l]).value;if(7===v.type&&v.ip){if(null===(u=xu.util.bytesFromIP(v.ip)))throw(E=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension=t,E}else 8===v.type&&(u=v.oid?e.oidToDer(e.oidToDer(v.oid)):e.oidToDer(u));t.value.value.push(e.create(e.Class.CONTEXT_SPECIFIC,v.type,!1,u))}}else if("nsComment"===t.name&&i.cert){if(!/^[\x00-\x7F]*$/.test(t.comment)||t.comment.length<1||t.comment.length>128)throw new Error('Invalid "nsComment" content.');t.value=e.create(e.Class.UNIVERSAL,e.Type.IA5STRING,!1,t.comment)}else if("subjectKeyIdentifier"===t.name&&i.cert){var p=i.cert.generateSubjectKeyIdentifier();t.subjectKeyIdentifier=p.toHex(),t.value=e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,p.getBytes())}else if("authorityKeyIdentifier"===t.name&&i.cert){t.value=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[]);c=t.value.value;if(t.keyIdentifier){var d=!0===t.keyIdentifier?i.cert.generateSubjectKeyIdentifier().getBytes():t.keyIdentifier;c.push(e.create(e.Class.CONTEXT_SPECIFIC,0,!1,d))}if(t.authorityCertIssuer){var y=[e.create(e.Class.CONTEXT_SPECIFIC,4,!0,[h(!0===t.authorityCertIssuer?i.cert.issuer:t.authorityCertIssuer)])];c.push(e.create(e.Class.CONTEXT_SPECIFIC,1,!0,y))}if(t.serialNumber){var g=xu.util.hexToBytes(!0===t.serialNumber?i.cert.serialNumber:t.serialNumber);c.push(e.create(e.Class.CONTEXT_SPECIFIC,2,!1,g))}}else if("cRLDistributionPoints"===t.name){t.value=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[]);c=t.value.value;var v,m=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[]),C=e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[]);for(l=0;l<t.altNames.length;++l){u=(v=t.altNames[l]).value;if(7===v.type&&v.ip){if(null===(u=xu.util.bytesFromIP(v.ip)))throw(E=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension=t,E}else 8===v.type&&(u=v.oid?e.oidToDer(e.oidToDer(v.oid)):e.oidToDer(u));C.value.push(e.create(e.Class.CONTEXT_SPECIFIC,v.type,!1,u))}m.value.push(e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[C])),c.push(m)}var E;if(void 0===t.value)throw(E=new Error("Extension value not specified.")).extension=t,E;return t}function y(t,r){switch(t){case n["RSASSA-PSS"]:var i=[];return void 0!==r.hash.algorithmOid&&i.push(e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(r.hash.algorithmOid).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.NULL,!1,"")])])),void 0!==r.mgf.algorithmOid&&i.push(e.create(e.Class.CONTEXT_SPECIFIC,1,!0,[e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(r.mgf.algorithmOid).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(r.mgf.hash.algorithmOid).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.NULL,!1,"")])])])),void 0!==r.saltLength&&i.push(e.create(e.Class.CONTEXT_SPECIFIC,2,!0,[e.create(e.Class.UNIVERSAL,e.Type.INTEGER,!1,e.integerToDer(r.saltLength).getBytes())])),e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,i);default:return e.create(e.Class.UNIVERSAL,e.Type.NULL,!1,"")}}function g(t){var r=e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[]);if(0===t.attributes.length)return r;for(var n=t.attributes,i=0;i<n.length;++i){var a=n[i],o=a.value,s=e.Type.UTF8;"valueTagClass"in a&&(s=a.valueTagClass),s===e.Type.UTF8&&(o=xu.util.encodeUtf8(o));var u=!1;"valueConstructed"in a&&(u=a.valueConstructed);var c=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(a.type).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.SET,!0,[e.create(e.Class.UNIVERSAL,s,u,o)])]);r.value.push(c)}return r}r.certificateFromPem=function(t,n,i){var a=xu.pem.decode(t)[0];if("CERTIFICATE"!==a.type&&"X509 CERTIFICATE"!==a.type&&"TRUSTED CERTIFICATE"!==a.type){var o=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw o.headerType=a.type,o}if(a.procType&&"ENCRYPTED"===a.procType.type)throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var s=e.fromDer(a.body,i);return r.certificateFromAsn1(s,n)},r.certificateToPem=function(t,n){var i={type:"CERTIFICATE",body:e.toDer(r.certificateToAsn1(t)).getBytes()};return xu.pem.encode(i,{maxline:n})},r.publicKeyFromPem=function(t){var n=xu.pem.decode(t)[0];if("PUBLIC KEY"!==n.type&&"RSA PUBLIC KEY"!==n.type){var i=new Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw i.headerType=n.type,i}if(n.procType&&"ENCRYPTED"===n.procType.type)throw new Error("Could not convert public key from PEM; PEM is encrypted.");var a=e.fromDer(n.body);return r.publicKeyFromAsn1(a)},r.publicKeyToPem=function(t,n){var i={type:"PUBLIC KEY",body:e.toDer(r.publicKeyToAsn1(t)).getBytes()};return xu.pem.encode(i,{maxline:n})},r.publicKeyToRSAPublicKeyPem=function(t,n){var i={type:"RSA PUBLIC KEY",body:e.toDer(r.publicKeyToRSAPublicKey(t)).getBytes()};return xu.pem.encode(i,{maxline:n})},r.getPublicKeyFingerprint=function(t,n){var i,a=(n=n||{}).md||xu.md.sha1.create();switch(n.type||"RSAPublicKey"){case"RSAPublicKey":i=e.toDer(r.publicKeyToRSAPublicKey(t)).getBytes();break;case"SubjectPublicKeyInfo":i=e.toDer(r.publicKeyToAsn1(t)).getBytes();break;default:throw new Error('Unknown fingerprint type "'+n.type+'".')}a.start(),a.update(i);var o=a.digest();if("hex"===n.encoding){var s=o.toHex();return n.delimiter?s.match(/.{2}/g).join(n.delimiter):s}if("binary"===n.encoding)return o.getBytes();if(n.encoding)throw new Error('Unknown encoding "'+n.encoding+'".');return o},r.certificationRequestFromPem=function(t,n,i){var a=xu.pem.decode(t)[0];if("CERTIFICATE REQUEST"!==a.type){var o=new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw o.headerType=a.type,o}if(a.procType&&"ENCRYPTED"===a.procType.type)throw new Error("Could not convert certification request from PEM; PEM is encrypted.");var s=e.fromDer(a.body,i);return r.certificationRequestFromAsn1(s,n)},r.certificationRequestToPem=function(t,n){var i={type:"CERTIFICATE REQUEST",body:e.toDer(r.certificationRequestToAsn1(t)).getBytes()};return xu.pem.encode(i,{maxline:n})},r.createCertificate=function(){var t={version:2,serialNumber:"00",signatureOid:null,signature:null,siginfo:{}};return t.siginfo.algorithmOid=null,t.validity={},t.validity.notBefore=new Date,t.validity.notAfter=new Date,t.issuer={},t.issuer.getField=function(e){return f(t.issuer,e)},t.issuer.addField=function(e){p([e]),t.issuer.attributes.push(e)},t.issuer.attributes=[],t.issuer.hash=null,t.subject={},t.subject.getField=function(e){return f(t.subject,e)},t.subject.addField=function(e){p([e]),t.subject.attributes.push(e)},t.subject.attributes=[],t.subject.hash=null,t.extensions=[],t.publicKey=null,t.md=null,t.setSubject=function(e,r){p(e),t.subject.attributes=e,delete t.subject.uniqueId,r&&(t.subject.uniqueId=r),t.subject.hash=null},t.setIssuer=function(e,r){p(e),t.issuer.attributes=e,delete t.issuer.uniqueId,r&&(t.issuer.uniqueId=r),t.issuer.hash=null},t.setExtensions=function(e){for(var r=0;r<e.length;++r)d(e[r],{cert:t});t.extensions=e},t.getExtension=function(e){"string"==typeof e&&(e={name:e});for(var r,n=null,i=0;null===n&&i<t.extensions.length;++i)r=t.extensions[i],(e.id&&r.id===e.id||e.name&&r.name===e.name)&&(n=r);return n},t.sign=function(i,a){t.md=a||xu.md.sha1.create();var o=n[t.md.algorithm+"WithRSAEncryption"];if(!o){var s=new Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw s.algorithm=t.md.algorithm,s}t.signatureOid=t.siginfo.algorithmOid=o,t.tbsCertificate=r.getTBSCertificate(t);var u=e.toDer(t.tbsCertificate);t.md.update(u.getBytes()),t.signature=i.sign(t.md)},t.verify=function(i){var a=!1;if(!t.issued(i)){var o=i.issuer,s=t.subject;throw(d=new Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.")).expectedIssuer=o.attributes,d.actualIssuer=s.attributes,d}var u=i.md;if(null===u){if(i.signatureOid in n)switch(n[i.signatureOid]){case"sha1WithRSAEncryption":u=xu.md.sha1.create();break;case"md5WithRSAEncryption":u=xu.md.md5.create();break;case"sha256WithRSAEncryption":u=xu.md.sha256.create();break;case"sha384WithRSAEncryption":u=xu.md.sha384.create();break;case"sha512WithRSAEncryption":u=xu.md.sha512.create();break;case"RSASSA-PSS":u=xu.md.sha256.create()}if(null===u)throw(d=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=i.signatureOid,d;var c=i.tbsCertificate||r.getTBSCertificate(i),f=e.toDer(c);u.update(f.getBytes())}if(null!==u){var l;switch(i.signatureOid){case n.sha1WithRSAEncryption:l=void 0;break;case n["RSASSA-PSS"]:var h,p,d;if(void 0===(h=n[i.signatureParameters.mgf.hash.algorithmOid])||void 0===xu.md[h])throw(d=new Error("Unsupported MGF hash function.")).oid=i.signatureParameters.mgf.hash.algorithmOid,d.name=h,d;if(void 0===(p=n[i.signatureParameters.mgf.algorithmOid])||void 0===xu.mgf[p])throw(d=new Error("Unsupported MGF function.")).oid=i.signatureParameters.mgf.algorithmOid,d.name=p,d;if(p=xu.mgf[p].create(xu.md[h].create()),void 0===(h=n[i.signatureParameters.hash.algorithmOid])||void 0===xu.md[h])throw{message:"Unsupported RSASSA-PSS hash function.",oid:i.signatureParameters.hash.algorithmOid,name:h};l=xu.pss.create(xu.md[h].create(),p,i.signatureParameters.saltLength)}a=t.publicKey.verify(u.digest().getBytes(),i.signature,l)}return a},t.isIssuer=function(e){var r=!1,n=t.issuer,i=e.subject;if(n.hash&&i.hash)r=n.hash===i.hash;else if(n.attributes.length===i.attributes.length){var a,o;r=!0;for(var s=0;r&&s<n.attributes.length;++s)a=n.attributes[s],o=i.attributes[s],a.type===o.type&&a.value===o.value||(r=!1)}return r},t.issued=function(e){return e.isIssuer(t)},t.generateSubjectKeyIdentifier=function(){return r.getPublicKeyFingerprint(t.publicKey,{type:"RSAPublicKey"})},t.verifySubjectKeyIdentifier=function(){for(var e=n.subjectKeyIdentifier,r=0;r<t.extensions.length;++r){var i=t.extensions[r];if(i.id===e){var a=t.generateSubjectKeyIdentifier().getBytes();return xu.util.hexToBytes(i.subjectKeyIdentifier)===a}}return!1},t},r.certificateFromAsn1=function(t,i){var a={},s=[];if(!e.validate(t,o,a,s))throw(d=new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.")).errors=s,d;if(e.derToOid(a.publicKeyOid)!==r.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var u=r.createCertificate();u.version=a.certVersion?a.certVersion.charCodeAt(0):0;var c=xu.util.createBuffer(a.certSerialNumber);u.serialNumber=c.toHex(),u.signatureOid=xu.asn1.derToOid(a.certSignatureOid),u.signatureParameters=l(u.signatureOid,a.certSignatureParams,!0),u.siginfo.algorithmOid=xu.asn1.derToOid(a.certinfoSignatureOid),u.siginfo.parameters=l(u.siginfo.algorithmOid,a.certinfoSignatureParams,!1),u.signature=a.certSignature;var h=[];if(void 0!==a.certValidity1UTCTime&&h.push(e.utcTimeToDate(a.certValidity1UTCTime)),void 0!==a.certValidity2GeneralizedTime&&h.push(e.generalizedTimeToDate(a.certValidity2GeneralizedTime)),void 0!==a.certValidity3UTCTime&&h.push(e.utcTimeToDate(a.certValidity3UTCTime)),void 0!==a.certValidity4GeneralizedTime&&h.push(e.generalizedTimeToDate(a.certValidity4GeneralizedTime)),h.length>2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(h.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(u.validity.notBefore=h[0],u.validity.notAfter=h[1],u.tbsCertificate=a.tbsCertificate,i){var d;if(u.md=null,u.signatureOid in n)switch(n[u.signatureOid]){case"sha1WithRSAEncryption":u.md=xu.md.sha1.create();break;case"md5WithRSAEncryption":u.md=xu.md.md5.create();break;case"sha256WithRSAEncryption":u.md=xu.md.sha256.create();break;case"sha384WithRSAEncryption":u.md=xu.md.sha384.create();break;case"sha512WithRSAEncryption":u.md=xu.md.sha512.create();break;case"RSASSA-PSS":u.md=xu.md.sha256.create()}if(null===u.md)throw(d=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=u.signatureOid,d;var y=e.toDer(u.tbsCertificate);u.md.update(y.getBytes())}var g=xu.md.sha1.create();u.issuer.getField=function(t){return f(u.issuer,t)},u.issuer.addField=function(t){p([t]),u.issuer.attributes.push(t)},u.issuer.attributes=r.RDNAttributesAsArray(a.certIssuer,g),a.certIssuerUniqueId&&(u.issuer.uniqueId=a.certIssuerUniqueId),u.issuer.hash=g.digest().toHex();var v=xu.md.sha1.create();return u.subject.getField=function(t){return f(u.subject,t)},u.subject.addField=function(t){p([t]),u.subject.attributes.push(t)},u.subject.attributes=r.RDNAttributesAsArray(a.certSubject,v),a.certSubjectUniqueId&&(u.subject.uniqueId=a.certSubjectUniqueId),u.subject.hash=v.digest().toHex(),a.certExtensions?u.extensions=r.certificateExtensionsFromAsn1(a.certExtensions):u.extensions=[],u.publicKey=r.publicKeyFromAsn1(a.subjectPublicKeyInfo),u},r.certificateExtensionsFromAsn1=function(t){for(var e=[],n=0;n<t.value.length;++n)for(var i=t.value[n],a=0;a<i.value.length;++a)e.push(r.certificateExtensionFromAsn1(i.value[a]));return e},r.certificateExtensionFromAsn1=function(t){var r={};if(r.id=e.derToOid(t.value[0].value),r.critical=!1,t.value[1].type===e.Type.BOOLEAN?(r.critical=0!==t.value[1].value.charCodeAt(0),r.value=t.value[2].value):r.value=t.value[1].value,r.id in n)if(r.name=n[r.id],"keyUsage"===r.name){var i=0,a=0;(s=e.fromDer(r.value)).value.length>1&&(i=s.value.charCodeAt(1),a=s.value.length>2?s.value.charCodeAt(2):0),r.digitalSignature=128==(128&i),r.nonRepudiation=64==(64&i),r.keyEncipherment=32==(32&i),r.dataEncipherment=16==(16&i),r.keyAgreement=8==(8&i),r.keyCertSign=4==(4&i),r.cRLSign=2==(2&i),r.encipherOnly=1==(1&i),r.decipherOnly=128==(128&a)}else if("basicConstraints"===r.name){(s=e.fromDer(r.value)).value.length>0&&s.value[0].type===e.Type.BOOLEAN?r.cA=0!==s.value[0].value.charCodeAt(0):r.cA=!1;var o=null;s.value.length>0&&s.value[0].type===e.Type.INTEGER?o=s.value[0].value:s.value.length>1&&(o=s.value[1].value),null!==o&&(r.pathLenConstraint=e.derToInteger(o))}else if("extKeyUsage"===r.name)for(var s=e.fromDer(r.value),u=0;u<s.value.length;++u){var c=e.derToOid(s.value[u].value);c in n?r[n[c]]=!0:r[c]=!0}else if("nsCertType"===r.name){i=0;(s=e.fromDer(r.value)).value.length>1&&(i=s.value.charCodeAt(1)),r.client=128==(128&i),r.server=64==(64&i),r.email=32==(32&i),r.objsign=16==(16&i),r.reserved=8==(8&i),r.sslCA=4==(4&i),r.emailCA=2==(2&i),r.objCA=1==(1&i)}else if("subjectAltName"===r.name||"issuerAltName"===r.name){var f;r.altNames=[];s=e.fromDer(r.value);for(var l=0;l<s.value.length;++l){var h={type:(f=s.value[l]).type,value:f.value};switch(r.altNames.push(h),f.type){case 1:case 2:case 6:break;case 7:h.ip=xu.util.bytesToIP(f.value);break;case 8:h.oid=e.derToOid(f.value)}}}else if("subjectKeyIdentifier"===r.name){s=e.fromDer(r.value);r.subjectKeyIdentifier=xu.util.bytesToHex(s.value)}return r},r.certificationRequestFromAsn1=function(t,i){var a={},o=[];if(!e.validate(t,c,a,o))throw(u=new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.")).errors=o,u;if(e.derToOid(a.publicKeyOid)!==r.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var s=r.createCertificationRequest();if(s.version=a.csrVersion?a.csrVersion.charCodeAt(0):0,s.signatureOid=xu.asn1.derToOid(a.csrSignatureOid),s.signatureParameters=l(s.signatureOid,a.csrSignatureParams,!0),s.siginfo.algorithmOid=xu.asn1.derToOid(a.csrSignatureOid),s.siginfo.parameters=l(s.siginfo.algorithmOid,a.csrSignatureParams,!1),s.signature=a.csrSignature,s.certificationRequestInfo=a.certificationRequestInfo,i){var u;if(s.md=null,s.signatureOid in n)switch(n[s.signatureOid]){case"sha1WithRSAEncryption":s.md=xu.md.sha1.create();break;case"md5WithRSAEncryption":s.md=xu.md.md5.create();break;case"sha256WithRSAEncryption":s.md=xu.md.sha256.create();break;case"sha384WithRSAEncryption":s.md=xu.md.sha384.create();break;case"sha512WithRSAEncryption":s.md=xu.md.sha512.create();break;case"RSASSA-PSS":s.md=xu.md.sha256.create()}if(null===s.md)throw(u=new Error("Could not compute certification request digest. Unknown signature OID.")).signatureOid=s.signatureOid,u;var h=e.toDer(s.certificationRequestInfo);s.md.update(h.getBytes())}var d=xu.md.sha1.create();return s.subject.getField=function(t){return f(s.subject,t)},s.subject.addField=function(t){p([t]),s.subject.attributes.push(t)},s.subject.attributes=r.RDNAttributesAsArray(a.certificationRequestInfoSubject,d),s.subject.hash=d.digest().toHex(),s.publicKey=r.publicKeyFromAsn1(a.subjectPublicKeyInfo),s.getAttribute=function(t){return f(s,t)},s.addAttribute=function(t){p([t]),s.attributes.push(t)},s.attributes=r.CRIAttributesAsArray(a.certificationRequestInfoAttributes||[]),s},r.createCertificationRequest=function(){var t={version:0,signatureOid:null,signature:null,siginfo:{}};return t.siginfo.algorithmOid=null,t.subject={},t.subject.getField=function(e){return f(t.subject,e)},t.subject.addField=function(e){p([e]),t.subject.attributes.push(e)},t.subject.attributes=[],t.subject.hash=null,t.publicKey=null,t.attributes=[],t.getAttribute=function(e){return f(t,e)},t.addAttribute=function(e){p([e]),t.attributes.push(e)},t.md=null,t.setSubject=function(e){p(e),t.subject.attributes=e,t.subject.hash=null},t.setAttributes=function(e){p(e),t.attributes=e},t.sign=function(i,a){t.md=a||xu.md.sha1.create();var o=n[t.md.algorithm+"WithRSAEncryption"];if(!o){var s=new Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw s.algorithm=t.md.algorithm,s}t.signatureOid=t.siginfo.algorithmOid=o,t.certificationRequestInfo=r.getCertificationRequestInfo(t);var u=e.toDer(t.certificationRequestInfo);t.md.update(u.getBytes()),t.signature=i.sign(t.md)},t.verify=function(){var i=!1,a=t.md;if(null===a){if(t.signatureOid in n)switch(n[t.signatureOid]){case"sha1WithRSAEncryption":a=xu.md.sha1.create();break;case"md5WithRSAEncryption":a=xu.md.md5.create();break;case"sha256WithRSAEncryption":a=xu.md.sha256.create();break;case"sha384WithRSAEncryption":a=xu.md.sha384.create();break;case"sha512WithRSAEncryption":a=xu.md.sha512.create();break;case"RSASSA-PSS":a=xu.md.sha256.create()}if(null===a)throw(l=new Error("Could not compute certification request digest. Unknown signature OID.")).signatureOid=t.signatureOid,l;var o=t.certificationRequestInfo||r.getCertificationRequestInfo(t),s=e.toDer(o);a.update(s.getBytes())}if(null!==a){var u;switch(t.signatureOid){case n.sha1WithRSAEncryption:break;case n["RSASSA-PSS"]:var c,f,l;if(void 0===(c=n[t.signatureParameters.mgf.hash.algorithmOid])||void 0===xu.md[c])throw(l=new Error("Unsupported MGF hash function.")).oid=t.signatureParameters.mgf.hash.algorithmOid,l.name=c,l;if(void 0===(f=n[t.signatureParameters.mgf.algorithmOid])||void 0===xu.mgf[f])throw(l=new Error("Unsupported MGF function.")).oid=t.signatureParameters.mgf.algorithmOid,l.name=f,l;if(f=xu.mgf[f].create(xu.md[c].create()),void 0===(c=n[t.signatureParameters.hash.algorithmOid])||void 0===xu.md[c])throw(l=new Error("Unsupported RSASSA-PSS hash function.")).oid=t.signatureParameters.hash.algorithmOid,l.name=c,l;u=xu.pss.create(xu.md[c].create(),f,t.signatureParameters.saltLength)}i=t.publicKey.verify(a.digest().getBytes(),t.signature,u)}return i},t};var v=new Date("1950-01-01T00:00:00Z"),m=new Date("2050-01-01T00:00:00Z");function C(t){return t>=v&&t<m?e.create(e.Class.UNIVERSAL,e.Type.UTCTIME,!1,e.dateToUtcTime(t)):e.create(e.Class.UNIVERSAL,e.Type.GENERALIZEDTIME,!1,e.dateToGeneralizedTime(t))}r.getTBSCertificate=function(t){var n=C(t.validity.notBefore),i=C(t.validity.notAfter),a=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[e.create(e.Class.UNIVERSAL,e.Type.INTEGER,!1,e.integerToDer(t.version).getBytes())]),e.create(e.Class.UNIVERSAL,e.Type.INTEGER,!1,xu.util.hexToBytes(t.serialNumber)),e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(t.siginfo.algorithmOid).getBytes()),y(t.siginfo.algorithmOid,t.siginfo.parameters)]),h(t.issuer),e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[n,i]),h(t.subject),r.publicKeyToAsn1(t.publicKey)]);return t.issuer.uniqueId&&a.value.push(e.create(e.Class.CONTEXT_SPECIFIC,1,!0,[e.create(e.Class.UNIVERSAL,e.Type.BITSTRING,!1,String.fromCharCode(0)+t.issuer.uniqueId)])),t.subject.uniqueId&&a.value.push(e.create(e.Class.CONTEXT_SPECIFIC,2,!0,[e.create(e.Class.UNIVERSAL,e.Type.BITSTRING,!1,String.fromCharCode(0)+t.subject.uniqueId)])),t.extensions.length>0&&a.value.push(r.certificateExtensionsToAsn1(t.extensions)),a},r.getCertificationRequestInfo=function(t){return e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.INTEGER,!1,e.integerToDer(t.version).getBytes()),h(t.subject),r.publicKeyToAsn1(t.publicKey),g(t)])},r.distinguishedNameToAsn1=function(t){return h(t)},r.certificateToAsn1=function(t){var n=t.tbsCertificate||r.getTBSCertificate(t);return e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[n,e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(t.signatureOid).getBytes()),y(t.signatureOid,t.signatureParameters)]),e.create(e.Class.UNIVERSAL,e.Type.BITSTRING,!1,String.fromCharCode(0)+t.signature)])},r.certificateExtensionsToAsn1=function(t){var n=e.create(e.Class.CONTEXT_SPECIFIC,3,!0,[]),i=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[]);n.value.push(i);for(var a=0;a<t.length;++a)i.value.push(r.certificateExtensionToAsn1(t[a]));return n},r.certificateExtensionToAsn1=function(t){var r=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[]);r.value.push(e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(t.id).getBytes())),t.critical&&r.value.push(e.create(e.Class.UNIVERSAL,e.Type.BOOLEAN,!1,String.fromCharCode(255)));var n=t.value;return"string"!=typeof t.value&&(n=e.toDer(n).getBytes()),r.value.push(e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,n)),r},r.certificationRequestToAsn1=function(t){var n=t.certificationRequestInfo||r.getCertificationRequestInfo(t);return e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[n,e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(t.signatureOid).getBytes()),y(t.signatureOid,t.signatureParameters)]),e.create(e.Class.UNIVERSAL,e.Type.BITSTRING,!1,String.fromCharCode(0)+t.signature)])},r.createCaStore=function(t){var n={certs:{}};function i(t){return a(t),n.certs[t.hash]||null}function a(t){if(!t.hash){var e=xu.md.sha1.create();t.attributes=r.RDNAttributesAsArray(h(t),e),t.hash=e.digest().toHex()}}if(n.getIssuer=function(t){return i(t.issuer)},n.addCertificate=function(t){if("string"==typeof t&&(t=xu.pki.certificateFromPem(t)),a(t.subject),!n.hasCertificate(t))if(t.subject.hash in n.certs){var e=n.certs[t.subject.hash];xu.util.isArray(e)||(e=[e]),e.push(t),n.certs[t.subject.hash]=e}else n.certs[t.subject.hash]=t},n.hasCertificate=function(t){"string"==typeof t&&(t=xu.pki.certificateFromPem(t));var n=i(t.subject);if(!n)return!1;xu.util.isArray(n)||(n=[n]);for(var a=e.toDer(r.certificateToAsn1(t)).getBytes(),o=0;o<n.length;++o){if(a===e.toDer(r.certificateToAsn1(n[o])).getBytes())return!0}return!1},n.listAllCertificates=function(){var t=[];for(var e in n.certs)if(n.certs.hasOwnProperty(e)){var r=n.certs[e];if(xu.util.isArray(r))for(var i=0;i<r.length;++i)t.push(r[i]);else t.push(r)}return t},n.removeCertificate=function(t){var o;if("string"==typeof t&&(t=xu.pki.certificateFromPem(t)),a(t.subject),!n.hasCertificate(t))return null;var s=i(t.subject);if(!xu.util.isArray(s))return o=n.certs[t.subject.hash],delete n.certs[t.subject.hash],o;for(var u=e.toDer(r.certificateToAsn1(t)).getBytes(),c=0;c<s.length;++c){u===e.toDer(r.certificateToAsn1(s[c])).getBytes()&&(o=s[c],s.splice(c,1))}return 0===s.length&&delete n.certs[t.subject.hash],o},t)for(var o=0;o<t.length;++o){var s=t[o];n.addCertificate(s)}return n},r.certificateError={bad_certificate:"forge.pki.BadCertificate",unsupported_certificate:"forge.pki.UnsupportedCertificate",certificate_revoked:"forge.pki.CertificateRevoked",certificate_expired:"forge.pki.CertificateExpired",certificate_unknown:"forge.pki.CertificateUnknown",unknown_ca:"forge.pki.UnknownCertificateAuthority"},r.verifyCertificateChain=function(t,e,n){"function"==typeof n&&(n={verify:n}),n=n||{};var i=(e=e.slice(0)).slice(0),a=n.validityCheckDate;void 0===a&&(a=new Date);var o=!0,s=null,u=0;do{var c=e.shift(),f=null,l=!1;if(a&&(a<c.validity.notBefore||a>c.validity.notAfter)&&(s={message:"Certificate is not valid yet or has expired.",error:r.certificateError.certificate_expired,notBefore:c.validity.notBefore,notAfter:c.validity.notAfter,now:a}),null===s){if(null===(f=e[0]||t.getIssuer(c))&&c.isIssuer(c)&&(l=!0,f=c),f){var h=f;xu.util.isArray(h)||(h=[h]);for(var p=!1;!p&&h.length>0;){f=h.shift();try{p=f.verify(c)}catch(t){}}p||(s={message:"Certificate signature is invalid.",error:r.certificateError.bad_certificate})}null!==s||f&&!l||t.hasCertificate(c)||(s={message:"Certificate is not trusted.",error:r.certificateError.unknown_ca})}if(null===s&&f&&!c.isIssuer(f)&&(s={message:"Certificate issuer is invalid.",error:r.certificateError.bad_certificate}),null===s)for(var d={keyUsage:!0,basicConstraints:!0},y=0;null===s&&y<c.extensions.length;++y){var g=c.extensions[y];g.critical&&!(g.name in d)&&(s={message:"Certificate has an unsupported critical extension.",error:r.certificateError.unsupported_certificate})}if(null===s&&(!o||0===e.length&&(!f||l))){var v=c.getExtension("basicConstraints"),m=c.getExtension("keyUsage");if(null!==m&&(m.keyCertSign&&null!==v||(s={message:"Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",error:r.certificateError.bad_certificate})),null!==s||null===v||v.cA||(s={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:r.certificateError.bad_certificate}),null===s&&null!==m&&"pathLenConstraint"in v)u-1>v.pathLenConstraint&&(s={message:"Certificate basicConstraints pathLenConstraint violated.",error:r.certificateError.bad_certificate})}var C=null===s||s.error,E=n.verify?n.verify(C,u,i):C;if(!0!==E)throw!0===C&&(s={message:"The application rejected the certificate.",error:r.certificateError.bad_certificate}),(E||0===E)&&("object"!=typeof E||xu.util.isArray(E)?"string"==typeof E&&(s.error=E):(E.message&&(s.message=E.message),E.error&&(s.error=E.error))),s;s=null,o=!1,++u}while(e.length>0);return!0}})),w((function(t){var e=xu.asn1,r=xu.pki,n=t.exports=xu.pkcs12=xu.pkcs12||{},i={name:"ContentInfo",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:e.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},a={name:"PFX",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1,capture:"version"},i,{name:"PFX.macData",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",tagClass:e.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:e.Class.UNIVERSAL,type:e.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:e.Class.UNIVERSAL,type:e.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},o={name:"SafeBag",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:e.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:e.Class.UNIVERSAL,type:e.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},s={name:"Attribute",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:e.Class.UNIVERSAL,type:e.Type.SET,constructed:!0,capture:"values"}]},u={name:"CertBag",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:e.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:e.Class.UNIVERSAL,type:e.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function c(t,e,r,n){for(var i=[],a=0;a<t.length;a++)for(var o=0;o<t[a].safeBags.length;o++){var s=t[a].safeBags[o];void 0!==n&&s.type!==n||(null!==e?void 0!==s.attributes[e]&&s.attributes[e].indexOf(r)>=0&&i.push(s):i.push(s))}return i}function f(t){if(t.composed||t.constructed){for(var e=xu.util.createBuffer(),r=0;r<t.value.length;++r)e.putBytes(t.value[r].value);t.composed=t.constructed=!1,t.value=e.getBytes()}return t}function l(t,n){var i={},a=[];if(!e.validate(t,xu.pkcs7.asn1.encryptedDataValidator,i,a))throw(o=new Error("Cannot read EncryptedContentInfo.")).errors=a,o;var o,s=e.derToOid(i.contentType);if(s!==r.oids.data)throw(o=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.")).oid=s,o;s=e.derToOid(i.encAlgorithm);var u=r.pbe.getCipher(s,i.encParameter,n),c=f(i.encryptedContentAsn1),l=xu.util.createBuffer(c.value);if(u.update(l),!u.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return u.output.getBytes()}function h(t,n,i){if(!n&&0===t.length)return[];if((t=e.fromDer(t,n)).tagClass!==e.Class.UNIVERSAL||t.type!==e.Type.SEQUENCE||!0!==t.constructed)throw new Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var a=[],s=0;s<t.value.length;s++){var c=t.value[s],f={},l=[];if(!e.validate(c,o,f,l))throw(v=new Error("Cannot read SafeBag.")).errors=l,v;var h,d,y={type:e.derToOid(f.bagId),attributes:p(f.bagAttributes)};a.push(y);var g=f.bagValue.value[0];switch(y.type){case r.oids.pkcs8ShroudedKeyBag:if(null===(g=r.decryptPrivateKeyInfo(g,i)))throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case r.oids.keyBag:try{y.key=r.privateKeyFromAsn1(g)}catch(t){y.key=null,y.asn1=g}continue;case r.oids.certBag:h=u,d=function(){if(e.derToOid(f.certId)!==r.oids.x509Certificate){var t=new Error("Unsupported certificate type, only X.509 supported.");throw t.oid=e.derToOid(f.certId),t}var i=e.fromDer(f.cert,n);try{y.cert=r.certificateFromAsn1(i,!0)}catch(t){y.cert=null,y.asn1=i}};break;default:var v;throw(v=new Error("Unsupported PKCS#12 SafeBag type.")).oid=y.type,v}if(void 0!==h&&!e.validate(g,h,f,l))throw(v=new Error("Cannot read PKCS#12 "+h.name)).errors=l,v;d()}return a}function p(t){var n={};if(void 0!==t)for(var i=0;i<t.length;++i){var a={},o=[];if(!e.validate(t[i],s,a,o)){var u=new Error("Cannot read PKCS#12 BagAttribute.");throw u.errors=o,u}var c=e.derToOid(a.oid);if(void 0!==r.oids[c]){n[r.oids[c]]=[];for(var f=0;f<a.values.length;++f)n[r.oids[c]].push(a.values[f].value)}}return n}n.pkcs12FromAsn1=function(t,o,s){"string"==typeof o?(s=o,o=!0):void 0===o&&(o=!0);var u={};if(!e.validate(t,a,u,[]))throw(p=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.")).errors=p,p;var p,d={version:u.version.charCodeAt(0),safeContents:[],getBags:function(t){var e,r={};return"localKeyId"in t?e=t.localKeyId:"localKeyIdHex"in t&&(e=xu.util.hexToBytes(t.localKeyIdHex)),void 0===e&&!("friendlyName"in t)&&"bagType"in t&&(r[t.bagType]=c(d.safeContents,null,null,t.bagType)),void 0!==e&&(r.localKeyId=c(d.safeContents,"localKeyId",e,t.bagType)),"friendlyName"in t&&(r.friendlyName=c(d.safeContents,"friendlyName",t.friendlyName,t.bagType)),r},getBagsByFriendlyName:function(t,e){return c(d.safeContents,"friendlyName",t,e)},getBagsByLocalKeyId:function(t,e){return c(d.safeContents,"localKeyId",t,e)}};if(3!==u.version.charCodeAt(0))throw(p=new Error("PKCS#12 PFX of version other than 3 not supported.")).version=u.version.charCodeAt(0),p;if(e.derToOid(u.contentType)!==r.oids.data)throw(p=new Error("Only PKCS#12 PFX in password integrity mode supported.")).oid=e.derToOid(u.contentType),p;var y=u.content.value[0];if(y.tagClass!==e.Class.UNIVERSAL||y.type!==e.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(y=f(y),u.mac){var g=null,v=0,m=e.derToOid(u.macAlgorithm);switch(m){case r.oids.sha1:g=xu.md.sha1.create(),v=20;break;case r.oids.sha256:g=xu.md.sha256.create(),v=32;break;case r.oids.sha384:g=xu.md.sha384.create(),v=48;break;case r.oids.sha512:g=xu.md.sha512.create(),v=64;break;case r.oids.md5:g=xu.md.md5.create(),v=16}if(null===g)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+m);var C=new xu.util.ByteBuffer(u.macSalt),E="macIterations"in u?parseInt(xu.util.bytesToHex(u.macIterations),16):1,S=n.generateKey(s,C,3,E,v,g),b=xu.hmac.create();if(b.start(g,S),b.update(y.value),b.getMac().getBytes()!==u.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}return function(t,n,a,o){if((n=e.fromDer(n,a)).tagClass!==e.Class.UNIVERSAL||n.type!==e.Type.SEQUENCE||!0!==n.constructed)throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var s=0;s<n.value.length;s++){var u=n.value[s],c={},p=[];if(!e.validate(u,i,c,p))throw(v=new Error("Cannot read ContentInfo.")).errors=p,v;var d={encrypted:!1},y=null,g=c.content.value[0];switch(e.derToOid(c.contentType)){case r.oids.data:if(g.tagClass!==e.Class.UNIVERSAL||g.type!==e.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");y=f(g).value;break;case r.oids.encryptedData:y=l(g,o),d.encrypted=!0;break;default:var v;throw(v=new Error("Unsupported PKCS#12 contentType.")).contentType=e.derToOid(c.contentType),v}d.safeBags=h(y,a,o),t.safeContents.push(d)}}(d,y.value,o,s),d},n.toPkcs12Asn1=function(t,i,a,o){(o=o||{}).saltSize=o.saltSize||8,o.count=o.count||2048,o.algorithm=o.algorithm||o.encAlgorithm||"aes128","useMac"in o||(o.useMac=!0),"localKeyId"in o||(o.localKeyId=null),"generateLocalKeyId"in o||(o.generateLocalKeyId=!0);var s,u=o.localKeyId;if(null!==u)u=xu.util.hexToBytes(u);else if(o.generateLocalKeyId)if(i){var c=xu.util.isArray(i)?i[0]:i;"string"==typeof c&&(c=r.certificateFromPem(c)),(w=xu.md.sha1.create()).update(e.toDer(r.certificateToAsn1(c)).getBytes()),u=w.digest().getBytes()}else u=xu.random.getBytes(20);var f=[];null!==u&&f.push(e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(r.oids.localKeyId).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.SET,!0,[e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,u)])])),"friendlyName"in o&&f.push(e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(r.oids.friendlyName).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.SET,!0,[e.create(e.Class.UNIVERSAL,e.Type.BMPSTRING,!1,o.friendlyName)])])),f.length>0&&(s=e.create(e.Class.UNIVERSAL,e.Type.SET,!0,f));var l=[],h=[];null!==i&&(h=xu.util.isArray(i)?i:[i]);for(var p=[],d=0;d<h.length;++d){"string"==typeof(i=h[d])&&(i=r.certificateFromPem(i));var y=0===d?s:void 0,g=r.certificateToAsn1(i),v=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(r.oids.certBag).getBytes()),e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(r.oids.x509Certificate).getBytes()),e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,e.toDer(g).getBytes())])])]),y]);p.push(v)}if(p.length>0){var m=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,p),C=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(r.oids.data).getBytes()),e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,e.toDer(m).getBytes())])]);l.push(C)}var E=null;if(null!==t){var S=r.wrapRsaPrivateKey(r.privateKeyToAsn1(t));E=null===a?e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(r.oids.keyBag).getBytes()),e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[S]),s]):e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(r.oids.pkcs8ShroudedKeyBag).getBytes()),e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[r.encryptPrivateKeyInfo(S,a,o)]),s]);var b=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[E]),T=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(r.oids.data).getBytes()),e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,e.toDer(b).getBytes())])]);l.push(T)}var I,A=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,l);if(o.useMac){var w=xu.md.sha1.create(),_=new xu.util.ByteBuffer(xu.random.getBytes(o.saltSize)),B=o.count,N=(t=n.generateKey(a,_,3,B,20),xu.hmac.create());N.start(w,t),N.update(e.toDer(A).getBytes());var k=N.getMac();I=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(r.oids.sha1).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.NULL,!1,"")]),e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,k.getBytes())]),e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,_.getBytes()),e.create(e.Class.UNIVERSAL,e.Type.INTEGER,!1,e.integerToDer(B).getBytes())])}return e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.INTEGER,!1,e.integerToDer(3).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(r.oids.data).getBytes()),e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,e.toDer(A).getBytes())])]),I])},n.generateKey=xu.pbe.generatePkcs12Key}));var Ef=w((function(t){var e=xu.asn1,r=t.exports=xu.pki=xu.pki||{};r.pemToDer=function(t){var e=xu.pem.decode(t)[0];if(e.procType&&"ENCRYPTED"===e.procType.type)throw new Error("Could not convert PEM to DER; PEM is encrypted.");return xu.util.createBuffer(e.body)},r.privateKeyFromPem=function(t){var n=xu.pem.decode(t)[0];if("PRIVATE KEY"!==n.type&&"RSA PRIVATE KEY"!==n.type){var i=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw i.headerType=n.type,i}if(n.procType&&"ENCRYPTED"===n.procType.type)throw new Error("Could not convert private key from PEM; PEM is encrypted.");var a=e.fromDer(n.body);return r.privateKeyFromAsn1(a)},r.privateKeyToPem=function(t,n){var i={type:"RSA PRIVATE KEY",body:e.toDer(r.privateKeyToAsn1(t)).getBytes()};return xu.pem.encode(i,{maxline:n})},r.privateKeyInfoToPem=function(t,r){var n={type:"PRIVATE KEY",body:e.toDer(t).getBytes()};return xu.pem.encode(n,{maxline:r})}})),Sf=w((function(t,e){var r=e;r.createCA=function(t){var e=Ef.rsa.generateKeyPair(2046),r=Ef.createCertificate();r.publicKey=e.publicKey,r.serialNumber=(new Date).getTime()+"",r.validity.notBefore=new Date,r.validity.notBefore.setFullYear(r.validity.notBefore.getFullYear()-5),r.validity.notAfter=new Date,r.validity.notAfter.setFullYear(r.validity.notAfter.getFullYear()+20);var n=[{name:"commonName",value:t},{name:"countryName",value:"CN"},{shortName:"ST",value:"GuangDong"},{name:"localityName",value:"ShenZhen"},{name:"organizationName",value:"node-mitmproxy"},{shortName:"OU",value:"https://github.com/wuchangming/node-mitmproxy"}];return r.setSubject(n),r.setIssuer(n),r.setExtensions([{name:"basicConstraints",critical:!0,cA:!0},{name:"keyUsage",critical:!0,keyCertSign:!0},{name:"subjectKeyIdentifier"}]),r.sign(e.privateKey,fc.sha256.create()),{key:e.privateKey,cert:r}},r.covertNodeCertToForgeCert=function(t){var e=ju.fromDer(t.raw.toString("binary"));return Ef.certificateFromAsn1(e)},r.createFakeCertificateByDomain=function(t,e,r){var n=Ef.rsa.generateKeyPair(2046),i=Ef.createCertificate();i.publicKey=n.publicKey,i.serialNumber=(new Date).getTime()+"",i.validity.notBefore=new Date,i.validity.notBefore.setFullYear(i.validity.notBefore.getFullYear()-1),i.validity.notAfter=new Date,i.validity.notAfter.setFullYear(i.validity.notAfter.getFullYear()+1);var a=[{name:"commonName",value:r},{name:"countryName",value:"CN"},{shortName:"ST",value:"GuangDong"},{name:"localityName",value:"ShengZhen"},{name:"organizationName",value:"node-mitmproxy"},{shortName:"OU",value:"https://github.com/wuchangming/node-mitmproxy"}];return i.setIssuer(e.subject.attributes),i.setSubject(a),i.setExtensions([{name:"basicConstraints",critical:!0,cA:!1},{name:"keyUsage",critical:!0,digitalSignature:!0,contentCommitment:!0,keyEncipherment:!0,dataEncipherment:!0,keyAgreement:!0,keyCertSign:!0,cRLSign:!0,encipherOnly:!0,decipherOnly:!0},{name:"subjectAltName",altNames:[{type:2,value:r}]},{name:"subjectKeyIdentifier"},{name:"extKeyUsage",serverAuth:!0,clientAuth:!0,codeSigning:!0,emailProtection:!0,timeStamping:!0},{name:"authorityKeyIdentifier"}]),i.sign(t,fc.sha256.create()),{key:n.privateKey,cert:i}},r.createFakeCertificateByCA=function(t,e,n){var i=r.covertNodeCertToForgeCert(n),a=Ef.rsa.generateKeyPair(2046),o=Ef.createCertificate();o.publicKey=a.publicKey,o.serialNumber=i.serialNumber,o.validity.notBefore=new Date,o.validity.notBefore.setFullYear(o.validity.notBefore.getFullYear()-1),o.validity.notAfter=new Date,o.validity.notAfter.setFullYear(o.validity.notAfter.getFullYear()+1),o.setSubject(i.subject.attributes),o.setIssuer(e.subject.attributes),i.subjectaltname&&(o.subjectaltname=i.subjectaltname);var s=Ou.find(i.extensions,{name:"subjectAltName"});return o.setExtensions([{name:"basicConstraints",critical:!0,cA:!1},{name:"keyUsage",critical:!0,digitalSignature:!0,contentCommitment:!0,keyEncipherment:!0,dataEncipherment:!0,keyAgreement:!0,keyCertSign:!0,cRLSign:!0,encipherOnly:!0,decipherOnly:!0},{name:"subjectAltName",altNames:s.altNames},{name:"subjectKeyIdentifier"},{name:"extKeyUsage",serverAuth:!0,clientAuth:!0,codeSigning:!0,emailProtection:!0,timeStamping:!0},{name:"authorityKeyIdentifier"}]),o.sign(t,fc.sha256.create()),{key:a.privateKey,cert:o}},r.isBrowserRequest=function(){return/Mozilla/i.test(userAgent)},r.isMappingHostName=function(t,e){var r=t.replace(/\./g,"\\.").replace(/\*/g,"[^.]+");return r="^"+r+"$",new RegExp(r).test(e)},r.getMappingHostNamesFormCert=function(t){var e=[];e.push(t.subject.getField("CN")?t.subject.getField("CN").value:"");var r=t.getExtension("subjectAltName")?t.getExtension("subjectAltName").altNames:[];return e=e.concat(Ou.map(r,"value"))},r.initCA=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ru.getDefaultCABasePath(),e=d.default.resolve(t,Ru.caCertFileName),n=d.default.resolve(t,Ru.caKeyFileName);try{return p.default.accessSync(e,p.default.F_OK),p.default.accessSync(n,p.default.F_OK),{caCertPath:e,caKeyPath:n,create:!1}}catch(t){var i=r.createCA(Ru.caName),a=i.cert,o=i.key,s=Ef.certificateToPem(a),u=Ef.privateKeyToPem(o);Pu.sync(d.default.dirname(e)),p.default.writeFileSync(e,s),p.default.writeFileSync(n,u)}return{caCertPath:e,caKeyPath:n,create:!0}}})),bf=w((function(t){var e={};t.exports=e;var r={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(r).forEach((function(t){var n=r[t],i=e[t]=[];i.open="["+n[0]+"m",i.close="["+n[1]+"m"}))})),Tf=function(t,e){var r=(e=e||process.argv).indexOf("--"),n=/^-{1,2}/.test(t)?"":"--",i=e.indexOf(n+t);return-1!==i&&(-1===r||i<r)},If=process.env,Af=void 0;function wf(t){return function(t){return 0!==t&&{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}(function(t){if(!1===Af)return 0;if(Tf("color=16m")||Tf("color=full")||Tf("color=truecolor"))return 3;if(Tf("color=256"))return 2;if(t&&!t.isTTY&&!0!==Af)return 0;var e=Af?1:0;if("win32"===process.platform){var r=m.default.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in If)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((function(t){return t in If}))||"codeship"===If.CI_NAME?1:e;if("TEAMCITY_VERSION"in If)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(If.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in If){var n=parseInt((If.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(If.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(If.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(If.TERM)||"COLORTERM"in If?1:(If.TERM,e)}(t))}Tf("no-color")||Tf("no-colors")||Tf("color=false")?Af=!1:(Tf("color")||Tf("colors")||Tf("color=true")||Tf("color=always"))&&(Af=!0),"FORCE_COLOR"in If&&(Af=0===If.FORCE_COLOR.length||0!==parseInt(If.FORCE_COLOR,10));var _f=wf,Bf=(wf(process.stdout),wf(process.stderr),w((function(t){t.exports=function(t,e){var r="";t=(t=t||"Run the trap, drop the bass").split("");var n={a:["@","Ą","Ⱥ","Ʌ","Δ","Λ","Д"],b:["ß","Ɓ","Ƀ","ɮ","β","฿"],c:["©","Ȼ","Ͼ"],d:["Ð","Ɗ","Ԁ","ԁ","Ԃ","ԃ"],e:["Ë","ĕ","Ǝ","ɘ","Σ","ξ","Ҽ","੬"],f:["Ӻ"],g:["ɢ"],h:["Ħ","ƕ","Ң","Һ","Ӈ","Ԋ"],i:["༏"],j:["Ĵ"],k:["ĸ","Ҡ","Ӄ","Ԟ"],l:["Ĺ"],m:["ʍ","Ӎ","ӎ","Ԡ","ԡ","൩"],n:["Ñ","ŋ","Ɲ","Ͷ","Π","Ҋ"],o:["Ø","õ","ø","Ǿ","ʘ","Ѻ","ם","۝","๏"],p:["Ƿ","Ҏ"],q:["্"],r:["®","Ʀ","Ȑ","Ɍ","ʀ","Я"],s:["§","Ϟ","ϟ","Ϩ"],t:["Ł","Ŧ","ͳ"],u:["Ʊ","Ս"],v:["ט"],w:["Ш","Ѡ","Ѽ","൰"],x:["Ҳ","Ӿ","Ӽ","ӽ"],y:["¥","Ұ","Ӌ"],z:["Ƶ","ɀ"]};return t.forEach((function(t){t=t.toLowerCase();var e=n[t]||[" "],i=Math.floor(Math.random()*e.length);r+=void 0!==n[t]?n[t][i]:t})),r}}))),Nf=w((function(t){t.exports=function(t,e){t=t||" he is here ";var r={up:["̍","̎","̄","̅","̿","̑","̆","̐","͒","͗","͑","̇","̈","̊","͂","̓","̈","͊","͋","͌","̃","̂","̌","͐","̀","́","̋","̏","̒","̓","̔","̽","̉","ͣ","ͤ","ͥ","ͦ","ͧ","ͨ","ͩ","ͪ","ͫ","ͬ","ͭ","ͮ","ͯ","̾","͛","͆","̚"],down:["̖","̗","̘","̙","̜","̝","̞","̟","̠","̤","̥","̦","̩","̪","̫","̬","̭","̮","̯","̰","̱","̲","̳","̹","̺","̻","̼","ͅ","͇","͈","͉","͍","͎","͓","͔","͕","͖","͙","͚","̣"],mid:["̕","̛","̀","́","͘","̡","̢","̧","̨","̴","̵","̶","͜","͝","͞","͟","͠","͢","̸","̷","͡"," ҉"]},n=[].concat(r.up,r.down,r.mid);function i(t){return Math.floor(Math.random()*t)}function a(t){var e=!1;return n.filter((function(r){e=r===t})),e}return function(t,e){var n,o,s="";for(o in(e=e||{}).up=void 0===e.up||e.up,e.mid=void 0===e.mid||e.mid,e.down=void 0===e.down||e.down,e.size=void 0!==e.size?e.size:"maxi",t=t.split(""))if(!a(o)){switch(s+=t[o],n={up:0,down:0,mid:0},e.size){case"mini":n.up=i(8),n.mid=i(2),n.down=i(8);break;case"maxi":n.up=i(16)+3,n.mid=i(4)+1,n.down=i(64)+3;break;default:n.up=i(8)+1,n.mid=i(6)/2,n.down=i(8)+1}var u=["up","mid","down"];for(var c in u)for(var f=u[c],l=0;l<=n[f];l++)e[f]&&(s+=r[f][i(r[f].length)])}return s}(t,e)}})),kf=w((function(t){t.exports=function(t){return function(e,r,n){if(" "===e)return e;switch(r%3){case 0:return t.red(e);case 1:return t.white(e);case 2:return t.blue(e)}}}})),Rf=w((function(t){t.exports=function(t){return function(e,r,n){return r%2==0?e:t.inverse(e)}}})),Of=w((function(t){t.exports=function(t){var e=["red","yellow","green","blue","magenta"];return function(r,n,i){return" "===r?r:t[e[n++%e.length]](r)}}})),Lf=w((function(t){t.exports=function(t){var e=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(r,n,i){return" "===r?r:t[e[Math.round(Math.random()*(e.length-2))]](r)}}})),Pf=w((function(t){var e={};t.exports=e,e.themes={};var r=e.styles=bf,n=Object.defineProperties,i=new RegExp(/[\r\n]+/g);e.supportsColor=_f,void 0===e.enabled&&(e.enabled=!1!==e.supportsColor()),e.enable=function(){e.enabled=!0},e.disable=function(){e.enabled=!1},e.stripColors=e.strip=function(t){return(""+t).replace(/\x1B\[\d+m/g,"")},e.stylize=function(t,n){if(!e.enabled)return t+"";var i=r[n];return!i&&n in e?e[n](t):i.open+t+i.close};var a=/[|\\{}()[\]^$+*?.]/g;function o(t){var e=function t(){return f.apply(t,arguments)};return e._styles=t,e.__proto__=c,e}var s,u=(s={},r.grey=r.gray,Object.keys(r).forEach((function(t){r[t].closeRe=new RegExp(function(t){if("string"!=typeof t)throw new TypeError("Expected a string");return t.replace(a,"\\$&")}(r[t].close),"g"),s[t]={get:function(){return o(this._styles.concat(t))}}})),s),c=n((function(){}),u);function f(){var t=Array.prototype.slice.call(arguments),n=t.map((function(t){return null!=t&&t.constructor===String?t:v.default.inspect(t)})).join(" ");if(!e.enabled||!n)return n;for(var a=-1!=n.indexOf("\n"),o=this._styles,s=o.length;s--;){var u=r[o[s]];n=u.open+n.replace(u.closeRe,u.open)+u.close,a&&(n=n.replace(i,(function(t){return u.close+t+u.open})))}return n}e.setTheme=function(t){if("string"!=typeof t)for(var r in t)!function(r){e[r]=function(n){if("object"==typeof t[r]){var i=n;for(var a in t[r])i=e[t[r][a]](i);return i}return e[t[r]](n)}}(r);else console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));")};var l=function(t,e){var r=e.split("");return(r=r.map(t)).join("")};for(var h in e.trap=Bf,e.zalgo=Nf,e.maps={},e.maps.america=kf(e),e.maps.zebra=Rf(e),e.maps.rainbow=Of(e),e.maps.random=Lf(e),e.maps)!function(t){e[t]=function(r){return l(e.maps[t],r)}}(h);n(e,function(){var t={};return Object.keys(u).forEach((function(e){t[e]={get:function(){return o([e])}}})),t}())})),Uf=w((function(t){t.exports=function(){var t=function(t,e){String.prototype.__defineGetter__(t,e)};t("strip",(function(){return Pf.strip(this)})),t("stripColors",(function(){return Pf.strip(this)})),t("trap",(function(){return Pf.trap(this)})),t("zalgo",(function(){return Pf.zalgo(this)})),t("zebra",(function(){return Pf.zebra(this)})),t("rainbow",(function(){return Pf.rainbow(this)})),t("random",(function(){return Pf.random(this)})),t("america",(function(){return Pf.america(this)})),Object.keys(Pf.styles).forEach((function(e){t(e,(function(){return Pf.stylize(this,e)}))})),Pf.setTheme=function(e){"string"!=typeof e?function(e){var r=["__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","charAt","constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf","charCodeAt","indexOf","lastIndexOf","length","localeCompare","match","repeat","replace","search","slice","split","substring","toLocaleLowerCase","toLocaleUpperCase","toLowerCase","toUpperCase","trim","trimLeft","trimRight"];Object.keys(e).forEach((function(n){if(-1!==r.indexOf(n))console.log("warn: ".red+("String.prototype"+n).magenta+" is probably something you don't want to override. Ignoring style name");else if("string"==typeof e[n])Pf[n]=Pf[e[n]],t(n,(function(){return Pf[n](this)}));else{var i=function(t){for(var r=t||this,i=0;i<e[n].length;i++)r=Pf[e[n][i]](r);return r};t(n,i),Pf[n]=function(t){return i(t)}}}))}(e):console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));")}}})),xf=w((function(t){t.exports=Pf,Uf()})),Df=0===process.version.indexOf("v0.10."),Vf={debug:Df?function(){process.env.NODE_DEBUG&&/agentkeepalive/.test(process.env.NODE_DEBUG)&&console.log.apply(console.log,arguments)}:v.default.debuglog("agentkeepalive"),isNode10:Df,inherits:v.default.inherits},Mf=b.default.EventEmitter,jf=Vf.debug;function Ff(t){if(!(this instanceof Ff))return new Ff(t);Mf.call(this);var e=this;e.defaultPort=80,e.protocol="http:",e.options=v.default._extend({},t),e.options.path=null,e.requests={},e.sockets={},e.freeSockets={},e.keepAliveMsecs=e.options.keepAliveMsecs||1e3,e.keepAlive=e.options.keepAlive||!1,e.keepAliveTimeout=e.options.keepAliveTimeout||0,e.timeout=e.options.timeout||0,e.maxSockets=e.options.maxSockets||Ff.defaultMaxSockets,e.maxFreeSockets=e.options.maxFreeSockets||256,e.on("free",(function(t,r){var n=e.getName(r);if(jf("agent.on(free)",n),!t.destroyed&&e.requests[n]&&e.requests[n].length)e.requests[n].shift().onSocket(t),0===e.requests[n].length&&delete e.requests[n],jf("continue handle next request");else{var i=t._httpMessage;if(i&&i.shouldKeepAlive&&!t.destroyed&&e.options.keepAlive){var a=e.freeSockets[n],o=a?a.length:0,s=o;e.sockets[n]&&(s+=e.sockets[n].length),s>e.maxSockets||o>=e.maxFreeSockets?(e.removeSocket(t,r),t.destroy()):(a=a||[],e.freeSockets[n]=a,t.setKeepAlive(!0,e.keepAliveMsecs),t.unref&&t.unref(),t._httpMessage=null,e.removeSocket(t,r),a.push(t),0===t.listeners("error").length&&t.once("error",qf),t.setTimeout(e.keepAliveTimeout))}else e.removeSocket(t,r),t.destroy()}}))}v.default.inherits(Ff,Mf);var Kf=Ff;function qf(t){jf("SOCKET ERROR on FREE socket:",t.message,t.stack),this.destroy(),this.emit("agentRemove")}Ff.defaultMaxSockets=1/0,Ff.prototype.createConnection=S.default.createConnection,Ff.prototype.getName=function(t){var e="";return t.host?e+=t.host:e+="localhost",e+=":",t.port&&(e+=t.port),e+=":",t.localAddress&&(e+=t.localAddress),e+=":"},Ff.prototype.addRequest=function(t,e){"string"==typeof e&&(e={host:e,port:arguments[2],path:arguments[3]}),e=v.default._extend({},e),e=v.default._extend(e,this.options);var r=this.getName(e);this.sockets[r]||(this.sockets[r]=[]);var n=this.freeSockets[r]?this.freeSockets[r].length:0,i=n+this.sockets[r].length;if(n){var a=this.freeSockets[r].shift();jf("have free socket"),a.removeListener("error",qf),a.setTimeout(this.timeout),this.freeSockets[r].length||delete this.freeSockets[r],a.ref&&a.ref(),t.onSocket(a),this.sockets[r].push(a)}else i<this.maxSockets?(jf("call onSocket",i,n),t.onSocket(this.createSocket(t,e))):(jf("wait for socket"),this.requests[r]||(this.requests[r]=[]),this.requests[r].push(t))},Ff.prototype.createSocket=function(t,e){var r=this;if(e=v.default._extend({},e),!(e=v.default._extend(e,r.options)).servername&&(e.servername=e.host,t)){var n=t.getHeader("host");n&&(e.servername=n.replace(/:.*$/,""))}var i=r.getName(e);jf("createConnection",i,e),e.encoding=null;var a=r.createConnection(e);function o(){r.emit("free",a,e)}function s(t){jf("CLIENT socket onClose"),"boolean"!=typeof a.destroyed&&(a.destroyed=!0),r.removeSocket(a,e),r.emit("close")}function u(){jf("CLIENT socket onTimeout"),a.destroy(),r.removeSocket(a,e),r.emit("timeout")}return r.sockets[i]||(r.sockets[i]=[]),this.sockets[i].push(a),jf("sockets",i,this.sockets[i].length),a.on("free",o),a.on("close",s),a.on("timeout",u),a.setTimeout(r.timeout),a.on("agentRemove",(function t(){jf("CLIENT socket onRemove"),r.removeSocket(a,e),a.removeListener("close",s),a.removeListener("free",o),a.removeListener("agentRemove",t),a.setTimeout(0,u)})),a},Ff.prototype.removeSocket=function(t,e){var r,n=this.getName(e);jf("removeSocket",n,"destroyed:",t.destroyed);var i=[this.sockets];t.destroyed&&i.push(this.freeSockets);for(var a=0;a<i.length;a++){var o=i[a];if(o[n]){var s=o[n].indexOf(t);-1!==s&&(o[n].splice(s,1),0===o[n].length&&delete o[n])}}if(r=(this.freeSockets[n]?this.freeSockets[n].length:0)+this.sockets[n]?this.sockets[n].length:0,this.requests[n]&&this.requests[n].length&&r<this.maxSockets){jf("removeSocket, have a request, make a socket");var u=this.requests[n][0];this.createSocket(u,e).emit("free")}},Ff.prototype.destroy=function(){for(var t=[this.freeSockets,this.sockets],e=0;e<t.length;e++)for(var r=t[e],n=Object.keys(r),i=0;i<n.length;i++)for(var a=r[n[i]],o=0;o<a.length;o++)a[o].destroy()};var Gf={Agent:Kf,globalAgent:new Ff}.Agent;C.default.Agent;var zf=Wf;function Wf(t){if(!(this instanceof Wf))return new Wf(t);(t=t||{}).keepAlive=!1!==t.keepAlive,void 0===t.keepAliveTimeout&&(t.keepAliveTimeout=15e3),void 0===t.timeout&&(t.timeout=2*t.keepAliveTimeout),Gf.call(this,t);var e=this;e.createSocketCount=0,e.closeSocketCount=0,e.errorSocketCount=0,e.requestCount=0,e.timeoutSocketCount=0,e.on("free",(function(){e.requestCount++})),e.on("timeout",(function(){e.timeoutSocketCount++})),e.on("close",(function(){e.closeSocketCount++})),e.on("error",(function(){e.errorSocketCount++}))}function Hf(t){var e={};for(var r in t)e[r]=t[r].length;return e}Vf.inherits(Wf,Gf),Wf.prototype.createSocket=function(t,e){var r=Gf.prototype.createSocket.call(this,t,e);return this.keepAlive&&r.setNoDelay(!0),this.createSocketCount++,r},Wf.prototype.getCurrentStatus=function(){return{createSocketCount:this.createSocketCount,closeSocketCount:this.closeSocketCount,errorSocketCount:this.errorSocketCount,timeoutSocketCount:this.timeoutSocketCount,requestCount:this.requestCount,freeSockets:Hf(this.freeSockets),sockets:Hf(this.sockets),requests:Hf(this.requests)}};var Qf,Yf=C.default.Agent;Vf.isNode10?(Qf=function(t){zf.call(this,t),this.defaultPort=443,this.protocol="https:"},Vf.inherits(Qf,zf),Qf.prototype.createConnection=C.default.globalAgent.createConnection,Qf.prototype.getName=function(t){var e=zf.prototype.getName.call(this,t);return e+=":",t.ca&&(e+=t.ca),e+=":",t.cert&&(e+=t.cert),e+=":",t.ciphers&&(e+=t.ciphers),e+=":",t.key&&(e+=t.key),e+=":",t.pfx&&(e+=t.pfx),e+=":",void 0!==t.rejectUnauthorized&&(e+=t.rejectUnauthorized),e}):(Qf=function(t){zf.call(this,t),this.defaultPort=443,this.protocol="https:",this.maxCachedSessions=this.options.maxCachedSessions,void 0===this.maxCachedSessions&&(this.maxCachedSessions=100),this._sessionCache={map:{},list:[]}},Vf.inherits(Qf,zf),["createConnection","getName","_getSession","_cacheSession","_evictSession"].forEach((function(t){"function"==typeof Yf.prototype[t]&&(Qf.prototype[t]=Yf.prototype[t])})));var Xf=zf,$f=Qf;Xf.HttpsAgent=$f;var Zf=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();function Jf(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function tl(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var el=function(t){function e(){return Jf(this,e),tl(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,Xf),Zf(e,[{key:"getName",value:function(t){var e=Xf.prototype.getName.call(this,t);return e+=":",t.customSocketId&&(e+=t.customSocketId),e}}]),e}(),rl=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();function nl(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function il(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var al,ol=Xf.HttpsAgent,sl=function(t){function e(){return nl(this,e),il(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,ol),rl(e,[{key:"getName",value:function(t){var e=ol.prototype.getName.call(this,t);return e+=":",t.customSocketId&&(e+=t.customSocketId),e}}]),e}(),ul=function(t){var e=new hl(t);return e.request=g.default.request,e},cl=function(t){var e=new hl(t);return e.request=g.default.request,e.createSocket=pl,e.defaultPort=443,e},fl=function(t){var e=new hl(t);return e.request=C.default.request,e},ll=function(t){var e=new hl(t);return e.request=C.default.request,e.createSocket=pl,e.defaultPort=443,e};function hl(t){var e=this;e.options=t||{},e.proxyOptions=e.options.proxy||{},e.maxSockets=e.options.maxSockets||g.default.Agent.defaultMaxSockets,e.requests=[],e.sockets=[],e.on("free",(function(t,r,n){for(var i=0,a=e.requests.length;i<a;++i){var o=e.requests[i];if(o.host===r&&o.port===n)return e.requests.splice(i,1),void o.request.onSocket(t)}t.destroy(),e.removeSocket(t)}))}function pl(t,e){var r=this;hl.prototype.createSocket.call(r,t,(function(n){var i=T.default.connect(0,dl({},r.options,{servername:t.host,socket:n}));r.sockets[r.sockets.indexOf(n)]=i,e(i)}))}function dl(t){for(var e=1,r=arguments.length;e<r;++e){var n=arguments[e];if("object"==typeof n)for(var i=Object.keys(n),a=0,o=i.length;a<o;++a){var s=i[a];void 0!==n[s]&&(t[s]=n[s])}}return t}v.default.inherits(hl,b.default.EventEmitter),hl.prototype.addRequest=function(t,e){var r=this;"string"==typeof e&&(e={host:e,port:arguments[2],path:arguments[3]}),r.sockets.length>=this.maxSockets?r.requests.push({host:e.host,port:e.port,request:t}):r.createConnection({host:e.host,port:e.port,request:t})},hl.prototype.createConnection=function(t){var e=this;e.createSocket(t,(function(r){function n(){e.emit("free",r,t.host,t.port)}function i(t){e.removeSocket(r),r.removeListener("free",n),r.removeListener("close",i),r.removeListener("agentRemove",i)}r.on("free",n),r.on("close",i),r.on("agentRemove",i),t.request.onSocket(r)}))},hl.prototype.createSocket=function(t,e){var r=this,n={};r.sockets.push(n);var i=dl({},r.proxyOptions,{method:"CONNECT",path:t.host+":"+t.port,agent:!1});i.proxyAuth&&(i.headers=i.headers||{},i.headers["Proxy-Authorization"]="Basic "+new Buffer(i.proxyAuth).toString("base64")),al("making CONNECT request");var a=r.request(i);function o(i,o,s){if(a.removeAllListeners(),o.removeAllListeners(),200===i.statusCode)I.default.equal(s.length,0),al("tunneling connection has established"),r.sockets[r.sockets.indexOf(n)]=o,e(o);else{al("tunneling socket could not be established, statusCode=%d",i.statusCode);var u=new Error("tunneling socket could not be established, statusCode="+i.statusCode);u.code="ECONNRESET",t.request.emit("error",u),r.removeSocket(n)}}a.useChunkedEncodingByDefault=!1,a.once("response",(function(t){t.upgrade=!0})),a.once("upgrade",(function(t,e,r){process.nextTick((function(){o(t,e,r)}))})),a.once("connect",o),a.once("error",(function(e){a.removeAllListeners(),al("tunneling socket could not be established, cause=%s\n",e.message,e.stack);var i=new Error("tunneling socket could not be established, cause="+e.message);i.code="ECONNRESET",t.request.emit("error",i),r.removeSocket(n)})),a.end()},hl.prototype.removeSocket=function(t){var e=this.sockets.indexOf(t);if(-1!==e){this.sockets.splice(e,1);var r=this.requests.shift();r&&this.createConnection(r)}};var yl={httpOverHttp:ul,httpsOverHttp:cl,httpOverHttps:fl,httpsOverHttps:ll,debug:al=process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?function(){var t=Array.prototype.slice.call(arguments);"string"==typeof t[0]?t[0]="TUNNEL: "+t[0]:t.unshift("TUNNEL:"),console.error.apply(console,t)}:function(){}},gl=w((function(t,e){var r,n,i,a=e,o=new sl({keepAlive:!0,timeout:6e4,keepAliveTimeout:3e4,rejectUnauthorized:!1}),s=new el({keepAlive:!0,timeout:6e4,keepAliveTimeout:3e4}),u=0;a.getOptionsFormRequest=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=E.default.parse(t.url),i=e?443:80,c=e?"https:":"http:",f=Object.assign({},t.headers),l=null;if(r)if("string"==typeof r)l=r;else if("function"==typeof r)try{l=r(t,e)}catch(t){console.error(t)}delete f["proxy-connection"];var h=!1;l?h=a.getTunnelAgent("https:"===c,l):"close"!==f.connection&&(h="https:"==c?o:s,f.connection="keep-alive");var p={protocol:c,hostname:t.headers.host.split(":")[0],method:t.method,port:t.headers.host.split(":")[1]||i,path:n.path,headers:t.headers,agent:h};if("http:"===c&&l&&"http:"===E.default.parse(l).protocol){var d=E.default.parse(l);p.hostname=d.hostname,p.port=d.port,p.path="http://"+n.host+n.path}return t.socket.customSocketId?p.customSocketId=t.socket.customSocketId:f.authorization&&(p.customSocketId=t.socket.customSocketId=u++),p},a.getTunnelAgent=function(t,e){var a=E.default.parse(e),o=a.protocol||"http:",s=a.port;s||(s="http:"===o?80:443);var u=a.hostname||"localhost";return t?"http:"===o?(r||(r=yl.httpsOverHttp({proxy:{host:u,port:s}})),r):(i||(i=yl.httpsOverHttps({proxy:{host:u,port:s}})),i):"http:"!==o&&(n||(n=yl.httpOverHttps({proxy:{host:u,port:s}})),n)}}));var vl=function(t,e,r,n){return function(r,i,a){var o,s=this,u=gl.getOptionsFormRequest(r,a,n);"close"===u.headers.connection?r.socket.setKeepAlive(!1):null!=u.customSocketId?r.socket.setKeepAlive(!0,36e5):r.socket.setKeepAlive(!0,3e4);var c;(c=regeneratorRuntime.mark((function n(){var c,f;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,new Promise((function(e,n){try{"function"==typeof t?t.call(null,u,r,i,a,(function(){e()})):e()}catch(t){n(t)}}));case 2:if(!i.finished){n.next=4;break}return n.abrupt("return",!1);case 4:return n.next=6,new Promise((function(t,e){if(u.host=u.hostname||u.host||"localhost",u.agent&&null!=u.customSocketId&&u.agent.getName){var n=u.agent.getName(u),i=u.agent.sockets[n];if(i&&i.length>0)return void i[0].once("free",a)}function a(){(o=("https:"==u.protocol?C.default:g.default).request(u,(function(e){t(e)}))).on("timeout",(function(){e(u.host+":"+u.port+", request timeout")})),o.on("error",(function(t){e(t)})),o.on("aborted",(function(){e("server aborted reqest"),r.abort()})),r.on("aborted",(function(){o.abort()})),r.pipe(o)}a()}));case 6:return c=n.sent,f=new Promise((function(t,n){try{"function"==typeof e?e.call(null,r,i,o,c,a,(function(){t()})):t()}catch(t){n(t)}})),n.next=10,f;case 10:if(!i.finished){n.next=12;break}return n.abrupt("return",!1);case 12:n.prev=12,i.headersSent||(Object.keys(c.headers).forEach((function(t){null!=c.headers[t]&&(/^www-authenticate$/i.test(t)&&(c.headers[t]&&(c.headers[t]=c.headers[t]&&c.headers[t].split(",")),t="www-authenticate"),i.setHeader(t,c.headers[t]))})),i.writeHead(c.statusCode),c.pipe(i)),n.next=19;break;case 16:throw n.prev=16,n.t0=n.catch(12),n.t0;case 19:case"end":return n.stop()}}),n,s,[[12,16]])})),function(){var t=c.apply(this,arguments);return new Promise((function(e,r){return function n(i,a){try{var o=t[i](a),s=o.value}catch(t){return void r(t)}if(!o.done)return Promise.resolve(s).then((function(t){n("next",t)}),(function(t){n("throw",t)}));e(s)}("next")}))})().then((function(t){}),(function(t){i.finished||(i.writeHead(500),i.write("Node-MitmProxy Warning:\n\n "+t.toString()),i.end()),console.error(t)}))}};const ml=m.default.networkInterfaces();var Cl=(()=>{for(var t in ml)for(var e=ml[t],r=0;r<e.length;r++){var n=e[r];if("IPv4"===n.family&&"127.0.0.1"!==n.address&&!n.internal)return n.address}return"127.0.0.1"})();function El(t,e,r,n,i){var a=S.default.connect(i,n,(function(){e.write("HTTP/1.1 200 Connection Established\r\nProxy-agent: node-mitmproxy\r\n\r\n"),a.write(r),a.pipe(e),e.pipe(a)}));return a.on("error",(function(t){console.log(xf.red(t))})),a}var Sl=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();var bl=function(){function t(e){var r=e.maxLength,n=void 0===r?1e3:r,i=e.getCertSocketTimeout,a=void 0===i?2e3:i,o=e.caCert,s=e.caKey;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.queue=[],this.maxLength=n,this.getCertSocketTimeout=a,this.caCert=o,this.caKey=s}return Sl(t,[{key:"addCertPromise",value:function(t){return this.queue.length>=this.maxLength&&this.queue.shift(),this.queue.push(t),t}},{key:"getCertPromise",value:function(t,e){for(var r=this,n=0;n<this.queue.length;n++)for(var i=this.queue[n],a=i.mappingHostNames,o=0;o<a.length;o++){var s=a[o];if(Sf.isMappingHostName(s,t))return this.reRankCert(n),i.promise}var u={mappingHostNames:[t]},c=new Promise((function(n,i){var a=!0,o=function(t){if(a){a=!1;var e=Sf.getMappingHostNamesFormCert(t.cert);u.mappingHostNames=e,n(t)}},s=void 0,c=C.default.request({port:e,hostname:t,path:"/",method:"HEAD"},(function(e){try{var n=e.socket.getPeerCertificate();if(n)try{s=Sf.createFakeCertificateByCA(r.caKey,r.caCert,n)}catch(e){s=Sf.createFakeCertificateByDomain(r.caKey,r.caCert,t)}else s=Sf.createFakeCertificateByDomain(r.caKey,r.caCert,t);o(s)}catch(t){i(t)}}));c.setTimeout(~~r.getCertSocketTimeout,(function(){s||(s=Sf.createFakeCertificateByDomain(r.caKey,r.caCert,t),o(s))})),c.on("error",(function(e){s||(s=Sf.createFakeCertificateByDomain(r.caKey,r.caCert,t),o(s))})),c.end()}));return u.promise=c,this.addCertPromise(u).promise}},{key:"reRankCert",value:function(t){this.queue.push(this.queue.splice(t,1)[0])}}]),t}(),Tl=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();function Il(t){return function(){var e=t.apply(this,arguments);return new Promise((function(t,r){return function n(i,a){try{var o=e[i](a),s=o.value}catch(t){return void r(t)}if(!o.done)return Promise.resolve(s).then((function(t){n("next",t)}),(function(t){n("throw",t)}));t(s)}("next")}))}}var Al=function(){function t(e){var r=e.maxLength,n=void 0===r?100:r,i=e.requestHandler,a=e.upgradeHandler,o=e.caCert,s=e.caKey,u=e.getCertSocketTimeout;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.queue=[],this.maxLength=n,this.requestHandler=i,this.upgradeHandler=a,this.certAndKeyContainer=new bl({getCertSocketTimeout:u,caCert:o,caKey:s})}return Tl(t,[{key:"addServerPromise",value:function(t){if(this.queue.length>=this.maxLength){var e=this.queue.shift();try{e.serverObj.server.close()}catch(t){console.log(t)}}return this.queue.push(t),t}},{key:"getServerPromise",value:function(t,e){for(var r=this,n=0;n<this.queue.length;n++)for(var i=this.queue[n],a=i.mappingHostNames,o=0;o<a.length;o++){var s=a[o];if(Sf.isMappingHostName(s,t))return this.reRankServer(n),i.promise}var u={mappingHostNames:[t]},c=new Promise((function(n,i){Il(regeneratorRuntime.mark((function i(){var a,o,s,c,f,l,h;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,r.certAndKeyContainer.getCertPromise(t,e);case 2:a=i.sent,o=a.cert,s=a.key,c=Ef.certificateToPem(o),f=Ef.privateKeyToPem(s),l=new C.default.Server({key:f,cert:c,SNICallback:function(t,n){Il(regeneratorRuntime.mark((function i(){var a;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,r.certAndKeyContainer.getCertPromise(t,e);case 2:a=i.sent,n(null,T.default.createSecureContext({key:Ef.privateKeyToPem(a.key),cert:Ef.certificateToPem(a.cert)}));case 4:case"end":return i.stop()}}),i,r)})))()}}),h={cert:o,key:s,server:l,port:0},u.serverObj=h,l.listen(0,(function(){var t=l.address();h.port=t.port})),l.on("request",(function(t,e){r.requestHandler(t,e,!0)})),l.on("error",(function(t){console.error(t)})),l.on("listening",(function(){var t=Sf.getMappingHostNamesFormCert(a.cert);u.mappingHostNames=t,n(h)})),l.on("upgrade",(function(t,e,n){r.upgradeHandler(t,e,n,!0)}));case 15:case"end":return i.stop()}}),i,r)})))()}));return u.promise=c,this.addServerPromise(u).promise}},{key:"reRankServer",value:function(t){this.queue.push(this.queue.splice(t,1)[0])}}]),t}(),wl={createProxy:function(t){var e=t.port,r=void 0===e?Ru.defaultPort:e,n=t.caCertPath,i=t.caKeyPath,a=t.sslConnectInterceptor,o=t.requestInterceptor,s=t.responseInterceptor,u=t.getCertSocketTimeout,c=void 0===u?1e3:u,f=(t.middlewares,t.externalProxy);if(t.getPath&&(Ru.getDefaultCABasePath=t.getPath),process.env.NODE_TLS_REJECT_UNAUTHORIZED="0",!n&&!i){var l=this.createCA();n=l.caCertPath,i=l.caKeyPath,l.create&&(console.log(xf.cyan("CA Cert saved in: "+n)),console.log(xf.cyan("CA private key saved in: "+i)))}r=~~r;var h=vl(o,s,0,f),d=function(t,e,r,n){var i=gl.getOptionsFormRequest(t,n),a=(n?C.default:g.default).request(i);a.on("error",(function(t){console.error(t)})),a.on("response",(function(t){t.upgrade||e.end()})),a.on("upgrade",(function(t,r,n){r.on("error",(function(t){console.error(t)})),e.on("error",(function(){r.end()})),r.setTimeout(0),r.setNoDelay(!0),r.setKeepAlive(!0,0),n&&n.length&&r.unshift(n),e.write(Object.keys(t.headers).reduce((function(e,r){var n=t.headers[r];if(!Array.isArray(n))return e.push(r+": "+n),e;for(var i=0;i<n.length;i++)e.push(r+": "+n[i]);return e}),["HTTP/1.1 101 Switching Protocols"]).join("\r\n")+"\r\n\r\n"),r.pipe(e).pipe(r)})),a.end()},y=function(t,e){return function(r,n,i){var a=E.default.parse("https://"+r.url);"function"==typeof t&&t.call(null,r,n,i)?e.getServerPromise(a.hostname,a.port).then((function(t){El(0,n,i,Cl,t.port)}),(function(t){console.error(t)})):El(0,n,i,a.hostname,a.port)}}(a,function(t){var e,r,n=t.caCertPath,i=t.caKeyPath,a=t.requestHandler,o=t.upgradeHandler,s=t.getCertSocketTimeout;try{p.default.accessSync(n,p.default.F_OK),p.default.accessSync(i,p.default.F_OK);var u=p.default.readFileSync(n),c=p.default.readFileSync(i);e=Ef.certificateFromPem(u),r=Ef.privateKeyFromPem(c)}catch(t){console.log(xf.red("Can not find `CA certificate` or `CA key`."),t),process.exit(1)}return new Al({caCert:e,caKey:r,maxLength:100,requestHandler:a,upgradeHandler:o,getCertSocketTimeout:s})}({caCertPath:n,caKeyPath:i,requestHandler:h,upgradeHandler:d,getCertSocketTimeout:c})),v=new g.default.Server;v.listen(r,(function(){console.log(xf.green("node-mitmproxy启动端口: "+r)),v.on("error",(function(t){console.error(xf.red(t))})),v.on("request",(function(t,e){h(t,e,!1)})),v.on("connect",(function(t,e,r){y(t,e,r)})),v.on("upgrade",(function(t,e,r){d(t,e,r,!1)}))}))},createCA:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ru.getDefaultCABasePath();return Sf.initCA(t)}};module.exports=wl;