>8*v-d&255;if(g.charCodeAt(0)&b)throw new Error("Bits beyond keysize not zero as expected.");var w=n.generate(x,p),A="";for(f=0;f{var H=X();cr();It();Dn();kt();cc();lr();Er();ka();On();se();var h=H.asn1,P=mc.exports=H.pki=H.pki||{},ie=P.oids,Se={};Se.CN=ie.commonName;Se.commonName="CN";Se.C=ie.countryName;Se.countryName="C";Se.L=ie.localityName;Se.localityName="L";Se.ST=ie.stateOrProvinceName;Se.stateOrProvinceName="ST";Se.O=ie.organizationName;Se.organizationName="O";Se.OU=ie.organizationalUnitName;Se.organizationalUnitName="OU";Se.E=ie.emailAddress;Se.emailAddress="E";var dc=H.pki.rsa.publicKeyValidator,zm={name:"Certificate",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:h.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:h.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:h.Class.UNIVERSAL,type:h.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:h.Class.UNIVERSAL,type:h.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:h.Class.UNIVERSAL,type:h.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:h.Class.UNIVERSAL,type:h.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},dc,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:h.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:h.Class.UNIVERSAL,type:h.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:h.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:h.Class.UNIVERSAL,type:h.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:h.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:h.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:h.Class.UNIVERSAL,type:h.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},jm={name:"rsapss",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:h.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:h.Class.UNIVERSAL,type:h.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:h.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:h.Class.UNIVERSAL,type:h.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:h.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:h.Class.UNIVERSAL,type:h.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:h.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:h.Class.UNIVERSAL,type:h.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},Ym={name:"CertificationRequestInfo",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},dc,{name:"CertificationRequestInfo.attributes",tagClass:h.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:h.Class.UNIVERSAL,type:h.Type.SET,constructed:!0}]}]}]},Qm={name:"CertificationRequest",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[Ym,{name:"CertificationRequest.signatureAlgorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:h.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:h.Class.UNIVERSAL,type:h.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};P.RDNAttributesAsArray=function(e,t){for(var n=[],r,a,i,s=0;s2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(u.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(s.validity.notBefore=u[0],s.validity.notAfter=u[1],s.tbsCertificate=n.tbsCertificate,t){s.md=Da({signatureOid:s.signatureOid,type:"certificate"});var c=h.toDer(s.tbsCertificate);s.md.update(c.getBytes())}var l=H.md.sha1.create(),f=h.toDer(n.certIssuer);l.update(f.getBytes()),s.issuer.getField=function(p){return pr(s.issuer,p)},s.issuer.addField=function(p){Ct([p]),s.issuer.attributes.push(p)},s.issuer.attributes=P.RDNAttributesAsArray(n.certIssuer),n.certIssuerUniqueId&&(s.issuer.uniqueId=n.certIssuerUniqueId),s.issuer.hash=l.digest().toHex();var d=H.md.sha1.create(),v=h.toDer(n.certSubject);return d.update(v.getBytes()),s.subject.getField=function(p){return pr(s.subject,p)},s.subject.addField=function(p){Ct([p]),s.subject.attributes.push(p)},s.subject.attributes=P.RDNAttributesAsArray(n.certSubject),n.certSubjectUniqueId&&(s.subject.uniqueId=n.certSubjectUniqueId),s.subject.hash=d.digest().toHex(),n.certExtensions?s.extensions=P.certificateExtensionsFromAsn1(n.certExtensions):s.extensions=[],s.publicKey=P.publicKeyFromAsn1(n.subjectPublicKeyInfo),s};P.certificateExtensionsFromAsn1=function(e){for(var t=[],n=0;n1&&(r=n.value.charCodeAt(1),a=n.value.length>2?n.value.charCodeAt(2):0),t.digitalSignature=(r&128)===128,t.nonRepudiation=(r&64)===64,t.keyEncipherment=(r&32)===32,t.dataEncipherment=(r&16)===16,t.keyAgreement=(r&8)===8,t.keyCertSign=(r&4)===4,t.cRLSign=(r&2)===2,t.encipherOnly=(r&1)===1,t.decipherOnly=(a&128)===128}else if(t.name==="basicConstraints"){var n=h.fromDer(t.value);n.value.length>0&&n.value[0].type===h.Type.BOOLEAN?t.cA=n.value[0].value.charCodeAt(0)!==0:t.cA=!1;var i=null;n.value.length>0&&n.value[0].type===h.Type.INTEGER?i=n.value[0].value:n.value.length>1&&(i=n.value[1].value),i!==null&&(t.pathLenConstraint=h.derToInteger(i))}else if(t.name==="extKeyUsage")for(var n=h.fromDer(t.value),s=0;s1&&(r=n.value.charCodeAt(1)),t.client=(r&128)===128,t.server=(r&64)===64,t.email=(r&32)===32,t.objsign=(r&16)===16,t.reserved=(r&8)===8,t.sslCA=(r&4)===4,t.emailCA=(r&2)===2,t.objCA=(r&1)===1}else if(t.name==="subjectAltName"||t.name==="issuerAltName"){t.altNames=[];for(var u,n=h.fromDer(t.value),c=0;c"u"&&(t.type&&t.type in P.oids?t.name=P.oids[t.type]:t.shortName&&t.shortName in Se&&(t.name=P.oids[Se[t.shortName]])),typeof t.type>"u")if(t.name&&t.name in P.oids)t.type=P.oids[t.name];else{var r=new Error("Attribute type not specified.");throw r.attribute=t,r}if(typeof t.shortName>"u"&&t.name&&t.name in Se&&(t.shortName=Se[t.name]),t.type===ie.extensionRequest&&(t.valueConstructed=!0,t.valueTagClass=h.Type.SEQUENCE,!t.value&&t.extensions)){t.value=[];for(var a=0;a"u"){var r=new Error("Attribute value not specified.");throw r.attribute=t,r}}}function hc(e,t){if(t=t||{},typeof e.name>"u"&&e.id&&e.id in P.oids&&(e.name=P.oids[e.id]),typeof e.id>"u")if(e.name&&e.name in P.oids)e.id=P.oids[e.name];else{var n=new Error("Extension ID not specified.");throw n.extension=e,n}if(typeof e.value<"u")return e;if(e.name==="keyUsage"){var r=0,a=0,i=0;e.digitalSignature&&(a|=128,r=7),e.nonRepudiation&&(a|=64,r=6),e.keyEncipherment&&(a|=32,r=5),e.dataEncipherment&&(a|=16,r=4),e.keyAgreement&&(a|=8,r=3),e.keyCertSign&&(a|=4,r=2),e.cRLSign&&(a|=2,r=1),e.encipherOnly&&(a|=1,r=0),e.decipherOnly&&(i|=128,r=7);var s=String.fromCharCode(r);i!==0?s+=String.fromCharCode(a)+String.fromCharCode(i):a!==0&&(s+=String.fromCharCode(a)),e.value=h.create(h.Class.UNIVERSAL,h.Type.BITSTRING,!1,s)}else if(e.name==="basicConstraints")e.value=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]),e.cA&&e.value.value.push(h.create(h.Class.UNIVERSAL,h.Type.BOOLEAN,!1,String.fromCharCode(255))),"pathLenConstraint"in e&&e.value.value.push(h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,h.integerToDer(e.pathLenConstraint).getBytes()));else if(e.name==="extKeyUsage"){e.value=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]);var o=e.value.value;for(var u in e)e[u]===!0&&(u in ie?o.push(h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(ie[u]).getBytes())):u.indexOf(".")!==-1&&o.push(h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(u).getBytes())))}else if(e.name==="nsCertType"){var r=0,a=0;e.client&&(a|=128,r=7),e.server&&(a|=64,r=6),e.email&&(a|=32,r=5),e.objsign&&(a|=16,r=4),e.reserved&&(a|=8,r=3),e.sslCA&&(a|=4,r=2),e.emailCA&&(a|=2,r=1),e.objCA&&(a|=1,r=0);var s=String.fromCharCode(r);a!==0&&(s+=String.fromCharCode(a)),e.value=h.create(h.Class.UNIVERSAL,h.Type.BITSTRING,!1,s)}else if(e.name==="subjectAltName"||e.name==="issuerAltName"){e.value=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]);for(var c,l=0;l128)throw new Error('Invalid "nsComment" content.');e.value=h.create(h.Class.UNIVERSAL,h.Type.IA5STRING,!1,e.comment)}else if(e.name==="subjectKeyIdentifier"&&t.cert){var f=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=f.toHex(),e.value=h.create(h.Class.UNIVERSAL,h.Type.OCTETSTRING,!1,f.getBytes())}else if(e.name==="authorityKeyIdentifier"&&t.cert){e.value=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]);var o=e.value.value;if(e.keyIdentifier){var d=e.keyIdentifier===!0?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;o.push(h.create(h.Class.CONTEXT_SPECIFIC,0,!1,d))}if(e.authorityCertIssuer){var v=[h.create(h.Class.CONTEXT_SPECIFIC,4,!0,[$r(e.authorityCertIssuer===!0?t.cert.issuer:e.authorityCertIssuer)])];o.push(h.create(h.Class.CONTEXT_SPECIFIC,1,!0,v))}if(e.serialNumber){var p=H.util.hexToBytes(e.serialNumber===!0?t.cert.serialNumber:e.serialNumber);o.push(h.create(h.Class.CONTEXT_SPECIFIC,2,!1,p))}}else if(e.name==="cRLDistributionPoints"){e.value=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]);for(var o=e.value.value,g=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]),x=h.create(h.Class.CONTEXT_SPECIFIC,0,!0,[]),c,l=0;l"u"){var n=new Error("Extension value not specified.");throw n.extension=e,n}return e}function Ss(e,t){switch(e){case ie["RSASSA-PSS"]:var n=[];return t.hash.algorithmOid!==void 0&&n.push(h.create(h.Class.CONTEXT_SPECIFIC,0,!0,[h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(t.hash.algorithmOid).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.NULL,!1,"")])])),t.mgf.algorithmOid!==void 0&&n.push(h.create(h.Class.CONTEXT_SPECIFIC,1,!0,[h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(t.mgf.algorithmOid).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(t.mgf.hash.algorithmOid).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.NULL,!1,"")])])])),t.saltLength!==void 0&&n.push(h.create(h.Class.CONTEXT_SPECIFIC,2,!0,[h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,h.integerToDer(t.saltLength).getBytes())])),h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,n);default:return h.create(h.Class.UNIVERSAL,h.Type.NULL,!1,"")}}function Xm(e){var t=h.create(h.Class.CONTEXT_SPECIFIC,0,!0,[]);if(e.attributes.length===0)return t;for(var n=e.attributes,r=0;r=Zm&&e0&&r.value.push(P.certificateExtensionsToAsn1(e.extensions)),r};P.getCertificationRequestInfo=function(e){var t=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,h.integerToDer(e.version).getBytes()),$r(e.subject),P.publicKeyToAsn1(e.publicKey),Xm(e)]);return t};P.distinguishedNameToAsn1=function(e){return $r(e)};P.certificateToAsn1=function(e){var t=e.tbsCertificate||P.getTBSCertificate(e);return h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[t,h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(e.signatureOid).getBytes()),Ss(e.signatureOid,e.signatureParameters)]),h.create(h.Class.UNIVERSAL,h.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])};P.certificateExtensionsToAsn1=function(e){var t=h.create(h.Class.CONTEXT_SPECIFIC,3,!0,[]),n=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]);t.value.push(n);for(var r=0;r"u"&&(a=new Date);var i=!0,s=null,o=0;do{var u=t.shift(),c=null,l=!1;if(a&&(au.validity.notAfter)&&(s={message:"Certificate is not valid yet or has expired.",error:P.certificateError.certificate_expired,notBefore:u.validity.notBefore,notAfter:u.validity.notAfter,now:a}),s===null){if(c=t[0]||e.getIssuer(u),c===null&&u.isIssuer(u)&&(l=!0,c=u),c){var f=c;H.util.isArray(f)||(f=[f]);for(var d=!1;!d&&f.length>0;){c=f.shift();try{d=c.verify(u)}catch{}}d||(s={message:"Certificate signature is invalid.",error:P.certificateError.bad_certificate})}s===null&&(!c||l)&&!e.hasCertificate(u)&&(s={message:"Certificate is not trusted.",error:P.certificateError.unknown_ca})}if(s===null&&c&&!u.isIssuer(c)&&(s={message:"Certificate issuer is invalid.",error:P.certificateError.bad_certificate}),s===null)for(var v={keyUsage:!0,basicConstraints:!0},p=0;s===null&&px.pathLenConstraint&&(s={message:"Certificate basicConstraints pathLenConstraint violated.",error:P.certificateError.bad_certificate})}}var A=s===null?!0:s.error,D=n.verify?n.verify(A,o,r):A;if(D===!0)s=null;else throw A===!0&&(s={message:"The application rejected the certificate.",error:P.certificateError.bad_certificate}),(D||D===0)&&(typeof D=="object"&&!H.util.isArray(D)?(D.message&&(s.message=D.message),D.error&&(s.error=D.error)):typeof D=="string"&&(s.error=D)),s;i=!1,++o}while(t.length>0);return!0}});var ws=j((iC,vc)=>{var ye=X();It();zr();lr();Es();Cs();vt();On();Xr();se();Pa();var C=ye.asn1,te=ye.pki,Fn=vc.exports=ye.pkcs12=ye.pkcs12||{},yc={name:"ContentInfo",tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:C.Class.UNIVERSAL,type:C.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:C.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},$m={name:"PFX",tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:C.Class.UNIVERSAL,type:C.Type.INTEGER,constructed:!1,capture:"version"},yc,{name:"PFX.macData",tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:C.Class.UNIVERSAL,type:C.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",tagClass:C.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:C.Class.UNIVERSAL,type:C.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:C.Class.UNIVERSAL,type:C.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:C.Class.UNIVERSAL,type:C.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},ey={name:"SafeBag",tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:C.Class.UNIVERSAL,type:C.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:C.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:C.Class.UNIVERSAL,type:C.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},ty={name:"Attribute",tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:C.Class.UNIVERSAL,type:C.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:C.Class.UNIVERSAL,type:C.Type.SET,constructed:!0,capture:"values"}]},ry={name:"CertBag",tagClass:C.Class.UNIVERSAL,type:C.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:C.Class.UNIVERSAL,type:C.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:C.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:C.Class.UNIVERSAL,type:C.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function Vn(e,t,n,r){for(var a=[],i=0;i=0&&a.push(o)}}return a}Fn.pkcs12FromAsn1=function(e,t,n){typeof t=="string"?(n=t,t=!0):t===void 0&&(t=!0);var r={},a=[];if(!C.validate(e,$m,r,a)){var i=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.");throw i.errors=i,i}var s={version:r.version.charCodeAt(0),safeContents:[],getBags:function(x){var b={},w;return"localKeyId"in x?w=x.localKeyId:"localKeyIdHex"in x&&(w=ye.util.hexToBytes(x.localKeyIdHex)),w===void 0&&!("friendlyName"in x)&&"bagType"in x&&(b[x.bagType]=Vn(s.safeContents,null,null,x.bagType)),w!==void 0&&(b.localKeyId=Vn(s.safeContents,"localKeyId",w,x.bagType)),"friendlyName"in x&&(b.friendlyName=Vn(s.safeContents,"friendlyName",x.friendlyName,x.bagType)),b},getBagsByFriendlyName:function(x,b){return Vn(s.safeContents,"friendlyName",x,b)},getBagsByLocalKeyId:function(x,b){return Vn(s.safeContents,"localKeyId",x,b)}};if(r.version.charCodeAt(0)!==3){var i=new Error("PKCS#12 PFX of version other than 3 not supported.");throw i.version=r.version.charCodeAt(0),i}if(C.derToOid(r.contentType)!==te.oids.data){var i=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw i.oid=C.derToOid(r.contentType),i}var o=r.content.value[0];if(o.tagClass!==C.Class.UNIVERSAL||o.type!==C.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(o=Ts(o),r.mac){var u=null,c=0,l=C.derToOid(r.macAlgorithm);switch(l){case te.oids.sha1:u=ye.md.sha1.create(),c=20;break;case te.oids.sha256:u=ye.md.sha256.create(),c=32;break;case te.oids.sha384:u=ye.md.sha384.create(),c=48;break;case te.oids.sha512:u=ye.md.sha512.create(),c=64;break;case te.oids.md5:u=ye.md.md5.create(),c=16;break}if(u===null)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+l);var f=new ye.util.ByteBuffer(r.macSalt),d="macIterations"in r?parseInt(ye.util.bytesToHex(r.macIterations),16):1,v=Fn.generateKey(n,f,3,d,c,u),p=ye.hmac.create();p.start(u,v),p.update(o.value);var g=p.getMac();if(g.getBytes()!==r.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}return ny(s,o.value,t,n),s};function Ts(e){if(e.composed||e.constructed){for(var t=ye.util.createBuffer(),n=0;n0&&(i=C.create(C.Class.UNIVERSAL,C.Type.SET,!0,u));var c=[],l=[];t!==null&&(ye.util.isArray(t)?l=t:l=[t]);for(var f=[],d=0;d0){var x=C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,f),b=C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.OID,!1,C.oidToDer(te.oids.data).getBytes()),C.create(C.Class.CONTEXT_SPECIFIC,0,!0,[C.create(C.Class.UNIVERSAL,C.Type.OCTETSTRING,!1,C.toDer(x).getBytes())])]);c.push(b)}var w=null;if(e!==null){var A=te.wrapRsaPrivateKey(te.privateKeyToAsn1(e));n===null?w=C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.OID,!1,C.oidToDer(te.oids.keyBag).getBytes()),C.create(C.Class.CONTEXT_SPECIFIC,0,!0,[A]),i]):w=C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.OID,!1,C.oidToDer(te.oids.pkcs8ShroudedKeyBag).getBytes()),C.create(C.Class.CONTEXT_SPECIFIC,0,!0,[te.encryptPrivateKeyInfo(A,n,r)]),i]);var D=C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[w]),k=C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.OID,!1,C.oidToDer(te.oids.data).getBytes()),C.create(C.Class.CONTEXT_SPECIFIC,0,!0,[C.create(C.Class.UNIVERSAL,C.Type.OCTETSTRING,!1,C.toDer(D).getBytes())])]);c.push(k)}var L=C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,c),z;if(r.useMac){var o=ye.md.sha1.create(),Z=new ye.util.ByteBuffer(ye.random.getBytes(r.saltSize)),le=r.count,e=Fn.generateKey(n,Z,3,le,20),fe=ye.hmac.create();fe.start(o,e),fe.update(C.toDer(L).getBytes());var he=fe.getMac();z=C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.OID,!1,C.oidToDer(te.oids.sha1).getBytes()),C.create(C.Class.UNIVERSAL,C.Type.NULL,!1,"")]),C.create(C.Class.UNIVERSAL,C.Type.OCTETSTRING,!1,he.getBytes())]),C.create(C.Class.UNIVERSAL,C.Type.OCTETSTRING,!1,Z.getBytes()),C.create(C.Class.UNIVERSAL,C.Type.INTEGER,!1,C.integerToDer(le).getBytes())])}return C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.INTEGER,!1,C.integerToDer(3).getBytes()),C.create(C.Class.UNIVERSAL,C.Type.SEQUENCE,!0,[C.create(C.Class.UNIVERSAL,C.Type.OID,!1,C.oidToDer(te.oids.data).getBytes()),C.create(C.Class.CONTEXT_SPECIFIC,0,!0,[C.create(C.Class.UNIVERSAL,C.Type.OCTETSTRING,!1,C.toDer(L).getBytes())])]),z])};Fn.generateKey=ye.pbe.generatePkcs12Key});var As=j((sC,gc)=>{var hr=X();It();lr();Cs();Er();wa();ws();ka();On();se();Pa();var Is=hr.asn1,en=gc.exports=hr.pki=hr.pki||{};en.pemToDer=function(e){var t=hr.pem.decode(e)[0];if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert PEM to DER; PEM is encrypted.");return hr.util.createBuffer(t.body)};en.privateKeyFromPem=function(e){var t=hr.pem.decode(e)[0];if(t.type!=="PRIVATE KEY"&&t.type!=="RSA PRIVATE KEY"){var n=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw n.headerType=t.type,n}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert private key from PEM; PEM is encrypted.");var r=Is.fromDer(t.body);return en.privateKeyFromAsn1(r)};en.privateKeyToPem=function(e,t){var n={type:"RSA PRIVATE KEY",body:Is.toDer(en.privateKeyToAsn1(e)).getBytes()};return hr.pem.encode(n,{maxline:t})};en.privateKeyInfoToPem=function(e,t){var n={type:"PRIVATE KEY",body:Is.toDer(e).getBytes()};return hr.pem.encode(n,{maxline:t})}});var Ls=j((oC,Ic)=>{var R=X();It();zr();Ca();Er();As();vt();Xr();se();var Fa=function(e,t,n,r){var a=R.util.createBuffer(),i=e.length>>1,s=i+(e.length&1),o=e.substr(0,s),u=e.substr(i,s),c=R.util.createBuffer(),l=R.hmac.create();n=t+n;var f=Math.ceil(r/16),d=Math.ceil(r/20);l.start("MD5",o);var v=R.util.createBuffer();c.putBytes(n);for(var p=0;p0&&(y.queue(e,y.createAlert(e,{level:y.Alert.Level.warning,description:y.Alert.Description.no_renegotiation})),y.flush(e)),e.process()};y.parseHelloMessage=function(e,t,n){var r=null,a=e.entity===y.ConnectionEnd.client;if(n<38)e.error(e,{message:a?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:y.Alert.Level.fatal,description:y.Alert.Description.illegal_parameter}});else{var i=t.fragment,s=i.length();if(r={version:{major:i.getByte(),minor:i.getByte()},random:R.util.createBuffer(i.getBytes(32)),session_id:dt(i,1),extensions:[]},a?(r.cipher_suite=i.getBytes(2),r.compression_method=i.getByte()):(r.cipher_suites=dt(i,2),r.compression_methods=dt(i,1)),s=n-(s-i.length()),s>0){for(var o=dt(i,2);o.length()>0;)r.extensions.push({type:[o.getByte(),o.getByte()],data:dt(o,2)});if(!a)for(var u=0;u0;){var f=l.getByte();if(f!==0)break;e.session.extensions.server_name.serverNameList.push(dt(l,2).getBytes())}}}if(e.session.version&&(r.version.major!==e.session.version.major||r.version.minor!==e.session.version.minor))return e.error(e,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:y.Alert.Level.fatal,description:y.Alert.Description.protocol_version}});if(a)e.session.cipherSuite=y.getCipherSuite(r.cipher_suite);else for(var d=R.util.createBuffer(r.cipher_suites.bytes());d.length()>0&&(e.session.cipherSuite=y.getCipherSuite(d.getBytes(2)),e.session.cipherSuite===null););if(e.session.cipherSuite===null)return e.error(e,{message:"No cipher suites in common.",send:!0,alert:{level:y.Alert.Level.fatal,description:y.Alert.Description.handshake_failure},cipherSuite:R.util.bytesToHex(r.cipher_suite)});a?e.session.compressionMethod=r.compression_method:e.session.compressionMethod=y.CompressionMethod.none}return r};y.createSecurityParameters=function(e,t){var n=e.entity===y.ConnectionEnd.client,r=t.random.bytes(),a=n?e.session.sp.client_random:r,i=n?r:y.createRandom().getBytes();e.session.sp={entity:e.entity,prf_algorithm:y.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:e.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:a,server_random:i}};y.handleServerHello=function(e,t,n){var r=y.parseHelloMessage(e,t,n);if(!e.fail){if(r.version.minor<=e.version.minor)e.version.minor=r.version.minor;else return e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:y.Alert.Level.fatal,description:y.Alert.Description.protocol_version}});e.session.version=e.version;var a=r.session_id.bytes();a.length>0&&a===e.session.id?(e.expect=Ec,e.session.resuming=!0,e.session.sp.server_random=r.random.bytes()):(e.expect=fy,e.session.resuming=!1,y.createSecurityParameters(e,r)),e.session.id=a,e.process()}};y.handleClientHello=function(e,t,n){var r=y.parseHelloMessage(e,t,n);if(!e.fail){var a=r.session_id.bytes(),i=null;if(e.sessionCache&&(i=e.sessionCache.getSession(a),i===null?a="":(i.version.major!==r.version.major||i.version.minor>r.version.minor)&&(i=null,a="")),a.length===0&&(a=R.random.getBytes(32)),e.session.id=a,e.session.clientHelloVersion=r.version,e.session.sp={},i)e.version=e.session.version=i.version,e.session.sp=i.sp;else{for(var s,o=1;o0;)i=dt(a.certificate_list,3),s=R.asn1.fromDer(i),i=R.pki.certificateFromAsn1(s,!0),o.push(i)}catch(c){return e.error(e,{message:"Could not parse certificate list.",cause:c,send:!0,alert:{level:y.Alert.Level.fatal,description:y.Alert.Description.bad_certificate}})}var u=e.entity===y.ConnectionEnd.client;(u||e.verifyClient===!0)&&o.length===0?e.error(e,{message:u?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:y.Alert.Level.fatal,description:y.Alert.Description.illegal_parameter}}):o.length===0?e.expect=u?xc:Rs:(u?e.session.serverCertificate=o[0]:e.session.clientCertificate=o[0],y.verifyCertificateChain(e,o)&&(e.expect=u?xc:Rs)),e.process()};y.handleServerKeyExchange=function(e,t,n){if(n>0)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:y.Alert.Level.fatal,description:y.Alert.Description.unsupported_certificate}});e.expect=dy,e.process()};y.handleClientKeyExchange=function(e,t,n){if(n<48)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:y.Alert.Level.fatal,description:y.Alert.Description.unsupported_certificate}});var r=t.fragment,a={enc_pre_master_secret:dt(r,2).getBytes()},i=null;if(e.getPrivateKey)try{i=e.getPrivateKey(e,e.session.serverCertificate),i=R.pki.privateKeyFromPem(i)}catch(u){e.error(e,{message:"Could not get private key.",cause:u,send:!0,alert:{level:y.Alert.Level.fatal,description:y.Alert.Description.internal_error}})}if(i===null)return e.error(e,{message:"No private key set.",send:!0,alert:{level:y.Alert.Level.fatal,description:y.Alert.Description.internal_error}});try{var s=e.session.sp;s.pre_master_secret=i.decrypt(a.enc_pre_master_secret);var o=e.session.clientHelloVersion;if(o.major!==s.pre_master_secret.charCodeAt(0)||o.minor!==s.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch{s.pre_master_secret=R.random.getBytes(48)}e.expect=Ns,e.session.clientCertificate!==null&&(e.expect=xy),e.process()};y.handleCertificateRequest=function(e,t,n){if(n<3)return e.error(e,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:y.Alert.Level.fatal,description:y.Alert.Description.illegal_parameter}});var r=t.fragment,a={certificate_types:dt(r,1),certificate_authorities:dt(r,2)};e.session.certificateRequest=a,e.expect=py,e.process()};y.handleCertificateVerify=function(e,t,n){if(n<2)return e.error(e,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:y.Alert.Level.fatal,description:y.Alert.Description.illegal_parameter}});var r=t.fragment;r.read-=4;var a=r.bytes();r.read+=4;var i={signature:dt(r,2).getBytes()},s=R.util.createBuffer();s.putBuffer(e.session.md5.digest()),s.putBuffer(e.session.sha1.digest()),s=s.getBytes();try{var o=e.session.clientCertificate;if(!o.publicKey.verify(s,i.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");e.session.md5.update(a),e.session.sha1.update(a)}catch{return e.error(e,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:y.Alert.Level.fatal,description:y.Alert.Description.handshake_failure}})}e.expect=Ns,e.process()};y.handleServerHelloDone=function(e,t,n){if(n>0)return e.error(e,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:y.Alert.Level.fatal,description:y.Alert.Description.record_overflow}});if(e.serverCertificate===null){var r={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:y.Alert.Level.fatal,description:y.Alert.Description.insufficient_security}},a=0,i=e.verify(e,r.alert.description,a,[]);if(i!==!0)return(i||i===0)&&(typeof i=="object"&&!R.util.isArray(i)?(i.message&&(r.message=i.message),i.alert&&(r.alert.description=i.alert)):typeof i=="number"&&(r.alert.description=i)),e.error(e,r)}e.session.certificateRequest!==null&&(t=y.createRecord(e,{type:y.ContentType.handshake,data:y.createCertificate(e)}),y.queue(e,t)),t=y.createRecord(e,{type:y.ContentType.handshake,data:y.createClientKeyExchange(e)}),y.queue(e,t),e.expect=yy;var s=function(o,u){o.session.certificateRequest!==null&&o.session.clientCertificate!==null&&y.queue(o,y.createRecord(o,{type:y.ContentType.handshake,data:y.createCertificateVerify(o,u)})),y.queue(o,y.createRecord(o,{type:y.ContentType.change_cipher_spec,data:y.createChangeCipherSpec()})),o.state.pending=y.createConnectionState(o),o.state.current.write=o.state.pending.write,y.queue(o,y.createRecord(o,{type:y.ContentType.handshake,data:y.createFinished(o)})),o.expect=Ec,y.flush(o),o.process()};if(e.session.certificateRequest===null||e.session.clientCertificate===null)return s(e,null);y.getClientSignature(e,s)};y.handleChangeCipherSpec=function(e,t){if(t.fragment.getByte()!==1)return e.error(e,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:y.Alert.Level.fatal,description:y.Alert.Description.illegal_parameter}});var n=e.entity===y.ConnectionEnd.client;(e.session.resuming&&n||!e.session.resuming&&!n)&&(e.state.pending=y.createConnectionState(e)),e.state.current.read=e.state.pending.read,(!e.session.resuming&&n||e.session.resuming&&!n)&&(e.state.pending=null),e.expect=n?hy:Cy,e.process()};y.handleFinished=function(e,t,n){var r=t.fragment;r.read-=4;var a=r.bytes();r.read+=4;var i=t.fragment.getBytes();r=R.util.createBuffer(),r.putBuffer(e.session.md5.digest()),r.putBuffer(e.session.sha1.digest());var s=e.entity===y.ConnectionEnd.client,o=s?"server finished":"client finished",u=e.session.sp,c=12,l=Fa;if(r=l(u.master_secret,o,r.getBytes(),c),r.getBytes()!==i)return e.error(e,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:y.Alert.Level.fatal,description:y.Alert.Description.decrypt_error}});e.session.md5.update(a),e.session.sha1.update(a),(e.session.resuming&&s||!e.session.resuming&&!s)&&(y.queue(e,y.createRecord(e,{type:y.ContentType.change_cipher_spec,data:y.createChangeCipherSpec()})),e.state.current.write=e.state.pending.write,e.state.pending=null,y.queue(e,y.createRecord(e,{type:y.ContentType.handshake,data:y.createFinished(e)}))),e.expect=s?my:Ey,e.handshaking=!1,++e.handshakes,e.peerCertificate=s?e.session.serverCertificate:e.session.clientCertificate,y.flush(e),e.isConnected=!0,e.connected(e),e.process()};y.handleAlert=function(e,t){var n=t.fragment,r={level:n.getByte(),description:n.getByte()},a;switch(r.description){case y.Alert.Description.close_notify:a="Connection closed.";break;case y.Alert.Description.unexpected_message:a="Unexpected message.";break;case y.Alert.Description.bad_record_mac:a="Bad record MAC.";break;case y.Alert.Description.decryption_failed:a="Decryption failed.";break;case y.Alert.Description.record_overflow:a="Record overflow.";break;case y.Alert.Description.decompression_failure:a="Decompression failed.";break;case y.Alert.Description.handshake_failure:a="Handshake failure.";break;case y.Alert.Description.bad_certificate:a="Bad certificate.";break;case y.Alert.Description.unsupported_certificate:a="Unsupported certificate.";break;case y.Alert.Description.certificate_revoked:a="Certificate revoked.";break;case y.Alert.Description.certificate_expired:a="Certificate expired.";break;case y.Alert.Description.certificate_unknown:a="Certificate unknown.";break;case y.Alert.Description.illegal_parameter:a="Illegal parameter.";break;case y.Alert.Description.unknown_ca:a="Unknown certificate authority.";break;case y.Alert.Description.access_denied:a="Access denied.";break;case y.Alert.Description.decode_error:a="Decode error.";break;case y.Alert.Description.decrypt_error:a="Decrypt error.";break;case y.Alert.Description.export_restriction:a="Export restriction.";break;case y.Alert.Description.protocol_version:a="Unsupported protocol version.";break;case y.Alert.Description.insufficient_security:a="Insufficient security.";break;case y.Alert.Description.internal_error:a="Internal error.";break;case y.Alert.Description.user_canceled:a="User canceled.";break;case y.Alert.Description.no_renegotiation:a="Renegotiation not supported.";break;default:a="Unknown error.";break}if(r.description===y.Alert.Description.close_notify)return e.close();e.error(e,{message:a,send:!1,origin:e.entity===y.ConnectionEnd.client?"server":"client",alert:r}),e.process()};y.handleHandshake=function(e,t){var n=t.fragment,r=n.getByte(),a=n.getInt24();if(a>n.length())return e.fragmented=t,t.fragment=R.util.createBuffer(),n.read-=4,e.process();e.fragmented=null,n.read-=4;var i=n.bytes(a+4);n.read+=4,r in Va[e.entity][e.expect]?(e.entity===y.ConnectionEnd.server&&!e.open&&!e.fail&&(e.handshaking=!0,e.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:R.md.md5.create(),sha1:R.md.sha1.create()}),r!==y.HandshakeType.hello_request&&r!==y.HandshakeType.certificate_verify&&r!==y.HandshakeType.finished&&(e.session.md5.update(i),e.session.sha1.update(i)),Va[e.entity][e.expect][r](e,t,a)):y.handleUnexpected(e,t)};y.handleApplicationData=function(e,t){e.data.putBuffer(t.fragment),e.dataReady(e),e.process()};y.handleHeartbeat=function(e,t){var n=t.fragment,r=n.getByte(),a=n.getInt16(),i=n.getBytes(a);if(r===y.HeartbeatMessageType.heartbeat_request){if(e.handshaking||a>i.length)return e.process();y.queue(e,y.createRecord(e,{type:y.ContentType.heartbeat,data:y.createHeartbeat(y.HeartbeatMessageType.heartbeat_response,i)})),y.flush(e)}else if(r===y.HeartbeatMessageType.heartbeat_response){if(i!==e.expectedHeartbeatPayload)return e.process();e.heartbeatReceived&&e.heartbeatReceived(e,R.util.createBuffer(i))}e.process()};var ly=0,fy=1,xc=2,dy=3,py=4,Ec=5,hy=6,my=7,yy=8,vy=0,gy=1,Rs=2,xy=3,Ns=4,Cy=5,Ey=6,m=y.handleUnexpected,bc=y.handleChangeCipherSpec,Ue=y.handleAlert,ot=y.handleHandshake,Sc=y.handleApplicationData,Oe=y.handleHeartbeat,ks=[];ks[y.ConnectionEnd.client]=[[m,Ue,ot,m,Oe],[m,Ue,ot,m,Oe],[m,Ue,ot,m,Oe],[m,Ue,ot,m,Oe],[m,Ue,ot,m,Oe],[bc,Ue,m,m,Oe],[m,Ue,ot,m,Oe],[m,Ue,ot,Sc,Oe],[m,Ue,ot,m,Oe]];ks[y.ConnectionEnd.server]=[[m,Ue,ot,m,Oe],[m,Ue,ot,m,Oe],[m,Ue,ot,m,Oe],[m,Ue,ot,m,Oe],[bc,Ue,m,m,Oe],[m,Ue,ot,m,Oe],[m,Ue,ot,Sc,Oe],[m,Ue,ot,m,Oe]];var mr=y.handleHelloRequest,by=y.handleServerHello,Tc=y.handleCertificate,Cc=y.handleServerKeyExchange,Bs=y.handleCertificateRequest,Ua=y.handleServerHelloDone,wc=y.handleFinished,Va=[];Va[y.ConnectionEnd.client]=[[m,m,by,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m],[mr,m,m,m,m,m,m,m,m,m,m,Tc,Cc,Bs,Ua,m,m,m,m,m,m],[mr,m,m,m,m,m,m,m,m,m,m,m,Cc,Bs,Ua,m,m,m,m,m,m],[mr,m,m,m,m,m,m,m,m,m,m,m,m,Bs,Ua,m,m,m,m,m,m],[mr,m,m,m,m,m,m,m,m,m,m,m,m,m,Ua,m,m,m,m,m,m],[mr,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m],[mr,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,wc],[mr,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m],[mr,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m]];var Sy=y.handleClientHello,Ty=y.handleClientKeyExchange,wy=y.handleCertificateVerify;Va[y.ConnectionEnd.server]=[[m,Sy,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m],[m,m,m,m,m,m,m,m,m,m,m,Tc,m,m,m,m,m,m,m,m,m],[m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,Ty,m,m,m,m],[m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,wy,m,m,m,m,m],[m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m],[m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,wc],[m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m],[m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m]];y.generateKeys=function(e,t){var n=Fa,r=t.client_random+t.server_random;e.session.resuming||(t.master_secret=n(t.pre_master_secret,"master secret",r,48).bytes(),t.pre_master_secret=null),r=t.server_random+t.client_random;var a=2*t.mac_key_length+2*t.enc_key_length,i=e.version.major===y.Versions.TLS_1_0.major&&e.version.minor===y.Versions.TLS_1_0.minor;i&&(a+=2*t.fixed_iv_length);var s=n(t.master_secret,"key expansion",r,a),o={client_write_MAC_key:s.getBytes(t.mac_key_length),server_write_MAC_key:s.getBytes(t.mac_key_length),client_write_key:s.getBytes(t.enc_key_length),server_write_key:s.getBytes(t.enc_key_length)};return i&&(o.client_write_IV=s.getBytes(t.fixed_iv_length),o.server_write_IV=s.getBytes(t.fixed_iv_length)),o};y.createConnectionState=function(e){var t=e.entity===y.ConnectionEnd.client,n=function(){var i={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(s){return!0},compressionState:null,compressFunction:function(s){return!0},updateSequenceNumber:function(){i.sequenceNumber[1]===4294967295?(i.sequenceNumber[1]=0,++i.sequenceNumber[0]):++i.sequenceNumber[1]}};return i},r={read:n(),write:n()};if(r.read.update=function(i,s){return r.read.cipherFunction(s,r.read)?r.read.compressFunction(i,s,r.read)||i.error(i,{message:"Could not decompress record.",send:!0,alert:{level:y.Alert.Level.fatal,description:y.Alert.Description.decompression_failure}}):i.error(i,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:y.Alert.Level.fatal,description:y.Alert.Description.bad_record_mac}}),!i.fail},r.write.update=function(i,s){return r.write.compressFunction(i,s,r.write)?r.write.cipherFunction(s,r.write)||i.error(i,{message:"Could not encrypt record.",send:!1,alert:{level:y.Alert.Level.fatal,description:y.Alert.Description.internal_error}}):i.error(i,{message:"Could not compress record.",send:!1,alert:{level:y.Alert.Level.fatal,description:y.Alert.Description.internal_error}}),!i.fail},e.session){var a=e.session.sp;switch(e.session.cipherSuite.initSecurityParameters(a),a.keys=y.generateKeys(e,a),r.read.macKey=t?a.keys.server_write_MAC_key:a.keys.client_write_MAC_key,r.write.macKey=t?a.keys.client_write_MAC_key:a.keys.server_write_MAC_key,e.session.cipherSuite.initConnectionState(r,e,a),a.compression_algorithm){case y.CompressionMethod.none:break;case y.CompressionMethod.deflate:r.read.compressFunction=cy,r.write.compressFunction=uy;break;default:throw new Error("Unsupported compression algorithm.")}}return r};y.createRandom=function(){var e=new Date,t=+e+e.getTimezoneOffset()*6e4,n=R.util.createBuffer();return n.putInt32(t),n.putBytes(R.random.getBytes(28)),n};y.createRecord=function(e,t){if(!t.data)return null;var n={type:t.type,version:{major:e.version.major,minor:e.version.minor},length:t.data.length(),fragment:t.data};return n};y.createAlert=function(e,t){var n=R.util.createBuffer();return n.putByte(t.level),n.putByte(t.description),y.createRecord(e,{type:y.ContentType.alert,data:n})};y.createClientHello=function(e){e.session.clientHelloVersion={major:e.version.major,minor:e.version.minor};for(var t=R.util.createBuffer(),n=0;n0&&(f+=2);var d=e.session.id,v=d.length+1+2+4+28+2+a+1+s+f,p=R.util.createBuffer();return p.putByte(y.HandshakeType.client_hello),p.putInt24(v),p.putByte(e.version.major),p.putByte(e.version.minor),p.putBytes(e.session.sp.client_random),Et(p,1,R.util.createBuffer(d)),Et(p,2,t),Et(p,1,i),f>0&&Et(p,2,o),p};y.createServerHello=function(e){var t=e.session.id,n=t.length+1+2+4+28+2+1,r=R.util.createBuffer();return r.putByte(y.HandshakeType.server_hello),r.putInt24(n),r.putByte(e.version.major),r.putByte(e.version.minor),r.putBytes(e.session.sp.server_random),Et(r,1,R.util.createBuffer(t)),r.putByte(e.session.cipherSuite.id[0]),r.putByte(e.session.cipherSuite.id[1]),r.putByte(e.session.compressionMethod),r};y.createCertificate=function(e){var t=e.entity===y.ConnectionEnd.client,n=null;if(e.getCertificate){var r;t?r=e.session.certificateRequest:r=e.session.extensions.server_name.serverNameList,n=e.getCertificate(e,r)}var a=R.util.createBuffer();if(n!==null)try{R.util.isArray(n)||(n=[n]);for(var i=null,s=0;s0&&(n.putByte(y.HandshakeType.server_key_exchange),n.putInt24(t)),n};y.getClientSignature=function(e,t){var n=R.util.createBuffer();n.putBuffer(e.session.md5.digest()),n.putBuffer(e.session.sha1.digest()),n=n.getBytes(),e.getSignature=e.getSignature||function(r,a,i){var s=null;if(r.getPrivateKey)try{s=r.getPrivateKey(r,r.session.clientCertificate),s=R.pki.privateKeyFromPem(s)}catch(o){r.error(r,{message:"Could not get private key.",cause:o,send:!0,alert:{level:y.Alert.Level.fatal,description:y.Alert.Description.internal_error}})}s===null?r.error(r,{message:"No private key set.",send:!0,alert:{level:y.Alert.Level.fatal,description:y.Alert.Description.internal_error}}):a=s.sign(a,null),i(r,a)},e.getSignature(e,n,t)};y.createCertificateVerify=function(e,t){var n=t.length+2,r=R.util.createBuffer();return r.putByte(y.HandshakeType.certificate_verify),r.putInt24(n),r.putInt16(t.length),r.putBytes(t),r};y.createCertificateRequest=function(e){var t=R.util.createBuffer();t.putByte(1);var n=R.util.createBuffer();for(var r in e.caStore.certs){var a=e.caStore.certs[r],i=R.pki.distinguishedNameToAsn1(a.subject),s=R.asn1.toDer(i);n.putInt16(s.length()),n.putBuffer(s)}var o=1+t.length()+2+n.length(),u=R.util.createBuffer();return u.putByte(y.HandshakeType.certificate_request),u.putInt24(o),Et(u,1,t),Et(u,2,n),u};y.createServerHelloDone=function(e){var t=R.util.createBuffer();return t.putByte(y.HandshakeType.server_hello_done),t.putInt24(0),t};y.createChangeCipherSpec=function(){var e=R.util.createBuffer();return e.putByte(1),e};y.createFinished=function(e){var t=R.util.createBuffer();t.putBuffer(e.session.md5.digest()),t.putBuffer(e.session.sha1.digest());var n=e.entity===y.ConnectionEnd.client,r=e.session.sp,a=12,i=Fa,s=n?"client finished":"server finished";t=i(r.master_secret,s,t.getBytes(),a);var o=R.util.createBuffer();return o.putByte(y.HandshakeType.finished),o.putInt24(t.length()),o.putBuffer(t),o};y.createHeartbeat=function(e,t,n){typeof n>"u"&&(n=t.length);var r=R.util.createBuffer();r.putByte(e),r.putInt16(n),r.putBytes(t);var a=r.length(),i=Math.max(16,a-n-3);return r.putBytes(R.random.getBytes(i)),r};y.queue=function(e,t){if(t&&!(t.fragment.length()===0&&(t.type===y.ContentType.handshake||t.type===y.ContentType.alert||t.type===y.ContentType.change_cipher_spec))){if(t.type===y.ContentType.handshake){var n=t.fragment.bytes();e.session.md5.update(n),e.session.sha1.update(n),n=null}var r;if(t.fragment.length()<=y.MaxFragment)r=[t];else{r=[];for(var a=t.fragment.bytes();a.length>y.MaxFragment;)r.push(y.createRecord(e,{type:t.type,data:R.util.createBuffer(a.slice(0,y.MaxFragment))})),a=a.slice(y.MaxFragment);a.length>0&&r.push(y.createRecord(e,{type:t.type,data:R.util.createBuffer(a)}))}for(var i=0;i0&&(s=n.order[0]),s!==null&&s in n.cache){i=n.cache[s],delete n.cache[s];for(var o in n.order)if(n.order[o]===s){n.order.splice(o,1);break}}return i},n.setSession=function(a,i){if(n.order.length===n.capacity){var s=n.order.shift();delete n.cache[s]}var s=R.util.bytesToHex(a);n.order.push(s),n.cache[s]=i}}return n};y.createConnection=function(e){var t=null;e.caStore?R.util.isArray(e.caStore)?t=R.pki.createCaStore(e.caStore):t=e.caStore:t=R.pki.createCaStore();var n=e.cipherSuites||null;if(n===null){n=[];for(var r in y.CipherSuites)n.push(y.CipherSuites[r])}var a=e.server?y.ConnectionEnd.server:y.ConnectionEnd.client,i=e.sessionCache?y.createSessionCache(e.sessionCache):null,s={version:{major:y.Version.major,minor:y.Version.minor},entity:a,sessionId:e.sessionId,caStore:t,sessionCache:i,cipherSuites:n,connected:e.connected,virtualHost:e.virtualHost||null,verifyClient:e.verifyClient||!1,verify:e.verify||function(l,f,d,v){return f},verifyOptions:e.verifyOptions||{},getCertificate:e.getCertificate||null,getPrivateKey:e.getPrivateKey||null,getSignature:e.getSignature||null,input:R.util.createBuffer(),tlsData:R.util.createBuffer(),data:R.util.createBuffer(),tlsDataReady:e.tlsDataReady,dataReady:e.dataReady,heartbeatReceived:e.heartbeatReceived,closed:e.closed,error:function(l,f){f.origin=f.origin||(l.entity===y.ConnectionEnd.client?"client":"server"),f.send&&(y.queue(l,y.createAlert(l,f.alert)),y.flush(l));var d=f.fatal!==!1;d&&(l.fail=!0),e.error(l,f),d&&l.close(!1)},deflate:e.deflate||null,inflate:e.inflate||null};s.reset=function(l){s.version={major:y.Version.major,minor:y.Version.minor},s.record=null,s.session=null,s.peerCertificate=null,s.state={pending:null,current:null},s.expect=s.entity===y.ConnectionEnd.client?ly:vy,s.fragmented=null,s.records=[],s.open=!1,s.handshakes=0,s.handshaking=!1,s.isConnected=!1,s.fail=!(l||typeof l>"u"),s.input.clear(),s.tlsData.clear(),s.data.clear(),s.state.current=y.createConnectionState(s)},s.reset();var o=function(l,f){var d=f.type-y.ContentType.change_cipher_spec,v=ks[l.entity][l.expect];d in v?v[d](l,f):y.handleUnexpected(l,f)},u=function(l){var f=0,d=l.input,v=d.length();if(v<5)f=5-v;else{l.record={type:d.getByte(),version:{major:d.getByte(),minor:d.getByte()},length:d.getInt16(),fragment:R.util.createBuffer(),ready:!1};var p=l.record.version.major===l.version.major;p&&l.session&&l.session.version&&(p=l.record.version.minor===l.version.minor),p||l.error(l,{message:"Incompatible TLS version.",send:!0,alert:{level:y.Alert.Level.fatal,description:y.Alert.Description.protocol_version}})}return f},c=function(l){var f=0,d=l.input,v=d.length();if(v0&&(s.sessionCache&&(f=s.sessionCache.getSession(l)),f===null&&(l="")),l.length===0&&s.sessionCache&&(f=s.sessionCache.getSession(),f!==null&&(l=f.id)),s.session={id:l,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:R.md.md5.create(),sha1:R.md.sha1.create()},f&&(s.version=f.version,s.session.sp=f.sp),s.session.sp.client_random=y.createRandom().getBytes(),s.open=!0,y.queue(s,y.createRecord(s,{type:y.ContentType.handshake,data:y.createClientHello(s)})),y.flush(s)}},s.process=function(l){var f=0;return l&&s.input.putBytes(l),s.fail||(s.record!==null&&s.record.ready&&s.record.fragment.isEmpty()&&(s.record=null),s.record===null&&(f=u(s)),!s.fail&&s.record!==null&&!s.record.ready&&(f=c(s)),!s.fail&&s.record!==null&&s.record.ready&&o(s,s.record)),f},s.prepare=function(l){return y.queue(s,y.createRecord(s,{type:y.ContentType.application_data,data:R.util.createBuffer(l)})),y.flush(s)},s.prepareHeartbeatRequest=function(l,f){return l instanceof R.util.ByteBuffer&&(l=l.bytes()),typeof f>"u"&&(f=l.length),s.expectedHeartbeatPayload=l,y.queue(s,y.createRecord(s,{type:y.ContentType.heartbeat,data:y.createHeartbeat(y.HeartbeatMessageType.heartbeat_request,l,f)})),y.flush(s)},s.close=function(l){if(!s.fail&&s.sessionCache&&s.session){var f={id:s.session.id,version:s.session.version,sp:s.session.sp};f.sp.keys=null,s.sessionCache.setSession(f.id,f)}s.open&&(s.open=!1,s.input.clear(),(s.isConnected||s.handshaking)&&(s.isConnected=s.handshaking=!1,y.queue(s,y.createAlert(s,{level:y.Alert.Level.warning,description:y.Alert.Description.close_notify})),y.flush(s)),s.closed(s)),s.reset(l)},s};Ic.exports=R.tls=R.tls||{};for(Oa in y)typeof y[Oa]!="function"&&(R.tls[Oa]=y[Oa]);var Oa;R.tls.prf_tls1=Fa;R.tls.hmac_sha1=oy;R.tls.createSessionCache=y.createSessionCache;R.tls.createConnection=y.createConnection});var _c=j((uC,Bc)=>{var yr=X();cr();Ls();var bt=Bc.exports=yr.tls;bt.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=bt.BulkCipherAlgorithm.aes,e.cipher_type=bt.CipherType.block,e.enc_key_length=16,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=bt.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:Ac};bt.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=bt.BulkCipherAlgorithm.aes,e.cipher_type=bt.CipherType.block,e.enc_key_length=32,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=bt.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:Ac};function Ac(e,t,n){var r=t.entity===yr.tls.ConnectionEnd.client;e.read.cipherState={init:!1,cipher:yr.cipher.createDecipher("AES-CBC",r?n.keys.server_write_key:n.keys.client_write_key),iv:r?n.keys.server_write_IV:n.keys.client_write_IV},e.write.cipherState={init:!1,cipher:yr.cipher.createCipher("AES-CBC",r?n.keys.client_write_key:n.keys.server_write_key),iv:r?n.keys.client_write_IV:n.keys.server_write_IV},e.read.cipherFunction=Ry,e.write.cipherFunction=Ay,e.read.macLength=e.write.macLength=n.mac_length,e.read.macFunction=e.write.macFunction=bt.hmac_sha1}function Ay(e,t){var n=!1,r=t.macFunction(t.macKey,t.sequenceNumber,e);e.fragment.putBytes(r),t.updateSequenceNumber();var a;e.version.minor===bt.Versions.TLS_1_0.minor?a=t.cipherState.init?null:t.cipherState.iv:a=yr.random.getBytesSync(16),t.cipherState.init=!0;var i=t.cipherState.cipher;return i.start({iv:a}),e.version.minor>=bt.Versions.TLS_1_1.minor&&i.output.putBytes(a),i.update(e.fragment),i.finish(By)&&(e.fragment=i.output,e.length=e.fragment.length(),n=!0),n}function By(e,t,n){if(!n){var r=e-t.length()%e;t.fillWithByte(r-1,r)}return!0}function _y(e,t,n){var r=!0;if(n){for(var a=t.length(),i=t.last(),s=a-1-i;s=i?(e.fragment=a.output.getBytes(o-i),s=a.output.getBytes(i)):e.fragment=a.output.getBytes(),e.fragment=yr.util.createBuffer(e.fragment),e.length=e.fragment.length();var u=t.macFunction(t.macKey,t.sequenceNumber,e);return t.updateSequenceNumber(),n=Ny(t.macKey,s,u)&&n,n}function Ny(e,t,n){var r=yr.hmac.create();return r.start("SHA1",e),r.update(t),t=r.digest().getBytes(),r.start(null,null),r.update(n),n=r.digest().getBytes(),t===n}});var Us=j((cC,Lc)=>{var Ce=X();kt();se();var Mn=Lc.exports=Ce.sha512=Ce.sha512||{};Ce.md.sha512=Ce.md.algorithms.sha512=Mn;var Nc=Ce.sha384=Ce.sha512.sha384=Ce.sha512.sha384||{};Nc.create=function(){return Mn.create("SHA-384")};Ce.md.sha384=Ce.md.algorithms.sha384=Nc;Ce.sha512.sha256=Ce.sha512.sha256||{create:function(){return Mn.create("SHA-512/256")}};Ce.md["sha512/256"]=Ce.md.algorithms["sha512/256"]=Ce.sha512.sha256;Ce.sha512.sha224=Ce.sha512.sha224||{create:function(){return Mn.create("SHA-512/224")}};Ce.md["sha512/224"]=Ce.md.algorithms["sha512/224"]=Ce.sha512.sha224;Mn.create=function(e){if(kc||ky(),typeof e>"u"&&(e="SHA-512"),!(e in Ar))throw new Error("Invalid SHA-512 algorithm: "+e);for(var t=Ar[e],n=null,r=Ce.util.createBuffer(),a=new Array(80),i=0;i<80;++i)a[i]=new Array(2);var s=64;switch(e){case"SHA-384":s=48;break;case"SHA-512/256":s=32;break;case"SHA-512/224":s=28;break}var o={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:s,messageLength:0,fullMessageLength:null,messageLengthSize:16};return o.start=function(){o.messageLength=0,o.fullMessageLength=o.messageLength128=[];for(var u=o.messageLengthSize/4,c=0;c>>0,l>>>0];for(var f=o.fullMessageLength.length-1;f>=0;--f)o.fullMessageLength[f]+=l[1],l[1]=l[0]+(o.fullMessageLength[f]/4294967296>>>0),o.fullMessageLength[f]=o.fullMessageLength[f]>>>0,l[0]=l[1]/4294967296>>>0;return r.putBytes(u),Rc(n,a,r),(r.read>2048||r.length()===0)&&r.compact(),o},o.digest=function(){var u=Ce.util.createBuffer();u.putBytes(r.bytes());var c=o.fullMessageLength[o.fullMessageLength.length-1]+o.messageLengthSize,l=c&o.blockLength-1;u.putBytes(Ds.substr(0,o.blockLength-l));for(var f,d,v=o.fullMessageLength[0]*8,p=0;p>>0,v+=d,u.putInt32(v>>>0),v=f>>>0;u.putInt32(v);for(var g=new Array(n.length),p=0;p=128;){for(de=0;de<16;++de)t[de][0]=n.getInt32()>>>0,t[de][1]=n.getInt32()>>>0;for(;de<80;++de)gr=t[de-2],Te=gr[0],K=gr[1],r=((Te>>>19|K<<13)^(K>>>29|Te<<3)^Te>>>6)>>>0,a=((Te<<13|K>>>19)^(K<<3|Te>>>29)^(Te<<26|K>>>6))>>>0,we=t[de-15],Te=we[0],K=we[1],i=((Te>>>1|K<<31)^(Te>>>8|K<<24)^Te>>>7)>>>0,s=((Te<<31|K>>>1)^(Te<<24|K>>>8)^(Te<<25|K>>>7))>>>0,Rr=t[de-7],Ie=t[de-16],K=a+Rr[1]+s+Ie[1],t[de][0]=r+Rr[0]+i+Ie[0]+(K/4294967296>>>0)>>>0,t[de][1]=K>>>0;for(g=e[0][0],x=e[0][1],b=e[1][0],w=e[1][1],A=e[2][0],D=e[2][1],k=e[3][0],L=e[3][1],z=e[4][0],Z=e[4][1],le=e[5][0],fe=e[5][1],he=e[6][0],ve=e[6][1],$e=e[7][0],ht=e[7][1],de=0;de<80;++de)c=((z>>>14|Z<<18)^(z>>>18|Z<<14)^(Z>>>9|z<<23))>>>0,l=((z<<18|Z>>>14)^(z<<14|Z>>>18)^(Z<<23|z>>>9))>>>0,f=(he^z&(le^he))>>>0,d=(ve^Z&(fe^ve))>>>0,o=((g>>>28|x<<4)^(x>>>2|g<<30)^(x>>>7|g<<25))>>>0,u=((g<<4|x>>>28)^(x<<30|g>>>2)^(x<<25|g>>>7))>>>0,v=(g&b|A&(g^b))>>>0,p=(x&w|D&(x^w))>>>0,K=ht+l+d+Ps[de][1]+t[de][1],r=$e+c+f+Ps[de][0]+t[de][0]+(K/4294967296>>>0)>>>0,a=K>>>0,K=u+p,i=o+v+(K/4294967296>>>0)>>>0,s=K>>>0,$e=he,ht=ve,he=le,ve=fe,le=z,fe=Z,K=L+a,z=k+r+(K/4294967296>>>0)>>>0,Z=K>>>0,k=A,L=D,A=b,D=w,b=g,w=x,K=a+s,g=r+i+(K/4294967296>>>0)>>>0,x=K>>>0;K=e[0][1]+x,e[0][0]=e[0][0]+g+(K/4294967296>>>0)>>>0,e[0][1]=K>>>0,K=e[1][1]+w,e[1][0]=e[1][0]+b+(K/4294967296>>>0)>>>0,e[1][1]=K>>>0,K=e[2][1]+D,e[2][0]=e[2][0]+A+(K/4294967296>>>0)>>>0,e[2][1]=K>>>0,K=e[3][1]+L,e[3][0]=e[3][0]+k+(K/4294967296>>>0)>>>0,e[3][1]=K>>>0,K=e[4][1]+Z,e[4][0]=e[4][0]+z+(K/4294967296>>>0)>>>0,e[4][1]=K>>>0,K=e[5][1]+fe,e[5][0]=e[5][0]+le+(K/4294967296>>>0)>>>0,e[5][1]=K>>>0,K=e[6][1]+ve,e[6][0]=e[6][0]+he+(K/4294967296>>>0)>>>0,e[6][1]=K>>>0,K=e[7][1]+ht,e[7][0]=e[7][0]+$e+(K/4294967296>>>0)>>>0,e[7][1]=K>>>0,Re-=128}}});var Dc=j(Os=>{var Ly=X();It();var De=Ly.asn1;Os.privateKeyValidator={name:"PrivateKeyInfo",tagClass:De.Class.UNIVERSAL,type:De.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:De.Class.UNIVERSAL,type:De.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:De.Class.UNIVERSAL,type:De.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:De.Class.UNIVERSAL,type:De.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:De.Class.UNIVERSAL,type:De.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]};Os.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:De.Class.UNIVERSAL,type:De.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:De.Class.UNIVERSAL,type:De.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:De.Class.UNIVERSAL,type:De.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:De.Class.UNIVERSAL,type:De.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}});var jc=j((fC,zc)=>{var Ve=X();Un();vt();Us();se();var Mc=Dc(),Dy=Mc.publicKeyValidator,Py=Mc.privateKeyValidator;typeof Pc>"u"&&(Pc=Ve.jsbn.BigInteger);var Pc,Ms=Ve.util.ByteBuffer,lt=typeof Buffer>"u"?Uint8Array:Buffer;Ve.pki=Ve.pki||{};zc.exports=Ve.pki.ed25519=Ve.ed25519=Ve.ed25519||{};var re=Ve.ed25519;re.constants={};re.constants.PUBLIC_KEY_BYTE_LENGTH=32;re.constants.PRIVATE_KEY_BYTE_LENGTH=64;re.constants.SEED_BYTE_LENGTH=32;re.constants.SIGN_BYTE_LENGTH=64;re.constants.HASH_BYTE_LENGTH=64;re.generateKeyPair=function(e){e=e||{};var t=e.seed;if(t===void 0)t=Ve.random.getBytesSync(re.constants.SEED_BYTE_LENGTH);else if(typeof t=="string"){if(t.length!==re.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+re.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(t instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');t=Zt({message:t,encoding:"binary"});for(var n=new lt(re.constants.PUBLIC_KEY_BYTE_LENGTH),r=new lt(re.constants.PRIVATE_KEY_BYTE_LENGTH),a=0;a<32;++a)r[a]=t[a];return Fy(n,r),{publicKey:n,privateKey:r}};re.privateKeyFromAsn1=function(e){var t={},n=[],r=Ve.asn1.validate(e,Py,t,n);if(!r){var a=new Error("Invalid Key.");throw a.errors=n,a}var i=Ve.asn1.derToOid(t.privateKeyOid),s=Ve.oids.EdDSA25519;if(i!==s)throw new Error('Invalid OID "'+i+'"; OID must be "'+s+'".');var o=t.privateKey,u=Zt({message:Ve.asn1.fromDer(o).value,encoding:"binary"});return{privateKeyBytes:u}};re.publicKeyFromAsn1=function(e){var t={},n=[],r=Ve.asn1.validate(e,Dy,t,n);if(!r){var a=new Error("Invalid Key.");throw a.errors=n,a}var i=Ve.asn1.derToOid(t.publicKeyOid),s=Ve.oids.EdDSA25519;if(i!==s)throw new Error('Invalid OID "'+i+'"; OID must be "'+s+'".');var o=t.ed25519PublicKey;if(o.length!==re.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return Zt({message:o,encoding:"binary"})};re.publicKeyFromPrivateKey=function(e){e=e||{};var t=Zt({message:e.privateKey,encoding:"binary"});if(t.length!==re.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+re.constants.PRIVATE_KEY_BYTE_LENGTH);for(var n=new lt(re.constants.PUBLIC_KEY_BYTE_LENGTH),r=0;r=0};function Zt(e){var t=e.message;if(t instanceof Uint8Array||t instanceof lt)return t;var n=e.encoding;if(t===void 0)if(e.md)t=e.md.digest().getBytes(),n="binary";else throw new TypeError('"options.message" or "options.md" not specified.');if(typeof t=="string"&&!n)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if(typeof t=="string"){if(typeof Buffer<"u")return Buffer.from(t,n);t=new Ms(t,n)}else if(!(t instanceof Ms))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var r=new lt(t.length()),a=0;a=32;--r){for(n=0,a=r-32,i=r-12;a>8,t[a]-=n*256;t[a]+=n,t[r]=0}for(n=0,a=0;a<32;++a)t[a]+=n-(t[31]>>4)*Vs[a],n=t[a]>>8,t[a]&=255;for(a=0;a<32;++a)t[a]-=n*Vs[a];for(r=0;r<32;++r)t[r+1]+=t[r]>>8,e[r]=t[r]&255}function qs(e){for(var t=new Float64Array(64),n=0;n<64;++n)t[n]=e[n],e[n]=0;Kc(e,t)}function Hs(e,t){var n=G(),r=G(),a=G(),i=G(),s=G(),o=G(),u=G(),c=G(),l=G();rn(n,e[1],e[0]),rn(l,t[1],t[0]),pe(n,n,l),tn(r,e[0],e[1]),tn(l,t[0],t[1]),pe(r,r,l),pe(a,e[3],t[3]),pe(a,a,Oy),pe(i,e[2],t[2]),tn(i,i,i),rn(s,r,n),rn(o,i,a),tn(u,i,a),tn(c,r,n),pe(e[0],s,o),pe(e[1],c,u),pe(e[2],u,o),pe(e[3],s,c)}function Vc(e,t,n){for(var r=0;r<4;++r)Wc(e[r],t[r],n)}function Gs(e,t){var n=G(),r=G(),a=G();zy(a,t[2]),pe(n,t[0],a),pe(r,t[1],a),Ka(e,r),e[31]^=Hc(n)<<7}function Ka(e,t){var n,r,a,i=G(),s=G();for(n=0;n<16;++n)s[n]=t[n];for(Fs(s),Fs(s),Fs(s),r=0;r<2;++r){for(i[0]=s[0]-65517,n=1;n<15;++n)i[n]=s[n]-65535-(i[n-1]>>16&1),i[n-1]&=65535;i[15]=s[15]-32767-(i[14]>>16&1),a=i[15]>>16&1,i[14]&=65535,Wc(s,i,1-a)}for(n=0;n<16;n++)e[2*n]=s[n]&255,e[2*n+1]=s[n]>>8}function qy(e,t){var n=G(),r=G(),a=G(),i=G(),s=G(),o=G(),u=G();return vr(e[2],Ma),Hy(e[1],t),Br(a,e[1]),pe(i,a,Uy),rn(a,a,e[2]),tn(i,e[2],i),Br(s,i),Br(o,s),pe(u,o,s),pe(n,u,a),pe(n,n,i),Gy(n,n),pe(n,n,a),pe(n,n,i),pe(n,n,i),pe(e[0],n,i),Br(r,e[0]),pe(r,r,i),Fc(r,a)&&pe(e[0],e[0],Vy),Br(r,e[0]),pe(r,r,i),Fc(r,a)?-1:(Hc(e[0])===t[31]>>7&&rn(e[0],Ks,e[0]),pe(e[3],e[0],e[1]),0)}function Hy(e,t){var n;for(n=0;n<16;++n)e[n]=t[2*n]+(t[2*n+1]<<8);e[15]&=32767}function Gy(e,t){var n=G(),r;for(r=0;r<16;++r)n[r]=t[r];for(r=250;r>=0;--r)Br(n,n),r!==1&&pe(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}function Fc(e,t){var n=new lt(32),r=new lt(32);return Ka(n,e),Ka(r,t),qc(n,0,r,0)}function qc(e,t,n,r){return Wy(e,t,n,r,32)}function Wy(e,t,n,r,a){var i,s=0;for(i=0;i>>8)-1}function Hc(e){var t=new lt(32);return Ka(t,e),t[0]&1}function Gc(e,t,n){var r,a;for(vr(e[0],Ks),vr(e[1],Ma),vr(e[2],Ma),vr(e[3],Ks),a=255;a>=0;--a)r=n[a/8|0]>>(a&7)&1,Vc(e,t,r),Hs(t,e),Hs(e,e),Vc(e,t,r)}function Ws(e,t){var n=[G(),G(),G(),G()];vr(n[0],Uc),vr(n[1],Oc),vr(n[2],Ma),pe(n[3],Uc,Oc),Gc(e,n,t)}function vr(e,t){var n;for(n=0;n<16;n++)e[n]=t[n]|0}function zy(e,t){var n=G(),r;for(r=0;r<16;++r)n[r]=t[r];for(r=253;r>=0;--r)Br(n,n),r!==2&&r!==4&&pe(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}function Fs(e){var t,n,r=1;for(t=0;t<16;++t)n=e[t]+r+65535,r=Math.floor(n/65536),e[t]=n-r*65536;e[0]+=r-1+37*(r-1)}function Wc(e,t,n){for(var r,a=~(n-1),i=0;i<16;++i)r=a&(e[i]^t[i]),e[i]^=r,t[i]^=r}function G(e){var t,n=new Float64Array(16);if(e)for(t=0;t{var pt=X();se();vt();Un();Xc.exports=pt.kem=pt.kem||{};var Yc=pt.jsbn.BigInteger;pt.kem.rsa={};pt.kem.rsa.create=function(e,t){t=t||{};var n=t.prng||pt.random,r={};return r.encrypt=function(a,i){var s=Math.ceil(a.n.bitLength()/8),o;do o=new Yc(pt.util.bytesToHex(n.getBytesSync(s)),16).mod(a.n);while(o.compareTo(Yc.ONE)<=0);o=pt.util.hexToBytes(o.toString(16));var u=s-o.length;u>0&&(o=pt.util.fillString(String.fromCharCode(0),u)+o);var c=a.encrypt(o,"NONE"),l=e.generate(o,i);return{encapsulation:c,key:l}},r.decrypt=function(a,i,s){var o=a.decrypt(i,"NONE");return e.generate(o,s)},r};pt.kem.kdf1=function(e,t){Qc(this,e,0,t||e.digestLength)};pt.kem.kdf2=function(e,t){Qc(this,e,1,t||e.digestLength)};function Qc(e,t,n,r){e.generate=function(a,i){for(var s=new pt.util.ByteBuffer,o=Math.ceil(i/r)+n,u=new pt.util.ByteBuffer,c=n;c{var ne=X();se();el.exports=ne.log=ne.log||{};ne.log.levels=["none","error","warning","info","debug","verbose","max"];var qa={},Ys=[],Hn=null;ne.log.LEVEL_LOCKED=1<<1;ne.log.NO_LEVEL_CHECK=1<<2;ne.log.INTERPOLATE=1<<3;for(Mt=0;Mt"u"||t?e.flags|=ne.log.LEVEL_LOCKED:e.flags&=~ne.log.LEVEL_LOCKED};ne.log.addLogger=function(e){Ys.push(e)};typeof console<"u"&&"log"in console?(console.error&&console.warn&&console.info&&console.debug?(Jc={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},Gn=function(e,t){ne.log.prepareStandard(t);var n=Jc[t.level],r=[t.standard];r=r.concat(t.arguments.slice()),n.apply(console,r)},nn=ne.log.makeLogger(Gn)):(Gn=function(t,n){ne.log.prepareStandardFull(n),console.log(n.standardFull)},nn=ne.log.makeLogger(Gn)),ne.log.setLevel(nn,"debug"),ne.log.addLogger(nn),Hn=nn):console={log:function(){}};var nn,Jc,Gn;Hn!==null&&typeof window<"u"&&window.location&&(qn=new URL(window.location.href).searchParams,qn.has("console.level")&&ne.log.setLevel(Hn,qn.get("console.level").slice(-1)[0]),qn.has("console.lock")&&($c=qn.get("console.lock").slice(-1)[0],$c=="true"&&ne.log.lock(Hn)));var qn,$c;ne.log.consoleLogger=Hn});var nl=j((hC,rl)=>{rl.exports=kt();Ca();Xr();os();Us()});var sl=j((mC,il)=>{var U=X();cr();It();Dn();lr();Er();Es();vt();se();Pa();var E=U.asn1,ut=il.exports=U.pkcs7=U.pkcs7||{};ut.messageFromPem=function(e){var t=U.pem.decode(e)[0];if(t.type!=="PKCS7"){var n=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw n.headerType=t.type,n}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var r=E.fromDer(t.body);return ut.messageFromAsn1(r)};ut.messageToPem=function(e,t){var n={type:"PKCS7",body:E.toDer(e.toAsn1()).getBytes()};return U.pem.encode(n,{maxline:t})};ut.messageFromAsn1=function(e){var t={},n=[];if(!E.validate(e,ut.asn1.contentInfoValidator,t,n)){var r=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw r.errors=n,r}var a=E.derToOid(t.contentType),i;switch(a){case U.pki.oids.envelopedData:i=ut.createEnvelopedData();break;case U.pki.oids.encryptedData:i=ut.createEncryptedData();break;case U.pki.oids.signedData:i=ut.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+a+" is not (yet) supported.")}return i.fromAsn1(t.content.value[0]),i};ut.createSignedData=function(){var e=null;return e={type:U.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(r){if(Xs(e,r,ut.asn1.signedDataValidator),e.certificates=[],e.crls=[],e.digestAlgorithmIdentifiers=[],e.contentInfo=null,e.signerInfos=[],e.rawCapture.certificates)for(var a=e.rawCapture.certificates.value,i=0;i0&&s.value[0].value.push(E.create(E.Class.CONTEXT_SPECIFIC,0,!0,r)),i.length>0&&s.value[0].value.push(E.create(E.Class.CONTEXT_SPECIFIC,1,!0,i)),s.value[0].value.push(E.create(E.Class.UNIVERSAL,E.Type.SET,!0,e.signerInfos)),E.create(E.Class.UNIVERSAL,E.Type.SEQUENCE,!0,[E.create(E.Class.UNIVERSAL,E.Type.OID,!1,E.oidToDer(e.type).getBytes()),s])},addSigner:function(r){var a=r.issuer,i=r.serialNumber;if(r.certificate){var s=r.certificate;typeof s=="string"&&(s=U.pki.certificateFromPem(s)),a=s.issuer.attributes,i=s.serialNumber}var o=r.key;if(!o)throw new Error("Could not add PKCS#7 signer; no private key specified.");typeof o=="string"&&(o=U.pki.privateKeyFromPem(o));var u=r.digestAlgorithm||U.pki.oids.sha1;switch(u){case U.pki.oids.sha1:case U.pki.oids.sha256:case U.pki.oids.sha384:case U.pki.oids.sha512:case U.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+u)}var c=r.authenticatedAttributes||[];if(c.length>0){for(var l=!1,f=!1,d=0;d0){for(var n=E.create(E.Class.CONTEXT_SPECIFIC,1,!0,[]),r=0;r=n&&a{var _e=X();cr();zr();Ca();Xr();se();var Ga=ol.exports=_e.ssh=_e.ssh||{};Ga.privateKeyToPutty=function(e,t,n){n=n||"",t=t||"";var r="ssh-rsa",a=t===""?"none":"aes256-cbc",i="PuTTY-User-Key-File-2: "+r+`\r
`;i+="Encryption: "+a+`\r
`,i+="Comment: "+n+`\r
`;var s=_e.util.createBuffer();an(s,r),Kt(s,e.e),Kt(s,e.n);var o=_e.util.encode64(s.bytes(),64),u=Math.floor(o.length/66)+1;i+="Public-Lines: "+u+`\r
`,i+=o;var c=_e.util.createBuffer();Kt(c,e.d),Kt(c,e.p),Kt(c,e.q),Kt(c,e.qInv);var l;if(!t)l=_e.util.encode64(c.bytes(),64);else{var f=c.length()+16-1;f-=f%16;var d=Ha(c.bytes());d.truncate(d.length()-f+c.length()),c.putBuffer(d);var v=_e.util.createBuffer();v.putBuffer(Ha("\0\0\0\0",t)),v.putBuffer(Ha("\0\0\0",t));var p=_e.aes.createEncryptionCipher(v.truncate(8),"CBC");p.start(_e.util.createBuffer().fillWithByte(0,16)),p.update(c.copy()),p.finish();var g=p.output;g.truncate(16),l=_e.util.encode64(g.bytes(),64)}u=Math.floor(l.length/66)+1,i+=`\r
Private-Lines: `+u+`\r
`,i+=l;var x=Ha("putty-private-key-file-mac-key",t),b=_e.util.createBuffer();an(b,r),an(b,a),an(b,n),b.putInt32(s.length()),b.putBuffer(s),b.putInt32(c.length()),b.putBuffer(c);var w=_e.hmac.create();return w.start("sha1",x),w.update(b.bytes()),i+=`\r
Private-MAC: `+w.digest().toHex()+`\r
`,i};Ga.publicKeyToOpenSSH=function(e,t){var n="ssh-rsa";t=t||"";var r=_e.util.createBuffer();return an(r,n),Kt(r,e.e),Kt(r,e.n),n+" "+_e.util.encode64(r.bytes())+" "+t};Ga.privateKeyToOpenSSH=function(e,t){return t?_e.pki.encryptRsaPrivateKey(e,t,{legacy:!0,algorithm:"aes128"}):_e.pki.privateKeyToPem(e)};Ga.getPublicKeyFingerprint=function(e,t){t=t||{};var n=t.md||_e.md.md5.create(),r="ssh-rsa",a=_e.util.createBuffer();an(a,r),Kt(a,e.e),Kt(a,e.n),n.start(),n.update(a.getBytes());var i=n.digest();if(t.encoding==="hex"){var s=i.toHex();return t.delimiter?s.match(/.{2}/g).join(t.delimiter):s}else{if(t.encoding==="binary")return i.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".')}return i};function Kt(e,t){var n=t.toString(16);n[0]>="8"&&(n="00"+n);var r=_e.util.hexToBytes(n);e.putInt32(r.length),e.putBytes(r)}function an(e,t){e.putInt32(t.length),e.putString(t)}function Ha(){for(var e=_e.md.sha1.create(),t=arguments.length,n=0;n{cl.exports=X();cr();_c();It();pa();Dn();jc();zr();Zc();tl();nl();bs();wa();Er();ys();ws();sl();As();gs();us();ka();vt();fs();ul();Ls();se()});var Bt,sn,fl=F(()=>{Bt=_l(ll());xn();sn=class{static async encrypt(t){let n=Gt()?.pk;if(n)try{let r=Bt.default.pki.publicKeyFromPem(n),a=Bt.default.random.getBytesSync(32),i=Bt.default.cipher.createCipher("AES-GCM",a),s=Bt.default.random.getBytesSync(12);i.start({iv:s}),i.update(Bt.default.util.createBuffer(JSON.stringify(t),"utf8")),i.finish();let o=i.output.bytes(),u=i.mode.tag.bytes(),c=r.encrypt(a,"RSA-OAEP",{md:Bt.default.md.sha256.create()});return{k:Bt.default.util.encode64(c),i:Bt.default.util.encode64(s),c:Bt.default.util.encode64(o),t:Bt.default.util.encode64(u)}}catch(r){throw console.error("Encryption failed:",r),new Error("Failed to encrypt data.")}else return JSON.stringify(t)}static secureEnv(){return Boolean(window.crypto?.subtle)}}});var Jt,dl=F(()=>{o0();xn();Cn();Bi();H0();Y0();ji();fl();Or.defaults.withCredentials=!0;Jt=class{static async formatRequest(t,n){try{if(sn.secureEnv()){t=`s_${t}`;let r=await sn.encrypt(n);return JSON.stringify({type:t,data:r})}}catch{}return JSON.stringify({type:t,data:n})}static async post(t,n,r,a){try{let i=Gt()?.api?.baseUrl;if(!i)throw console.error("Internal honeypot error: missing base url"),new Error("Missing base URL");let s=`${i}${t}`,o={identity:En.getIdentity(),identities:En.getIdentities()};try{o={...o,...await ir.get()}}catch{}let u=!navigator.geolocation.getCurrentPosition.toString().includes("[native code]")||window?.geoLocationStorage!==void 0,c=a||[];u&&c.push("blsf");let l={};try{l=await j0.detect()}catch{}let f={...r,...o,library_version:fa,ctags:c,cbt:l},d=await Jt.formatRequest(n,f);return(await Or.post(s,d,{headers:{"Content-Type":"application/json;charset=UTF-8"}})).data}catch(i){throw Nt.addError("Failed to communicate with the backend server"),Jt.postError(i),i}}static async postError(t){try{let r=Gt()?.api?.routes?.errors;if(!r)return;let a=await Jt.formatRequest("error",{message:t}),i=await Or.post(r,a,{headers:{"Content-Type":"application/json;charset=UTF-8"}})}catch{console.error("error HP10002")}}}});var Wa,Zs=F(()=>{Wa=(e,t,n,r)=>{let a=0,i=s=>{try{let o=new URLSearchParams(window.location.search).has("hpdebug");(r?.debug===!0||o)&&console.log(`[hp] ${s}`)}catch{}};return{name:"honeypot-enrichment",type:"before",setup:async s=>{try{s.userId&&(r?.trackIdentities?(i(`setting user_id: ${s.userId}`),await n(s.userId)):i(`ignoring user_id since trackIdentities is set to false: ${s.userId}`))}catch{}let o=await t();i(`initialized plugin. honey=${JSON.stringify(o)}`)},execute:async s=>{try{let{user_id:o,event_type:u}=s;try{o&&(r?.trackIdentities?(i(`processing identify event: ${o}`),await n(o)):i(`ignoring identify event since trackIdentities is set to false: ${o}`))}catch{}let l=u.startsWith("[Amplitude] ")?u.replace("[Amplitude] ",""):u;a=a+1;let f=!1;if(r?.excludeEvents?.includes(l)||r?.includeEvents?.length&&!r?.includeEvents.includes(l)){if(r?.enrichEventProperties){let p={ignored:!0};s.event_properties={...s.event_properties,honey:p}}return i(`ignoring event: ${u}`),s}f||(i(`tracking event: ${u}`),await e(u,s.event_properties));let v=await t();return v?.geofenced&&v?.redirect_auto?(i(`dropping event: ${u}`),null):(r?.enrichEventProperties&&(s.event_properties={...s.event_properties,honey:v},i(`enriching event: ${u}. ${JSON.stringify(s.event_properties)}`)),s)}catch{return s}}}}});var Js,ev,pl=F(()=>{Zs();Js=class{constructor(){this.config=null;this.honey=null;this.id=[];this.q=[];this.didInit=!1;this.didLoad=!1;this.callbacks={};this.geofenced=!1}setup(t){this.config=t}amplitudePlugin(t){return Wa(this.track.bind(this),this.get.bind(this),this.identify.bind(this),t)}geofence(){window.honeypot?.geofence&&window.honeypot.geofence(),this.geofenced=!0}ensureHoneypot(){window.honeypot||(window.honeypot={q:[],id:[]})}async identify(t,n,r){if(this.ensureHoneypot(),window.honeypot?.identify)window.honeypot.identify(t,n,r);else{let a={id:t,...n?{properties:n}:{},...r?{type:r}:{}};Array.isArray(window.honeypot.id)||(window.honeypot.id=[]),window.honeypot.id.push(a)}}on(t,n){this.ensureHoneypot(),window.honeypot.on?window.honeypot.on(t,n):(window.honeypot.callbacks[t]??=[]).push(n)}async flow(t,n){return this.ensureHoneypot(),new Promise((r,a)=>{let i=Date.now(),s=()=>{window&&window.honeypot&&this.didInit?r(window.honeypot.flow(t,n)):Date.now()-i>=5e3?a(new Error("Flow could not be created. Did you call the load() method first?")):setTimeout(s,100)};s()})}async track(t,n={}){this.ensureHoneypot();try{if(window.honeypot?.track)window.honeypot.track(t,n);else{let r=this.q||[];r.push([t,n]),this.q=r}}catch(r){this.config?.debug&&console.error("Error tracking event:",r)}}async init(){}maybeTime(t,n){if(this.config?.debug){if(n){console.timeEnd(t);return}console.time(t)}}load(t,n,r){return this.didLoad=!0,new Promise(a=>{let i=document.createElement("script");i.async=!0;let s=new URL(t),o=null,u=null;try{o=window.location.href}catch{}try{u=document.title}catch{}s.searchParams.append("url",o||"URL not available"),s.searchParams.append("title",u||"Title not available");try{if(window.honeypot&&Array.isArray(window.honeypot.q)){let f=window.honeypot.q.map(d=>d[0]);s.searchParams.append("events",JSON.stringify(f))}}catch(f){this.config?.debug&&console.error("Error appending event names to the script URL:",f)}try{let f=["hpdebug","hpgeotest"],d=new URLSearchParams(window.location.search);f.forEach(v=>{d.has(v)&&s.searchParams.append(v,d.get(v)||"")})}catch{}n&&(s.searchParams.append("identity",n),r&&s.searchParams.append("type",r));let c=new URLSearchParams(window.location.search).get("georef");c&&s.searchParams.append("georef",c),this.maybeTime("load honeypot");try{let f=window?.honeypot?.id;if(f){let d=null;Array.isArray(f)&&f.length>0?d=f[0]?.id:d=f?.id,d&&s.searchParams.append("identity",d)}}catch{}i.src=s.toString(),document.head.appendChild(i);let l=this.config;i.onload=()=>{this.didInit=!0,this.maybeTime("load honeypot",!0);try{window.honeypot&&(window.honeypot.config=l)}catch{}a(window.honeypot)}})}async get(){if(!this.didLoad&&this.config?.url)try{if(await this.load(this.config.url),window.honeypot)return window.honeypot.get()}catch{throw new Error("Failed to load")}else if(this.didLoad&&!this.didInit)return new Promise((t,n)=>{let r=Date.now(),a=()=>{window.honeypot&&window.honeypot.get?t(window.honeypot.get()):Date.now()-r>=2e3?n(new Error("Timeout: Honeypot SDK did not initialize in time.")):setTimeout(a,50)};a()});return new Promise((t,n)=>{(()=>{if(window.honeypot&&window.honeypot.honey)t(window.honeypot.honey);else{if(window.honeypot?.get)return window.honeypot.get();n(new Error("Honey not found"))}})()})}},ev=new Js});var Wn,hl=F(()=>{Zs();Wn=class{amplitudePlugin(t){return Wa(this.track.bind(this),this.get.bind(this),this.identify.bind(this),t)}}});var ml=F(()=>{pl();hl()});var _t,yl=F(()=>{_t=class{static sleep(t){return new Promise(n=>setTimeout(n,t))}static isConstantLike(t){return typeof t=="string"&&!t.match(/[^A-Z0-9_x]/)}static getConstantsFromPrototype(t){return Object.keys(t.__proto__).filter(_t.isConstantLike)}static recur(t,n=new WeakSet,r=!1){if(n.has(t))return{};try{n.add(t)}catch{}var a=r?[]:{};for(var i in t)try{let s;if(i==="enabledPlugin"||typeof t[i]=="function")continue;Array.isArray(t[i])?typeof t[i][0]=="object"?(s=_t.recur(t[i],n,!0),a[i]=s.length?s:t[i]):a[i]=t[i]:typeof t[i]=="object"?(s=_t.recur(t[i],n),Object.keys(s).length&&(a[i]=s)):r?a.push(t[i]):a[i]=t[i]}catch{}return a}static isValidUrlOrPath(t){try{if(!t)return!1;if(t.startsWith("/"))return!0;if(t.startsWith("http://")||t.startsWith("https://"))return new URL(t),!0}catch{return!1}return!1}static onRedirectPage(t){if(!_t.isValidUrlOrPath(t))return!1;var n=t===window.location.pathname;if(!n)try{n=new URL(t,window.location.origin).href===window.location.href}catch{}return n}}});var vl,gl=F(()=>{vl=`
/* Base styles */
.nicebox {
color: black;
width: 100%;
font-family: 'Raleway', 'Helvetica Neue', Arial, sans-serif;
font-size: 1.2em;
height: 100%;
line-height: 2em;
top: 0;
left: 0;
position: fixed;
display: flex;
align-items: center;
justify-content: center;
pointer-events: none;
z-index: 1000;
}
.nicebox a, .nicebox button {
color: #74716D;
text-decoration: none;
outline: none;
}
.nicebox a:hover, .nicebox a:focus {
color: #c94e50;
outline: none;
}
.nicebox__title {
font-size: 1.5em;
line-height: 2.5em;
}
.nicebox button {
cursor: pointer;
font-size: 1.2em;
padding: 0.6em 1.2em;
outline: none;
border: none;
color: #fff;
background: #c94e50;
position:relative;
}
.nicebox__overlay {
position: absolute;
z-index: 1;
background: rgba(55, 58, 71, 0.9);
width: 100%;
height: 100%;
top: 0;
left: 0;
opacity: 0;
transition: opacity 0.3s ease-in-out;
}
.nicebox--open .nicebox__overlay {
opacity: 1;
pointer-events: auto;
}
.nicebox__content {
width: 50%;
max-width: 560px;
min-width: 290px;
background: #fff;
padding: 2em 3em;
text-align: center;
position: relative;
z-index: 5;
opacity: 0;
transform: scale(0.9);
transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}
.nicebox--open .nicebox__content {
opacity: 1;
transform: scale(1);
pointer-events: auto;
}
.nicebox__buttons {
cursor: pointer;
display: flex;
gap: 10px;
margin-top: 20px;
justify-content: center;
}
/* fancy animation */
.nicebox.fancy.nicebox--open .nicebox__content,
.nicebox.fancy.nicebox--close .nicebox__content {
-webkit-animation-duration: 1s;
animation-duration: 1s;
-webkit-animation-timing-function: linear;
animation-timing-function: linear;
-webkit-animation-fill-mode: forwards;
animation-fill-mode: forwards;
}
.nicebox.fancy.nicebox--open .nicebox__content {
-webkit-animation-name: fancy-anim-open;
animation-name: fancy-anim-open;
}
.nicebox.fancy.nicebox--close .nicebox__content {
-webkit-animation-name: fancy-anim-close;
animation-name: fancy-anim-close;
-webkit-animation-duration: 0.3s;
animation-duration: 0.3s;
-webkit-animation-timing-function: ease-out;
animation-timing-function: ease-out;
}
@-webkit-keyframes fancy-anim-open {
0% { opacity: 0; -webkit-transform: matrix3d(0.7, 0, 0, 0, 0, 0.7, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.7, 0, 0, 0, 0, 0.7, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
2.083333% { -webkit-transform: matrix3d(0.75266, 0, 0, 0, 0, 0.76342, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.75266, 0, 0, 0, 0, 0.76342, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
4.166667% { -webkit-transform: matrix3d(0.81071, 0, 0, 0, 0, 0.84545, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.81071, 0, 0, 0, 0, 0.84545, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
6.25% { -webkit-transform: matrix3d(0.86808, 0, 0, 0, 0, 0.9286, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.86808, 0, 0, 0, 0, 0.9286, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
8.333333% { -webkit-transform: matrix3d(0.92038, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.92038, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
10.416667% { -webkit-transform: matrix3d(0.96482, 0, 0, 0, 0, 1.05202, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.96482, 0, 0, 0, 0, 1.05202, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
12.5% { -webkit-transform: matrix3d(1, 0, 0, 0, 0, 1.08204, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1, 0, 0, 0, 0, 1.08204, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
14.583333% { -webkit-transform: matrix3d(1.02563, 0, 0, 0, 0, 1.09149, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.02563, 0, 0, 0, 0, 1.09149, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
16.666667% { -webkit-transform: matrix3d(1.04227, 0, 0, 0, 0, 1.08453, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.04227, 0, 0, 0, 0, 1.08453, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
18.75% { -webkit-transform: matrix3d(1.05102, 0, 0, 0, 0, 1.06666, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.05102, 0, 0, 0, 0, 1.06666, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
20.833333% { -webkit-transform: matrix3d(1.05334, 0, 0, 0, 0, 1.04355, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.05334, 0, 0, 0, 0, 1.04355, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
22.916667% { -webkit-transform: matrix3d(1.05078, 0, 0, 0, 0, 1.02012, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.05078, 0, 0, 0, 0, 1.02012, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
25% { -webkit-transform: matrix3d(1.04487, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.04487, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
27.083333% { -webkit-transform: matrix3d(1.03699, 0, 0, 0, 0, 0.98534, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.03699, 0, 0, 0, 0, 0.98534, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
29.166667% { -webkit-transform: matrix3d(1.02831, 0, 0, 0, 0, 0.97688, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.02831, 0, 0, 0, 0, 0.97688, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
31.25% { -webkit-transform: matrix3d(1.01973, 0, 0, 0, 0, 0.97422, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.01973, 0, 0, 0, 0, 0.97422, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
33.333333% { -webkit-transform: matrix3d(1.01191, 0, 0, 0, 0, 0.97618, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.01191, 0, 0, 0, 0, 0.97618, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
35.416667% { -webkit-transform: matrix3d(1.00526, 0, 0, 0, 0, 0.98122, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.00526, 0, 0, 0, 0, 0.98122, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
37.5% { -webkit-transform: matrix3d(1, 0, 0, 0, 0, 0.98773, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1, 0, 0, 0, 0, 0.98773, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
39.583333% { -webkit-transform: matrix3d(0.99617, 0, 0, 0, 0, 0.99433, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.99617, 0, 0, 0, 0, 0.99433, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
41.666667% { -webkit-transform: matrix3d(0.99368, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.99368, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
43.75% { -webkit-transform: matrix3d(0.99237, 0, 0, 0, 0, 1.00413, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.99237, 0, 0, 0, 0, 1.00413, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
45.833333% { -webkit-transform: matrix3d(0.99202, 0, 0, 0, 0, 1.00651, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.99202, 0, 0, 0, 0, 1.00651, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
47.916667% { -webkit-transform: matrix3d(0.99241, 0, 0, 0, 0, 1.00726, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.99241, 0, 0, 0, 0, 1.00726, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
50% { opacity: 1; -webkit-transform: matrix3d(0.99329, 0, 0, 0, 0, 1.00671, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.99329, 0, 0, 0, 0, 1.00671, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
52.083333% { -webkit-transform: matrix3d(0.99447, 0, 0, 0, 0, 1.00529, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.99447, 0, 0, 0, 0, 1.00529, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
54.166667% { -webkit-transform: matrix3d(0.99577, 0, 0, 0, 0, 1.00346, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.99577, 0, 0, 0, 0, 1.00346, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
56.25% { -webkit-transform: matrix3d(0.99705, 0, 0, 0, 0, 1.0016, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.99705, 0, 0, 0, 0, 1.0016, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
58.333333% { -webkit-transform: matrix3d(0.99822, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.99822, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
60.416667% { -webkit-transform: matrix3d(0.99921, 0, 0, 0, 0, 0.99884, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.99921, 0, 0, 0, 0, 0.99884, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
62.5% { -webkit-transform: matrix3d(1, 0, 0, 0, 0, 0.99816, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1, 0, 0, 0, 0, 0.99816, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
64.583333% { -webkit-transform: matrix3d(1.00057, 0, 0, 0, 0, 0.99795, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.00057, 0, 0, 0, 0, 0.99795, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
66.666667% { -webkit-transform: matrix3d(1.00095, 0, 0, 0, 0, 0.99811, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.00095, 0, 0, 0, 0, 0.99811, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
68.75% { -webkit-transform: matrix3d(1.00114, 0, 0, 0, 0, 0.99851, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.00114, 0, 0, 0, 0, 0.99851, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
70.833333% { -webkit-transform: matrix3d(1.00119, 0, 0, 0, 0, 0.99903, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.00119, 0, 0, 0, 0, 0.99903, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
72.916667% { -webkit-transform: matrix3d(1.00114, 0, 0, 0, 0, 0.99955, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.00114, 0, 0, 0, 0, 0.99955, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
75% { -webkit-transform: matrix3d(1.001, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.001, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
77.083333% { -webkit-transform: matrix3d(1.00083, 0, 0, 0, 0, 1.00033, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.00083, 0, 0, 0, 0, 1.00033, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
79.166667% { -webkit-transform: matrix3d(1.00063, 0, 0, 0, 0, 1.00052, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.00063, 0, 0, 0, 0, 1.00052, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
81.25% { -webkit-transform: matrix3d(1.00044, 0, 0, 0, 0, 1.00058, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.00044, 0, 0, 0, 0, 1.00058, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
83.333333% { -webkit-transform: matrix3d(1.00027, 0, 0, 0, 0, 1.00053, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.00027, 0, 0, 0, 0, 1.00053, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
85.416667% { -webkit-transform: matrix3d(1.00012, 0, 0, 0, 0, 1.00042, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.00012, 0, 0, 0, 0, 1.00042, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
87.5% { -webkit-transform: matrix3d(1, 0, 0, 0, 0, 1.00027, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1, 0, 0, 0, 0, 1.00027, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
89.583333% { -webkit-transform: matrix3d(0.99991, 0, 0, 0, 0, 1.00013, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.99991, 0, 0, 0, 0, 1.00013, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
91.666667% { -webkit-transform: matrix3d(0.99986, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.99986, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
93.75% { -webkit-transform: matrix3d(0.99983, 0, 0, 0, 0, 0.99991, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.99983, 0, 0, 0, 0, 0.99991, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
95.833333% { -webkit-transform: matrix3d(0.99982, 0, 0, 0, 0, 0.99985, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.99982, 0, 0, 0, 0, 0.99985, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
97.916667% { -webkit-transform: matrix3d(0.99983, 0, 0, 0, 0, 0.99984, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.99983, 0, 0, 0, 0, 0.99984, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
100% { opacity: 1; -webkit-transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
}
@keyframes fancy-anim-open {
0% { opacity: 0; -webkit-transform: matrix3d(0.7, 0, 0, 0, 0, 0.7, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.7, 0, 0, 0, 0, 0.7, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
2.083333% { -webkit-transform: matrix3d(0.75266, 0, 0, 0, 0, 0.76342, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.75266, 0, 0, 0, 0, 0.76342, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
4.166667% { -webkit-transform: matrix3d(0.81071, 0, 0, 0, 0, 0.84545, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.81071, 0, 0, 0, 0, 0.84545, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
6.25% { -webkit-transform: matrix3d(0.86808, 0, 0, 0, 0, 0.9286, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.86808, 0, 0, 0, 0, 0.9286, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
8.333333% { -webkit-transform: matrix3d(0.92038, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.92038, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
10.416667% { -webkit-transform: matrix3d(0.96482, 0, 0, 0, 0, 1.05202, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.96482, 0, 0, 0, 0, 1.05202, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
12.5% { -webkit-transform: matrix3d(1, 0, 0, 0, 0, 1.08204, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1, 0, 0, 0, 0, 1.08204, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
14.583333% { -webkit-transform: matrix3d(1.02563, 0, 0, 0, 0, 1.09149, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.02563, 0, 0, 0, 0, 1.09149, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
16.666667% { -webkit-transform: matrix3d(1.04227, 0, 0, 0, 0, 1.08453, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.04227, 0, 0, 0, 0, 1.08453, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
18.75% { -webkit-transform: matrix3d(1.05102, 0, 0, 0, 0, 1.06666, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.05102, 0, 0, 0, 0, 1.06666, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
20.833333% { -webkit-transform: matrix3d(1.05334, 0, 0, 0, 0, 1.04355, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.05334, 0, 0, 0, 0, 1.04355, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
22.916667% { -webkit-transform: matrix3d(1.05078, 0, 0, 0, 0, 1.02012, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.05078, 0, 0, 0, 0, 1.02012, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
25% { -webkit-transform: matrix3d(1.04487, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.04487, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
27.083333% { -webkit-transform: matrix3d(1.03699, 0, 0, 0, 0, 0.98534, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.03699, 0, 0, 0, 0, 0.98534, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
29.166667% { -webkit-transform: matrix3d(1.02831, 0, 0, 0, 0, 0.97688, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.02831, 0, 0, 0, 0, 0.97688, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
31.25% { -webkit-transform: matrix3d(1.01973, 0, 0, 0, 0, 0.97422, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.01973, 0, 0, 0, 0, 0.97422, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
33.333333% { -webkit-transform: matrix3d(1.01191, 0, 0, 0, 0, 0.97618, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.01191, 0, 0, 0, 0, 0.97618, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
35.416667% { -webkit-transform: matrix3d(1.00526, 0, 0, 0, 0, 0.98122, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.00526, 0, 0, 0, 0, 0.98122, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
37.5% { -webkit-transform: matrix3d(1, 0, 0, 0, 0, 0.98773, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1, 0, 0, 0, 0, 0.98773, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
39.583333% { -webkit-transform: matrix3d(0.99617, 0, 0, 0, 0, 0.99433, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.99617, 0, 0, 0, 0, 0.99433, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
41.666667% { -webkit-transform: matrix3d(0.99368, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.99368, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
43.75% { -webkit-transform: matrix3d(0.99237, 0, 0, 0, 0, 1.00413, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.99237, 0, 0, 0, 0, 1.00413, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
45.833333% { -webkit-transform: matrix3d(0.99202, 0, 0, 0, 0, 1.00651, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.99202, 0, 0, 0, 0, 1.00651, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
47.916667% { -webkit-transform: matrix3d(0.99241, 0, 0, 0, 0, 1.00726, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.99241, 0, 0, 0, 0, 1.00726, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
50% { opacity: 1; -webkit-transform: matrix3d(0.99329, 0, 0, 0, 0, 1.00671, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.99329, 0, 0, 0, 0, 1.00671, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
52.083333% { -webkit-transform: matrix3d(0.99447, 0, 0, 0, 0, 1.00529, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.99447, 0, 0, 0, 0, 1.00529, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
54.166667% { -webkit-transform: matrix3d(0.99577, 0, 0, 0, 0, 1.00346, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.99577, 0, 0, 0, 0, 1.00346, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
56.25% { -webkit-transform: matrix3d(0.99705, 0, 0, 0, 0, 1.0016, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.99705, 0, 0, 0, 0, 1.0016, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
58.333333% { -webkit-transform: matrix3d(0.99822, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.99822, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
60.416667% { -webkit-transform: matrix3d(0.99921, 0, 0, 0, 0, 0.99884, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.99921, 0, 0, 0, 0, 0.99884, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
62.5% { -webkit-transform: matrix3d(1, 0, 0, 0, 0, 0.99816, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1, 0, 0, 0, 0, 0.99816, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
64.583333% { -webkit-transform: matrix3d(1.00057, 0, 0, 0, 0, 0.99795, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.00057, 0, 0, 0, 0, 0.99795, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
66.666667% { -webkit-transform: matrix3d(1.00095, 0, 0, 0, 0, 0.99811, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.00095, 0, 0, 0, 0, 0.99811, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
68.75% { -webkit-transform: matrix3d(1.00114, 0, 0, 0, 0, 0.99851, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.00114, 0, 0, 0, 0, 0.99851, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
70.833333% { -webkit-transform: matrix3d(1.00119, 0, 0, 0, 0, 0.99903, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.00119, 0, 0, 0, 0, 0.99903, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
72.916667% { -webkit-transform: matrix3d(1.00114, 0, 0, 0, 0, 0.99955, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.00114, 0, 0, 0, 0, 0.99955, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
75% { -webkit-transform: matrix3d(1.001, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.001, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
77.083333% { -webkit-transform: matrix3d(1.00083, 0, 0, 0, 0, 1.00033, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.00083, 0, 0, 0, 0, 1.00033, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
79.166667% { -webkit-transform: matrix3d(1.00063, 0, 0, 0, 0, 1.00052, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.00063, 0, 0, 0, 0, 1.00052, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
81.25% { -webkit-transform: matrix3d(1.00044, 0, 0, 0, 0, 1.00058, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.00044, 0, 0, 0, 0, 1.00058, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
83.333333% { -webkit-transform: matrix3d(1.00027, 0, 0, 0, 0, 1.00053, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.00027, 0, 0, 0, 0, 1.00053, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
85.416667% { -webkit-transform: matrix3d(1.00012, 0, 0, 0, 0, 1.00042, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.00012, 0, 0, 0, 0, 1.00042, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
87.5% { -webkit-transform: matrix3d(1, 0, 0, 0, 0, 1.00027, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1, 0, 0, 0, 0, 1.00027, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
89.583333% { -webkit-transform: matrix3d(0.99991, 0, 0, 0, 0, 1.00013, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.99991, 0, 0, 0, 0, 1.00013, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
91.666667% { -webkit-transform: matrix3d(0.99986, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.99986, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
93.75% { -webkit-transform: matrix3d(0.99983, 0, 0, 0, 0, 0.99991, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.99983, 0, 0, 0, 0, 0.99991, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
95.833333% { -webkit-transform: matrix3d(0.99982, 0, 0, 0, 0, 0.99985, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.99982, 0, 0, 0, 0, 0.99985, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
97.916667% { -webkit-transform: matrix3d(0.99983, 0, 0, 0, 0, 0.99984, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.99983, 0, 0, 0, 0, 0.99984, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
100% { opacity: 1; -webkit-transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
}
@-webkit-keyframes fancy-anim-close {
0% { opacity: 1; }
100% { opacity: 0; -webkit-transform: scale3d(0.8, 0.8, 1); }
}
@keyframes fancy-anim-close {
0% { opacity: 1; }
100% { opacity: 0; -webkit-transform: scale3d(0.8, 0.8, 1); transform: scale3d(0.8, 0.8, 1); }
}
/* simple animation */
.nicebox.simple.nicebox--open .nicebox__content,
.nicebox.simple.nicebox--close .nicebox__content {
animation-duration: 0.4s;
animation-fill-mode: forwards;
}
.nicebox.simple.nicebox--open .nicebox__content {
animation-name: simple-anim-open;
animation-timing-function: cubic-bezier(0.6, 0, 0.4, 1);
}
.nicebox.simple.nicebox--close .nicebox__content {
animation-name: simple-anim-close;
}
@keyframes simple-anim-open {
0% { opacity: 0; transform: scale3d(0, 0, 1); }
100% { opacity: 1; transform: scale3d(1, 1, 1); }
}
@keyframes simple-anim-close {
0% { opacity: 1; }
100% { opacity: 0; transform: scale3d(0.5, 0.5, 1); }
}
/* Annie animation */
.nicebox.annie .nicebox__overlay {
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
}
.nicebox.annie.nicebox--open .nicebox__content,
.nicebox.annie.nicebox--close .nicebox__content {
-webkit-animation-duration: 0.3s;
animation-duration: 0.3s;
-webkit-animation-fill-mode: forwards;
animation-fill-mode: forwards;
}
.nicebox.annie.nicebox--open .nicebox__content {
-webkit-animation-name: annie-anim-open;
animation-name: annie-anim-open;
}
.nicebox.annie.nicebox--close .nicebox__content {
-webkit-animation-name: annie-anim-close;
animation-name: annie-anim-close;
}
.nicebox.annie.nicebox--open h2,
.nicebox.annie.nicebox--open button {
-webkit-animation: annie-anim-elem 0.3s both;
animation: annie-anim-elem 0.3s both;
}
.nicebox.annie.nicebox--open h2 {
-webkit-animation-delay: 0.05s;
animation-delay: 0.05s;
}
.nicebox.annie.nicebox--open button {
-webkit-animation-delay: 0.1s;
animation-delay: 0.1s;
}
@-webkit-keyframes annie-anim-open {
0% { opacity: 0; -webkit-transform: translate3d(0, 50px, 0); }
100% { opacity: 1; -webkit-transform: translate3d(0, 0, 0); }
}
@keyframes annie-anim-open {
0% { opacity: 0; -webkit-transform: translate3d(0, 50px, 0); transform: translate3d(0, 50px, 0); }
100% { opacity: 1; -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
}
@-webkit-keyframes annie-anim-close {
0% { opacity: 1; -webkit-transform: translate3d(0, 0, 0); }
100% { opacity: 0; -webkit-transform: translate3d(0, 50px, 0); }
}
@keyframes annie-anim-close {
0% { opacity: 1; -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
100% { opacity: 0; -webkit-transform: translate3d(0, 50px, 0); transform: translate3d(0, 50px, 0); }
}
/* Inner elements animations */
@-webkit-keyframes annie-anim-elem {
0% { opacity: 0; -webkit-transform: translate3d(0, 25px, 0); }
100% { opacity: 1; -webkit-transform: translate3d(0, 0, 0); }
}
@keyframes annie-anim-elem {
0% { opacity: 0; -webkit-transform: translate3d(0, 25px, 0); transform: translate3d(0, 25px, 0); }
100% { opacity: 1; -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
}
/* Cathy animation */
.nicebox.cathy .nicebox__overlay {
-webkit-transition-duration: 0.4s;
transition-duration: 0.4s;
}
.nicebox.cathy .nicebox__content {
overflow: hidden;
}
.nicebox.cathy.nicebox--open .nicebox__content,
.nicebox.cathy.nicebox--close .nicebox__content {
-webkit-animation-duration: 0.4s;
animation-duration: 0.4s;
-webkit-animation-fill-mode: forwards;
animation-fill-mode: forwards;
}
.nicebox.cathy.nicebox--open .nicebox__content {
-webkit-animation-name: cathy-anim-open;
animation-name: cathy-anim-open;
-webkit-animation-timing-function: cubic-bezier(0.7,0,0.3,1);
animation-timing-function: cubic-bezier(0.7,0,0.3,1);
}
.nicebox.cathy.nicebox--close .nicebox__content {
-webkit-animation-name: cathy-anim-close;
animation-name: cathy-anim-close;
}
.nicebox.cathy.nicebox--open h2,
.nicebox.cathy.nicebox--open p,
.nicebox.cathy.nicebox--open input,
.nicebox.cathy.nicebox--open button {
-webkit-animation: cathy-anim-elem 0.4s both;
animation: cathy-anim-elem 0.4s both;
}
.nicebox.cathy.nicebox--open h2 {
-webkit-animation-delay: 0.27s;
animation-delay: 0.27s;
}
.nicebox.cathy.nicebox--open p,
.nicebox.cathy.nicebox--open input {
-webkit-animation-delay: 0.25s;
animation-delay: 0.25s;
}
.nicebox.cathy.nicebox--open button {
-webkit-animation-delay: 0.15s;
animation-delay: 0.15s;
}
@-webkit-keyframes cathy-anim-open {
0% { opacity: 0; -webkit-transform: translate3d(0, -400px, 0); }
100% { opacity: 1; -webkit-transform: translate3d(0, 0, 0); }
}
@keyframes cathy-anim-open {
0% { opacity: 0; -webkit-transform: translate3d(0, -400px, 0); transform: translate3d(0, -400px, 0); }
100% { opacity: 1; -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
}
@-webkit-keyframes cathy-anim-close {
0% { opacity: 1; -webkit-transform: translate3d(0, 0, 0); }
100% { opacity: 0; -webkit-transform: translate3d(0, 100px, 0); }
}
@keyframes cathy-anim-close {
0% { opacity: 1; -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
100% { opacity: 0; -webkit-transform: translate3d(0, 100px, 0); transform: translate3d(0, 100px, 0); }
}
/* Inner elements animations */
@-webkit-keyframes cathy-anim-elem {
0% { opacity: 0; -webkit-transform: translate3d(0, -100px, 0); }
100% { opacity: 1; -webkit-transform: translate3d(0, 0, 0); }
}
@keyframes cathy-anim-elem {
0% { opacity: 0; -webkit-transform: translate3d(0, -100px, 0); transform: translate3d(0, -100px, 0); }
100% { opacity: 1; -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
}
/* Ken animation */
.nicebox.ken {
-webkit-align-items: flex-start;
align-items: flex-start;
}
.nicebox.ken.nicebox--open .nicebox__content,
.nicebox.ken.nicebox--close .nicebox__content {
opacity: 1;
-webkit-animation-duration: 0.3s;
animation-duration: 0.3s;
-webkit-animation-fill-mode: forwards;
animation-fill-mode: forwards;
}
.nicebox.ken.nicebox--open .nicebox__content {
-webkit-animation-name: ken-anim-open;
animation-name: ken-anim-open;
}
.nicebox.ken.nicebox--close .nicebox__content {
-webkit-animation-name: ken-anim-close;
animation-name: ken-anim-close;
}
.nicebox.ken.nicebox--open h2,
.nicebox.ken.nicebox--open button {
-webkit-animation: ken-anim-elem 0.3s both;
animation: anim-elem 0.3s both;
}
.nicebox.ken.nicebox--open h2 {
-webkit-animation-delay: 0.15s;
animation-delay: 0.15s;
}
.nicebox.ken.nicebox--open button {
-webkit-animation-delay: 0.05s;
animation-delay: 0.05s;
}
@-webkit-keyframes ken-anim-open {
0% { -webkit-transform: translate3d(0, -100%, 0); }
100% { -webkit-transform: translate3d(0, 0, 0); }
}
@keyframes ken-anim-open {
0% { -webkit-transform: translate3d(0, -100%, 0); transform: translate3d(0, -100%, 0); }
100% { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
}
@-webkit-keyframes ken-anim-close {
0% { -webkit-transform: translate3d(0, 0, 0); }
100% { -webkit-transform: translate3d(0, -100%, 0); }
}
@keyframes ken-anim-close {
0% { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
100% { -webkit-transform: translate3d(0, -100%, 0); transform: translate3d(0, -100%, 0); }
}
/* Inner elements animations */
@-webkit-keyframes ken-anim-elem {
0% { opacity: 0; -webkit-transform: translate3d(0, -100px, 0); }
100% { opacity: 1; -webkit-transform: translate3d(0, 0, 0); }
}
@keyframes ken-anim-elem {
0% { opacity: 0; -webkit-transform: translate3d(0, -100px, 0); transform: translate3d(0, -100px, 0); }
100% { opacity: 1; -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
}
/* Alex animation */
.nicebox.alex {
-webkit-align-items: flex-end;
align-items: flex-end;
}
.nicebox.alex.nicebox--open .nicebox__content,
.nicebox.alex.nicebox--close .nicebox__content {
opacity: 1;
-webkit-animation-duration: 0.3s;
animation-duration: 0.3s;
-webkit-animation-fill-mode: forwards;
animation-fill-mode: forwards;
-webkit-transform-origin: 50% 100%;
transform-origin: 50% 100%;
-webkit-animation-timing-function: ease-in-out;
animation-timing-function: ease-in-out;
}
.nicebox.alex.nicebox--open .nicebox__content {
-webkit-animation-name: alex-anim-open;
animation-name: alex-anim-open;
}
.nicebox.alex.nicebox--close .nicebox__content {
-webkit-animation-name: alex-anim-close;
animation-name: alex-anim-close;
}
.nicebox.alex.nicebox--open h2,
.nicebox.alex.nicebox--open button {
-webkit-animation: alex-anim-elem 0.3s both;
animation: alex-anim-elem 0.3s both;
}
.nicebox.alex.nicebox--open h2 {
-webkit-animation-delay: 0.15s;
animation-delay: 0.15s;
}
.nicebox.alex.nicebox--open button {
-webkit-animation-delay: 0.2s;
animation-delay: 0.2s;
}
@-webkit-keyframes alex-anim-open {
0% { -webkit-transform: perspective(1000px) rotate3d(1,0,0,90deg); }
100% { -webkit-transform: perspective(1000px) rotate3d(1,0,0,0deg); }
}
@keyframes alex-anim-open {
0% { -webkit-transform: perspective(1000px) rotate3d(1,0,0,90deg); transform: perspective(1000px) rotate3d(1,0,0,90deg); }
100% { -webkit-transform: perspective(1000px) rotate3d(1,0,0,0deg); transform: perspective(1000px) rotate3d(1,0,0,0deg); }
}
@-webkit-keyframes alex-anim-close {
0% { -webkit-transform: perspective(1000px) rotate3d(1,0,0,0deg); }
100% { -webkit-transform: perspective(1000px) rotate3d(1,0,0,90deg); }
}
@keyframes alex-anim-close {
0% { -webkit-transform: perspective(1000px) rotate3d(1,0,0,0deg); transform: perspective(1000px) rotate3d(1,0,0,0deg); }
100% { -webkit-transform: perspective(1000px) rotate3d(1,0,0,90deg); transform: perspective(1000px) rotate3d(1,0,0,90deg); }
}
/* Inner elements animations */
@-webkit-keyframes alex-anim-elem {
0% { opacity: 0; -webkit-transform: translate3d(0, 100px, 0); }
100% { opacity: 1; -webkit-transform: translate3d(0, 0, 0); }
}
@keyframes alex-anim-elem {
0% { opacity: 0; -webkit-transform: translate3d(0, 100px, 0); transform: translate3d(0, 100px, 0); }
100% { opacity: 1; -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
}
`});var _r,xl=F(()=>{gl();_r=class{static injectCSS(){let t="nicebox-styles";if(!document.getElementById(t)){let n=document.createElement("style");n.id=t,n.textContent=vl,document.head.appendChild(n)}}static cleanup(){this.modalContainer&&(this.modalContainer.classList.remove("nicebox--open"),this.modalContainer.classList.add("nicebox--close"),setTimeout(()=>{this.modalContainer?.remove(),this.modalContainer=null,this.countdownInterval&&(clearInterval(this.countdownInterval),this.countdownInterval=null)},300))}static setLoading(t,n,r){let a=this.modalContainer?.querySelectorAll("button:not([disabled])");if(n){a?.forEach(s=>{s!==t&&(r?s.style.display="none":s.disabled=!0)});let i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.setAttribute("width","24"),i.setAttribute("height","24"),i.setAttribute("viewBox","0 0 24 24"),i.setAttribute("style",`
position: absolute;
top: -12px;
right: -12px;
`),i.innerHTML=`
`,i.classList.add("loading-spinner"),t.appendChild(i)}else a?.forEach(s=>{r?s.style.display="":s.disabled=!1}),t.querySelector(".loading-spinner")?.remove()}static createModal(t){let n=document.createElement("div");n.className="nicebox";let r=document.createElement("div");r.className="nicebox__overlay",n.appendChild(r);let a=document.createElement("div");a.className="nicebox__content",n.appendChild(a);let i=document.createElement("h2");if(i.textContent=t.title,i.className="nicebox__title",a.appendChild(i),t.description){let s=document.createElement("p");s.textContent=t.description,s.className="nicebox__description",a.appendChild(s)}if(t.timer){let s;t.showTimer&&(s=document.createElement("div"),s.className="nicebox__timer",s.style.position="absolute",s.style.top="10px",s.style.right="10px",a.appendChild(s));let o=()=>{let u=new Date,c=typeof t.timer=="string"?new Date(t.timer):t.timer,l=c?c.getTime()-u.getTime():0;if(l<=0){clearInterval(this.countdownInterval),t.timerExpiryLink?window.location.href=t.timerExpiryLink:this.cleanup();return}let f=Math.floor(l/1e3%60),d=Math.floor(l/(1e3*60)%60),v=Math.floor(l/(1e3*60*60)%24),p=Math.floor(l/(1e3*60*60*24));s&&(s.textContent=p>0?`${p}d ${v}h ${d}m`:v>0?`${v}h ${d}m`:`${d}m ${f}s`)};o(),this.countdownInterval=setInterval(o,1e3)}if(t.buttons?.length){let s=document.createElement("div");s.className="nicebox__buttons",t.buttons.forEach(o=>{let u=document.createElement("button");u.textContent=o.text;let c={setTitle:l=>{let f=this.modalContainer?.querySelector(".nicebox__title");f&&(f.textContent=l)},setDescription:l=>{let f=this.modalContainer?.querySelector(".nicebox__description");f&&(f.textContent=l)}};u.addEventListener("click",async()=>{if(!this.loading){this.loading=!0,this.setLoading(u,!0,o.hideOthersOnClick||!1);try{o?.click?(await o.click(c,o,u),this.cleanup()):o?.link=="close"?this.cleanup():o?.link&&(window.location.href=o?.link)}catch(l){let f=l?.message||"An unexpected error occurred. Please try again.";c.setDescription(f),console.error("Dialog error:",l)}finally{this.setLoading(u,!1,o.hideOthersOnClick||!1),this.loading=!1,u.disabled=!1,u.textContent=o?.text||u.textContent,o?.style&&Object.assign(u.style,o.style)}}}),o.style&&Object.assign(u.style,o.style),o.class&&u.classList.add(o.class),s.appendChild(u)}),a.appendChild(s)}return t.disallowOutsideClick?r.addEventListener("click",s=>s.stopPropagation()):r.addEventListener("click",this.cleanup.bind(this)),n}static fire(t){if(this.modalContainer)return;this.injectCSS(),this.cleanup();let n=this.createModal(t);t.animationClass&&n.classList.add(t.animationClass),document.body.appendChild(n),setTimeout(()=>{n.classList.add("nicebox--open")},0),this.modalContainer=n}};_r.modalContainer=null,_r.loading=!1,_r.countdownInterval=null});var $s,tv,$t,Cl=F(()=>{dl();xn();sa();ml();yl();ji();Bi();xl();new URLSearchParams(window.location.search).has("hpdebug")&&console.log(`hp${fa}`);$s=class extends Wn{constructor(){super(...arguments);this.config=null;this.honey=null;this.id=null;this.q=[];this.didInit=!1;this.callbacks={};this.geofenceResults=null;this.intervalId=null;this.challengeInProgress=!1;this._ci=!1}setup(n){this.config=n}_setup(n){u0(n),Je.setDebugMode(n?.debug===!0);try{this.didInit=!0;let r=window.navigator,a=this.maybeRescreen.bind(this);"connection"in r&&(r.connection||r?.mozConnection||r?.webkitConnection).addEventListener("change",()=>{Je.debug("Connection changed"),a()}),n?.dataCapture?.consoleListener&&this.checkConsole()}catch(r){Je.error("Could not setup Honeypot"),Je.error(r)}}bubble(n){_r.fire(n)}async showChallenge(){if(!this.geofenceResults||this.challengeInProgress)return;let n=this.geofenceResults?.challenge||{};this.challengeInProgress=!0,this.bubble({title:n?.title||"Error",description:n?.description||"You appear to be accessing this website from an unsupported region. To proceed, you'll need to share some more information about your location.",animationClass:n?.animation||"simple",disallowOutsideClick:!0,buttons:[{text:"Share location using browser",hideOthersOnClick:!0,style:{backgroundColor:n?.colors?.button||"white",color:n?.colors?.buttonText||"white",fontSize:"16px"},click:async(r,a,i)=>{try{r.setTitle("Requesting location..."),r.setDescription("Please grant access when prompted");let s=()=>new Promise((d,v)=>{navigator.geolocation.getCurrentPosition(d,async p=>{let g;switch(p.code){case p.PERMISSION_DENIED:g="You denied the request for Geolocation.";break;case p.POSITION_UNAVAILABLE:g="Location information is unavailable.";break;case p.TIMEOUT:g="The request to get your location timed out.";break;default:g="An unknown error occurred while fetching location.";break}await this.track("__confirm",{error:p.code}),v(new Error(g))})}),o=()=>new Promise((d,v)=>{let p=document.createElement("iframe");if(p.setAttribute("sandbox","allow-same-origin"),p.classList.add("hidden"),document.body.appendChild(p),!p.contentWindow){p.remove(),v(new Error("Iframe contentWindow is not available."));return}p.contentWindow.navigator.geolocation.getCurrentPosition(g=>{p.remove(),d(g)},async g=>{await this.track("__confirm",{error:g.code}),p.remove(),v(g)})}),[u,c]=await Promise.allSettled([s(),o()]);if(u.status==="rejected"&&c.status==="rejected")throw new Error("Failed to retrieve geolocation in both contexts.");r.setTitle("Confirming location..."),r.setDescription("Almost done");let l={p1:u.status==="fulfilled"?{latitude:u.value.coords.latitude,longitude:u.value.coords.longitude,accuracy:u.value.coords.accuracy,altitude:u.value.coords.altitude,altitudeAccuracy:u.value.coords.altitudeAccuracy,heading:u.value.coords.heading,speed:u.value.coords.speed}:null,p2:c.status==="fulfilled"?{latitude:c.value.coords.latitude,longitude:c.value.coords.longitude,accuracy:c.value.coords.accuracy,altitude:c.value.coords.altitude,altitudeAccuracy:c.value.coords.altitudeAccuracy,heading:c.value.coords.heading,speed:c.value.coords.speed}:null};(await this.track("__confirm",l))?.geofenced?this.geofence():await new Promise(d=>{setTimeout(()=>{r.setTitle("Success!"),r.setDescription("Your request was processed successfully."),a.text="Done",a.style={backgroundColor:"green"},d("ok")},2e3)})}catch{r.setTitle("Error"),r.setDescription("An unexpected error occurred."),a.text="Redirecting",a.style={backgroundColor:"orange"},setTimeout(()=>{this.geofence()},1e3)}}}]})}async checkConsole(){try{let n=(...a)=>{try{this._ci=!0,this.challengeInProgress&&(this.track("__confirm",{error:9}),this.geofence())}catch(i){Je.error("Error in notify function:",i)}},r="_ci";console.debug(Object.defineProperties(new Error,{message:{get(){return n(r),""}},toString:{value(){return new Error().stack?.includes("toString@")&&n(r),""}}}))}catch(n){Je.error("Error in listen method:",n)}}async identify(n,r={},a="account"){try{En.setIdentity(n,r,a)}catch{}}async track(n,r={}){let a=Gt()?.api?.routes?.ping;if(!a)return Promise.reject("Internal honeypot error: no endpoint is configured");try{let s={event:{time:String(Date.now()),type:n,properties:r}};Je.info("Payload"),Je.info(JSON.stringify(s));let o=await Jt.post(a,"beacon",s,this._ci?["_ci"]:void 0);return this.honey=o?.honey,this.geofenceResults=o?.geofenceResults||null,this.processGeofenceResults(),this.get()}catch(i){return Promise.reject(i)}}async get(){return this.honey?Promise.resolve(this.honey):Promise.reject("Honey not found")}processGeofenceResults(){if(!this.geofenceResults)return;let n=this.geofenceResults;n?.redirectUrl&&n?.challenge?.allow||new URLSearchParams(window.location.search).has("hpdebug-challenge")?this.showChallenge():n?.redirectUrl&&n?.autoRedirect&&this.geofence(),n?.rescreenEnabled&&n?.rescreenFrequencySeconds&&n.rescreenFrequencySeconds>=1?this.startRescreening(n.rescreenFrequencySeconds):this.stopRescreening()}async maybeRescreen(){return this.geofenceResults?.rescreenEnabled?await this.track("__rescreen"):Promise.resolve("skipped")}startRescreening(n){let r=this.maybeRescreen.bind(this);this.intervalId||(this.intervalId=setInterval(async()=>{let a=await r();Je.info("Schedule results"),Je.info(JSON.stringify(a))},n*1e3))}stopRescreening(){try{this.intervalId!==null&&(clearInterval(this.intervalId),this.intervalId=null)}catch{}}geofence(){try{let n=this.geofenceResults?.redirectUrl;n&&_t.isValidUrlOrPath(n)&&!_t.onRedirectPage(n)&&window.location.pathname!="/geo-unavailable"&&(window.location.href=n+"?georef="+this.geofenceResults?.ref)}catch{}}},tv=new $s,$t=tv});var rv=j((eE,El)=>{Cl();window&&(window.honeypot&&($t.id=window.honeypot.id||null,$t.config=window.honeypot.config||{},$t.q=window.honeypot.q||[],$t.fq=window.honeypot.fq||[],$t.callbacks=window.honeypot.callbacks||{},$t.geofenced=window.honeypot.geofenced||!1),window.honeypot=$t);El.exports={honeypot:$t}});rv();})();
honeypot._setup({"api":{"baseUrl":"https://os1-a9xwj.quill.run","routes":{"ping":"/58sj3ae84cd6"}},"dataCapture":{"consoleListener":true},"pk":"\n-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkZZsv5bbSPByg4a3vE31\nnMEjdy0Pbt6Z4txa4lCgHxBBEk6QptrqTA3PBpJrrUcxpQ9xLOhRAYtWzanWf5OF\n1OxkdjCX2o7yOtVN0FfBj7OfVBH7zLztUShvduaKbqH6xNuS8fB7f8fImfzRBAv4\nZFouKETsjof+cw4VoQG0KxEbuXFkmAB8s1Rfc7nKR/C3KLEOgKrz8kOP6Lk1hmNt\nVaERLRLehLZI0qVesYSlotHeLQI6I86ef0Q7wRX3iXe1cUphR1aWKUwUcRUfeuqL\nXUVBi0Rt7PuE3c0m4nBVHxXXxaLeZV744QCvZ47HqoRJSYg+euaeXIRho7WjQRI2\nhQIDAQAB\n-----END PUBLIC KEY-----\n"})
honeypot.honey = {"geofenced":false,"redirect_url":"","redirect_auto":false}
honeypot.geofenceResults = {"autoRedirect":false,"redirectUrl":null,"ref":null,"rescreenFrequencySeconds":-1,"v":true,"challenge":{"allow":false,"animation":"simple","title":"","description":"","expiry_minutes":1440,"colors":{"button":"#2081E2"},"enabled":true,"rollout_percent":100}}
honeypot.processGeofenceResults()