diff --git a/404.html b/404.html index 2d5b495..a9a59cd 100644 --- a/404.html +++ b/404.html @@ -1,4 +1,4 @@ -

Loading information...

\ No newline at end of file +

Loading information...

\ No newline at end of file diff --git a/_next/static/hMf1uAp3Cd5Yqle5ey3vZ/_buildManifest.js b/_next/static/K8BrGKlemPRBGq89Ar7pW/_buildManifest.js similarity index 100% rename from _next/static/hMf1uAp3Cd5Yqle5ey3vZ/_buildManifest.js rename to _next/static/K8BrGKlemPRBGq89Ar7pW/_buildManifest.js diff --git a/_next/static/hMf1uAp3Cd5Yqle5ey3vZ/_ssgManifest.js b/_next/static/K8BrGKlemPRBGq89Ar7pW/_ssgManifest.js similarity index 100% rename from _next/static/hMf1uAp3Cd5Yqle5ey3vZ/_ssgManifest.js rename to _next/static/K8BrGKlemPRBGq89Ar7pW/_ssgManifest.js diff --git a/_next/static/chunks/pages/_app-0ead8488119195b4.js b/_next/static/chunks/pages/_app-5c7d9b8474527a11.js similarity index 99% rename from _next/static/chunks/pages/_app-0ead8488119195b4.js rename to _next/static/chunks/pages/_app-5c7d9b8474527a11.js index 69fe5c1..34ff115 100644 --- a/_next/static/chunks/pages/_app-0ead8488119195b4.js +++ b/_next/static/chunks/pages/_app-5c7d9b8474527a11.js @@ -295,7 +295,7 @@ */function tn(e,t){this.x=t,this.q=e}function ti(e,t,r,n){this.curve=e,this.x=t,this.y=r,null==n?this.z=E.ONE:this.z=n,this.zinv=null}function ta(e,t,r){this.q=e,this.a=this.fromBigInteger(t),this.b=this.fromBigInteger(r),this.infinity=new ti(this,null,null)}e9.prototype.nextBytes=function(e){var t;for(t=0;t0&&t.length>0)this.n=e7(e,16),this.e=parseInt(t,16);else throw"Invalid RSA public key"},tt.prototype.encrypt=function(e){var t=function(e,t){if(t=0&&t>0;){var i=e.charCodeAt(n--);i<128?r[--t]=i:i>127&&i<2048?(r[--t]=63&i|128,r[--t]=i>>6|192):(r[--t]=63&i|128,r[--t]=i>>6&63|128,r[--t]=i>>12|224)}r[--t]=0;for(var a=new e9,o=[];t>2;){for(o[0]=0;0==o[0];)a.nextBytes(o);r[--t]=o[0]}return r[--t]=2,r[--t]=0,new E(r)}(e,this.n.bitLength()+7>>3);if(null==t)return null;var r=this.doPublic(t);if(null==r)return null;var n=r.toString(16);return(1&n.length)==0?n:"0"+n},tt.prototype.encryptOAEP=function(e,t,r){var n=function(e,t,r,n){var i=d.crypto.MessageDigest,a=d.crypto.Util,o=null;if(r||(r="sha1"),"string"==typeof r&&(o=i.getCanonicalAlgName(r),n=i.getHashLength(o),r=function(e){return tv(a.hashHex(tg(e),o))}),e.length+2*n+2>t)throw"Message too long for RSA";var s,u="";for(s=0;s>3,t,r);if(null==n)return null;var i=this.doPublic(n);if(null==i)return null;var a=i.toString(16);return(1&a.length)==0?a:"0"+a},tt.prototype.type="RSA",tt.prototype.doPrivate=function(e){if(null==this.p||null==this.q)return e.modPow(this.d,this.n);for(var t=e.mod(this.p).modPow(this.dmp1,this.p),r=e.mod(this.q).modPow(this.dmq1,this.q);0>t.compareTo(r);)t=t.add(this.p);return t.subtract(r).multiply(this.coeff).mod(this.p).multiply(this.q).add(r)},tt.prototype.setPrivate=function(e,t,r){if(this.isPrivate=!0,"string"!=typeof e)this.n=e,this.e=t,this.d=r;else if(null!=e&&null!=t&&e.length>0&&t.length>0)this.n=e7(e,16),this.e=parseInt(t,16),this.d=e7(r,16);else throw"Invalid RSA private key"},tt.prototype.setPrivateEx=function(e,t,r,n,i,a,o,s){if(this.isPrivate=!0,this.isPublic=!1,null==e)throw"RSASetPrivateEx N == null";if(null==t)throw"RSASetPrivateEx E == null";if(0==e.length)throw"RSASetPrivateEx N.length == 0";if(0==t.length)throw"RSASetPrivateEx E.length == 0";if(null!=e&&null!=t&&e.length>0&&t.length>0)this.n=e7(e,16),this.e=parseInt(t,16),this.d=e7(r,16),this.p=e7(n,16),this.q=e7(i,16),this.dmp1=e7(a,16),this.dmq1=e7(o,16),this.coeff=e7(s,16);else throw"Invalid RSA private key in RSASetPrivateEx"},tt.prototype.generate=function(e,t){var r=new e9,n=e>>1;this.e=parseInt(t,16);for(var i=new E(t,16),a=e/2-100,o=E.ONE.shiftLeft(a);;){for(;this.p=new E(e-n,1,r),!(0==this.p.subtract(E.ONE).gcd(i).compareTo(E.ONE)&&this.p.isProbablePrime(10)););for(;this.q=new E(n,1,r),!(0==this.q.subtract(E.ONE).gcd(i).compareTo(E.ONE)&&this.q.isProbablePrime(10)););if(0>=this.p.compareTo(this.q)){var s=this.p;this.p=this.q,this.q=s}var u=this.q.subtract(this.p).abs();if(!(u.bitLength()=u.compareTo(o))){var c=this.p.subtract(E.ONE),l=this.q.subtract(E.ONE),f=c.multiply(l);if(0==f.gcd(i).compareTo(E.ONE)&&(this.n=this.p.multiply(this.q),this.n.bitLength()==e)){this.d=i.modInverse(f),this.dmp1=this.d.mod(c),this.dmq1=this.d.mod(l),this.coeff=this.q.modInverse(this.p);break}}}this.isPrivate=!0},tt.prototype.decrypt=function(e){if(e.length!=Math.ceil(this.n.bitLength()/4))throw Error("wrong ctext length");var t=e7(e,16),r=this.doPrivate(t);return null==r?null:/*! (c) Tom Wu, Kenji Urushima | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function(e,t){for(var r=e.toByteArray(),n=0;n=r.length)return null;for(var i="";++n191&&a<224?(i+=String.fromCharCode((31&a)<<6|63&r[n+1]),++n):(i+=String.fromCharCode((15&a)<<12|(63&r[n+1])<<6|63&r[n+2]),n+=2)}return i}(r,this.n.bitLength()+7>>3)},tt.prototype.decryptOAEP=function(e,t,r){if(e.length!=Math.ceil(this.n.bitLength()/4))throw Error("wrong ctext length");var n=e7(e,16),i=this.doPrivate(n);return null==i?null:function(e,t,r,n){var i=d.crypto.MessageDigest,a=d.crypto.Util,o=null;for(r||(r="sha1"),"string"==typeof r&&(o=i.getCanonicalAlgName(r),n=i.getHashLength(o),r=function(e){return tv(a.hashHex(tg(e),o))}),e=e.toByteArray(),s=0;s>3,t,r)},tn.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.x.equals(e.x)},tn.prototype.toBigInteger=function(){return this.x},tn.prototype.negate=function(){return new tn(this.q,this.x.negate().mod(this.q))},tn.prototype.add=function(e){return new tn(this.q,this.x.add(e.toBigInteger()).mod(this.q))},tn.prototype.subtract=function(e){return new tn(this.q,this.x.subtract(e.toBigInteger()).mod(this.q))},tn.prototype.multiply=function(e){return new tn(this.q,this.x.multiply(e.toBigInteger()).mod(this.q))},tn.prototype.square=function(){return new tn(this.q,this.x.square().mod(this.q))},tn.prototype.divide=function(e){return new tn(this.q,this.x.multiply(e.toBigInteger().modInverse(this.q)).mod(this.q))},tn.prototype.sqrt=function(){return new tn(this.q,this.x.sqrt().mod(this.q))},ti.prototype.getX=function(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))},ti.prototype.getY=function(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))},ti.prototype.equals=function(e){return e==this||(this.isInfinity()?e.isInfinity():e.isInfinity()?this.isInfinity():!!e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(E.ZERO)&&e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q).equals(E.ZERO))},ti.prototype.isInfinity=function(){return null==this.x&&null==this.y||this.z.equals(E.ZERO)&&!this.y.toBigInteger().equals(E.ZERO)},ti.prototype.negate=function(){return new ti(this.curve,this.x,this.y.negate(),this.z)},ti.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.q),r=e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.q);if(E.ZERO.equals(r))return E.ZERO.equals(t)?this.twice():this.curve.getInfinity();var n=new E("3"),i=this.x.toBigInteger(),a=this.y.toBigInteger();e.x.toBigInteger(),e.y.toBigInteger();var o=r.square(),s=o.multiply(r),u=i.multiply(o),c=t.square().multiply(this.z),l=c.subtract(u.shiftLeft(1)).multiply(e.z).subtract(s).multiply(r).mod(this.curve.q),f=u.multiply(n).multiply(t).subtract(a.multiply(s)).subtract(c.multiply(t)).multiply(e.z).add(t.multiply(s)).mod(this.curve.q),d=s.multiply(this.z).multiply(e.z).mod(this.curve.q);return new ti(this.curve,this.curve.fromBigInteger(l),this.curve.fromBigInteger(f),d)},ti.prototype.twice=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var e=new E("3"),t=this.x.toBigInteger(),r=this.y.toBigInteger(),n=r.multiply(this.z),i=n.multiply(r).mod(this.curve.q),a=this.curve.a.toBigInteger(),o=t.square().multiply(e);E.ZERO.equals(a)||(o=o.add(this.z.square().multiply(a)));var s=(o=o.mod(this.curve.q)).square().subtract(t.shiftLeft(3).multiply(i)).shiftLeft(1).multiply(n).mod(this.curve.q),u=o.multiply(e).multiply(t).subtract(i.shiftLeft(1)).shiftLeft(2).multiply(i).subtract(o.square().multiply(o)).mod(this.curve.q),c=n.square().multiply(n).shiftLeft(3).mod(this.curve.q);return new ti(this.curve,this.curve.fromBigInteger(s),this.curve.fromBigInteger(u),c)},ti.prototype.multiply=function(e){if(this.isInfinity())return this;if(0==e.signum())return this.curve.getInfinity();var t,r=e.multiply(new E("3")),n=this.negate(),i=this,a=this.curve.q.subtract(e),o=a.multiply(new E("3")),s=new ti(this.curve,this.x,this.y),u=s.negate();for(t=r.bitLength()-2;t>0;--t){i=i.twice();var c=r.testBit(t);c!=e.testBit(t)&&(i=i.add(c?this:n))}for(t=o.bitLength()-2;t>0;--t){s=s.twice();var l=o.testBit(t);l!=a.testBit(t)&&(s=s.add(l?s:u))}return i},ti.prototype.multiplyTwo=function(e,t,r){n=e.bitLength()>r.bitLength()?e.bitLength()-1:r.bitLength()-1;for(var n,i=this.curve.getInfinity(),a=this.add(t);n>=0;)i=i.twice(),e.testBit(n)?i=r.testBit(n)?i.add(a):i.add(this):r.testBit(n)&&(i=i.add(t)),--n;return i},ta.prototype.getQ=function(){return this.q},ta.prototype.getA=function(){return this.a},ta.prototype.getB=function(){return this.b},ta.prototype.equals=function(e){return e==this||this.q.equals(e.q)&&this.a.equals(e.a)&&this.b.equals(e.b)},ta.prototype.getInfinity=function(){return this.infinity},ta.prototype.fromBigInteger=function(e){return new tn(this.q,e)},ta.prototype.decodePointHex=function(e){switch(parseInt(e.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:var t=e.substr(0,2);e.substr(2);var r=this.fromBigInteger(new E(s,16)),n=this.getA(),i=this.getB(),a=r.square().add(n).multiply(r).add(i).sqrt();return"03"==t&&(a=a.negate()),new ti(this,r,a);case 4:case 6:case 7:var o=(e.length-2)/2,s=e.substr(2,o),u=e.substr(o+2,o);return new ti(this,this.fromBigInteger(new E(s,16)),this.fromBigInteger(new E(u,16)));default:return null}},/*! (c) Stefan Thomas | https://github.com/bitcoinjs/bitcoinjs-lib */tn.prototype.getByteLength=function(){return Math.floor((this.toBigInteger().bitLength()+7)/8)},ti.prototype.getEncoded=function(e){var t=function(e,t){var r=e.toByteArrayUnsigned();if(tr.length;)r.unshift(0);return r},r=this.getX().toBigInteger(),n=this.getY().toBigInteger(),i=t(r,32);return e?n.isEven()?i.unshift(2):i.unshift(3):(i.unshift(4),i=i.concat(t(n,32))),i},ti.decodeFrom=function(e,t){t[0];var r=t.length-1,n=t.slice(1,1+r/2),i=t.slice(1+r/2,1+r);n.unshift(0),i.unshift(0);var a=new E(n),o=new E(i);return new ti(e,e.fromBigInteger(a),e.fromBigInteger(o))},ti.decodeFromHex=function(e,t){t.substr(0,2);var r=t.length-2,n=t.substr(2,r/2),i=t.substr(2+r/2,r/2),a=new E(n,16),o=new E(i,16);return new ti(e,e.fromBigInteger(a),e.fromBigInteger(o))},ti.prototype.add2D=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;if(this.x.equals(e.x))return this.y.equals(e.y)?this.twice():this.curve.getInfinity();var t=e.x.subtract(this.x),r=e.y.subtract(this.y).divide(t),n=r.square().subtract(this.x).subtract(e.x),i=r.multiply(this.x.subtract(n)).subtract(this.y);return new ti(this.curve,n,i)},ti.prototype.twice2D=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var e=this.curve.fromBigInteger(E.valueOf(2)),t=this.curve.fromBigInteger(E.valueOf(3)),r=this.x.square().multiply(t).add(this.curve.a).divide(this.y.multiply(e)),n=r.square().subtract(this.x.multiply(e)),i=r.multiply(this.x.subtract(n)).subtract(this.y);return new ti(this.curve,n,i)},ti.prototype.multiply2D=function(e){if(this.isInfinity())return this;if(0==e.signum())return this.curve.getInfinity();var t,r=e.multiply(new E("3")),n=this.negate(),i=this;for(t=r.bitLength()-2;t>0;--t){i=i.twice();var a=r.testBit(t);a!=e.testBit(t)&&(i=i.add2D(a?this:n))}return i},ti.prototype.isOnCurve=function(){var e=this.getX().toBigInteger(),t=this.getY().toBigInteger(),r=this.curve.getA().toBigInteger(),n=this.curve.getB().toBigInteger(),i=this.curve.getQ(),a=t.multiply(t).mod(i),o=e.multiply(e).multiply(e).add(r.multiply(e)).add(n).mod(i);return a.equals(o)},ti.prototype.toString=function(){return"("+this.getX().toBigInteger().toString()+","+this.getY().toBigInteger().toString()+")"},ti.prototype.validate=function(){var e=this.curve.getQ();if(this.isInfinity())throw Error("Point is at infinity.");var t=this.getX().toBigInteger(),r=this.getY().toBigInteger();if(0>t.compareTo(E.ONE)||t.compareTo(e.subtract(E.ONE))>0)throw Error("x coordinate out of bounds");if(0>r.compareTo(E.ONE)||r.compareTo(e.subtract(E.ONE))>0)throw Error("y coordinate out of bounds");if(!this.isOnCurve())throw Error("Point is not on the curve.");if(this.multiply(e).isInfinity())throw Error("Point is not a scalar multiple of G.");return!0};/*! Mike Samuel (c) 2009 | code.google.com/p/json-sans-eval - */var to=function(){var e=RegExp('(?:false|true|null|[\\{\\}\\[\\]]|(?:-?\\b(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\\b)|(?:"(?:[^\\0-\\x08\\x0a-\\x1f"\\\\]|\\\\(?:["/\\\\bfnrt]|u[0-9A-Fa-f]{4}))*"))',"g"),t=RegExp("\\\\(?:([^u])|u(.{4}))","g"),r={'"':'"',"/":"/","\\":"\\",b:"\b",f:"\f",n:"\n",r:"\r",t:" "};function n(e,t,n){return t?r[t]:String.fromCharCode(parseInt(n,16))}var i=new String(""),a=Object.hasOwnProperty;return function(r,o){var s,u,c,l=r.match(e),f=l[0],d=!1;"{"===f?s={}:"["===f?s=[]:(s=[],d=!0);for(var h=[s],p=1-d,m=l.length;p=0;)delete r[n[u]]}return o.call(e,t,r)};s=g({"":s},"")}return s}}();void 0!==d&&d||(d={}),void 0!==d.asn1&&d.asn1||(d.asn1={}),d.asn1.ASN1Util=new function(){this.integerToByteHex=function(e){var t=e.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(e){var t=e.toString(16);if("-"!=t.substr(0,1))t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{var r=t.substr(1).length;r%2==1?r+=1:t.match(/^[0-7]/)||(r+=2);for(var n="",i=0;i15)throw Error("ASN.1 length too long to represent by 8x: n = "+e.toString(16));return(128+r).toString(16)+t},this.tohex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getEncodedHex=function(){return this.tohex()},this.getValueHex=function(){return this.tohex(),this.hV},this.getFreshValueHex=function(){return""},this.setByParam=function(e){this.params=e},void 0!=e&&void 0!=e.tlv&&(this.hTLV=e.tlv,this.isModified=!1)},d.asn1.DERAbstractString=function(e){d.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=tp(this.s).toLowerCase()},this.setStringHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e?this.setString(e):void 0!==e.str?this.setString(e.str):void 0!==e.hex&&this.setStringHex(e.hex))},tD(d.asn1.DERAbstractString,d.asn1.ASN1Object),d.asn1.DERAbstractTime=function(e){d.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(e){var t=e.getTime()+6e4*e.getTimezoneOffset();return new Date(t)},this.formatDate=function(e,t,r){var n=this.zeroPadding,i=this.localDateToUTC(e),a=String(i.getFullYear());"utc"==t&&(a=a.substr(2,2));var o=a+n(String(i.getMonth()+1),2)+n(String(i.getDate()),2)+n(String(i.getHours()),2)+n(String(i.getMinutes()),2)+n(String(i.getSeconds()),2);if(!0===r){var s=i.getMilliseconds();if(0!=s){var u=n(String(s),3);o=o+"."+(u=u.replace(/[0]+$/,""))}}return o+"Z"},this.zeroPadding=function(e,t){return e.length>=t?e:Array(t-e.length+1).join("0")+e},this.setByParam=function(e){this.hV=null,this.hTLV=null,this.params=e},this.getString=function(){},this.setString=function(e){this.hTLV=null,this.isModified=!0,void 0==this.params&&(this.params={}),this.params.str=e},this.setByDate=function(e){this.hTLV=null,this.isModified=!0,void 0==this.params&&(this.params={}),this.params.date=e},this.setByDateValue=function(e,t,r,n,i,a){var o=new Date(Date.UTC(e,t-1,r,n,i,a,0));this.setByDate(o)},this.getFreshValueHex=function(){return this.hV}},tD(d.asn1.DERAbstractTime,d.asn1.ASN1Object),d.asn1.DERAbstractStructured=function(e){d.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array=e},this.appendASN1Object=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array.push(e)},this.asn1Array=[],void 0!==e&&void 0!==e.array&&(this.asn1Array=e.array)},tD(d.asn1.DERAbstractStructured,d.asn1.ASN1Object),d.asn1.DERBoolean=function(e){d.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",!1==e?this.hTLV="010100":this.hTLV="0101ff"},tD(d.asn1.DERBoolean,d.asn1.ASN1Object),d.asn1.DERInteger=function(e){d.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=d.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new E(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.bigint?this.setByBigInteger(e.bigint):void 0!==e.int?this.setByInteger(e.int):"number"==typeof e?this.setByInteger(e):void 0!==e.hex&&this.setValueHex(e.hex))},tD(d.asn1.DERInteger,d.asn1.ASN1Object),d.asn1.DERBitString=function(e){if(void 0!==e&&void 0!==e.obj){var t=d.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.tohex()}d.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(e){this.hTLV=null,this.isModified=!0,this.hV=e},this.setUnusedBitsAndHexValue=function(e,t){if(e<0||7>6,i=128|63&r;return tm(n.toString(16)+i.toString(16))}var n=224|(240&t)>>4,i=128|(15&t)<<2|(192&r)>>6;return tm(n.toString(16)+i.toString(16)+(128|63&r).toString(16))}).join("")}function tk(e){for(var t=encodeURIComponent(e),r="",n=0;n"7"?"00"+e:e}function tR(e){if(!t_(e))return null;try{var t=[],r=e.substr(0,2),n=parseInt(r,16);t[0]=new String(Math.floor(n/40)),t[1]=new String(n%40);for(var i=e.substr(2),a=[],o=0;o0&&(c=c+"."+s.join(".")),c}catch(e){return null}}ts.getLblen=function(e,t){if("8"!=e.substr(t+2,1))return 1;var r=parseInt(e.substr(t+3,1));return 0==r?-1:0=n)break}return a},ts.getNthChildIdx=function(e,t,r){return ts.getChildIdx(e,t)[r]},ts.getIdxbyList=function(e,t,r,n){var i,a;return 0==r.length?void 0!==n&&e.substr(t,2)!==n?-1:t:(i=r.shift())>=(a=ts.getChildIdx(e,t)).length?-1:ts.getIdxbyList(e,a[i],r,n)},ts.getIdxbyListEx=function(e,t,r,n){if(0==r.length)return void 0!==n&&e.substr(t,2)!==n?-1:t;i=r.shift(),a=ts.getChildIdx(e,t);for(var i,a,o=0,s=0;s=e.length?null:ts.getTLV(e,i)},ts.getTLVbyListEx=function(e,t,r,n){var i=ts.getIdxbyListEx(e,t,r,n);return -1==i?null:ts.getTLV(e,i)},ts.getVbyList=function(e,t,r,n,i){var a,o;return -1==(a=ts.getIdxbyList(e,t,r,n))||a>=e.length?null:(o=ts.getV(e,a),!0===i&&(o=o.substr(2)),o)},ts.getVbyListEx=function(e,t,r,n,i){var a,o;return -1==(a=ts.getIdxbyListEx(e,t,r,n))?null:(o=ts.getV(e,a),"03"==e.substr(a,2)&&!1!==i&&(o=o.substr(2)),o)},ts.getInt=function(e,t,r){void 0==r&&(r=-1);try{var n=e.substr(t,2);if("02"!=n&&"03"!=n)return r;var i=ts.getV(e,t);if("02"==n)return parseInt(i,16);return function(e){if(e.length%2!=0||null==(e=e.toLowerCase()).match(/^[0-9a-f]+$/))return -1;try{var t=e.substr(0,2);if("00"==t)return parseInt(e.substr(2),16);var r=parseInt(t,16);if(r>7)return -1;var n=e.substr(2),i=parseInt(n,16).toString(2);"0"==i&&(i="00000000"),i=i.slice(0,0-r);var a=parseInt(i,2);if(a==NaN)return -1;return a}catch(e){return -1}}(i)}catch(e){return r}},ts.getOID=function(e,t,r){void 0==r&&(r=null);try{if("06"!=e.substr(t,2))return r;var n=ts.getV(e,t);return tR(n)}catch(e){return r}},ts.getOIDName=function(e,t,r){void 0==r&&(r=null);try{var n=ts.getOID(e,t,r);if(n==r)return r;var i=d.asn1.x509.OID.oid2name(n);if(""==i)return n;return i}catch(e){return r}},ts.getString=function(e,t,r){void 0==r&&(r=null);try{var n=ts.getV(e,t);return tv(n)}catch(e){return r}},ts.hextooidstr=function(e){var t=function(e,t){return e.length>=t?e:Array(t-e.length+1).join("0")+e},r=[],n=parseInt(e.substr(0,2),16);r[0]=new String(Math.floor(n/40)),r[1]=new String(n%40);for(var i=e.substr(2),a=[],o=0;o0&&(c=c+"."+s.join(".")),c},ts.dump=function(e,t,r,n){var i=ts.getV,a=ts.dump,o=ts.getChildIdx,s=e;e instanceof d.asn1.ASN1Object&&(s=e.tohex());var u=function(e,t){return e.length<=2*t?e:e.substr(0,t)+"..(total "+e.length/2+"bytes).."+e.substr(e.length-t,t)};void 0===t&&(t={ommit_long_octet:32}),void 0===r&&(r=0),void 0===n&&(n="");var c=t.ommit_long_octet,l=s.substr(r,2);if("01"==l){var f=i(s,r);return"00"==f?n+"BOOLEAN FALSE\n":n+"BOOLEAN TRUE\n"}if("02"==l){var f=i(s,r);return n+"INTEGER "+u(f,c)+"\n"}if("03"==l){var f=i(s,r);if(!ts.isASN1HEX(f.substr(2)))return n+"BITSTRING "+u(f,c)+"\n";var h=n+"BITSTRING, encapsulates\n";return h+a(f.substr(2),t,0,n+" ")}if("04"==l){var f=i(s,r);if(!ts.isASN1HEX(f))return n+"OCTETSTRING "+u(f,c)+"\n";var h=n+"OCTETSTRING, encapsulates\n";return h+a(f,t,0,n+" ")}if("05"==l)return n+"NULL\n";if("06"==l){var p=i(s,r),m=d.asn1.ASN1Util.oidHexToInt(p),g=d.asn1.x509.OID.oid2name(m),y=m.replace(/\./g," ");return""!=g?n+"ObjectIdentifier "+g+" ("+y+")\n":n+"ObjectIdentifier ("+y+")\n"}if("0a"==l)return n+"ENUMERATED "+parseInt(i(s,r))+"\n";if("0c"==l)return n+"UTF8String '"+tm(i(s,r))+"'\n";if("13"==l)return n+"PrintableString '"+tm(i(s,r))+"'\n";if("14"==l)return n+"TeletexString '"+tm(i(s,r))+"'\n";if("16"==l)return n+"IA5String '"+tm(i(s,r))+"'\n";if("17"==l)return n+"UTCTime "+tm(i(s,r))+"\n";if("18"==l)return n+"GeneralizedTime "+tm(i(s,r))+"\n";if("1a"==l)return n+"VisualString '"+tm(i(s,r))+"'\n";if("1e"==l)return n+"BMPString '"+tO(i(s,r))+"'\n";if("30"==l){if("3000"==s.substr(r,4))return n+"SEQUENCE {}\n";var h=n+"SEQUENCE\n",b=o(s,r),x=t;if((2==b.length||3==b.length)&&"06"==s.substr(b[0],2)&&"04"==s.substr(b[b.length-1],2)){var g=ts.oidname(i(s,b[0])),S=JSON.parse(JSON.stringify(t));S.x509ExtName=g,x=S}for(var w=0;w4?{enum:{hex:h}}:{enum:parseInt(h,16)};if("30"==l||"31"==l)return f[c[l]]=function(e){for(var r=[],n=a(e,0),o=0;o31)return!1;if((192&r)==128&&(31&r)==n)return!0;return!1}catch(e){return!1}},ts.isASN1HEX=function(e){if(e.length%2==1)return!1;var t=ts.getVblen(e,0),r=e.substr(0,2),n=ts.getL(e,0);return e.length-r.length-n.length==2*t},ts.checkStrictDER=function(e,t,r,n,i){if(void 0===r){if("string"!=typeof e||(e=e.toLowerCase(),!d.lang.String.isHex(e)))throw Error("not hex string");r=e.length,i=(n=e.length/2)<128?1:Math.ceil(n.toString(16))+1}if(ts.getL(e,t).length>2*i)throw Error("L of TLV too long: idx="+t);var a=ts.getVblen(e,t);if(a>n)throw Error("value of L too long than hex: idx="+t);var o=ts.getTLV(e,t),s=o.length-2-ts.getL(e,t).length;if(s!==2*a)throw Error("V string length and L's value not the same:"+s+"/"+2*a);if(0===t&&e.length!=o.length)throw Error("total length and TLV length unmatch:"+e.length+"!="+o.length);var u=e.substr(t,2);if("02"===u){var c=ts.getVidx(e,t);if("00"==e.substr(c,2)&&56>e.charCodeAt(c+2))throw Error("not least zeros for DER INTEGER")}if(32&parseInt(u,16)){for(var l=ts.getVblen(e,t),f=0,h=ts.getChildIdx(e,t),p=0;p0&&e.push(new n({tag:"a3",obj:new c(t.ext)})),new d.asn1.DERSequence({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},tD(d.asn1.x509.TBSCertificate,d.asn1.ASN1Object),d.asn1.x509.Extensions=function(e){d.asn1.x509.Extensions.superclass.constructor.call(this);var t=d.asn1,r=t.DERSequence,n=t.x509;this.aParam=[],this.setByParam=function(e){this.aParam=e},this.tohex=function(){for(var e=[],t=0;t-1&&e.push(new n({int:this.pathLen}));var t=new i({array:e});return this.asn1ExtnValue=t,this.asn1ExtnValue.tohex()},this.oid="2.5.29.19",this.cA=!1,this.pathLen=-1,void 0!==e&&(void 0!==e.cA&&(this.cA=e.cA),void 0!==e.pathLen&&(this.pathLen=e.pathLen))},tD(d.asn1.x509.BasicConstraints,d.asn1.x509.Extension),d.asn1.x509.CRLDistributionPoints=function(e){d.asn1.x509.CRLDistributionPoints.superclass.constructor.call(this,e);var t=d.asn1,r=t.x509;this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.setByDPArray=function(e){for(var n=[],i=0;i0&&e.push(new r({array:t}))}return new r({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&(this.params=e)},tD(d.asn1.x509.PolicyInformation,d.asn1.ASN1Object),d.asn1.x509.PolicyQualifierInfo=function(e){d.asn1.x509.PolicyQualifierInfo.superclass.constructor.call(this,e);var t=d.asn1,r=t.DERSequence,n=t.DERIA5String,i=t.DERObjectIdentifier,a=t.x509.UserNotice;this.params=null,this.tohex=function(){if(void 0!==this.params.cps){var e=new r({array:[new i({oid:"1.3.6.1.5.5.7.2.1"}),new n({str:this.params.cps})]});return e.tohex()}if(void 0!=this.params.unotice){var e=new r({array:[new i({oid:"1.3.6.1.5.5.7.2.2"}),new a(this.params.unotice)]});return e.tohex()}},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&(this.params=e)},tD(d.asn1.x509.PolicyQualifierInfo,d.asn1.ASN1Object),d.asn1.x509.UserNotice=function(e){d.asn1.x509.UserNotice.superclass.constructor.call(this,e);var t=d.asn1.DERSequence,r=(d.asn1.DERInteger,d.asn1.x509.DisplayText),n=d.asn1.x509.NoticeReference;this.params=null,this.tohex=function(){var e=[];return void 0!==this.params.noticeref&&e.push(new n(this.params.noticeref)),void 0!==this.params.exptext&&e.push(new r(this.params.exptext)),new t({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&(this.params=e)},tD(d.asn1.x509.UserNotice,d.asn1.ASN1Object),d.asn1.x509.NoticeReference=function(e){d.asn1.x509.NoticeReference.superclass.constructor.call(this,e);var t=d.asn1.DERSequence,r=d.asn1.DERInteger,n=d.asn1.x509.DisplayText;this.params=null,this.tohex=function(){var e=[];if(void 0!==this.params.org&&e.push(new n(this.params.org)),void 0!==this.params.noticenum){for(var i=[],a=this.params.noticenum,o=0;o0)for(var e=0;e0;i++){var a=t.shift();if(!0===r){var o=(n.pop()+","+a).replace(/\\,/g,",");n.push(o),r=!1}else n.push(a);"\\"===a.substr(-1,1)&&(r=!0)}return(n=n.map(function(e){return e.replace("/","\\/")})).reverse(),"/"+n.join("/")},d.asn1.x509.X500Name.ldapToOneline=function(e){return d.asn1.x509.X500Name.ldapToCompat(e)},d.asn1.x509.RDN=function(e){d.asn1.x509.RDN.superclass.constructor.call(this),this.asn1Array=[],this.paramArray=[],this.sRule="utf8";var t=d.asn1.x509.AttributeTypeAndValue;this.setByParam=function(e){void 0!==e.rule&&(this.sRule=e.rule),void 0!==e.str&&this.addByMultiValuedString(e.str),void 0!==e.array&&(this.paramArray=e.array)},this.addByString=function(e){this.asn1Array.push(new d.asn1.x509.AttributeTypeAndValue({str:e,rule:this.sRule}))},this.addByMultiValuedString=function(e){for(var t=d.asn1.x509.RDN.parseString(e),r=0;r0)for(var e=0;e0;i++){var a=t.shift();if(!0===r){var o=(n.pop()+"+"+a).replace(/\\\+/g,"+");n.push(o),r=!1}else n.push(a);"\\"===a.substr(-1,1)&&(r=!0)}for(var s=!1,u=[],i=0;n.length>0;i++){var a=n.shift();if(!0===s){var c=u.pop();if(a.match(/"$/)){var o=(c+"+"+a).replace(/^([^=]+)="(.*)"$/,"$1=$2");u.push(o),s=!1}else u.push(c+"+"+a)}else u.push(a);a.match(/^[^=]+="/)&&(s=!0)}return u},d.asn1.x509.AttributeTypeAndValue=function(e){d.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this),this.sRule="utf8",this.sType=null,this.sValue=null,this.dsType=null;var t=d,r=t.asn1,n=r.DERSequence,i=r.DERUTF8String,a=r.DERPrintableString,o=r.DERTeletexString,s=r.DERIA5String,u=r.DERVisibleString,c=r.DERBMPString,l=t.lang.String.isMail,f=t.lang.String.isPrintable;this.setByParam=function(e){if(void 0!==e.rule&&(this.sRule=e.rule),void 0!==e.ds&&(this.dsType=e.ds),void 0===e.value&&void 0!==e.str){var t=e.str.match(/^([^=]+)=(.+)$/);if(t)this.sType=t[1],this.sValue=t[2];else throw Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr)}else this.sType=e.type,this.sValue=e.value},this.setByString=function(e,t){void 0!==t&&(this.sRule=t);var r=e.match(/^([^=]+)=(.+)$/);if(r)this.setByAttrTypeAndValueStr(r[1],r[2]);else throw Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr)},this._getDsType=function(){var e=this.sType,t=this.sValue,r=this.sRule;if("prn"===r){if("CN"==e&&l(t))return"ia5";if(f(t))return"prn"}else if("utf8"===r){if("CN"==e&&l(t))return"ia5";if("C"==e)return"prn"}return"utf8"},this.setByAttrTypeAndValueStr=function(e,t,r){void 0!==r&&(this.sRule=r),this.sType=e,this.sValue=t},this.getValueObj=function(e,t){if("utf8"==e)return new i({str:t});if("prn"==e)return new a({str:t});if("tel"==e)return new o({str:t});if("ia5"==e)return new s({str:t});if("vis"==e)return new u({str:t});if("bmp"==e)return new c({str:t});throw Error("unsupported directory string type: type="+e+" value="+t)},this.tohex=function(){null==this.dsType&&(this.dsType=this._getDsType());var e=d.asn1.x509.OID.atype2obj(this.sType),t=this.getValueObj(this.dsType,this.sValue),r=new n({array:[e,t]});return this.TLV=r.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},tD(d.asn1.x509.AttributeTypeAndValue,d.asn1.ASN1Object),d.asn1.x509.SubjectPublicKeyInfo=function(e){d.asn1.x509.SubjectPublicKeyInfo.superclass.constructor.call(this);var t=d,r=t.asn1,n=r.DERInteger,i=r.DERBitString,a=r.DERObjectIdentifier,o=r.DERSequence,s=r.ASN1Util.newObject,u=r.x509.AlgorithmIdentifier,c=t.crypto;c.ECDSA,c.DSA,this.getASN1Object=function(){if(null==this.asn1AlgId||null==this.asn1SubjPKey)throw"algId and/or subjPubKey not set";return new o({array:[this.asn1AlgId,this.asn1SubjPKey]})},this.tohex=function(){var e=this.getASN1Object();return this.hTLV=e.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},this.setPubKey=function(e){try{if(e instanceof tt){var t=s({seq:[{int:{bigint:e.n}},{int:{int:e.e}}]}).tohex();this.asn1AlgId=new u({name:"rsaEncryption"}),this.asn1SubjPKey=new i({hex:"00"+t})}}catch(e){}try{if(e instanceof d.crypto.ECDSA){var r=new a({name:e.curveName});this.asn1AlgId=new u({name:"ecPublicKey",asn1params:r}),this.asn1SubjPKey=new i({hex:"00"+e.pubKeyHex})}}catch(e){}try{if(e instanceof d.crypto.DSA){var r=new s({seq:[{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}}]});this.asn1AlgId=new u({name:"dsa",asn1params:r});var o=new n({bigint:e.y});this.asn1SubjPKey=new i({hex:"00"+o.tohex()})}}catch(e){}},void 0!==e&&this.setPubKey(e)},tD(d.asn1.x509.SubjectPublicKeyInfo,d.asn1.ASN1Object),d.asn1.x509.Time=function(e){d.asn1.x509.Time.superclass.constructor.call(this);var t=d.asn1,r=t.DERUTCTime,n=t.DERGeneralizedTime;this.params=null,this.type=null,this.setTimeParams=function(e){this.timeParams=e},this.setByParam=function(e){this.params=e},this.getType=function(e){return e.match(/^[0-9]{12}Z$/)?"utc":e.match(/^[0-9]{14}Z$/)?"gen":e.match(/^[0-9]{12}\.[0-9]+Z$/)?"utc":e.match(/^[0-9]{14}\.[0-9]+Z$/)?"gen":null},this.tohex=function(){var e=this.params,t=null;if("string"==typeof e&&(e={str:e}),null!=e&&e.str&&(null==e.type||void 0==e.type)&&(e.type=this.getType(e.str)),null!=e&&e.str?("utc"==e.type&&(t=new r(e.str)),"gen"==e.type&&(t=new n(e.str))):t="gen"==this.type?new n:new r,null==t)throw Error("wrong setting for Time");return this.TLV=t.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},void 0!=e&&this.setByParam(e)},d.asn1.x509.Time_bak=function(e){d.asn1.x509.Time_bak.superclass.constructor.call(this);var t=d.asn1,r=t.DERUTCTime,n=t.DERGeneralizedTime;this.setTimeParams=function(e){this.timeParams=e},this.tohex=function(){var e=null;return e=null!=this.timeParams?"utc"==this.type?new r(this.timeParams):new n(this.timeParams):"utc"==this.type?new r:new n,this.TLV=e.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},this.type="utc",void 0!==e&&(void 0!==e.type?this.type=e.type:void 0!==e.str&&(e.str.match(/^[0-9]{12}Z$/)&&(this.type="utc"),e.str.match(/^[0-9]{14}Z$/)&&(this.type="gen")),this.timeParams=e)},tD(d.asn1.x509.Time,d.asn1.ASN1Object),d.asn1.x509.AlgorithmIdentifier=function(e){d.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this),this.nameAlg=null,this.asn1Alg=null,this.asn1Params=null,this.paramEmpty=!1;var t=d.asn1,r=t.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV;if(this.tohex=function(){if(null===this.nameAlg&&null===this.asn1Alg)throw Error("algorithm not specified");if(null!==this.nameAlg){var e=null;for(var n in r)n===this.nameAlg&&(e=r[n]);if(null!==e)return this.hTLV=e,this.hTLV}null!==this.nameAlg&&null===this.asn1Alg&&(this.asn1Alg=t.x509.OID.name2obj(this.nameAlg));var i=[this.asn1Alg];null!==this.asn1Params&&i.push(this.asn1Params);var a=new t.DERSequence({array:i});return this.hTLV=a.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&(void 0!==e.name&&(this.nameAlg=e.name),void 0!==e.asn1params&&(this.asn1Params=e.asn1params),void 0!==e.paramempty&&(this.paramEmpty=e.paramempty)),null===this.asn1Params&&!1===this.paramEmpty&&null!==this.nameAlg){void 0!==this.nameAlg.name&&(this.nameAlg=this.nameAlg.name);var n=this.nameAlg.toLowerCase();"withdsa"!==n.substr(-7,7)&&"withecdsa"!==n.substr(-9,9)&&(this.asn1Params=new t.DERNull)}},tD(d.asn1.x509.AlgorithmIdentifier,d.asn1.ASN1Object),d.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"},d.asn1.x509.GeneralName=function(e){d.asn1.x509.GeneralName.superclass.constructor.call(this);var t=d.asn1,r=t.x509,n=r.X500Name,i=r.OtherName,a=t.DERIA5String,o=(t.DERPrintableString,t.DEROctetString),s=t.DERTaggedObject,u=t.ASN1Object,c=Error;this.params=null,this.setByParam=function(e){this.params=e},this.tohex=function(){var e=this.params,t=!1;if(void 0!==e.other)r="a0",l=new i(e.other);else if(void 0!==e.rfc822)r="81",l=new a({str:e.rfc822});else if(void 0!==e.dns)r="82",l=new a({str:e.dns});else if(void 0!==e.dn)r="a4",t=!0,l="string"==typeof e.dn?new n({str:e.dn}):e.dn instanceof d.asn1.x509.X500Name?e.dn:new n(e.dn);else if(void 0!==e.ldapdn)r="a4",t=!0,l=new n({ldapstr:e.ldapdn});else if(void 0!==e.certissuer||void 0!==e.certsubj){r="a4",t=!0;var r,t,l,f,h,p,m=null;if(void 0!==e.certsubj?(f=!1,h=e.certsubj):(f=!0,h=e.certissuer),h.match(/^[0-9A-Fa-f]+$/),-1!=h.indexOf("-----BEGIN ")&&(m=tb(h)),null==m)throw Error("certsubj/certissuer not cert");var g=new tH;g.hex=m,p=f?g.getIssuerHex():g.getSubjectHex(),(l=new u).hTLV=p}else if(void 0!==e.uri)r="86",l=new a({str:e.uri});else if(void 0!==e.ip){r="87";var y,b=e.ip;try{if(b.match(/^[0-9a-f]+$/)){var x=b.length;if(8==x||16==x||32==x||64==x)y=b;else throw"err"}else y=function e(t){var r=Error("malformed IP address");if(!(t=t.toLowerCase(t)).match(/^[0-9a-f.:/]+$/))throw r;if(t.match(/^[0-9.]+$/)){var n=t.split(".");if(4!==n.length)throw r;var i="";try{for(var a=0;a<4;a++){var o=parseInt(n[a]);i+=("0"+o.toString(16)).slice(-2)}return i}catch(e){throw r}}else{if(t.match(/^[0-9.]+\/[0-9]+$/)){var s=t.split("/");return e(s[0])+tP(parseInt(s[1]),32)}if(t.match(/^[0-9a-f:]+$/)&&-1!==t.indexOf(":"))return tw(t);if(t.match(/^[0-9a-f:]+\/[0-9]+$/)&&-1!==t.indexOf(":")){var s=t.split("/");return tw(s[0])+tP(parseInt(s[1]),128)}throw r}}(b)}catch(t){throw new c("malformed IP address: "+e.ip+":"+t.message)}l=new o({hex:y})}else throw new c("improper params");return new s({tag:r,explicit:t,obj:l}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},tD(d.asn1.x509.GeneralName,d.asn1.ASN1Object),d.asn1.x509.GeneralNames=function(e){d.asn1.x509.GeneralNames.superclass.constructor.call(this);var t=d.asn1;this.setByParamArray=function(e){for(var r=0;r0){for(var r=n(e.valhex,t[0]),i=u(r,0),a=[],o=0;o1){var l=n(e.valhex,t[1]);e.polhex=l}delete e.valhex},this.setSignaturePolicyIdentifier=function(e){var t=u(e.valhex,0);if(t.length>0){var i=ts.getOID(e.valhex,t[0]);e.oid=i}if(t.length>1){var a=new tH,o=u(e.valhex,t[1]),s=n(e.valhex,o[0]),c=a.getAlgorithmIdentifierName(s);e.alg=c;var l=r(e.valhex,o[1]);e.hash=l}delete e.valhex},this.setSigningCertificateV2=function(e){var t=u(e.valhex,0);if(t.length>0){for(var r=n(e.valhex,t[0]),i=u(r,0),a=[],o=0;o1){var l=n(e.valhex,t[1]);e.polhex=l}delete e.valhex},this.getESSCertID=function(e){var t={},i=u(e,0);if(i.length>0){var a=r(e,i[0]);t.hash=a}if(i.length>1){var o=n(e,i[1]),s=this.getIssuerSerial(o);void 0!=s.serial&&(t.serial=s.serial),void 0!=s.issuer&&(t.issuer=s.issuer)}return t},this.getESSCertIDv2=function(i){var a={},o=u(i,0);if(o.length<1||3s+1){var f=n(i,o[s+1]),d=this.getIssuerSerial(f);a.issuer=d.issuer,a.serial=d.serial}return a},this.getIssuerSerial=function(e){var i={},a=u(e,0),o=n(e,a[0]),s=t.getGeneralNames(o)[0].dn;i.issuer=s;var c=r(e,a[1]);return i.serial={hex:c},i},this.getCertificateSet=function(e){for(var t=u(e,0),r=[],i=0;i=0;o--)i+=n[o];return i}if("string"==typeof e&&void 0!=a[e])return tT([e],a);if("object"==typeof e&&void 0!=e.length)return tT(e,a);throw new t("wrong params")},this.tohex=function(){this.params;var e=this.getBinValue();return new n({bin:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!=e&&this.setByParam(e)},tD(d.asn1.tsp.PKIFailureInfo,d.asn1.ASN1Object),d.asn1.tsp.AbstractTSAAdapter=function(e){this.getTSTHex=function(e,t){throw"not implemented yet"}},d.asn1.tsp.SimpleTSAAdapter=function(e){var t=d,r=t.asn1.tsp,n=t.crypto.Util.hashHex;r.SimpleTSAAdapter.superclass.constructor.call(this),this.params=null,this.serial=0,this.getTSTHex=function(e,t){var i=n(e,t);return this.params.econtent.content.messageImprint={alg:t,hash:i},this.params.econtent.content.serial={int:this.serial++},this.params.econtent.content.nonce={int:Math.floor(1e9*Math.random())},new r.TimeStampToken(this.params).getContentInfoEncodedHex()},void 0!==e&&(this.params=e)},tD(d.asn1.tsp.SimpleTSAAdapter,d.asn1.tsp.AbstractTSAAdapter),d.asn1.tsp.FixedTSAAdapter=function(e){var t=d,r=t.asn1.tsp,n=t.crypto.Util.hashHex;r.FixedTSAAdapter.superclass.constructor.call(this),this.params=null,this.getTSTHex=function(e,t){var i=n(e,t);return this.params.econtent.content.messageImprint={alg:t,hash:i},new r.TimeStampToken(this.params).getContentInfoEncodedHex()},void 0!==e&&(this.params=e)},tD(d.asn1.tsp.FixedTSAAdapter,d.asn1.tsp.AbstractTSAAdapter),d.asn1.tsp.TSPUtil=new function(){},d.asn1.tsp.TSPUtil.newTimeStampToken=function(e){return new d.asn1.tsp.TimeStampToken(e)},d.asn1.tsp.TSPUtil.parseTimeStampReq=function(e){return new d.asn1.tsp.TSPParser().getTimeStampReq(e)},d.asn1.tsp.TSPUtil.parseMessageImprint=function(e){return new d.asn1.tsp.TSPParser().getMessageImprint(e)},d.asn1.tsp.TSPParser=function(){var e=new tH,t=ts.getV,r=ts.getTLV,n=ts.getIdxbyList,i=(ts.getTLVbyListEx,ts.getChildIdx),a=["granted","grantedWithMods","rejection","waiting","revocationWarning","revocationNotification"],o={0:"badAlg",2:"badRequest",5:"badDataFormat",14:"timeNotAvailable",15:"unacceptedPolicy",16:"unacceptedExtension",17:"addInfoNotAvailable",25:"systemFailure"};this.getResponse=function(e){var t=i(e,0);if(1==t.length)return this.getPKIStatusInfo(r(e,t[0]));if(t.length>1){var n=this.getPKIStatusInfo(r(e,t[0])),a=r(e,t[1]),o=this.getToken(a);return o.statusinfo=n,o}},this.getToken=function(e){var t=(new d.asn1.cms.CMSParser).getCMSSignedData(e);return this.setTSTInfo(t),t},this.setTSTInfo=function(e){var t=e.econtent;if("tstinfo"==t.type){var r=t.content.hex,n=this.getTSTInfo(r);t.content=n}},this.getTSTInfo=function(n){var a={},o=i(n,0),s=t(n,o[1]);a.policy=tR(s);var u=r(n,o[2]);a.messageImprint=this.getMessageImprint(u);var c=t(n,o[3]);a.serial={hex:c};var l=t(n,o[4]);a.genTime={str:tm(l)};var f=0;if(o.length>5&&"30"==n.substr(o[5],2)){var d=r(n,o[5]);a.accuracy=this.getAccuracy(d),f++}if(o.length>5+f&&"01"==n.substr(o[5+f],2)&&("ff"==t(n,o[5+f])&&(a.ordering=!0),f++),o.length>5+f&&"02"==n.substr(o[5+f],2)){var h=t(n,o[5+f]);a.nonce={hex:h},f++}if(o.length>5+f&&"a0"==n.substr(o[5+f],2)){var p=r(n,o[5+f]);p="30"+p.substr(2);var m=(pGeneralNames=e.getGeneralNames(p))[0].dn;a.tsa=m,f++}if(o.length>5+f&&"a1"==n.substr(o[5+f],2)){var g=r(n,o[5+f]);g="30"+g.substr(2);var y=e.getExtParamArray(g);a.ext=y,f++}return a},this.getAccuracy=function(e){for(var r={},n=i(e,0),a=0;a1&&"30"==e.substr(o[1],2)){var l=r(e,o[1]);n.statusstr=this.getPKIFreeText(l),s++}if(o.length>s&&"03"==e.substr(o[1+s],2)){var f=r(e,o[1+s]);n.failinfo=this.getPKIFailureInfo(f)}return n},this.getPKIFreeText=function(e){for(var t=[],r=i(e,0),n=0;n=t)?e:Array(t-e.length+1).join(r)+e};function tT(e,t){for(var r=0,n=0;n=0;n--)a+=i[n];return a}function tD(e,t){var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e,e.superclass=t.prototype,t.prototype.constructor==Object.prototype.constructor&&(t.prototype.constructor=t)}void 0!==d&&d||(d={}),void 0!==d.crypto&&d.crypto||(d.crypto={}),d.crypto.Util=new function(){this.DIGESTINFOHEAD={sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",ripemd160:"3021300906052b2403020105000414"},this.DEFAULTPROVIDER={md5:"cryptojs",sha1:"cryptojs",sha224:"cryptojs",sha256:"cryptojs",sha384:"cryptojs",sha512:"cryptojs",ripemd160:"cryptojs",hmacmd5:"cryptojs",hmacsha1:"cryptojs",hmacsha224:"cryptojs",hmacsha256:"cryptojs",hmacsha384:"cryptojs",hmacsha512:"cryptojs",hmacripemd160:"cryptojs",MD5withRSA:"cryptojs/jsrsa",SHA1withRSA:"cryptojs/jsrsa",SHA224withRSA:"cryptojs/jsrsa",SHA256withRSA:"cryptojs/jsrsa",SHA384withRSA:"cryptojs/jsrsa",SHA512withRSA:"cryptojs/jsrsa",RIPEMD160withRSA:"cryptojs/jsrsa",MD5withECDSA:"cryptojs/jsrsa",SHA1withECDSA:"cryptojs/jsrsa",SHA224withECDSA:"cryptojs/jsrsa",SHA256withECDSA:"cryptojs/jsrsa",SHA384withECDSA:"cryptojs/jsrsa",SHA512withECDSA:"cryptojs/jsrsa",RIPEMD160withECDSA:"cryptojs/jsrsa",SHA1withDSA:"cryptojs/jsrsa",SHA224withDSA:"cryptojs/jsrsa",SHA256withDSA:"cryptojs/jsrsa",MD5withRSAandMGF1:"cryptojs/jsrsa",SHAwithRSAandMGF1:"cryptojs/jsrsa",SHA1withRSAandMGF1:"cryptojs/jsrsa",SHA224withRSAandMGF1:"cryptojs/jsrsa",SHA256withRSAandMGF1:"cryptojs/jsrsa",SHA384withRSAandMGF1:"cryptojs/jsrsa",SHA512withRSAandMGF1:"cryptojs/jsrsa",RIPEMD160withRSAandMGF1:"cryptojs/jsrsa"},this.CRYPTOJSMESSAGEDIGESTNAME={md5:b.algo.MD5,sha1:b.algo.SHA1,sha224:b.algo.SHA224,sha256:b.algo.SHA256,sha384:b.algo.SHA384,sha512:b.algo.SHA512,ripemd160:b.algo.RIPEMD160},this.getDigestInfoHex=function(e,t){if(void 0===this.DIGESTINFOHEAD[t])throw"alg not supported in Util.DIGESTINFOHEAD: "+t;return this.DIGESTINFOHEAD[t]+e},this.getPaddedDigestInfoHex=function(e,t,r){var n=this.getDigestInfoHex(e,t),i=r/4;if(n.length+22>i)throw"key is too short for SigAlg: keylen="+r+","+t;for(var a="0001",o="00"+n,s="",u=i-a.length-o.length,c=0;c=s.compareTo(E.ZERO));var u=o.modInverse(i).multiply(a.add(n.multiply(s))).mod(i);return r.biRSSigToASN1Sig(s,u)},this.sign=function(e,t){var r=this.ecparams.n,n=E.fromByteArrayUnsigned(e);do var i=this.getBigRandom(r),a=this.ecparams.G.multiply(i).getX().toBigInteger().mod(r);while(0>=a.compareTo(E.ZERO));var o=i.modInverse(r).multiply(n.add(t.multiply(a))).mod(r);return this.serializeSig(a,o)},this.verifyWithMessageHash=function(e,t){return this.verifyHex(e,t,this.pubKeyHex)},this.verifyHex=function(e,t,n){try{var i,a,o=r.parseSigHex(t);i=o.r,a=o.s;var s=ti.decodeFromHex(this.ecparams.curve,n),u=new E(e.substring(0,this.ecparams.keycharlen),16);return this.verifyRaw(u,i,a,s)}catch(e){return!1}},this.verify=function(e,t,r){if(Bitcoin.Util.isArray(t)){var n,i,a,o=this.parseSig(t);n=o.r,i=o.s}else if("object"==typeof t&&t.r&&t.s)n=t.r,i=t.s;else throw"Invalid value for signature";if(r instanceof ti)a=r;else if(Bitcoin.Util.isArray(r))a=ti.decodeFrom(this.ecparams.curve,r);else throw"Invalid format for pubkey value, must be byte array or ECPointFp";var s=E.fromByteArrayUnsigned(e);return this.verifyRaw(s,n,i,a)},this.verifyRaw=function(e,t,r,n){var i=this.ecparams.n,a=this.ecparams.G;if(0>t.compareTo(E.ONE)||t.compareTo(i)>=0||0>r.compareTo(E.ONE)||r.compareTo(i)>=0)return!1;var o=r.modInverse(i),s=e.multiply(o).mod(i),u=t.multiply(o).mod(i);return a.multiply(s).add(n.multiply(u)).getX().toBigInteger().mod(i).equals(t)},this.serializeSig=function(e,t){var r=e.toByteArraySigned(),n=t.toByteArraySigned(),i=[];return i.push(2),i.push(r.length),(i=i.concat(r)).push(2),i.push(n.length),(i=i.concat(n)).unshift(i.length),i.unshift(48),i},this.parseSig=function(e){if(48!=e[0])throw Error("Signature not a valid DERSequence");if(2!=e[t=2])throw Error("First element in signature must be a DERInteger");var t,r=e.slice(t+2,t+2+e[t+1]);if(t+=2+e[t+1],2!=e[t])throw Error("Second element in signature must be a DERInteger");var n=e.slice(t+2,t+2+e[t+1]);return t+=2+e[t+1],{r:E.fromByteArrayUnsigned(r),s:E.fromByteArrayUnsigned(n)}},this.parseSigCompact=function(e){if(65!==e.length)throw"Signature has the wrong length";var t=e[0]-27;if(t<0||t>7)throw"Invalid signature type";var r=this.ecparams.n;return{r:E.fromByteArrayUnsigned(e.slice(1,33)).mod(r),s:E.fromByteArrayUnsigned(e.slice(33,65)).mod(r),i:t}},this.readPKCS5PrvKeyHex=function(e){var t,r,n;if(!1===o(e))throw Error("not ASN.1 hex string");try{t=a(e,0,["[0]",0],"06"),r=a(e,0,[1],"04");try{n=a(e,0,["[1]",0],"03")}catch(e){}}catch(e){throw Error("malformed PKCS#1/5 plain ECC private key")}if(this.curveName=i(t),void 0===this.curveName)throw"unsupported curve name";this.setNamedCurve(this.curveName),this.setPublicKeyHex(n),this.setPrivateKeyHex(r),this.isPublic=!1},this.readPKCS8PrvKeyHex=function(e){var r,n,s;if(!1===o(e))throw new t("not ASN.1 hex string");try{a(e,0,[1,0],"06"),r=a(e,0,[1,1],"06"),n=a(e,0,[2,0,1],"04");try{s=a(e,0,[2,0,"[1]",0],"03")}catch(e){}}catch(e){throw new t("malformed PKCS#8 plain ECC private key")}if(this.curveName=i(r),void 0===this.curveName)throw new t("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(s),this.setPrivateKeyHex(n),this.isPublic=!1},this.readPKCS8PubKeyHex=function(e){var r,n;if(!1===o(e))throw new t("not ASN.1 hex string");try{a(e,0,[0,0],"06"),r=a(e,0,[0,1],"06"),n=a(e,0,[1],"03")}catch(e){throw new t("malformed PKCS#8 ECC public key")}if(this.curveName=i(r),null===this.curveName)throw new t("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(n)},this.readCertPubKeyHex=function(e,r){var n,s;if(!1===o(e))throw new t("not ASN.1 hex string");try{n=a(e,0,[0,5,0,1],"06"),s=a(e,0,[0,5,1],"03")}catch(e){throw new t("malformed X.509 certificate ECC public key")}if(this.curveName=i(n),null===this.curveName)throw new t("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(s)},void 0!==e&&void 0!==e.curve&&(this.curveName=e.curve),void 0===this.curveName&&(this.curveName="secp256r1"),this.setNamedCurve(this.curveName),void 0!==e&&(void 0!==e.prv&&this.setPrivateKeyHex(e.prv),void 0!==e.pub&&this.setPublicKeyHex(e.pub))},d.crypto.ECDSA.parseSigHex=function(e){var t=d.crypto.ECDSA.parseSigHexInHexRS(e);return{r:new E(t.r,16),s:new E(t.s,16)}},d.crypto.ECDSA.parseSigHexInHexRS=function(e){var t=ts.getChildIdx,r=ts.getV;if(ts.checkStrictDER(e,0),"30"!=e.substr(0,2))throw Error("signature is not a ASN.1 sequence");var n=t(e,0);if(2!=n.length)throw Error("signature shall have two elements");var i=n[0],a=n[1];if("02"!=e.substr(i,2))throw Error("1st item not ASN.1 integer");if("02"!=e.substr(a,2))throw Error("2nd item not ASN.1 integer");return{r:r(e,i),s:r(e,a)}},d.crypto.ECDSA.asn1SigToConcatSig=function(e){var t=d.crypto.ECDSA.parseSigHexInHexRS(e),r=t.r,n=t.s;if(r.length>=130&&r.length<=134){if(r.length%2!=0)throw Error("unknown ECDSA sig r length error");if(n.length%2!=0)throw Error("unknown ECDSA sig s length error");"00"==r.substr(0,2)&&(r=r.substr(2)),"00"==n.substr(0,2)&&(n=n.substr(2));var i=Math.max(r.length,n.length);return(r=("000000"+r).slice(-i))+(n=("000000"+n).slice(-i))}if("00"==r.substr(0,2)&&r.length%32==2&&(r=r.substr(2)),"00"==n.substr(0,2)&&n.length%32==2&&(n=n.substr(2)),r.length%32==30&&(r="00"+r),n.length%32==30&&(n="00"+n),r.length%32!=0)throw Error("unknown ECDSA sig r length error");if(n.length%32!=0)throw Error("unknown ECDSA sig s length error");return r+n},d.crypto.ECDSA.concatSigToASN1Sig=function(e){if(e.length%4!=0)throw Error("unknown ECDSA concatinated r-s sig length error");var t=e.substr(0,e.length/2),r=e.substr(e.length/2);return d.crypto.ECDSA.hexRSSigToASN1Sig(t,r)},d.crypto.ECDSA.hexRSSigToASN1Sig=function(e,t){var r=new E(e,16),n=new E(t,16);return d.crypto.ECDSA.biRSSigToASN1Sig(r,n)},d.crypto.ECDSA.biRSSigToASN1Sig=function(e,t){var r=d.asn1,n=new r.DERInteger({bigint:e}),i=new r.DERInteger({bigint:t});return new r.DERSequence({array:[n,i]}).tohex()},d.crypto.ECDSA.getName=function(e){return"2b8104001f"===e?"secp192k1":"2a8648ce3d030107"===e?"secp256r1":"2b8104000a"===e?"secp256k1":"2b81040021"===e?"secp224r1":"2b81040022"===e?"secp384r1":"2b81040023"===e?"secp521r1":-1!=="|secp256r1|NIST P-256|P-256|prime256v1|".indexOf(e)?"secp256r1":-1!=="|secp256k1|".indexOf(e)?"secp256k1":-1!=="|secp224r1|NIST P-224|P-224|".indexOf(e)?"secp224r1":-1!=="|secp384r1|NIST P-384|P-384|".indexOf(e)?"secp384r1":-1!=="|secp521r1|NIST P-521|P-521|".indexOf(e)?"secp521r1":null},void 0!==d&&d||(d={}),void 0!==d.crypto&&d.crypto||(d.crypto={}),d.crypto.ECParameterDB=new function(){var e={},t={};function r(e){return new E(e,16)}this.getByName=function(r){var n=r;if(void 0!==t[n]&&(n=t[r]),void 0!==e[n])return e[n];throw"unregistered EC curve name: "+n},this.regist=function(n,i,a,o,s,u,c,l,f,d,h,p){e[n]={};var m=r(a),g=r(o),y=r(s),b=r(u),x=r(c),S=new ta(m,g,y),w=S.decodePointHex("04"+l+f);e[n].name=n,e[n].keylen=i,e[n].keycharlen=2*Math.ceil(i/8),e[n].curve=S,e[n].G=w,e[n].n=b,e[n].h=x,e[n].oid=h,e[n].info=p;for(var E=0;E1?new E(n,16):null,c=new E(i,16),this.setPrivate(a,o,s,u,c)},this.setPublic=function(e,t,r,n){this.isPublic=!0,this.p=e,this.q=t,this.g=r,this.y=n,this.x=null},this.setPublicHex=function(e,t,r,n){var i,a,o,s;i=new E(e,16),a=new E(t,16),o=new E(r,16),s=new E(n,16),this.setPublic(i,a,o,s)},this.signWithMessageHash=function(e){var t=this.p,r=this.q,n=this.g;this.y;var i=this.x,a=d.crypto.Util.getRandomBigIntegerMinToMax(E.ONE.add(E.ONE),r.subtract(E.ONE)),o=e.substr(0,r.bitLength()/4),s=new E(o,16),u=n.modPow(a,t).mod(r),c=a.modInverse(r).multiply(s.add(i.multiply(u))).mod(r);return d.asn1.ASN1Util.jsonToASN1HEX({seq:[{int:{bigint:u}},{int:{bigint:c}}]})},this.verifyWithMessageHash=function(e,t){var r=this.p,n=this.q,i=this.g,a=this.y,o=this.parseASN1Signature(t),s=o[0],u=o[1],c=e.substr(0,n.bitLength()/4),l=new E(c,16);if(E.ZERO.compareTo(s)>0||s.compareTo(n)>0||E.ZERO.compareTo(u)>=0||u.compareTo(n)>0)throw"invalid DSA signature";var f=u.modInverse(n),d=l.multiply(f).mod(n),h=s.multiply(f).mod(n);return 0==i.modPow(d,r).multiply(a.modPow(h,r)).mod(r).mod(n).compareTo(s)},this.parseASN1Signature=function(t){try{var r=new E(e(t,0,[0],"02"),16),n=new E(e(t,0,[1],"02"),16);return[r,n]}catch(e){throw Error("malformed ASN.1 DSA signature")}},this.readPKCS5PrvKeyHex=function(r){var n,i,a,o,s;if(!1===t(r))throw Error("not ASN.1 hex string");try{n=e(r,0,[1],"02"),i=e(r,0,[2],"02"),a=e(r,0,[3],"02"),o=e(r,0,[4],"02"),s=e(r,0,[5],"02")}catch(e){throw Error("malformed PKCS#1/5 plain DSA private key")}this.setPrivateHex(n,i,a,o,s)},this.readPKCS8PrvKeyHex=function(r){var n,i,a,o;if(!1===t(r))throw Error("not ASN.1 hex string");try{n=e(r,0,[1,1,0],"02"),i=e(r,0,[1,1,1],"02"),a=e(r,0,[1,1,2],"02"),o=e(r,0,[2,0],"02")}catch(e){throw Error("malformed PKCS#8 plain DSA private key")}this.setPrivateHex(n,i,a,null,o)},this.readPKCS8PubKeyHex=function(r){var n,i,a,o;if(!1===t(r))throw Error("not ASN.1 hex string");try{n=e(r,0,[0,1,0],"02"),i=e(r,0,[0,1,1],"02"),a=e(r,0,[0,1,2],"02"),o=e(r,0,[1,0],"02")}catch(e){throw Error("malformed PKCS#8 DSA public key")}this.setPublicHex(n,i,a,o)},this.readCertPubKeyHex=function(r,n){var i,a,o,s;if(!1===t(r))throw Error("not ASN.1 hex string");try{i=e(r,0,[0,5,0,1,0],"02"),a=e(r,0,[0,5,0,1,1],"02"),o=e(r,0,[0,5,0,1,2],"02"),s=e(r,0,[0,5,1,0],"02")}catch(e){throw Error("malformed X.509 certificate DSA public key")}this.setPublicHex(i,a,o,s)}};var tN=(n=function(e,t,r){return i(b.AES,e,t,r)},i=function(e,t,r,n){var i=b.enc.Hex.parse(t),a=b.enc.Hex.parse(r),o=b.enc.Hex.parse(n),s={};s.key=a,s.iv=o,s.ciphertext=i;var u=e.decrypt(s,a,{iv:o});return b.enc.Hex.stringify(u)},a=function(e,t,r){return o(b.AES,e,t,r)},o=function(e,t,r,n){var i=b.enc.Hex.parse(t),a=b.enc.Hex.parse(r),o=b.enc.Hex.parse(n),s=e.encrypt(i,a,{iv:o}),u=b.enc.Hex.parse(s.toString());return b.enc.Base64.stringify(u)},s={"AES-256-CBC":{proc:n,eproc:a,keylen:32,ivlen:16},"AES-192-CBC":{proc:n,eproc:a,keylen:24,ivlen:16},"AES-128-CBC":{proc:n,eproc:a,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:function(e,t,r){return i(b.TripleDES,e,t,r)},eproc:function(e,t,r){return o(b.TripleDES,e,t,r)},keylen:24,ivlen:8},"DES-CBC":{proc:function(e,t,r){return i(b.DES,e,t,r)},eproc:function(e,t,r){return o(b.DES,e,t,r)},keylen:8,ivlen:8}},u=function(e){var t=b.lib.WordArray.random(e);return b.enc.Hex.stringify(t)},c=function(e){var t={},r=e.match(RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));r&&(t.cipher=r[1],t.ivsalt=r[2]);var n=e.match(RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));n&&(t.type=n[1]);var i=-1,a=0;-1!=e.indexOf("\r\n\r\n")&&(i=e.indexOf("\r\n\r\n"),a=2),-1!=e.indexOf("\n\n")&&(i=e.indexOf("\n\n"),a=1);var o=e.indexOf("-----END");if(-1!=i&&-1!=o){var s=e.substring(i+2*a,o-a);s=s.replace(/\s+/g,""),t.data=s}return t},l=function(e,t,r){for(var n=r.substring(0,16),i=b.enc.Hex.parse(n),a=b.enc.Utf8.parse(t),o=s[e].keylen+s[e].ivlen,u="",c=null;;){var l=b.algo.MD5.create();if(null!=c&&l.update(c),l.update(a),l.update(i),c=l.finalize(),(u+=b.enc.Hex.stringify(c)).length>=2*o)break}var f={};return f.keyhex=u.substr(0,2*s[e].keylen),f.ivhex=u.substr(2*s[e].keylen,2*s[e].ivlen),f},f=function(e,t,r,n){var i=b.enc.Base64.parse(e),a=b.enc.Hex.stringify(i);return(0,s[t].proc)(a,r,n)},{version:"1.0.0",parsePKCS5PEM:function(e){return c(e)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(e,t,r){return l(e,t,r)},decryptKeyB64:function(e,t,r,n){return f(e,t,r,n)},getDecryptedKeyHex:function(e,t){var r=c(e);r.type;var n=r.cipher,i=r.ivsalt,a=r.data,o=l(n,t,i).keyhex;return f(a,n,o,i)},getEncryptedPKCS5PEMFromPrvKeyHex:function(e,t,r,n,i){var a,o,c="";if((void 0===n||null==n)&&(n="AES-256-CBC"),void 0===s[n])throw Error("KEYUTIL unsupported algorithm: "+n);(void 0===i||null==i)&&(i=u(s[n].ivlen).toUpperCase());var f=l(n,r,i).keyhex,d=(a=n,o=i,(0,s[a].eproc)(t,f,o)).replace(/(.{64})/g,"$1\r\n"),c="-----BEGIN "+e+" PRIVATE KEY-----\r\n";return c+("Proc-Type: 4,ENCRYPTED\r\n"+("DEK-Info: "+n+",")+i+"\r\n\r\n"+d+"\r\n-----END "+e)+" PRIVATE KEY-----\r\n"},parseHexOfEncryptedPKCS8:function(e){var t=ts.getChildIdx,r=ts.getV,n={},i=t(e,0);if(2!=i.length)throw Error("malformed format: SEQUENCE(0).items != 2: "+i.length);n.ciphertext=r(e,i[1]);var a=t(e,i[0]);if(2!=a.length)throw Error("malformed format: SEQUENCE(0.0).items != 2: "+a.length);if("2a864886f70d01050d"!=r(e,a[0]))throw Error("this only supports pkcs5PBES2");var o=t(e,a[1]);if(2!=a.length)throw Error("malformed format: SEQUENCE(0.0.1).items != 2: "+o.length);var s=t(e,o[1]);if(2!=s.length)throw Error("malformed format: SEQUENCE(0.0.1.1).items != 2: "+s.length);if("2a864886f70d0307"!=r(e,s[0]))throw"this only supports TripleDES";n.encryptionSchemeAlg="TripleDES",n.encryptionSchemeIV=r(e,s[1]);var u=t(e,o[0]);if(2!=u.length)throw Error("malformed format: SEQUENCE(0.0.1.0).items != 2: "+u.length);if("2a864886f70d01050c"!=r(e,u[0]))throw Error("this only supports pkcs5PBKDF2");var c=t(e,u[1]);if(c.length<2)throw Error("malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+c.length);n.pbkdf2Salt=r(e,c[0]);var l=r(e,c[1]);try{n.pbkdf2Iter=parseInt(l,16)}catch(e){throw Error("malformed format pbkdf2Iter: "+l)}return n},getPBKDF2KeyHexFromParam:function(e,t){var r=b.enc.Hex.parse(e.pbkdf2Salt),n=e.pbkdf2Iter,i=b.PBKDF2(t,r,{keySize:6,iterations:n});return b.enc.Hex.stringify(i)},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(e,t){var r=tb(e,"ENCRYPTED PRIVATE KEY"),n=this.parseHexOfEncryptedPKCS8(r),i=tN.getPBKDF2KeyHexFromParam(n,t),a={};a.ciphertext=b.enc.Hex.parse(n.ciphertext);var o=b.enc.Hex.parse(i),s=b.enc.Hex.parse(n.encryptionSchemeIV),u=b.TripleDES.decrypt(a,o,{iv:s});return b.enc.Hex.stringify(u)},getKeyFromEncryptedPKCS8PEM:function(e,t){var r=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(e,t);return this.getKeyFromPlainPrivatePKCS8Hex(r)},parsePlainPrivatePKCS8Hex:function(e){var t=ts.getChildIdx,r=ts.getV,n={};if(n.algparam=null,"30"!=e.substr(0,2))throw Error("malformed plain PKCS8 private key(code:001)");var i=t(e,0);if(i.length<3)throw Error("malformed plain PKCS8 private key(code:002)");if("30"!=e.substr(i[1],2))throw Error("malformed PKCS8 private key(code:003)");var a=t(e,i[1]);if(2!=a.length)throw Error("malformed PKCS8 private key(code:004)");if("06"!=e.substr(a[0],2))throw Error("malformed PKCS8 private key(code:005)");if(n.algoid=r(e,a[0]),"06"==e.substr(a[1],2)&&(n.algparam=r(e,a[1])),"04"!=e.substr(i[2],2))throw Error("malformed PKCS8 private key(code:006)");return n.keyidx=ts.getVidx(e,i[2]),n},getKeyFromPlainPrivatePKCS8PEM:function(e){var t=tb(e,"PRIVATE KEY");return this.getKeyFromPlainPrivatePKCS8Hex(t)},getKeyFromPlainPrivatePKCS8Hex:function(e){var t,r=this.parsePlainPrivatePKCS8Hex(e);if("2a864886f70d010101"==r.algoid)t=new tt;else if("2a8648ce380401"==r.algoid)t=new d.crypto.DSA;else if("2a8648ce3d0201"==r.algoid)t=new d.crypto.ECDSA;else throw Error("unsupported private key algorithm");return t.readPKCS8PrvKeyHex(e),t},_getKeyFromPublicPKCS8Hex:function(e){var t,r=ts.getVbyList(e,0,[0,0],"06");if("2a864886f70d010101"===r)t=new tt;else if("2a8648ce380401"===r)t=new d.crypto.DSA;else if("2a8648ce3d0201"===r)t=new d.crypto.ECDSA;else throw Error("unsupported PKCS#8 public key hex");return t.readPKCS8PubKeyHex(e),t},parsePublicRawRSAKeyHex:function(e){var t=ts.getChildIdx,r=ts.getV,n={};if("30"!=e.substr(0,2))throw Error("malformed RSA key(code:001)");var i=t(e,0);if(2!=i.length)throw Error("malformed RSA key(code:002)");if("02"!=e.substr(i[0],2))throw Error("malformed RSA key(code:003)");if(n.n=r(e,i[0]),"02"!=e.substr(i[1],2))throw Error("malformed RSA key(code:004)");return n.e=r(e,i[1]),n},parsePublicPKCS8Hex:function(e){var t=ts.getChildIdx,r=ts.getV,n={};n.algparam=null;var i=t(e,0);if(2!=i.length)throw Error("outer DERSequence shall have 2 elements: "+i.length);var a=i[0];if("30"!=e.substr(a,2))throw Error("malformed PKCS8 public key(code:001)");var o=t(e,a);if(2!=o.length)throw Error("malformed PKCS8 public key(code:002)");if("06"!=e.substr(o[0],2))throw Error("malformed PKCS8 public key(code:003)");if(n.algoid=r(e,o[0]),"06"==e.substr(o[1],2)?n.algparam=r(e,o[1]):"30"==e.substr(o[1],2)&&(n.algparam={},n.algparam.p=ts.getVbyList(e,o[1],[0],"02"),n.algparam.q=ts.getVbyList(e,o[1],[1],"02"),n.algparam.g=ts.getVbyList(e,o[1],[2],"02")),"03"!=e.substr(i[1],2))throw Error("malformed PKCS8 public key(code:004)");return n.key=r(e,i[1]).substr(2),n}});function tM(e,t){for(var r="",n=t/4-e.length,i=0;i>24,(16711680&i)>>16,(65280&i)>>8,255&i])))),i+=1;return n}function tB(e){for(var t in d.crypto.Util.DIGESTINFOHEAD){var r=d.crypto.Util.DIGESTINFOHEAD[t],n=r.length;if(e.substring(0,n)==r)return[t,e.substring(n)]}return[]}function tH(e){var t,r=ts.getChildIdx,n=ts.getV,i=(ts.dump,ts.parse),a=ts.getTLV,o=ts.getVbyList,s=ts.getVbyListEx,u=ts.getTLVbyList,c=ts.getTLVbyListEx,l=ts.getIdxbyList,f=ts.getIdxbyListEx,h=ts.getVidx,p=ts.getInt,m=ts.oidname,g=ts.hextooidstr;try{t=d.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch(e){}this.HEX2STAG={"0c":"utf8",13:"prn",16:"ia5","1a":"vis","1e":"bmp"},this.hex=null,this.version=0,this.foffset=0,this.aExtInfo=null,this.getVersion=function(){if(null===this.hex||0!==this.version)return this.version;var e=u(this.hex,0,[0,0]);if("a0"!=e.substr(0,2))return this.version=1,this.foffset=-1,1;var t=p(u(e,0,[0]),0);if(t<0||21){var s=a(e,o[1]),u=this.getGeneralName(s);void 0!=u.uri&&(i.uri=u.uri)}if(o.length>2){var c=a(e,o[2]);"0101ff"==c&&(i.reqauth=!0),"010100"==c&&(i.reqauth=!1)}return i};var y=function(e){var t={};try{var r=e.seq[0].oid,n=d.asn1.x509.OID.name2oid(r);t.type=d.asn1.x509.OID.oid2atype(n);var i=e.seq[1];if(void 0!=i.utf8str)t.ds="utf8",t.value=i.utf8str.str;else if(void 0!=i.numstr)t.ds="num",t.value=i.numstr.str;else if(void 0!=i.telstr)t.ds="tel",t.value=i.telstr.str;else if(void 0!=i.prnstr)t.ds="prn",t.value=i.prnstr.str;else if(void 0!=i.ia5str)t.ds="ia5",t.value=i.ia5str.str;else if(void 0!=i.visstr)t.ds="vis",t.value=i.visstr.str;else if(void 0!=i.bmpstr)t.ds="bmp",t.value=i.bmpstr.str;else throw"error";return t}catch(e){throw new Erorr("improper ASN.1 parsed AttrTypeAndValue")}},b=function(e){try{return e.set.map(function(e){return y(e)})}catch(e){throw Error("improper ASN.1 parsed RDN: "+e)}},x=function(e){try{return e.seq.map(function(e){return b(e)})}catch(e){throw Error("improper ASN.1 parsed X500Name: "+e)}};this.getX500NameRule=function(e){for(var t=null,r=[],n=0;n0&&(t.ext=this.getExtParamArray()),t.sighex=this.getSignatureValueHex(),"object"==typeof e&&(!0==e.tbshex&&(t.tbshex=u(this.hex,0,[0])),!0==e.nodnarray&&(delete t.issuer.array,delete t.subject.array)),t},this.getExtParamArray=function(e){void 0==e&&-1!=f(this.hex,0,[0,"[3]"])&&(e=c(this.hex,0,[0,"[3]",0],"30"));for(var t=[],n=r(e,0),i=0;i2&&"04"===e.substr(b[1],2))(l=new s).readPKCS5PrvKeyHex(e);else throw Error("unsupported PKCS#1/5 hexadecimal key");return l}if("pkcs8prv"===r){var l=tN.getKeyFromPlainPrivatePKCS8Hex(e);return l}if("pkcs8pub"===r)return tN._getKeyFromPublicPKCS8Hex(e);if("x509pub"===r)return tH.getPublicKeyFromCertHex(e);if(-1!=e.indexOf("-END CERTIFICATE-",0)||-1!=e.indexOf("-END X509 CERTIFICATE-",0)||-1!=e.indexOf("-END TRUSTED CERTIFICATE-",0))return tH.getPublicKeyFromCertPEM(e);if(-1!=e.indexOf("-END PUBLIC KEY-")){var x=tb(e,"PUBLIC KEY");return tN._getKeyFromPublicPKCS8Hex(x)}if(-1!=e.indexOf("-END RSA PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){var S=c(e,"RSA PRIVATE KEY");return tN.getKey(S,null,"pkcs5prv")}if(-1!=e.indexOf("-END DSA PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){var w=c(e,"DSA PRIVATE KEY"),A=a(w,0,[1],"02"),C=a(w,0,[2],"02"),P=a(w,0,[3],"02"),O=a(w,0,[4],"02"),k=a(w,0,[5],"02"),l=new u;return l.setPrivate(new E(A,16),new E(C,16),new E(P,16),new E(O,16),new E(k,16)),l}if(-1!=e.indexOf("-END EC PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){var S=c(e,"EC PRIVATE KEY");return tN.getKey(S,null,"pkcs5prv")}if(-1!=e.indexOf("-END PRIVATE KEY-"))return tN.getKeyFromPlainPrivatePKCS8PEM(e);if(-1!=e.indexOf("-END RSA PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var _=tN.getDecryptedKeyHex(e,t),F=new tt;return F.readPKCS5PrvKeyHex(_),F}if(-1!=e.indexOf("-END EC PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var w=tN.getDecryptedKeyHex(e,t),l=a(w,0,[1],"04"),j=a(w,0,[2,0],"06"),R=a(w,0,[3,0],"03").substr(2),I="";if(void 0!==d.crypto.OID.oidhex2name[j])I=d.crypto.OID.oidhex2name[j];else throw Error("undefined OID(hex) in KJUR.crypto.OID: "+j);var f=new s({curve:I});return f.setPublicKeyHex(R),f.setPrivateKeyHex(l),f.isPublic=!1,f}if(-1!=e.indexOf("-END DSA PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var w=tN.getDecryptedKeyHex(e,t),A=a(w,0,[1],"02"),C=a(w,0,[2],"02"),P=a(w,0,[3],"02"),O=a(w,0,[4],"02"),k=a(w,0,[5],"02"),l=new u;return l.setPrivate(new E(A,16),new E(C,16),new E(P,16),new E(O,16),new E(k,16)),l}if(-1!=e.indexOf("-END ENCRYPTED PRIVATE KEY-"))return tN.getKeyFromEncryptedPKCS8PEM(e,t);throw Error("not supported argument")},tN.generateKeypair=function(e,t){if("RSA"==e){var r=new tt;r.generate(t,"10001"),r.isPrivate=!0,r.isPublic=!0;var n=new tt,i=r.n.toString(16),a=r.e.toString(16);n.setPublic(i,a),n.isPrivate=!1,n.isPublic=!0;var o={};return o.prvKeyObj=r,o.pubKeyObj=n,o}if("EC"==e){var s=new d.crypto.ECDSA({curve:t}).generateKeyPairHex(),r=new d.crypto.ECDSA({curve:t});r.setPublicKeyHex(s.ecpubhex),r.setPrivateKeyHex(s.ecprvhex),r.isPrivate=!0,r.isPublic=!1;var n=new d.crypto.ECDSA({curve:t});n.setPublicKeyHex(s.ecpubhex),n.isPrivate=!1,n.isPublic=!0;var o={};return o.prvKeyObj=r,o.pubKeyObj=n,o}throw Error("unknown algorithm: "+e)},tN.getPEM=function(e,t,r,n,i,a){var o=d,s=o.asn1,u=s.DERObjectIdentifier,c=s.DERInteger,l=s.ASN1Util.newObject,f=s.x509.SubjectPublicKeyInfo,h=o.crypto,p=h.DSA,m=h.ECDSA;function g(e){return l({seq:[{int:0},{int:{bigint:e.n}},{int:e.e},{int:{bigint:e.d}},{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.dmp1}},{int:{bigint:e.dmq1}},{int:{bigint:e.coeff}}]})}function y(e){return l({seq:[{int:1},{octstr:{hex:e.prvKeyHex}},{tag:["a0",!0,{oid:{name:e.curveName}}]},{tag:["a1",!0,{bitstr:{hex:"00"+e.pubKeyHex}}]}]})}function x(e){return l({seq:[{int:0},{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}},{int:{bigint:e.y}},{int:{bigint:e.x}}]})}if((void 0!==tt&&e instanceof tt||void 0!==p&&e instanceof p||void 0!==m&&e instanceof m)&&!0==e.isPublic&&(void 0===t||"PKCS8PUB"==t)){var S=new f(e),w=S.tohex();return ty(w,"PUBLIC KEY")}if("PKCS1PRV"==t&&void 0!==tt&&e instanceof tt&&(void 0===r||null==r)&&!0==e.isPrivate){var S=g(e),w=S.tohex();return ty(w,"RSA PRIVATE KEY")}if("PKCS1PRV"==t&&void 0!==m&&e instanceof m&&(void 0===r||null==r)&&!0==e.isPrivate){var E=new u({name:e.curveName}).tohex(),A=y(e).tohex();return""+(ty(E,"EC PARAMETERS")+ty(A,"EC PRIVATE KEY"))}if("PKCS1PRV"==t&&void 0!==p&&e instanceof p&&(void 0===r||null==r)&&!0==e.isPrivate){var S=x(e),w=S.tohex();return ty(w,"DSA PRIVATE KEY")}if("PKCS5PRV"==t&&void 0!==tt&&e instanceof tt&&void 0!==r&&null!=r&&!0==e.isPrivate){var S=g(e),w=S.tohex();return void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",w,r,n,a)}if("PKCS5PRV"==t&&void 0!==m&&e instanceof m&&void 0!==r&&null!=r&&!0==e.isPrivate){var S=y(e),w=S.tohex();return void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("EC",w,r,n,a)}if("PKCS5PRV"==t&&void 0!==p&&e instanceof p&&void 0!==r&&null!=r&&!0==e.isPrivate){var S=x(e),w=S.tohex();return void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA",w,r,n,a)}var C=function(e,t){var r=P(e,t);return new l({seq:[{seq:[{oid:{name:"pkcs5PBES2"}},{seq:[{seq:[{oid:{name:"pkcs5PBKDF2"}},{seq:[{octstr:{hex:r.pbkdf2Salt}},{int:r.pbkdf2Iter}]}]},{seq:[{oid:{name:"des-EDE3-CBC"}},{octstr:{hex:r.encryptionSchemeIV}}]}]}]},{octstr:{hex:r.ciphertext}}]}).tohex()},P=function(e,t){var r=b.lib.WordArray.random(8),n=b.lib.WordArray.random(8),i=b.PBKDF2(t,r,{keySize:6,iterations:100}),a=b.enc.Hex.parse(e),o=b.TripleDES.encrypt(a,i,{iv:n})+"",s={};return s.ciphertext=o,s.pbkdf2Salt=b.enc.Hex.stringify(r),s.pbkdf2Iter=100,s.encryptionSchemeAlg="DES-EDE3-CBC",s.encryptionSchemeIV=b.enc.Hex.stringify(n),s};if("PKCS8PRV"==t&&void 0!=tt&&e instanceof tt&&!0==e.isPrivate){var O=g(e),k=O.tohex(),S=l({seq:[{int:0},{seq:[{oid:{name:"rsaEncryption"}},{null:!0}]},{octstr:{hex:k}}]}),w=S.tohex();if(void 0===r||null==r)return ty(w,"PRIVATE KEY");var A=C(w,r);return ty(A,"ENCRYPTED PRIVATE KEY")}if("PKCS8PRV"==t&&void 0!==m&&e instanceof m&&!0==e.isPrivate){var _={seq:[{int:1},{octstr:{hex:e.prvKeyHex}}]};"string"==typeof e.pubKeyHex&&_.seq.push({tag:["a1",!0,{bitstr:{hex:"00"+e.pubKeyHex}}]});var O=new l(_),k=O.tohex(),S=l({seq:[{int:0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:e.curveName}}]},{octstr:{hex:k}}]}),w=S.tohex();if(void 0===r||null==r)return ty(w,"PRIVATE KEY");var A=C(w,r);return ty(A,"ENCRYPTED PRIVATE KEY")}if("PKCS8PRV"==t&&void 0!==p&&e instanceof p&&!0==e.isPrivate){var O=new c({bigint:e.x}),k=O.tohex(),S=l({seq:[{int:0},{seq:[{oid:{name:"dsa"}},{seq:[{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}}]}]},{octstr:{hex:k}}]}),w=S.tohex();if(void 0===r||null==r)return ty(w,"PRIVATE KEY");var A=C(w,r);return ty(A,"ENCRYPTED PRIVATE KEY")}throw Error("unsupported object nor format")},tN.getKeyFromCSRPEM=function(e){var t=tb(e,"CERTIFICATE REQUEST");return tN.getKeyFromCSRHex(t)},tN.getKeyFromCSRHex=function(e){var t=tN.parseCSRHex(e);return tN.getKey(t.p8pubkeyhex,null,"pkcs8pub")},tN.parseCSRHex=function(e){var t=ts.getChildIdx,r=ts.getTLV,n={};if("30"!=e.substr(0,2))throw Error("malformed CSR(code:001)");var i=t(e,0);if(i.length<1)throw Error("malformed CSR(code:002)");if("30"!=e.substr(i[0],2))throw Error("malformed CSR(code:003)");var a=t(e,i[0]);if(a.length<3)throw Error("malformed CSR(code:004)");return n.p8pubkeyhex=r(e,a[2]),n},tN.getKeyID=function(e){"string"==typeof e&&-1!=e.indexOf("BEGIN ")&&(e=tN.getKey(e));var t=tb(tN.getPEM(e)),r=ts.getIdxbyList(t,0,[1]),n=ts.getV(t,r).substring(2);return d.crypto.Util.hashHex(n,"sha1")},tN.getJWK=function(e,t,r,n,i){var a,o,s={},u=d.crypto.Util.hashHex;if("string"==typeof e)a=tN.getKey(e),-1!=e.indexOf("CERTIFICATE")&&(o=tb(e));else if("object"==typeof e)e instanceof tH?(a=e.getPublicKey(),o=e.hex):a=e;else throw Error("unsupported keyinfo type");if(a instanceof tt&&a.isPrivate)s.kty="RSA",s.n=td(a.n.toString(16)),s.e=td(a.e.toString(16)),s.d=td(a.d.toString(16)),s.p=td(a.p.toString(16)),s.q=td(a.q.toString(16)),s.dp=td(a.dmp1.toString(16)),s.dq=td(a.dmq1.toString(16)),s.qi=td(a.coeff.toString(16));else if(a instanceof tt&&a.isPublic)s.kty="RSA",s.n=td(a.n.toString(16)),s.e=td(a.e.toString(16));else if(a instanceof d.crypto.ECDSA&&a.isPrivate){var c=a.getShortNISTPCurveName();if("P-256"!==c&&"P-384"!==c&&"P-521"!==c)throw Error("unsupported curve name for JWT: "+c);var l=a.getPublicKeyXYHex();s.kty="EC",s.crv=c,s.x=td(l.x),s.y=td(l.y),s.d=td(a.prvKeyHex)}else if(a instanceof d.crypto.ECDSA&&a.isPublic){var c=a.getShortNISTPCurveName();if("P-256"!==c&&"P-384"!==c&&"P-521"!==c)throw Error("unsupported curve name for JWT: "+c);var l=a.getPublicKeyXYHex();s.kty="EC",s.crv=c,s.x=td(l.x),s.y=td(l.y)}if(void 0==s.kty)throw Error("unsupported keyinfo");return a.isPrivate||!0==t||(s.kid=d.jws.JWS.getJWKthumbprint(s)),void 0!=o&&!0!=r&&(s.x5c=[S(o)]),void 0!=o&&!0!=n&&(s.x5t=tl(S(u(o,"sha1")))),void 0!=o&&!0!=i&&(s["x5t#S256"]=tl(S(u(o,"sha256")))),s},tN.getJWKFromKey=function(e){return tN.getJWK(e,!0,!0,!0,!0)},tt.getPosArrayOfChildrenFromHex=function(e){return ts.getChildIdx(e,0)},tt.getHexValueArrayOfChildrenFromHex=function(e){var t=ts.getV,r=tt.getPosArrayOfChildrenFromHex(e),n=t(e,r[0]),i=t(e,r[1]),a=t(e,r[2]),o=t(e,r[3]),s=t(e,r[4]),u=t(e,r[5]),c=t(e,r[6]),l=t(e,r[7]),f=t(e,r[8]),r=[];return r.push(n,i,a,o,s,u,c,l,f),r},tt.prototype.readPrivateKeyFromPEMString=function(e){var t=tb(e),r=tt.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8])},tt.prototype.readPKCS5PrvKeyHex=function(e){var t=tt.getHexValueArrayOfChildrenFromHex(e);this.setPrivateEx(t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},tt.prototype.readPKCS8PrvKeyHex=function(e){var t,r,n,i,a,o,s,u,c=ts.getVbyListEx;if(!1===ts.isASN1HEX(e))throw Error("not ASN.1 hex string");try{t=c(e,0,[2,0,1],"02"),r=c(e,0,[2,0,2],"02"),n=c(e,0,[2,0,3],"02"),i=c(e,0,[2,0,4],"02"),a=c(e,0,[2,0,5],"02"),o=c(e,0,[2,0,6],"02"),s=c(e,0,[2,0,7],"02"),u=c(e,0,[2,0,8],"02")}catch(e){throw Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(t,r,n,i,a,o,s,u)},tt.prototype.readPKCS5PubKeyHex=function(e){var t=ts.getV;if(!1===ts.isASN1HEX(e))throw Error("keyHex is not ASN.1 hex string");var r=ts.getChildIdx(e,0);if(2!==r.length||"02"!==e.substr(r[0],2)||"02"!==e.substr(r[1],2))throw Error("wrong hex for PKCS#5 public key");var n=t(e,r[0]),i=t(e,r[1]);this.setPublic(n,i)},tt.prototype.readPKCS8PubKeyHex=function(e){if(!1===ts.isASN1HEX(e))throw Error("not ASN.1 hex string");if("06092a864886f70d010101"!==ts.getTLVbyListEx(e,0,[0,0]))throw Error("not PKCS8 RSA public key");var t=ts.getTLVbyListEx(e,0,[1,0]);this.readPKCS5PubKeyHex(t)},tt.prototype.readCertPubKeyHex=function(e,t){var r,n;(r=new tH).readCertHex(e),n=r.getPublicKeyHex(),this.readPKCS8PubKeyHex(n)},tt.prototype.sign=function(e,t){var r=d.crypto.Util.hashString(e,t);return this.signWithMessageHash(r,t)},tt.prototype.signWithMessageHash=function(e,t){var r=d.crypto.Util.getPaddedDigestInfoHex(e,t,this.n.bitLength()),n=e7(r,16);return tM(this.doPrivate(n).toString(16),this.n.bitLength())},tt.prototype.signPSS=function(e,t,r){var n,i=(n=tg(e),d.crypto.Util.hashHex(n,t));return void 0===r&&(r=-1),this.signWithMessageHashPSS(i,t,r)},tt.prototype.signWithMessageHashPSS=function(e,t,r){var n,i=tv(e),a=i.length,o=this.n.bitLength()-1,s=Math.ceil(o/8),u=function(e){return d.crypto.Util.hashHex(e,t)};if(-1===r||void 0===r)r=a;else if(-2===r)r=s-a-2;else if(r<-2)throw Error("invalid salt length");if(s0&&(c=Array(r),new e9().nextBytes(c),c=String.fromCharCode.apply(String,c));var l=tv(u(tg("\x00\x00\x00\x00\x00\x00\x00\x00"+i+c))),f=[];for(n=0;n>8*s-o&255),n=0;nn)return!1;var i=this.doPublic(r).toString(16);if(i.length+3!=n/4)return!1;var a=tB(i.replace(/^1f+00/,""));if(0==a.length)return!1;var o=a[0],s=a[1],u=d.crypto.Util.hashString(e,o);return s==u},tt.prototype.verifyWithMessageHash=function(e,t){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var r=e7(t,16);if(r.bitLength()>this.n.bitLength())return 0;var n=tB(this.doPublic(r).toString(16).replace(/^1f+00/,""));return 0!=n.length&&(n[0],n[1]==e)},tt.prototype.verifyPSS=function(e,t,r,n){var i,a=(i=tg(e),d.crypto.Util.hashHex(i,r));return void 0===n&&(n=-1),this.verifyWithMessageHashPSS(a,t,r,n)},tt.prototype.verifyWithMessageHashPSS=function(e,t,r,n){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var i,a=new E(t,16),o=function(e){return d.crypto.Util.hashHex(e,r)},s=tv(e),u=s.length,c=this.n.bitLength()-1,l=Math.ceil(c/8);if(-1===n||void 0===n)n=u;else if(-2===n)n=l-u-2;else if(n<-2)throw Error("invalid salt length");if(l>8*l-c&255;if((h.charCodeAt(0)&m)!=0)throw Error("bits beyond keysize not zero");var g=tL(p,h.length,o),y=[];for(i=0;i0&&-1==(":"+r.join(":")+":").indexOf(":"+g+":"))throw"algorithm '"+g+"' not accepted in the list";if("none"!=g&&null===t)throw"key shall be specified to verify.";if("string"==typeof t&&-1!=t.indexOf("-----BEGIN ")&&(t=tN.getKey(t)),("RS"==y||"PS"==y)&&!(t instanceof tt))throw"key shall be a RSAKey obj for RS* and PS* algs";if("ES"==y&&!(t instanceof s))throw"key shall be a ECDSA obj for ES* algs";var b=null;if(void 0===i.jwsalg2sigalg[m.alg])throw"unsupported alg name: "+g;if("none"==(b=i.jwsalg2sigalg[g]))throw"not supported";if("Hmac"==b.substr(0,4)){if(void 0===t)throw"hexadecimal key shall be specified for HMAC";var x=new u({alg:b,pass:t});return x.updateString(f),h==x.doFinal()}if(-1!=b.indexOf("withECDSA")){var S=null;try{S=s.concatSigToASN1Sig(h)}catch(e){return!1}var w=new c({alg:b});return w.init(t),w.updateString(f),w.verify(S)}var w=new c({alg:b});return w.init(t),w.updateString(f),w.verify(h)},d.jws.JWS.parse=function(e){var t,r,n,i=e.split("."),a={};if(2!=i.length&&3!=i.length)throw"malformed sJWS: wrong number of '.' splitted elements";return t=i[0],r=i[1],3==i.length&&(n=i[2]),a.headerObj=d.jws.JWS.readSafeJSONString(p(t)),a.payloadObj=d.jws.JWS.readSafeJSONString(p(r)),a.headerPP=JSON.stringify(a.headerObj,null," "),null==a.payloadObj?a.payloadPP=p(r):a.payloadPP=JSON.stringify(a.payloadObj,null," "),void 0!==n&&(a.sigHex=th(n)),a},d.jws.JWS.verifyJWT=function(e,t,r){var n=d.jws,i=n.JWS,a=i.readSafeJSONString,o=i.inArray,s=i.includedArray;if(!tF(e))return!1;var u=e.split(".");if(3!=u.length)return!1;var c=u[0],l=u[1];th(u[2]);var f=a(p(c)),h=a(p(l));if(void 0===f.alg)return!1;if(void 0===r.alg)throw"acceptField.alg shall be specified";if(!o(f.alg,r.alg)||void 0!==h.iss&&"object"==typeof r.iss&&!o(h.iss,r.iss)||void 0!==h.sub&&"object"==typeof r.sub&&!o(h.sub,r.sub))return!1;if(void 0!==h.aud&&"object"==typeof r.aud){if("string"==typeof h.aud){if(!o(h.aud,r.aud))return!1}else if("object"==typeof h.aud&&!s(h.aud,r.aud))return!1}var m=n.IntDate.getNow();return void 0!==r.verifyAt&&"number"==typeof r.verifyAt&&(m=r.verifyAt),(void 0===r.gracePeriod||"number"!=typeof r.gracePeriod)&&(r.gracePeriod=0),(void 0===h.exp||"number"!=typeof h.exp||!(h.exp+r.gracePeriodi&&this.aHeader.pop(),this.aSignature.length>i&&this.aSignature.pop(),"addSignature failed: "+e}},this.verifyAll=function(e){if(this.aHeader.length!==e.length||this.aSignature.length!==e.length)return!1;for(var t=0;t0)this.aHeader=e.headers;else throw"malformed header";if("string"==typeof e.payload)this.sPayload=e.payload;else throw"malformed signatures";if(e.signatures.length>0)this.aSignature=e.signatures;else throw"malformed signatures"}catch(e){throw"malformed JWS-JS JSON object: "+e}},this.getJSON=function(){return{headers:this.aHeader,payload:this.sPayload,signatures:this.aSignature}},this.isEmpty=function(){return 0==this.aHeader.length?1:0}},d.crypto.ECDSA,d.crypto.DSA,d.crypto.Signature,d.crypto.MessageDigest,d.crypto.Mac,d.crypto.Cipher,t.KZ=tN,t.fs=d,d.crypto,d.asn1,d.jws,d.lang},48094:function(e){var t=Object.prototype.toString;e.exports=function(e){return!0===e||!1===e||!!e&&"object"==typeof e&&"[object Boolean]"==t.call(e)}},98423:function(e,t,r){var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,i="object"==typeof self&&self&&self.Object===Object&&self,a=n||i||Function("return this")(),o=Object.prototype,s=o.hasOwnProperty,u=o.toString,c=a.Symbol,l=c?c.toStringTag:void 0;e.exports=function(e){if(t=typeof e,null==e||"object"!=t&&"function"!=t)return!1;var t,r=null==e?void 0===e?"[object Undefined]":"[object Null]":l&&l in Object(e)?function(e){var t=s.call(e,l),r=e[l];try{e[l]=void 0;var n=!0}catch(e){}var i=u.call(e);return n&&(t?e[l]=r:delete e[l]),i}(e):u.call(e);return"[object Function]"==r||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r}},23126:function(e){var t=Object.prototype.toString;e.exports=function(e){return"number"==typeof e||!!e&&"object"==typeof e&&"[object Number]"==t.call(e)}},25751:function(e){var t=Object.prototype.toString,r=Array.isArray;e.exports=function(e){var n;return"string"==typeof e||!r(e)&&!!(n=e)&&"object"==typeof n&&"[object String]"==t.call(e)}},35683:function(e,t,r){var n,i,a=1/0,o=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,s=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,u="\ud800-\udfff",c="\\u2700-\\u27bf",l="a-z\\xdf-\\xf6\\xf8-\\xff",f="A-Z\\xc0-\\xd6\\xd8-\\xde",d="\\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",h="['’]",p="["+d+"]",m="[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]",g="["+l+"]",y="[^"+u+d+"\\d+"+c+l+f+"]",b="(?:\ud83c[\udde6-\uddff]){2}",x="[\ud800-\udbff][\udc00-\udfff]",S="["+f+"]",w="(?:"+g+"|"+y+")",E="(?:"+h+"(?:d|ll|m|re|s|t|ve))?",A="(?:"+h+"(?:D|LL|M|RE|S|T|VE))?",C="(?:"+m+"|\ud83c[\udffb-\udfff])?",P="[\\ufe0e\\ufe0f]?",O="(?:\\u200d(?:"+["[^"+u+"]",b,x].join("|")+")"+P+C+")*",k="(?:"+["["+c+"]",b,x].join("|")+")"+(P+C+O),_=RegExp(h,"g"),F=RegExp(m,"g"),j=RegExp([S+"?"+g+"+"+E+"(?="+[p,S,"$"].join("|")+")","(?:"+S+"|"+y+")+"+A+"(?="+[p,S+w,"$"].join("|")+")",S+"?"+w+"+"+E,S+"+"+A,"\\d+",k].join("|"),"g"),R=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,I="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,T="object"==typeof self&&self&&self.Object===Object&&self,D=I||T||Function("return this")(),N=(n={À:"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",ſ:"ss"},function(e){return null==n?void 0:n[e]}),M=Object.prototype.toString,L=D.Symbol,B=L?L.prototype:void 0,H=B?B.toString:void 0;function $(e){return null==e?"":function(e){if("string"==typeof e)return e;if("symbol"==typeof(t=e)||t&&"object"==typeof t&&"[object Symbol]"==M.call(t))return H?H.call(e):"";var t,r=e+"";return"0"==r&&1/e==-a?"-0":r}(e)}var U=(i=function(e,t,r){return e+(r?"-":"")+t.toLowerCase()},function(e){var t;return function(e,t,r,n){for(var i=-1,a=e?e.length:0;++ii?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(i);++n1?r[a-1]:void 0,s=a>2?r[2]:void 0;for(o=e.length>3&&"function"==typeof o?(a--,o):void 0,s&&i(r[0],r[1],s)&&(o=a<3?void 0:o,a=1),t=Object(t);++nl))return!1;var d=u.get(e),h=u.get(t);if(d&&h)return d==t&&h==e;var p=-1,m=!0,g=2&r?new n:void 0;for(u.set(e,t),u.set(t,e);++p-1&&e%1==0&&e-1}},54705:function(e,t,r){var n=r(18470);e.exports=function(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}},24785:function(e,t,r){var n=r(1989),i=r(38407),a=r(57071);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(a||i),string:new n}}},11285:function(e,t,r){var n=r(45050);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},96e3:function(e,t,r){var n=r(45050);e.exports=function(e){return n(this,e).get(e)}},49916:function(e,t,r){var n=r(45050);e.exports=function(e){return n(this,e).has(e)}},95265:function(e,t,r){var n=r(45050);e.exports=function(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}},68776:function(e){e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}},42634:function(e){e.exports=function(e,t){return function(r){return null!=r&&r[e]===t&&(void 0!==t||e in Object(r))}}},24523:function(e,t,r){var n=r(88306);e.exports=function(e){var t=n(e,function(e){return 500===r.size&&r.clear(),e}),r=t.cache;return t}},94536:function(e,t,r){var n=r(10852)(Object,"create");e.exports=n},86916:function(e,t,r){var n=r(5569)(Object.keys,Object);e.exports=n},33498:function(e){e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},31167:function(e,t,r){e=r.nmd(e);var n=r(31957),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,o=a&&a.exports===i&&n.process,s=function(){try{var e=a&&a.require&&a.require("util").types;if(e)return e;return o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=s},2333:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5569:function(e){e.exports=function(e,t){return function(r){return e(t(r))}}},45357:function(e,t,r){var n=r(96874),i=Math.max;e.exports=function(e,t,r){return t=i(void 0===t?e.length-1:t,0),function(){for(var a=arguments,o=-1,s=i(a.length-t,0),u=Array(s);++o0){if(++r>=800)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}},37465:function(e,t,r){var n=r(38407);e.exports=function(){this.__data__=new n,this.size=0}},63779:function(e){e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},67599:function(e){e.exports=function(e){return this.__data__.get(e)}},44758:function(e){e.exports=function(e){return this.__data__.has(e)}},34309:function(e,t,r){var n=r(38407),i=r(57071),a=r(83369);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var o=r.__data__;if(!i||o.length<199)return o.push([e,t]),this.size=++r.size,this;r=this.__data__=new a(o)}return r.set(e,t),this.size=r.size,this}},55514:function(e,t,r){var n=r(24523),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g,o=n(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,function(e,r,n,i){t.push(n?i.replace(a,"$1"):r||e)}),t});e.exports=o},40327:function(e,t,r){var n=r(33448),i=1/0;e.exports=function(e){if("string"==typeof e||n(e))return e;var t=e+"";return"0"==t&&1/e==-i?"-0":t}},80346:function(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},75703:function(e){e.exports=function(e){return function(){return e}}},77813:function(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},84486:function(e,t,r){var n=r(77412),i=r(89881),a=r(54290),o=r(1469);e.exports=function(e,t){return(o(e)?n:i)(e,a(t))}},27361:function(e,t,r){var n=r(97786);e.exports=function(e,t,r){var i=null==e?void 0:n(e,t);return void 0===i?r:i}},79095:function(e,t,r){var n=r(13),i=r(222);e.exports=function(e,t){return null!=e&&i(e,t,n)}},6557:function(e){e.exports=function(e){return e}},35694:function(e,t,r){var n=r(9454),i=r(37005),a=Object.prototype,o=a.hasOwnProperty,s=a.propertyIsEnumerable,u=n(function(){return arguments}())?n:function(e){return i(e)&&o.call(e,"callee")&&!s.call(e,"callee")};e.exports=u},1469:function(e){var t=Array.isArray;e.exports=t},98612:function(e,t,r){var n=r(23560),i=r(41780);e.exports=function(e){return null!=e&&i(e.length)&&!n(e)}},29246:function(e,t,r){var n=r(98612),i=r(37005);e.exports=function(e){return i(e)&&n(e)}},51584:function(e,t,r){var n=r(44239),i=r(37005);e.exports=function(e){return!0===e||!1===e||i(e)&&"[object Boolean]"==n(e)}},44144:function(e,t,r){e=r.nmd(e);var n=r(55639),i=r(95062),a=t&&!t.nodeType&&t,o=a&&e&&!e.nodeType&&e,s=o&&o.exports===a?n.Buffer:void 0,u=s?s.isBuffer:void 0;e.exports=u||i},23560:function(e,t,r){var n=r(44239),i=r(13218);e.exports=function(e){if(!i(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},41780:function(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},81763:function(e,t,r){var n=r(44239),i=r(37005);e.exports=function(e){return"number"==typeof e||i(e)&&"[object Number]"==n(e)}},13218:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},37005:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},68630:function(e,t,r){var n=r(44239),i=r(85924),a=r(37005),o=Object.prototype,s=Function.prototype.toString,u=o.hasOwnProperty,c=s.call(Object);e.exports=function(e){if(!a(e)||"[object Object]"!=n(e))return!1;var t=i(e);if(null===t)return!0;var r=u.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&s.call(r)==c}},47037:function(e,t,r){var n=r(44239),i=r(1469),a=r(37005);e.exports=function(e){return"string"==typeof e||!i(e)&&a(e)&&"[object String]"==n(e)}},33448:function(e,t,r){var n=r(44239),i=r(37005);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==n(e)}},36719:function(e,t,r){var n=r(38749),i=r(7518),a=r(31167),o=a&&a.isTypedArray,s=o?i(o):n;e.exports=s},3674:function(e,t,r){var n=r(14636),i=r(280),a=r(98612);e.exports=function(e){return a(e)?n(e):i(e)}},81704:function(e,t,r){var n=r(14636),i=r(10313),a=r(98612);e.exports=function(e){return a(e)?n(e,!0):i(e)}},66604:function(e,t,r){var n=r(89465),i=r(47816),a=r(11243);e.exports=function(e,t){var r={};return t=a(t,3),i(e,function(e,i,a){n(r,i,t(e,i,a))}),r}},88306:function(e,t,r){var n=r(83369);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw TypeError("Expected a function");var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(i.Cache||n),r}i.Cache=n,e.exports=i},82492:function(e,t,r){var n=r(42980),i=r(21463)(function(e,t,r){n(e,t,r)});e.exports=i},35937:function(e,t,r){var n=r(29932),i=r(11243),a=r(63012),o=r(46904);e.exports=function(e,t){if(null==e)return{};var r=n(o(e),function(e){return[e]});return t=i(t),a(e,r,function(e,r){return t(e,r[0])})}},39601:function(e,t,r){var n=r(40371),i=r(79152),a=r(15403),o=r(40327);e.exports=function(e){return a(e)?n(o(e)):i(e)}},54061:function(e,t,r){var n=r(62663),i=r(89881),a=r(11243),o=r(10107),s=r(1469);e.exports=function(e,t,r){var u=s(e)?n:o,c=arguments.length<3;return u(e,a(t,4),r,c,i)}},36968:function(e,t,r){var n=r(10611);e.exports=function(e,t,r){return null==e?e:n(e,t,r)}},70479:function(e){e.exports=function(){return[]}},95062:function(e){e.exports=function(){return!1}},30084:function(e,t,r){var n=r(29932),i=r(278),a=r(1469),o=r(33448),s=r(55514),u=r(40327),c=r(79833);e.exports=function(e){return a(e)?n(e,u):o(e)?[e]:i(s(c(e)))}},59881:function(e,t,r){var n=r(98363),i=r(81704);e.exports=function(e){return n(e,i(e))}},79833:function(e,t,r){var n=r(80531);e.exports=function(e){return null==e?"":n(e)}},63947:function(e,t,r){var n,i;n=r(23126),i={"minor second":16/15,"major second":9/8,"minor third":1.2,"major third":4/3,"diminished fourth":Math.sqrt(2),"perfect fifth":1.5,"minor sixth":1.6,golden:1.61803398875,phi:1.61803398875,"major sixth":5/3,"minor seventh":16/9,"major seventh":15/8,octave:2,"major tenth":2.5,"major eleventh":8/3,"major twelfth":3,"double octave":4},e.exports=function(e,t){return null==e&&(e=0),null==t&&(t="golden"),Math.pow(n(t)?t:null!=i[t]?i[t]:i.golden,e)}},11752:function(e,t,r){e.exports=r(62156)},61165:function(e,t,r){"use strict";var n,i,a,o,s,u=r(50029),c=r(71383),l=r(87794),f=r.n(l),d=r(67294),h=r(69696),p=r(99603),m=r(71893),g=r(42894),y=r(59417),b=r(85330),x=r(35683),S=r.n(x),w=r(85893),E=(0,m.ZP)(h.ZP)(n||(n=(0,c.Z)(["\n display: flex;\n align-items: center;\n text-align: left !important;\n\n & .pg-modal-main {\n max-width: 700px;\n margin: auto;\n box-shadow: 5px 5px 10px black;\n }\n"]))),A=(0,m.ZP)(h.ZP.Header)(i||(i=(0,c.Z)(["\n font-size: 1.5em;\n padding: 0.75em;\n background: #38598a;\n color: #fff;\n & a {\n float: right;\n }\n"]))),C=(0,m.ZP)(p.G)(a||(a=(0,c.Z)(["\n margin-right: 5px;\n height: 30px;\n"]))),P=m.ZP.div(o||(o=(0,c.Z)(["\n color: #000;\n cursor: default;\n font-weight: 400;\n"]))),O=m.ZP.div(s||(s=(0,c.Z)(["\n margin-top: 20px;\n display: flex;\n justify-content: "," & button {\n min-width: 150px;\n margin-right: 20px;\n display: inline-block;\n\n &:disabled {\n cursor: not-allowed;\n }\n }\n"])),function(e){return"center"===e.buttonAlign?"center;":"space-between;"});t.Z=function(e){var t,r,n=e.onConfirm,i=e.onClose,a=e.content,o=e.id,s=e.title,c=e.closable,l=e.icon,m=void 0===l?y.eHv:l,x=e.confirmText,k=e.showCancel,_=void 0===k||k,F=e.showConfirm,j=void 0===F||F,R=e.buttonStyle,I=e.buttonAlign,T=e.skipCloseOnConfirm,D=void 0!==T&&T,N=e.style,M=e.disableConfirm,L=(0,d.useState)(!1),B=L[0],H=L[1],$="bcSecondary",U="bcPrimary",z="confirm-delete-"+S()(s),V="cancel-"+S()(s);switch(void 0===R?"bcgov":R){case"bcgov":break;case"custom":$="secondary",U="primary";break;case"danger":$="secondary",U="danger"}var K=(t=(0,u.Z)(f().mark(function e(){return f().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(H(!0),!n){e.next=4;break}return e.next=4,n();case 4:H(!1),D||(window.location.hash="#");case 6:case"end":return e.stop()}},e)})),function(){return t.apply(this,arguments)}),W=(r=(0,u.Z)(f().mark(function e(){return f().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:i&&i(),window.location.hash="#";case 2:case"end":return e.stop()}},e)})),function(){return r.apply(this,arguments)});return(0,w.jsxs)(E,{id:o,children:[(0,w.jsxs)(A,{title:s,as:"div",children:[m&&(0,w.jsx)(C,{icon:m,title:"Information",size:"2x",style:{paddingRight:"10px"}}),s,c&&(0,w.jsx)(h.ZP.Close,{onClick:W,title:"exit",children:(0,w.jsx)(p.G,{icon:y.NBC,size:"lg"})})]}),(0,w.jsxs)(h.ZP.Content,{style:void 0===N?{}:N,children:[(0,w.jsx)(P,{children:a}),(_||j)&&(0,w.jsxs)(O,{buttonAlign:void 0===I?"default":I,children:[_&&(0,w.jsx)(b.zx,{variant:$,onClick:W,type:"button","data-testid":V,children:"Cancel"}),j&&(0,w.jsx)(b.zx,{"data-testid":z,onClick:K,variant:U,type:"button",className:"text-center",disabled:void 0!==M&&M,children:B?(0,w.jsx)(g.rj,{color:"#FFF",height:18,width:50,wrapperClass:"d-block",visible:B}):void 0===x?"Confirm":x})]})]})]})}},30233:function(e,t,r){"use strict";r.d(t,{V:function(){return j}});var n,i,a,o,s=r(50029),u=r(59499),c=r(71383),l=r(87794),f=r.n(l),d=r(67294),h=r(69696),p=r(99603),m=r(34798),g=r.n(m),y=r(71893),b=r(42894),x=r(59417),S=r(85330),w=r(35683),E=r.n(w),A=r(85893);function C(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function P(e){for(var t=1;t0&&(n=I(r.width)/o||1),a>0&&(i=I(r.height)/a||1)}return{width:r.width/n,height:r.height/i,top:r.top/i,right:r.right/n,bottom:r.bottom/i,left:r.left/n,x:r.left/n,y:r.top/i}}function D(e){var t=T(e),r=e.offsetWidth,n=e.offsetHeight;return 1>=Math.abs(t.width-r)&&(r=t.width),1>=Math.abs(t.height-n)&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function N(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&F(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function M(e){return e?(e.nodeName||"").toLowerCase():null}function L(e){return O(e).getComputedStyle(e)}function B(e){return((k(e)?e.ownerDocument:e.document)||window.document).documentElement}function H(e){return"html"===M(e)?e:e.assignedSlot||e.parentNode||(F(e)?e.host:null)||B(e)}function $(e){return _(e)&&"fixed"!==L(e).position?e.offsetParent:null}function U(e){for(var t=O(e),r=$(e);r&&["table","td","th"].indexOf(M(r))>=0&&"static"===L(r).position;)r=$(r);return r&&("html"===M(r)||"body"===M(r)&&"static"===L(r).position)?t:r||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&_(e)&&"fixed"===L(e).position)return null;var r=H(e);for(F(r)&&(r=r.host);_(r)&&0>["html","body"].indexOf(M(r));){var n=L(r);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||t&&"filter"===n.willChange||t&&n.filter&&"none"!==n.filter)return r;r=r.parentNode}return null}(e)||t}function z(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function V(e,t,r){return j(e,R(t,r))}function K(){return{top:0,right:0,bottom:0,left:0}}function W(e){return Object.assign({},K(),e)}function q(e,t){return t.reduce(function(t,r){return t[r]=e,t},{})}var Z="bottom",G="right",Y="left",J="auto",X=["top",Z,G,Y],Q="start",ee="viewport",et="popper",er=X.reduce(function(e,t){return e.concat([t+"-"+Q,t+"-end"])},[]),en=[].concat(X,[J]).reduce(function(e,t){return e.concat([t,t+"-"+Q,t+"-end"])},[]),ei=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function ea(e){return e.split("-")[1]}var eo={top:"auto",right:"auto",bottom:"auto",left:"auto"};function es(e){var t,r,n,i,a,o,s=e.popper,u=e.popperRect,c=e.placement,l=e.variation,f=e.offsets,d=e.position,h=e.gpuAcceleration,p=e.adaptive,m=e.roundOffsets,g=e.isFixed,y=f.x,b=void 0===y?0:y,x=f.y,S=void 0===x?0:x,w="function"==typeof m?m({x:b,y:S}):{x:b,y:S};b=w.x,S=w.y;var E=f.hasOwnProperty("x"),A=f.hasOwnProperty("y"),C=Y,P="top",k=window;if(p){var _=U(s),F="clientHeight",j="clientWidth";_===O(s)&&"static"!==L(_=B(s)).position&&"absolute"===d&&(F="scrollHeight",j="scrollWidth"),("top"===c||(c===Y||c===G)&&"end"===l)&&(P=Z,S-=(g&&_===k&&k.visualViewport?k.visualViewport.height:_[F])-u.height,S*=h?1:-1),(c===Y||("top"===c||c===Z)&&"end"===l)&&(C=G,b-=(g&&_===k&&k.visualViewport?k.visualViewport.width:_[j])-u.width,b*=h?1:-1)}var R=Object.assign({position:d},p&&eo),T=!0===m?(r=(t={x:b,y:S}).x,n=t.y,{x:I(r*(i=window.devicePixelRatio||1))/i||0,y:I(n*i)/i||0}):{x:b,y:S};return(b=T.x,S=T.y,h)?Object.assign({},R,((o={})[P]=A?"0":"",o[C]=E?"0":"",o.transform=1>=(k.devicePixelRatio||1)?"translate("+b+"px, "+S+"px)":"translate3d("+b+"px, "+S+"px, 0)",o)):Object.assign({},R,((a={})[P]=A?S+"px":"",a[C]=E?b+"px":"",a.transform="",a))}var eu={passive:!0},ec={left:"right",right:"left",bottom:"top",top:"bottom"};function el(e){return e.replace(/left|right|bottom|top/g,function(e){return ec[e]})}var ef={start:"end",end:"start"};function ed(e){return e.replace(/start|end/g,function(e){return ef[e]})}function eh(e){var t=O(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function ep(e){return T(B(e)).left+eh(e).scrollLeft}function em(e){var t=L(e),r=t.overflow,n=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+i+n)}function ev(e,t){void 0===t&&(t=[]);var r,n=function e(t){return["html","body","#document"].indexOf(M(t))>=0?t.ownerDocument.body:_(t)&&em(t)?t:e(H(t))}(e),i=n===(null==(r=e.ownerDocument)?void 0:r.body),a=O(n),o=i?[a].concat(a.visualViewport||[],em(n)?n:[]):n,s=t.concat(o);return i?s:s.concat(ev(H(o)))}function eg(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ey(e,t){var r,n,i,a,o,s,u,c,l,f,d,h,p,m,g,y,b;return t===ee?eg((r=O(e),n=B(e),i=r.visualViewport,a=n.clientWidth,o=n.clientHeight,s=0,u=0,i&&(a=i.width,o=i.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=i.offsetLeft,u=i.offsetTop)),{width:a,height:o,x:s+ep(e),y:u})):k(t)?((c=T(t)).top=c.top+t.clientTop,c.left=c.left+t.clientLeft,c.bottom=c.top+t.clientHeight,c.right=c.left+t.clientWidth,c.width=t.clientWidth,c.height=t.clientHeight,c.x=c.left,c.y=c.top,c):eg((l=B(e),d=B(l),h=eh(l),p=null==(f=l.ownerDocument)?void 0:f.body,m=j(d.scrollWidth,d.clientWidth,p?p.scrollWidth:0,p?p.clientWidth:0),g=j(d.scrollHeight,d.clientHeight,p?p.scrollHeight:0,p?p.clientHeight:0),y=-h.scrollLeft+ep(l),b=-h.scrollTop,"rtl"===L(p||d).direction&&(y+=j(d.clientWidth,p?p.clientWidth:0)-m),{width:m,height:g,x:y,y:b}))}function eb(e){var t,r=e.reference,n=e.element,i=e.placement,a=i?P(i):null,o=i?ea(i):null,s=r.x+r.width/2-n.width/2,u=r.y+r.height/2-n.height/2;switch(a){case"top":t={x:s,y:r.y-n.height};break;case Z:t={x:s,y:r.y+r.height};break;case G:t={x:r.x+r.width,y:u};break;case Y:t={x:r.x-n.width,y:u};break;default:t={x:r.x,y:r.y}}var c=a?z(a):null;if(null!=c){var l="y"===c?"height":"width";switch(o){case Q:t[c]=t[c]-(r[l]/2-n[l]/2);break;case"end":t[c]=t[c]+(r[l]/2-n[l]/2)}}return t}function ex(e,t){void 0===t&&(t={});var r,n,i,a,o,s,u,c=t,l=c.placement,f=void 0===l?e.placement:l,d=c.boundary,h=c.rootBoundary,p=c.elementContext,m=void 0===p?et:p,g=c.altBoundary,y=c.padding,b=void 0===y?0:y,x=W("number"!=typeof b?b:q(b,X)),S=e.rects.popper,w=e.elements[void 0!==g&&g?m===et?"reference":et:m],E=(r=k(w)?w:w.contextElement||B(e.elements.popper),s=(o=[].concat("clippingParents"===(n=void 0===d?"clippingParents":d)?(i=ev(H(r)),k(a=["absolute","fixed"].indexOf(L(r).position)>=0&&_(r)?U(r):r)?i.filter(function(e){return k(e)&&N(e,a)&&"body"!==M(e)}):[]):[].concat(n),[void 0===h?ee:h]))[0],(u=o.reduce(function(e,t){var n=ey(r,t);return e.top=j(n.top,e.top),e.right=R(n.right,e.right),e.bottom=R(n.bottom,e.bottom),e.left=j(n.left,e.left),e},ey(r,s))).width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u),A=T(e.elements.reference),C=eb({reference:A,element:S,strategy:"absolute",placement:f}),P=eg(Object.assign({},S,C)),O=m===et?P:A,F={top:E.top-O.top+x.top,bottom:O.bottom-E.bottom+x.bottom,left:E.left-O.left+x.left,right:O.right-E.right+x.right},I=e.modifiersData.offset;if(m===et&&I){var D=I[f];Object.keys(F).forEach(function(e){var t=[G,Z].indexOf(e)>=0?1:-1,r=["top",Z].indexOf(e)>=0?"y":"x";F[e]+=D[r]*t})}return F}function eS(e,t,r){return void 0===r&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function ew(e){return["top",G,Z,Y].some(function(t){return e[t]>=0})}var eE={placement:"bottom",modifiers:[],strategy:"absolute"};function eA(){for(var e=arguments.length,t=Array(e),r=0;r=0?-1:1,u=(s="function"==typeof a?a(Object.assign({},n,{placement:r})):a)[0],c=s[1],u=u||0,c=(c||0)*o,[Y,G].indexOf(i)>=0?{x:c,y:u}:{x:u,y:c}),e},{}),s=o[t.placement],u=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=c),t.modifiersData[n]=o}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var i=r.mainAxis,a=void 0===i||i,o=r.altAxis,s=void 0===o||o,u=r.fallbackPlacements,c=r.padding,l=r.boundary,f=r.rootBoundary,d=r.altBoundary,h=r.flipVariations,p=void 0===h||h,m=r.allowedAutoPlacements,g=t.options.placement,y=P(g),b=[g].concat(u||(y!==g&&p?function(e){if(P(e)===J)return[];var t=el(e);return[ed(e),t,ed(t)]}(g):[el(g)])).reduce(function(e,r){var n,i,a,o,s,u,d,h,g,y,b,x;return e.concat(P(r)===J?(i=(n={placement:r,boundary:l,rootBoundary:f,padding:c,flipVariations:p,allowedAutoPlacements:m}).placement,a=n.boundary,o=n.rootBoundary,s=n.padding,u=n.flipVariations,h=void 0===(d=n.allowedAutoPlacements)?en:d,0===(b=(y=(g=ea(i))?u?er:er.filter(function(e){return ea(e)===g}):X).filter(function(e){return h.indexOf(e)>=0})).length&&(b=y),Object.keys(x=b.reduce(function(e,r){return e[r]=ex(t,{placement:r,boundary:a,rootBoundary:o,padding:s})[P(r)],e},{})).sort(function(e,t){return x[e]-x[t]})):r)},[]),x=t.rects.reference,S=t.rects.popper,w=new Map,E=!0,A=b[0],C=0;C=0,j=F?"width":"height",R=ex(t,{placement:O,boundary:l,rootBoundary:f,altBoundary:d,padding:c}),I=F?_?G:Y:_?Z:"top";x[j]>S[j]&&(I=el(I));var T=el(I),D=[];if(a&&D.push(R[k]<=0),s&&D.push(R[I]<=0,R[T]<=0),D.every(function(e){return e})){A=O,E=!1;break}w.set(O,D)}if(E)for(var N=p?3:1,M=function(e){var t=b.find(function(t){var r=w.get(t);if(r)return r.slice(0,e).every(function(e){return e})});if(t)return A=t,"break"},L=N;L>0&&"break"!==M(L);L--);t.placement!==A&&(t.modifiersData[n]._skip=!0,t.placement=A,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options,n=e.name,i=r.mainAxis,a=r.altAxis,o=r.boundary,s=r.rootBoundary,u=r.altBoundary,c=r.padding,l=r.tether,f=void 0===l||l,d=r.tetherOffset,h=void 0===d?0:d,p=ex(t,{boundary:o,rootBoundary:s,padding:c,altBoundary:u}),m=P(t.placement),g=ea(t.placement),y=!g,b=z(m),x="x"===b?"y":"x",S=t.modifiersData.popperOffsets,w=t.rects.reference,E=t.rects.popper,A="function"==typeof h?h(Object.assign({},t.rects,{placement:t.placement})):h,C="number"==typeof A?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),O=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,k={x:0,y:0};if(S){if(void 0===i||i){var _,F="y"===b?"top":Y,I="y"===b?Z:G,T="y"===b?"height":"width",N=S[b],M=N+p[F],L=N-p[I],B=f?-E[T]/2:0,H=g===Q?w[T]:E[T],$=g===Q?-E[T]:-w[T],W=t.elements.arrow,q=f&&W?D(W):{width:0,height:0},J=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:K(),X=J[F],ee=J[I],et=V(0,w[T],q[T]),er=y?w[T]/2-B-et-X-C.mainAxis:H-et-X-C.mainAxis,en=y?-w[T]/2+B+et+ee+C.mainAxis:$+et+ee+C.mainAxis,ei=t.elements.arrow&&U(t.elements.arrow),eo=ei?"y"===b?ei.clientTop||0:ei.clientLeft||0:0,es=null!=(_=null==O?void 0:O[b])?_:0,eu=V(f?R(M,N+er-es-eo):M,N,f?j(L,N+en-es):L);S[b]=eu,k[b]=eu-N}if(void 0!==a&&a){var ec,el,ef=S[x],ed="y"===x?"height":"width",eh=ef+p["x"===b?"top":Y],ep=ef-p["x"===b?Z:G],em=-1!==["top",Y].indexOf(m),ev=null!=(ec=null==O?void 0:O[x])?ec:0,eg=em?eh:ef-w[ed]-E[ed]-ev+C.altAxis,ey=em?ef+w[ed]+E[ed]-ev-C.altAxis:ep,eb=f&&em?(el=V(eg,ef,ey))>ey?ey:el:V(f?eg:eh,ef,f?ey:ep);S[x]=eb,k[x]=eb-ef}t.modifiersData[n]=k}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,r,n=e.state,i=e.name,a=e.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,u=P(n.placement),c=z(u),l=[Y,G].indexOf(u)>=0?"height":"width";if(o&&s){var f=W("number"!=typeof(t="function"==typeof(t=a.padding)?t(Object.assign({},n.rects,{placement:n.placement})):t)?t:q(t,X)),d=D(o),h=n.rects.reference[l]+n.rects.reference[c]-s[c]-n.rects.popper[l],p=s[c]-n.rects.reference[c],m=U(o),g=m?"y"===c?m.clientHeight||0:m.clientWidth||0:0,y=f["y"===c?"top":Y],b=g-d[l]-f["y"===c?Z:G],x=g/2-d[l]/2+(h/2-p/2),S=V(y,x,b);n.modifiersData[i]=((r={})[c]=S,r.centerOffset=S-x,r)}},effect:function(e){var t=e.state,r=e.options.element,n=void 0===r?"[data-popper-arrow]":r;null!=n&&("string"!=typeof n||(n=t.elements.popper.querySelector(n)))&&N(t.elements.popper,n)&&(t.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]}]}).defaultModifiers)?[]:i,s=void 0===(o=n.defaultOptions)?eE:o,function(e,t,r){void 0===r&&(r=s);var n,i={placement:"bottom",orderedModifiers:[],options:Object.assign({},eE,s),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},o=[],u=!1,c={state:i,setOptions:function(r){var n,u,f,d,h,p="function"==typeof r?r(i.options):r;l(),i.options=Object.assign({},s,i.options,p),i.scrollParents={reference:k(e)?ev(e):e.contextElement?ev(e.contextElement):[],popper:ev(t)};var m=(u=Object.keys(n=[].concat(a,i.options.modifiers).reduce(function(e,t){var r=e[t.name];return e[t.name]=r?Object.assign({},r,t,{options:Object.assign({},r.options,t.options),data:Object.assign({},r.data,t.data)}):t,e},{})).map(function(e){return n[e]}),f=new Map,d=new Set,h=[],u.forEach(function(e){f.set(e.name,e)}),u.forEach(function(e){d.has(e.name)||function e(t){d.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){if(!d.has(t)){var r=f.get(t);r&&e(r)}}),h.push(t)}(e)}),ei.reduce(function(e,t){return e.concat(h.filter(function(e){return e.phase===t}))},[]));return i.orderedModifiers=m.filter(function(e){return e.enabled}),i.orderedModifiers.forEach(function(e){var t=e.name,r=e.options,n=e.effect;if("function"==typeof n){var a=n({state:i,name:t,instance:c,options:void 0===r?{}:r});o.push(a||function(){})}}),c.update()},forceUpdate:function(){if(!u){var e,t,r,n,a,o,s,l,f,d,h,p,m=i.elements,g=m.reference,y=m.popper;if(eA(g,y)){i.rects={reference:(t=U(y),r="fixed"===i.options.strategy,n=_(t),l=_(t)&&(o=I((a=t.getBoundingClientRect()).width)/t.offsetWidth||1,s=I(a.height)/t.offsetHeight||1,1!==o||1!==s),f=B(t),d=T(g,l),h={scrollLeft:0,scrollTop:0},p={x:0,y:0},(n||!n&&!r)&&(("body"!==M(t)||em(f))&&(h=(e=t)!==O(e)&&_(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:eh(e)),_(t)?(p=T(t,!0),p.x+=t.clientLeft,p.y+=t.clientTop):f&&(p.x=ep(f))),{x:d.left+h.scrollLeft-p.x,y:d.top+h.scrollTop-p.y,width:d.width,height:d.height}),popper:D(y)},i.reset=!1,i.placement=i.options.placement,i.orderedModifiers.forEach(function(e){return i.modifiersData[e.name]=Object.assign({},e.data)});for(var b=0;bvoid 0},ek={name:"ariaDescribedBy",enabled:!0,phase:"afterWrite",effect:({state:e})=>()=>{let{reference:t,popper:r}=e.elements;if("removeAttribute"in t){let e=(t.getAttribute("aria-describedby")||"").split(",").filter(e=>e.trim()!==r.id);e.length?t.setAttribute("aria-describedby",e.join(",")):t.removeAttribute("aria-describedby")}},fn:({state:e})=>{var t;let{popper:r,reference:n}=e.elements,i=null==(t=r.getAttribute("role"))?void 0:t.toLowerCase();if(r.id&&"tooltip"===i&&"setAttribute"in n){let e=n.getAttribute("aria-describedby");if(e&&-1!==e.split(",").indexOf(r.id))return;n.setAttribute("aria-describedby",e?`${e},${r.id}`:r.id)}}},e_=[];var eF=function(e,t,r={}){let{enabled:n=!0,placement:i="bottom",strategy:a="absolute",modifiers:o=e_}=r,s=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n=0||(i[r]=e[r]);return i}(r,eP),u=(0,l.useRef)(o),c=(0,l.useRef)(),f=(0,l.useCallback)(()=>{var e;null==(e=c.current)||e.update()},[]),d=(0,l.useCallback)(()=>{var e;null==(e=c.current)||e.forceUpdate()},[]),[h,p]=C((0,l.useState)({placement:i,update:f,forceUpdate:d,attributes:{},styles:{popper:{},arrow:{}}})),m=(0,l.useMemo)(()=>({name:"updateStateModifier",enabled:!0,phase:"write",requires:["computeStyles"],fn:({state:e})=>{let t={},r={};Object.keys(e.elements).forEach(n=>{t[n]=e.styles[n],r[n]=e.attributes[n]}),p({state:e,styles:t,attributes:r,update:f,forceUpdate:d,placement:e.placement})}}),[f,d,p]),g=(0,l.useMemo)(()=>(A(u.current,o)||(u.current=o),u.current),[o]);return(0,l.useEffect)(()=>{c.current&&n&&c.current.setOptions({placement:i,strategy:a,modifiers:[...g,m,eO]})},[a,i,m,n,g]),(0,l.useEffect)(()=>{if(n&&null!=e&&null!=t)return c.current=eC(e,t,Object.assign({},s,{placement:i,strategy:a,modifiers:[...g,ek,m]})),()=>{null!=c.current&&(c.current.destroy(),c.current=void 0,p(e=>Object.assign({},e,{attributes:{},styles:{popper:{}}})))}},[n,e,t]),h},ej=!!("undefined"!=typeof window&&window.document&&window.document.createElement),eR=!1,eI=!1;try{var eT={get passive(){return eR=!0},get once(){return eI=eR=!0}};ej&&(window.addEventListener("test",eT,eT),window.removeEventListener("test",eT,!0))}catch(e){}var eD=function(e,t,r,n){if(n&&"boolean"!=typeof n&&!eI){var i=n.once,a=n.capture,o=r;!eI&&i&&(o=r.__once||function e(n){this.removeEventListener(t,e,a),r.call(this,n)},r.__once=o),e.addEventListener(t,o,eR?n:a)}e.addEventListener(t,r,n)},eN=function(e,t,r,n){var i=n&&"boolean"!=typeof n?n.capture:n;e.removeEventListener(t,r,i),r.__once&&e.removeEventListener(t,r.__once,i)},eM=function(e,t,r,n){return eD(e,t,r,n),function(){eN(e,t,r,n)}};function eL(e){return e&&e.ownerDocument||document}var eB=r(78146);let eH=()=>{},e$=e=>e&&("current"in e?e.current:e),eU={click:"mousedown",mouseup:"mousedown",pointerup:"pointerdown"};var ez=function(e,t=eH,{disabled:r,clickTrigger:n="click"}={}){let i=(0,l.useRef)(!1),a=(0,l.useRef)(!1),o=(0,l.useCallback)(t=>{let r=e$(e);p()(!!r,"ClickOutside captured a close event but does not have a ref to compare it to. useClickOutside(), should be passed a ref that resolves to a DOM node"),i.current=!r||!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)||0!==t.button||!!f(r,t.target)||a.current,a.current=!1},[e]),s=(0,eB.Z)(t=>{let r=e$(e);r&&f(r,t.target)&&(a.current=!0)}),u=(0,eB.Z)(e=>{i.current||t(e)});(0,l.useEffect)(()=>{if(r||null==e)return;let t=eL(e$(e)),i=(t.defaultView||window).event,a=null;eU[n]&&(a=eM(t,eU[n],s,!0));let c=eM(t,n,o,!0),l=eM(t,n,e=>{if(e===i){i=void 0;return}u(e)}),f=[];return"ontouchstart"in t.documentElement&&(f=[].slice.call(t.body.children).map(e=>eM(e,"mousemove",eH))),()=>{null==a||a(),c(),l(),f.forEach(e=>e())}},[e,r,n,o,s,u])};let eV=()=>{};var eK=function(e,t,{disabled:r,clickTrigger:n}={}){let i=t||eV;ez(e,i,{disabled:r,clickTrigger:n});let a=(0,eB.Z)(e=>{27===e.keyCode&&i(e)});(0,l.useEffect)(()=>{if(r||null==e)return;let t=eL(e$(e)),n=(t.defaultView||window).event,i=eM(t,"keyup",e=>{if(e===n){n=void 0;return}a(e)});return()=>{i()}},[e,r,a])};let eW=(0,l.createContext)(ej?window:void 0);eW.Provider;let eq=(e,t)=>ej?null==e?(t||eL()).body:("function"==typeof e&&(e=e()),e&&"current"in e&&(e=e.current),e&&("nodeType"in e||e.getBoundingClientRect))?e:null:null;function eZ(e,t){let r=(0,l.useContext)(eW),[n,i]=(0,l.useState)(()=>eq(e,null==r?void 0:r.document));if(!n){let t=eq(e);t&&i(t)}return(0,l.useEffect)(()=>{t&&n&&t(n)},[t,n]),(0,l.useEffect)(()=>{let t=eq(e);t!==n&&i(t)},[e,n]),n}var eG=r(85893);let eY=l.forwardRef((e,t)=>{let{flip:r,offset:n,placement:i,containerPadding:a,popperConfig:o={},transition:s}=e,[u,c]=(0,S.Z)(),[f,d]=(0,S.Z)(),h=g(c,t),p=eZ(e.container),m=eZ(e.target),[y,b]=(0,l.useState)(!e.show),w=eF(m,u,function({enabled:e,enableEvents:t,placement:r,flip:n,offset:i,fixed:a,containerPadding:o,arrowElement:s,popperConfig:u={}}){var c,l,f,d;let h=function(e){let t={};return Array.isArray(e)?(null==e||e.forEach(e=>{t[e.name]=e}),t):e||t}(u.modifiers);return Object.assign({},u,{placement:r,enabled:e,strategy:a?"fixed":u.strategy,modifiers:function(e={}){return Array.isArray(e)?e:Object.keys(e).map(t=>(e[t].name=t,e[t]))}(Object.assign({},h,{eventListeners:{enabled:t},preventOverflow:Object.assign({},h.preventOverflow,{options:o?Object.assign({padding:o},null==(c=h.preventOverflow)?void 0:c.options):null==(l=h.preventOverflow)?void 0:l.options}),offset:{options:Object.assign({offset:i},null==(f=h.offset)?void 0:f.options)},arrow:Object.assign({},h.arrow,{enabled:!!s,options:Object.assign({},null==(d=h.arrow)?void 0:d.options,{element:s})}),flip:Object.assign({enabled:!!n},h.flip)}))})}({placement:i,enableEvents:!!e.show,containerPadding:a||5,flip:r,offset:n,arrowElement:f,popperConfig:o}));e.show?y&&b(!1):e.transition||y||b(!0);let E=(...t)=>{b(!0),e.onExited&&e.onExited(...t)},A=e.show||s&&!y;if(eK(u,e.onHide,{disabled:!e.rootClose||e.rootCloseDisabled,clickTrigger:e.rootCloseEvent}),!A)return null;let C=e.children(Object.assign({},w.attributes.popper,{style:w.styles.popper,ref:h}),{popper:w,placement:i,show:!!e.show,arrowProps:Object.assign({},w.attributes.arrow,{style:w.styles.arrow,ref:d})});if(s){let{onExit:t,onExiting:r,onEnter:n,onEntering:i,onEntered:a}=e;C=(0,eG.jsx)(s,{in:e.show,appear:!0,onExit:t,onExiting:r,onExited:E,onEnter:n,onEntering:i,onEntered:a,children:C})}return p?x.createPortal(C,p):null});eY.displayName="Overlay";var eJ=r(99585),eX=r(76792),eQ=/-(.)/g;let e0=e=>e[0].toUpperCase()+e.replace(eQ,function(e,t){return t.toUpperCase()}).slice(1);function e1(e,{displayName:t=e0(e),Component:r,defaultProps:n}={}){let i=l.forwardRef(({className:t,bsPrefix:n,as:i=r||"div",...a},o)=>{let s=(0,eX.vE)(n,e);return(0,eG.jsx)(i,{ref:o,className:b()(t,s),...a})});return i.defaultProps=n,i.displayName=t,i}var e2=e1("popover-header"),e4=e1("popover-body");let e3=l.forwardRef(({bsPrefix:e,placement:t,className:r,style:n,children:i,body:a,arrowProps:o,popper:s,show:u,...c},l)=>{let f;let d=(0,eX.vE)(e,"popover"),h=(0,eX.SC)(),[p]=(null==t?void 0:t.split("-"))||[],m=(f=p,"left"===p?f=h?"end":"start":"right"===p&&(f=h?"start":"end"),f);return(0,eG.jsxs)("div",{ref:l,role:"tooltip",style:n,"x-placement":p,className:b()(r,d,p&&`bs-popover-${m}`),...c,children:[(0,eG.jsx)("div",{className:"popover-arrow",...o}),a?(0,eG.jsx)(e4,{children:i}):i]})});e3.defaultProps={placement:"right"};var e6=Object.assign(e3,{Header:e2,Body:e4,POPPER_OFFSET:[0,8]});function e5(e,t){return(e5=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var e8={disabled:!1},e9=l.createContext(null),e7="unmounted",te="exited",tt="entering",tr="entered",tn="exiting",ti=function(e){function t(t,r){n=e.call(this,t,r)||this;var n,i,a=r&&!r.isMounting?t.enter:t.appear;return n.appearStatus=null,t.in?a?(i=te,n.appearStatus=tt):i=tr:i=t.unmountOnExit||t.mountOnEnter?e7:te,n.state={status:i},n.nextCallback=null,n}(r=t).prototype=Object.create(e.prototype),r.prototype.constructor=r,e5(r,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===e7?{status:te}:null};var r,n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var r=this.state.status;this.props.in?r!==tt&&r!==tr&&(t=tt):(r===tt||r===tr)&&(t=tn)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,r,n=this.props.timeout;return e=t=r=n,null!=n&&"number"!=typeof n&&(e=n.exit,t=n.enter,r=void 0!==n.appear?n.appear:t),{exit:e,enter:t,appear:r}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t){if(this.cancelNextCallback(),t===tt){if(this.props.unmountOnExit||this.props.mountOnEnter){var r=this.props.nodeRef?this.props.nodeRef.current:x.findDOMNode(this);r&&r.scrollTop}this.performEnter(e)}else this.performExit()}else this.props.unmountOnExit&&this.state.status===te&&this.setState({status:e7})},n.performEnter=function(e){var t=this,r=this.props.enter,n=this.context?this.context.isMounting:e,i=this.props.nodeRef?[n]:[x.findDOMNode(this),n],a=i[0],o=i[1],s=this.getTimeouts(),u=n?s.appear:s.enter;if(!e&&!r||e8.disabled){this.safeSetState({status:tr},function(){t.props.onEntered(a)});return}this.props.onEnter(a,o),this.safeSetState({status:tt},function(){t.props.onEntering(a,o),t.onTransitionEnd(u,function(){t.safeSetState({status:tr},function(){t.props.onEntered(a,o)})})})},n.performExit=function(){var e=this,t=this.props.exit,r=this.getTimeouts(),n=this.props.nodeRef?void 0:x.findDOMNode(this);if(!t||e8.disabled){this.safeSetState({status:te},function(){e.props.onExited(n)});return}this.props.onExit(n),this.safeSetState({status:tn},function(){e.props.onExiting(n),e.onTransitionEnd(r.exit,function(){e.safeSetState({status:te},function(){e.props.onExited(n)})})})},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,r=!0;return this.nextCallback=function(n){r&&(r=!1,t.nextCallback=null,e(n))},this.nextCallback.cancel=function(){r=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var r=this.props.nodeRef?this.props.nodeRef.current:x.findDOMNode(this),n=null==e&&!this.props.addEndListener;if(!r||n){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[r,this.nextCallback],a=i[0],o=i[1];this.props.addEndListener(a,o)}null!=e&&setTimeout(this.nextCallback,e)},n.render=function(){var e=this.state.status;if(e===e7)return null;var t=this.props,r=t.children,n=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n=0||(i[r]=e[r]);return i}(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return l.createElement(e9.Provider,{value:null},"function"==typeof r?r(e,n):l.cloneElement(l.Children.only(r),n))},t}(l.Component);function ta(){}ti.contextType=e9,ti.propTypes={},ti.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:ta,onEntering:ta,onEntered:ta,onExit:ta,onExiting:ta,onExited:ta},ti.UNMOUNTED=e7,ti.EXITED=te,ti.ENTERING=tt,ti.ENTERED=tr,ti.EXITING=tn;var to=/([A-Z])/g,ts=/^ms-/;function tu(e){return e.replace(to,"-$1").toLowerCase().replace(ts,"-ms-")}var tc=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i,tl=function(e,t){var r,n="",i="";if("string"==typeof t)return e.style.getPropertyValue(tu(t))||((r=eL(e))&&r.defaultView||window).getComputedStyle(e,void 0).getPropertyValue(tu(t));Object.keys(t).forEach(function(r){var a=t[r];a||0===a?r&&tc.test(r)?i+=r+"("+a+") ":n+=tu(r)+": "+a+";":e.style.removeProperty(tu(r))}),i&&(n+="transform: "+i+";"),e.style.cssText+=";"+n};function tf(e,t){let r=tl(e,t)||"",n=-1===r.indexOf("ms")?1e3:1;return parseFloat(r)*n}function td(e,t){var r,n,i,a,o,s,u,c,l,f,d,h;let p=tf(e,"transitionDuration"),m=tf(e,"transitionDelay"),g=(r=e,n=r=>{r.target===e&&(g(),t(r))},null==(i=p+m)&&(s=-1===(o=tl(r,"transitionDuration")||"").indexOf("ms")?1e3:1,i=parseFloat(o)*s||0),d=(c=!1,l=setTimeout(function(){c||function(e,t,r,n){if(void 0===r&&(r=!1),void 0===n&&(n=!0),e){var i=document.createEvent("HTMLEvents");i.initEvent(t,r,n),e.dispatchEvent(i)}}(r,"transitionend",!0)},i+5),f=eM(r,"transitionend",function(){c=!0},{once:!0}),function(){clearTimeout(l),f()}),h=eM(r,"transitionend",n),function(){d(),h()})}function th(e){return e&&"setState"in e?x.findDOMNode(e):null!=e?e:null}let tp=l.forwardRef(({onEnter:e,onEntering:t,onEntered:r,onExit:n,onExiting:i,onExited:a,addEndListener:o,children:s,childRef:u,...c},f)=>{let d=(0,l.useRef)(null),h=g(d,u),p=e=>{h(th(e))},m=e=>t=>{e&&d.current&&e(d.current,t)},y=(0,l.useCallback)(m(e),[e]),b=(0,l.useCallback)(m(t),[t]),x=(0,l.useCallback)(m(r),[r]),S=(0,l.useCallback)(m(n),[n]),w=(0,l.useCallback)(m(i),[i]),E=(0,l.useCallback)(m(a),[a]),A=(0,l.useCallback)(m(o),[o]);return(0,eG.jsx)(ti,{ref:f,...c,onEnter:y,onEntered:x,onEntering:b,onExit:S,onExited:E,onExiting:w,addEndListener:A,nodeRef:d,children:"function"==typeof s?(e,t)=>s(e,{...t,ref:p}):l.cloneElement(s,{ref:p})})}),tm={[tt]:"show",[tr]:"show"},tv=l.forwardRef(({className:e,children:t,transitionClasses:r={},...n},i)=>{let a=(0,l.useCallback)((e,t)=>{e.offsetHeight,null==n.onEnter||n.onEnter(e,t)},[n]);return(0,eG.jsx)(tp,{ref:i,addEndListener:td,...n,onEnter:a,childRef:t.ref,children:(n,i)=>l.cloneElement(t,{...i,className:b()("fade",e,t.props.className,tm[n],r[n])})})});tv.defaultProps={in:!1,timeout:300,mountOnEnter:!1,unmountOnExit:!1,appear:!1},tv.displayName="Fade";let tg=l.forwardRef(({children:e,transition:t,popperConfig:r={},...n},i)=>{let a=(0,l.useRef)({}),[o,s]=(0,S.Z)(),[u,c]=function(e){let t=(0,l.useRef)(null),r=(0,eX.vE)(void 0,"popover"),n=(0,l.useMemo)(()=>({name:"offset",options:{offset:()=>{var n;return t.current&&((n=t.current).classList?!!r&&n.classList.contains(r):-1!==(" "+(n.className.baseVal||n.className)+" ").indexOf(" "+r+" "))?e||e6.POPPER_OFFSET:e||[0,0]}}}),[e,r]);return[t,[n]]}(n.offset),f=g(i,u),d=!0===t?tv:t||void 0,h=(0,eB.Z)(e=>{s(e),null==r||null==r.onFirstUpdate||r.onFirstUpdate(e)});return(0,eJ.Z)(()=>{o&&(null==a.current.scheduleUpdate||a.current.scheduleUpdate())},[o]),(0,eG.jsx)(eY,{...n,ref:f,popperConfig:{...r,modifiers:c.concat(r.modifiers||[]),onFirstUpdate:h},transition:d,children:(r,{arrowProps:n,popper:i,show:o})=>{var s,u;!function(e,t){let{ref:r}=e,{ref:n}=t;e.ref=r.__wrapped||(r.__wrapped=e=>r(th(e))),t.ref=n.__wrapped||(n.__wrapped=e=>n(th(e)))}(r,n);let c=null==i?void 0:i.placement,f=Object.assign(a.current,{state:null==i?void 0:i.state,scheduleUpdate:null==i?void 0:i.update,placement:c,outOfBoundaries:(null==i?void 0:null==(s=i.state)?void 0:null==(u=s.modifiersData.hide)?void 0:u.isReferenceHidden)||!1});return"function"==typeof e?e({...r,placement:c,show:o,...!t&&o&&{className:"show"},popper:f,arrowProps:n}):l.cloneElement(e,{...r,placement:c,arrowProps:n,popper:f,className:b()(e.props.className,!t&&o&&"show"),style:{...e.props.style,...r.style}})}})});function ty(e,t,r){let[n]=t,i=n.currentTarget,a=n.relatedTarget||n.nativeEvent[r];a&&a===i||f(i,a)||e(...t)}function tb({trigger:e,overlay:t,children:r,popperConfig:n={},show:i,defaultShow:a=!1,onToggle:o,delay:s,placement:u,flip:c=u&&-1!==u.indexOf("auto"),...f}){var h,p,m,y,b,x,S,w,E,A;let C=(0,l.useRef)(null),P=g(C,r.ref),O=(E=(0,d.Z)(),A=(0,l.useRef)(),S=function(){return clearTimeout(A.current)},(w=(0,l.useRef)(S)).current=S,(0,l.useEffect)(function(){return function(){return w.current()}},[]),(0,l.useMemo)(function(){var e=function(){return clearTimeout(A.current)};return{set:function(t,r){void 0===r&&(r=0),E()&&(e(),r<=2147483647?A.current=setTimeout(t,r):function e(t,r,n){var i=n-Date.now();t.current=i<=2147483647?setTimeout(r,i):setTimeout(function(){return e(t,r,n)},2147483647)}(A,t,Date.now()+r))},clear:e}},[])),k=(0,l.useRef)(""),[_,F]=(h=(0,l.useRef)(void 0!==i),m=(p=(0,l.useState)(a))[0],y=p[1],b=void 0!==i,x=h.current,h.current=b,!b&&x&&m!==a&&y(a),[b?i:m,(0,l.useCallback)(function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n{P(th(e))},N=(0,l.useCallback)(()=>{if(O.clear(),k.current="show",!j.show){F(!0);return}O.set(()=>{"show"===k.current&&F(!0)},j.show)},[j.show,F,O]),M=(0,l.useCallback)(()=>{if(O.clear(),k.current="hide",!j.hide){F(!1);return}O.set(()=>{"hide"===k.current&&F(!1)},j.hide)},[j.hide,F,O]),L=(0,l.useCallback)((...e)=>{N(),null==R||R(...e)},[N,R]),B=(0,l.useCallback)((...e)=>{M(),null==I||I(...e)},[M,I]),H=(0,l.useCallback)((...e)=>{F(!_),null==T||T(...e)},[T,F,_]),$=(0,l.useCallback)((...e)=>{ty(N,e,"fromElement")},[N]),U=(0,l.useCallback)((...e)=>{ty(M,e,"toElement")},[M]),z=null==e?[]:[].concat(e),V={ref:D};return -1!==z.indexOf("click")&&(V.onClick=H),-1!==z.indexOf("focus")&&(V.onFocus=L,V.onBlur=B),-1!==z.indexOf("hover")&&(V.onMouseOver=$,V.onMouseOut=U),(0,eG.jsxs)(eG.Fragment,{children:["function"==typeof r?r(V):(0,l.cloneElement)(r,V),(0,eG.jsx)(tg,{...f,show:_,onHide:M,flip:c,placement:u,popperConfig:n,target:C.current,children:t})]})}tg.displayName="Overlay",tg.defaultProps={transition:tv,rootClose:!1,show:!1,placement:"top"},tb.defaultProps={defaultShow:!1,trigger:["hover","focus"]};var tx=r(71893),tS=r(34798),tw=r.n(tS),tE=r(99603),tA=r(59417),tC=r(63055);function tP(e){var t=e.title,r=e.content,n=e.show,i=e.hide,a=e.icon,o=void 0===a?tA.sqG:a,s=e.onClick,u=void 0===s?tw():s,c=e.trigger,l=e.style,f=e.children,d=(0,eG.jsxs)(e6,{id:"popover-basic",style:l,children:[t&&(0,eG.jsx)(e2,{children:t}),r&&(0,eG.jsx)(e4,{dangerouslySetInnerHTML:{__html:r}})]});return(0,eG.jsx)(tb,{trigger:void 0===c?["hover","focus","click"]:c,placement:"right-start",overlay:d,delay:{show:void 0===n?150:n,hide:void 0===i?250:i},children:(0,eG.jsx)("span",{children:f||(0,eG.jsx)(tE.G,{color:"#777777",icon:o,onClick:u})})})}(0,tx.ZP)(e6)(u||(u=(0,c.Z)(["\n font-size: "," !important;\n font-family: "," !important;\n"])),tC.n5,tC.rk)},31637:function(e,t,r){"use strict";var n,i=r(71383),a=r(42894),o=r(71893),s=r(63055),u=r(85893),c=o.ZP.div(n||(n=(0,i.Z)(["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n margin-top: ",";\n\n & p {\n margin-top: 10px;\n }\n"])),s.SI);t.Z=function(){return(0,u.jsxs)(c,{children:[(0,u.jsx)(a.rj,{color:"#000",height:45,width:45,visible:!0}),(0,u.jsx)("p",{children:"Loading information..."})]})}},59912:function(e,t,r){"use strict";r.d(t,{I:function(){return o}});var n,i=r(71383),a=r(71893),o=[{maxWidth:767,marginTop:10},{maxWidth:991,width:723,marginTop:20},{maxWidth:1199,width:933,marginTop:50},{width:1127,marginTop:80}],s=function(e,t,r,n){if("left"===e)return"\n margin-right: auto !important;\n ";if("right"===e)return"\n margin-left: auto !important;\n ";if("center"===e)return"\n margin-left: auto !important;\n margin-right: auto !important;\n ";var i="";return t&&(i+="margin-left: ".concat(t).concat(n," !important;")),r&&(i+="margin-right: ".concat(r).concat(n," !important;")),i},u=a.ZP.div(n||(n=(0,i.Z)(["\n display: block;\n max-width: 100% !important;\n\n ","\n"])),function(e){return e.rules.map(function(t,r){return 0===r?"@media only screen and (max-width: ".concat(t.maxWidth,"px) {\n & {\n ").concat(t.marginTop&&"margin-top: ".concat(t.marginTop,"px;"),"\n width: auto !important;\n ").concat(s(t.horizontalAlign||"none",1,1,"em"),"\n }\n }"):r===e.rules.length-1?"@media only screen and (min-width: ".concat((e.rules[r-1].maxWidth||0)+1,"px) {\n & {\n ").concat(t.marginTop&&"margin-top: ".concat(t.marginTop,"px;"),"\n width: ").concat(t.width,"px;\n ").concat(s(t.horizontalAlign||"center",t.marginLeft,t.marginRight,t.marginUnit),"\n }\n }"):"@media only screen and (min-width: ".concat((e.rules[r-1].maxWidth||0)+1,"px) and (max-width: ").concat(t.maxWidth,"px) {\n & {\n ").concat(t.marginTop&&"margin-top: ".concat(t.marginTop,"px;"),"\n width: ").concat(t.width,"px;\n ").concat(s(t.horizontalAlign||"center",t.marginLeft,t.marginRight,t.marginUnit),"\n }\n }")})});t.Z=u},19287:function(e,t,r){"use strict";var n,i=r(71383),a=r(71893);t.Z=a.ZP.div(n||(n=(0,i.Z)(["\n width: 100%;\n\n & .pg-notification-close {\n padding: 0 0.5rem;\n }\n"])))},99154:function(e,t,r){"use strict";r.d(t,{DK:function(){return h},Es:function(){return c},JK:function(){return s},Jx:function(){return p},Qf:function(){return d},S3:function(){return g},TW:function(){return l},YC:function(){return f},dV:function(){return m},ne:function(){return u},rp:function(){return o},uA:function(){return n}});var n=function(e){return"bceidboth"===e},i=function(e){return"digitalcredential"===e},a=function(e){return["idir","azureidir"].includes(e)},o=function(e){return e.startsWith("bceid")},s=function(e){return!o(e)},u=function(e){return["bceidbasic","bceidbusiness"].includes(e)},c=function(e){return a(e)||"bceidboth"!==e},l=function(e){return a(e)||!u(e)},f=function(e){return["githubpublic","githubbcgov"].includes(e)},d=function(e){return!f(e)},h=function(e){return!i(e)},p=function(e){if(!e)return!1;var t=e.devIdps;return(void 0===t?[]:t).some(o)},m=function(e){if(!e)return!1;var t=e.devIdps;return(void 0===t?[]:t).some(f)},g=function(e){if(!e)return!1;var t=e.devIdps;return(void 0===t?[]:t).some(i)}},15812:function(e,t,r){"use strict";r.d(t,{bD:function(){return x},ZP:function(){return b},hU:function(){return S}});var n,i=r(59499),a=r(67294),o=r(48094),s=r.n(o),u=r(85330),c=r(85893),l=function(e){var t=e.children,r=e.variant,n=e.size,i=e.closable,o=e.content,s=e.fadeOut,l=(0,a.useState)(!1),f=l[0],d=l[1];return((0,a.useEffect)(function(){var e=s?setTimeout(function(){d(!0)},s):null;return function(){e&&clearTimeout(e)}},[]),f)?null:(0,c.jsx)(u.bZ,{variant:r,size:n,closable:i,content:o,children:t})},f=r(19287),d=r(71383),h=r(71893).ZP.div(n||(n=(0,d.Z)(["\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n z-index: 2000;\n"])));function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function m(e){for(var t=1;t0;t&&r&&t(r)})},e),elements:i},u.push(r),s.set(r,t),t}({root:null==t?void 0:t.current,rootMargin:r})).id,i=e.observer,(l=e.elements).set(p,function(e){return e&&d(e)}),i.observe(p),function(){if(l.delete(p),i.unobserve(p),0===l.size){i.disconnect(),s.delete(n);var e=u.findIndex(function(e){return e.root===n.root&&e.margin===n.margin});e>-1&&u.splice(e,1)}}}}else if(!f){var m=a.requestIdleCallback(function(){return d(!0)});return function(){return a.cancelIdleCallback(m)}}},[c,r,t,f,h.current]),[p,f,i.useCallback(function(){d(!1)},[])]};var i=r(67294),a=r(98065),o="function"==typeof IntersectionObserver,s=new Map,u=[];("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},17285:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AmpStateContext=void 0;var n=(0,r(92648).Z)(r(67294)).default.createContext({});t.AmpStateContext=n},80354:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isInAmpMode=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.ampFirst,r=e.hybrid,n=e.hasQuery;return void 0!==t&&t||void 0!==r&&r&&void 0!==n&&n}},16505:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultHead=l,t.default=void 0;var n=r(6495).Z,i=r(92648).Z,a=(0,r(91598).Z)(r(67294)),o=i(r(70148)),s=r(17285),u=r(60523),c=r(80354);function l(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=[a.default.createElement("meta",{charSet:"utf-8"})];return e||t.push(a.default.createElement("meta",{name:"viewport",content:"width=device-width"})),t}function f(e,t){return"string"==typeof t||"number"==typeof t?e:t.type===a.default.Fragment?e.concat(a.default.Children.toArray(t.props.children).reduce(function(e,t){return"string"==typeof t||"number"==typeof t?e:e.concat(t)},[])):e.concat(t)}r(92783);var d=["name","httpEquiv","charSet","itemProp"];function h(e,t){var r,i,o,s,u=t.inAmpMode;return e.reduce(f,[]).reverse().concat(l(u).reverse()).filter((r=new Set,i=new Set,o=new Set,s={},function(e){var t=!0,n=!1;if(e.key&&"number"!=typeof e.key&&e.key.indexOf("$")>0){n=!0;var a=e.key.slice(e.key.indexOf("$")+1);r.has(a)?t=!1:r.add(a)}switch(e.type){case"title":case"base":i.has(e.type)?t=!1:i.add(e.type);break;case"meta":for(var u=0,c=d.length;u0&&!eb().isEmail(f))){e.next=3;break}return s("Please provide a valid email address"),e.abrupt("return");case 3:return e.next=5,(0,B.ck)({additionalEmail:f});case 5:t=e.sent,n=(r=(0,P.Z)(t,2))[0],(a=r[1])?(console.error(a),p(a)):n&&i.show({variant:"success",fadeOut:2500,closable:!0,content:"Your additional email has successfully been updated"}),window.location.hash="#";case 11:case"end":return e.stop()}},e)})),function(){return r.apply(this,arguments)}),y="".concat(null==c?void 0:c.given_name," ").concat(null==c?void 0:c.family_name),b=(0,et.jsxs)(ex,{children:[(0,et.jsx)(em.default,{label:"Name",fullWidth:!0,value:y,disabled:!0}),(0,et.jsx)("br",{}),(0,et.jsx)(em.default,{label:"Default Email",fullWidth:!0,value:null==c?void 0:c.email,disabled:!0}),(0,et.jsx)("br",{}),(0,et.jsxs)("div",{children:[(0,et.jsx)("span",{className:"strong",children:"Additional Email"})," \xa0",(0,et.jsx)(eg.Z,{title:"",content:"You can add a work email address in addition to your @gov.bc.ca to keep you informed of your integration progress. Note IDIR login/authentication is required to access the CSS App.",hide:200})]}),(0,et.jsx)(em.default,{"data-testid":"addi-email",type:"email",fullWidth:!0,maxLength:"100",value:f,onChange:function(e){eb().isEmail(e.target.value)&&s(""),d(e.target.value)}}),o&&(0,et.jsx)(eS,{children:o})]});return(0,et.jsxs)(et.Fragment,{children:[n(h,function(){return window.location.hash=h}),(0,et.jsx)(ev.Z,{id:h,content:b,onConfirm:g,icon:K.m08,title:"My Profile",confirmText:"Save",skipCloseOnConfirm:!0,closable:!0})]})}),eE=r(85330),eA=Z.ZP.div(d||(d=(0,$.Z)(["\n font-size: 1.2rem;\n display: flex;\n\n & > div:first-child {\n color: red;\n font-size: 2rem;\n width: 120px;\n }\n\n & > div:nth-child(2) {\n & > p:first-child {\n color: red;\n font-weight: bold;\n }\n }\n"]))),eC="gold-notification",eP=function(){var e,t,r=(0,j.useContext)(tA)||{},n=r.user,i=r.session,a=(e=(0,k.Z)(F().mark(function e(){var t;return F().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(!i||!n)){e.next=2;break}return e.abrupt("return");case 2:!i.isAdmin&&!n.hasReadGoldNotification&&null!==(t=n.integrations)&&void 0!==t&&t.find(function(e){return"gold"!==e.serviceType})&&(window.location.hash=eC);case 3:case"end":return e.stop()}},e)})),function(){return e.apply(this,arguments)});(0,j.useEffect)(function(){i&&n&&a()},[n]);var o=(t=(0,k.Z)(F().mark(function e(){return F().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,B.ck)({hasReadGoldNotification:!0});case 2:window.location.hash="#";case 3:case"end":return e.stop()}},e)})),function(){return t.apply(this,arguments)}),s=(0,et.jsxs)(et.Fragment,{children:[(0,et.jsxs)(eA,{children:[(0,et.jsx)("div",{children:(0,et.jsx)(V.G,{icon:K.RLE,size:"lg"})}),(0,et.jsxs)("div",{children:[(0,et.jsx)("p",{children:"At this time, the Silver realms are being retired on Jan. 30 2023*. Projects on these realms will no longer be supported by the SSO team."}),(0,et.jsxs)("p",{children:["Please complete a ",(0,et.jsx)("span",{className:"strong",children:"Change Impact Assessment"}),", for each of your projects in the Silver realms."]})]})]}),(0,et.jsx)("div",{className:"text-center",children:(0,et.jsx)(eE.zx,{variant:"primary",type:"button",onClick:function(){return window.open("https://docs.google.com/forms/d/1MMPeMB0A2076xkXIZRaErAwZe9QDsSwSAWqe-uvm3ys","_blank")},children:"Complete Change Impact Assessment"})})]});return(0,et.jsx)(et.Fragment,{children:(0,et.jsx)(ev.Z,{id:eC,content:s,showCancel:!1,showConfirm:!1,onClose:o,icon:K.RLE,title:"Please upgrade from Silver to Gold",closable:!0})})},eO=r(90352),ek=Z.ZP.span(h||(h=(0,$.Z)(["\n font-weight: 600;\n font-size: 1.3em;\n display: flex;\n align-items: end;\n"]))),e_=Z.ZP.div(p||(p=(0,$.Z)(["\n padding: 1rem 0;\n min-height: calc(100vh - ",");\n"])),"152px"),eF=Z.ZP.ul(m||(m=(0,$.Z)(["\n padding-left: 2rem;\n padding-right: 2rem;\n\n li a {\n display: inline-block !important;\n font-size: unset !important;\n padding: 0 !important;\n border-right: none !important;\n }\n"]))),ej=Z.ZP.div(g||(g=(0,$.Z)(["\n display: flex;\n justify-content: space-between;\n width: 100%;\n padding-left: 2rem;\n padding-right: 2rem;\n"]))),eR=Z.ZP.ul(y||(y=(0,$.Z)(["\n & a {\n font-size: 1rem !important;\n }\n\n & a.current {\n font-weight: bold;\n }\n\n & li.current {\n padding-bottom: 6px;\n border-bottom: none;\n background: linear-gradient(orange, orange) bottom /* left or right or else */ no-repeat;\n background-size: calc(100% - 2rem) 4px;\n }\n"]))),eI=Z.ZP.ul(b||(b=(0,$.Z)(["\n padding-right: 2rem;\n"]))),eT=Z.ZP.div(x||(x=(0,$.Z)(["\n padding-left: 2rem;\n padding-right: 2rem;\n"]))),eD=Z.ZP.li(S||(S=(0,$.Z)(["\n &:hover {\n opacity: 0.8;\n }\n"]))),eN=Z.ZP.div(w||(w=(0,$.Z)(["\n height: 100%;\n"]))),eM=[{path:"/",label:"Home",roles:["guest","user","sso-admin"]},{path:"/terms-conditions",label:"Terms and Conditions",roles:["guest"]},{path:"/my-dashboard",label:"My Dashboard",roles:["user","sso-admin"]},{path:"/admin-dashboard",label:"SSO Dashboard",roles:["sso-admin"]},{path:"/admin-reports",label:"SSO Reports",roles:["sso-admin"]},{path:"/request",label:"Request Details",roles:["user","sso-admin"],hide:!0},{path:"/faq",label:"FAQ",roles:["guest","user","sso-admin"]}],eL=function(e){var t,r=e.session,n=e.currentPath,i=e.query,a=["guest"];r&&(a=(null==r?void 0:null===(t=r.client_roles)||void 0===t?void 0:t.length)>0?r.client_roles:["user"]);var o=function(e){return n===e||n.startsWith("".concat(e,"/"))};return(0,et.jsx)(et.Fragment,{children:eM.filter(function(e){return e.roles.some(function(e){return a.includes(e)})&&(!e.hide||o(e.path))}).map(function(e){return(0,et.jsx)("li",{className:o(e.path)?"current":"",children:(0,et.jsx)(z(),{href:e.path,children:X()(e.label)?e.label(i):e.label})},e.path)})})},eB=function(){return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(ew,{children:function(e,t){return(0,et.jsx)(eD,{children:(0,et.jsx)("a",{href:"#".concat(e),title:"My Profile",children:(0,et.jsx)(V.G,{size:"2x",icon:K.U6l})})})}}),(0,et.jsx)(eD,{children:(0,et.jsx)("a",{href:"https://chat.developer.gov.bc.ca/channel/sso",target:"_blank",title:"Rocket Chat",children:(0,et.jsx)(V.G,{size:"2x",icon:K.Z6I})})}),(0,et.jsx)(eD,{children:(0,et.jsx)("a",{href:"mailto:bcgov.sso@gov.bc.ca",title:"Pathfinder SSO",children:(0,et.jsx)(V.G,{size:"2x",icon:K.FU$})})}),(0,et.jsx)(eD,{children:(0,et.jsx)("a",{href:(0,eO.eO)(),target:"_blank",title:"Documentation",children:(0,et.jsx)(V.G,{size:"2x",icon:K.cwv})})})]})},eH=function(e){var t=e.children,r=e.session,n=(e.user,e.onLoginClick),i=e.onLogoutClick,a=(0,R.useRouter)(),o=a.pathname,s=r?(0,et.jsxs)(ek,{children:[(0,et.jsxs)("div",{className:"welcome",children:["Welcome ","".concat(r.given_name," ").concat(r.family_name),"\xa0",(null==r?void 0:r.client_roles)&&(0,et.jsxs)("span",{className:"small",children:["(",Y()(null==r?void 0:r.client_roles[0]),")"]})]}),"\xa0\xa0",(0,et.jsx)(W.default,{variant:"secondary-inverse",size:"medium",onClick:i,children:"Log out"})]}):(0,et.jsx)(W.default,{variant:"secondary-inverse",size:"medium",onClick:n,children:"Log in"});return(0,et.jsxs)(ep.ZP,{children:[(0,et.jsx)(er,{}),(0,et.jsx)(eh,{title:function(){return(0,et.jsx)(eN,{children:"Common Hosted Single Sign-on (CSS)"})},rightSide:s,mobileMenu:function(){return(0,et.jsxs)(eF,{children:[(0,et.jsx)(eL,{session:r,currentPath:o,query:a.query}),(0,et.jsxs)("li",{children:["Need help?\xa0\xa0",(0,et.jsx)("a",{href:"https://chat.developer.gov.bc.ca/",target:"_blank",title:"Rocket Chat",children:(0,et.jsx)(V.G,{size:"2x",icon:K.Z6I})}),"\xa0\xa0",(0,et.jsx)("a",{href:"mailto:bcgov.sso@gov.bc.ca",title:"SSO Team",children:(0,et.jsx)(V.G,{size:"2x",icon:K.FU$})}),"\xa0\xa0",(0,et.jsx)("a",{href:(0,eO.eO)(),target:"_blank",title:"Wiki",children:(0,et.jsx)(V.G,{size:"2x",icon:K.cwv})})]}),(0,et.jsx)("li",{children:r?(0,et.jsx)(W.default,{variant:"secondary-inverse",size:"small",onClick:i,children:"Logout"}):(0,et.jsx)(W.default,{variant:"secondary-inverse",size:"small",onClick:n,children:"Login with IDIR"})})]})},onBannerClick:console.log,children:(0,et.jsxs)(ej,{children:[(0,et.jsx)(eR,{children:(0,et.jsx)(eL,{session:r,currentPath:o,query:a.query})}),(0,et.jsx)(eI,{children:(0,et.jsx)(eB,{})})]})}),(0,et.jsx)(e_,{children:(0,et.jsx)(ep.bD,{children:t})}),(0,et.jsx)(q.default,{children:(0,et.jsx)(eT,{children:(0,et.jsxs)("ul",{children:[(0,et.jsx)("li",{children:(0,et.jsx)(z(),{href:"/",children:"Home"})}),(0,et.jsx)("li",{children:(0,et.jsx)("a",{href:"https://www2.gov.bc.ca/gov/content/home/disclaimer",target:"_blank",rel:"noreferrer",children:"Disclaimer"})}),(0,et.jsx)("li",{children:(0,et.jsx)("a",{href:"https://www2.gov.bc.ca/gov/content/home/privacy",target:"_blank",rel:"noreferrer",children:"Privacy"})}),(0,et.jsx)("li",{children:(0,et.jsx)("a",{href:"https://www2.gov.bc.ca/gov/content/home/accessible-government",target:"_blank",rel:"noreferrer",children:"Accessibility"})}),(0,et.jsx)("li",{children:(0,et.jsx)("a",{href:"https://www2.gov.bc.ca/gov/content/home/copyright",target:"_blank",rel:"noreferrer",children:"Copyright"})})]})})}),(0,et.jsx)(eP,{})]})},e$=r(31637),eU=r(9008),ez=r.n(eU);r(87266),r(90458);var eV=Object.create,eK=Object.defineProperty,eW=Object.getOwnPropertyDescriptor,eq=Object.getOwnPropertyNames,eZ=Object.getPrototypeOf,eG=Object.prototype.hasOwnProperty,eY=(s=null!=(o=(i=(e,t)=>{var n,i;n=e,i=function(e){var t,r=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,n=2*536870912,i=new WeakMap,a=(t=function(e,t){return i.set(e,t),t},function(e){var a=i.get(e),o=void 0===a?e.size:ar)throw Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;e.has(o);)o=Math.floor(Math.random()*r);return t(e,o)});e.addUniqueNumber=function(e){var t=a(e);return e.add(t),t},e.generateUniqueNumber=a},"object"==typeof e&&"u">typeof t?i(e):"function"==typeof define&&r.amdO?define(["exports"],i):i((n="u">typeof globalThis?globalThis:n||self).fastUniqueNumbers={})},()=>(a||i((a={exports:{}}).exports,a),a.exports))())?eV(eZ(o)):{},((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of eq(t))eG.call(e,r)||void 0===r||eK(e,r,{get:()=>t[r],enumerable:!(n=eW(t,r))||n.enumerable});return e})(o&&o.__esModule?s:eK(s,"default",{value:o,enumerable:!0}),o)),eJ=e=>void 0!==e.method&&"call"===e.method,eX=e=>null===e.error&&"number"==typeof e.id,eQ=e=>{let t=new Map([[0,()=>{}]]),r=new Map([[0,()=>{}]]),n=new Map,i=new Worker(e);return i.addEventListener("message",({data:e})=>{if(eJ(e)){let{params:{timerId:i,timerType:a}}=e;if("interval"===a){let e=t.get(i);if("number"==typeof e){let t=n.get(e);if(void 0===t||t.timerId!==i||t.timerType!==a)throw Error("The timer is in an undefined state.")}else if("u">typeof e)e();else throw Error("The timer is in an undefined state.")}else if("timeout"===a){let e=r.get(i);if("number"==typeof e){let t=n.get(e);if(void 0===t||t.timerId!==i||t.timerType!==a)throw Error("The timer is in an undefined state.")}else if("u">typeof e)e(),r.delete(i);else throw Error("The timer is in an undefined state.")}}else if(eX(e)){let{id:i}=e,a=n.get(i);if(void 0===a)throw Error("The timer is in an undefined state.");let{timerId:o,timerType:s}=a;n.delete(i),"interval"===s?t.delete(o):r.delete(o)}else{let{error:{message:t}}=e;throw Error(t)}}),{clearInterval:e=>{let r=(0,eY.generateUniqueNumber)(n);n.set(r,{timerId:e,timerType:"interval"}),t.set(e,r),i.postMessage({id:r,method:"clear",params:{timerId:e,timerType:"interval"}})},clearTimeout:e=>{let t=(0,eY.generateUniqueNumber)(n);n.set(t,{timerId:e,timerType:"timeout"}),r.set(e,t),i.postMessage({id:t,method:"clear",params:{timerId:e,timerType:"timeout"}})},setInterval:(e,r)=>{let n=(0,eY.generateUniqueNumber)(t);return t.set(n,()=>{e(),"function"==typeof t.get(n)&&i.postMessage({id:null,method:"set",params:{delay:r,now:performance.now(),timerId:n,timerType:"interval"}})}),i.postMessage({id:null,method:"set",params:{delay:r,now:performance.now(),timerId:n,timerType:"interval"}}),n},setTimeout:(e,t)=>{let n=(0,eY.generateUniqueNumber)(r);return r.set(n,e),i.postMessage({id:null,method:"set",params:{delay:t,now:performance.now(),timerId:n,timerType:"timeout"}}),n}}};n=null,()=>{if(null!==n)return n;let e=new Blob(['(()=>{"use strict";const e=new Map,t=new Map,r=(e,t)=>{let r,o;const i=performance.now();r=i,o=e-Math.max(0,i-t);return{expected:r+o,remainingDelay:o}},o=(e,t,r,i)=>{const s=performance.now();s>r?postMessage({id:null,method:"call",params:{timerId:t,timerType:i}}):e.set(t,setTimeout(o,r-s,e,t,r,i))};addEventListener("message",(i=>{let{data:s}=i;try{if("clear"===s.method){const{id:r,params:{timerId:o,timerType:i}}=s;if("interval"===i)(t=>{const r=e.get(t);if(void 0===r)throw new Error(\'There is no interval scheduled with the given id "\'.concat(t,\'".\'));clearTimeout(r),e.delete(t)})(o),postMessage({error:null,id:r});else{if("timeout"!==i)throw new Error(\'The given type "\'.concat(i,\'" is not supported\'));(e=>{const r=t.get(e);if(void 0===r)throw new Error(\'There is no timeout scheduled with the given id "\'.concat(e,\'".\'));clearTimeout(r),t.delete(e)})(o),postMessage({error:null,id:r})}}else{if("set"!==s.method)throw new Error(\'The given method "\'.concat(s.method,\'" is not supported\'));{const{params:{delay:i,now:n,timerId:a,timerType:d}}=s;if("interval"===d)((t,i,s)=>{const{expected:n,remainingDelay:a}=r(t,s);e.set(i,setTimeout(o,a,e,i,n,"interval"))})(i,a,n);else{if("timeout"!==d)throw new Error(\'The given type "\'.concat(d,\'" is not supported\'));((e,i,s)=>{const{expected:n,remainingDelay:a}=r(e,s);t.set(i,setTimeout(o,a,t,i,n,"timeout"))})(i,a,n)}}}}catch(e){postMessage({error:{message:e.message},id:s.id,result:null})}}))})();'],{type:"application/javascript; charset=utf-8"}),t=URL.createObjectURL(e);return n=eQ(t),setTimeout(()=>URL.revokeObjectURL(t)),n};var e0=(typeof window>"u"?"undefined":typeof window)=="object",e1={setTimeout:e0?setTimeout.bind(window):setTimeout,clearTimeout:e0?clearTimeout.bind(window):clearTimeout,setInterval:e0?setInterval.bind(window):setInterval,clearInterval:e0?clearInterval.bind(window):clearInterval},e2={},e4=class{name;closed=!1;mc=new MessageChannel;constructor(e){this.name=e,e2[e]=e2[e]||[],e2[e].push(this),this.mc.port1.start(),this.mc.port2.start(),this.onStorage=this.onStorage.bind(this),window.addEventListener("storage",this.onStorage)}onStorage(e){if(e.storageArea!==window.localStorage||e.key.substring(0,this.name.length)!==this.name||null===e.newValue)return;let t=JSON.parse(e.newValue);this.mc.port2.postMessage(t)}postMessage(e){if(this.closed)throw Error("InvalidStateError");let t=JSON.stringify(e),r=`${this.name}:${String(Date.now())}${String(Math.random())}`;window.localStorage.setItem(r,t),e1.setTimeout(()=>{window.localStorage.removeItem(r)},500),e2[this.name].forEach(e=>{e!==this&&e.mc.port2.postMessage(JSON.parse(t))})}close(){if(this.closed)return;this.closed=!0,this.mc.port1.close(),this.mc.port2.close(),window.removeEventListener("storage",this.onStorage);let e=e2[this.name].indexOf(this);e2[this.name].splice(e,1)}get onmessage(){return this.mc.port1.onmessage}set onmessage(e){this.mc.port1.onmessage=e}get onmessageerror(){return this.mc.port1.onmessageerror}set onmessageerror(e){this.mc.port1.onmessageerror=e}addEventListener(e,t){return this.mc.port1.addEventListener(e,t)}removeEventListener(e,t){return this.mc.port1.removeEventListener(e,t)}dispatchEvent(e){return this.mc.port1.dispatchEvent(e)}},e3=typeof window>"u"?void 0:"function"==typeof window.BroadcastChannel?window.BroadcastChannel:e4;function e6(){return Math.random().toString(36).substring(2)}var e5=class{options;channel;token=e6();isLeader=!1;isDead=!1;isApplying=!1;reApply=!1;intervals=[];listeners=[];deferred;constructor(e,t){this.channel=e,this.options=t,this.apply=this.apply.bind(this),this.awaitLeadership=this.awaitLeadership.bind(this),this.sendAction=this.sendAction.bind(this)}async apply(){if(this.isLeader||this.isDead)return!1;if(this.isApplying)return this.reApply=!0,!1;this.isApplying=!0;let e=!1,t=t=>{let{token:r,action:n}=t.data;r!==this.token&&(0===n&&r>this.token&&(e=!0),1===n&&(e=!0))};this.channel.addEventListener("message",t);try{return this.sendAction(0),await function(e=0){return new Promise(t=>e1.setTimeout(t,e))}(this.options.responseTime),this.channel.removeEventListener("message",t),this.isApplying=!1,e?!!this.reApply&&this.apply():(this.assumeLead(),!0)}catch{return!1}}awaitLeadership(){if(this.isLeader)return Promise.resolve();let e=!1,t=null;return new Promise(r=>{let n=()=>{if(e)return;e=!0;try{e1.clearInterval(t)}catch{}let n=this.intervals.indexOf(t);n>=0&&this.intervals.splice(n,1),this.channel.removeEventListener("message",i),r()};t=e1.setInterval(()=>{this.apply().then(()=>{this.isLeader&&n()})},this.options.fallbackInterval),this.intervals.push(t);let i=e=>{let{action:t}=e.data;2===t&&this.apply().then(()=>{this.isLeader&&n()})};this.channel.addEventListener("message",i)})}sendAction(e){this.channel.postMessage({action:e,token:this.token})}assumeLead(){this.isLeader=!0;let e=e=>{let{action:t}=e.data;0===t&&this.sendAction(1)};return this.channel.addEventListener("message",e),this.listeners.push(e),this.sendAction(1)}waitForLeadership(){return this.deferred||(this.deferred=this.awaitLeadership()),this.deferred}close(){if(!this.isDead){this.isDead=!0,this.isLeader=!1,this.sendAction(2);try{this.listeners.forEach(e=>this.channel.removeEventListener("message",e)),this.intervals.forEach(e=>e1.clearInterval(e))}catch{}}}},e8=class{channel;options;elector;token=e6();registry=new Map;allIdle=!1;isLastActive=!1;constructor(e){let{channelName:t}=e;this.options=e,this.channel=new e3(t),this.registry.set(this.token,1),e.leaderElection&&(this.elector=new e5(this.channel,{fallbackInterval:2e3,responseTime:100}),this.elector.waitForLeadership()),this.channel.addEventListener("message",e=>{let{action:t,token:r,data:n}=e.data;switch(t){case 3:this.registry.set(r,2);break;case 4:this.registry.delete(r);break;case 5:this.idle(r);break;case 6:this.active(r);break;case 7:this.prompt(r);break;case 8:this.start(r);break;case 9:this.reset(r);break;case 10:this.activate(r);break;case 11:this.pause(r);break;case 12:this.resume(r);break;case 13:this.options.onMessage(n)}}),this.send(3)}get isLeader(){if(!this.elector)throw Error('❌ Leader election is not enabled. To Enable it set the "leaderElection" property to true.');return this.elector.isLeader}prompt(e=this.token){this.registry.set(e,0);let t=[...this.registry.values()].every(e=>0===e);e===this.token&&this.send(7),t&&this.options.onPrompt()}idle(e=this.token){this.registry.set(e,2);let t=[...this.registry.values()].every(e=>2===e);e===this.token&&this.send(5),!this.allIdle&&t&&(this.allIdle=!0,this.options.onIdle())}active(e=this.token){this.allIdle=!1,this.registry.set(e,1);let t=[...this.registry.values()].some(e=>1===e);e===this.token&&this.send(6),t&&this.options.onActive(),this.isLastActive=e===this.token}start(e=this.token){this.allIdle=!1,this.registry.set(e,1),e===this.token?this.send(8):this.options.start(!0),this.isLastActive=e===this.token}reset(e=this.token){this.allIdle=!1,this.registry.set(e,1),e===this.token?this.send(9):this.options.reset(!0),this.isLastActive=e===this.token}activate(e=this.token){this.allIdle=!1,this.registry.set(e,1),e===this.token?this.send(10):this.options.activate(!0),this.isLastActive=e===this.token}pause(e=this.token){e===this.token?this.send(11):this.options.pause(!0)}resume(e=this.token){e===this.token?this.send(12):this.options.resume(!0)}message(e){try{this.channel.postMessage({action:13,token:this.token,data:e})}catch{}}send(e){try{this.channel.postMessage({action:e,token:this.token})}catch{}}close(){this.options.leaderElection&&this.elector.close(),this.send(4),this.channel.close()}},e9=e0?document:null,e7=["mousemove","keydown","wheel","DOMMouseScroll","mousewheel","mousedown","touchstart","touchmove","MSPointerDown","MSPointerMove","visibilitychange","focus"];function te(e,t){let r=0;return function(...n){let i=new Date().getTime();if(!(i-rDate.now();(0,j.createContext)(null).Consumer;var tr=r(30233),tn=r(31513),ti=r(63055),ta=r(30996);function to(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function ts(e){for(var t=1;t0){e.next=3;break}return e.abrupt("return",m("Please select a rating."));case 3:o&&(0,B.xc)({triggerEvent:o,message:f,rating:u.filter(function(e){return e.selected}).length}),n(!1),r(!1);case 6:case"end":return e.stop()}},e)})),function(){return t.apply(this,arguments)}),b="".concat(i?"open":"closed"," ").concat(!a&&"hidden");return(0,et.jsx)(tc,{children:(0,et.jsxs)(tl,{className:b,children:[(0,et.jsxs)("div",{className:"header",onClick:function(){r(!i)},children:[(0,et.jsx)("p",{children:"We'd love to hear from you"}),(0,et.jsx)(V.G,{icon:i?K.Qbq:K.K96})]}),(0,et.jsxs)("div",{className:"body",children:[(0,et.jsx)("p",{className:"title",children:(0,et.jsx)("strong",{children:"Rate our service"})}),(0,et.jsx)("p",{children:"How was your experience with the CSS app?"}),(0,et.jsxs)(tf,{children:[(0,et.jsx)("div",{className:"stars-box",children:u.map(function(e,t){return(0,et.jsx)(V.G,{style:{cursor:"pointer"},role:"button",size:"3x",icon:K.Tab,color:e.selected?"gold":"grey",onClick:function(){return g(t)}},e.id)})}),(0,et.jsxs)("div",{className:"stars-text",children:[(0,et.jsx)("span",{children:"Bad"}),(0,et.jsx)("span",{children:"Great"})]})]}),(0,et.jsx)(ta.default,{fullWidth:!0,placeholder:"Leave a message...",rows:4,value:f,onChange:function(e){m(""),e.target.value.length<=700?d(e.target.value):m("Messages are at most ".concat(700," characters."))}}),p&&(0,et.jsx)("p",{className:"error-message",children:p}),(0,et.jsxs)("div",{className:"button-container",children:[(0,et.jsx)(W.default,{variant:"secondary",onClick:function(){return n(!1)},children:"Close"}),(0,et.jsx)(W.default,{onClick:y,children:"Rate now"})]})]})]})})};function tp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function tm(e){for(var t=1;t{},onPrompt:u=()=>{},onIdle:c=()=>{},onActive:l=()=>{},onAction:f=()=>{},onMessage:d=()=>{},debounce:h=0,throttle:p=0,eventsThrottle:m=200,startOnMount:g=!0,startManually:y=!1,stopOnIdle:b=!1,crossTab:x=!1,name:S="idle-timer",syncTimers:w=0,leaderElection:E=!1,disabled:A=!1}={}){let C=(0,j.useRef)(tt()),P=(0,j.useRef)(tt()),O=(0,j.useRef)(null),k=(0,j.useRef)(null),_=(0,j.useRef)(0),F=(0,j.useRef)(0),R=(0,j.useRef)(0),I=(0,j.useRef)(0),T=(0,j.useRef)(!1),D=(0,j.useRef)(!1),N=(0,j.useRef)(!1),M=(0,j.useRef)(!0),L=(0,j.useRef)(!1),B=(0,j.useRef)(null),H=(0,j.useRef)(null),$=(0,j.useRef)(e),U=(0,j.useRef)(0);(0,j.useEffect)(()=>{if(t&&console.warn("⚠️ IdleTimer -- The `promptTimeout` property has been deprecated in favor of `promptBeforeIdle`. It will be removed in the next major release."),r&&t)throw Error("❌ Both promptTimeout and promptBeforeIdle can not be set. The promptTimeout property will be deprecated in a future version.");if(e>=2147483647)throw Error(`\u274C The value for the timeout property must fit in a 32 bit signed integer, 2147483647.`);if(t>=2147483647)throw Error(`\u274C The value for the promptTimeout property must fit in a 32 bit signed integer, 2147483647.`);if(r>=2147483647)throw Error(`\u274C The value for the promptBeforeIdle property must fit in a 32 bit signed integer, 2147483647.`);if(r>=e)throw Error(`\u274C The value for the promptBeforeIdle property must be less than the timeout property, ${e}.`);if(r?($.current=e-r,U.current=r):($.current=e,U.current=t),!M.current){if(y||A)return;T.current&&(J.current(null,eR),H.current&&H.current.active()),ed()}},[e,t,r,y,A]);let z=(0,j.useRef)(b);(0,j.useEffect)(()=>{z.current=b},[b]);let V=(0,j.useRef)(o),K=(0,j.useRef)(n),W=(0,j.useRef)([...new Set([...i,...o]).values()]),q=(0,j.useRef)(A);(0,j.useEffect)(()=>{q.current=A,!M.current&&(A?em():y||ed())},[A]);let Z=(0,j.useRef)(s);(0,j.useEffect)(()=>{Z.current=s},[s]);let G=(0,j.useRef)(u);(0,j.useEffect)(()=>{G.current=u},[u]);let Y=(0,j.useRef)(c);(0,j.useEffect)(()=>{Y.current=c},[c]);let J=(0,j.useRef)(l);(0,j.useEffect)(()=>{J.current=l},[l]);let X=(0,j.useRef)(f);(0,j.useEffect)(()=>{X.current=f},[f]);let Q=(0,j.useRef)(d);(0,j.useEffect)(()=>{Q.current=d},[d]);let ee=(0,j.useMemo)(()=>{let e=(e,t)=>X.current(e,t);return h>0?function(e,t){let r;function n(...i){r&&clearTimeout(r),r=setTimeout(()=>{e(...i),r=null},t)}return n.cancel=function(){clearTimeout(r)},n}(e,h):p>0?te(e,p):e},[p,h]),et=(0,j.useRef)();(0,j.useEffect)(()=>{x&&w&&(et.current=te(()=>{H.current.active()},w))},[x,w]);let er=()=>{null!==B.current&&(e1.clearTimeout(B.current),B.current=null)},en=(e,t=!0)=>{er(),B.current=e1.setTimeout(es,e||$.current),t&&(k.current=tt())},ei=e=>{D.current||T.current||(G.current(e,eR),Z.current({type:"active",prompted:!0},eR)),I.current=0,R.current=tt(),D.current=!0,en(U.current,!1)},ea=()=>{er(),T.current||(Y.current(null,eR),Z.current({type:"idle"},eR)),T.current=!0,O.current=tt(),z.current?ef():D.current&&(R.current=0,D.current=!1)},eo=e=>{er(),(T.current||D.current)&&(J.current(e,eR),Z.current({type:"active",prompted:!1},eR)),D.current=!1,R.current=0,T.current=!1,_.current+=tt()-O.current,F.current+=tt()-O.current,el(),en()},es=e=>{if(!T.current){ee.cancel&&ee.cancel();let t=tt()-k.current;if(!($.current+U.current0&&!D.current){H.current?H.current.prompt():ei(e);return}H.current?H.current.idle():ea();return}H.current?H.current.active():eo(e)},eu=e=>{if(g||k.current||(k.current=tt(),J.current(null,eR)),ee(e,eR),D.current)return;if(er(),!T.current&&V.current.includes(e.type)){es(e);return}let t=tt()-k.current;if(T.current&&!b||!T.current&&t>=$.current){es(e);return}N.current=!1,I.current=0,R.current=0,en(),x&&w&&et.current()},ec=(0,j.useRef)(eu);(0,j.useEffect)(()=>{let e=L.current;e&&ef(),m>0?ec.current=te(eu,m):ec.current=eu,e&&el()},[m,p,h,X,x,w]);let el=()=>{e0&&K.current&&(L.current||(W.current.forEach(e=>{K.current.addEventListener(e,ec.current,{capture:!0,passive:!0})}),L.current=!0))},ef=(e=!1)=>{e0&&K.current&&(L.current||e)&&(W.current.forEach(e=>{K.current.removeEventListener(e,ec.current,{capture:!0})}),L.current=!1)},ed=(0,j.useCallback)(e=>!q.current&&(er(),el(),T.current=!1,D.current=!1,N.current=!1,I.current=0,R.current=0,H.current&&!e&&H.current.start(),en(),!0),[B,T,q,$,H]),eh=(0,j.useCallback)(e=>!q.current&&(er(),el(),P.current=tt(),_.current+=tt()-O.current,F.current+=tt()-O.current,_.current=0,T.current=!1,D.current=!1,N.current=!1,I.current=0,R.current=0,H.current&&!e&&H.current.reset(),y||en(),!0),[B,T,$,y,q,H]),ep=(0,j.useCallback)(e=>!q.current&&(er(),el(),(T.current||D.current)&&eo(),T.current=!1,D.current=!1,N.current=!1,I.current=0,R.current=0,P.current=tt(),H.current&&!e&&H.current.activate(),en(),!0),[B,T,D,q,$,H]),em=(0,j.useCallback)((e=!1)=>!q.current&&!N.current&&(I.current=eE(),N.current=!0,ef(),er(),H.current&&!e&&H.current.pause(),!0),[B,q,H]),ev=(0,j.useCallback)((e=!1)=>!q.current&&!!N.current&&(N.current=!1,D.current||el(),T.current||en(I.current),R.current&&(R.current=tt()),H.current&&!e&&H.current.resume(),!0),[B,$,q,I,H]),eg=(0,j.useCallback)((e,t)=>(H.current?(t&&Q.current(e,eR),H.current.message(e)):t&&Q.current(e,eR),!0),[d]),ey=(0,j.useCallback)(()=>T.current,[T]),eb=(0,j.useCallback)(()=>D.current,[D]),ex=(0,j.useCallback)(()=>H.current?H.current.isLeader:null,[H]),eS=(0,j.useCallback)(()=>H.current?H.current.isLastActive:null,[H]),ew=(0,j.useCallback)(()=>H.current?H.current.token:null,[H]),eE=(0,j.useCallback)(()=>{if(N.current)return I.current;let e=Math.floor((I.current?I.current:U.current+$.current)-(k.current?tt()-k.current:0));return e<0?0:Math.abs(e)},[$,U,D,I,k]),eA=(0,j.useCallback)(()=>Math.round(tt()-P.current),[P]),eC=(0,j.useCallback)(()=>Math.round(tt()-C.current),[C]),eP=(0,j.useCallback)(()=>O.current?new Date(O.current):null,[O]),eO=(0,j.useCallback)(()=>k.current?new Date(k.current):null,[k]),ek=(0,j.useCallback)(()=>T.current?Math.round(tt()-O.current+_.current):Math.round(_.current),[O,_]),e_=(0,j.useCallback)(()=>T.current?Math.round(tt()-O.current+F.current):Math.round(F.current),[O,F]),eF=(0,j.useCallback)(()=>{let e=Math.round(eA()-ek());return e>=0?e:0},[O,_]),ej=(0,j.useCallback)(()=>{let e=Math.round(eC()-e_());return e>=0?e:0},[O,_]);(0,j.useEffect)(()=>{if(h>0&&p>0)throw Error("❌ onAction can either be throttled or debounced, not both.");a&&(e1.setTimeout=a.setTimeout,e1.clearTimeout=a.clearTimeout,e1.setInterval=a.setInterval,e1.clearInterval=a.clearInterval);let e=()=>{H.current&&H.current.close(),ee.cancel&&ee.cancel(),er(),ef(!0)};return e0&&window.addEventListener("beforeunload",e),()=>{e0&&window.removeEventListener("beforeunload",e),H.current&&H.current.close(),ee.cancel&&ee.cancel(),er(),ef(!0)}},[]),(0,j.useEffect)(()=>{H.current&&H.current.close(),x?H.current=new e8({channelName:S,leaderElection:E,onPrompt:()=>{ei()},onIdle:()=>{ea()},onActive:()=>{eo()},onMessage:e=>{Q.current(e,eR)},start:ed,reset:eh,activate:ep,pause:em,resume:ev}):H.current=null},[x,S,E,G,Y,J,Q,ed,eh,em,ev]),(0,j.useEffect)(()=>{M.current||(er(),ef(!0)),y||A||(g?ed():el())},[y,g,A,M]),(0,j.useEffect)(()=>{if(!M.current){let e=[...new Set([...i,...o]).values()];ef(),W.current=e,K.current=n,V.current=o,y||A||(g?ed():el())}},[n,JSON.stringify(i),JSON.stringify(o),M,A,y,g]),(0,j.useEffect)(()=>{M.current&&(M.current=!1)},[M]);let eR={message:eg,start:ed,reset:eh,activate:ep,pause:em,resume:ev,isIdle:ey,isPrompted:eb,isLeader:ex,isLastActiveTab:eS,getTabId:ew,getRemainingTime:eE,getElapsedTime:eA,getTotalElapsedTime:eC,getLastIdleTime:eP,getLastActiveTime:eO,getIdleTime:ek,getTotalIdleTime:e_,getActiveTime:eF,getTotalActiveTime:ej,setOnPresenceChange:e=>{s=e,Z.current=e},setOnPrompt:e=>{u=e,G.current=e},setOnIdle:e=>{c=e,Y.current=e},setOnActive:e=>{l=e,J.current=e},setOnAction:e=>{f=e,X.current=e},setOnMessage:e=>{d=e,Q.current=e}}}({onPrompt:function(){"expired"!==S&&o.current.open()},timeout:3e5,promptBeforeIdle:1e4,throttle:500,disabled:null===l}),(0,j.useEffect)(function(){function e(e,r){return t.apply(this,arguments)}function t(){return(t=(0,k.Z)(F().mark(function e(t,r){var n,i,a,o;return F().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,M.W)(t.id_token);case 2:if(n=e.sent,a=(i=(0,P.Z)(n,2))[0],o=i[1],!a){e.next=14;break}if(!r){e.next=11;break}return(0,H.d0)(t),e.next=11,u.push("/my-dashboard");case 11:f(tw(a)),e.next=17;break;case 14:(0,H.Zz)(),f(tw(null)),r&&u.push({pathname:"/application-error",query:{error:o}});case 17:y(!1);case 18:case"end":return e.stop()}},e)}))).apply(this,arguments)}function r(){return(r=(0,k.Z)(F().mark(function t(){var r,n,i,a,o;return F().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return y(!0),t.prev=1,t.next=4,(0,D.M)();case 4:if(n=(r=(0,N.rg)()).code,i=r.state,!n){t.next=13;break}return t.next=8,(0,N.hP)({code:n,state:i});case 8:return a=t.sent,t.next=11,e(a,!0);case 11:t.next=16;break;case 13:return o=(0,H.lz)(),t.next=16,e(o,!1);case 16:t.next=25;break;case 18:t.prev=18,t.t0=t.catch(1),console.log(t.t0),(0,H.Zz)(),f(tw(null)),y(!1),b(t.t0);case 25:case"end":return t.stop()}},t,null,[[1,18]])}))).apply(this,arguments)}console.log("app started..."),tx&&"true"===tx&&u.push({pathname:"/application-error",query:{error:"maintenance"}}),(0,L.Nu)(),function(){r.apply(this,arguments)}()},[]),(0,j.useEffect)(function(){var e,t=(e=(0,k.Z)(F().mark(function e(){var t,r,n;return F().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,B.Ai)();case 2:t=e.sent,n=(r=(0,P.Z)(t,2))[0],r[1],p(n);case 7:case"end":return e.stop()}},e)})),function(){return e.apply(this,arguments)});l&&t()},[l]),(0,j.useEffect)(function(){if(l){var e=setInterval((0,k.Z)(F().mark(function e(){var t;return F().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=(0,tn.QE)((0,H.lz)().refresh_token),Date.now()>=(null==t?void 0:t.exp)*1e3?(w("expired"),o.current.close(),s.current.open()):w("");case 2:case"end":return e.stop()}},e)})),5e3);return function(){clearInterval(e)}}});var W=(r=(0,k.Z)(F().mark(function e(){var t;return F().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,N.iq)({kc_idp_hint:tb});case 2:t=e.sent,window.location.href=t;case 4:case"end":return e.stop()}},e)})),function(){return r.apply(this,arguments)}),q=(n=(0,k.Z)(F().mark(function e(){return F().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:(0,H.Zz)(),window.location.href=(0,N.kG)();case 2:case"end":return e.stop()}},e)})),function(){return n.apply(this,arguments)}),Z=(0,j.useMemo)(function(){return{setShowSurvey:V}},[h]);return g?(0,et.jsx)(e$.Z,{}):tS.some(function(e){return window.location.pathname.startsWith(e)})&&!l?(u.push("/"),null):(0,et.jsx)(tA.Provider,{value:{session:l,user:h},children:(0,et.jsx)(tC.Provider,{value:Z,children:tx&&"true"===tx?(0,et.jsx)(i,tm({},a)):(0,et.jsxs)(et.Fragment,{children:[(0,et.jsxs)(eH,{session:l,user:h,onLoginClick:W,onLogoutClick:q,children:[(0,et.jsxs)(ez(),{children:[(0,et.jsx)("html",{lang:"en"}),(0,et.jsx)("title",{children:"Common Hosted Single Sign-on (CSS)"}),(0,et.jsx)("link",{rel:"icon",href:"/bootstrap-theme/dist/images/bcid-favicon-32x32.png"})]}),(0,et.jsx)(i,tm(tm({},a),{},{session:l,onLoginClick:W,onLogoutClick:q}))]}),(0,et.jsx)(tr.Z,{ref:o,style:{maxHeight:"calc(100vh - 200px)",overflowY:"auto"},title:"Session expiring",icon:K.eHv,onConfirm:(0,k.Z)(F().mark(function e(){return F().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,B.Ai)();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e)})),onCancel:function(){q()},confirmButtonText:"Confirm",confirmButtonVariant:"primary",cancelButtonVariant:"secondary",showConfirmButton:!0,showCancelButton:!0,children:(0,et.jsxs)("div",{children:[(0,et.jsx)("div",{children:"Your session will expire soon and you will be signed out automatically."}),(0,et.jsx)("br",{}),(0,et.jsx)("div",{children:"Do you want to stay signed in?"})," "]})}),(0,et.jsx)(tr.Z,{ref:s,style:{maxHeight:"calc(100vh - 200px)",overflowY:"auto"},title:"Session expired",icon:K.eHv,onConfirm:function(){return W()},onCancel:(0,k.Z)(F().mark(function e(){return F().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,B.Ai)();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e)})),confirmButtonText:"Login",confirmButtonVariant:"primary",cancelButtonVariant:"secondary",showConfirmButton:!0,showCancelButton:!0,children:(0,et.jsxs)("div",{children:[(0,et.jsx)("div",{children:"Your session has expired."}),(0,et.jsx)("br",{}),(0,et.jsx)("div",{children:"Please login again."})," "]})}),h&&(0,et.jsx)(th,{setOpenSurvey:z,open:U,display:I,setDisplaySurvey:T,triggerEvent:A})]})})})}},64730:function(e,t,r){"use strict";r.d(t,{Ek:function(){return y},Nu:function(){return b}});var n,i,a,o=r(16835),s=r(50029),u=r(87794),c=r.n(u),l=r(21963),f=r(54494),d=r(88757),h=r(84595),p=r(11752),m=(r.n(p)()()||{}).publicRuntimeConfig,g=(void 0===m?{}:m).base_path,y=(n=(0,s.Z)(c().mark(function e(){var t;return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,w();case 2:return t=(0,f.lz)(),e.abrupt("return","Bearer ".concat(t.id_token));case 4:case"end":return e.stop()}},e)})),function(){return n.apply(this,arguments)});function b(){return x.apply(this,arguments)}function x(){return(x=(0,s.Z)(c().mark(function e(){return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.abrupt("return",l.e.get("heartbeat",{headers:{skipAuth:!0}}).then(function(e){return e.data}));case 4:return e.prev=4,e.t0=e.catch(0),console.error(e.t0),e.abrupt("return",null);case 8:case"end":return e.stop()}},e,null,[[0,4]])}))).apply(this,arguments)}var S=(i=(0,s.Z)(c().mark(function e(t){var r,n;return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,d.dx)({refreshToken:t.refresh_token});case 2:return r=e.sent,e.next=5,(0,h.W)(null==r?void 0:r.id_token);case 5:n=e.sent,(0,o.Z)(n,1)[0]?(0,f.d0)(r):((0,f.Zz)(),console.error("failed to refresh the token"),window.location.href="".concat(g));case 9:case"end":return e.stop()}},e)})),function(e){return i.apply(this,arguments)}),w=(a=(0,s.Z)(c().mark(function e(){var t,r,n;return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=(0,f.lz)(),e.next=3,(0,h.W)(t.id_token);case 3:r=e.sent,(n=(0,o.Z)(r,1)[0])?1e3*n.exp-Date.now()<12e4&&S(t):S(t);case 7:case"end":return e.stop()}},e)})),function(){return a.apply(this,arguments)})},21963:function(e,t,r){"use strict";r.d(t,{e:function(){return x},z:function(){return S}});var n,i=r(59499),a=r(50029),o=r(87794),s=r.n(o),u=r(11752),c=r.n(u),l=r(9669),f=r.n(l),d=r(64730),h=r(11163),p=r.n(h);function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function g(e){for(var t=1;t0?i:null,a=a.length>0?a:null;var o=t.map(function(e){return e.value});return[a,i,o=o.length>0?o:null]},g=function(e){var t=e.bceidApproved,r=e.githubApproved,n=e.digitalCredentialApproved,i=e.environments,a=void 0===i?[]:i,o=e.serviceType,s=(0,f.Jx)(e),u=(0,f.dV)(e),l=(0,f.S3)(e),d=c.TJ.map(function(t){var r=e.devIdps;return p(p({},t),{},{idps:r||[]})});if("gold"===o){var h=j(e),m=R(e),g=I(e),y=d.filter(function(e){return a.includes(e.name)});return s&&(!t||h)&&(y=y.map(function(e){return"prod"===e.name&&(e.idps=e.idps.filter(f.JK)),e})),u&&(!r||m)&&(y=y.map(function(e){return"prod"===e.name&&(e.idps=e.idps.filter(f.Qf)),e})),l&&(!n||g)&&(y=y.map(function(e){return"prod"===e.name&&(e.idps=e.idps.filter(f.DK)),e})),y}var b=a.concat()||[];return s&&!t&&(b=b.filter(function(e){return"prod"!==e})),d.filter(function(e){return b.includes(e.name)})},y=function(e){return e?JSON.parse(decodeURIComponent(Array.from(atob(e.replace(/-/g,"+").replace(/_/g,"/"))).reduce(function(e,t){var r=("00"+t.charCodeAt(0).toString(16)).slice(-2);return"".concat(e,"%").concat(r)},""))):null},b=function(e){if(!e)return null;var t=e.split(".");return y((0,a.Z)(t,2)[1])},x=function(e){if(!e)return null;var t=e.split(".");return y((0,a.Z)(t,1)[0])},S=function(){var e=new Uint32Array(28);crypto.getRandomValues(e);var t=[];return e.forEach(function(e){return t.push("0".concat(e.toString(16).substr(-2)))}),t.reduce(function(e,t){return"".concat(e).concat(t)},"")},w=(n=(0,i.Z)(u().mark(function e(t){var r;return u().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=new TextEncoder().encode(t),e.abrupt("return",crypto.subtle.digest("SHA-256",r));case 4:case"end":return e.stop()}},e)})),function(e){return n.apply(this,arguments)}),E=function(e){return btoa(new Uint8Array(e).reduce(function(e,t){return"".concat(e).concat(String.fromCharCode(t))},"")).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},A=function(e){var t;return e.devValidRedirectUris&&0!==e.devValidRedirectUris.length||(e.devValidRedirectUris=[""]),e.testValidRedirectUris&&0!==e.testValidRedirectUris.length||(e.testValidRedirectUris=[""]),e.prodValidRedirectUris&&0!==e.prodValidRedirectUris.length||(e.prodValidRedirectUris=[""]),e.teamId?e.teamId=String(e.teamId):e.usesTeam=!1,Object.entries(t=e).forEach(function(e){var r=(0,a.Z)(e,2),n=r[0];null===r[1]&&delete t[n]}),t},C=function(e){return e.map(function(e){if(Object.keys(c.Qj).map(function(e){return".".concat(e)}).includes(e.property)){var t=e.property.slice(1);e.message=c.Qj[t]||e.message}else(e.property.includes("ValidRedirectUris")||e.property.includes("SamlLogoutPostBindingUri"))&&("should be string"===e.message?e.message="":e.message=c.Qj.redirectUris);return e})},P=function(e){if(!e||0===e.length)return(0,d.jsx)("div",{children:"No changes"});var t=e.map(function(e){var t=e.kind,r=e.lhs,n=e.rhs,i=e.path,a=e.item,o=i[0];switch(t){case"E":return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("strong",{children:["Edited ",o,": "]}),"Changed ",(0,d.jsx)("code",{children:String(r)})," to ",(0,d.jsx)("code",{children:String(n)})]});case"A":if((null==a?void 0:a.kind)==="D")return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("strong",{children:["Changed Array ",o,": "]}),"Deleted ",(0,d.jsxs)("code",{children:[" ",null==a?void 0:a.lhs]})]});if((null==a?void 0:a.kind)==="N")return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("strong",{children:["Changed Array ",o,": "]}),"Added ",(0,d.jsx)("code",{children:null==a?void 0:a.rhs})]});return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("strong",{children:["Changed Array ",o,": "]}),"Edited"," ",(0,d.jsxs)("code",{children:[null==a?void 0:a.lhs," to ",null==a?void 0:a.rhs]})]});case"N":return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("strong",{children:["Added ",o,": "]}),(0,d.jsx)("code",{children:a})]});case"D":return(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)("strong",{children:["Deleted ",o," "]})});default:return(0,d.jsx)("code",{children:JSON.stringify(e,null,2)})}});return(0,d.jsx)("ul",{children:t.map(function(e,t){return(0,d.jsx)("li",{children:e},t)})})},O=function(e){return e.some(function(e){return["submitted","pr","prFailed","planned","planFailed","approved","applyFailed"].includes(e.status||"")})};function k(e,t){if(1===e.length)return!1;var r=e.find(function(e){return e.id===t});return 1!==e.filter(function(e){return"admin"===e.role}).length||(null==r?void 0:r.role)!=="admin"}var _=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},F=function(e,t){return"Submitted"===(0,l.n)(e.status||"draft")&&!!e.lastChanges&&0!==e.lastChanges.length&&e.lastChanges.some(function(e){return e.path[0]===t&&!1===e.lhs&&!0===e.rhs})},j=function(e){return F(e,"bceidApproved")},R=function(e){return F(e,"githubApproved")},I=function(e){return F(e,"digitalCredentialApproved")},T=function(e){var t=new Date;return t.setDate(t.getDate()-e),t}},84595:function(e,t,r){"use strict";r.d(t,{W:function(){return p}});var n,i=r(50029),a=r(87794),o=r.n(a),s=r(31166),u=r(11752),c=r.n(u),l=r(16689),f=r(31513),d=(c()()||{}).publicRuntimeConfig,h=(void 0===d?{}:d).sso_client_id,p=(n=(0,i.Z)(o().mark(function e(t){var r,n,i,a,u;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return",[,"e02"]);case 2:if(r=l.$.keys,n=(0,f.ob)(t),void 0!==(i=null==r?void 0:r.find(function(e){return e.kid===n.kid}))){e.next=8;break}return console.error("public key not found in JWK jwks.json"),e.abrupt("return",[,"e02"]);case 8:if(a=(0,f.QE)(t),!(Date.now()>=1e3*a.exp)){e.next=12;break}return console.log("token has expired"),e.abrupt("return",[,"e02"]);case 12:if(u=s.KZ.getKey(i),s.fs.jws.JWS.verifyJWT(t,u,{alg:["RS256"],gracePeriod:28800})){e.next=17;break}return console.error("signature verification failed"),e.abrupt("return",[,"e02"]);case 17:if(!(0!==a.aud.localeCompare(h))){e.next=21;break}return console.error("token was not issued for this audience"),e.abrupt("return",[,"e02"]);case 21:if(["idir","azureidir"].includes(a.identity_provider)){e.next=24;break}return console.error("invalid identity provider ".concat(a.identity_provider)),e.abrupt("return",[,"e03"]);case 24:if(!(!a.idir_user_guid||!a.email)){e.next=27;break}return console.error("invalid user account"),e.abrupt("return",[,"e03"]);case 27:return e.abrupt("return",[a]);case 28:case"end":return e.stop()}},e)})),function(e){return n.apply(this,arguments)})},88757:function(e,t,r){"use strict";r.d(t,{dx:function(){return j},hP:function(){return _},iq:function(){return k},kG:function(){return F},rg:function(){return R}});var n,i,a,o=r(59499),s=r(50029),u=r(87794),c=r.n(u),l=r(9669),f=r.n(l),d=r(80129),h=r.n(d),p=r(11752),m=r.n(p),g=r(16689),y=r(31513);function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}var x=(m()()||{}).publicRuntimeConfig,S=void 0===x?{}:x,w=S.sso_client_id,E=S.sso_authorization_scope,A=S.sso_authorization_response_mode,C=S.sso_authorization_response_type,P=S.sso_redirect_uri,O=S.sso_token_grant_type,k=(n=(0,s.Z)(c().mark(function e(t){var r,n,i,a,s,u;return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=(0,y.zO)(),n=(0,y.zO)(),sessionStorage.setItem("oauth_state",r),sessionStorage.setItem("oidc_nonce",n),i=(0,y.zO)(),sessionStorage.setItem("code_verifier",i),e.next=8,(0,y.qu)(i);case 8:return a=e.sent,s=(0,y.z9)(a),sessionStorage.setItem("code_challenge",s),u=function(e){for(var t=1;tf&&t[r].addError("Must be ".concat(f/60," minutes or fewer."))}},Z=function(e,r){return function(){e>d&&t[r].addError("Must be ".concat(d/60," minutes or fewer."))}},G={projectName:function(){/^\d/.test(i)&&t.projectName.addError("Please have your project name start with a letter")},authType:function(){"browser-login"!==K&&W&&t.authType.addError("Ensure your access is confidential when using a service account.")},devSessionIdleTimeout:q(B,"devSessionIdleTimeout"),testSessionIdleTimeout:q(H,"testSessionIdleTimeout"),prodSessionIdleTimeout:q($,"prodSessionIdleTimeout"),devSessionMaxLifespan:Z(U,"devSessionMaxLifespan"),testSessionMaxLifespan:Z(z,"testSessionMaxLifespan"),prodSessionMaxLifespan:Z(V,"prodSessionMaxLifespan"),devValidRedirectUris:function(){h.every(u)||p(h,t,"devValidRedirectUris",u)},testValidRedirectUris:function(){S.includes("test")&&!g.every(u)&&p(g,t,"testValidRedirectUris",u)},prodValidRedirectUris:function(){S.includes("prod")&&!b.every(c)&&p(b,t,"prodValidRedirectUris",c)},createTeam:function(){if(w&&(!E||""==E)){var e;null===(e=t.createTeam)||void 0===e||e.addError("Please select or create a team")}},additionalRoleAttribute:function(){a.hL.includes(C.trim())&&t.additionalRoleAttribute.addError("Please use a different name as existing claim '".concat(C.trim(),"' cannot be overwritten"))},devSamlLogoutPostBindingUri:function(){""===O||null===O||u(O)||t.devSamlLogoutPostBindingUri.addError(l)},testSamlLogoutPostBindingUri:function(){""===_||null===_||u(_)||t.testSamlLogoutPostBindingUri.addError(l)},prodSamlLogoutPostBindingUri:function(){""===j||null===j||c(j)||t.prodSamlLogoutPostBindingUri.addError(l)},clientId:function(){""!==I&&null!==I&&(I!==I.trim()||I.match(/\s/))&&t.clientId.addError("Client id is not valid")},devIdps:function(){"saml"===M&&D.length>1&&t.devIdps.addError("Only one identity provider is allowed for saml integrations"),"saml"===M&&(0,o.S3)(e)&&t.devIdps.addError("Digital Credential is not allowed for saml integrations")},projectLead:function(){!1===w&&!1===L&&t.projectLead.addError("")}};r||(r=Object.keys(G));for(var Y=0;Y0,u=i()(e,t,s?(o=t.customValidation,function(e,t){return h(e,t,o)}):void 0).errors;u.length>0&&(n[a]=u)}}),n}},96086:function(e){"use strict";var t=Object.assign.bind(Object);e.exports=t,e.exports.default=e.exports},6840:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return r(24444)}])},21876:function(e){!function(){var t={675:function(e,t){"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return(r+n)*3/4-n},t.toByteArray=function(e){var t,r,a=u(e),o=a[0],s=a[1],c=new i((o+s)*3/4-s),l=0,f=s>0?o-4:o;for(r=0;r>16&255,c[l++]=t>>8&255,c[l++]=255&t;return 2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t),1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=0,s=n-i;o>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}(e,o,o+16383>s?s:o+16383));return 1===i?a.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===i&&a.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),a.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,s=a.length;o0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},72:function(e,t,r){"use strict";/*! + */var to=function(){var e=RegExp('(?:false|true|null|[\\{\\}\\[\\]]|(?:-?\\b(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\\b)|(?:"(?:[^\\0-\\x08\\x0a-\\x1f"\\\\]|\\\\(?:["/\\\\bfnrt]|u[0-9A-Fa-f]{4}))*"))',"g"),t=RegExp("\\\\(?:([^u])|u(.{4}))","g"),r={'"':'"',"/":"/","\\":"\\",b:"\b",f:"\f",n:"\n",r:"\r",t:" "};function n(e,t,n){return t?r[t]:String.fromCharCode(parseInt(n,16))}var i=new String(""),a=Object.hasOwnProperty;return function(r,o){var s,u,c,l=r.match(e),f=l[0],d=!1;"{"===f?s={}:"["===f?s=[]:(s=[],d=!0);for(var h=[s],p=1-d,m=l.length;p=0;)delete r[n[u]]}return o.call(e,t,r)};s=g({"":s},"")}return s}}();void 0!==d&&d||(d={}),void 0!==d.asn1&&d.asn1||(d.asn1={}),d.asn1.ASN1Util=new function(){this.integerToByteHex=function(e){var t=e.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(e){var t=e.toString(16);if("-"!=t.substr(0,1))t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{var r=t.substr(1).length;r%2==1?r+=1:t.match(/^[0-7]/)||(r+=2);for(var n="",i=0;i15)throw Error("ASN.1 length too long to represent by 8x: n = "+e.toString(16));return(128+r).toString(16)+t},this.tohex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getEncodedHex=function(){return this.tohex()},this.getValueHex=function(){return this.tohex(),this.hV},this.getFreshValueHex=function(){return""},this.setByParam=function(e){this.params=e},void 0!=e&&void 0!=e.tlv&&(this.hTLV=e.tlv,this.isModified=!1)},d.asn1.DERAbstractString=function(e){d.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=tp(this.s).toLowerCase()},this.setStringHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e?this.setString(e):void 0!==e.str?this.setString(e.str):void 0!==e.hex&&this.setStringHex(e.hex))},tD(d.asn1.DERAbstractString,d.asn1.ASN1Object),d.asn1.DERAbstractTime=function(e){d.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(e){var t=e.getTime()+6e4*e.getTimezoneOffset();return new Date(t)},this.formatDate=function(e,t,r){var n=this.zeroPadding,i=this.localDateToUTC(e),a=String(i.getFullYear());"utc"==t&&(a=a.substr(2,2));var o=a+n(String(i.getMonth()+1),2)+n(String(i.getDate()),2)+n(String(i.getHours()),2)+n(String(i.getMinutes()),2)+n(String(i.getSeconds()),2);if(!0===r){var s=i.getMilliseconds();if(0!=s){var u=n(String(s),3);o=o+"."+(u=u.replace(/[0]+$/,""))}}return o+"Z"},this.zeroPadding=function(e,t){return e.length>=t?e:Array(t-e.length+1).join("0")+e},this.setByParam=function(e){this.hV=null,this.hTLV=null,this.params=e},this.getString=function(){},this.setString=function(e){this.hTLV=null,this.isModified=!0,void 0==this.params&&(this.params={}),this.params.str=e},this.setByDate=function(e){this.hTLV=null,this.isModified=!0,void 0==this.params&&(this.params={}),this.params.date=e},this.setByDateValue=function(e,t,r,n,i,a){var o=new Date(Date.UTC(e,t-1,r,n,i,a,0));this.setByDate(o)},this.getFreshValueHex=function(){return this.hV}},tD(d.asn1.DERAbstractTime,d.asn1.ASN1Object),d.asn1.DERAbstractStructured=function(e){d.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array=e},this.appendASN1Object=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array.push(e)},this.asn1Array=[],void 0!==e&&void 0!==e.array&&(this.asn1Array=e.array)},tD(d.asn1.DERAbstractStructured,d.asn1.ASN1Object),d.asn1.DERBoolean=function(e){d.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",!1==e?this.hTLV="010100":this.hTLV="0101ff"},tD(d.asn1.DERBoolean,d.asn1.ASN1Object),d.asn1.DERInteger=function(e){d.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=d.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new E(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.bigint?this.setByBigInteger(e.bigint):void 0!==e.int?this.setByInteger(e.int):"number"==typeof e?this.setByInteger(e):void 0!==e.hex&&this.setValueHex(e.hex))},tD(d.asn1.DERInteger,d.asn1.ASN1Object),d.asn1.DERBitString=function(e){if(void 0!==e&&void 0!==e.obj){var t=d.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.tohex()}d.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(e){this.hTLV=null,this.isModified=!0,this.hV=e},this.setUnusedBitsAndHexValue=function(e,t){if(e<0||7>6,i=128|63&r;return tm(n.toString(16)+i.toString(16))}var n=224|(240&t)>>4,i=128|(15&t)<<2|(192&r)>>6;return tm(n.toString(16)+i.toString(16)+(128|63&r).toString(16))}).join("")}function tk(e){for(var t=encodeURIComponent(e),r="",n=0;n"7"?"00"+e:e}function tR(e){if(!t_(e))return null;try{var t=[],r=e.substr(0,2),n=parseInt(r,16);t[0]=new String(Math.floor(n/40)),t[1]=new String(n%40);for(var i=e.substr(2),a=[],o=0;o0&&(c=c+"."+s.join(".")),c}catch(e){return null}}ts.getLblen=function(e,t){if("8"!=e.substr(t+2,1))return 1;var r=parseInt(e.substr(t+3,1));return 0==r?-1:0=n)break}return a},ts.getNthChildIdx=function(e,t,r){return ts.getChildIdx(e,t)[r]},ts.getIdxbyList=function(e,t,r,n){var i,a;return 0==r.length?void 0!==n&&e.substr(t,2)!==n?-1:t:(i=r.shift())>=(a=ts.getChildIdx(e,t)).length?-1:ts.getIdxbyList(e,a[i],r,n)},ts.getIdxbyListEx=function(e,t,r,n){if(0==r.length)return void 0!==n&&e.substr(t,2)!==n?-1:t;i=r.shift(),a=ts.getChildIdx(e,t);for(var i,a,o=0,s=0;s=e.length?null:ts.getTLV(e,i)},ts.getTLVbyListEx=function(e,t,r,n){var i=ts.getIdxbyListEx(e,t,r,n);return -1==i?null:ts.getTLV(e,i)},ts.getVbyList=function(e,t,r,n,i){var a,o;return -1==(a=ts.getIdxbyList(e,t,r,n))||a>=e.length?null:(o=ts.getV(e,a),!0===i&&(o=o.substr(2)),o)},ts.getVbyListEx=function(e,t,r,n,i){var a,o;return -1==(a=ts.getIdxbyListEx(e,t,r,n))?null:(o=ts.getV(e,a),"03"==e.substr(a,2)&&!1!==i&&(o=o.substr(2)),o)},ts.getInt=function(e,t,r){void 0==r&&(r=-1);try{var n=e.substr(t,2);if("02"!=n&&"03"!=n)return r;var i=ts.getV(e,t);if("02"==n)return parseInt(i,16);return function(e){if(e.length%2!=0||null==(e=e.toLowerCase()).match(/^[0-9a-f]+$/))return -1;try{var t=e.substr(0,2);if("00"==t)return parseInt(e.substr(2),16);var r=parseInt(t,16);if(r>7)return -1;var n=e.substr(2),i=parseInt(n,16).toString(2);"0"==i&&(i="00000000"),i=i.slice(0,0-r);var a=parseInt(i,2);if(a==NaN)return -1;return a}catch(e){return -1}}(i)}catch(e){return r}},ts.getOID=function(e,t,r){void 0==r&&(r=null);try{if("06"!=e.substr(t,2))return r;var n=ts.getV(e,t);return tR(n)}catch(e){return r}},ts.getOIDName=function(e,t,r){void 0==r&&(r=null);try{var n=ts.getOID(e,t,r);if(n==r)return r;var i=d.asn1.x509.OID.oid2name(n);if(""==i)return n;return i}catch(e){return r}},ts.getString=function(e,t,r){void 0==r&&(r=null);try{var n=ts.getV(e,t);return tv(n)}catch(e){return r}},ts.hextooidstr=function(e){var t=function(e,t){return e.length>=t?e:Array(t-e.length+1).join("0")+e},r=[],n=parseInt(e.substr(0,2),16);r[0]=new String(Math.floor(n/40)),r[1]=new String(n%40);for(var i=e.substr(2),a=[],o=0;o0&&(c=c+"."+s.join(".")),c},ts.dump=function(e,t,r,n){var i=ts.getV,a=ts.dump,o=ts.getChildIdx,s=e;e instanceof d.asn1.ASN1Object&&(s=e.tohex());var u=function(e,t){return e.length<=2*t?e:e.substr(0,t)+"..(total "+e.length/2+"bytes).."+e.substr(e.length-t,t)};void 0===t&&(t={ommit_long_octet:32}),void 0===r&&(r=0),void 0===n&&(n="");var c=t.ommit_long_octet,l=s.substr(r,2);if("01"==l){var f=i(s,r);return"00"==f?n+"BOOLEAN FALSE\n":n+"BOOLEAN TRUE\n"}if("02"==l){var f=i(s,r);return n+"INTEGER "+u(f,c)+"\n"}if("03"==l){var f=i(s,r);if(!ts.isASN1HEX(f.substr(2)))return n+"BITSTRING "+u(f,c)+"\n";var h=n+"BITSTRING, encapsulates\n";return h+a(f.substr(2),t,0,n+" ")}if("04"==l){var f=i(s,r);if(!ts.isASN1HEX(f))return n+"OCTETSTRING "+u(f,c)+"\n";var h=n+"OCTETSTRING, encapsulates\n";return h+a(f,t,0,n+" ")}if("05"==l)return n+"NULL\n";if("06"==l){var p=i(s,r),m=d.asn1.ASN1Util.oidHexToInt(p),g=d.asn1.x509.OID.oid2name(m),y=m.replace(/\./g," ");return""!=g?n+"ObjectIdentifier "+g+" ("+y+")\n":n+"ObjectIdentifier ("+y+")\n"}if("0a"==l)return n+"ENUMERATED "+parseInt(i(s,r))+"\n";if("0c"==l)return n+"UTF8String '"+tm(i(s,r))+"'\n";if("13"==l)return n+"PrintableString '"+tm(i(s,r))+"'\n";if("14"==l)return n+"TeletexString '"+tm(i(s,r))+"'\n";if("16"==l)return n+"IA5String '"+tm(i(s,r))+"'\n";if("17"==l)return n+"UTCTime "+tm(i(s,r))+"\n";if("18"==l)return n+"GeneralizedTime "+tm(i(s,r))+"\n";if("1a"==l)return n+"VisualString '"+tm(i(s,r))+"'\n";if("1e"==l)return n+"BMPString '"+tO(i(s,r))+"'\n";if("30"==l){if("3000"==s.substr(r,4))return n+"SEQUENCE {}\n";var h=n+"SEQUENCE\n",b=o(s,r),x=t;if((2==b.length||3==b.length)&&"06"==s.substr(b[0],2)&&"04"==s.substr(b[b.length-1],2)){var g=ts.oidname(i(s,b[0])),S=JSON.parse(JSON.stringify(t));S.x509ExtName=g,x=S}for(var w=0;w4?{enum:{hex:h}}:{enum:parseInt(h,16)};if("30"==l||"31"==l)return f[c[l]]=function(e){for(var r=[],n=a(e,0),o=0;o31)return!1;if((192&r)==128&&(31&r)==n)return!0;return!1}catch(e){return!1}},ts.isASN1HEX=function(e){if(e.length%2==1)return!1;var t=ts.getVblen(e,0),r=e.substr(0,2),n=ts.getL(e,0);return e.length-r.length-n.length==2*t},ts.checkStrictDER=function(e,t,r,n,i){if(void 0===r){if("string"!=typeof e||(e=e.toLowerCase(),!d.lang.String.isHex(e)))throw Error("not hex string");r=e.length,i=(n=e.length/2)<128?1:Math.ceil(n.toString(16))+1}if(ts.getL(e,t).length>2*i)throw Error("L of TLV too long: idx="+t);var a=ts.getVblen(e,t);if(a>n)throw Error("value of L too long than hex: idx="+t);var o=ts.getTLV(e,t),s=o.length-2-ts.getL(e,t).length;if(s!==2*a)throw Error("V string length and L's value not the same:"+s+"/"+2*a);if(0===t&&e.length!=o.length)throw Error("total length and TLV length unmatch:"+e.length+"!="+o.length);var u=e.substr(t,2);if("02"===u){var c=ts.getVidx(e,t);if("00"==e.substr(c,2)&&56>e.charCodeAt(c+2))throw Error("not least zeros for DER INTEGER")}if(32&parseInt(u,16)){for(var l=ts.getVblen(e,t),f=0,h=ts.getChildIdx(e,t),p=0;p0&&e.push(new n({tag:"a3",obj:new c(t.ext)})),new d.asn1.DERSequence({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},tD(d.asn1.x509.TBSCertificate,d.asn1.ASN1Object),d.asn1.x509.Extensions=function(e){d.asn1.x509.Extensions.superclass.constructor.call(this);var t=d.asn1,r=t.DERSequence,n=t.x509;this.aParam=[],this.setByParam=function(e){this.aParam=e},this.tohex=function(){for(var e=[],t=0;t-1&&e.push(new n({int:this.pathLen}));var t=new i({array:e});return this.asn1ExtnValue=t,this.asn1ExtnValue.tohex()},this.oid="2.5.29.19",this.cA=!1,this.pathLen=-1,void 0!==e&&(void 0!==e.cA&&(this.cA=e.cA),void 0!==e.pathLen&&(this.pathLen=e.pathLen))},tD(d.asn1.x509.BasicConstraints,d.asn1.x509.Extension),d.asn1.x509.CRLDistributionPoints=function(e){d.asn1.x509.CRLDistributionPoints.superclass.constructor.call(this,e);var t=d.asn1,r=t.x509;this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.setByDPArray=function(e){for(var n=[],i=0;i0&&e.push(new r({array:t}))}return new r({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&(this.params=e)},tD(d.asn1.x509.PolicyInformation,d.asn1.ASN1Object),d.asn1.x509.PolicyQualifierInfo=function(e){d.asn1.x509.PolicyQualifierInfo.superclass.constructor.call(this,e);var t=d.asn1,r=t.DERSequence,n=t.DERIA5String,i=t.DERObjectIdentifier,a=t.x509.UserNotice;this.params=null,this.tohex=function(){if(void 0!==this.params.cps){var e=new r({array:[new i({oid:"1.3.6.1.5.5.7.2.1"}),new n({str:this.params.cps})]});return e.tohex()}if(void 0!=this.params.unotice){var e=new r({array:[new i({oid:"1.3.6.1.5.5.7.2.2"}),new a(this.params.unotice)]});return e.tohex()}},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&(this.params=e)},tD(d.asn1.x509.PolicyQualifierInfo,d.asn1.ASN1Object),d.asn1.x509.UserNotice=function(e){d.asn1.x509.UserNotice.superclass.constructor.call(this,e);var t=d.asn1.DERSequence,r=(d.asn1.DERInteger,d.asn1.x509.DisplayText),n=d.asn1.x509.NoticeReference;this.params=null,this.tohex=function(){var e=[];return void 0!==this.params.noticeref&&e.push(new n(this.params.noticeref)),void 0!==this.params.exptext&&e.push(new r(this.params.exptext)),new t({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&(this.params=e)},tD(d.asn1.x509.UserNotice,d.asn1.ASN1Object),d.asn1.x509.NoticeReference=function(e){d.asn1.x509.NoticeReference.superclass.constructor.call(this,e);var t=d.asn1.DERSequence,r=d.asn1.DERInteger,n=d.asn1.x509.DisplayText;this.params=null,this.tohex=function(){var e=[];if(void 0!==this.params.org&&e.push(new n(this.params.org)),void 0!==this.params.noticenum){for(var i=[],a=this.params.noticenum,o=0;o0)for(var e=0;e0;i++){var a=t.shift();if(!0===r){var o=(n.pop()+","+a).replace(/\\,/g,",");n.push(o),r=!1}else n.push(a);"\\"===a.substr(-1,1)&&(r=!0)}return(n=n.map(function(e){return e.replace("/","\\/")})).reverse(),"/"+n.join("/")},d.asn1.x509.X500Name.ldapToOneline=function(e){return d.asn1.x509.X500Name.ldapToCompat(e)},d.asn1.x509.RDN=function(e){d.asn1.x509.RDN.superclass.constructor.call(this),this.asn1Array=[],this.paramArray=[],this.sRule="utf8";var t=d.asn1.x509.AttributeTypeAndValue;this.setByParam=function(e){void 0!==e.rule&&(this.sRule=e.rule),void 0!==e.str&&this.addByMultiValuedString(e.str),void 0!==e.array&&(this.paramArray=e.array)},this.addByString=function(e){this.asn1Array.push(new d.asn1.x509.AttributeTypeAndValue({str:e,rule:this.sRule}))},this.addByMultiValuedString=function(e){for(var t=d.asn1.x509.RDN.parseString(e),r=0;r0)for(var e=0;e0;i++){var a=t.shift();if(!0===r){var o=(n.pop()+"+"+a).replace(/\\\+/g,"+");n.push(o),r=!1}else n.push(a);"\\"===a.substr(-1,1)&&(r=!0)}for(var s=!1,u=[],i=0;n.length>0;i++){var a=n.shift();if(!0===s){var c=u.pop();if(a.match(/"$/)){var o=(c+"+"+a).replace(/^([^=]+)="(.*)"$/,"$1=$2");u.push(o),s=!1}else u.push(c+"+"+a)}else u.push(a);a.match(/^[^=]+="/)&&(s=!0)}return u},d.asn1.x509.AttributeTypeAndValue=function(e){d.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this),this.sRule="utf8",this.sType=null,this.sValue=null,this.dsType=null;var t=d,r=t.asn1,n=r.DERSequence,i=r.DERUTF8String,a=r.DERPrintableString,o=r.DERTeletexString,s=r.DERIA5String,u=r.DERVisibleString,c=r.DERBMPString,l=t.lang.String.isMail,f=t.lang.String.isPrintable;this.setByParam=function(e){if(void 0!==e.rule&&(this.sRule=e.rule),void 0!==e.ds&&(this.dsType=e.ds),void 0===e.value&&void 0!==e.str){var t=e.str.match(/^([^=]+)=(.+)$/);if(t)this.sType=t[1],this.sValue=t[2];else throw Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr)}else this.sType=e.type,this.sValue=e.value},this.setByString=function(e,t){void 0!==t&&(this.sRule=t);var r=e.match(/^([^=]+)=(.+)$/);if(r)this.setByAttrTypeAndValueStr(r[1],r[2]);else throw Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr)},this._getDsType=function(){var e=this.sType,t=this.sValue,r=this.sRule;if("prn"===r){if("CN"==e&&l(t))return"ia5";if(f(t))return"prn"}else if("utf8"===r){if("CN"==e&&l(t))return"ia5";if("C"==e)return"prn"}return"utf8"},this.setByAttrTypeAndValueStr=function(e,t,r){void 0!==r&&(this.sRule=r),this.sType=e,this.sValue=t},this.getValueObj=function(e,t){if("utf8"==e)return new i({str:t});if("prn"==e)return new a({str:t});if("tel"==e)return new o({str:t});if("ia5"==e)return new s({str:t});if("vis"==e)return new u({str:t});if("bmp"==e)return new c({str:t});throw Error("unsupported directory string type: type="+e+" value="+t)},this.tohex=function(){null==this.dsType&&(this.dsType=this._getDsType());var e=d.asn1.x509.OID.atype2obj(this.sType),t=this.getValueObj(this.dsType,this.sValue),r=new n({array:[e,t]});return this.TLV=r.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},tD(d.asn1.x509.AttributeTypeAndValue,d.asn1.ASN1Object),d.asn1.x509.SubjectPublicKeyInfo=function(e){d.asn1.x509.SubjectPublicKeyInfo.superclass.constructor.call(this);var t=d,r=t.asn1,n=r.DERInteger,i=r.DERBitString,a=r.DERObjectIdentifier,o=r.DERSequence,s=r.ASN1Util.newObject,u=r.x509.AlgorithmIdentifier,c=t.crypto;c.ECDSA,c.DSA,this.getASN1Object=function(){if(null==this.asn1AlgId||null==this.asn1SubjPKey)throw"algId and/or subjPubKey not set";return new o({array:[this.asn1AlgId,this.asn1SubjPKey]})},this.tohex=function(){var e=this.getASN1Object();return this.hTLV=e.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},this.setPubKey=function(e){try{if(e instanceof tt){var t=s({seq:[{int:{bigint:e.n}},{int:{int:e.e}}]}).tohex();this.asn1AlgId=new u({name:"rsaEncryption"}),this.asn1SubjPKey=new i({hex:"00"+t})}}catch(e){}try{if(e instanceof d.crypto.ECDSA){var r=new a({name:e.curveName});this.asn1AlgId=new u({name:"ecPublicKey",asn1params:r}),this.asn1SubjPKey=new i({hex:"00"+e.pubKeyHex})}}catch(e){}try{if(e instanceof d.crypto.DSA){var r=new s({seq:[{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}}]});this.asn1AlgId=new u({name:"dsa",asn1params:r});var o=new n({bigint:e.y});this.asn1SubjPKey=new i({hex:"00"+o.tohex()})}}catch(e){}},void 0!==e&&this.setPubKey(e)},tD(d.asn1.x509.SubjectPublicKeyInfo,d.asn1.ASN1Object),d.asn1.x509.Time=function(e){d.asn1.x509.Time.superclass.constructor.call(this);var t=d.asn1,r=t.DERUTCTime,n=t.DERGeneralizedTime;this.params=null,this.type=null,this.setTimeParams=function(e){this.timeParams=e},this.setByParam=function(e){this.params=e},this.getType=function(e){return e.match(/^[0-9]{12}Z$/)?"utc":e.match(/^[0-9]{14}Z$/)?"gen":e.match(/^[0-9]{12}\.[0-9]+Z$/)?"utc":e.match(/^[0-9]{14}\.[0-9]+Z$/)?"gen":null},this.tohex=function(){var e=this.params,t=null;if("string"==typeof e&&(e={str:e}),null!=e&&e.str&&(null==e.type||void 0==e.type)&&(e.type=this.getType(e.str)),null!=e&&e.str?("utc"==e.type&&(t=new r(e.str)),"gen"==e.type&&(t=new n(e.str))):t="gen"==this.type?new n:new r,null==t)throw Error("wrong setting for Time");return this.TLV=t.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},void 0!=e&&this.setByParam(e)},d.asn1.x509.Time_bak=function(e){d.asn1.x509.Time_bak.superclass.constructor.call(this);var t=d.asn1,r=t.DERUTCTime,n=t.DERGeneralizedTime;this.setTimeParams=function(e){this.timeParams=e},this.tohex=function(){var e=null;return e=null!=this.timeParams?"utc"==this.type?new r(this.timeParams):new n(this.timeParams):"utc"==this.type?new r:new n,this.TLV=e.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},this.type="utc",void 0!==e&&(void 0!==e.type?this.type=e.type:void 0!==e.str&&(e.str.match(/^[0-9]{12}Z$/)&&(this.type="utc"),e.str.match(/^[0-9]{14}Z$/)&&(this.type="gen")),this.timeParams=e)},tD(d.asn1.x509.Time,d.asn1.ASN1Object),d.asn1.x509.AlgorithmIdentifier=function(e){d.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this),this.nameAlg=null,this.asn1Alg=null,this.asn1Params=null,this.paramEmpty=!1;var t=d.asn1,r=t.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV;if(this.tohex=function(){if(null===this.nameAlg&&null===this.asn1Alg)throw Error("algorithm not specified");if(null!==this.nameAlg){var e=null;for(var n in r)n===this.nameAlg&&(e=r[n]);if(null!==e)return this.hTLV=e,this.hTLV}null!==this.nameAlg&&null===this.asn1Alg&&(this.asn1Alg=t.x509.OID.name2obj(this.nameAlg));var i=[this.asn1Alg];null!==this.asn1Params&&i.push(this.asn1Params);var a=new t.DERSequence({array:i});return this.hTLV=a.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&(void 0!==e.name&&(this.nameAlg=e.name),void 0!==e.asn1params&&(this.asn1Params=e.asn1params),void 0!==e.paramempty&&(this.paramEmpty=e.paramempty)),null===this.asn1Params&&!1===this.paramEmpty&&null!==this.nameAlg){void 0!==this.nameAlg.name&&(this.nameAlg=this.nameAlg.name);var n=this.nameAlg.toLowerCase();"withdsa"!==n.substr(-7,7)&&"withecdsa"!==n.substr(-9,9)&&(this.asn1Params=new t.DERNull)}},tD(d.asn1.x509.AlgorithmIdentifier,d.asn1.ASN1Object),d.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"},d.asn1.x509.GeneralName=function(e){d.asn1.x509.GeneralName.superclass.constructor.call(this);var t=d.asn1,r=t.x509,n=r.X500Name,i=r.OtherName,a=t.DERIA5String,o=(t.DERPrintableString,t.DEROctetString),s=t.DERTaggedObject,u=t.ASN1Object,c=Error;this.params=null,this.setByParam=function(e){this.params=e},this.tohex=function(){var e=this.params,t=!1;if(void 0!==e.other)r="a0",l=new i(e.other);else if(void 0!==e.rfc822)r="81",l=new a({str:e.rfc822});else if(void 0!==e.dns)r="82",l=new a({str:e.dns});else if(void 0!==e.dn)r="a4",t=!0,l="string"==typeof e.dn?new n({str:e.dn}):e.dn instanceof d.asn1.x509.X500Name?e.dn:new n(e.dn);else if(void 0!==e.ldapdn)r="a4",t=!0,l=new n({ldapstr:e.ldapdn});else if(void 0!==e.certissuer||void 0!==e.certsubj){r="a4",t=!0;var r,t,l,f,h,p,m=null;if(void 0!==e.certsubj?(f=!1,h=e.certsubj):(f=!0,h=e.certissuer),h.match(/^[0-9A-Fa-f]+$/),-1!=h.indexOf("-----BEGIN ")&&(m=tb(h)),null==m)throw Error("certsubj/certissuer not cert");var g=new tH;g.hex=m,p=f?g.getIssuerHex():g.getSubjectHex(),(l=new u).hTLV=p}else if(void 0!==e.uri)r="86",l=new a({str:e.uri});else if(void 0!==e.ip){r="87";var y,b=e.ip;try{if(b.match(/^[0-9a-f]+$/)){var x=b.length;if(8==x||16==x||32==x||64==x)y=b;else throw"err"}else y=function e(t){var r=Error("malformed IP address");if(!(t=t.toLowerCase(t)).match(/^[0-9a-f.:/]+$/))throw r;if(t.match(/^[0-9.]+$/)){var n=t.split(".");if(4!==n.length)throw r;var i="";try{for(var a=0;a<4;a++){var o=parseInt(n[a]);i+=("0"+o.toString(16)).slice(-2)}return i}catch(e){throw r}}else{if(t.match(/^[0-9.]+\/[0-9]+$/)){var s=t.split("/");return e(s[0])+tP(parseInt(s[1]),32)}if(t.match(/^[0-9a-f:]+$/)&&-1!==t.indexOf(":"))return tw(t);if(t.match(/^[0-9a-f:]+\/[0-9]+$/)&&-1!==t.indexOf(":")){var s=t.split("/");return tw(s[0])+tP(parseInt(s[1]),128)}throw r}}(b)}catch(t){throw new c("malformed IP address: "+e.ip+":"+t.message)}l=new o({hex:y})}else throw new c("improper params");return new s({tag:r,explicit:t,obj:l}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},tD(d.asn1.x509.GeneralName,d.asn1.ASN1Object),d.asn1.x509.GeneralNames=function(e){d.asn1.x509.GeneralNames.superclass.constructor.call(this);var t=d.asn1;this.setByParamArray=function(e){for(var r=0;r0){for(var r=n(e.valhex,t[0]),i=u(r,0),a=[],o=0;o1){var l=n(e.valhex,t[1]);e.polhex=l}delete e.valhex},this.setSignaturePolicyIdentifier=function(e){var t=u(e.valhex,0);if(t.length>0){var i=ts.getOID(e.valhex,t[0]);e.oid=i}if(t.length>1){var a=new tH,o=u(e.valhex,t[1]),s=n(e.valhex,o[0]),c=a.getAlgorithmIdentifierName(s);e.alg=c;var l=r(e.valhex,o[1]);e.hash=l}delete e.valhex},this.setSigningCertificateV2=function(e){var t=u(e.valhex,0);if(t.length>0){for(var r=n(e.valhex,t[0]),i=u(r,0),a=[],o=0;o1){var l=n(e.valhex,t[1]);e.polhex=l}delete e.valhex},this.getESSCertID=function(e){var t={},i=u(e,0);if(i.length>0){var a=r(e,i[0]);t.hash=a}if(i.length>1){var o=n(e,i[1]),s=this.getIssuerSerial(o);void 0!=s.serial&&(t.serial=s.serial),void 0!=s.issuer&&(t.issuer=s.issuer)}return t},this.getESSCertIDv2=function(i){var a={},o=u(i,0);if(o.length<1||3s+1){var f=n(i,o[s+1]),d=this.getIssuerSerial(f);a.issuer=d.issuer,a.serial=d.serial}return a},this.getIssuerSerial=function(e){var i={},a=u(e,0),o=n(e,a[0]),s=t.getGeneralNames(o)[0].dn;i.issuer=s;var c=r(e,a[1]);return i.serial={hex:c},i},this.getCertificateSet=function(e){for(var t=u(e,0),r=[],i=0;i=0;o--)i+=n[o];return i}if("string"==typeof e&&void 0!=a[e])return tT([e],a);if("object"==typeof e&&void 0!=e.length)return tT(e,a);throw new t("wrong params")},this.tohex=function(){this.params;var e=this.getBinValue();return new n({bin:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!=e&&this.setByParam(e)},tD(d.asn1.tsp.PKIFailureInfo,d.asn1.ASN1Object),d.asn1.tsp.AbstractTSAAdapter=function(e){this.getTSTHex=function(e,t){throw"not implemented yet"}},d.asn1.tsp.SimpleTSAAdapter=function(e){var t=d,r=t.asn1.tsp,n=t.crypto.Util.hashHex;r.SimpleTSAAdapter.superclass.constructor.call(this),this.params=null,this.serial=0,this.getTSTHex=function(e,t){var i=n(e,t);return this.params.econtent.content.messageImprint={alg:t,hash:i},this.params.econtent.content.serial={int:this.serial++},this.params.econtent.content.nonce={int:Math.floor(1e9*Math.random())},new r.TimeStampToken(this.params).getContentInfoEncodedHex()},void 0!==e&&(this.params=e)},tD(d.asn1.tsp.SimpleTSAAdapter,d.asn1.tsp.AbstractTSAAdapter),d.asn1.tsp.FixedTSAAdapter=function(e){var t=d,r=t.asn1.tsp,n=t.crypto.Util.hashHex;r.FixedTSAAdapter.superclass.constructor.call(this),this.params=null,this.getTSTHex=function(e,t){var i=n(e,t);return this.params.econtent.content.messageImprint={alg:t,hash:i},new r.TimeStampToken(this.params).getContentInfoEncodedHex()},void 0!==e&&(this.params=e)},tD(d.asn1.tsp.FixedTSAAdapter,d.asn1.tsp.AbstractTSAAdapter),d.asn1.tsp.TSPUtil=new function(){},d.asn1.tsp.TSPUtil.newTimeStampToken=function(e){return new d.asn1.tsp.TimeStampToken(e)},d.asn1.tsp.TSPUtil.parseTimeStampReq=function(e){return new d.asn1.tsp.TSPParser().getTimeStampReq(e)},d.asn1.tsp.TSPUtil.parseMessageImprint=function(e){return new d.asn1.tsp.TSPParser().getMessageImprint(e)},d.asn1.tsp.TSPParser=function(){var e=new tH,t=ts.getV,r=ts.getTLV,n=ts.getIdxbyList,i=(ts.getTLVbyListEx,ts.getChildIdx),a=["granted","grantedWithMods","rejection","waiting","revocationWarning","revocationNotification"],o={0:"badAlg",2:"badRequest",5:"badDataFormat",14:"timeNotAvailable",15:"unacceptedPolicy",16:"unacceptedExtension",17:"addInfoNotAvailable",25:"systemFailure"};this.getResponse=function(e){var t=i(e,0);if(1==t.length)return this.getPKIStatusInfo(r(e,t[0]));if(t.length>1){var n=this.getPKIStatusInfo(r(e,t[0])),a=r(e,t[1]),o=this.getToken(a);return o.statusinfo=n,o}},this.getToken=function(e){var t=(new d.asn1.cms.CMSParser).getCMSSignedData(e);return this.setTSTInfo(t),t},this.setTSTInfo=function(e){var t=e.econtent;if("tstinfo"==t.type){var r=t.content.hex,n=this.getTSTInfo(r);t.content=n}},this.getTSTInfo=function(n){var a={},o=i(n,0),s=t(n,o[1]);a.policy=tR(s);var u=r(n,o[2]);a.messageImprint=this.getMessageImprint(u);var c=t(n,o[3]);a.serial={hex:c};var l=t(n,o[4]);a.genTime={str:tm(l)};var f=0;if(o.length>5&&"30"==n.substr(o[5],2)){var d=r(n,o[5]);a.accuracy=this.getAccuracy(d),f++}if(o.length>5+f&&"01"==n.substr(o[5+f],2)&&("ff"==t(n,o[5+f])&&(a.ordering=!0),f++),o.length>5+f&&"02"==n.substr(o[5+f],2)){var h=t(n,o[5+f]);a.nonce={hex:h},f++}if(o.length>5+f&&"a0"==n.substr(o[5+f],2)){var p=r(n,o[5+f]);p="30"+p.substr(2);var m=(pGeneralNames=e.getGeneralNames(p))[0].dn;a.tsa=m,f++}if(o.length>5+f&&"a1"==n.substr(o[5+f],2)){var g=r(n,o[5+f]);g="30"+g.substr(2);var y=e.getExtParamArray(g);a.ext=y,f++}return a},this.getAccuracy=function(e){for(var r={},n=i(e,0),a=0;a1&&"30"==e.substr(o[1],2)){var l=r(e,o[1]);n.statusstr=this.getPKIFreeText(l),s++}if(o.length>s&&"03"==e.substr(o[1+s],2)){var f=r(e,o[1+s]);n.failinfo=this.getPKIFailureInfo(f)}return n},this.getPKIFreeText=function(e){for(var t=[],r=i(e,0),n=0;n=t)?e:Array(t-e.length+1).join(r)+e};function tT(e,t){for(var r=0,n=0;n=0;n--)a+=i[n];return a}function tD(e,t){var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e,e.superclass=t.prototype,t.prototype.constructor==Object.prototype.constructor&&(t.prototype.constructor=t)}void 0!==d&&d||(d={}),void 0!==d.crypto&&d.crypto||(d.crypto={}),d.crypto.Util=new function(){this.DIGESTINFOHEAD={sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",ripemd160:"3021300906052b2403020105000414"},this.DEFAULTPROVIDER={md5:"cryptojs",sha1:"cryptojs",sha224:"cryptojs",sha256:"cryptojs",sha384:"cryptojs",sha512:"cryptojs",ripemd160:"cryptojs",hmacmd5:"cryptojs",hmacsha1:"cryptojs",hmacsha224:"cryptojs",hmacsha256:"cryptojs",hmacsha384:"cryptojs",hmacsha512:"cryptojs",hmacripemd160:"cryptojs",MD5withRSA:"cryptojs/jsrsa",SHA1withRSA:"cryptojs/jsrsa",SHA224withRSA:"cryptojs/jsrsa",SHA256withRSA:"cryptojs/jsrsa",SHA384withRSA:"cryptojs/jsrsa",SHA512withRSA:"cryptojs/jsrsa",RIPEMD160withRSA:"cryptojs/jsrsa",MD5withECDSA:"cryptojs/jsrsa",SHA1withECDSA:"cryptojs/jsrsa",SHA224withECDSA:"cryptojs/jsrsa",SHA256withECDSA:"cryptojs/jsrsa",SHA384withECDSA:"cryptojs/jsrsa",SHA512withECDSA:"cryptojs/jsrsa",RIPEMD160withECDSA:"cryptojs/jsrsa",SHA1withDSA:"cryptojs/jsrsa",SHA224withDSA:"cryptojs/jsrsa",SHA256withDSA:"cryptojs/jsrsa",MD5withRSAandMGF1:"cryptojs/jsrsa",SHAwithRSAandMGF1:"cryptojs/jsrsa",SHA1withRSAandMGF1:"cryptojs/jsrsa",SHA224withRSAandMGF1:"cryptojs/jsrsa",SHA256withRSAandMGF1:"cryptojs/jsrsa",SHA384withRSAandMGF1:"cryptojs/jsrsa",SHA512withRSAandMGF1:"cryptojs/jsrsa",RIPEMD160withRSAandMGF1:"cryptojs/jsrsa"},this.CRYPTOJSMESSAGEDIGESTNAME={md5:b.algo.MD5,sha1:b.algo.SHA1,sha224:b.algo.SHA224,sha256:b.algo.SHA256,sha384:b.algo.SHA384,sha512:b.algo.SHA512,ripemd160:b.algo.RIPEMD160},this.getDigestInfoHex=function(e,t){if(void 0===this.DIGESTINFOHEAD[t])throw"alg not supported in Util.DIGESTINFOHEAD: "+t;return this.DIGESTINFOHEAD[t]+e},this.getPaddedDigestInfoHex=function(e,t,r){var n=this.getDigestInfoHex(e,t),i=r/4;if(n.length+22>i)throw"key is too short for SigAlg: keylen="+r+","+t;for(var a="0001",o="00"+n,s="",u=i-a.length-o.length,c=0;c=s.compareTo(E.ZERO));var u=o.modInverse(i).multiply(a.add(n.multiply(s))).mod(i);return r.biRSSigToASN1Sig(s,u)},this.sign=function(e,t){var r=this.ecparams.n,n=E.fromByteArrayUnsigned(e);do var i=this.getBigRandom(r),a=this.ecparams.G.multiply(i).getX().toBigInteger().mod(r);while(0>=a.compareTo(E.ZERO));var o=i.modInverse(r).multiply(n.add(t.multiply(a))).mod(r);return this.serializeSig(a,o)},this.verifyWithMessageHash=function(e,t){return this.verifyHex(e,t,this.pubKeyHex)},this.verifyHex=function(e,t,n){try{var i,a,o=r.parseSigHex(t);i=o.r,a=o.s;var s=ti.decodeFromHex(this.ecparams.curve,n),u=new E(e.substring(0,this.ecparams.keycharlen),16);return this.verifyRaw(u,i,a,s)}catch(e){return!1}},this.verify=function(e,t,r){if(Bitcoin.Util.isArray(t)){var n,i,a,o=this.parseSig(t);n=o.r,i=o.s}else if("object"==typeof t&&t.r&&t.s)n=t.r,i=t.s;else throw"Invalid value for signature";if(r instanceof ti)a=r;else if(Bitcoin.Util.isArray(r))a=ti.decodeFrom(this.ecparams.curve,r);else throw"Invalid format for pubkey value, must be byte array or ECPointFp";var s=E.fromByteArrayUnsigned(e);return this.verifyRaw(s,n,i,a)},this.verifyRaw=function(e,t,r,n){var i=this.ecparams.n,a=this.ecparams.G;if(0>t.compareTo(E.ONE)||t.compareTo(i)>=0||0>r.compareTo(E.ONE)||r.compareTo(i)>=0)return!1;var o=r.modInverse(i),s=e.multiply(o).mod(i),u=t.multiply(o).mod(i);return a.multiply(s).add(n.multiply(u)).getX().toBigInteger().mod(i).equals(t)},this.serializeSig=function(e,t){var r=e.toByteArraySigned(),n=t.toByteArraySigned(),i=[];return i.push(2),i.push(r.length),(i=i.concat(r)).push(2),i.push(n.length),(i=i.concat(n)).unshift(i.length),i.unshift(48),i},this.parseSig=function(e){if(48!=e[0])throw Error("Signature not a valid DERSequence");if(2!=e[t=2])throw Error("First element in signature must be a DERInteger");var t,r=e.slice(t+2,t+2+e[t+1]);if(t+=2+e[t+1],2!=e[t])throw Error("Second element in signature must be a DERInteger");var n=e.slice(t+2,t+2+e[t+1]);return t+=2+e[t+1],{r:E.fromByteArrayUnsigned(r),s:E.fromByteArrayUnsigned(n)}},this.parseSigCompact=function(e){if(65!==e.length)throw"Signature has the wrong length";var t=e[0]-27;if(t<0||t>7)throw"Invalid signature type";var r=this.ecparams.n;return{r:E.fromByteArrayUnsigned(e.slice(1,33)).mod(r),s:E.fromByteArrayUnsigned(e.slice(33,65)).mod(r),i:t}},this.readPKCS5PrvKeyHex=function(e){var t,r,n;if(!1===o(e))throw Error("not ASN.1 hex string");try{t=a(e,0,["[0]",0],"06"),r=a(e,0,[1],"04");try{n=a(e,0,["[1]",0],"03")}catch(e){}}catch(e){throw Error("malformed PKCS#1/5 plain ECC private key")}if(this.curveName=i(t),void 0===this.curveName)throw"unsupported curve name";this.setNamedCurve(this.curveName),this.setPublicKeyHex(n),this.setPrivateKeyHex(r),this.isPublic=!1},this.readPKCS8PrvKeyHex=function(e){var r,n,s;if(!1===o(e))throw new t("not ASN.1 hex string");try{a(e,0,[1,0],"06"),r=a(e,0,[1,1],"06"),n=a(e,0,[2,0,1],"04");try{s=a(e,0,[2,0,"[1]",0],"03")}catch(e){}}catch(e){throw new t("malformed PKCS#8 plain ECC private key")}if(this.curveName=i(r),void 0===this.curveName)throw new t("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(s),this.setPrivateKeyHex(n),this.isPublic=!1},this.readPKCS8PubKeyHex=function(e){var r,n;if(!1===o(e))throw new t("not ASN.1 hex string");try{a(e,0,[0,0],"06"),r=a(e,0,[0,1],"06"),n=a(e,0,[1],"03")}catch(e){throw new t("malformed PKCS#8 ECC public key")}if(this.curveName=i(r),null===this.curveName)throw new t("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(n)},this.readCertPubKeyHex=function(e,r){var n,s;if(!1===o(e))throw new t("not ASN.1 hex string");try{n=a(e,0,[0,5,0,1],"06"),s=a(e,0,[0,5,1],"03")}catch(e){throw new t("malformed X.509 certificate ECC public key")}if(this.curveName=i(n),null===this.curveName)throw new t("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(s)},void 0!==e&&void 0!==e.curve&&(this.curveName=e.curve),void 0===this.curveName&&(this.curveName="secp256r1"),this.setNamedCurve(this.curveName),void 0!==e&&(void 0!==e.prv&&this.setPrivateKeyHex(e.prv),void 0!==e.pub&&this.setPublicKeyHex(e.pub))},d.crypto.ECDSA.parseSigHex=function(e){var t=d.crypto.ECDSA.parseSigHexInHexRS(e);return{r:new E(t.r,16),s:new E(t.s,16)}},d.crypto.ECDSA.parseSigHexInHexRS=function(e){var t=ts.getChildIdx,r=ts.getV;if(ts.checkStrictDER(e,0),"30"!=e.substr(0,2))throw Error("signature is not a ASN.1 sequence");var n=t(e,0);if(2!=n.length)throw Error("signature shall have two elements");var i=n[0],a=n[1];if("02"!=e.substr(i,2))throw Error("1st item not ASN.1 integer");if("02"!=e.substr(a,2))throw Error("2nd item not ASN.1 integer");return{r:r(e,i),s:r(e,a)}},d.crypto.ECDSA.asn1SigToConcatSig=function(e){var t=d.crypto.ECDSA.parseSigHexInHexRS(e),r=t.r,n=t.s;if(r.length>=130&&r.length<=134){if(r.length%2!=0)throw Error("unknown ECDSA sig r length error");if(n.length%2!=0)throw Error("unknown ECDSA sig s length error");"00"==r.substr(0,2)&&(r=r.substr(2)),"00"==n.substr(0,2)&&(n=n.substr(2));var i=Math.max(r.length,n.length);return(r=("000000"+r).slice(-i))+(n=("000000"+n).slice(-i))}if("00"==r.substr(0,2)&&r.length%32==2&&(r=r.substr(2)),"00"==n.substr(0,2)&&n.length%32==2&&(n=n.substr(2)),r.length%32==30&&(r="00"+r),n.length%32==30&&(n="00"+n),r.length%32!=0)throw Error("unknown ECDSA sig r length error");if(n.length%32!=0)throw Error("unknown ECDSA sig s length error");return r+n},d.crypto.ECDSA.concatSigToASN1Sig=function(e){if(e.length%4!=0)throw Error("unknown ECDSA concatinated r-s sig length error");var t=e.substr(0,e.length/2),r=e.substr(e.length/2);return d.crypto.ECDSA.hexRSSigToASN1Sig(t,r)},d.crypto.ECDSA.hexRSSigToASN1Sig=function(e,t){var r=new E(e,16),n=new E(t,16);return d.crypto.ECDSA.biRSSigToASN1Sig(r,n)},d.crypto.ECDSA.biRSSigToASN1Sig=function(e,t){var r=d.asn1,n=new r.DERInteger({bigint:e}),i=new r.DERInteger({bigint:t});return new r.DERSequence({array:[n,i]}).tohex()},d.crypto.ECDSA.getName=function(e){return"2b8104001f"===e?"secp192k1":"2a8648ce3d030107"===e?"secp256r1":"2b8104000a"===e?"secp256k1":"2b81040021"===e?"secp224r1":"2b81040022"===e?"secp384r1":"2b81040023"===e?"secp521r1":-1!=="|secp256r1|NIST P-256|P-256|prime256v1|".indexOf(e)?"secp256r1":-1!=="|secp256k1|".indexOf(e)?"secp256k1":-1!=="|secp224r1|NIST P-224|P-224|".indexOf(e)?"secp224r1":-1!=="|secp384r1|NIST P-384|P-384|".indexOf(e)?"secp384r1":-1!=="|secp521r1|NIST P-521|P-521|".indexOf(e)?"secp521r1":null},void 0!==d&&d||(d={}),void 0!==d.crypto&&d.crypto||(d.crypto={}),d.crypto.ECParameterDB=new function(){var e={},t={};function r(e){return new E(e,16)}this.getByName=function(r){var n=r;if(void 0!==t[n]&&(n=t[r]),void 0!==e[n])return e[n];throw"unregistered EC curve name: "+n},this.regist=function(n,i,a,o,s,u,c,l,f,d,h,p){e[n]={};var m=r(a),g=r(o),y=r(s),b=r(u),x=r(c),S=new ta(m,g,y),w=S.decodePointHex("04"+l+f);e[n].name=n,e[n].keylen=i,e[n].keycharlen=2*Math.ceil(i/8),e[n].curve=S,e[n].G=w,e[n].n=b,e[n].h=x,e[n].oid=h,e[n].info=p;for(var E=0;E1?new E(n,16):null,c=new E(i,16),this.setPrivate(a,o,s,u,c)},this.setPublic=function(e,t,r,n){this.isPublic=!0,this.p=e,this.q=t,this.g=r,this.y=n,this.x=null},this.setPublicHex=function(e,t,r,n){var i,a,o,s;i=new E(e,16),a=new E(t,16),o=new E(r,16),s=new E(n,16),this.setPublic(i,a,o,s)},this.signWithMessageHash=function(e){var t=this.p,r=this.q,n=this.g;this.y;var i=this.x,a=d.crypto.Util.getRandomBigIntegerMinToMax(E.ONE.add(E.ONE),r.subtract(E.ONE)),o=e.substr(0,r.bitLength()/4),s=new E(o,16),u=n.modPow(a,t).mod(r),c=a.modInverse(r).multiply(s.add(i.multiply(u))).mod(r);return d.asn1.ASN1Util.jsonToASN1HEX({seq:[{int:{bigint:u}},{int:{bigint:c}}]})},this.verifyWithMessageHash=function(e,t){var r=this.p,n=this.q,i=this.g,a=this.y,o=this.parseASN1Signature(t),s=o[0],u=o[1],c=e.substr(0,n.bitLength()/4),l=new E(c,16);if(E.ZERO.compareTo(s)>0||s.compareTo(n)>0||E.ZERO.compareTo(u)>=0||u.compareTo(n)>0)throw"invalid DSA signature";var f=u.modInverse(n),d=l.multiply(f).mod(n),h=s.multiply(f).mod(n);return 0==i.modPow(d,r).multiply(a.modPow(h,r)).mod(r).mod(n).compareTo(s)},this.parseASN1Signature=function(t){try{var r=new E(e(t,0,[0],"02"),16),n=new E(e(t,0,[1],"02"),16);return[r,n]}catch(e){throw Error("malformed ASN.1 DSA signature")}},this.readPKCS5PrvKeyHex=function(r){var n,i,a,o,s;if(!1===t(r))throw Error("not ASN.1 hex string");try{n=e(r,0,[1],"02"),i=e(r,0,[2],"02"),a=e(r,0,[3],"02"),o=e(r,0,[4],"02"),s=e(r,0,[5],"02")}catch(e){throw Error("malformed PKCS#1/5 plain DSA private key")}this.setPrivateHex(n,i,a,o,s)},this.readPKCS8PrvKeyHex=function(r){var n,i,a,o;if(!1===t(r))throw Error("not ASN.1 hex string");try{n=e(r,0,[1,1,0],"02"),i=e(r,0,[1,1,1],"02"),a=e(r,0,[1,1,2],"02"),o=e(r,0,[2,0],"02")}catch(e){throw Error("malformed PKCS#8 plain DSA private key")}this.setPrivateHex(n,i,a,null,o)},this.readPKCS8PubKeyHex=function(r){var n,i,a,o;if(!1===t(r))throw Error("not ASN.1 hex string");try{n=e(r,0,[0,1,0],"02"),i=e(r,0,[0,1,1],"02"),a=e(r,0,[0,1,2],"02"),o=e(r,0,[1,0],"02")}catch(e){throw Error("malformed PKCS#8 DSA public key")}this.setPublicHex(n,i,a,o)},this.readCertPubKeyHex=function(r,n){var i,a,o,s;if(!1===t(r))throw Error("not ASN.1 hex string");try{i=e(r,0,[0,5,0,1,0],"02"),a=e(r,0,[0,5,0,1,1],"02"),o=e(r,0,[0,5,0,1,2],"02"),s=e(r,0,[0,5,1,0],"02")}catch(e){throw Error("malformed X.509 certificate DSA public key")}this.setPublicHex(i,a,o,s)}};var tN=(n=function(e,t,r){return i(b.AES,e,t,r)},i=function(e,t,r,n){var i=b.enc.Hex.parse(t),a=b.enc.Hex.parse(r),o=b.enc.Hex.parse(n),s={};s.key=a,s.iv=o,s.ciphertext=i;var u=e.decrypt(s,a,{iv:o});return b.enc.Hex.stringify(u)},a=function(e,t,r){return o(b.AES,e,t,r)},o=function(e,t,r,n){var i=b.enc.Hex.parse(t),a=b.enc.Hex.parse(r),o=b.enc.Hex.parse(n),s=e.encrypt(i,a,{iv:o}),u=b.enc.Hex.parse(s.toString());return b.enc.Base64.stringify(u)},s={"AES-256-CBC":{proc:n,eproc:a,keylen:32,ivlen:16},"AES-192-CBC":{proc:n,eproc:a,keylen:24,ivlen:16},"AES-128-CBC":{proc:n,eproc:a,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:function(e,t,r){return i(b.TripleDES,e,t,r)},eproc:function(e,t,r){return o(b.TripleDES,e,t,r)},keylen:24,ivlen:8},"DES-CBC":{proc:function(e,t,r){return i(b.DES,e,t,r)},eproc:function(e,t,r){return o(b.DES,e,t,r)},keylen:8,ivlen:8}},u=function(e){var t=b.lib.WordArray.random(e);return b.enc.Hex.stringify(t)},c=function(e){var t={},r=e.match(RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));r&&(t.cipher=r[1],t.ivsalt=r[2]);var n=e.match(RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));n&&(t.type=n[1]);var i=-1,a=0;-1!=e.indexOf("\r\n\r\n")&&(i=e.indexOf("\r\n\r\n"),a=2),-1!=e.indexOf("\n\n")&&(i=e.indexOf("\n\n"),a=1);var o=e.indexOf("-----END");if(-1!=i&&-1!=o){var s=e.substring(i+2*a,o-a);s=s.replace(/\s+/g,""),t.data=s}return t},l=function(e,t,r){for(var n=r.substring(0,16),i=b.enc.Hex.parse(n),a=b.enc.Utf8.parse(t),o=s[e].keylen+s[e].ivlen,u="",c=null;;){var l=b.algo.MD5.create();if(null!=c&&l.update(c),l.update(a),l.update(i),c=l.finalize(),(u+=b.enc.Hex.stringify(c)).length>=2*o)break}var f={};return f.keyhex=u.substr(0,2*s[e].keylen),f.ivhex=u.substr(2*s[e].keylen,2*s[e].ivlen),f},f=function(e,t,r,n){var i=b.enc.Base64.parse(e),a=b.enc.Hex.stringify(i);return(0,s[t].proc)(a,r,n)},{version:"1.0.0",parsePKCS5PEM:function(e){return c(e)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(e,t,r){return l(e,t,r)},decryptKeyB64:function(e,t,r,n){return f(e,t,r,n)},getDecryptedKeyHex:function(e,t){var r=c(e);r.type;var n=r.cipher,i=r.ivsalt,a=r.data,o=l(n,t,i).keyhex;return f(a,n,o,i)},getEncryptedPKCS5PEMFromPrvKeyHex:function(e,t,r,n,i){var a,o,c="";if((void 0===n||null==n)&&(n="AES-256-CBC"),void 0===s[n])throw Error("KEYUTIL unsupported algorithm: "+n);(void 0===i||null==i)&&(i=u(s[n].ivlen).toUpperCase());var f=l(n,r,i).keyhex,d=(a=n,o=i,(0,s[a].eproc)(t,f,o)).replace(/(.{64})/g,"$1\r\n"),c="-----BEGIN "+e+" PRIVATE KEY-----\r\n";return c+("Proc-Type: 4,ENCRYPTED\r\n"+("DEK-Info: "+n+",")+i+"\r\n\r\n"+d+"\r\n-----END "+e)+" PRIVATE KEY-----\r\n"},parseHexOfEncryptedPKCS8:function(e){var t=ts.getChildIdx,r=ts.getV,n={},i=t(e,0);if(2!=i.length)throw Error("malformed format: SEQUENCE(0).items != 2: "+i.length);n.ciphertext=r(e,i[1]);var a=t(e,i[0]);if(2!=a.length)throw Error("malformed format: SEQUENCE(0.0).items != 2: "+a.length);if("2a864886f70d01050d"!=r(e,a[0]))throw Error("this only supports pkcs5PBES2");var o=t(e,a[1]);if(2!=a.length)throw Error("malformed format: SEQUENCE(0.0.1).items != 2: "+o.length);var s=t(e,o[1]);if(2!=s.length)throw Error("malformed format: SEQUENCE(0.0.1.1).items != 2: "+s.length);if("2a864886f70d0307"!=r(e,s[0]))throw"this only supports TripleDES";n.encryptionSchemeAlg="TripleDES",n.encryptionSchemeIV=r(e,s[1]);var u=t(e,o[0]);if(2!=u.length)throw Error("malformed format: SEQUENCE(0.0.1.0).items != 2: "+u.length);if("2a864886f70d01050c"!=r(e,u[0]))throw Error("this only supports pkcs5PBKDF2");var c=t(e,u[1]);if(c.length<2)throw Error("malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+c.length);n.pbkdf2Salt=r(e,c[0]);var l=r(e,c[1]);try{n.pbkdf2Iter=parseInt(l,16)}catch(e){throw Error("malformed format pbkdf2Iter: "+l)}return n},getPBKDF2KeyHexFromParam:function(e,t){var r=b.enc.Hex.parse(e.pbkdf2Salt),n=e.pbkdf2Iter,i=b.PBKDF2(t,r,{keySize:6,iterations:n});return b.enc.Hex.stringify(i)},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(e,t){var r=tb(e,"ENCRYPTED PRIVATE KEY"),n=this.parseHexOfEncryptedPKCS8(r),i=tN.getPBKDF2KeyHexFromParam(n,t),a={};a.ciphertext=b.enc.Hex.parse(n.ciphertext);var o=b.enc.Hex.parse(i),s=b.enc.Hex.parse(n.encryptionSchemeIV),u=b.TripleDES.decrypt(a,o,{iv:s});return b.enc.Hex.stringify(u)},getKeyFromEncryptedPKCS8PEM:function(e,t){var r=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(e,t);return this.getKeyFromPlainPrivatePKCS8Hex(r)},parsePlainPrivatePKCS8Hex:function(e){var t=ts.getChildIdx,r=ts.getV,n={};if(n.algparam=null,"30"!=e.substr(0,2))throw Error("malformed plain PKCS8 private key(code:001)");var i=t(e,0);if(i.length<3)throw Error("malformed plain PKCS8 private key(code:002)");if("30"!=e.substr(i[1],2))throw Error("malformed PKCS8 private key(code:003)");var a=t(e,i[1]);if(2!=a.length)throw Error("malformed PKCS8 private key(code:004)");if("06"!=e.substr(a[0],2))throw Error("malformed PKCS8 private key(code:005)");if(n.algoid=r(e,a[0]),"06"==e.substr(a[1],2)&&(n.algparam=r(e,a[1])),"04"!=e.substr(i[2],2))throw Error("malformed PKCS8 private key(code:006)");return n.keyidx=ts.getVidx(e,i[2]),n},getKeyFromPlainPrivatePKCS8PEM:function(e){var t=tb(e,"PRIVATE KEY");return this.getKeyFromPlainPrivatePKCS8Hex(t)},getKeyFromPlainPrivatePKCS8Hex:function(e){var t,r=this.parsePlainPrivatePKCS8Hex(e);if("2a864886f70d010101"==r.algoid)t=new tt;else if("2a8648ce380401"==r.algoid)t=new d.crypto.DSA;else if("2a8648ce3d0201"==r.algoid)t=new d.crypto.ECDSA;else throw Error("unsupported private key algorithm");return t.readPKCS8PrvKeyHex(e),t},_getKeyFromPublicPKCS8Hex:function(e){var t,r=ts.getVbyList(e,0,[0,0],"06");if("2a864886f70d010101"===r)t=new tt;else if("2a8648ce380401"===r)t=new d.crypto.DSA;else if("2a8648ce3d0201"===r)t=new d.crypto.ECDSA;else throw Error("unsupported PKCS#8 public key hex");return t.readPKCS8PubKeyHex(e),t},parsePublicRawRSAKeyHex:function(e){var t=ts.getChildIdx,r=ts.getV,n={};if("30"!=e.substr(0,2))throw Error("malformed RSA key(code:001)");var i=t(e,0);if(2!=i.length)throw Error("malformed RSA key(code:002)");if("02"!=e.substr(i[0],2))throw Error("malformed RSA key(code:003)");if(n.n=r(e,i[0]),"02"!=e.substr(i[1],2))throw Error("malformed RSA key(code:004)");return n.e=r(e,i[1]),n},parsePublicPKCS8Hex:function(e){var t=ts.getChildIdx,r=ts.getV,n={};n.algparam=null;var i=t(e,0);if(2!=i.length)throw Error("outer DERSequence shall have 2 elements: "+i.length);var a=i[0];if("30"!=e.substr(a,2))throw Error("malformed PKCS8 public key(code:001)");var o=t(e,a);if(2!=o.length)throw Error("malformed PKCS8 public key(code:002)");if("06"!=e.substr(o[0],2))throw Error("malformed PKCS8 public key(code:003)");if(n.algoid=r(e,o[0]),"06"==e.substr(o[1],2)?n.algparam=r(e,o[1]):"30"==e.substr(o[1],2)&&(n.algparam={},n.algparam.p=ts.getVbyList(e,o[1],[0],"02"),n.algparam.q=ts.getVbyList(e,o[1],[1],"02"),n.algparam.g=ts.getVbyList(e,o[1],[2],"02")),"03"!=e.substr(i[1],2))throw Error("malformed PKCS8 public key(code:004)");return n.key=r(e,i[1]).substr(2),n}});function tM(e,t){for(var r="",n=t/4-e.length,i=0;i>24,(16711680&i)>>16,(65280&i)>>8,255&i])))),i+=1;return n}function tB(e){for(var t in d.crypto.Util.DIGESTINFOHEAD){var r=d.crypto.Util.DIGESTINFOHEAD[t],n=r.length;if(e.substring(0,n)==r)return[t,e.substring(n)]}return[]}function tH(e){var t,r=ts.getChildIdx,n=ts.getV,i=(ts.dump,ts.parse),a=ts.getTLV,o=ts.getVbyList,s=ts.getVbyListEx,u=ts.getTLVbyList,c=ts.getTLVbyListEx,l=ts.getIdxbyList,f=ts.getIdxbyListEx,h=ts.getVidx,p=ts.getInt,m=ts.oidname,g=ts.hextooidstr;try{t=d.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch(e){}this.HEX2STAG={"0c":"utf8",13:"prn",16:"ia5","1a":"vis","1e":"bmp"},this.hex=null,this.version=0,this.foffset=0,this.aExtInfo=null,this.getVersion=function(){if(null===this.hex||0!==this.version)return this.version;var e=u(this.hex,0,[0,0]);if("a0"!=e.substr(0,2))return this.version=1,this.foffset=-1,1;var t=p(u(e,0,[0]),0);if(t<0||21){var s=a(e,o[1]),u=this.getGeneralName(s);void 0!=u.uri&&(i.uri=u.uri)}if(o.length>2){var c=a(e,o[2]);"0101ff"==c&&(i.reqauth=!0),"010100"==c&&(i.reqauth=!1)}return i};var y=function(e){var t={};try{var r=e.seq[0].oid,n=d.asn1.x509.OID.name2oid(r);t.type=d.asn1.x509.OID.oid2atype(n);var i=e.seq[1];if(void 0!=i.utf8str)t.ds="utf8",t.value=i.utf8str.str;else if(void 0!=i.numstr)t.ds="num",t.value=i.numstr.str;else if(void 0!=i.telstr)t.ds="tel",t.value=i.telstr.str;else if(void 0!=i.prnstr)t.ds="prn",t.value=i.prnstr.str;else if(void 0!=i.ia5str)t.ds="ia5",t.value=i.ia5str.str;else if(void 0!=i.visstr)t.ds="vis",t.value=i.visstr.str;else if(void 0!=i.bmpstr)t.ds="bmp",t.value=i.bmpstr.str;else throw"error";return t}catch(e){throw new Erorr("improper ASN.1 parsed AttrTypeAndValue")}},b=function(e){try{return e.set.map(function(e){return y(e)})}catch(e){throw Error("improper ASN.1 parsed RDN: "+e)}},x=function(e){try{return e.seq.map(function(e){return b(e)})}catch(e){throw Error("improper ASN.1 parsed X500Name: "+e)}};this.getX500NameRule=function(e){for(var t=null,r=[],n=0;n0&&(t.ext=this.getExtParamArray()),t.sighex=this.getSignatureValueHex(),"object"==typeof e&&(!0==e.tbshex&&(t.tbshex=u(this.hex,0,[0])),!0==e.nodnarray&&(delete t.issuer.array,delete t.subject.array)),t},this.getExtParamArray=function(e){void 0==e&&-1!=f(this.hex,0,[0,"[3]"])&&(e=c(this.hex,0,[0,"[3]",0],"30"));for(var t=[],n=r(e,0),i=0;i2&&"04"===e.substr(b[1],2))(l=new s).readPKCS5PrvKeyHex(e);else throw Error("unsupported PKCS#1/5 hexadecimal key");return l}if("pkcs8prv"===r){var l=tN.getKeyFromPlainPrivatePKCS8Hex(e);return l}if("pkcs8pub"===r)return tN._getKeyFromPublicPKCS8Hex(e);if("x509pub"===r)return tH.getPublicKeyFromCertHex(e);if(-1!=e.indexOf("-END CERTIFICATE-",0)||-1!=e.indexOf("-END X509 CERTIFICATE-",0)||-1!=e.indexOf("-END TRUSTED CERTIFICATE-",0))return tH.getPublicKeyFromCertPEM(e);if(-1!=e.indexOf("-END PUBLIC KEY-")){var x=tb(e,"PUBLIC KEY");return tN._getKeyFromPublicPKCS8Hex(x)}if(-1!=e.indexOf("-END RSA PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){var S=c(e,"RSA PRIVATE KEY");return tN.getKey(S,null,"pkcs5prv")}if(-1!=e.indexOf("-END DSA PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){var w=c(e,"DSA PRIVATE KEY"),A=a(w,0,[1],"02"),C=a(w,0,[2],"02"),P=a(w,0,[3],"02"),O=a(w,0,[4],"02"),k=a(w,0,[5],"02"),l=new u;return l.setPrivate(new E(A,16),new E(C,16),new E(P,16),new E(O,16),new E(k,16)),l}if(-1!=e.indexOf("-END EC PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){var S=c(e,"EC PRIVATE KEY");return tN.getKey(S,null,"pkcs5prv")}if(-1!=e.indexOf("-END PRIVATE KEY-"))return tN.getKeyFromPlainPrivatePKCS8PEM(e);if(-1!=e.indexOf("-END RSA PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var _=tN.getDecryptedKeyHex(e,t),F=new tt;return F.readPKCS5PrvKeyHex(_),F}if(-1!=e.indexOf("-END EC PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var w=tN.getDecryptedKeyHex(e,t),l=a(w,0,[1],"04"),j=a(w,0,[2,0],"06"),R=a(w,0,[3,0],"03").substr(2),I="";if(void 0!==d.crypto.OID.oidhex2name[j])I=d.crypto.OID.oidhex2name[j];else throw Error("undefined OID(hex) in KJUR.crypto.OID: "+j);var f=new s({curve:I});return f.setPublicKeyHex(R),f.setPrivateKeyHex(l),f.isPublic=!1,f}if(-1!=e.indexOf("-END DSA PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var w=tN.getDecryptedKeyHex(e,t),A=a(w,0,[1],"02"),C=a(w,0,[2],"02"),P=a(w,0,[3],"02"),O=a(w,0,[4],"02"),k=a(w,0,[5],"02"),l=new u;return l.setPrivate(new E(A,16),new E(C,16),new E(P,16),new E(O,16),new E(k,16)),l}if(-1!=e.indexOf("-END ENCRYPTED PRIVATE KEY-"))return tN.getKeyFromEncryptedPKCS8PEM(e,t);throw Error("not supported argument")},tN.generateKeypair=function(e,t){if("RSA"==e){var r=new tt;r.generate(t,"10001"),r.isPrivate=!0,r.isPublic=!0;var n=new tt,i=r.n.toString(16),a=r.e.toString(16);n.setPublic(i,a),n.isPrivate=!1,n.isPublic=!0;var o={};return o.prvKeyObj=r,o.pubKeyObj=n,o}if("EC"==e){var s=new d.crypto.ECDSA({curve:t}).generateKeyPairHex(),r=new d.crypto.ECDSA({curve:t});r.setPublicKeyHex(s.ecpubhex),r.setPrivateKeyHex(s.ecprvhex),r.isPrivate=!0,r.isPublic=!1;var n=new d.crypto.ECDSA({curve:t});n.setPublicKeyHex(s.ecpubhex),n.isPrivate=!1,n.isPublic=!0;var o={};return o.prvKeyObj=r,o.pubKeyObj=n,o}throw Error("unknown algorithm: "+e)},tN.getPEM=function(e,t,r,n,i,a){var o=d,s=o.asn1,u=s.DERObjectIdentifier,c=s.DERInteger,l=s.ASN1Util.newObject,f=s.x509.SubjectPublicKeyInfo,h=o.crypto,p=h.DSA,m=h.ECDSA;function g(e){return l({seq:[{int:0},{int:{bigint:e.n}},{int:e.e},{int:{bigint:e.d}},{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.dmp1}},{int:{bigint:e.dmq1}},{int:{bigint:e.coeff}}]})}function y(e){return l({seq:[{int:1},{octstr:{hex:e.prvKeyHex}},{tag:["a0",!0,{oid:{name:e.curveName}}]},{tag:["a1",!0,{bitstr:{hex:"00"+e.pubKeyHex}}]}]})}function x(e){return l({seq:[{int:0},{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}},{int:{bigint:e.y}},{int:{bigint:e.x}}]})}if((void 0!==tt&&e instanceof tt||void 0!==p&&e instanceof p||void 0!==m&&e instanceof m)&&!0==e.isPublic&&(void 0===t||"PKCS8PUB"==t)){var S=new f(e),w=S.tohex();return ty(w,"PUBLIC KEY")}if("PKCS1PRV"==t&&void 0!==tt&&e instanceof tt&&(void 0===r||null==r)&&!0==e.isPrivate){var S=g(e),w=S.tohex();return ty(w,"RSA PRIVATE KEY")}if("PKCS1PRV"==t&&void 0!==m&&e instanceof m&&(void 0===r||null==r)&&!0==e.isPrivate){var E=new u({name:e.curveName}).tohex(),A=y(e).tohex();return""+(ty(E,"EC PARAMETERS")+ty(A,"EC PRIVATE KEY"))}if("PKCS1PRV"==t&&void 0!==p&&e instanceof p&&(void 0===r||null==r)&&!0==e.isPrivate){var S=x(e),w=S.tohex();return ty(w,"DSA PRIVATE KEY")}if("PKCS5PRV"==t&&void 0!==tt&&e instanceof tt&&void 0!==r&&null!=r&&!0==e.isPrivate){var S=g(e),w=S.tohex();return void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",w,r,n,a)}if("PKCS5PRV"==t&&void 0!==m&&e instanceof m&&void 0!==r&&null!=r&&!0==e.isPrivate){var S=y(e),w=S.tohex();return void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("EC",w,r,n,a)}if("PKCS5PRV"==t&&void 0!==p&&e instanceof p&&void 0!==r&&null!=r&&!0==e.isPrivate){var S=x(e),w=S.tohex();return void 0===n&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA",w,r,n,a)}var C=function(e,t){var r=P(e,t);return new l({seq:[{seq:[{oid:{name:"pkcs5PBES2"}},{seq:[{seq:[{oid:{name:"pkcs5PBKDF2"}},{seq:[{octstr:{hex:r.pbkdf2Salt}},{int:r.pbkdf2Iter}]}]},{seq:[{oid:{name:"des-EDE3-CBC"}},{octstr:{hex:r.encryptionSchemeIV}}]}]}]},{octstr:{hex:r.ciphertext}}]}).tohex()},P=function(e,t){var r=b.lib.WordArray.random(8),n=b.lib.WordArray.random(8),i=b.PBKDF2(t,r,{keySize:6,iterations:100}),a=b.enc.Hex.parse(e),o=b.TripleDES.encrypt(a,i,{iv:n})+"",s={};return s.ciphertext=o,s.pbkdf2Salt=b.enc.Hex.stringify(r),s.pbkdf2Iter=100,s.encryptionSchemeAlg="DES-EDE3-CBC",s.encryptionSchemeIV=b.enc.Hex.stringify(n),s};if("PKCS8PRV"==t&&void 0!=tt&&e instanceof tt&&!0==e.isPrivate){var O=g(e),k=O.tohex(),S=l({seq:[{int:0},{seq:[{oid:{name:"rsaEncryption"}},{null:!0}]},{octstr:{hex:k}}]}),w=S.tohex();if(void 0===r||null==r)return ty(w,"PRIVATE KEY");var A=C(w,r);return ty(A,"ENCRYPTED PRIVATE KEY")}if("PKCS8PRV"==t&&void 0!==m&&e instanceof m&&!0==e.isPrivate){var _={seq:[{int:1},{octstr:{hex:e.prvKeyHex}}]};"string"==typeof e.pubKeyHex&&_.seq.push({tag:["a1",!0,{bitstr:{hex:"00"+e.pubKeyHex}}]});var O=new l(_),k=O.tohex(),S=l({seq:[{int:0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:e.curveName}}]},{octstr:{hex:k}}]}),w=S.tohex();if(void 0===r||null==r)return ty(w,"PRIVATE KEY");var A=C(w,r);return ty(A,"ENCRYPTED PRIVATE KEY")}if("PKCS8PRV"==t&&void 0!==p&&e instanceof p&&!0==e.isPrivate){var O=new c({bigint:e.x}),k=O.tohex(),S=l({seq:[{int:0},{seq:[{oid:{name:"dsa"}},{seq:[{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}}]}]},{octstr:{hex:k}}]}),w=S.tohex();if(void 0===r||null==r)return ty(w,"PRIVATE KEY");var A=C(w,r);return ty(A,"ENCRYPTED PRIVATE KEY")}throw Error("unsupported object nor format")},tN.getKeyFromCSRPEM=function(e){var t=tb(e,"CERTIFICATE REQUEST");return tN.getKeyFromCSRHex(t)},tN.getKeyFromCSRHex=function(e){var t=tN.parseCSRHex(e);return tN.getKey(t.p8pubkeyhex,null,"pkcs8pub")},tN.parseCSRHex=function(e){var t=ts.getChildIdx,r=ts.getTLV,n={};if("30"!=e.substr(0,2))throw Error("malformed CSR(code:001)");var i=t(e,0);if(i.length<1)throw Error("malformed CSR(code:002)");if("30"!=e.substr(i[0],2))throw Error("malformed CSR(code:003)");var a=t(e,i[0]);if(a.length<3)throw Error("malformed CSR(code:004)");return n.p8pubkeyhex=r(e,a[2]),n},tN.getKeyID=function(e){"string"==typeof e&&-1!=e.indexOf("BEGIN ")&&(e=tN.getKey(e));var t=tb(tN.getPEM(e)),r=ts.getIdxbyList(t,0,[1]),n=ts.getV(t,r).substring(2);return d.crypto.Util.hashHex(n,"sha1")},tN.getJWK=function(e,t,r,n,i){var a,o,s={},u=d.crypto.Util.hashHex;if("string"==typeof e)a=tN.getKey(e),-1!=e.indexOf("CERTIFICATE")&&(o=tb(e));else if("object"==typeof e)e instanceof tH?(a=e.getPublicKey(),o=e.hex):a=e;else throw Error("unsupported keyinfo type");if(a instanceof tt&&a.isPrivate)s.kty="RSA",s.n=td(a.n.toString(16)),s.e=td(a.e.toString(16)),s.d=td(a.d.toString(16)),s.p=td(a.p.toString(16)),s.q=td(a.q.toString(16)),s.dp=td(a.dmp1.toString(16)),s.dq=td(a.dmq1.toString(16)),s.qi=td(a.coeff.toString(16));else if(a instanceof tt&&a.isPublic)s.kty="RSA",s.n=td(a.n.toString(16)),s.e=td(a.e.toString(16));else if(a instanceof d.crypto.ECDSA&&a.isPrivate){var c=a.getShortNISTPCurveName();if("P-256"!==c&&"P-384"!==c&&"P-521"!==c)throw Error("unsupported curve name for JWT: "+c);var l=a.getPublicKeyXYHex();s.kty="EC",s.crv=c,s.x=td(l.x),s.y=td(l.y),s.d=td(a.prvKeyHex)}else if(a instanceof d.crypto.ECDSA&&a.isPublic){var c=a.getShortNISTPCurveName();if("P-256"!==c&&"P-384"!==c&&"P-521"!==c)throw Error("unsupported curve name for JWT: "+c);var l=a.getPublicKeyXYHex();s.kty="EC",s.crv=c,s.x=td(l.x),s.y=td(l.y)}if(void 0==s.kty)throw Error("unsupported keyinfo");return a.isPrivate||!0==t||(s.kid=d.jws.JWS.getJWKthumbprint(s)),void 0!=o&&!0!=r&&(s.x5c=[S(o)]),void 0!=o&&!0!=n&&(s.x5t=tl(S(u(o,"sha1")))),void 0!=o&&!0!=i&&(s["x5t#S256"]=tl(S(u(o,"sha256")))),s},tN.getJWKFromKey=function(e){return tN.getJWK(e,!0,!0,!0,!0)},tt.getPosArrayOfChildrenFromHex=function(e){return ts.getChildIdx(e,0)},tt.getHexValueArrayOfChildrenFromHex=function(e){var t=ts.getV,r=tt.getPosArrayOfChildrenFromHex(e),n=t(e,r[0]),i=t(e,r[1]),a=t(e,r[2]),o=t(e,r[3]),s=t(e,r[4]),u=t(e,r[5]),c=t(e,r[6]),l=t(e,r[7]),f=t(e,r[8]),r=[];return r.push(n,i,a,o,s,u,c,l,f),r},tt.prototype.readPrivateKeyFromPEMString=function(e){var t=tb(e),r=tt.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8])},tt.prototype.readPKCS5PrvKeyHex=function(e){var t=tt.getHexValueArrayOfChildrenFromHex(e);this.setPrivateEx(t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},tt.prototype.readPKCS8PrvKeyHex=function(e){var t,r,n,i,a,o,s,u,c=ts.getVbyListEx;if(!1===ts.isASN1HEX(e))throw Error("not ASN.1 hex string");try{t=c(e,0,[2,0,1],"02"),r=c(e,0,[2,0,2],"02"),n=c(e,0,[2,0,3],"02"),i=c(e,0,[2,0,4],"02"),a=c(e,0,[2,0,5],"02"),o=c(e,0,[2,0,6],"02"),s=c(e,0,[2,0,7],"02"),u=c(e,0,[2,0,8],"02")}catch(e){throw Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(t,r,n,i,a,o,s,u)},tt.prototype.readPKCS5PubKeyHex=function(e){var t=ts.getV;if(!1===ts.isASN1HEX(e))throw Error("keyHex is not ASN.1 hex string");var r=ts.getChildIdx(e,0);if(2!==r.length||"02"!==e.substr(r[0],2)||"02"!==e.substr(r[1],2))throw Error("wrong hex for PKCS#5 public key");var n=t(e,r[0]),i=t(e,r[1]);this.setPublic(n,i)},tt.prototype.readPKCS8PubKeyHex=function(e){if(!1===ts.isASN1HEX(e))throw Error("not ASN.1 hex string");if("06092a864886f70d010101"!==ts.getTLVbyListEx(e,0,[0,0]))throw Error("not PKCS8 RSA public key");var t=ts.getTLVbyListEx(e,0,[1,0]);this.readPKCS5PubKeyHex(t)},tt.prototype.readCertPubKeyHex=function(e,t){var r,n;(r=new tH).readCertHex(e),n=r.getPublicKeyHex(),this.readPKCS8PubKeyHex(n)},tt.prototype.sign=function(e,t){var r=d.crypto.Util.hashString(e,t);return this.signWithMessageHash(r,t)},tt.prototype.signWithMessageHash=function(e,t){var r=d.crypto.Util.getPaddedDigestInfoHex(e,t,this.n.bitLength()),n=e7(r,16);return tM(this.doPrivate(n).toString(16),this.n.bitLength())},tt.prototype.signPSS=function(e,t,r){var n,i=(n=tg(e),d.crypto.Util.hashHex(n,t));return void 0===r&&(r=-1),this.signWithMessageHashPSS(i,t,r)},tt.prototype.signWithMessageHashPSS=function(e,t,r){var n,i=tv(e),a=i.length,o=this.n.bitLength()-1,s=Math.ceil(o/8),u=function(e){return d.crypto.Util.hashHex(e,t)};if(-1===r||void 0===r)r=a;else if(-2===r)r=s-a-2;else if(r<-2)throw Error("invalid salt length");if(s0&&(c=Array(r),new e9().nextBytes(c),c=String.fromCharCode.apply(String,c));var l=tv(u(tg("\x00\x00\x00\x00\x00\x00\x00\x00"+i+c))),f=[];for(n=0;n>8*s-o&255),n=0;nn)return!1;var i=this.doPublic(r).toString(16);if(i.length+3!=n/4)return!1;var a=tB(i.replace(/^1f+00/,""));if(0==a.length)return!1;var o=a[0],s=a[1],u=d.crypto.Util.hashString(e,o);return s==u},tt.prototype.verifyWithMessageHash=function(e,t){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var r=e7(t,16);if(r.bitLength()>this.n.bitLength())return 0;var n=tB(this.doPublic(r).toString(16).replace(/^1f+00/,""));return 0!=n.length&&(n[0],n[1]==e)},tt.prototype.verifyPSS=function(e,t,r,n){var i,a=(i=tg(e),d.crypto.Util.hashHex(i,r));return void 0===n&&(n=-1),this.verifyWithMessageHashPSS(a,t,r,n)},tt.prototype.verifyWithMessageHashPSS=function(e,t,r,n){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var i,a=new E(t,16),o=function(e){return d.crypto.Util.hashHex(e,r)},s=tv(e),u=s.length,c=this.n.bitLength()-1,l=Math.ceil(c/8);if(-1===n||void 0===n)n=u;else if(-2===n)n=l-u-2;else if(n<-2)throw Error("invalid salt length");if(l>8*l-c&255;if((h.charCodeAt(0)&m)!=0)throw Error("bits beyond keysize not zero");var g=tL(p,h.length,o),y=[];for(i=0;i0&&-1==(":"+r.join(":")+":").indexOf(":"+g+":"))throw"algorithm '"+g+"' not accepted in the list";if("none"!=g&&null===t)throw"key shall be specified to verify.";if("string"==typeof t&&-1!=t.indexOf("-----BEGIN ")&&(t=tN.getKey(t)),("RS"==y||"PS"==y)&&!(t instanceof tt))throw"key shall be a RSAKey obj for RS* and PS* algs";if("ES"==y&&!(t instanceof s))throw"key shall be a ECDSA obj for ES* algs";var b=null;if(void 0===i.jwsalg2sigalg[m.alg])throw"unsupported alg name: "+g;if("none"==(b=i.jwsalg2sigalg[g]))throw"not supported";if("Hmac"==b.substr(0,4)){if(void 0===t)throw"hexadecimal key shall be specified for HMAC";var x=new u({alg:b,pass:t});return x.updateString(f),h==x.doFinal()}if(-1!=b.indexOf("withECDSA")){var S=null;try{S=s.concatSigToASN1Sig(h)}catch(e){return!1}var w=new c({alg:b});return w.init(t),w.updateString(f),w.verify(S)}var w=new c({alg:b});return w.init(t),w.updateString(f),w.verify(h)},d.jws.JWS.parse=function(e){var t,r,n,i=e.split("."),a={};if(2!=i.length&&3!=i.length)throw"malformed sJWS: wrong number of '.' splitted elements";return t=i[0],r=i[1],3==i.length&&(n=i[2]),a.headerObj=d.jws.JWS.readSafeJSONString(p(t)),a.payloadObj=d.jws.JWS.readSafeJSONString(p(r)),a.headerPP=JSON.stringify(a.headerObj,null," "),null==a.payloadObj?a.payloadPP=p(r):a.payloadPP=JSON.stringify(a.payloadObj,null," "),void 0!==n&&(a.sigHex=th(n)),a},d.jws.JWS.verifyJWT=function(e,t,r){var n=d.jws,i=n.JWS,a=i.readSafeJSONString,o=i.inArray,s=i.includedArray;if(!tF(e))return!1;var u=e.split(".");if(3!=u.length)return!1;var c=u[0],l=u[1];th(u[2]);var f=a(p(c)),h=a(p(l));if(void 0===f.alg)return!1;if(void 0===r.alg)throw"acceptField.alg shall be specified";if(!o(f.alg,r.alg)||void 0!==h.iss&&"object"==typeof r.iss&&!o(h.iss,r.iss)||void 0!==h.sub&&"object"==typeof r.sub&&!o(h.sub,r.sub))return!1;if(void 0!==h.aud&&"object"==typeof r.aud){if("string"==typeof h.aud){if(!o(h.aud,r.aud))return!1}else if("object"==typeof h.aud&&!s(h.aud,r.aud))return!1}var m=n.IntDate.getNow();return void 0!==r.verifyAt&&"number"==typeof r.verifyAt&&(m=r.verifyAt),(void 0===r.gracePeriod||"number"!=typeof r.gracePeriod)&&(r.gracePeriod=0),(void 0===h.exp||"number"!=typeof h.exp||!(h.exp+r.gracePeriodi&&this.aHeader.pop(),this.aSignature.length>i&&this.aSignature.pop(),"addSignature failed: "+e}},this.verifyAll=function(e){if(this.aHeader.length!==e.length||this.aSignature.length!==e.length)return!1;for(var t=0;t0)this.aHeader=e.headers;else throw"malformed header";if("string"==typeof e.payload)this.sPayload=e.payload;else throw"malformed signatures";if(e.signatures.length>0)this.aSignature=e.signatures;else throw"malformed signatures"}catch(e){throw"malformed JWS-JS JSON object: "+e}},this.getJSON=function(){return{headers:this.aHeader,payload:this.sPayload,signatures:this.aSignature}},this.isEmpty=function(){return 0==this.aHeader.length?1:0}},d.crypto.ECDSA,d.crypto.DSA,d.crypto.Signature,d.crypto.MessageDigest,d.crypto.Mac,d.crypto.Cipher,t.KZ=tN,t.fs=d,d.crypto,d.asn1,d.jws,d.lang},48094:function(e){var t=Object.prototype.toString;e.exports=function(e){return!0===e||!1===e||!!e&&"object"==typeof e&&"[object Boolean]"==t.call(e)}},98423:function(e,t,r){var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,i="object"==typeof self&&self&&self.Object===Object&&self,a=n||i||Function("return this")(),o=Object.prototype,s=o.hasOwnProperty,u=o.toString,c=a.Symbol,l=c?c.toStringTag:void 0;e.exports=function(e){if(t=typeof e,null==e||"object"!=t&&"function"!=t)return!1;var t,r=null==e?void 0===e?"[object Undefined]":"[object Null]":l&&l in Object(e)?function(e){var t=s.call(e,l),r=e[l];try{e[l]=void 0;var n=!0}catch(e){}var i=u.call(e);return n&&(t?e[l]=r:delete e[l]),i}(e):u.call(e);return"[object Function]"==r||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r}},23126:function(e){var t=Object.prototype.toString;e.exports=function(e){return"number"==typeof e||!!e&&"object"==typeof e&&"[object Number]"==t.call(e)}},25751:function(e){var t=Object.prototype.toString,r=Array.isArray;e.exports=function(e){var n;return"string"==typeof e||!r(e)&&!!(n=e)&&"object"==typeof n&&"[object String]"==t.call(e)}},35683:function(e,t,r){var n,i,a=1/0,o=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,s=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,u="\ud800-\udfff",c="\\u2700-\\u27bf",l="a-z\\xdf-\\xf6\\xf8-\\xff",f="A-Z\\xc0-\\xd6\\xd8-\\xde",d="\\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",h="['’]",p="["+d+"]",m="[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]",g="["+l+"]",y="[^"+u+d+"\\d+"+c+l+f+"]",b="(?:\ud83c[\udde6-\uddff]){2}",x="[\ud800-\udbff][\udc00-\udfff]",S="["+f+"]",w="(?:"+g+"|"+y+")",E="(?:"+h+"(?:d|ll|m|re|s|t|ve))?",A="(?:"+h+"(?:D|LL|M|RE|S|T|VE))?",C="(?:"+m+"|\ud83c[\udffb-\udfff])?",P="[\\ufe0e\\ufe0f]?",O="(?:\\u200d(?:"+["[^"+u+"]",b,x].join("|")+")"+P+C+")*",k="(?:"+["["+c+"]",b,x].join("|")+")"+(P+C+O),_=RegExp(h,"g"),F=RegExp(m,"g"),j=RegExp([S+"?"+g+"+"+E+"(?="+[p,S,"$"].join("|")+")","(?:"+S+"|"+y+")+"+A+"(?="+[p,S+w,"$"].join("|")+")",S+"?"+w+"+"+E,S+"+"+A,"\\d+",k].join("|"),"g"),R=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,I="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,T="object"==typeof self&&self&&self.Object===Object&&self,D=I||T||Function("return this")(),N=(n={À:"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",ſ:"ss"},function(e){return null==n?void 0:n[e]}),M=Object.prototype.toString,L=D.Symbol,B=L?L.prototype:void 0,H=B?B.toString:void 0;function $(e){return null==e?"":function(e){if("string"==typeof e)return e;if("symbol"==typeof(t=e)||t&&"object"==typeof t&&"[object Symbol]"==M.call(t))return H?H.call(e):"";var t,r=e+"";return"0"==r&&1/e==-a?"-0":r}(e)}var U=(i=function(e,t,r){return e+(r?"-":"")+t.toLowerCase()},function(e){var t;return function(e,t,r,n){for(var i=-1,a=e?e.length:0;++ii?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(i);++n1?r[a-1]:void 0,s=a>2?r[2]:void 0;for(o=e.length>3&&"function"==typeof o?(a--,o):void 0,s&&i(r[0],r[1],s)&&(o=a<3?void 0:o,a=1),t=Object(t);++nl))return!1;var d=u.get(e),h=u.get(t);if(d&&h)return d==t&&h==e;var p=-1,m=!0,g=2&r?new n:void 0;for(u.set(e,t),u.set(t,e);++p-1&&e%1==0&&e-1}},54705:function(e,t,r){var n=r(18470);e.exports=function(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}},24785:function(e,t,r){var n=r(1989),i=r(38407),a=r(57071);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(a||i),string:new n}}},11285:function(e,t,r){var n=r(45050);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},96e3:function(e,t,r){var n=r(45050);e.exports=function(e){return n(this,e).get(e)}},49916:function(e,t,r){var n=r(45050);e.exports=function(e){return n(this,e).has(e)}},95265:function(e,t,r){var n=r(45050);e.exports=function(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}},68776:function(e){e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}},42634:function(e){e.exports=function(e,t){return function(r){return null!=r&&r[e]===t&&(void 0!==t||e in Object(r))}}},24523:function(e,t,r){var n=r(88306);e.exports=function(e){var t=n(e,function(e){return 500===r.size&&r.clear(),e}),r=t.cache;return t}},94536:function(e,t,r){var n=r(10852)(Object,"create");e.exports=n},86916:function(e,t,r){var n=r(5569)(Object.keys,Object);e.exports=n},33498:function(e){e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},31167:function(e,t,r){e=r.nmd(e);var n=r(31957),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,o=a&&a.exports===i&&n.process,s=function(){try{var e=a&&a.require&&a.require("util").types;if(e)return e;return o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=s},2333:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5569:function(e){e.exports=function(e,t){return function(r){return e(t(r))}}},45357:function(e,t,r){var n=r(96874),i=Math.max;e.exports=function(e,t,r){return t=i(void 0===t?e.length-1:t,0),function(){for(var a=arguments,o=-1,s=i(a.length-t,0),u=Array(s);++o0){if(++r>=800)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}},37465:function(e,t,r){var n=r(38407);e.exports=function(){this.__data__=new n,this.size=0}},63779:function(e){e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},67599:function(e){e.exports=function(e){return this.__data__.get(e)}},44758:function(e){e.exports=function(e){return this.__data__.has(e)}},34309:function(e,t,r){var n=r(38407),i=r(57071),a=r(83369);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var o=r.__data__;if(!i||o.length<199)return o.push([e,t]),this.size=++r.size,this;r=this.__data__=new a(o)}return r.set(e,t),this.size=r.size,this}},55514:function(e,t,r){var n=r(24523),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g,o=n(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,function(e,r,n,i){t.push(n?i.replace(a,"$1"):r||e)}),t});e.exports=o},40327:function(e,t,r){var n=r(33448),i=1/0;e.exports=function(e){if("string"==typeof e||n(e))return e;var t=e+"";return"0"==t&&1/e==-i?"-0":t}},80346:function(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},75703:function(e){e.exports=function(e){return function(){return e}}},77813:function(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},84486:function(e,t,r){var n=r(77412),i=r(89881),a=r(54290),o=r(1469);e.exports=function(e,t){return(o(e)?n:i)(e,a(t))}},27361:function(e,t,r){var n=r(97786);e.exports=function(e,t,r){var i=null==e?void 0:n(e,t);return void 0===i?r:i}},79095:function(e,t,r){var n=r(13),i=r(222);e.exports=function(e,t){return null!=e&&i(e,t,n)}},6557:function(e){e.exports=function(e){return e}},35694:function(e,t,r){var n=r(9454),i=r(37005),a=Object.prototype,o=a.hasOwnProperty,s=a.propertyIsEnumerable,u=n(function(){return arguments}())?n:function(e){return i(e)&&o.call(e,"callee")&&!s.call(e,"callee")};e.exports=u},1469:function(e){var t=Array.isArray;e.exports=t},98612:function(e,t,r){var n=r(23560),i=r(41780);e.exports=function(e){return null!=e&&i(e.length)&&!n(e)}},29246:function(e,t,r){var n=r(98612),i=r(37005);e.exports=function(e){return i(e)&&n(e)}},51584:function(e,t,r){var n=r(44239),i=r(37005);e.exports=function(e){return!0===e||!1===e||i(e)&&"[object Boolean]"==n(e)}},44144:function(e,t,r){e=r.nmd(e);var n=r(55639),i=r(95062),a=t&&!t.nodeType&&t,o=a&&e&&!e.nodeType&&e,s=o&&o.exports===a?n.Buffer:void 0,u=s?s.isBuffer:void 0;e.exports=u||i},23560:function(e,t,r){var n=r(44239),i=r(13218);e.exports=function(e){if(!i(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},41780:function(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},81763:function(e,t,r){var n=r(44239),i=r(37005);e.exports=function(e){return"number"==typeof e||i(e)&&"[object Number]"==n(e)}},13218:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},37005:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},68630:function(e,t,r){var n=r(44239),i=r(85924),a=r(37005),o=Object.prototype,s=Function.prototype.toString,u=o.hasOwnProperty,c=s.call(Object);e.exports=function(e){if(!a(e)||"[object Object]"!=n(e))return!1;var t=i(e);if(null===t)return!0;var r=u.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&s.call(r)==c}},47037:function(e,t,r){var n=r(44239),i=r(1469),a=r(37005);e.exports=function(e){return"string"==typeof e||!i(e)&&a(e)&&"[object String]"==n(e)}},33448:function(e,t,r){var n=r(44239),i=r(37005);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==n(e)}},36719:function(e,t,r){var n=r(38749),i=r(7518),a=r(31167),o=a&&a.isTypedArray,s=o?i(o):n;e.exports=s},3674:function(e,t,r){var n=r(14636),i=r(280),a=r(98612);e.exports=function(e){return a(e)?n(e):i(e)}},81704:function(e,t,r){var n=r(14636),i=r(10313),a=r(98612);e.exports=function(e){return a(e)?n(e,!0):i(e)}},66604:function(e,t,r){var n=r(89465),i=r(47816),a=r(11243);e.exports=function(e,t){var r={};return t=a(t,3),i(e,function(e,i,a){n(r,i,t(e,i,a))}),r}},88306:function(e,t,r){var n=r(83369);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw TypeError("Expected a function");var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(i.Cache||n),r}i.Cache=n,e.exports=i},82492:function(e,t,r){var n=r(42980),i=r(21463)(function(e,t,r){n(e,t,r)});e.exports=i},35937:function(e,t,r){var n=r(29932),i=r(11243),a=r(63012),o=r(46904);e.exports=function(e,t){if(null==e)return{};var r=n(o(e),function(e){return[e]});return t=i(t),a(e,r,function(e,r){return t(e,r[0])})}},39601:function(e,t,r){var n=r(40371),i=r(79152),a=r(15403),o=r(40327);e.exports=function(e){return a(e)?n(o(e)):i(e)}},54061:function(e,t,r){var n=r(62663),i=r(89881),a=r(11243),o=r(10107),s=r(1469);e.exports=function(e,t,r){var u=s(e)?n:o,c=arguments.length<3;return u(e,a(t,4),r,c,i)}},36968:function(e,t,r){var n=r(10611);e.exports=function(e,t,r){return null==e?e:n(e,t,r)}},70479:function(e){e.exports=function(){return[]}},95062:function(e){e.exports=function(){return!1}},30084:function(e,t,r){var n=r(29932),i=r(278),a=r(1469),o=r(33448),s=r(55514),u=r(40327),c=r(79833);e.exports=function(e){return a(e)?n(e,u):o(e)?[e]:i(s(c(e)))}},59881:function(e,t,r){var n=r(98363),i=r(81704);e.exports=function(e){return n(e,i(e))}},79833:function(e,t,r){var n=r(80531);e.exports=function(e){return null==e?"":n(e)}},63947:function(e,t,r){var n,i;n=r(23126),i={"minor second":16/15,"major second":9/8,"minor third":1.2,"major third":4/3,"diminished fourth":Math.sqrt(2),"perfect fifth":1.5,"minor sixth":1.6,golden:1.61803398875,phi:1.61803398875,"major sixth":5/3,"minor seventh":16/9,"major seventh":15/8,octave:2,"major tenth":2.5,"major eleventh":8/3,"major twelfth":3,"double octave":4},e.exports=function(e,t){return null==e&&(e=0),null==t&&(t="golden"),Math.pow(n(t)?t:null!=i[t]?i[t]:i.golden,e)}},11752:function(e,t,r){e.exports=r(62156)},61165:function(e,t,r){"use strict";var n,i,a,o,s,u=r(50029),c=r(71383),l=r(87794),f=r.n(l),d=r(67294),h=r(69696),p=r(99603),m=r(71893),g=r(42894),y=r(59417),b=r(85330),x=r(35683),S=r.n(x),w=r(85893),E=(0,m.ZP)(h.ZP)(n||(n=(0,c.Z)(["\n display: flex;\n align-items: center;\n text-align: left !important;\n\n & .pg-modal-main {\n max-width: 700px;\n margin: auto;\n box-shadow: 5px 5px 10px black;\n }\n"]))),A=(0,m.ZP)(h.ZP.Header)(i||(i=(0,c.Z)(["\n font-size: 1.5em;\n padding: 0.75em;\n background: #38598a;\n color: #fff;\n & a {\n float: right;\n }\n"]))),C=(0,m.ZP)(p.G)(a||(a=(0,c.Z)(["\n margin-right: 5px;\n height: 30px;\n"]))),P=m.ZP.div(o||(o=(0,c.Z)(["\n color: #000;\n cursor: default;\n font-weight: 400;\n"]))),O=m.ZP.div(s||(s=(0,c.Z)(["\n margin-top: 20px;\n display: flex;\n justify-content: "," & button {\n min-width: 150px;\n margin-right: 20px;\n display: inline-block;\n\n &:disabled {\n cursor: not-allowed;\n }\n }\n"])),function(e){return"center"===e.buttonAlign?"center;":"space-between;"});t.Z=function(e){var t,r,n=e.onConfirm,i=e.onClose,a=e.content,o=e.id,s=e.title,c=e.closable,l=e.icon,m=void 0===l?y.eHv:l,x=e.confirmText,k=e.showCancel,_=void 0===k||k,F=e.showConfirm,j=void 0===F||F,R=e.buttonStyle,I=e.buttonAlign,T=e.skipCloseOnConfirm,D=void 0!==T&&T,N=e.style,M=e.disableConfirm,L=(0,d.useState)(!1),B=L[0],H=L[1],$="bcSecondary",U="bcPrimary",z="confirm-delete-"+S()(s),V="cancel-"+S()(s);switch(void 0===R?"bcgov":R){case"bcgov":break;case"custom":$="secondary",U="primary";break;case"danger":$="secondary",U="danger"}var K=(t=(0,u.Z)(f().mark(function e(){return f().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(H(!0),!n){e.next=4;break}return e.next=4,n();case 4:H(!1),D||(window.location.hash="#");case 6:case"end":return e.stop()}},e)})),function(){return t.apply(this,arguments)}),W=(r=(0,u.Z)(f().mark(function e(){return f().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:i&&i(),window.location.hash="#";case 2:case"end":return e.stop()}},e)})),function(){return r.apply(this,arguments)});return(0,w.jsxs)(E,{id:o,children:[(0,w.jsxs)(A,{title:s,as:"div",children:[m&&(0,w.jsx)(C,{icon:m,title:"Information",size:"2x",style:{paddingRight:"10px"}}),s,c&&(0,w.jsx)(h.ZP.Close,{onClick:W,title:"exit",children:(0,w.jsx)(p.G,{icon:y.NBC,size:"lg"})})]}),(0,w.jsxs)(h.ZP.Content,{style:void 0===N?{}:N,children:[(0,w.jsx)(P,{children:a}),(_||j)&&(0,w.jsxs)(O,{buttonAlign:void 0===I?"default":I,children:[_&&(0,w.jsx)(b.zx,{variant:$,onClick:W,type:"button","data-testid":V,children:"Cancel"}),j&&(0,w.jsx)(b.zx,{"data-testid":z,onClick:K,variant:U,type:"button",className:"text-center",disabled:void 0!==M&&M,children:B?(0,w.jsx)(g.rj,{color:"#FFF",height:18,width:50,wrapperClass:"d-block",visible:B}):void 0===x?"Confirm":x})]})]})]})}},30233:function(e,t,r){"use strict";r.d(t,{V:function(){return j}});var n,i,a,o,s=r(50029),u=r(59499),c=r(71383),l=r(87794),f=r.n(l),d=r(67294),h=r(69696),p=r(99603),m=r(34798),g=r.n(m),y=r(71893),b=r(42894),x=r(59417),S=r(85330),w=r(35683),E=r.n(w),A=r(85893);function C(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function P(e){for(var t=1;t0&&(n=I(r.width)/o||1),a>0&&(i=I(r.height)/a||1)}return{width:r.width/n,height:r.height/i,top:r.top/i,right:r.right/n,bottom:r.bottom/i,left:r.left/n,x:r.left/n,y:r.top/i}}function D(e){var t=T(e),r=e.offsetWidth,n=e.offsetHeight;return 1>=Math.abs(t.width-r)&&(r=t.width),1>=Math.abs(t.height-n)&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function N(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&F(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function M(e){return e?(e.nodeName||"").toLowerCase():null}function L(e){return O(e).getComputedStyle(e)}function B(e){return((k(e)?e.ownerDocument:e.document)||window.document).documentElement}function H(e){return"html"===M(e)?e:e.assignedSlot||e.parentNode||(F(e)?e.host:null)||B(e)}function $(e){return _(e)&&"fixed"!==L(e).position?e.offsetParent:null}function U(e){for(var t=O(e),r=$(e);r&&["table","td","th"].indexOf(M(r))>=0&&"static"===L(r).position;)r=$(r);return r&&("html"===M(r)||"body"===M(r)&&"static"===L(r).position)?t:r||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&_(e)&&"fixed"===L(e).position)return null;var r=H(e);for(F(r)&&(r=r.host);_(r)&&0>["html","body"].indexOf(M(r));){var n=L(r);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||t&&"filter"===n.willChange||t&&n.filter&&"none"!==n.filter)return r;r=r.parentNode}return null}(e)||t}function z(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function V(e,t,r){return j(e,R(t,r))}function K(){return{top:0,right:0,bottom:0,left:0}}function W(e){return Object.assign({},K(),e)}function q(e,t){return t.reduce(function(t,r){return t[r]=e,t},{})}var Z="bottom",G="right",Y="left",J="auto",X=["top",Z,G,Y],Q="start",ee="viewport",et="popper",er=X.reduce(function(e,t){return e.concat([t+"-"+Q,t+"-end"])},[]),en=[].concat(X,[J]).reduce(function(e,t){return e.concat([t,t+"-"+Q,t+"-end"])},[]),ei=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function ea(e){return e.split("-")[1]}var eo={top:"auto",right:"auto",bottom:"auto",left:"auto"};function es(e){var t,r,n,i,a,o,s=e.popper,u=e.popperRect,c=e.placement,l=e.variation,f=e.offsets,d=e.position,h=e.gpuAcceleration,p=e.adaptive,m=e.roundOffsets,g=e.isFixed,y=f.x,b=void 0===y?0:y,x=f.y,S=void 0===x?0:x,w="function"==typeof m?m({x:b,y:S}):{x:b,y:S};b=w.x,S=w.y;var E=f.hasOwnProperty("x"),A=f.hasOwnProperty("y"),C=Y,P="top",k=window;if(p){var _=U(s),F="clientHeight",j="clientWidth";_===O(s)&&"static"!==L(_=B(s)).position&&"absolute"===d&&(F="scrollHeight",j="scrollWidth"),("top"===c||(c===Y||c===G)&&"end"===l)&&(P=Z,S-=(g&&_===k&&k.visualViewport?k.visualViewport.height:_[F])-u.height,S*=h?1:-1),(c===Y||("top"===c||c===Z)&&"end"===l)&&(C=G,b-=(g&&_===k&&k.visualViewport?k.visualViewport.width:_[j])-u.width,b*=h?1:-1)}var R=Object.assign({position:d},p&&eo),T=!0===m?(r=(t={x:b,y:S}).x,n=t.y,{x:I(r*(i=window.devicePixelRatio||1))/i||0,y:I(n*i)/i||0}):{x:b,y:S};return(b=T.x,S=T.y,h)?Object.assign({},R,((o={})[P]=A?"0":"",o[C]=E?"0":"",o.transform=1>=(k.devicePixelRatio||1)?"translate("+b+"px, "+S+"px)":"translate3d("+b+"px, "+S+"px, 0)",o)):Object.assign({},R,((a={})[P]=A?S+"px":"",a[C]=E?b+"px":"",a.transform="",a))}var eu={passive:!0},ec={left:"right",right:"left",bottom:"top",top:"bottom"};function el(e){return e.replace(/left|right|bottom|top/g,function(e){return ec[e]})}var ef={start:"end",end:"start"};function ed(e){return e.replace(/start|end/g,function(e){return ef[e]})}function eh(e){var t=O(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function ep(e){return T(B(e)).left+eh(e).scrollLeft}function em(e){var t=L(e),r=t.overflow,n=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+i+n)}function ev(e,t){void 0===t&&(t=[]);var r,n=function e(t){return["html","body","#document"].indexOf(M(t))>=0?t.ownerDocument.body:_(t)&&em(t)?t:e(H(t))}(e),i=n===(null==(r=e.ownerDocument)?void 0:r.body),a=O(n),o=i?[a].concat(a.visualViewport||[],em(n)?n:[]):n,s=t.concat(o);return i?s:s.concat(ev(H(o)))}function eg(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ey(e,t){var r,n,i,a,o,s,u,c,l,f,d,h,p,m,g,y,b;return t===ee?eg((r=O(e),n=B(e),i=r.visualViewport,a=n.clientWidth,o=n.clientHeight,s=0,u=0,i&&(a=i.width,o=i.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=i.offsetLeft,u=i.offsetTop)),{width:a,height:o,x:s+ep(e),y:u})):k(t)?((c=T(t)).top=c.top+t.clientTop,c.left=c.left+t.clientLeft,c.bottom=c.top+t.clientHeight,c.right=c.left+t.clientWidth,c.width=t.clientWidth,c.height=t.clientHeight,c.x=c.left,c.y=c.top,c):eg((l=B(e),d=B(l),h=eh(l),p=null==(f=l.ownerDocument)?void 0:f.body,m=j(d.scrollWidth,d.clientWidth,p?p.scrollWidth:0,p?p.clientWidth:0),g=j(d.scrollHeight,d.clientHeight,p?p.scrollHeight:0,p?p.clientHeight:0),y=-h.scrollLeft+ep(l),b=-h.scrollTop,"rtl"===L(p||d).direction&&(y+=j(d.clientWidth,p?p.clientWidth:0)-m),{width:m,height:g,x:y,y:b}))}function eb(e){var t,r=e.reference,n=e.element,i=e.placement,a=i?P(i):null,o=i?ea(i):null,s=r.x+r.width/2-n.width/2,u=r.y+r.height/2-n.height/2;switch(a){case"top":t={x:s,y:r.y-n.height};break;case Z:t={x:s,y:r.y+r.height};break;case G:t={x:r.x+r.width,y:u};break;case Y:t={x:r.x-n.width,y:u};break;default:t={x:r.x,y:r.y}}var c=a?z(a):null;if(null!=c){var l="y"===c?"height":"width";switch(o){case Q:t[c]=t[c]-(r[l]/2-n[l]/2);break;case"end":t[c]=t[c]+(r[l]/2-n[l]/2)}}return t}function ex(e,t){void 0===t&&(t={});var r,n,i,a,o,s,u,c=t,l=c.placement,f=void 0===l?e.placement:l,d=c.boundary,h=c.rootBoundary,p=c.elementContext,m=void 0===p?et:p,g=c.altBoundary,y=c.padding,b=void 0===y?0:y,x=W("number"!=typeof b?b:q(b,X)),S=e.rects.popper,w=e.elements[void 0!==g&&g?m===et?"reference":et:m],E=(r=k(w)?w:w.contextElement||B(e.elements.popper),s=(o=[].concat("clippingParents"===(n=void 0===d?"clippingParents":d)?(i=ev(H(r)),k(a=["absolute","fixed"].indexOf(L(r).position)>=0&&_(r)?U(r):r)?i.filter(function(e){return k(e)&&N(e,a)&&"body"!==M(e)}):[]):[].concat(n),[void 0===h?ee:h]))[0],(u=o.reduce(function(e,t){var n=ey(r,t);return e.top=j(n.top,e.top),e.right=R(n.right,e.right),e.bottom=R(n.bottom,e.bottom),e.left=j(n.left,e.left),e},ey(r,s))).width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u),A=T(e.elements.reference),C=eb({reference:A,element:S,strategy:"absolute",placement:f}),P=eg(Object.assign({},S,C)),O=m===et?P:A,F={top:E.top-O.top+x.top,bottom:O.bottom-E.bottom+x.bottom,left:E.left-O.left+x.left,right:O.right-E.right+x.right},I=e.modifiersData.offset;if(m===et&&I){var D=I[f];Object.keys(F).forEach(function(e){var t=[G,Z].indexOf(e)>=0?1:-1,r=["top",Z].indexOf(e)>=0?"y":"x";F[e]+=D[r]*t})}return F}function eS(e,t,r){return void 0===r&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function ew(e){return["top",G,Z,Y].some(function(t){return e[t]>=0})}var eE={placement:"bottom",modifiers:[],strategy:"absolute"};function eA(){for(var e=arguments.length,t=Array(e),r=0;r=0?-1:1,u=(s="function"==typeof a?a(Object.assign({},n,{placement:r})):a)[0],c=s[1],u=u||0,c=(c||0)*o,[Y,G].indexOf(i)>=0?{x:c,y:u}:{x:u,y:c}),e},{}),s=o[t.placement],u=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=c),t.modifiersData[n]=o}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var i=r.mainAxis,a=void 0===i||i,o=r.altAxis,s=void 0===o||o,u=r.fallbackPlacements,c=r.padding,l=r.boundary,f=r.rootBoundary,d=r.altBoundary,h=r.flipVariations,p=void 0===h||h,m=r.allowedAutoPlacements,g=t.options.placement,y=P(g),b=[g].concat(u||(y!==g&&p?function(e){if(P(e)===J)return[];var t=el(e);return[ed(e),t,ed(t)]}(g):[el(g)])).reduce(function(e,r){var n,i,a,o,s,u,d,h,g,y,b,x;return e.concat(P(r)===J?(i=(n={placement:r,boundary:l,rootBoundary:f,padding:c,flipVariations:p,allowedAutoPlacements:m}).placement,a=n.boundary,o=n.rootBoundary,s=n.padding,u=n.flipVariations,h=void 0===(d=n.allowedAutoPlacements)?en:d,0===(b=(y=(g=ea(i))?u?er:er.filter(function(e){return ea(e)===g}):X).filter(function(e){return h.indexOf(e)>=0})).length&&(b=y),Object.keys(x=b.reduce(function(e,r){return e[r]=ex(t,{placement:r,boundary:a,rootBoundary:o,padding:s})[P(r)],e},{})).sort(function(e,t){return x[e]-x[t]})):r)},[]),x=t.rects.reference,S=t.rects.popper,w=new Map,E=!0,A=b[0],C=0;C=0,j=F?"width":"height",R=ex(t,{placement:O,boundary:l,rootBoundary:f,altBoundary:d,padding:c}),I=F?_?G:Y:_?Z:"top";x[j]>S[j]&&(I=el(I));var T=el(I),D=[];if(a&&D.push(R[k]<=0),s&&D.push(R[I]<=0,R[T]<=0),D.every(function(e){return e})){A=O,E=!1;break}w.set(O,D)}if(E)for(var N=p?3:1,M=function(e){var t=b.find(function(t){var r=w.get(t);if(r)return r.slice(0,e).every(function(e){return e})});if(t)return A=t,"break"},L=N;L>0&&"break"!==M(L);L--);t.placement!==A&&(t.modifiersData[n]._skip=!0,t.placement=A,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options,n=e.name,i=r.mainAxis,a=r.altAxis,o=r.boundary,s=r.rootBoundary,u=r.altBoundary,c=r.padding,l=r.tether,f=void 0===l||l,d=r.tetherOffset,h=void 0===d?0:d,p=ex(t,{boundary:o,rootBoundary:s,padding:c,altBoundary:u}),m=P(t.placement),g=ea(t.placement),y=!g,b=z(m),x="x"===b?"y":"x",S=t.modifiersData.popperOffsets,w=t.rects.reference,E=t.rects.popper,A="function"==typeof h?h(Object.assign({},t.rects,{placement:t.placement})):h,C="number"==typeof A?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),O=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,k={x:0,y:0};if(S){if(void 0===i||i){var _,F="y"===b?"top":Y,I="y"===b?Z:G,T="y"===b?"height":"width",N=S[b],M=N+p[F],L=N-p[I],B=f?-E[T]/2:0,H=g===Q?w[T]:E[T],$=g===Q?-E[T]:-w[T],W=t.elements.arrow,q=f&&W?D(W):{width:0,height:0},J=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:K(),X=J[F],ee=J[I],et=V(0,w[T],q[T]),er=y?w[T]/2-B-et-X-C.mainAxis:H-et-X-C.mainAxis,en=y?-w[T]/2+B+et+ee+C.mainAxis:$+et+ee+C.mainAxis,ei=t.elements.arrow&&U(t.elements.arrow),eo=ei?"y"===b?ei.clientTop||0:ei.clientLeft||0:0,es=null!=(_=null==O?void 0:O[b])?_:0,eu=V(f?R(M,N+er-es-eo):M,N,f?j(L,N+en-es):L);S[b]=eu,k[b]=eu-N}if(void 0!==a&&a){var ec,el,ef=S[x],ed="y"===x?"height":"width",eh=ef+p["x"===b?"top":Y],ep=ef-p["x"===b?Z:G],em=-1!==["top",Y].indexOf(m),ev=null!=(ec=null==O?void 0:O[x])?ec:0,eg=em?eh:ef-w[ed]-E[ed]-ev+C.altAxis,ey=em?ef+w[ed]+E[ed]-ev-C.altAxis:ep,eb=f&&em?(el=V(eg,ef,ey))>ey?ey:el:V(f?eg:eh,ef,f?ey:ep);S[x]=eb,k[x]=eb-ef}t.modifiersData[n]=k}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,r,n=e.state,i=e.name,a=e.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,u=P(n.placement),c=z(u),l=[Y,G].indexOf(u)>=0?"height":"width";if(o&&s){var f=W("number"!=typeof(t="function"==typeof(t=a.padding)?t(Object.assign({},n.rects,{placement:n.placement})):t)?t:q(t,X)),d=D(o),h=n.rects.reference[l]+n.rects.reference[c]-s[c]-n.rects.popper[l],p=s[c]-n.rects.reference[c],m=U(o),g=m?"y"===c?m.clientHeight||0:m.clientWidth||0:0,y=f["y"===c?"top":Y],b=g-d[l]-f["y"===c?Z:G],x=g/2-d[l]/2+(h/2-p/2),S=V(y,x,b);n.modifiersData[i]=((r={})[c]=S,r.centerOffset=S-x,r)}},effect:function(e){var t=e.state,r=e.options.element,n=void 0===r?"[data-popper-arrow]":r;null!=n&&("string"!=typeof n||(n=t.elements.popper.querySelector(n)))&&N(t.elements.popper,n)&&(t.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]}]}).defaultModifiers)?[]:i,s=void 0===(o=n.defaultOptions)?eE:o,function(e,t,r){void 0===r&&(r=s);var n,i={placement:"bottom",orderedModifiers:[],options:Object.assign({},eE,s),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},o=[],u=!1,c={state:i,setOptions:function(r){var n,u,f,d,h,p="function"==typeof r?r(i.options):r;l(),i.options=Object.assign({},s,i.options,p),i.scrollParents={reference:k(e)?ev(e):e.contextElement?ev(e.contextElement):[],popper:ev(t)};var m=(u=Object.keys(n=[].concat(a,i.options.modifiers).reduce(function(e,t){var r=e[t.name];return e[t.name]=r?Object.assign({},r,t,{options:Object.assign({},r.options,t.options),data:Object.assign({},r.data,t.data)}):t,e},{})).map(function(e){return n[e]}),f=new Map,d=new Set,h=[],u.forEach(function(e){f.set(e.name,e)}),u.forEach(function(e){d.has(e.name)||function e(t){d.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){if(!d.has(t)){var r=f.get(t);r&&e(r)}}),h.push(t)}(e)}),ei.reduce(function(e,t){return e.concat(h.filter(function(e){return e.phase===t}))},[]));return i.orderedModifiers=m.filter(function(e){return e.enabled}),i.orderedModifiers.forEach(function(e){var t=e.name,r=e.options,n=e.effect;if("function"==typeof n){var a=n({state:i,name:t,instance:c,options:void 0===r?{}:r});o.push(a||function(){})}}),c.update()},forceUpdate:function(){if(!u){var e,t,r,n,a,o,s,l,f,d,h,p,m=i.elements,g=m.reference,y=m.popper;if(eA(g,y)){i.rects={reference:(t=U(y),r="fixed"===i.options.strategy,n=_(t),l=_(t)&&(o=I((a=t.getBoundingClientRect()).width)/t.offsetWidth||1,s=I(a.height)/t.offsetHeight||1,1!==o||1!==s),f=B(t),d=T(g,l),h={scrollLeft:0,scrollTop:0},p={x:0,y:0},(n||!n&&!r)&&(("body"!==M(t)||em(f))&&(h=(e=t)!==O(e)&&_(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:eh(e)),_(t)?(p=T(t,!0),p.x+=t.clientLeft,p.y+=t.clientTop):f&&(p.x=ep(f))),{x:d.left+h.scrollLeft-p.x,y:d.top+h.scrollTop-p.y,width:d.width,height:d.height}),popper:D(y)},i.reset=!1,i.placement=i.options.placement,i.orderedModifiers.forEach(function(e){return i.modifiersData[e.name]=Object.assign({},e.data)});for(var b=0;bvoid 0},ek={name:"ariaDescribedBy",enabled:!0,phase:"afterWrite",effect:({state:e})=>()=>{let{reference:t,popper:r}=e.elements;if("removeAttribute"in t){let e=(t.getAttribute("aria-describedby")||"").split(",").filter(e=>e.trim()!==r.id);e.length?t.setAttribute("aria-describedby",e.join(",")):t.removeAttribute("aria-describedby")}},fn:({state:e})=>{var t;let{popper:r,reference:n}=e.elements,i=null==(t=r.getAttribute("role"))?void 0:t.toLowerCase();if(r.id&&"tooltip"===i&&"setAttribute"in n){let e=n.getAttribute("aria-describedby");if(e&&-1!==e.split(",").indexOf(r.id))return;n.setAttribute("aria-describedby",e?`${e},${r.id}`:r.id)}}},e_=[];var eF=function(e,t,r={}){let{enabled:n=!0,placement:i="bottom",strategy:a="absolute",modifiers:o=e_}=r,s=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n=0||(i[r]=e[r]);return i}(r,eP),u=(0,l.useRef)(o),c=(0,l.useRef)(),f=(0,l.useCallback)(()=>{var e;null==(e=c.current)||e.update()},[]),d=(0,l.useCallback)(()=>{var e;null==(e=c.current)||e.forceUpdate()},[]),[h,p]=C((0,l.useState)({placement:i,update:f,forceUpdate:d,attributes:{},styles:{popper:{},arrow:{}}})),m=(0,l.useMemo)(()=>({name:"updateStateModifier",enabled:!0,phase:"write",requires:["computeStyles"],fn:({state:e})=>{let t={},r={};Object.keys(e.elements).forEach(n=>{t[n]=e.styles[n],r[n]=e.attributes[n]}),p({state:e,styles:t,attributes:r,update:f,forceUpdate:d,placement:e.placement})}}),[f,d,p]),g=(0,l.useMemo)(()=>(A(u.current,o)||(u.current=o),u.current),[o]);return(0,l.useEffect)(()=>{c.current&&n&&c.current.setOptions({placement:i,strategy:a,modifiers:[...g,m,eO]})},[a,i,m,n,g]),(0,l.useEffect)(()=>{if(n&&null!=e&&null!=t)return c.current=eC(e,t,Object.assign({},s,{placement:i,strategy:a,modifiers:[...g,ek,m]})),()=>{null!=c.current&&(c.current.destroy(),c.current=void 0,p(e=>Object.assign({},e,{attributes:{},styles:{popper:{}}})))}},[n,e,t]),h},ej=!!("undefined"!=typeof window&&window.document&&window.document.createElement),eR=!1,eI=!1;try{var eT={get passive(){return eR=!0},get once(){return eI=eR=!0}};ej&&(window.addEventListener("test",eT,eT),window.removeEventListener("test",eT,!0))}catch(e){}var eD=function(e,t,r,n){if(n&&"boolean"!=typeof n&&!eI){var i=n.once,a=n.capture,o=r;!eI&&i&&(o=r.__once||function e(n){this.removeEventListener(t,e,a),r.call(this,n)},r.__once=o),e.addEventListener(t,o,eR?n:a)}e.addEventListener(t,r,n)},eN=function(e,t,r,n){var i=n&&"boolean"!=typeof n?n.capture:n;e.removeEventListener(t,r,i),r.__once&&e.removeEventListener(t,r.__once,i)},eM=function(e,t,r,n){return eD(e,t,r,n),function(){eN(e,t,r,n)}};function eL(e){return e&&e.ownerDocument||document}var eB=r(78146);let eH=()=>{},e$=e=>e&&("current"in e?e.current:e),eU={click:"mousedown",mouseup:"mousedown",pointerup:"pointerdown"};var ez=function(e,t=eH,{disabled:r,clickTrigger:n="click"}={}){let i=(0,l.useRef)(!1),a=(0,l.useRef)(!1),o=(0,l.useCallback)(t=>{let r=e$(e);p()(!!r,"ClickOutside captured a close event but does not have a ref to compare it to. useClickOutside(), should be passed a ref that resolves to a DOM node"),i.current=!r||!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)||0!==t.button||!!f(r,t.target)||a.current,a.current=!1},[e]),s=(0,eB.Z)(t=>{let r=e$(e);r&&f(r,t.target)&&(a.current=!0)}),u=(0,eB.Z)(e=>{i.current||t(e)});(0,l.useEffect)(()=>{if(r||null==e)return;let t=eL(e$(e)),i=(t.defaultView||window).event,a=null;eU[n]&&(a=eM(t,eU[n],s,!0));let c=eM(t,n,o,!0),l=eM(t,n,e=>{if(e===i){i=void 0;return}u(e)}),f=[];return"ontouchstart"in t.documentElement&&(f=[].slice.call(t.body.children).map(e=>eM(e,"mousemove",eH))),()=>{null==a||a(),c(),l(),f.forEach(e=>e())}},[e,r,n,o,s,u])};let eV=()=>{};var eK=function(e,t,{disabled:r,clickTrigger:n}={}){let i=t||eV;ez(e,i,{disabled:r,clickTrigger:n});let a=(0,eB.Z)(e=>{27===e.keyCode&&i(e)});(0,l.useEffect)(()=>{if(r||null==e)return;let t=eL(e$(e)),n=(t.defaultView||window).event,i=eM(t,"keyup",e=>{if(e===n){n=void 0;return}a(e)});return()=>{i()}},[e,r,a])};let eW=(0,l.createContext)(ej?window:void 0);eW.Provider;let eq=(e,t)=>ej?null==e?(t||eL()).body:("function"==typeof e&&(e=e()),e&&"current"in e&&(e=e.current),e&&("nodeType"in e||e.getBoundingClientRect))?e:null:null;function eZ(e,t){let r=(0,l.useContext)(eW),[n,i]=(0,l.useState)(()=>eq(e,null==r?void 0:r.document));if(!n){let t=eq(e);t&&i(t)}return(0,l.useEffect)(()=>{t&&n&&t(n)},[t,n]),(0,l.useEffect)(()=>{let t=eq(e);t!==n&&i(t)},[e,n]),n}var eG=r(85893);let eY=l.forwardRef((e,t)=>{let{flip:r,offset:n,placement:i,containerPadding:a,popperConfig:o={},transition:s}=e,[u,c]=(0,S.Z)(),[f,d]=(0,S.Z)(),h=g(c,t),p=eZ(e.container),m=eZ(e.target),[y,b]=(0,l.useState)(!e.show),w=eF(m,u,function({enabled:e,enableEvents:t,placement:r,flip:n,offset:i,fixed:a,containerPadding:o,arrowElement:s,popperConfig:u={}}){var c,l,f,d;let h=function(e){let t={};return Array.isArray(e)?(null==e||e.forEach(e=>{t[e.name]=e}),t):e||t}(u.modifiers);return Object.assign({},u,{placement:r,enabled:e,strategy:a?"fixed":u.strategy,modifiers:function(e={}){return Array.isArray(e)?e:Object.keys(e).map(t=>(e[t].name=t,e[t]))}(Object.assign({},h,{eventListeners:{enabled:t},preventOverflow:Object.assign({},h.preventOverflow,{options:o?Object.assign({padding:o},null==(c=h.preventOverflow)?void 0:c.options):null==(l=h.preventOverflow)?void 0:l.options}),offset:{options:Object.assign({offset:i},null==(f=h.offset)?void 0:f.options)},arrow:Object.assign({},h.arrow,{enabled:!!s,options:Object.assign({},null==(d=h.arrow)?void 0:d.options,{element:s})}),flip:Object.assign({enabled:!!n},h.flip)}))})}({placement:i,enableEvents:!!e.show,containerPadding:a||5,flip:r,offset:n,arrowElement:f,popperConfig:o}));e.show?y&&b(!1):e.transition||y||b(!0);let E=(...t)=>{b(!0),e.onExited&&e.onExited(...t)},A=e.show||s&&!y;if(eK(u,e.onHide,{disabled:!e.rootClose||e.rootCloseDisabled,clickTrigger:e.rootCloseEvent}),!A)return null;let C=e.children(Object.assign({},w.attributes.popper,{style:w.styles.popper,ref:h}),{popper:w,placement:i,show:!!e.show,arrowProps:Object.assign({},w.attributes.arrow,{style:w.styles.arrow,ref:d})});if(s){let{onExit:t,onExiting:r,onEnter:n,onEntering:i,onEntered:a}=e;C=(0,eG.jsx)(s,{in:e.show,appear:!0,onExit:t,onExiting:r,onExited:E,onEnter:n,onEntering:i,onEntered:a,children:C})}return p?x.createPortal(C,p):null});eY.displayName="Overlay";var eJ=r(99585),eX=r(76792),eQ=/-(.)/g;let e0=e=>e[0].toUpperCase()+e.replace(eQ,function(e,t){return t.toUpperCase()}).slice(1);function e1(e,{displayName:t=e0(e),Component:r,defaultProps:n}={}){let i=l.forwardRef(({className:t,bsPrefix:n,as:i=r||"div",...a},o)=>{let s=(0,eX.vE)(n,e);return(0,eG.jsx)(i,{ref:o,className:b()(t,s),...a})});return i.defaultProps=n,i.displayName=t,i}var e2=e1("popover-header"),e4=e1("popover-body");let e3=l.forwardRef(({bsPrefix:e,placement:t,className:r,style:n,children:i,body:a,arrowProps:o,popper:s,show:u,...c},l)=>{let f;let d=(0,eX.vE)(e,"popover"),h=(0,eX.SC)(),[p]=(null==t?void 0:t.split("-"))||[],m=(f=p,"left"===p?f=h?"end":"start":"right"===p&&(f=h?"start":"end"),f);return(0,eG.jsxs)("div",{ref:l,role:"tooltip",style:n,"x-placement":p,className:b()(r,d,p&&`bs-popover-${m}`),...c,children:[(0,eG.jsx)("div",{className:"popover-arrow",...o}),a?(0,eG.jsx)(e4,{children:i}):i]})});e3.defaultProps={placement:"right"};var e6=Object.assign(e3,{Header:e2,Body:e4,POPPER_OFFSET:[0,8]});function e5(e,t){return(e5=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var e8={disabled:!1},e9=l.createContext(null),e7="unmounted",te="exited",tt="entering",tr="entered",tn="exiting",ti=function(e){function t(t,r){n=e.call(this,t,r)||this;var n,i,a=r&&!r.isMounting?t.enter:t.appear;return n.appearStatus=null,t.in?a?(i=te,n.appearStatus=tt):i=tr:i=t.unmountOnExit||t.mountOnEnter?e7:te,n.state={status:i},n.nextCallback=null,n}(r=t).prototype=Object.create(e.prototype),r.prototype.constructor=r,e5(r,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===e7?{status:te}:null};var r,n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var r=this.state.status;this.props.in?r!==tt&&r!==tr&&(t=tt):(r===tt||r===tr)&&(t=tn)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,r,n=this.props.timeout;return e=t=r=n,null!=n&&"number"!=typeof n&&(e=n.exit,t=n.enter,r=void 0!==n.appear?n.appear:t),{exit:e,enter:t,appear:r}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t){if(this.cancelNextCallback(),t===tt){if(this.props.unmountOnExit||this.props.mountOnEnter){var r=this.props.nodeRef?this.props.nodeRef.current:x.findDOMNode(this);r&&r.scrollTop}this.performEnter(e)}else this.performExit()}else this.props.unmountOnExit&&this.state.status===te&&this.setState({status:e7})},n.performEnter=function(e){var t=this,r=this.props.enter,n=this.context?this.context.isMounting:e,i=this.props.nodeRef?[n]:[x.findDOMNode(this),n],a=i[0],o=i[1],s=this.getTimeouts(),u=n?s.appear:s.enter;if(!e&&!r||e8.disabled){this.safeSetState({status:tr},function(){t.props.onEntered(a)});return}this.props.onEnter(a,o),this.safeSetState({status:tt},function(){t.props.onEntering(a,o),t.onTransitionEnd(u,function(){t.safeSetState({status:tr},function(){t.props.onEntered(a,o)})})})},n.performExit=function(){var e=this,t=this.props.exit,r=this.getTimeouts(),n=this.props.nodeRef?void 0:x.findDOMNode(this);if(!t||e8.disabled){this.safeSetState({status:te},function(){e.props.onExited(n)});return}this.props.onExit(n),this.safeSetState({status:tn},function(){e.props.onExiting(n),e.onTransitionEnd(r.exit,function(){e.safeSetState({status:te},function(){e.props.onExited(n)})})})},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,r=!0;return this.nextCallback=function(n){r&&(r=!1,t.nextCallback=null,e(n))},this.nextCallback.cancel=function(){r=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var r=this.props.nodeRef?this.props.nodeRef.current:x.findDOMNode(this),n=null==e&&!this.props.addEndListener;if(!r||n){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[r,this.nextCallback],a=i[0],o=i[1];this.props.addEndListener(a,o)}null!=e&&setTimeout(this.nextCallback,e)},n.render=function(){var e=this.state.status;if(e===e7)return null;var t=this.props,r=t.children,n=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n=0||(i[r]=e[r]);return i}(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return l.createElement(e9.Provider,{value:null},"function"==typeof r?r(e,n):l.cloneElement(l.Children.only(r),n))},t}(l.Component);function ta(){}ti.contextType=e9,ti.propTypes={},ti.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:ta,onEntering:ta,onEntered:ta,onExit:ta,onExiting:ta,onExited:ta},ti.UNMOUNTED=e7,ti.EXITED=te,ti.ENTERING=tt,ti.ENTERED=tr,ti.EXITING=tn;var to=/([A-Z])/g,ts=/^ms-/;function tu(e){return e.replace(to,"-$1").toLowerCase().replace(ts,"-ms-")}var tc=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i,tl=function(e,t){var r,n="",i="";if("string"==typeof t)return e.style.getPropertyValue(tu(t))||((r=eL(e))&&r.defaultView||window).getComputedStyle(e,void 0).getPropertyValue(tu(t));Object.keys(t).forEach(function(r){var a=t[r];a||0===a?r&&tc.test(r)?i+=r+"("+a+") ":n+=tu(r)+": "+a+";":e.style.removeProperty(tu(r))}),i&&(n+="transform: "+i+";"),e.style.cssText+=";"+n};function tf(e,t){let r=tl(e,t)||"",n=-1===r.indexOf("ms")?1e3:1;return parseFloat(r)*n}function td(e,t){var r,n,i,a,o,s,u,c,l,f,d,h;let p=tf(e,"transitionDuration"),m=tf(e,"transitionDelay"),g=(r=e,n=r=>{r.target===e&&(g(),t(r))},null==(i=p+m)&&(s=-1===(o=tl(r,"transitionDuration")||"").indexOf("ms")?1e3:1,i=parseFloat(o)*s||0),d=(c=!1,l=setTimeout(function(){c||function(e,t,r,n){if(void 0===r&&(r=!1),void 0===n&&(n=!0),e){var i=document.createEvent("HTMLEvents");i.initEvent(t,r,n),e.dispatchEvent(i)}}(r,"transitionend",!0)},i+5),f=eM(r,"transitionend",function(){c=!0},{once:!0}),function(){clearTimeout(l),f()}),h=eM(r,"transitionend",n),function(){d(),h()})}function th(e){return e&&"setState"in e?x.findDOMNode(e):null!=e?e:null}let tp=l.forwardRef(({onEnter:e,onEntering:t,onEntered:r,onExit:n,onExiting:i,onExited:a,addEndListener:o,children:s,childRef:u,...c},f)=>{let d=(0,l.useRef)(null),h=g(d,u),p=e=>{h(th(e))},m=e=>t=>{e&&d.current&&e(d.current,t)},y=(0,l.useCallback)(m(e),[e]),b=(0,l.useCallback)(m(t),[t]),x=(0,l.useCallback)(m(r),[r]),S=(0,l.useCallback)(m(n),[n]),w=(0,l.useCallback)(m(i),[i]),E=(0,l.useCallback)(m(a),[a]),A=(0,l.useCallback)(m(o),[o]);return(0,eG.jsx)(ti,{ref:f,...c,onEnter:y,onEntered:x,onEntering:b,onExit:S,onExited:E,onExiting:w,addEndListener:A,nodeRef:d,children:"function"==typeof s?(e,t)=>s(e,{...t,ref:p}):l.cloneElement(s,{ref:p})})}),tm={[tt]:"show",[tr]:"show"},tv=l.forwardRef(({className:e,children:t,transitionClasses:r={},...n},i)=>{let a=(0,l.useCallback)((e,t)=>{e.offsetHeight,null==n.onEnter||n.onEnter(e,t)},[n]);return(0,eG.jsx)(tp,{ref:i,addEndListener:td,...n,onEnter:a,childRef:t.ref,children:(n,i)=>l.cloneElement(t,{...i,className:b()("fade",e,t.props.className,tm[n],r[n])})})});tv.defaultProps={in:!1,timeout:300,mountOnEnter:!1,unmountOnExit:!1,appear:!1},tv.displayName="Fade";let tg=l.forwardRef(({children:e,transition:t,popperConfig:r={},...n},i)=>{let a=(0,l.useRef)({}),[o,s]=(0,S.Z)(),[u,c]=function(e){let t=(0,l.useRef)(null),r=(0,eX.vE)(void 0,"popover"),n=(0,l.useMemo)(()=>({name:"offset",options:{offset:()=>{var n;return t.current&&((n=t.current).classList?!!r&&n.classList.contains(r):-1!==(" "+(n.className.baseVal||n.className)+" ").indexOf(" "+r+" "))?e||e6.POPPER_OFFSET:e||[0,0]}}}),[e,r]);return[t,[n]]}(n.offset),f=g(i,u),d=!0===t?tv:t||void 0,h=(0,eB.Z)(e=>{s(e),null==r||null==r.onFirstUpdate||r.onFirstUpdate(e)});return(0,eJ.Z)(()=>{o&&(null==a.current.scheduleUpdate||a.current.scheduleUpdate())},[o]),(0,eG.jsx)(eY,{...n,ref:f,popperConfig:{...r,modifiers:c.concat(r.modifiers||[]),onFirstUpdate:h},transition:d,children:(r,{arrowProps:n,popper:i,show:o})=>{var s,u;!function(e,t){let{ref:r}=e,{ref:n}=t;e.ref=r.__wrapped||(r.__wrapped=e=>r(th(e))),t.ref=n.__wrapped||(n.__wrapped=e=>n(th(e)))}(r,n);let c=null==i?void 0:i.placement,f=Object.assign(a.current,{state:null==i?void 0:i.state,scheduleUpdate:null==i?void 0:i.update,placement:c,outOfBoundaries:(null==i?void 0:null==(s=i.state)?void 0:null==(u=s.modifiersData.hide)?void 0:u.isReferenceHidden)||!1});return"function"==typeof e?e({...r,placement:c,show:o,...!t&&o&&{className:"show"},popper:f,arrowProps:n}):l.cloneElement(e,{...r,placement:c,arrowProps:n,popper:f,className:b()(e.props.className,!t&&o&&"show"),style:{...e.props.style,...r.style}})}})});function ty(e,t,r){let[n]=t,i=n.currentTarget,a=n.relatedTarget||n.nativeEvent[r];a&&a===i||f(i,a)||e(...t)}function tb({trigger:e,overlay:t,children:r,popperConfig:n={},show:i,defaultShow:a=!1,onToggle:o,delay:s,placement:u,flip:c=u&&-1!==u.indexOf("auto"),...f}){var h,p,m,y,b,x,S,w,E,A;let C=(0,l.useRef)(null),P=g(C,r.ref),O=(E=(0,d.Z)(),A=(0,l.useRef)(),S=function(){return clearTimeout(A.current)},(w=(0,l.useRef)(S)).current=S,(0,l.useEffect)(function(){return function(){return w.current()}},[]),(0,l.useMemo)(function(){var e=function(){return clearTimeout(A.current)};return{set:function(t,r){void 0===r&&(r=0),E()&&(e(),r<=2147483647?A.current=setTimeout(t,r):function e(t,r,n){var i=n-Date.now();t.current=i<=2147483647?setTimeout(r,i):setTimeout(function(){return e(t,r,n)},2147483647)}(A,t,Date.now()+r))},clear:e}},[])),k=(0,l.useRef)(""),[_,F]=(h=(0,l.useRef)(void 0!==i),m=(p=(0,l.useState)(a))[0],y=p[1],b=void 0!==i,x=h.current,h.current=b,!b&&x&&m!==a&&y(a),[b?i:m,(0,l.useCallback)(function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n{P(th(e))},N=(0,l.useCallback)(()=>{if(O.clear(),k.current="show",!j.show){F(!0);return}O.set(()=>{"show"===k.current&&F(!0)},j.show)},[j.show,F,O]),M=(0,l.useCallback)(()=>{if(O.clear(),k.current="hide",!j.hide){F(!1);return}O.set(()=>{"hide"===k.current&&F(!1)},j.hide)},[j.hide,F,O]),L=(0,l.useCallback)((...e)=>{N(),null==R||R(...e)},[N,R]),B=(0,l.useCallback)((...e)=>{M(),null==I||I(...e)},[M,I]),H=(0,l.useCallback)((...e)=>{F(!_),null==T||T(...e)},[T,F,_]),$=(0,l.useCallback)((...e)=>{ty(N,e,"fromElement")},[N]),U=(0,l.useCallback)((...e)=>{ty(M,e,"toElement")},[M]),z=null==e?[]:[].concat(e),V={ref:D};return -1!==z.indexOf("click")&&(V.onClick=H),-1!==z.indexOf("focus")&&(V.onFocus=L,V.onBlur=B),-1!==z.indexOf("hover")&&(V.onMouseOver=$,V.onMouseOut=U),(0,eG.jsxs)(eG.Fragment,{children:["function"==typeof r?r(V):(0,l.cloneElement)(r,V),(0,eG.jsx)(tg,{...f,show:_,onHide:M,flip:c,placement:u,popperConfig:n,target:C.current,children:t})]})}tg.displayName="Overlay",tg.defaultProps={transition:tv,rootClose:!1,show:!1,placement:"top"},tb.defaultProps={defaultShow:!1,trigger:["hover","focus"]};var tx=r(71893),tS=r(34798),tw=r.n(tS),tE=r(99603),tA=r(59417),tC=r(63055);function tP(e){var t=e.title,r=e.content,n=e.show,i=e.hide,a=e.icon,o=void 0===a?tA.sqG:a,s=e.onClick,u=void 0===s?tw():s,c=e.trigger,l=e.style,f=e.children,d=(0,eG.jsxs)(e6,{id:"popover-basic",style:l,children:[t&&(0,eG.jsx)(e2,{children:t}),r&&(0,eG.jsx)(e4,{dangerouslySetInnerHTML:{__html:r}})]});return(0,eG.jsx)(tb,{trigger:void 0===c?["hover","focus","click"]:c,placement:"right-start",overlay:d,delay:{show:void 0===n?150:n,hide:void 0===i?250:i},children:(0,eG.jsx)("span",{children:f||(0,eG.jsx)(tE.G,{color:"#777777",icon:o,onClick:u})})})}(0,tx.ZP)(e6)(u||(u=(0,c.Z)(["\n font-size: "," !important;\n font-family: "," !important;\n"])),tC.n5,tC.rk)},31637:function(e,t,r){"use strict";var n,i=r(71383),a=r(42894),o=r(71893),s=r(63055),u=r(85893),c=o.ZP.div(n||(n=(0,i.Z)(["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n margin-top: ",";\n\n & p {\n margin-top: 10px;\n }\n"])),s.SI);t.Z=function(){return(0,u.jsxs)(c,{children:[(0,u.jsx)(a.rj,{color:"#000",height:45,width:45,visible:!0}),(0,u.jsx)("p",{children:"Loading information..."})]})}},59912:function(e,t,r){"use strict";r.d(t,{I:function(){return o}});var n,i=r(71383),a=r(71893),o=[{maxWidth:767,marginTop:10},{maxWidth:991,width:723,marginTop:20},{maxWidth:1199,width:933,marginTop:50},{width:1127,marginTop:80}],s=function(e,t,r,n){if("left"===e)return"\n margin-right: auto !important;\n ";if("right"===e)return"\n margin-left: auto !important;\n ";if("center"===e)return"\n margin-left: auto !important;\n margin-right: auto !important;\n ";var i="";return t&&(i+="margin-left: ".concat(t).concat(n," !important;")),r&&(i+="margin-right: ".concat(r).concat(n," !important;")),i},u=a.ZP.div(n||(n=(0,i.Z)(["\n display: block;\n max-width: 100% !important;\n\n ","\n"])),function(e){return e.rules.map(function(t,r){return 0===r?"@media only screen and (max-width: ".concat(t.maxWidth,"px) {\n & {\n ").concat(t.marginTop&&"margin-top: ".concat(t.marginTop,"px;"),"\n width: auto !important;\n ").concat(s(t.horizontalAlign||"none",1,1,"em"),"\n }\n }"):r===e.rules.length-1?"@media only screen and (min-width: ".concat((e.rules[r-1].maxWidth||0)+1,"px) {\n & {\n ").concat(t.marginTop&&"margin-top: ".concat(t.marginTop,"px;"),"\n width: ").concat(t.width,"px;\n ").concat(s(t.horizontalAlign||"center",t.marginLeft,t.marginRight,t.marginUnit),"\n }\n }"):"@media only screen and (min-width: ".concat((e.rules[r-1].maxWidth||0)+1,"px) and (max-width: ").concat(t.maxWidth,"px) {\n & {\n ").concat(t.marginTop&&"margin-top: ".concat(t.marginTop,"px;"),"\n width: ").concat(t.width,"px;\n ").concat(s(t.horizontalAlign||"center",t.marginLeft,t.marginRight,t.marginUnit),"\n }\n }")})});t.Z=u},19287:function(e,t,r){"use strict";var n,i=r(71383),a=r(71893);t.Z=a.ZP.div(n||(n=(0,i.Z)(["\n width: 100%;\n\n & .pg-notification-close {\n padding: 0 0.5rem;\n }\n"])))},99154:function(e,t,r){"use strict";r.d(t,{DK:function(){return h},Es:function(){return c},JK:function(){return s},Jx:function(){return p},Qf:function(){return d},S3:function(){return g},TW:function(){return l},YC:function(){return f},dV:function(){return m},ne:function(){return u},rp:function(){return o},uA:function(){return n}});var n=function(e){return"bceidboth"===e},i=function(e){return"digitalcredential"===e},a=function(e){return["idir","azureidir"].includes(e)},o=function(e){return e.startsWith("bceid")},s=function(e){return!o(e)},u=function(e){return["bceidbasic","bceidbusiness"].includes(e)},c=function(e){return a(e)||"bceidboth"!==e},l=function(e){return a(e)||!u(e)},f=function(e){return["githubpublic","githubbcgov"].includes(e)},d=function(e){return!f(e)},h=function(e){return!i(e)},p=function(e){if(!e)return!1;var t=e.devIdps;return(void 0===t?[]:t).some(o)},m=function(e){if(!e)return!1;var t=e.devIdps;return(void 0===t?[]:t).some(f)},g=function(e){if(!e)return!1;var t=e.devIdps;return(void 0===t?[]:t).some(i)}},15812:function(e,t,r){"use strict";r.d(t,{bD:function(){return x},ZP:function(){return b},hU:function(){return S}});var n,i=r(59499),a=r(67294),o=r(48094),s=r.n(o),u=r(85330),c=r(85893),l=function(e){var t=e.children,r=e.variant,n=e.size,i=e.closable,o=e.content,s=e.fadeOut,l=(0,a.useState)(!1),f=l[0],d=l[1];return((0,a.useEffect)(function(){var e=s?setTimeout(function(){d(!0)},s):null;return function(){e&&clearTimeout(e)}},[]),f)?null:(0,c.jsx)(u.bZ,{variant:r,size:n,closable:i,content:o,children:t})},f=r(19287),d=r(71383),h=r(71893).ZP.div(n||(n=(0,d.Z)(["\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n z-index: 2000;\n"])));function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function m(e){for(var t=1;t0;t&&r&&t(r)})},e),elements:i},u.push(r),s.set(r,t),t}({root:null==t?void 0:t.current,rootMargin:r})).id,i=e.observer,(l=e.elements).set(p,function(e){return e&&d(e)}),i.observe(p),function(){if(l.delete(p),i.unobserve(p),0===l.size){i.disconnect(),s.delete(n);var e=u.findIndex(function(e){return e.root===n.root&&e.margin===n.margin});e>-1&&u.splice(e,1)}}}}else if(!f){var m=a.requestIdleCallback(function(){return d(!0)});return function(){return a.cancelIdleCallback(m)}}},[c,r,t,f,h.current]),[p,f,i.useCallback(function(){d(!1)},[])]};var i=r(67294),a=r(98065),o="function"==typeof IntersectionObserver,s=new Map,u=[];("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},17285:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AmpStateContext=void 0;var n=(0,r(92648).Z)(r(67294)).default.createContext({});t.AmpStateContext=n},80354:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isInAmpMode=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.ampFirst,r=e.hybrid,n=e.hasQuery;return void 0!==t&&t||void 0!==r&&r&&void 0!==n&&n}},16505:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultHead=l,t.default=void 0;var n=r(6495).Z,i=r(92648).Z,a=(0,r(91598).Z)(r(67294)),o=i(r(70148)),s=r(17285),u=r(60523),c=r(80354);function l(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=[a.default.createElement("meta",{charSet:"utf-8"})];return e||t.push(a.default.createElement("meta",{name:"viewport",content:"width=device-width"})),t}function f(e,t){return"string"==typeof t||"number"==typeof t?e:t.type===a.default.Fragment?e.concat(a.default.Children.toArray(t.props.children).reduce(function(e,t){return"string"==typeof t||"number"==typeof t?e:e.concat(t)},[])):e.concat(t)}r(92783);var d=["name","httpEquiv","charSet","itemProp"];function h(e,t){var r,i,o,s,u=t.inAmpMode;return e.reduce(f,[]).reverse().concat(l(u).reverse()).filter((r=new Set,i=new Set,o=new Set,s={},function(e){var t=!0,n=!1;if(e.key&&"number"!=typeof e.key&&e.key.indexOf("$")>0){n=!0;var a=e.key.slice(e.key.indexOf("$")+1);r.has(a)?t=!1:r.add(a)}switch(e.type){case"title":case"base":i.has(e.type)?t=!1:i.add(e.type);break;case"meta":for(var u=0,c=d.length;u0&&!eb().isEmail(f))){e.next=3;break}return s("Please provide a valid email address"),e.abrupt("return");case 3:return e.next=5,(0,B.ck)({additionalEmail:f});case 5:t=e.sent,n=(r=(0,P.Z)(t,2))[0],(a=r[1])?(console.error(a),p(a)):n&&i.show({variant:"success",fadeOut:2500,closable:!0,content:"Your additional email has successfully been updated"}),window.location.hash="#";case 11:case"end":return e.stop()}},e)})),function(){return r.apply(this,arguments)}),y="".concat(null==c?void 0:c.given_name," ").concat(null==c?void 0:c.family_name),b=(0,et.jsxs)(ex,{children:[(0,et.jsx)(em.default,{label:"Name",fullWidth:!0,value:y,disabled:!0}),(0,et.jsx)("br",{}),(0,et.jsx)(em.default,{label:"Default Email",fullWidth:!0,value:null==c?void 0:c.email,disabled:!0}),(0,et.jsx)("br",{}),(0,et.jsxs)("div",{children:[(0,et.jsx)("span",{className:"strong",children:"Additional Email"})," \xa0",(0,et.jsx)(eg.Z,{title:"",content:"You can add a work email address in addition to your @gov.bc.ca to keep you informed of your integration progress. Note IDIR login/authentication is required to access the CSS App.",hide:200})]}),(0,et.jsx)(em.default,{"data-testid":"addi-email",type:"email",fullWidth:!0,maxLength:"100",value:f,onChange:function(e){eb().isEmail(e.target.value)&&s(""),d(e.target.value)}}),o&&(0,et.jsx)(eS,{children:o})]});return(0,et.jsxs)(et.Fragment,{children:[n(h,function(){return window.location.hash=h}),(0,et.jsx)(ev.Z,{id:h,content:b,onConfirm:g,icon:K.m08,title:"My Profile",confirmText:"Save",skipCloseOnConfirm:!0,closable:!0})]})}),eE=r(85330),eA=Z.ZP.div(d||(d=(0,$.Z)(["\n font-size: 1.2rem;\n display: flex;\n\n & > div:first-child {\n color: red;\n font-size: 2rem;\n width: 120px;\n }\n\n & > div:nth-child(2) {\n & > p:first-child {\n color: red;\n font-weight: bold;\n }\n }\n"]))),eC="gold-notification",eP=function(){var e,t,r=(0,j.useContext)(tA)||{},n=r.user,i=r.session,a=(e=(0,k.Z)(F().mark(function e(){var t;return F().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(!i||!n)){e.next=2;break}return e.abrupt("return");case 2:!i.isAdmin&&!n.hasReadGoldNotification&&null!==(t=n.integrations)&&void 0!==t&&t.find(function(e){return"gold"!==e.serviceType})&&(window.location.hash=eC);case 3:case"end":return e.stop()}},e)})),function(){return e.apply(this,arguments)});(0,j.useEffect)(function(){i&&n&&a()},[n]);var o=(t=(0,k.Z)(F().mark(function e(){return F().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,B.ck)({hasReadGoldNotification:!0});case 2:window.location.hash="#";case 3:case"end":return e.stop()}},e)})),function(){return t.apply(this,arguments)}),s=(0,et.jsxs)(et.Fragment,{children:[(0,et.jsxs)(eA,{children:[(0,et.jsx)("div",{children:(0,et.jsx)(V.G,{icon:K.RLE,size:"lg"})}),(0,et.jsxs)("div",{children:[(0,et.jsx)("p",{children:"At this time, the Silver realms are being retired on Jan. 30 2023*. Projects on these realms will no longer be supported by the SSO team."}),(0,et.jsxs)("p",{children:["Please complete a ",(0,et.jsx)("span",{className:"strong",children:"Change Impact Assessment"}),", for each of your projects in the Silver realms."]})]})]}),(0,et.jsx)("div",{className:"text-center",children:(0,et.jsx)(eE.zx,{variant:"primary",type:"button",onClick:function(){return window.open("https://docs.google.com/forms/d/1MMPeMB0A2076xkXIZRaErAwZe9QDsSwSAWqe-uvm3ys","_blank")},children:"Complete Change Impact Assessment"})})]});return(0,et.jsx)(et.Fragment,{children:(0,et.jsx)(ev.Z,{id:eC,content:s,showCancel:!1,showConfirm:!1,onClose:o,icon:K.RLE,title:"Please upgrade from Silver to Gold",closable:!0})})},eO=r(90352),ek=Z.ZP.span(h||(h=(0,$.Z)(["\n font-weight: 600;\n font-size: 1.3em;\n display: flex;\n align-items: end;\n"]))),e_=Z.ZP.div(p||(p=(0,$.Z)(["\n padding: 1rem 0;\n min-height: calc(100vh - ",");\n"])),"152px"),eF=Z.ZP.ul(m||(m=(0,$.Z)(["\n padding-left: 2rem;\n padding-right: 2rem;\n\n li a {\n display: inline-block !important;\n font-size: unset !important;\n padding: 0 !important;\n border-right: none !important;\n }\n"]))),ej=Z.ZP.div(g||(g=(0,$.Z)(["\n display: flex;\n justify-content: space-between;\n width: 100%;\n padding-left: 2rem;\n padding-right: 2rem;\n"]))),eR=Z.ZP.ul(y||(y=(0,$.Z)(["\n & a {\n font-size: 1rem !important;\n }\n\n & a.current {\n font-weight: bold;\n }\n\n & li.current {\n padding-bottom: 6px;\n border-bottom: none;\n background: linear-gradient(orange, orange) bottom /* left or right or else */ no-repeat;\n background-size: calc(100% - 2rem) 4px;\n }\n"]))),eI=Z.ZP.ul(b||(b=(0,$.Z)(["\n padding-right: 2rem;\n"]))),eT=Z.ZP.div(x||(x=(0,$.Z)(["\n padding-left: 2rem;\n padding-right: 2rem;\n"]))),eD=Z.ZP.li(S||(S=(0,$.Z)(["\n &:hover {\n opacity: 0.8;\n }\n"]))),eN=Z.ZP.div(w||(w=(0,$.Z)(["\n height: 100%;\n"]))),eM=[{path:"/",label:"Home",roles:["guest","user","sso-admin"]},{path:"/terms-conditions",label:"Terms and Conditions",roles:["guest"]},{path:"/my-dashboard",label:"My Dashboard",roles:["user","sso-admin"]},{path:"/admin-dashboard",label:"SSO Dashboard",roles:["sso-admin"]},{path:"/admin-reports",label:"SSO Reports",roles:["sso-admin"]},{path:"/request",label:"Request Details",roles:["user","sso-admin"],hide:!0},{path:"/faq",label:"FAQ",roles:["guest","user","sso-admin"]}],eL=function(e){var t,r=e.session,n=e.currentPath,i=e.query,a=["guest"];r&&(a=(null==r?void 0:null===(t=r.client_roles)||void 0===t?void 0:t.length)>0?r.client_roles:["user"]);var o=function(e){return n===e||n.startsWith("".concat(e,"/"))};return(0,et.jsx)(et.Fragment,{children:eM.filter(function(e){return e.roles.some(function(e){return a.includes(e)})&&(!e.hide||o(e.path))}).map(function(e){return(0,et.jsx)("li",{className:o(e.path)?"current":"",children:(0,et.jsx)(z(),{href:e.path,children:X()(e.label)?e.label(i):e.label})},e.path)})})},eB=function(){return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(ew,{children:function(e,t){return(0,et.jsx)(eD,{children:(0,et.jsx)("a",{href:"#".concat(e),title:"My Profile",children:(0,et.jsx)(V.G,{size:"2x",icon:K.U6l})})})}}),(0,et.jsx)(eD,{children:(0,et.jsx)("a",{href:"https://chat.developer.gov.bc.ca/channel/sso",target:"_blank",title:"Rocket Chat",children:(0,et.jsx)(V.G,{size:"2x",icon:K.Z6I})})}),(0,et.jsx)(eD,{children:(0,et.jsx)("a",{href:"mailto:bcgov.sso@gov.bc.ca",title:"Pathfinder SSO",children:(0,et.jsx)(V.G,{size:"2x",icon:K.FU$})})}),(0,et.jsx)(eD,{children:(0,et.jsx)("a",{href:(0,eO.eO)(),target:"_blank",title:"Documentation",children:(0,et.jsx)(V.G,{size:"2x",icon:K.cwv})})})]})},eH=function(e){var t=e.children,r=e.session,n=(e.user,e.onLoginClick),i=e.onLogoutClick,a=(0,R.useRouter)(),o=a.pathname,s=r?(0,et.jsxs)(ek,{children:[(0,et.jsxs)("div",{className:"welcome",children:["Welcome ","".concat(r.given_name," ").concat(r.family_name),"\xa0",(null==r?void 0:r.client_roles)&&(0,et.jsxs)("span",{className:"small",children:["(",Y()(null==r?void 0:r.client_roles[0]),")"]})]}),"\xa0\xa0",(0,et.jsx)(W.default,{variant:"secondary-inverse",size:"medium",onClick:i,children:"Log out"})]}):(0,et.jsx)(W.default,{variant:"secondary-inverse",size:"medium",onClick:n,children:"Log in"});return(0,et.jsxs)(ep.ZP,{children:[(0,et.jsx)(er,{}),(0,et.jsx)(eh,{title:function(){return(0,et.jsx)(eN,{children:"Common Hosted Single Sign-on (CSS)"})},rightSide:s,mobileMenu:function(){return(0,et.jsxs)(eF,{children:[(0,et.jsx)(eL,{session:r,currentPath:o,query:a.query}),(0,et.jsxs)("li",{children:["Need help?\xa0\xa0",(0,et.jsx)("a",{href:"https://chat.developer.gov.bc.ca/",target:"_blank",title:"Rocket Chat",children:(0,et.jsx)(V.G,{size:"2x",icon:K.Z6I})}),"\xa0\xa0",(0,et.jsx)("a",{href:"mailto:bcgov.sso@gov.bc.ca",title:"SSO Team",children:(0,et.jsx)(V.G,{size:"2x",icon:K.FU$})}),"\xa0\xa0",(0,et.jsx)("a",{href:(0,eO.eO)(),target:"_blank",title:"Wiki",children:(0,et.jsx)(V.G,{size:"2x",icon:K.cwv})})]}),(0,et.jsx)("li",{children:r?(0,et.jsx)(W.default,{variant:"secondary-inverse",size:"small",onClick:i,children:"Logout"}):(0,et.jsx)(W.default,{variant:"secondary-inverse",size:"small",onClick:n,children:"Login with IDIR"})})]})},onBannerClick:console.log,children:(0,et.jsxs)(ej,{children:[(0,et.jsx)(eR,{children:(0,et.jsx)(eL,{session:r,currentPath:o,query:a.query})}),(0,et.jsx)(eI,{children:(0,et.jsx)(eB,{})})]})}),(0,et.jsx)(e_,{children:(0,et.jsx)(ep.bD,{children:t})}),(0,et.jsx)(q.default,{children:(0,et.jsx)(eT,{children:(0,et.jsxs)("ul",{children:[(0,et.jsx)("li",{children:(0,et.jsx)(z(),{href:"/",children:"Home"})}),(0,et.jsx)("li",{children:(0,et.jsx)("a",{href:"https://www2.gov.bc.ca/gov/content/home/disclaimer",target:"_blank",rel:"noreferrer",children:"Disclaimer"})}),(0,et.jsx)("li",{children:(0,et.jsx)("a",{href:"https://www2.gov.bc.ca/gov/content/home/privacy",target:"_blank",rel:"noreferrer",children:"Privacy"})}),(0,et.jsx)("li",{children:(0,et.jsx)("a",{href:"https://www2.gov.bc.ca/gov/content/home/accessible-government",target:"_blank",rel:"noreferrer",children:"Accessibility"})}),(0,et.jsx)("li",{children:(0,et.jsx)("a",{href:"https://www2.gov.bc.ca/gov/content/home/copyright",target:"_blank",rel:"noreferrer",children:"Copyright"})})]})})}),(0,et.jsx)(eP,{})]})},e$=r(31637),eU=r(9008),ez=r.n(eU);r(87266),r(90458);var eV=Object.create,eK=Object.defineProperty,eW=Object.getOwnPropertyDescriptor,eq=Object.getOwnPropertyNames,eZ=Object.getPrototypeOf,eG=Object.prototype.hasOwnProperty,eY=(s=null!=(o=(i=(e,t)=>{var n,i;n=e,i=function(e){var t,r=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,n=2*536870912,i=new WeakMap,a=(t=function(e,t){return i.set(e,t),t},function(e){var a=i.get(e),o=void 0===a?e.size:ar)throw Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;e.has(o);)o=Math.floor(Math.random()*r);return t(e,o)});e.addUniqueNumber=function(e){var t=a(e);return e.add(t),t},e.generateUniqueNumber=a},"object"==typeof e&&"u">typeof t?i(e):"function"==typeof define&&r.amdO?define(["exports"],i):i((n="u">typeof globalThis?globalThis:n||self).fastUniqueNumbers={})},()=>(a||i((a={exports:{}}).exports,a),a.exports))())?eV(eZ(o)):{},((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of eq(t))eG.call(e,r)||void 0===r||eK(e,r,{get:()=>t[r],enumerable:!(n=eW(t,r))||n.enumerable});return e})(o&&o.__esModule?s:eK(s,"default",{value:o,enumerable:!0}),o)),eJ=e=>void 0!==e.method&&"call"===e.method,eX=e=>null===e.error&&"number"==typeof e.id,eQ=e=>{let t=new Map([[0,()=>{}]]),r=new Map([[0,()=>{}]]),n=new Map,i=new Worker(e);return i.addEventListener("message",({data:e})=>{if(eJ(e)){let{params:{timerId:i,timerType:a}}=e;if("interval"===a){let e=t.get(i);if("number"==typeof e){let t=n.get(e);if(void 0===t||t.timerId!==i||t.timerType!==a)throw Error("The timer is in an undefined state.")}else if("u">typeof e)e();else throw Error("The timer is in an undefined state.")}else if("timeout"===a){let e=r.get(i);if("number"==typeof e){let t=n.get(e);if(void 0===t||t.timerId!==i||t.timerType!==a)throw Error("The timer is in an undefined state.")}else if("u">typeof e)e(),r.delete(i);else throw Error("The timer is in an undefined state.")}}else if(eX(e)){let{id:i}=e,a=n.get(i);if(void 0===a)throw Error("The timer is in an undefined state.");let{timerId:o,timerType:s}=a;n.delete(i),"interval"===s?t.delete(o):r.delete(o)}else{let{error:{message:t}}=e;throw Error(t)}}),{clearInterval:e=>{let r=(0,eY.generateUniqueNumber)(n);n.set(r,{timerId:e,timerType:"interval"}),t.set(e,r),i.postMessage({id:r,method:"clear",params:{timerId:e,timerType:"interval"}})},clearTimeout:e=>{let t=(0,eY.generateUniqueNumber)(n);n.set(t,{timerId:e,timerType:"timeout"}),r.set(e,t),i.postMessage({id:t,method:"clear",params:{timerId:e,timerType:"timeout"}})},setInterval:(e,r)=>{let n=(0,eY.generateUniqueNumber)(t);return t.set(n,()=>{e(),"function"==typeof t.get(n)&&i.postMessage({id:null,method:"set",params:{delay:r,now:performance.now(),timerId:n,timerType:"interval"}})}),i.postMessage({id:null,method:"set",params:{delay:r,now:performance.now(),timerId:n,timerType:"interval"}}),n},setTimeout:(e,t)=>{let n=(0,eY.generateUniqueNumber)(r);return r.set(n,e),i.postMessage({id:null,method:"set",params:{delay:t,now:performance.now(),timerId:n,timerType:"timeout"}}),n}}};n=null,()=>{if(null!==n)return n;let e=new Blob(['(()=>{"use strict";const e=new Map,t=new Map,r=(e,t)=>{let r,o;const i=performance.now();r=i,o=e-Math.max(0,i-t);return{expected:r+o,remainingDelay:o}},o=(e,t,r,i)=>{const s=performance.now();s>r?postMessage({id:null,method:"call",params:{timerId:t,timerType:i}}):e.set(t,setTimeout(o,r-s,e,t,r,i))};addEventListener("message",(i=>{let{data:s}=i;try{if("clear"===s.method){const{id:r,params:{timerId:o,timerType:i}}=s;if("interval"===i)(t=>{const r=e.get(t);if(void 0===r)throw new Error(\'There is no interval scheduled with the given id "\'.concat(t,\'".\'));clearTimeout(r),e.delete(t)})(o),postMessage({error:null,id:r});else{if("timeout"!==i)throw new Error(\'The given type "\'.concat(i,\'" is not supported\'));(e=>{const r=t.get(e);if(void 0===r)throw new Error(\'There is no timeout scheduled with the given id "\'.concat(e,\'".\'));clearTimeout(r),t.delete(e)})(o),postMessage({error:null,id:r})}}else{if("set"!==s.method)throw new Error(\'The given method "\'.concat(s.method,\'" is not supported\'));{const{params:{delay:i,now:n,timerId:a,timerType:d}}=s;if("interval"===d)((t,i,s)=>{const{expected:n,remainingDelay:a}=r(t,s);e.set(i,setTimeout(o,a,e,i,n,"interval"))})(i,a,n);else{if("timeout"!==d)throw new Error(\'The given type "\'.concat(d,\'" is not supported\'));((e,i,s)=>{const{expected:n,remainingDelay:a}=r(e,s);t.set(i,setTimeout(o,a,t,i,n,"timeout"))})(i,a,n)}}}}catch(e){postMessage({error:{message:e.message},id:s.id,result:null})}}))})();'],{type:"application/javascript; charset=utf-8"}),t=URL.createObjectURL(e);return n=eQ(t),setTimeout(()=>URL.revokeObjectURL(t)),n};var e0=(typeof window>"u"?"undefined":typeof window)=="object",e1={setTimeout:e0?setTimeout.bind(window):setTimeout,clearTimeout:e0?clearTimeout.bind(window):clearTimeout,setInterval:e0?setInterval.bind(window):setInterval,clearInterval:e0?clearInterval.bind(window):clearInterval},e2={},e4=class{name;closed=!1;mc=new MessageChannel;constructor(e){this.name=e,e2[e]=e2[e]||[],e2[e].push(this),this.mc.port1.start(),this.mc.port2.start(),this.onStorage=this.onStorage.bind(this),window.addEventListener("storage",this.onStorage)}onStorage(e){if(e.storageArea!==window.localStorage||e.key.substring(0,this.name.length)!==this.name||null===e.newValue)return;let t=JSON.parse(e.newValue);this.mc.port2.postMessage(t)}postMessage(e){if(this.closed)throw Error("InvalidStateError");let t=JSON.stringify(e),r=`${this.name}:${String(Date.now())}${String(Math.random())}`;window.localStorage.setItem(r,t),e1.setTimeout(()=>{window.localStorage.removeItem(r)},500),e2[this.name].forEach(e=>{e!==this&&e.mc.port2.postMessage(JSON.parse(t))})}close(){if(this.closed)return;this.closed=!0,this.mc.port1.close(),this.mc.port2.close(),window.removeEventListener("storage",this.onStorage);let e=e2[this.name].indexOf(this);e2[this.name].splice(e,1)}get onmessage(){return this.mc.port1.onmessage}set onmessage(e){this.mc.port1.onmessage=e}get onmessageerror(){return this.mc.port1.onmessageerror}set onmessageerror(e){this.mc.port1.onmessageerror=e}addEventListener(e,t){return this.mc.port1.addEventListener(e,t)}removeEventListener(e,t){return this.mc.port1.removeEventListener(e,t)}dispatchEvent(e){return this.mc.port1.dispatchEvent(e)}},e3=typeof window>"u"?void 0:"function"==typeof window.BroadcastChannel?window.BroadcastChannel:e4;function e6(){return Math.random().toString(36).substring(2)}var e5=class{options;channel;token=e6();isLeader=!1;isDead=!1;isApplying=!1;reApply=!1;intervals=[];listeners=[];deferred;constructor(e,t){this.channel=e,this.options=t,this.apply=this.apply.bind(this),this.awaitLeadership=this.awaitLeadership.bind(this),this.sendAction=this.sendAction.bind(this)}async apply(){if(this.isLeader||this.isDead)return!1;if(this.isApplying)return this.reApply=!0,!1;this.isApplying=!0;let e=!1,t=t=>{let{token:r,action:n}=t.data;r!==this.token&&(0===n&&r>this.token&&(e=!0),1===n&&(e=!0))};this.channel.addEventListener("message",t);try{return this.sendAction(0),await function(e=0){return new Promise(t=>e1.setTimeout(t,e))}(this.options.responseTime),this.channel.removeEventListener("message",t),this.isApplying=!1,e?!!this.reApply&&this.apply():(this.assumeLead(),!0)}catch{return!1}}awaitLeadership(){if(this.isLeader)return Promise.resolve();let e=!1,t=null;return new Promise(r=>{let n=()=>{if(e)return;e=!0;try{e1.clearInterval(t)}catch{}let n=this.intervals.indexOf(t);n>=0&&this.intervals.splice(n,1),this.channel.removeEventListener("message",i),r()};t=e1.setInterval(()=>{this.apply().then(()=>{this.isLeader&&n()})},this.options.fallbackInterval),this.intervals.push(t);let i=e=>{let{action:t}=e.data;2===t&&this.apply().then(()=>{this.isLeader&&n()})};this.channel.addEventListener("message",i)})}sendAction(e){this.channel.postMessage({action:e,token:this.token})}assumeLead(){this.isLeader=!0;let e=e=>{let{action:t}=e.data;0===t&&this.sendAction(1)};return this.channel.addEventListener("message",e),this.listeners.push(e),this.sendAction(1)}waitForLeadership(){return this.deferred||(this.deferred=this.awaitLeadership()),this.deferred}close(){if(!this.isDead){this.isDead=!0,this.isLeader=!1,this.sendAction(2);try{this.listeners.forEach(e=>this.channel.removeEventListener("message",e)),this.intervals.forEach(e=>e1.clearInterval(e))}catch{}}}},e8=class{channel;options;elector;token=e6();registry=new Map;allIdle=!1;isLastActive=!1;constructor(e){let{channelName:t}=e;this.options=e,this.channel=new e3(t),this.registry.set(this.token,1),e.leaderElection&&(this.elector=new e5(this.channel,{fallbackInterval:2e3,responseTime:100}),this.elector.waitForLeadership()),this.channel.addEventListener("message",e=>{let{action:t,token:r,data:n}=e.data;switch(t){case 3:this.registry.set(r,2);break;case 4:this.registry.delete(r);break;case 5:this.idle(r);break;case 6:this.active(r);break;case 7:this.prompt(r);break;case 8:this.start(r);break;case 9:this.reset(r);break;case 10:this.activate(r);break;case 11:this.pause(r);break;case 12:this.resume(r);break;case 13:this.options.onMessage(n)}}),this.send(3)}get isLeader(){if(!this.elector)throw Error('❌ Leader election is not enabled. To Enable it set the "leaderElection" property to true.');return this.elector.isLeader}prompt(e=this.token){this.registry.set(e,0);let t=[...this.registry.values()].every(e=>0===e);e===this.token&&this.send(7),t&&this.options.onPrompt()}idle(e=this.token){this.registry.set(e,2);let t=[...this.registry.values()].every(e=>2===e);e===this.token&&this.send(5),!this.allIdle&&t&&(this.allIdle=!0,this.options.onIdle())}active(e=this.token){this.allIdle=!1,this.registry.set(e,1);let t=[...this.registry.values()].some(e=>1===e);e===this.token&&this.send(6),t&&this.options.onActive(),this.isLastActive=e===this.token}start(e=this.token){this.allIdle=!1,this.registry.set(e,1),e===this.token?this.send(8):this.options.start(!0),this.isLastActive=e===this.token}reset(e=this.token){this.allIdle=!1,this.registry.set(e,1),e===this.token?this.send(9):this.options.reset(!0),this.isLastActive=e===this.token}activate(e=this.token){this.allIdle=!1,this.registry.set(e,1),e===this.token?this.send(10):this.options.activate(!0),this.isLastActive=e===this.token}pause(e=this.token){e===this.token?this.send(11):this.options.pause(!0)}resume(e=this.token){e===this.token?this.send(12):this.options.resume(!0)}message(e){try{this.channel.postMessage({action:13,token:this.token,data:e})}catch{}}send(e){try{this.channel.postMessage({action:e,token:this.token})}catch{}}close(){this.options.leaderElection&&this.elector.close(),this.send(4),this.channel.close()}},e9=e0?document:null,e7=["mousemove","keydown","wheel","DOMMouseScroll","mousewheel","mousedown","touchstart","touchmove","MSPointerDown","MSPointerMove","visibilitychange","focus"];function te(e,t){let r=0;return function(...n){let i=new Date().getTime();if(!(i-rDate.now();(0,j.createContext)(null).Consumer;var tr=r(30233),tn=r(31513),ti=r(63055),ta=r(30996);function to(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function ts(e){for(var t=1;t0){e.next=3;break}return e.abrupt("return",m("Please select a rating."));case 3:o&&(0,B.xc)({triggerEvent:o,message:f,rating:u.filter(function(e){return e.selected}).length}),n(!1),r(!1);case 6:case"end":return e.stop()}},e)})),function(){return t.apply(this,arguments)}),b="".concat(i?"open":"closed"," ").concat(!a&&"hidden");return(0,et.jsx)(tc,{children:(0,et.jsxs)(tl,{className:b,children:[(0,et.jsxs)("div",{className:"header",onClick:function(){r(!i)},children:[(0,et.jsx)("p",{children:"We'd love to hear from you"}),(0,et.jsx)(V.G,{icon:i?K.Qbq:K.K96})]}),(0,et.jsxs)("div",{className:"body",children:[(0,et.jsx)("p",{className:"title",children:(0,et.jsx)("strong",{children:"Rate our service"})}),(0,et.jsx)("p",{children:"How was your experience with the CSS app?"}),(0,et.jsxs)(tf,{children:[(0,et.jsx)("div",{className:"stars-box",children:u.map(function(e,t){return(0,et.jsx)(V.G,{style:{cursor:"pointer"},role:"button",size:"3x",icon:K.Tab,color:e.selected?"gold":"grey",onClick:function(){return g(t)}},e.id)})}),(0,et.jsxs)("div",{className:"stars-text",children:[(0,et.jsx)("span",{children:"Bad"}),(0,et.jsx)("span",{children:"Great"})]})]}),(0,et.jsx)(ta.default,{fullWidth:!0,placeholder:"Leave a message...",rows:4,value:f,onChange:function(e){m(""),e.target.value.length<=700?d(e.target.value):m("Messages are at most ".concat(700," characters."))}}),p&&(0,et.jsx)("p",{className:"error-message",children:p}),(0,et.jsxs)("div",{className:"button-container",children:[(0,et.jsx)(W.default,{variant:"secondary",onClick:function(){return n(!1)},children:"Close"}),(0,et.jsx)(W.default,{onClick:y,children:"Rate now"})]})]})]})})};function tp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function tm(e){for(var t=1;t{},onPrompt:u=()=>{},onIdle:c=()=>{},onActive:l=()=>{},onAction:f=()=>{},onMessage:d=()=>{},debounce:h=0,throttle:p=0,eventsThrottle:m=200,startOnMount:g=!0,startManually:y=!1,stopOnIdle:b=!1,crossTab:x=!1,name:S="idle-timer",syncTimers:w=0,leaderElection:E=!1,disabled:A=!1}={}){let C=(0,j.useRef)(tt()),P=(0,j.useRef)(tt()),O=(0,j.useRef)(null),k=(0,j.useRef)(null),_=(0,j.useRef)(0),F=(0,j.useRef)(0),R=(0,j.useRef)(0),I=(0,j.useRef)(0),T=(0,j.useRef)(!1),D=(0,j.useRef)(!1),N=(0,j.useRef)(!1),M=(0,j.useRef)(!0),L=(0,j.useRef)(!1),B=(0,j.useRef)(null),H=(0,j.useRef)(null),$=(0,j.useRef)(e),U=(0,j.useRef)(0);(0,j.useEffect)(()=>{if(t&&console.warn("⚠️ IdleTimer -- The `promptTimeout` property has been deprecated in favor of `promptBeforeIdle`. It will be removed in the next major release."),r&&t)throw Error("❌ Both promptTimeout and promptBeforeIdle can not be set. The promptTimeout property will be deprecated in a future version.");if(e>=2147483647)throw Error(`\u274C The value for the timeout property must fit in a 32 bit signed integer, 2147483647.`);if(t>=2147483647)throw Error(`\u274C The value for the promptTimeout property must fit in a 32 bit signed integer, 2147483647.`);if(r>=2147483647)throw Error(`\u274C The value for the promptBeforeIdle property must fit in a 32 bit signed integer, 2147483647.`);if(r>=e)throw Error(`\u274C The value for the promptBeforeIdle property must be less than the timeout property, ${e}.`);if(r?($.current=e-r,U.current=r):($.current=e,U.current=t),!M.current){if(y||A)return;T.current&&(J.current(null,eR),H.current&&H.current.active()),ed()}},[e,t,r,y,A]);let z=(0,j.useRef)(b);(0,j.useEffect)(()=>{z.current=b},[b]);let V=(0,j.useRef)(o),K=(0,j.useRef)(n),W=(0,j.useRef)([...new Set([...i,...o]).values()]),q=(0,j.useRef)(A);(0,j.useEffect)(()=>{q.current=A,!M.current&&(A?em():y||ed())},[A]);let Z=(0,j.useRef)(s);(0,j.useEffect)(()=>{Z.current=s},[s]);let G=(0,j.useRef)(u);(0,j.useEffect)(()=>{G.current=u},[u]);let Y=(0,j.useRef)(c);(0,j.useEffect)(()=>{Y.current=c},[c]);let J=(0,j.useRef)(l);(0,j.useEffect)(()=>{J.current=l},[l]);let X=(0,j.useRef)(f);(0,j.useEffect)(()=>{X.current=f},[f]);let Q=(0,j.useRef)(d);(0,j.useEffect)(()=>{Q.current=d},[d]);let ee=(0,j.useMemo)(()=>{let e=(e,t)=>X.current(e,t);return h>0?function(e,t){let r;function n(...i){r&&clearTimeout(r),r=setTimeout(()=>{e(...i),r=null},t)}return n.cancel=function(){clearTimeout(r)},n}(e,h):p>0?te(e,p):e},[p,h]),et=(0,j.useRef)();(0,j.useEffect)(()=>{x&&w&&(et.current=te(()=>{H.current.active()},w))},[x,w]);let er=()=>{null!==B.current&&(e1.clearTimeout(B.current),B.current=null)},en=(e,t=!0)=>{er(),B.current=e1.setTimeout(es,e||$.current),t&&(k.current=tt())},ei=e=>{D.current||T.current||(G.current(e,eR),Z.current({type:"active",prompted:!0},eR)),I.current=0,R.current=tt(),D.current=!0,en(U.current,!1)},ea=()=>{er(),T.current||(Y.current(null,eR),Z.current({type:"idle"},eR)),T.current=!0,O.current=tt(),z.current?ef():D.current&&(R.current=0,D.current=!1)},eo=e=>{er(),(T.current||D.current)&&(J.current(e,eR),Z.current({type:"active",prompted:!1},eR)),D.current=!1,R.current=0,T.current=!1,_.current+=tt()-O.current,F.current+=tt()-O.current,el(),en()},es=e=>{if(!T.current){ee.cancel&&ee.cancel();let t=tt()-k.current;if(!($.current+U.current0&&!D.current){H.current?H.current.prompt():ei(e);return}H.current?H.current.idle():ea();return}H.current?H.current.active():eo(e)},eu=e=>{if(g||k.current||(k.current=tt(),J.current(null,eR)),ee(e,eR),D.current)return;if(er(),!T.current&&V.current.includes(e.type)){es(e);return}let t=tt()-k.current;if(T.current&&!b||!T.current&&t>=$.current){es(e);return}N.current=!1,I.current=0,R.current=0,en(),x&&w&&et.current()},ec=(0,j.useRef)(eu);(0,j.useEffect)(()=>{let e=L.current;e&&ef(),m>0?ec.current=te(eu,m):ec.current=eu,e&&el()},[m,p,h,X,x,w]);let el=()=>{e0&&K.current&&(L.current||(W.current.forEach(e=>{K.current.addEventListener(e,ec.current,{capture:!0,passive:!0})}),L.current=!0))},ef=(e=!1)=>{e0&&K.current&&(L.current||e)&&(W.current.forEach(e=>{K.current.removeEventListener(e,ec.current,{capture:!0})}),L.current=!1)},ed=(0,j.useCallback)(e=>!q.current&&(er(),el(),T.current=!1,D.current=!1,N.current=!1,I.current=0,R.current=0,H.current&&!e&&H.current.start(),en(),!0),[B,T,q,$,H]),eh=(0,j.useCallback)(e=>!q.current&&(er(),el(),P.current=tt(),_.current+=tt()-O.current,F.current+=tt()-O.current,_.current=0,T.current=!1,D.current=!1,N.current=!1,I.current=0,R.current=0,H.current&&!e&&H.current.reset(),y||en(),!0),[B,T,$,y,q,H]),ep=(0,j.useCallback)(e=>!q.current&&(er(),el(),(T.current||D.current)&&eo(),T.current=!1,D.current=!1,N.current=!1,I.current=0,R.current=0,P.current=tt(),H.current&&!e&&H.current.activate(),en(),!0),[B,T,D,q,$,H]),em=(0,j.useCallback)((e=!1)=>!q.current&&!N.current&&(I.current=eE(),N.current=!0,ef(),er(),H.current&&!e&&H.current.pause(),!0),[B,q,H]),ev=(0,j.useCallback)((e=!1)=>!q.current&&!!N.current&&(N.current=!1,D.current||el(),T.current||en(I.current),R.current&&(R.current=tt()),H.current&&!e&&H.current.resume(),!0),[B,$,q,I,H]),eg=(0,j.useCallback)((e,t)=>(H.current?(t&&Q.current(e,eR),H.current.message(e)):t&&Q.current(e,eR),!0),[d]),ey=(0,j.useCallback)(()=>T.current,[T]),eb=(0,j.useCallback)(()=>D.current,[D]),ex=(0,j.useCallback)(()=>H.current?H.current.isLeader:null,[H]),eS=(0,j.useCallback)(()=>H.current?H.current.isLastActive:null,[H]),ew=(0,j.useCallback)(()=>H.current?H.current.token:null,[H]),eE=(0,j.useCallback)(()=>{if(N.current)return I.current;let e=Math.floor((I.current?I.current:U.current+$.current)-(k.current?tt()-k.current:0));return e<0?0:Math.abs(e)},[$,U,D,I,k]),eA=(0,j.useCallback)(()=>Math.round(tt()-P.current),[P]),eC=(0,j.useCallback)(()=>Math.round(tt()-C.current),[C]),eP=(0,j.useCallback)(()=>O.current?new Date(O.current):null,[O]),eO=(0,j.useCallback)(()=>k.current?new Date(k.current):null,[k]),ek=(0,j.useCallback)(()=>T.current?Math.round(tt()-O.current+_.current):Math.round(_.current),[O,_]),e_=(0,j.useCallback)(()=>T.current?Math.round(tt()-O.current+F.current):Math.round(F.current),[O,F]),eF=(0,j.useCallback)(()=>{let e=Math.round(eA()-ek());return e>=0?e:0},[O,_]),ej=(0,j.useCallback)(()=>{let e=Math.round(eC()-e_());return e>=0?e:0},[O,_]);(0,j.useEffect)(()=>{if(h>0&&p>0)throw Error("❌ onAction can either be throttled or debounced, not both.");a&&(e1.setTimeout=a.setTimeout,e1.clearTimeout=a.clearTimeout,e1.setInterval=a.setInterval,e1.clearInterval=a.clearInterval);let e=()=>{H.current&&H.current.close(),ee.cancel&&ee.cancel(),er(),ef(!0)};return e0&&window.addEventListener("beforeunload",e),()=>{e0&&window.removeEventListener("beforeunload",e),H.current&&H.current.close(),ee.cancel&&ee.cancel(),er(),ef(!0)}},[]),(0,j.useEffect)(()=>{H.current&&H.current.close(),x?H.current=new e8({channelName:S,leaderElection:E,onPrompt:()=>{ei()},onIdle:()=>{ea()},onActive:()=>{eo()},onMessage:e=>{Q.current(e,eR)},start:ed,reset:eh,activate:ep,pause:em,resume:ev}):H.current=null},[x,S,E,G,Y,J,Q,ed,eh,em,ev]),(0,j.useEffect)(()=>{M.current||(er(),ef(!0)),y||A||(g?ed():el())},[y,g,A,M]),(0,j.useEffect)(()=>{if(!M.current){let e=[...new Set([...i,...o]).values()];ef(),W.current=e,K.current=n,V.current=o,y||A||(g?ed():el())}},[n,JSON.stringify(i),JSON.stringify(o),M,A,y,g]),(0,j.useEffect)(()=>{M.current&&(M.current=!1)},[M]);let eR={message:eg,start:ed,reset:eh,activate:ep,pause:em,resume:ev,isIdle:ey,isPrompted:eb,isLeader:ex,isLastActiveTab:eS,getTabId:ew,getRemainingTime:eE,getElapsedTime:eA,getTotalElapsedTime:eC,getLastIdleTime:eP,getLastActiveTime:eO,getIdleTime:ek,getTotalIdleTime:e_,getActiveTime:eF,getTotalActiveTime:ej,setOnPresenceChange:e=>{s=e,Z.current=e},setOnPrompt:e=>{u=e,G.current=e},setOnIdle:e=>{c=e,Y.current=e},setOnActive:e=>{l=e,J.current=e},setOnAction:e=>{f=e,X.current=e},setOnMessage:e=>{d=e,Q.current=e}}}({onPrompt:function(){"expired"!==S&&o.current.open()},timeout:3e5,promptBeforeIdle:1e4,throttle:500,disabled:null===l}),(0,j.useEffect)(function(){function e(e,r){return t.apply(this,arguments)}function t(){return(t=(0,k.Z)(F().mark(function e(t,r){var n,i,a,o;return F().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,M.W)(t.id_token);case 2:if(n=e.sent,a=(i=(0,P.Z)(n,2))[0],o=i[1],!a){e.next=14;break}if(!r){e.next=11;break}return(0,H.d0)(t),e.next=11,u.push("/my-dashboard");case 11:f(tw(a)),e.next=17;break;case 14:(0,H.Zz)(),f(tw(null)),r&&u.push({pathname:"/application-error",query:{error:o}});case 17:y(!1);case 18:case"end":return e.stop()}},e)}))).apply(this,arguments)}function r(){return(r=(0,k.Z)(F().mark(function t(){var r,n,i,a,o;return F().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return y(!0),t.prev=1,t.next=4,(0,D.M)();case 4:if(n=(r=(0,N.rg)()).code,i=r.state,!n){t.next=13;break}return t.next=8,(0,N.hP)({code:n,state:i});case 8:return a=t.sent,t.next=11,e(a,!0);case 11:t.next=16;break;case 13:return o=(0,H.lz)(),t.next=16,e(o,!1);case 16:t.next=25;break;case 18:t.prev=18,t.t0=t.catch(1),console.log(t.t0),(0,H.Zz)(),f(tw(null)),y(!1),b(t.t0);case 25:case"end":return t.stop()}},t,null,[[1,18]])}))).apply(this,arguments)}console.log("app started..."),tx&&"true"===tx&&u.push({pathname:"/application-error",query:{error:"maintenance"}}),(0,L.Nu)(),function(){r.apply(this,arguments)}()},[]),(0,j.useEffect)(function(){var e,t=(e=(0,k.Z)(F().mark(function e(){var t,r,n;return F().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,B.Ai)();case 2:t=e.sent,n=(r=(0,P.Z)(t,2))[0],r[1],p(n);case 7:case"end":return e.stop()}},e)})),function(){return e.apply(this,arguments)});l&&t()},[l]),(0,j.useEffect)(function(){if(l){var e=setInterval((0,k.Z)(F().mark(function e(){var t;return F().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=(0,tn.QE)((0,H.lz)().refresh_token),Date.now()>=(null==t?void 0:t.exp)*1e3?(w("expired"),o.current.close(),s.current.open()):w("");case 2:case"end":return e.stop()}},e)})),5e3);return function(){clearInterval(e)}}});var W=(r=(0,k.Z)(F().mark(function e(){var t;return F().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,N.iq)({kc_idp_hint:tb});case 2:t=e.sent,window.location.href=t;case 4:case"end":return e.stop()}},e)})),function(){return r.apply(this,arguments)}),q=(n=(0,k.Z)(F().mark(function e(){return F().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:(0,H.Zz)(),window.location.href=(0,N.kG)();case 2:case"end":return e.stop()}},e)})),function(){return n.apply(this,arguments)}),Z=(0,j.useMemo)(function(){return{setShowSurvey:V}},[h]);return g?(0,et.jsx)(e$.Z,{}):tS.some(function(e){return window.location.pathname.startsWith(e)})&&!l?(u.push("/"),null):(0,et.jsx)(tA.Provider,{value:{session:l,user:h},children:(0,et.jsx)(tC.Provider,{value:Z,children:tx&&"true"===tx?(0,et.jsx)(i,tm({},a)):(0,et.jsxs)(et.Fragment,{children:[(0,et.jsxs)(eH,{session:l,user:h,onLoginClick:W,onLogoutClick:q,children:[(0,et.jsxs)(ez(),{children:[(0,et.jsx)("html",{lang:"en"}),(0,et.jsx)("title",{children:"Common Hosted Single Sign-on (CSS)"}),(0,et.jsx)("link",{rel:"icon",href:"/bootstrap-theme/dist/images/bcid-favicon-32x32.png"})]}),(0,et.jsx)(i,tm(tm({},a),{},{session:l,onLoginClick:W,onLogoutClick:q}))]}),(0,et.jsx)(tr.Z,{ref:o,style:{maxHeight:"calc(100vh - 200px)",overflowY:"auto"},title:"Session expiring",icon:K.eHv,onConfirm:(0,k.Z)(F().mark(function e(){return F().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,B.Ai)();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e)})),onCancel:function(){q()},confirmButtonText:"Confirm",confirmButtonVariant:"primary",cancelButtonVariant:"secondary",showConfirmButton:!0,showCancelButton:!0,children:(0,et.jsxs)("div",{children:[(0,et.jsx)("div",{children:"Your session will expire soon and you will be signed out automatically."}),(0,et.jsx)("br",{}),(0,et.jsx)("div",{children:"Do you want to stay signed in?"})," "]})}),(0,et.jsx)(tr.Z,{ref:s,style:{maxHeight:"calc(100vh - 200px)",overflowY:"auto"},title:"Session expired",icon:K.eHv,onConfirm:function(){return W()},onCancel:(0,k.Z)(F().mark(function e(){return F().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,B.Ai)();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e)})),confirmButtonText:"Login",confirmButtonVariant:"primary",cancelButtonVariant:"secondary",showConfirmButton:!0,showCancelButton:!0,children:(0,et.jsxs)("div",{children:[(0,et.jsx)("div",{children:"Your session has expired."}),(0,et.jsx)("br",{}),(0,et.jsx)("div",{children:"Please login again."})," "]})}),h&&(0,et.jsx)(th,{setOpenSurvey:z,open:U,display:I,setDisplaySurvey:T,triggerEvent:A})]})})})}},64730:function(e,t,r){"use strict";r.d(t,{Ek:function(){return y},Nu:function(){return b}});var n,i,a,o=r(16835),s=r(50029),u=r(87794),c=r.n(u),l=r(21963),f=r(54494),d=r(88757),h=r(84595),p=r(11752),m=(r.n(p)()()||{}).publicRuntimeConfig,g=(void 0===m?{}:m).base_path,y=(n=(0,s.Z)(c().mark(function e(){var t;return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,w();case 2:return t=(0,f.lz)(),e.abrupt("return","Bearer ".concat(t.id_token));case 4:case"end":return e.stop()}},e)})),function(){return n.apply(this,arguments)});function b(){return x.apply(this,arguments)}function x(){return(x=(0,s.Z)(c().mark(function e(){return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.abrupt("return",l.e.get("heartbeat",{headers:{skipAuth:!0}}).then(function(e){return e.data}));case 4:return e.prev=4,e.t0=e.catch(0),console.error(e.t0),e.abrupt("return",null);case 8:case"end":return e.stop()}},e,null,[[0,4]])}))).apply(this,arguments)}var S=(i=(0,s.Z)(c().mark(function e(t){var r,n;return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,d.dx)({refreshToken:t.refresh_token});case 2:return r=e.sent,e.next=5,(0,h.W)(null==r?void 0:r.id_token);case 5:n=e.sent,(0,o.Z)(n,1)[0]?(0,f.d0)(r):((0,f.Zz)(),console.error("failed to refresh the token"),window.location.href="".concat(g));case 9:case"end":return e.stop()}},e)})),function(e){return i.apply(this,arguments)}),w=(a=(0,s.Z)(c().mark(function e(){var t,r,n;return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=(0,f.lz)(),e.next=3,(0,h.W)(t.id_token);case 3:r=e.sent,(n=(0,o.Z)(r,1)[0])?1e3*n.exp-Date.now()<12e4&&S(t):S(t);case 7:case"end":return e.stop()}},e)})),function(){return a.apply(this,arguments)})},21963:function(e,t,r){"use strict";r.d(t,{e:function(){return x},z:function(){return S}});var n,i=r(59499),a=r(50029),o=r(87794),s=r.n(o),u=r(11752),c=r.n(u),l=r(9669),f=r.n(l),d=r(64730),h=r(11163),p=r.n(h);function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function g(e){for(var t=1;t0?i:null,a=a.length>0?a:null;var o=t.map(function(e){return e.value});return[a,i,o=o.length>0?o:null]},g=function(e){var t=e.bceidApproved,r=e.githubApproved,n=e.digitalCredentialApproved,i=e.environments,a=void 0===i?[]:i,o=e.serviceType,s=(0,f.Jx)(e),u=(0,f.dV)(e),l=(0,f.S3)(e),d=c.TJ.map(function(t){var r=e.devIdps;return p(p({},t),{},{idps:r||[]})});if("gold"===o){var h=j(e),m=R(e),g=I(e),y=d.filter(function(e){return a.includes(e.name)});return s&&(!t||h)&&(y=y.map(function(e){return"prod"===e.name&&(e.idps=e.idps.filter(f.JK)),e})),u&&(!r||m)&&(y=y.map(function(e){return"prod"===e.name&&(e.idps=e.idps.filter(f.Qf)),e})),l&&(!n||g)&&(y=y.map(function(e){return"prod"===e.name&&(e.idps=e.idps.filter(f.DK)),e})),y}var b=a.concat()||[];return s&&!t&&(b=b.filter(function(e){return"prod"!==e})),d.filter(function(e){return b.includes(e.name)})},y=function(e){return e?JSON.parse(decodeURIComponent(Array.from(atob(e.replace(/-/g,"+").replace(/_/g,"/"))).reduce(function(e,t){var r=("00"+t.charCodeAt(0).toString(16)).slice(-2);return"".concat(e,"%").concat(r)},""))):null},b=function(e){if(!e)return null;var t=e.split(".");return y((0,a.Z)(t,2)[1])},x=function(e){if(!e)return null;var t=e.split(".");return y((0,a.Z)(t,1)[0])},S=function(){var e=new Uint32Array(28);crypto.getRandomValues(e);var t=[];return e.forEach(function(e){return t.push("0".concat(e.toString(16).substr(-2)))}),t.reduce(function(e,t){return"".concat(e).concat(t)},"")},w=(n=(0,i.Z)(u().mark(function e(t){var r;return u().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=new TextEncoder().encode(t),e.abrupt("return",crypto.subtle.digest("SHA-256",r));case 4:case"end":return e.stop()}},e)})),function(e){return n.apply(this,arguments)}),E=function(e){return btoa(new Uint8Array(e).reduce(function(e,t){return"".concat(e).concat(String.fromCharCode(t))},"")).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},A=function(e){var t;return e.devValidRedirectUris&&0!==e.devValidRedirectUris.length||(e.devValidRedirectUris=[""]),e.testValidRedirectUris&&0!==e.testValidRedirectUris.length||(e.testValidRedirectUris=[""]),e.prodValidRedirectUris&&0!==e.prodValidRedirectUris.length||(e.prodValidRedirectUris=[""]),e.teamId?e.teamId=String(e.teamId):e.usesTeam=!1,Object.entries(t=e).forEach(function(e){var r=(0,a.Z)(e,2),n=r[0];null===r[1]&&delete t[n]}),t},C=function(e){return e.map(function(e){if(Object.keys(c.Qj).map(function(e){return".".concat(e)}).includes(e.property)){var t=e.property.slice(1);e.message=c.Qj[t]||e.message}else(e.property.includes("ValidRedirectUris")||e.property.includes("SamlLogoutPostBindingUri"))&&("should be string"===e.message?e.message="":e.message=c.Qj.redirectUris);return e})},P=function(e){if(!e||0===e.length)return(0,d.jsx)("div",{children:"No changes"});var t=e.map(function(e){var t=e.kind,r=e.lhs,n=e.rhs,i=e.path,a=e.item,o=i[0];switch(t){case"E":return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("strong",{children:["Edited ",o,": "]}),"Changed ",(0,d.jsx)("code",{children:String(r)})," to ",(0,d.jsx)("code",{children:String(n)})]});case"A":if((null==a?void 0:a.kind)==="D")return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("strong",{children:["Changed Array ",o,": "]}),"Deleted ",(0,d.jsxs)("code",{children:[" ",null==a?void 0:a.lhs]})]});if((null==a?void 0:a.kind)==="N")return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("strong",{children:["Changed Array ",o,": "]}),"Added ",(0,d.jsx)("code",{children:null==a?void 0:a.rhs})]});return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("strong",{children:["Changed Array ",o,": "]}),"Edited"," ",(0,d.jsxs)("code",{children:[null==a?void 0:a.lhs," to ",null==a?void 0:a.rhs]})]});case"N":return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("strong",{children:["Added ",o,": "]}),(0,d.jsx)("code",{children:a})]});case"D":return(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)("strong",{children:["Deleted ",o," "]})});default:return(0,d.jsx)("code",{children:JSON.stringify(e,null,2)})}});return(0,d.jsx)("ul",{children:t.map(function(e,t){return(0,d.jsx)("li",{children:e},t)})})},O=function(e){return e.some(function(e){return["submitted","pr","prFailed","planned","planFailed","approved","applyFailed"].includes(e.status||"")})};function k(e,t){if(1===e.length)return!1;var r=e.find(function(e){return e.id===t});return 1!==e.filter(function(e){return"admin"===e.role}).length||(null==r?void 0:r.role)!=="admin"}var _=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},F=function(e,t){return"Submitted"===(0,l.n)(e.status||"draft")&&!!e.lastChanges&&0!==e.lastChanges.length&&e.lastChanges.some(function(e){return e.path[0]===t&&!1===e.lhs&&!0===e.rhs})},j=function(e){return F(e,"bceidApproved")},R=function(e){return F(e,"githubApproved")},I=function(e){return F(e,"digitalCredentialApproved")},T=function(e){var t=new Date;return t.setDate(t.getDate()-e),t}},84595:function(e,t,r){"use strict";r.d(t,{W:function(){return p}});var n,i=r(50029),a=r(87794),o=r.n(a),s=r(31166),u=r(11752),c=r.n(u),l=r(16689),f=r(31513),d=(c()()||{}).publicRuntimeConfig,h=(void 0===d?{}:d).sso_client_id,p=(n=(0,i.Z)(o().mark(function e(t){var r,n,i,a,u;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return",[,"e02"]);case 2:if(r=l.$.keys,n=(0,f.ob)(t),void 0!==(i=null==r?void 0:r.find(function(e){return e.kid===n.kid}))){e.next=8;break}return console.error("public key not found in JWK jwks.json"),e.abrupt("return",[,"e02"]);case 8:if(a=(0,f.QE)(t),!(Date.now()>=1e3*a.exp)){e.next=12;break}return console.log("token has expired"),e.abrupt("return",[,"e02"]);case 12:if(u=s.KZ.getKey(i),s.fs.jws.JWS.verifyJWT(t,u,{alg:["RS256"],gracePeriod:28800})){e.next=17;break}return console.error("signature verification failed"),e.abrupt("return",[,"e02"]);case 17:if(!(0!==a.aud.localeCompare(h))){e.next=21;break}return console.error("token was not issued for this audience"),e.abrupt("return",[,"e02"]);case 21:if(["idir","azureidir"].includes(a.identity_provider)){e.next=24;break}return console.error("invalid identity provider ".concat(a.identity_provider)),e.abrupt("return",[,"e03"]);case 24:if(!(!a.idir_user_guid||!a.email)){e.next=27;break}return console.error("invalid user account"),e.abrupt("return",[,"e03"]);case 27:return e.abrupt("return",[a]);case 28:case"end":return e.stop()}},e)})),function(e){return n.apply(this,arguments)})},88757:function(e,t,r){"use strict";r.d(t,{dx:function(){return j},hP:function(){return _},iq:function(){return k},kG:function(){return F},rg:function(){return R}});var n,i,a,o=r(59499),s=r(50029),u=r(87794),c=r.n(u),l=r(9669),f=r.n(l),d=r(80129),h=r.n(d),p=r(11752),m=r.n(p),g=r(16689),y=r(31513);function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}var x=(m()()||{}).publicRuntimeConfig,S=void 0===x?{}:x,w=S.sso_client_id,E=S.sso_authorization_scope,A=S.sso_authorization_response_mode,C=S.sso_authorization_response_type,P=S.sso_redirect_uri,O=S.sso_token_grant_type,k=(n=(0,s.Z)(c().mark(function e(t){var r,n,i,a,s,u;return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=(0,y.zO)(),n=(0,y.zO)(),sessionStorage.setItem("oauth_state",r),sessionStorage.setItem("oidc_nonce",n),i=(0,y.zO)(),sessionStorage.setItem("code_verifier",i),e.next=8,(0,y.qu)(i);case 8:return a=e.sent,s=(0,y.z9)(a),sessionStorage.setItem("code_challenge",s),u=function(e){for(var t=1;tf&&t[r].addError("Must be ".concat(f/60," minutes or fewer."))}},Z=function(e,r){return function(){e>d&&t[r].addError("Must be ".concat(d/60," minutes or fewer."))}},G={projectName:function(){/^\d/.test(i)&&t.projectName.addError("Please have your project name start with a letter")},authType:function(){"browser-login"!==K&&W&&t.authType.addError("Ensure your access is confidential when using a service account.")},devSessionIdleTimeout:q(B,"devSessionIdleTimeout"),testSessionIdleTimeout:q(H,"testSessionIdleTimeout"),prodSessionIdleTimeout:q($,"prodSessionIdleTimeout"),devSessionMaxLifespan:Z(U,"devSessionMaxLifespan"),testSessionMaxLifespan:Z(z,"testSessionMaxLifespan"),prodSessionMaxLifespan:Z(V,"prodSessionMaxLifespan"),devValidRedirectUris:function(){h.every(u)||p(h,t,"devValidRedirectUris",u)},testValidRedirectUris:function(){S.includes("test")&&!g.every(u)&&p(g,t,"testValidRedirectUris",u)},prodValidRedirectUris:function(){S.includes("prod")&&!b.every(c)&&p(b,t,"prodValidRedirectUris",c)},createTeam:function(){if(w&&(!E||""==E)){var e;null===(e=t.createTeam)||void 0===e||e.addError("Please select or create a team")}},additionalRoleAttribute:function(){a.hL.includes(C.trim())&&t.additionalRoleAttribute.addError("Please use a different name as existing claim '".concat(C.trim(),"' cannot be overwritten"))},devSamlLogoutPostBindingUri:function(){""===O||null===O||u(O)||t.devSamlLogoutPostBindingUri.addError(l)},testSamlLogoutPostBindingUri:function(){""===_||null===_||u(_)||t.testSamlLogoutPostBindingUri.addError(l)},prodSamlLogoutPostBindingUri:function(){""===j||null===j||c(j)||t.prodSamlLogoutPostBindingUri.addError(l)},clientId:function(){""!==I&&null!==I&&(I!==I.trim()||I.match(/\s/))&&t.clientId.addError("Client id is not valid")},devIdps:function(){"saml"===M&&D.length>1&&t.devIdps.addError("Only one identity provider is allowed for saml integrations"),"saml"===M&&(0,o.S3)(e)&&t.devIdps.addError("Digital Credential is not allowed for saml integrations")},projectLead:function(){!1===w&&!1===L&&t.projectLead.addError("")}};r||(r=Object.keys(G));for(var Y=0;Y0,u=i()(e,t,s?(o=t.customValidation,function(e,t){return h(e,t,o)}):void 0).errors;u.length>0&&(n[a]=u)}}),n}},96086:function(e){"use strict";var t=Object.assign.bind(Object);e.exports=t,e.exports.default=e.exports},6840:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return r(24444)}])},21876:function(e){!function(){var t={675:function(e,t){"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return(r+n)*3/4-n},t.toByteArray=function(e){var t,r,a=u(e),o=a[0],s=a[1],c=new i((o+s)*3/4-s),l=0,f=s>0?o-4:o;for(r=0;r>16&255,c[l++]=t>>8&255,c[l++]=255&t;return 2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t),1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=0,s=n-i;o>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}(e,o,o+16383>s?s:o+16383));return 1===i?a.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===i&&a.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),a.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,s=a.length;o0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},72:function(e,t,r){"use strict";/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh diff --git a/admin-dashboard.html b/admin-dashboard.html index b5472a6..89a5943 100644 --- a/admin-dashboard.html +++ b/admin-dashboard.html @@ -1,4 +1,4 @@ -

Loading information...

\ No newline at end of file +

Loading information...

\ No newline at end of file diff --git a/admin-reports.html b/admin-reports.html index 043e7b7..0f6ee50 100644 --- a/admin-reports.html +++ b/admin-reports.html @@ -1,4 +1,4 @@ -

Loading information...

\ No newline at end of file +

Loading information...

\ No newline at end of file diff --git a/application-error.html b/application-error.html index 8f58e03..1dc145b 100644 --- a/application-error.html +++ b/application-error.html @@ -1,4 +1,4 @@ -

Loading information...

\ No newline at end of file +

Loading information...

\ No newline at end of file diff --git a/faq.html b/faq.html index dc64e5b..b9afb9a 100644 --- a/faq.html +++ b/faq.html @@ -1,4 +1,4 @@ -

Loading information...

\ No newline at end of file +

Loading information...

\ No newline at end of file diff --git a/index.html b/index.html index 914a4d4..1894e2a 100644 --- a/index.html +++ b/index.html @@ -1,4 +1,4 @@ -

Loading information...

\ No newline at end of file +

Loading information...

\ No newline at end of file diff --git a/my-dashboard.html b/my-dashboard.html index 68c2a8d..efdf234 100644 --- a/my-dashboard.html +++ b/my-dashboard.html @@ -1,4 +1,4 @@ -

Loading information...

\ No newline at end of file +

Loading information...

\ No newline at end of file diff --git a/my-dashboard/integrations.html b/my-dashboard/integrations.html index 49b296f..5b99fdf 100644 --- a/my-dashboard/integrations.html +++ b/my-dashboard/integrations.html @@ -1,4 +1,4 @@ -

Loading information...

\ No newline at end of file +

Loading information...

\ No newline at end of file diff --git a/my-dashboard/s2g.html b/my-dashboard/s2g.html index 25195c4..eee99e5 100644 --- a/my-dashboard/s2g.html +++ b/my-dashboard/s2g.html @@ -1,4 +1,4 @@ -

Loading information...

\ No newline at end of file +

Loading information...

\ No newline at end of file diff --git a/my-dashboard/teams.html b/my-dashboard/teams.html index 020d0df..70b6412 100644 --- a/my-dashboard/teams.html +++ b/my-dashboard/teams.html @@ -1,4 +1,4 @@ -

Loading information...

\ No newline at end of file +

Loading information...

\ No newline at end of file diff --git a/request.html b/request.html index 562717d..1139ebf 100644 --- a/request.html +++ b/request.html @@ -1,4 +1,4 @@ -

Loading information...

\ No newline at end of file +

Loading information...

\ No newline at end of file diff --git a/request/[rid].html b/request/[rid].html index 8c66f1e..7f9ffc2 100644 --- a/request/[rid].html +++ b/request/[rid].html @@ -1,4 +1,4 @@ -

Loading information...

\ No newline at end of file +

Loading information...

\ No newline at end of file diff --git a/terms-conditions.html b/terms-conditions.html index a10dc3e..309b5e0 100644 --- a/terms-conditions.html +++ b/terms-conditions.html @@ -1,4 +1,4 @@ -

Loading information...

\ No newline at end of file +

Loading information...

\ No newline at end of file diff --git a/verify-user.html b/verify-user.html index dcfbdd4..174b534 100644 --- a/verify-user.html +++ b/verify-user.html @@ -1,4 +1,4 @@ -

Loading information...

\ No newline at end of file +

Loading information...

\ No newline at end of file