UNPKG

@mkellsy/homebridge-lutron

Version:

This is a plugin that exposes Lutron LEAP devices to Homebridge.

4 lines 561 kB
var hE=Object.create;var Gi=Object.defineProperty;var dE=Object.getOwnPropertyDescriptor;var pE=Object.getOwnPropertyNames,Ya=Object.getOwnPropertySymbols,vE=Object.getPrototypeOf,hc=Object.prototype.hasOwnProperty,sh=Object.prototype.propertyIsEnumerable;var fc=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e);var ah=(e,t,r)=>t in e?Gi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,In=(e,t)=>{for(var r in t||(t={}))hc.call(t,r)&&ah(e,r,t[r]);if(Ya)for(var r of Ya(t))sh.call(t,r)&&ah(e,r,t[r]);return e};var oh=(e,t)=>{var r={};for(var n in e)hc.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ya)for(var n of Ya(e))t.indexOf(n)<0&&sh.call(e,n)&&(r[n]=e[n]);return r};var ht=(e,t)=>()=>(e&&(t=e(e=0)),t);var b=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),yE=(e,t)=>{for(var r in t)Gi(e,r,{get:t[r],enumerable:!0})},ch=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of pE(t))!hc.call(e,i)&&i!==r&&Gi(e,i,{get:()=>t[i],enumerable:!(n=dE(t,i))||n.enumerable});return e};var wn=(e,t,r)=>(r=e!=null?hE(vE(e)):{},ch(t||!e||!e.__esModule?Gi(r,"default",{value:e,enumerable:!0}):r,e)),gE=e=>ch(Gi({},"__esModule",{value:!0}),e);var Ue=(e,t,r)=>new Promise((n,i)=>{var a=u=>{try{o(r.next(u))}catch(c){i(c)}},s=u=>{try{o(r.throw(u))}catch(c){i(c)}},o=u=>u.done?n(u.value):Promise.resolve(u.value).then(a,s);o((r=r.apply(e,t)).next())}),ji=function(e,t){this[0]=e,this[1]=t},uh=(e,t,r)=>{var n=(s,o,u,c)=>{try{var l=r[s](o),f=(o=l.value)instanceof ji,h=l.done;Promise.resolve(f?o[0]:o).then(p=>f?n(s==="return"?s:"next",o[1]?{done:p.done,value:p.value}:p,u,c):u({value:p,done:h})).catch(p=>n("throw",p,u,c))}catch(p){c(p)}},i=s=>a[s]=o=>new Promise((u,c)=>n(s,o,u,c)),a={};return r=r.apply(e,t),a[fc("asyncIterator")]=()=>a,i("next"),i("throw"),i("return"),a};var lh=(e,t,r)=>(t=e[fc("asyncIterator")])?t.call(e):(e=e[fc("iterator")](),t={},r=(n,i)=>(i=e[n])&&(t[n]=a=>new Promise((s,o,u)=>(a=i.call(e,a),u=a.done,Promise.resolve(a.value).then(c=>s({value:c,done:u}),o)))),r("next"),r("return"),t);var ee=b((AO,fh)=>{fh.exports={options:{usePureJavaScript:!1}}});var ph=b((IO,dh)=>{var dc={};dh.exports=dc;var hh={};dc.encode=function(e,t,r){if(typeof t!="string")throw new TypeError('"alphabet" must be a string.');if(r!==void 0&&typeof r!="number")throw new TypeError('"maxline" must be a number.');var n="";if(!(e instanceof Uint8Array))n=mE(e,t);else{var i=0,a=t.length,s=t.charAt(0),o=[0];for(i=0;i<e.length;++i){for(var u=0,c=e[i];u<o.length;++u)c+=o[u]<<8,o[u]=c%a,c=c/a|0;for(;c>0;)o.push(c%a),c=c/a|0}for(i=0;e[i]===0&&i<e.length-1;++i)n+=s;for(i=o.length-1;i>=0;--i)n+=t[o[i]]}if(r){var l=new RegExp(".{1,"+r+"}","g");n=n.match(l).join(`\r `)}return n};dc.decode=function(e,t){if(typeof e!="string")throw new TypeError('"input" must be a string.');if(typeof t!="string")throw new TypeError('"alphabet" must be a string.');var r=hh[t];if(!r){r=hh[t]=[];for(var n=0;n<t.length;++n)r[t.charCodeAt(n)]=n}e=e.replace(/\s/g,"");for(var i=t.length,a=t.charAt(0),s=[0],n=0;n<e.length;n++){var o=r[e.charCodeAt(n)];if(o===void 0)return;for(var u=0,c=o;u<s.length;++u)c+=s[u]*i,s[u]=c&255,c>>=8;for(;c>0;)s.push(c&255),c>>=8}for(var l=0;e[l]===a&&l<e.length-1;++l)s.push(0);return typeof Buffer!="undefined"?Buffer.from(s.reverse()):new Uint8Array(s.reverse())};function mE(e,t){var r=0,n=t.length,i=t.charAt(0),a=[0];for(r=0;r<e.length();++r){for(var s=0,o=e.at(r);s<a.length;++s)o+=a[s]<<8,a[s]=o%n,o=o/n|0;for(;o>0;)a.push(o%n),o=o/n|0}var u="";for(r=0;e.at(r)===0&&r<e.length()-1;++r)u+=i;for(r=a.length-1;r>=0;--r)u+=t[a[r]];return u}});var de=b((wO,mh)=>{var vh=ee(),yh=ph(),T=mh.exports=vh.util=vh.util||{};(function(){if(typeof process!="undefined"&&process.nextTick&&!process.browser){T.nextTick=process.nextTick,typeof setImmediate=="function"?T.setImmediate=setImmediate:T.setImmediate=T.nextTick;return}if(typeof setImmediate=="function"){T.setImmediate=function(){return setImmediate.apply(void 0,arguments)},T.nextTick=function(o){return setImmediate(o)};return}if(T.setImmediate=function(o){setTimeout(o,0)},typeof window!="undefined"&&typeof window.postMessage=="function"){let o=function(u){if(u.source===window&&u.data===e){u.stopPropagation();var c=t.slice();t.length=0,c.forEach(function(l){l()})}};var s=o,e="forge.setImmediate",t=[];T.setImmediate=function(u){t.push(u),t.length===1&&window.postMessage(e,"*")},window.addEventListener("message",o,!0)}if(typeof MutationObserver!="undefined"){var r=Date.now(),n=!0,i=document.createElement("div"),t=[];new MutationObserver(function(){var u=t.slice();t.length=0,u.forEach(function(c){c()})}).observe(i,{attributes:!0});var a=T.setImmediate;T.setImmediate=function(u){Date.now()-r>15?(r=Date.now(),a(u)):(t.push(u),t.length===1&&i.setAttribute("a",n=!n))}}T.nextTick=T.setImmediate})();T.isNodejs=typeof process!="undefined"&&process.versions&&process.versions.node;T.globalScope=function(){return T.isNodejs?global:typeof self=="undefined"?window:self}();T.isArray=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};T.isArrayBuffer=function(e){return typeof ArrayBuffer!="undefined"&&e instanceof ArrayBuffer};T.isArrayBufferView=function(e){return e&&T.isArrayBuffer(e.buffer)&&e.byteLength!==void 0};function Hi(e){if(!(e===8||e===16||e===24||e===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}T.ByteBuffer=pc;function pc(e){if(this.data="",this.read=0,typeof e=="string")this.data=e;else if(T.isArrayBuffer(e)||T.isArrayBufferView(e))if(typeof Buffer!="undefined"&&e instanceof Buffer)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch(n){for(var r=0;r<t.length;++r)this.putByte(t[r])}}else(e instanceof pc||typeof e=="object"&&typeof e.data=="string"&&typeof e.read=="number")&&(this.data=e.data,this.read=e.read);this._constructedStringLength=0}T.ByteStringBuffer=pc;var SE=4096;T.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>SE&&(this.data.substr(0,1),this._constructedStringLength=0)};T.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};T.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};T.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))};T.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var r=this.data;t>0;)t&1&&(r+=e),t>>>=1,t>0&&(e+=e);return this.data=r,this._optimizeConstructedString(t),this};T.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this};T.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(T.encodeUtf8(e))};T.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))};T.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))};T.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))};T.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255))};T.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))};T.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))};T.ByteStringBuffer.prototype.putInt=function(e,t){Hi(t);var r="";do t-=8,r+=String.fromCharCode(e>>t&255);while(t>0);return this.putBytes(r)};T.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<<t-1),this.putInt(e,t)};T.ByteStringBuffer.prototype.putBuffer=function(e){return this.putBytes(e.getBytes())};T.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)};T.ByteStringBuffer.prototype.getInt16=function(){var e=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,e};T.ByteStringBuffer.prototype.getInt24=function(){var e=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,e};T.ByteStringBuffer.prototype.getInt32=function(){var e=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,e};T.ByteStringBuffer.prototype.getInt16Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,e};T.ByteStringBuffer.prototype.getInt24Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,e};T.ByteStringBuffer.prototype.getInt32Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,e};T.ByteStringBuffer.prototype.getInt=function(e){Hi(e);var t=0;do t=(t<<8)+this.data.charCodeAt(this.read++),e-=8;while(e>0);return t};T.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t};T.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):e===0?t="":(t=this.read===0?this.data:this.data.slice(this.read),this.clear()),t};T.ByteStringBuffer.prototype.bytes=function(e){return typeof e=="undefined"?this.data.slice(this.read):this.data.slice(this.read,this.read+e)};T.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)};T.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this};T.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};T.ByteStringBuffer.prototype.copy=function(){var e=T.createBuffer(this.data);return e.read=this.read,e};T.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};T.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};T.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this};T.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.length;++t){var r=this.data.charCodeAt(t);r<16&&(e+="0"),e+=r.toString(16)}return e};T.ByteStringBuffer.prototype.toString=function(){return T.decodeUtf8(this.bytes())};function CE(e,t){t=t||{},this.read=t.readOffset||0,this.growSize=t.growSize||1024;var r=T.isArrayBuffer(e),n=T.isArrayBufferView(e);if(r||n){r?this.data=new DataView(e):this.data=new DataView(e.buffer,e.byteOffset,e.byteLength),this.write="writeOffset"in t?t.writeOffset:this.data.byteLength;return}this.data=new DataView(new ArrayBuffer(0)),this.write=0,e!=null&&this.putBytes(e),"writeOffset"in t&&(this.write=t.writeOffset)}T.DataBuffer=CE;T.DataBuffer.prototype.length=function(){return this.write-this.read};T.DataBuffer.prototype.isEmpty=function(){return this.length()<=0};T.DataBuffer.prototype.accommodate=function(e,t){if(this.length()>=e)return this;t=Math.max(t||this.growSize,e);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+t);return n.set(r),this.data=new DataView(n.buffer),this};T.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this};T.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r<t;++r)this.data.setUint8(e);return this};T.DataBuffer.prototype.putBytes=function(e,t){if(T.isArrayBufferView(e)){var r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),n=r.byteLength-r.byteOffset;this.accommodate(n);var i=new Uint8Array(this.data.buffer,this.write);return i.set(r),this.write+=n,this}if(T.isArrayBuffer(e)){var r=new Uint8Array(e);this.accommodate(r.byteLength);var i=new Uint8Array(this.data.buffer);return i.set(r,this.write),this.write+=r.byteLength,this}if(e instanceof T.DataBuffer||typeof e=="object"&&typeof e.read=="number"&&typeof e.write=="number"&&T.isArrayBufferView(e.data)){var r=new Uint8Array(e.data.byteLength,e.read,e.length());this.accommodate(r.byteLength);var i=new Uint8Array(e.data.byteLength,this.write);return i.set(r),this.write+=r.byteLength,this}if(e instanceof T.ByteStringBuffer&&(e=e.data,t="binary"),t=t||"binary",typeof e=="string"){var a;if(t==="hex")return this.accommodate(Math.ceil(e.length/2)),a=new Uint8Array(this.data.buffer,this.write),this.write+=T.binary.hex.decode(e,a,this.write),this;if(t==="base64")return this.accommodate(Math.ceil(e.length/4)*3),a=new Uint8Array(this.data.buffer,this.write),this.write+=T.binary.base64.decode(e,a,this.write),this;if(t==="utf8"&&(e=T.encodeUtf8(e),t="binary"),t==="binary"||t==="raw")return this.accommodate(e.length),a=new Uint8Array(this.data.buffer,this.write),this.write+=T.binary.raw.decode(a),this;if(t==="utf16")return this.accommodate(e.length*2),a=new Uint16Array(this.data.buffer,this.write),this.write+=T.text.utf16.encode(a),this;throw new Error("Invalid encoding: "+t)}throw Error("Invalid parameter: "+e)};T.DataBuffer.prototype.putBuffer=function(e){return this.putBytes(e),e.clear(),this};T.DataBuffer.prototype.putString=function(e){return this.putBytes(e,"utf16")};T.DataBuffer.prototype.putInt16=function(e){return this.accommodate(2),this.data.setInt16(this.write,e),this.write+=2,this};T.DataBuffer.prototype.putInt24=function(e){return this.accommodate(3),this.data.setInt16(this.write,e>>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this};T.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this};T.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this};T.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this};T.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this};T.DataBuffer.prototype.putInt=function(e,t){Hi(t),this.accommodate(t/8);do t-=8,this.data.setInt8(this.write++,e>>t&255);while(t>0);return this};T.DataBuffer.prototype.putSignedInt=function(e,t){return Hi(t),this.accommodate(t/8),e<0&&(e+=2<<t-1),this.putInt(e,t)};T.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)};T.DataBuffer.prototype.getInt16=function(){var e=this.data.getInt16(this.read);return this.read+=2,e};T.DataBuffer.prototype.getInt24=function(){var e=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,e};T.DataBuffer.prototype.getInt32=function(){var e=this.data.getInt32(this.read);return this.read+=4,e};T.DataBuffer.prototype.getInt16Le=function(){var e=this.data.getInt16(this.read,!0);return this.read+=2,e};T.DataBuffer.prototype.getInt24Le=function(){var e=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,e};T.DataBuffer.prototype.getInt32Le=function(){var e=this.data.getInt32(this.read,!0);return this.read+=4,e};T.DataBuffer.prototype.getInt=function(e){Hi(e);var t=0;do t=(t<<8)+this.data.getInt8(this.read++),e-=8;while(e>0);return t};T.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t};T.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):e===0?t="":(t=this.read===0?this.data:this.data.slice(this.read),this.clear()),t};T.DataBuffer.prototype.bytes=function(e){return typeof e=="undefined"?this.data.slice(this.read):this.data.slice(this.read,this.read+e)};T.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)};T.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this};T.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};T.DataBuffer.prototype.copy=function(){return new T.DataBuffer(this)};T.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this};T.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};T.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this};T.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.byteLength;++t){var r=this.data.getUint8(t);r<16&&(e+="0"),e+=r.toString(16)}return e};T.DataBuffer.prototype.toString=function(e){var t=new Uint8Array(this.data,this.read,this.length());if(e=e||"utf8",e==="binary"||e==="raw")return T.binary.raw.encode(t);if(e==="hex")return T.binary.hex.encode(t);if(e==="base64")return T.binary.base64.encode(t);if(e==="utf8")return T.text.utf8.decode(t);if(e==="utf16")return T.text.utf16.decode(t);throw new Error("Invalid encoding: "+e)};T.createBuffer=function(e,t){return t=t||"raw",e!==void 0&&t==="utf8"&&(e=T.encodeUtf8(e)),new T.ByteBuffer(e)};T.fillString=function(e,t){for(var r="";t>0;)t&1&&(r+=e),t>>>=1,t>0&&(e+=e);return r};T.xorBytes=function(e,t,r){for(var n="",i="",a="",s=0,o=0;r>0;--r,++s)i=e.charCodeAt(s)^t.charCodeAt(s),o>=10&&(n+=a,a="",o=0),a+=String.fromCharCode(i),++o;return n+=a,n};T.hexToBytes=function(e){var t="",r=0;for(e.length&!0&&(r=1,t+=String.fromCharCode(parseInt(e[0],16)));r<e.length;r+=2)t+=String.fromCharCode(parseInt(e.substr(r,2),16));return t};T.bytesToHex=function(e){return T.createBuffer(e).toHex()};T.int32ToBytes=function(e){return String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255)};var Wr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Qr=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],gh="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";T.encode64=function(e,t){for(var r="",n="",i,a,s,o=0;o<e.length;)i=e.charCodeAt(o++),a=e.charCodeAt(o++),s=e.charCodeAt(o++),r+=Wr.charAt(i>>2),r+=Wr.charAt((i&3)<<4|a>>4),isNaN(a)?r+="==":(r+=Wr.charAt((a&15)<<2|s>>6),r+=isNaN(s)?"=":Wr.charAt(s&63)),t&&r.length>t&&(n+=r.substr(0,t)+`\r `,r=r.substr(t));return n+=r,n};T.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t="",r,n,i,a,s=0;s<e.length;)r=Qr[e.charCodeAt(s++)-43],n=Qr[e.charCodeAt(s++)-43],i=Qr[e.charCodeAt(s++)-43],a=Qr[e.charCodeAt(s++)-43],t+=String.fromCharCode(r<<2|n>>4),i!==64&&(t+=String.fromCharCode((n&15)<<4|i>>2),a!==64&&(t+=String.fromCharCode((i&3)<<6|a)));return t};T.encodeUtf8=function(e){return unescape(encodeURIComponent(e))};T.decodeUtf8=function(e){return decodeURIComponent(escape(e))};T.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:yh.encode,decode:yh.decode}};T.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)};T.binary.raw.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(e.length)),r=r||0;for(var i=r,a=0;a<e.length;++a)n[i++]=e.charCodeAt(a);return t?i-r:n};T.binary.hex.encode=T.bytesToHex;T.binary.hex.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(Math.ceil(e.length/2))),r=r||0;var i=0,a=r;for(e.length&1&&(i=1,n[a++]=parseInt(e[0],16));i<e.length;i+=2)n[a++]=parseInt(e.substr(i,2),16);return t?a-r:n};T.binary.base64.encode=function(e,t){for(var r="",n="",i,a,s,o=0;o<e.byteLength;)i=e[o++],a=e[o++],s=e[o++],r+=Wr.charAt(i>>2),r+=Wr.charAt((i&3)<<4|a>>4),isNaN(a)?r+="==":(r+=Wr.charAt((a&15)<<2|s>>6),r+=isNaN(s)?"=":Wr.charAt(s&63)),t&&r.length>t&&(n+=r.substr(0,t)+`\r `,r=r.substr(t));return n+=r,n};T.binary.base64.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(Math.ceil(e.length/4)*3)),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,""),r=r||0;for(var i,a,s,o,u=0,c=r;u<e.length;)i=Qr[e.charCodeAt(u++)-43],a=Qr[e.charCodeAt(u++)-43],s=Qr[e.charCodeAt(u++)-43],o=Qr[e.charCodeAt(u++)-43],n[c++]=i<<2|a>>4,s!==64&&(n[c++]=(a&15)<<4|s>>2,o!==64&&(n[c++]=(s&3)<<6|o));return t?c-r:n.subarray(0,c)};T.binary.base58.encode=function(e,t){return T.binary.baseN.encode(e,gh,t)};T.binary.base58.decode=function(e,t){return T.binary.baseN.decode(e,gh,t)};T.text={utf8:{},utf16:{}};T.text.utf8.encode=function(e,t,r){e=T.encodeUtf8(e);var n=t;n||(n=new Uint8Array(e.length)),r=r||0;for(var i=r,a=0;a<e.length;++a)n[i++]=e.charCodeAt(a);return t?i-r:n};T.text.utf8.decode=function(e){return T.decodeUtf8(String.fromCharCode.apply(null,e))};T.text.utf16.encode=function(e,t,r){var n=t;n||(n=new Uint8Array(e.length*2));var i=new Uint16Array(n.buffer);r=r||0;for(var a=r,s=r,o=0;o<e.length;++o)i[s++]=e.charCodeAt(o),a+=2;return t?a-r:n};T.text.utf16.decode=function(e){return String.fromCharCode.apply(null,new Uint16Array(e.buffer))};T.deflate=function(e,t,r){if(t=T.decode64(e.deflate(T.encode64(t)).rval),r){var n=2,i=t.charCodeAt(1);i&32&&(n=6),t=t.substring(n,t.length-4)}return t};T.inflate=function(e,t,r){var n=e.inflate(T.encode64(t)).rval;return n===null?null:T.decode64(n)};var vc=function(e,t,r){if(!e)throw new Error("WebStorage not available.");var n;if(r===null?n=e.removeItem(t):(r=T.encode64(JSON.stringify(r)),n=e.setItem(t,r)),typeof n!="undefined"&&n.rval!==!0){var i=new Error(n.error.message);throw i.id=n.error.id,i.name=n.error.name,i}},yc=function(e,t){if(!e)throw new Error("WebStorage not available.");var r=e.getItem(t);if(e.init)if(r.rval===null){if(r.error){var n=new Error(r.error.message);throw n.id=r.error.id,n.name=r.error.name,n}r=null}else r=r.rval;return r!==null&&(r=JSON.parse(T.decode64(r))),r},EE=function(e,t,r,n){var i=yc(e,t);i===null&&(i={}),i[r]=n,vc(e,t,i)},bE=function(e,t,r){var n=yc(e,t);return n!==null&&(n=r in n?n[r]:null),n},xE=function(e,t,r){var n=yc(e,t);if(n!==null&&r in n){delete n[r];var i=!0;for(var a in n){i=!1;break}i&&(n=null),vc(e,t,n)}},TE=function(e,t){vc(e,t,null)},Xa=function(e,t,r){var n=null;typeof r=="undefined"&&(r=["web","flash"]);var i,a=!1,s=null;for(var o in r){i=r[o];try{if(i==="flash"||i==="both"){if(t[0]===null)throw new Error("Flash local storage not available.");n=e.apply(this,t),a=i==="flash"}(i==="web"||i==="both")&&(t[0]=localStorage,n=e.apply(this,t),a=!0)}catch(u){s=u}if(a)break}if(!a)throw s;return n};T.setItem=function(e,t,r,n,i){Xa(EE,arguments,i)};T.getItem=function(e,t,r,n){return Xa(bE,arguments,n)};T.removeItem=function(e,t,r,n){Xa(xE,arguments,n)};T.clearItems=function(e,t,r){Xa(TE,arguments,r)};T.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0};T.format=function(e){for(var t=/%./g,r,n,i=0,a=[],s=0;r=t.exec(e);){n=e.substring(s,t.lastIndex-2),n.length>0&&a.push(n),s=t.lastIndex;var o=r[0][1];switch(o){case"s":case"o":i<arguments.length?a.push(arguments[i+++1]):a.push("<?>");break;case"%":a.push("%");break;default:a.push("<%"+o+"?>")}}return a.push(e.substring(s)),a.join("")};T.formatNumber=function(e,t,r,n){var i=e,a=isNaN(t=Math.abs(t))?2:t,s=r===void 0?",":r,o=n===void 0?".":n,u=i<0?"-":"",c=parseInt(i=Math.abs(+i||0).toFixed(a),10)+"",l=c.length>3?c.length%3:0;return u+(l?c.substr(0,l)+o:"")+c.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+o)+(a?s+Math.abs(i-c).toFixed(a).slice(2):"")};T.formatSize=function(e){return e>=1073741824?e=T.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?e=T.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?e=T.formatNumber(e/1024,0)+" KiB":e=T.formatNumber(e,0)+" bytes",e};T.bytesFromIP=function(e){return e.indexOf(".")!==-1?T.bytesFromIPv4(e):e.indexOf(":")!==-1?T.bytesFromIPv6(e):null};T.bytesFromIPv4=function(e){if(e=e.split("."),e.length!==4)return null;for(var t=T.createBuffer(),r=0;r<e.length;++r){var n=parseInt(e[r],10);if(isNaN(n))return null;t.putByte(n)}return t.getBytes()};T.bytesFromIPv6=function(e){var t=0;e=e.split(":").filter(function(s){return s.length===0&&++t,!0});for(var r=(8-e.length+t)*2,n=T.createBuffer(),i=0;i<8;++i){if(!e[i]||e[i].length===0){n.fillWithByte(0,r),r=0;continue}var a=T.hexToBytes(e[i]);a.length<2&&n.putByte(0),n.putBytes(a)}return n.getBytes()};T.bytesToIP=function(e){return e.length===4?T.bytesToIPv4(e):e.length===16?T.bytesToIPv6(e):null};T.bytesToIPv4=function(e){if(e.length!==4)return null;for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t.join(".")};T.bytesToIPv6=function(e){if(e.length!==16)return null;for(var t=[],r=[],n=0,i=0;i<e.length;i+=2){for(var a=T.bytesToHex(e[i]+e[i+1]);a[0]==="0"&&a!=="0";)a=a.substr(1);if(a==="0"){var s=r[r.length-1],o=t.length;!s||o!==s.end+1?r.push({start:o,end:o}):(s.end=o,s.end-s.start>r[n].end-r[n].start&&(n=r.length-1))}t.push(a)}if(r.length>0){var u=r[n];u.end-u.start>0&&(t.splice(u.start,u.end-u.start+1,""),u.start===0&&t.unshift(""),u.end===7&&t.push(""))}return t.join(":")};T.estimateCores=function(e,t){if(typeof e=="function"&&(t=e,e={}),e=e||{},"cores"in T&&!e.update)return t(null,T.cores);if(typeof navigator!="undefined"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return T.cores=navigator.hardwareConcurrency,t(null,T.cores);if(typeof Worker=="undefined")return T.cores=1,t(null,T.cores);if(typeof Blob=="undefined")return T.cores=2,t(null,T.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(s){for(var o=Date.now(),u=o+4;Date.now()<u;);self.postMessage({st:o,et:u})})}.toString(),")()"],{type:"application/javascript"}));n([],5,16);function n(s,o,u){if(o===0){var c=Math.floor(s.reduce(function(l,f){return l+f},0)/s.length);return T.cores=Math.max(1,c),URL.revokeObjectURL(r),t(null,T.cores)}i(u,function(l,f){s.push(a(u,f)),n(s,o-1,u)})}function i(s,o){for(var u=[],c=[],l=0;l<s;++l){var f=new Worker(r);f.addEventListener("message",function(h){if(c.push(h.data),c.length===s){for(var p=0;p<s;++p)u[p].terminate();o(null,c)}}),u.push(f)}for(var l=0;l<s;++l)u[l].postMessage(l)}function a(s,o){for(var u=[],c=0;c<s;++c)for(var l=o[c],f=u[c]=[],h=0;h<s;++h)if(c!==h){var p=o[h];(l.st>p.st&&l.st<p.et||p.st>l.st&&p.st<l.et)&&f.push(h)}return u.reduce(function(d,m){return Math.max(d,m.length)},0)}}});var Ja=b((_O,Sh)=>{var qe=ee();de();Sh.exports=qe.cipher=qe.cipher||{};qe.cipher.algorithms=qe.cipher.algorithms||{};qe.cipher.createCipher=function(e,t){var r=e;if(typeof r=="string"&&(r=qe.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+e);return new qe.cipher.BlockCipher({algorithm:r,key:t,decrypt:!1})};qe.cipher.createDecipher=function(e,t){var r=e;if(typeof r=="string"&&(r=qe.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+e);return new qe.cipher.BlockCipher({algorithm:r,key:t,decrypt:!0})};qe.cipher.registerAlgorithm=function(e,t){e=e.toUpperCase(),qe.cipher.algorithms[e]=t};qe.cipher.getAlgorithm=function(e){return e=e.toUpperCase(),e in qe.cipher.algorithms?qe.cipher.algorithms[e]:null};var gc=qe.cipher.BlockCipher=function(e){this.algorithm=e.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=e.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=e.decrypt,this.algorithm.initialize(e)};gc.prototype.start=function(e){e=e||{};var t={};for(var r in e)t[r]=e[r];t.decrypt=this._decrypt,this._finish=!1,this._input=qe.util.createBuffer(),this.output=e.output||qe.util.createBuffer(),this.mode.start(t)};gc.prototype.update=function(e){for(e&&this._input.putBuffer(e);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()};gc.prototype.finish=function(e){e&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(r){return e(this.blockSize,r,!1)},this.mode.unpad=function(r){return e(this.blockSize,r,!0)});var t={};return t.decrypt=this._decrypt,t.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,t)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,t))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,t))}});var Sc=b((BO,Ch)=>{var Me=ee();de();Me.cipher=Me.cipher||{};var ie=Ch.exports=Me.cipher.modes=Me.cipher.modes||{};ie.ecb=function(e){e=e||{},this.name="ECB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};ie.ecb.prototype.start=function(e){};ie.ecb.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])};ie.ecb.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])};ie.ecb.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0};ie.ecb.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),n=e.at(r-1);return n>this.blockSize<<2?!1:(e.truncate(n),!0)};ie.cbc=function(e){e=e||{},this.name="CBC",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};ie.cbc.prototype.start=function(e){if(e.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in e)this._iv=Za(e.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};ie.cbc.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=this._prev[n]^e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)t.putInt32(this._outBlock[n]);this._prev=this._outBlock};ie.cbc.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)t.putInt32(this._prev[n]^this._outBlock[n]);this._prev=this._inBlock.slice(0)};ie.cbc.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0};ie.cbc.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),n=e.at(r-1);return n>this.blockSize<<2?!1:(e.truncate(n),!0)};ie.cfb=function(e){e=e||{},this.name="CFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=Me.util.createBuffer(),this._partialBytes=0};ie.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=Za(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};ie.cfb.prototype.encrypt=function(e,t,r){var n=e.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32()^this._outBlock[i],t.putInt32(this._inBlock[i]);return}var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32()^this._outBlock[i],this._partialOutput.putInt32(this._partialBlock[i]);if(a>0)e.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};ie.cfb.prototype.decrypt=function(e,t,r){var n=e.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32(),t.putInt32(this._inBlock[i]^this._outBlock[i]);return}var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32(),this._partialOutput.putInt32(this._partialBlock[i]^this._outBlock[i]);if(a>0)e.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};ie.ofb=function(e){e=e||{},this.name="OFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=Me.util.createBuffer(),this._partialBytes=0};ie.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=Za(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};ie.ofb.prototype.encrypt=function(e,t,r){var n=e.length();if(e.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]),this._inBlock[i]=this._outBlock[i];return}var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(a>0)e.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._outBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};ie.ofb.prototype.decrypt=ie.ofb.prototype.encrypt;ie.ctr=function(e){e=e||{},this.name="CTR",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=Me.util.createBuffer(),this._partialBytes=0};ie.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=Za(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};ie.ctr.prototype.encrypt=function(e,t,r){var n=e.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize)for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]);else{var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(a>0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}es(this._inBlock)};ie.ctr.prototype.decrypt=ie.ctr.prototype.encrypt;ie.gcm=function(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=Me.util.createBuffer(),this._partialBytes=0,this._R=3774873600};ie.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t=Me.util.createBuffer(e.iv);this._cipherLength=0;var r;if("additionalData"in e?r=Me.util.createBuffer(e.additionalData):r=Me.util.createBuffer(),"tagLength"in e?this._tagLength=e.tagLength:this._tagLength=128,this._tag=null,e.decrypt&&(this._tag=Me.util.createBuffer(e.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var n=t.length();if(n===12)this._j0=[t.getInt32(),t.getInt32(),t.getInt32(),1];else{for(this._j0=[0,0,0,0];t.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(mc(n*8)))}this._inBlock=this._j0.slice(0),es(this._inBlock),this._partialBytes=0,r=Me.util.createBuffer(r),this._aDataLength=mc(r.length()*8);var i=r.length()%this.blockSize;for(i&&r.fillWithByte(0,this.blockSize-i),this._s=[0,0,0,0];r.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()])};ie.gcm.prototype.encrypt=function(e,t,r){var n=e.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^=e.getInt32());this._cipherLength+=this.blockSize}else{var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(a<=0||r){if(r){var s=n%this.blockSize;this._cipherLength+=s,this._partialOutput.truncate(this.blockSize-s)}else this._cipherLength+=this.blockSize;for(var i=0;i<this._ints;++i)this._outBlock[i]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),es(this._inBlock)};ie.gcm.prototype.decrypt=function(e,t,r){var n=e.length();if(n<this.blockSize&&!(r&&n>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),es(this._inBlock),this._hashBlock[0]=e.getInt32(),this._hashBlock[1]=e.getInt32(),this._hashBlock[2]=e.getInt32(),this._hashBlock[3]=e.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^this._hashBlock[i]);n<this.blockSize?this._cipherLength+=n%this.blockSize:this._cipherLength+=this.blockSize};ie.gcm.prototype.afterFinish=function(e,t){var r=!0;t.decrypt&&t.overflow&&e.truncate(this.blockSize-t.overflow),this.tag=Me.util.createBuffer();var n=this._aDataLength.concat(mc(this._cipherLength*8));this._s=this.ghash(this._hashSubkey,this._s,n);var i=[];this.cipher.encrypt(this._j0,i);for(var a=0;a<this._ints;++a)this.tag.putInt32(this._s[a]^i[a]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),t.decrypt&&this.tag.bytes()!==this._tag&&(r=!1),r};ie.gcm.prototype.multiply=function(e,t){for(var r=[0,0,0,0],n=t.slice(0),i=0;i<128;++i){var a=e[i/32|0]&1<<31-i%32;a&&(r[0]^=n[0],r[1]^=n[1],r[2]^=n[2],r[3]^=n[3]),this.pow(n,n)}return r};ie.gcm.prototype.pow=function(e,t){for(var r=e[3]&1,n=3;n>0;--n)t[n]=e[n]>>>1|(e[n-1]&1)<<31;t[0]=e[0]>>>1,r&&(t[0]^=this._R)};ie.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],r=0;r<32;++r){var n=r/8|0,i=e[n]>>>(7-r%8)*4&15,a=this._m[r][i];t[0]^=a[0],t[1]^=a[1],t[2]^=a[2],t[3]^=a[3]}return t};ie.gcm.prototype.ghash=function(e,t,r){return t[0]^=r[0],t[1]^=r[1],t[2]^=r[2],t[3]^=r[3],this.tableMultiply(t)};ie.gcm.prototype.generateHashTable=function(e,t){for(var r=8/t,n=4*r,i=16*r,a=new Array(i),s=0;s<i;++s){var o=[0,0,0,0],u=s/n|0,c=(n-1-s%n)*t;o[u]=1<<t-1<<c,a[s]=this.generateSubHashTable(this.multiply(o,e),t)}return a};ie.gcm.prototype.generateSubHashTable=function(e,t){var r=1<<t,n=r>>>1,i=new Array(r);i[n]=e.slice(0);for(var a=n>>>1;a>0;)this.pow(i[2*a],i[a]=[]),a>>=1;for(a=2;a<n;){for(var s=1;s<a;++s){var o=i[a],u=i[s];i[a+s]=[o[0]^u[0],o[1]^u[1],o[2]^u[2],o[3]^u[3]]}a*=2}for(i[0]=[0,0,0,0],a=n+1;a<r;++a){var c=i[a^n];i[a]=[e[0]^c[0],e[1]^c[1],e[2]^c[2],e[3]^c[3]]}return i};function Za(e,t){if(typeof e=="string"&&(e=Me.util.createBuffer(e)),Me.util.isArray(e)&&e.length>4){var r=e;e=Me.util.createBuffer();for(var n=0;n<r.length;++n)e.putByte(r[n])}if(e.length()<t)throw new Error("Invalid IV length; got "+e.length()+" bytes and expected "+t+" bytes.");if(!Me.util.isArray(e)){for(var i=[],a=t/4,n=0;n<a;++n)i.push(e.getInt32());e=i}return e}function es(e){e[e.length-1]=e[e.length-1]+1&4294967295}function mc(e){return[e/4294967296|0,e&4294967295]}});var Yr=b((RO,Th)=>{var be=ee();Ja();Sc();de();Th.exports=be.aes=be.aes||{};be.aes.startEncrypting=function(e,t,r,n){var i=ts({key:e,output:r,decrypt:!1,mode:n});return i.start(t),i};be.aes.createEncryptionCipher=function(e,t){return ts({key:e,output:null,decrypt:!1,mode:t})};be.aes.startDecrypting=function(e,t,r,n){var i=ts({key:e,output:r,decrypt:!0,mode:n});return i.start(t),i};be.aes.createDecryptionCipher=function(e,t){return ts({key:e,output:null,decrypt:!0,mode:t})};be.aes.Algorithm=function(e,t){bc||bh();var r=this;r.name=e,r.mode=new t({blockSize:16,cipher:{encrypt:function(n,i){return Ec(r._w,n,i,!1)},decrypt:function(n,i){return Ec(r._w,n,i,!0)}}}),r._init=!1};be.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t=e.key,r;if(typeof t=="string"&&(t.length===16||t.length===24||t.length===32))t=be.util.createBuffer(t);else if(be.util.isArray(t)&&(t.length===16||t.length===24||t.length===32)){r=t,t=be.util.createBuffer();for(var n=0;n<r.length;++n)t.putByte(r[n])}if(!be.util.isArray(t)){r=t,t=[];var i=r.length();if(i===16||i===24||i===32){i=i>>>2;for(var n=0;n<i;++n)t.push(r.getInt32())}}if(!be.util.isArray(t)||!(t.length===4||t.length===6||t.length===8))throw new Error("Invalid key parameter.");var a=this.mode.name,s=["CFB","OFB","CTR","GCM"].indexOf(a)!==-1;this._w=xh(t,e.decrypt&&!s),this._init=!0}};be.aes._expandKey=function(e,t){return bc||bh(),xh(e,t)};be.aes._updateBlock=Ec;ri("AES-ECB",be.cipher.modes.ecb);ri("AES-CBC",be.cipher.modes.cbc);ri("AES-CFB",be.cipher.modes.cfb);ri("AES-OFB",be.cipher.modes.ofb);ri("AES-CTR",be.cipher.modes.ctr);ri("AES-GCM",be.cipher.modes.gcm);function ri(e,t){var r=function(){return new be.aes.Algorithm(e,t)};be.cipher.registerAlgorithm(e,r)}var bc=!1,ti=4,vt,Cc,Eh,_n,jt;function bh(){bc=!0,Eh=[0,1,2,4,8,16,32,64,128,27,54];for(var e=new Array(256),t=0;t<128;++t)e[t]=t<<1,e[t+128]=t+128<<1^283;vt=new Array(256),Cc=new Array(256),_n=new Array(4),jt=new Array(4);for(var t=0;t<4;++t)_n[t]=new Array(256),jt[t]=new Array(256);for(var r=0,n=0,i,a,s,o,u,c,l,t=0;t<256;++t){o=n^n<<1^n<<2^n<<3^n<<4,o=o>>8^o&255^99,vt[r]=o,Cc[o]=r,u=e[o],i=e[r],a=e[i],s=e[a],c=u<<24^o<<16^o<<8^(o^u),l=(i^a^s)<<24^(r^s)<<16^(r^a^s)<<8^(r^i^s);for(var f=0;f<4;++f)_n[f][r]=c,jt[f][o]=l,c=c<<24|c>>>8,l=l<<24|l>>>8;r===0?r=n=1:(r=i^e[e[e[i^s]]],n^=e[e[n]])}}function xh(e,t){for(var r=e.slice(0),n,i=1,a=r.length,s=a+6+1,o=ti*s,u=a;u<o;++u)n=r[u-1],u%a===0?(n=vt[n>>>16&255]<<24^vt[n>>>8&255]<<16^vt[n&255]<<8^vt[n>>>24]^Eh[i]<<24,i++):a>6&&u%a===4&&(n=vt[n>>>24]<<24^vt[n>>>16&255]<<16^vt[n>>>8&255]<<8^vt[n&255]),r[u]=r[u-a]^n;if(t){var c,l=jt[0],f=jt[1],h=jt[2],p=jt[3],d=r.slice(0);o=r.length;for(var u=0,m=o-ti;u<o;u+=ti,m-=ti)if(u===0||u===o-ti)d[u]=r[m],d[u+1]=r[m+3],d[u+2]=r[m+2],d[u+3]=r[m+1];else for(var S=0;S<ti;++S)c=r[m+S],d[u+(3&-S)]=l[vt[c>>>24]]^f[vt[c>>>16&255]]^h[vt[c>>>8&255]]^p[vt[c&255]];r=d}return r}function Ec(e,t,r,n){var i=e.length/4-1,a,s,o,u,c;n?(a=jt[0],s=jt[1],o=jt[2],u=jt[3],c=Cc):(a=_n[0],s=_n[1],o=_n[2],u=_n[3],c=vt);var l,f,h,p,d,m,S;l=t[0]^e[0],f=t[n?3:1]^e[1],h=t[2]^e[2],p=t[n?1:3]^e[3];for(var E=3,I=1;I<i;++I)d=a[l>>>24]^s[f>>>16&255]^o[h>>>8&255]^u[p&255]^e[++E],m=a[f>>>24]^s[h>>>16&255]^o[p>>>8&255]^u[l&255]^e[++E],S=a[h>>>24]^s[p>>>16&255]^o[l>>>8&255]^u[f&255]^e[++E],p=a[p>>>24]^s[l>>>16&255]^o[f>>>8&255]^u[h&255]^e[++E],l=d,f=m,h=S;r[0]=c[l>>>24]<<24^c[f>>>16&255]<<16^c[h>>>8&255]<<8^c[p&255]^e[++E],r[n?3:1]=c[f>>>24]<<24^c[h>>>16&255]<<16^c[p>>>8&255]<<8^c[l&255]^e[++E],r[2]=c[h>>>24]<<24^c[p>>>16&255]<<16^c[l>>>8&255]<<8^c[f&255]^e[++E],r[n?1:3]=c[p>>>24]<<24^c[l>>>16&255]<<16^c[f>>>8&255]<<8^c[h&255]^e[++E]}function ts(e){e=e||{};var t=(e.mode||"CBC").toUpperCase(),r="AES-"+t,n;e.decrypt?n=be.cipher.createDecipher(r,e.key):n=be.cipher.createCipher(r,e.key);var i=n.start;return n.start=function(a,s){var o=null;s instanceof be.util.ByteBuffer&&(o=s,s={}),s=s||{},s.output=o,s.iv=a,i.call(n,s)},n}});var Xr=b((NO,Ah)=>{var $i=ee();$i.pki=$i.pki||{};var xc=Ah.exports=$i.pki.oids=$i.oids=$i.oids||{};function L(e,t){xc[e]=t,xc[t]=e}function ge(e,t){xc[e]=t}L("1.2.840.113549.1.1.1","rsaEncryption");L("1.2.840.113549.1.1.4","md5WithRSAEncryption");L("1.2.840.113549.1.1.5","sha1WithRSAEncryption");L("1.2.840.113549.1.1.7","RSAES-OAEP");L("1.2.840.113549.1.1.8","mgf1");L("1.2.840.113549.1.1.9","pSpecified");L("1.2.840.113549.1.1.10","RSASSA-PSS");L("1.2.840.113549.1.1.11","sha256WithRSAEncryption");L("1.2.840.113549.1.1.12","sha384WithRSAEncryption");L("1.2.840.113549.1.1.13","sha512WithRSAEncryption");L("1.3.101.112","EdDSA25519");L("1.2.840.10040.4.3","dsa-with-sha1");L("1.3.14.3.2.7","desCBC");L("1.3.14.3.2.26","sha1");L("1.3.14.3.2.29","sha1WithRSASignature");L("2.16.840.1.101.3.4.2.1","sha256");L("2.16.840.1.101.3.4.2.2","sha384");L("2.16.840.1.101.3.4.2.3","sha512");L("2.16.840.1.101.3.4.2.4","sha224");L("2.16.840.1.101.3.4.2.5","sha512-224");L("2.16.840.1.101.3.4.2.6","sha512-256");L("1.2.840.113549.2.2","md2");L("1.2.840.113549.2.5","md5");L("1.2.840.113549.1.7.1","data");L("1.2.840.113549.1.7.2","signedData");L("1.2.840.113549.1.7.3","envelopedData");L("1.2.840.113549.1.7.4","signedAndEnvelopedData");L("1.2.840.113549.1.7.5","digestedData");L("1.2.840.113549.1.7.6","encryptedData");L("1.2.840.113549.1.9.1","emailAddress");L("1.2.840.113549.1.9.2","unstructuredName");L("1.2.840.113549.1.9.3","contentType");L("1.2.840.113549.1.9.4","messageDigest");L("1.2.840.113549.1.9.5","signingTime");L("1.2.840.113549.1.9.6","counterSignature");L("1.2.840.113549.1.9.7","challengePassword");L("1.2.840.113549.1.9.8","unstructuredAddress");L("1.2.840.113549.1.9.14","extensionRequest");L("1.2.840.113549.1.9.20","friendlyName");L("1.2.840.113549.1.9.21","localKeyId");L("1.2.840.113549.1.9.22.1","x509Certificate");L("1.2.840.113549.1.12.10.1.1","keyBag");L("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");L("1.2.840.113549.1.12.10.1.3","certBag");L("1.2.840.113549.1.12.10.1.4","crlBag");L("1.2.840.113549.1.12.10.1.5","secretBag");L("1.2.840.113549.1.12.10.1.6","safeContentsBag");L("1.2.840.113549.1.5.13","pkcs5PBES2");L("1.2.840.113549.1.5.12","pkcs5PBKDF2");L("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");L("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");L("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");L("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");L("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");L("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");L("1.2.840.113549.2.7","hmacWithSHA1");L("1.2.840.113549.2.8","hmacWithSHA224");L("1.2.840.113549.2.9","hmacWithSHA256");L("1.2.840.113549.2.10","hmacWithSHA384");L("1.2.840.113549.2.11","hmacWithSHA512");L("1.2.840.113549.3.7","des-EDE3-CBC");L("2.16.840.1.101.3.4.1.2","aes128-CBC");L("2.16.840.1.101.3.4.1.22","aes192-CBC");L("2.16.840.1.101.3.4.1.42","aes256-CBC");L("2.5.4.3","commonName");L("2.5.4.4","surname");L("2.5.4.5","serialNumber");L("2.5.4.6","countryName");L("2.5.4.7","localityName");L("2.5.4.8","stateOrProvinceName");L("2.5.4.9","streetAddress");L("2.5.4.10","organizationName");L("2.5.4.11","organizationalUnitName");L("2.5.4.12","title");L("2.5.4.13","description");L("2.5.4.15","businessCategory");L("2.5.4.17","postalCode");L("2.5.4.42","givenName");L("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");L("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");L("2.16.840.1.113730.1.1","nsCertType");L("2.16.840.1.113730.1.13","nsComment");ge("2.5.29.1","authorityKeyIdentifier");ge("2.5.29.2","keyAttributes");ge("2.5.29.3","certificatePolicies");ge("2.5.29.4","keyUsageRestriction");ge("2.5.29.5","policyMapping");ge("2.5.29.6","subtreesConstraint");ge("2.5.29.7","subjectAltName");ge("2.5.29.8","issuerAltName");ge("2.5.29.9","subjectDirectoryAttributes");ge("2.5.29.10","basicConstraints");ge("2.5.29.11","nameConstraints");ge("2.5.29.12","policyConstraints");ge("2.5.29.13","basicConstraints");L("2.5.29.14","subjectKeyIdentifier");L("2.5.29.15","keyUsage");ge("2.5.29.16","privateKeyUsagePeriod");L("2.5.29.17","subjectAltName");L("2.5.29.18","issuerAltName");L("2.5.29.19","basicConstraints");ge("2.5.29.20","cRLNumber");ge("2.5.29.21","cRLReason");ge("2.5.29.22","expirationDate");ge("2.5.29.23","instructionCode");ge("2.5.29.24","invalidityDate");ge("2.5.29.25","cRLDistributionPoints");ge("2.5.29.26","issuingDistributionPoint");ge("2.5.29.27","deltaCRLIndicator");ge("2.5.29.28","issuingDistributionPoint");ge("2.5.29.29","certificateIssuer");ge("2.5.29.30","nameConstraints");L("2.5.29.31","cRLDistributionPoints");L("2.5.29.32","certificatePolicies");ge("2.5.29.33",