>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(g[t])return g[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new w;else if("p192"===t)e=new b;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return g[t]=e,e},E.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},E.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},E.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},E.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},E.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},E.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},E.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},E.prototype.isqr=function(t){return this.imul(t,t.clone())},E.prototype.sqr=function(t){return this.mul(t,t)},E.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,u).cmp(h);)l.redIAdd(h);for(var c=this.pow(l,n),f=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();i(g=0;i--){for(var u=e.words[i],l=h-1;l>=0;l--){var c=u>>l&1;n!==r[0]&&(n=this.sqr(n)),0!==c||0!==s?(s<<=1,s|=c,(4==++a||0===i&&0===l)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}h=26}return n},E.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},E.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new A(t)},n(A,E),A.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},A.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},A.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},A.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},A.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},(t,e,r)=>{var i=r(15);t.exports=function(t){return"string"!=typeof t?t:i(t)?t.slice(2):t}},t=>{t.exports=function(t){if("string"!=typeof t)throw new Error("[is-hex-prefixed] value must be type 'string', is currently type "+typeof t+", while checking isHexPrefixed.");return"0x"===t.slice(0,2)}},(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>i}),r(17);const i=window.crypto},(t,e,r)=>{"use strict";var i,n;r.r(e),r.d(e,{default:()=>o}),i="undefined"!=typeof self?self:void 0,n=function(t){if("function"!=typeof Promise)throw"Promise support required";var e=t.crypto||t.msCrypto;if(e){var r=e.subtle||e.webkitSubtle;if(r){var i=t.Crypto||e.constructor||Object,n=t.SubtleCrypto||r.constructor||Object,o=(t.CryptoKey||t.Key,t.navigator.userAgent.indexOf("Edge/")>-1),s=!!t.msCrypto&&!o,a=!e.subtle&&!!e.webkitSubtle;if(s||a){var h={KoZIhvcNAQEB:"1.2.840.113549.1.1.1"},u={"1.2.840.113549.1.1.1":"KoZIhvcNAQEB"};if(["generateKey","importKey","unwrapKey"].forEach((function(t){var i=r[t];r[t]=function(n,o,h){var u,l,c,p,b=[].slice.call(arguments);switch(t){case"generateKey":u=m(n),l=o,c=h;break;case"importKey":u=m(h),l=b[3],c=b[4],"jwk"===n&&((o=v(o)).alg||(o.alg=g(u)),o.key_ops||(o.key_ops="oct"!==o.kty?"d"in o?c.filter(B):c.filter(C):c.slice()),b[1]=y(o));break;case"unwrapKey":u=b[4],l=b[5],c=b[6],b[2]=h._key}if("generateKey"===t&&"HMAC"===u.name&&u.hash)return u.length=u.length||{"SHA-1":512,"SHA-256":512,"SHA-384":1024,"SHA-512":1024}[u.hash.name],r.importKey("raw",e.getRandomValues(new Uint8Array(u.length+7>>3)),u,l,c);if(a&&"generateKey"===t&&"RSASSA-PKCS1-v1_5"===u.name&&(!u.modulusLength||u.modulusLength>=2048))return(n=m(n)).name="RSAES-PKCS1-v1_5",delete n.hash,r.generateKey(n,!0,["encrypt","decrypt"]).then((function(t){return Promise.all([r.exportKey("jwk",t.publicKey),r.exportKey("jwk",t.privateKey)])})).then((function(t){return t[0].alg=t[1].alg=g(u),t[0].key_ops=c.filter(C),t[1].key_ops=c.filter(B),Promise.all([r.importKey("jwk",t[0],u,!0,t[0].key_ops),r.importKey("jwk",t[1],u,l,t[1].key_ops)])})).then((function(t){return{publicKey:t[0],privateKey:t[1]}}));if((a||s&&"SHA-1"===(u.hash||{}).name)&&"importKey"===t&&"jwk"===n&&"HMAC"===u.name&&"oct"===o.kty)return r.importKey("raw",d(f(o.k)),h,b[3],b[4]);if(a&&"importKey"===t&&("spki"===n||"pkcs8"===n))return r.importKey("jwk",w(o),h,b[3],b[4]);if(s&&"unwrapKey"===t)return r.decrypt(b[3],h,o).then((function(t){return r.importKey(n,t,b[4],b[5],b[6])}));try{p=i.apply(r,b)}catch(t){return Promise.reject(t)}return s&&(p=new Promise((function(t,e){p.onabort=p.onerror=function(t){e(t)},p.oncomplete=function(e){t(e.target.result)}}))),p=p.then((function(t){return"HMAC"===u.name&&(u.length||(u.length=8*t.algorithm.length)),0==u.name.search("RSA")&&(u.modulusLength||(u.modulusLength=(t.publicKey||t).algorithm.modulusLength),u.publicExponent||(u.publicExponent=(t.publicKey||t).algorithm.publicExponent)),t.publicKey&&t.privateKey?{publicKey:new A(t.publicKey,u,l,c.filter(C)),privateKey:new A(t.privateKey,u,l,c.filter(B))}:new A(t,u,l,c)}))}})),["exportKey","wrapKey"].forEach((function(t){var e=r[t];r[t]=function(i,n,o){var h,u=[].slice.call(arguments);switch(t){case"exportKey":u[1]=n._key;break;case"wrapKey":u[1]=n._key,u[2]=o._key}if((a||s&&"SHA-1"===(n.algorithm.hash||{}).name)&&"exportKey"===t&&"jwk"===i&&"HMAC"===n.algorithm.name&&(u[0]="raw"),!a||"exportKey"!==t||"spki"!==i&&"pkcs8"!==i||(u[0]="jwk"),s&&"wrapKey"===t)return r.exportKey(i,n).then((function(t){return"jwk"===i&&(t=d(unescape(encodeURIComponent(JSON.stringify(v(t)))))),r.encrypt(u[3],o,t)}));try{h=e.apply(r,u)}catch(t){return Promise.reject(t)}return s&&(h=new Promise((function(t,e){h.onabort=h.onerror=function(t){e(t)},h.oncomplete=function(e){t(e.target.result)}}))),"exportKey"===t&&"jwk"===i&&(h=h.then((function(t){return(a||s&&"SHA-1"===(n.algorithm.hash||{}).name)&&"HMAC"===n.algorithm.name?{kty:"oct",alg:g(n.algorithm),key_ops:n.usages.slice(),ext:!0,k:c(p(t))}:((t=v(t)).alg||(t.alg=g(n.algorithm)),t.key_ops||(t.key_ops="public"===n.type?n.usages.filter(C):"private"===n.type?n.usages.filter(B):n.usages.slice()),t)}))),!a||"exportKey"!==t||"spki"!==i&&"pkcs8"!==i||(h=h.then((function(t){return b(v(t))}))),h}})),["encrypt","decrypt","sign","verify"].forEach((function(t){var e=r[t];r[t]=function(i,n,o,a){if(s&&(!o.byteLength||a&&!a.byteLength))throw new Error("Empy input is not allowed");var h,u=[].slice.call(arguments),l=m(i);if(s&&"decrypt"===t&&"AES-GCM"===l.name){var c=i.tagLength>>3;u[2]=(o.buffer||o).slice(0,o.byteLength-c),i.tag=(o.buffer||o).slice(o.byteLength-c)}u[1]=n._key;try{h=e.apply(r,u)}catch(t){return Promise.reject(t)}return s&&(h=new Promise((function(e,r){h.onabort=h.onerror=function(t){r(t)},h.oncomplete=function(r){if(r=r.target.result,"encrypt"===t&&r instanceof AesGcmEncryptResult){var i=r.ciphertext,n=r.tag;(r=new Uint8Array(i.byteLength+n.byteLength)).set(new Uint8Array(i),0),r.set(new Uint8Array(n),i.byteLength),r=r.buffer}e(r)}}))),h}})),s){var l=r.digest;r.digest=function(t,e){if(!e.byteLength)throw new Error("Empy input is not allowed");var i;try{i=l.call(r,t,e)}catch(t){return Promise.reject(t)}return i=new Promise((function(t,e){i.onabort=i.onerror=function(t){e(t)},i.oncomplete=function(e){t(e.target.result)}}))},t.crypto=Object.create(e,{getRandomValues:{value:function(t){return e.getRandomValues(t)}},subtle:{value:r}}),t.CryptoKey=A}a&&(e.subtle=r,t.Crypto=i,t.SubtleCrypto=n,t.CryptoKey=A)}}}function c(t){return btoa(t).replace(/\=+$/,"").replace(/\+/g,"-").replace(/\//g,"_")}function f(t){return t=(t+="===").slice(0,-t.length%4),atob(t.replace(/-/g,"+").replace(/_/g,"/"))}function d(t){for(var e=new Uint8Array(t.length),r=0;r2&&(r=!0,e.shift());var i={ext:!0};if("1.2.840.113549.1.1.1"!==e[0][0])throw new TypeError("Unsupported key type");var n=["n","e","d","p","q","dp","dq","qi"],o=M(e[1]);r&&o.shift();for(var s=0;s2&&(i=!0,o.unshift(new Uint8Array([0]))),r[0][0]="1.2.840.113549.1.1.1",e=o,r.push(new Uint8Array(E(e)).buffer),i?r.unshift(new Uint8Array([0])):r[1]={tag:3,value:r[1]},new Uint8Array(E(r)).buffer}function M(t,e){if(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),e||(e={pos:0,end:t.length}),e.end-e.pos<2||e.end>t.length)throw new RangeError("Malformed DER");var r,i=t[e.pos++],n=t[e.pos++];if(n>=128){if(n&=127,e.end-e.pos=128){var a=i;for(i=4,e.splice(n,0,a>>24&255,a>>16&255,a>>8&255,255&a);i>1&&!(a>>24);)a<<=8,i--;i<4&&e.splice(n,4-i),i|=128}return e.splice(n-2,2,r,i),e}function A(t,e,r,i){Object.defineProperties(this,{_key:{value:t},type:{value:t.type,enumerable:!0},extractable:{value:void 0===r?t.extractable:r,enumerable:!0},algorithm:{value:void 0===e?t.algorithm:e,enumerable:!0},usages:{value:void 0===i?t.usages:i,enumerable:!0}})}function C(t){return"verify"===t||"encrypt"===t||"wrapKey"===t}function B(t){return"sign"===t||"decrypt"===t||"unwrapKey"===t}},"function"==typeof define&&define.amd?define([],(function(){return n(i)})):"object"==typeof module&&module.exports?module.exports=n(i):n(i);const o={}},(t,e,r)=>{const{crc16:i,hexToBytes:n,bytesToHex:o,stringToBytes:s,base64toString:a,stringToBase64:h}=r(2);class u{static isValid(t){try{return new u(t),!0}catch(t){return!1}}constructor(t){if(null==t)throw"Invalid address";if(t instanceof u)return this.wc=t.wc,this.hashPart=t.hashPart,this.isTestOnly=t.isTestOnly,this.isUserFriendly=t.isUserFriendly,this.isBounceable=t.isBounceable,void(this.isUrlSafe=t.isUrlSafe);if(t.search(/\-/)>0||t.search(/_/)>0?(this.isUrlSafe=!0,t=t.replace(/\-/g,"+").replace(/_/g,"/")):this.isUrlSafe=!1,t.indexOf(":")>-1){const e=t.split(":");if(2!==e.length)throw new Error("Invalid address "+t);const r=parseInt(e[0]);if(0!==r&&-1!==r)throw new Error("Invalid address wc "+t);const i=e[1];if(64!==i.length)throw new Error("Invalid address hex "+t);this.isUserFriendly=!1,this.wc=r,this.hashPart=n(i),this.isTestOnly=!1,this.isBounceable=!1}else{this.isUserFriendly=!0;const e=function(t){if(48!==t.length)throw new Error("User-friendly address should contain strictly 48 characters");const e=s(a(t));if(36!==e.length)throw"Unknown address type: byte length is not equal to 36";const r=e.slice(0,34),n=e.slice(34,36),o=i(r);if(o[0]!==n[0]||o[1]!==n[1])throw"Wrong crc16 hashsum";let h=r[0],u=!1,l=!1;if(128&h&&(u=!0,h^=128),17!==h&&81!==h)throw"Unknown address tag";l=17===h;let c=null;if(c=255===r[1]?-1:r[1],0!==c&&-1!==c)throw new Error("Invalid address wc "+c);return{isTestOnly:u,isBounceable:l,workchain:c,hashPart:r.slice(2,34)}}(t);this.wc=e.workchain,this.hashPart=e.hashPart,this.isTestOnly=e.isTestOnly,this.isBounceable=e.isBounceable}}toString(t,e,r,n){if(void 0===t&&(t=this.isUserFriendly),void 0===e&&(e=this.isUrlSafe),void 0===r&&(r=this.isBounceable),void 0===n&&(n=this.isTestOnly),t){let t=r?17:81;n&&(t|=128);const o=new Int8Array(34);o[0]=t,o[1]=this.wc,o.set(this.hashPart,2);const s=new Uint8Array(36);s.set(o),s.set(i(o),34);let a=h(String.fromCharCode.apply(null,new Uint8Array(s)));return e&&(a=a.replace(/\+/g,"-").replace(/\//g,"_")),a}return this.wc+":"+o(this.hashPart)}}t.exports.default=u},(t,e,r)=>{const{BitString:i}=r(20),{Cell:n}=r(21);t.exports={BitString:i,Cell:n}},(t,e,r)=>{const{BN:i,bytesToHex:n}=r(1);class o{constructor(t){this.array=Uint8Array.from({length:Math.ceil(t/8)},(()=>0)),this.cursor=0,this.length=t}getFreeBits(){return this.length-this.cursor}getUsedBits(){return this.cursor}getUsedBytes(){return Math.ceil(this.cursor/8)}get(t){return(this.array[t/8|0]&1<<7-t%8)>0}checkRange(t){if(t>this.length)throw Error("BitString overflow")}on(t){this.checkRange(t),this.array[t/8|0]|=1<<7-t%8}off(t){this.checkRange(t),this.array[t/8|0]&=~(1<<7-t%8)}toggle(t){this.checkRange(t),this.array[t/8|0]^=1<<7-t%8}forEach(t){const e=this.cursor;for(let r=0;r0?this.on(this.cursor):this.off(this.cursor),this.cursor=this.cursor+1}writeBitArray(t){for(let e=0;ee){if(0==t)return;throw Error("bitLength is too small for number, got number="+t+",bitLength="+e)}const r=t.toString(2,e);for(let t=0;t{this.writeBit(t)}))}clone(){const t=new o(0);return t.array=this.array.slice(0),t.length=this.length,t.cursor=this.cursor,t}toString(){return this.toHex()}getTopUppedArray(){const t=this.clone();let e=8*Math.ceil(t.cursor/8)-t.cursor;if(e>0)for(e-=1,t.writeBit(!0);e>0;)e-=1,t.writeBit(!1);return t.array=t.array.slice(0,Math.ceil(t.cursor/8)),t.array}toHex(){if(this.cursor%4==0){const t=n(this.array.slice(0,Math.ceil(this.cursor/8))).toUpperCase();return this.cursor%8==0?t:t.substr(0,t.length-1)}{const t=this.clone();for(t.writeBit(1);t.cursor%4!=0;)t.writeBit(0);return t.toHex().toUpperCase()+"_"}}setTopUppedArray(t,e=!0){if(this.length=8*t.length,this.array=t,this.cursor=this.length,!e&&this.length){let r=!1;for(let t=0;t<7;t++)if(this.cursor-=1,this.get(this.cursor)){r=!0,this.off(this.cursor);break}if(!r)throw console.log(t,e),new Error("Incorrect TopUppedArray")}}}t.exports={BitString:o}},(t,e,r)=>{const{BitString:i}=r(20),{bytesToBase64:n,compareBytes:o,concatBytes:s,crc32c:a,hexToBytes:h,readNBytesUIntFromArray:u,sha256:l,bytesToHex:c}=r(1),f=h("B5EE9C72"),d=h("68ff65f3"),p=h("acc3a728");class m{constructor(){this.bits=new i(1023),this.refs=[],this.isExotic=!1}static fromBoc(t){return w(t)}static oneFromBoc(t){const e=w(t);if(1!==e.length)throw new Error("expected 1 root cell but have "+e.length);return e[0]}writeCell(t){this.bits.writeBitString(t.bits),this.refs=this.refs.concat(t.refs)}getMaxLevel(){let t=0;for(let e in this.refs){const r=this.refs[e];r.getMaxLevel()>t&&(t=r.getMaxLevel())}return t}isExplicitlyStoredHashes(){return 0}getMaxDepth(){let t=0;if(this.refs.length>0){for(let e in this.refs){const r=this.refs[e];r.getMaxDepth()>t&&(t=r.getMaxDepth())}t+=1}return t}getMaxDepthAsArray(){const t=this.getMaxDepth(),e=Uint8Array.from({length:2},(()=>0));return e[1]=t%256,e[0]=Math.floor(t/256),e}getRefsDescriptor(){const t=Uint8Array.from({length:1},(()=>0));return t[0]=this.refs.length+8*this.isExotic+32*this.getMaxLevel(),t}getBitsDescriptor(){const t=Uint8Array.from({length:1},(()=>0));return t[0]=Math.ceil(this.bits.cursor/8)+Math.floor(this.bits.cursor/8),t}getDataWithDescriptors(){const t=this.getRefsDescriptor(),e=this.getBitsDescriptor(),r=this.bits.getTopUppedArray();return s(s(t,e),r)}async getRepr(){const t=[];t.push(this.getDataWithDescriptors());for(let e in this.refs){const r=this.refs[e];t.push(r.getMaxDepthAsArray())}for(let e in this.refs){const r=this.refs[e];t.push(await r.hash())}let e=new Uint8Array;for(let r in t){const i=t[r];e=s(e,i)}return e}async hash(){return new Uint8Array(await l(await this.getRepr()))}print(t){let e=(t=t||"")+"x{"+this.bits.toHex()+"}\n";for(let r in this.refs)e+=this.refs[r].print(t+" ");return e}async toBoc(t=!0,e=!0,r=!1,n=0){const o=await this.treeWalk(),h=o[0],u=o[1],l=h.length,c=l.toString(2).length,d=Math.min(Math.ceil(c/8),1);let p=0,m=[];for(let t of h)m.push(p),p+=await t[1].bocSerializationSize(u,d);const g=p.toString(2).length,v=Math.max(Math.ceil(g/8),1),y=new i(1247*h.length);y.writeBytes(f),y.writeBitArray([t,e,r]),y.writeUint(n,2),y.writeUint(d,3),y.writeUint8(v),y.writeUint(l,8*d),y.writeUint(1,8*d),y.writeUint(0,8*d),y.writeUint(p,8*v),y.writeUint(0,8*d),t&&h.forEach(((t,e)=>y.writeUint(m[e],8*v)));for(let t of h){const e=await t[1].serializeForBoc(u,d);y.writeBytes(e)}let w=y.getTopUppedArray();return e&&(w=s(w,a(w))),w}async serializeForBoc(t,e){const r=[];if(r.push(this.getDataWithDescriptors()),this.isExplicitlyStoredHashes())throw new Error("Cell hashes explicit storing is not implemented");for(let e in this.refs){const i=this.refs[e];let n=t[await i.hash()].toString(16);n.length%2&&(n="0"+n);const o=h(n);r.push(o)}let i=new Uint8Array;for(let t in r){const e=r[t];i=s(i,e)}return i}async bocSerializationSize(t,e){return(await this.serializeForBoc(t,e)).length}async treeWalk(){return v(this,[],{})}}async function g(t,e,r){const i=t[r];for(let e in t)t[e]>i&&(t[e]=t[e]-1);t[r]=e.length-1;const n=e.splice(i,1)[0];e.push(n);for(let r of n[1].refs)await g(t,e,await r.hash())}async function v(t,e,r,i=null){const n=await t.hash();if(n in r)return i&&r[i]>r[n]&&await g(r,e,n),[e,r];r[n]=e.length,e.push([n,t]);for(let i of t.refs){const t=await v(i,e,r,n);e=t[0],r=t[1]}return[e,r]}function y(t,e){if(t.length<2)throw"Not enough bytes to encode cell descriptors";const r=t[0],i=t[1];t=t.slice(2),Math.floor(r/32);const n=8&r,o=r%8,s=Math.ceil(i/2),a=!(i%2);let h=new m;if(h.isExotic=n,t.length=0;t--){let e=i[t];for(let r=0;r{var i=r(9).Buffer;const{Cell:n}=r(19),{Address:o,BN:s,bytesToHex:a}=r(1),{Contract:h}=r(23);t.exports=class{constructor(t,e){this.transport=t,this.ton=e,this.ADDRESS_FORMAT_HEX=0,this.ADDRESS_FORMAT_USER_FRIENDLY=1,this.ADDRESS_FORMAT_URL_SAFE=2,this.ADDRESS_FORMAT_BOUNCEABLE=4,this.ADDRESS_FORMAT_TEST_ONLY=8}async getAppConfiguration(){const t=await this.transport.send(224,1,0,0);return{version:t[0]+"."+t[1]+"."+t[2]}}async getPublicKey(t,e){const r=i.alloc(4);r.writeInt32BE(t);const n=await this.transport.send(224,2,e?1:0,0,r),o=n[0];return{publicKey:new Uint8Array(n.slice(1,1+o))}}async getAddress(t,e,r){const n=i.alloc(4);n.writeInt32BE(t);const s=await this.transport.send(224,5,e?1:0,r,n),h=s[0],u=new Uint8Array(s.slice(1,1+h));return{address:new o("0:"+a(u))}}async sign(t,e){const r=i.alloc(4);r.writeInt32BE(t);const n=i.concat([r,i.from(e)]),o=await this.transport.send(224,3,0,0,n),s=o[0];return{signature:o.slice(1,1+s)}}async transfer(t,e,r,o,s,a){const u=await e.createTransferMessage(null,r,o,s,null,3,!0),l=i.alloc(4);l.writeInt32BE(t);const c=i.concat([l,i.from(await u.signingMessage.toBoc())]),f=await this.transport.send(224,4,a,0,c),d=f[0],p=f.slice(1,1+d),m=new Uint8Array(p),g=new n;g.bits.writeBytes(m),g.writeCell(u.signingMessage);let v=null,y=null,w=null;if(0===s){const t=await e.createStateInit();v=t.stateInit,y=t.code,w=t.data}const b=await e.getAddress(),M=h.createExternalMessageHeader(b),E=h.createCommonMsgInfo(M,v,g),A=new Promise((t=>{t({address:b,message:E,body:g,signature:m,signingMessage:u.signingMessage,stateInit:v,code:y,data:w})}));return h.createMethod(this.ton.provider,A)}}},(t,e,r)=>{const{Cell:i}=r(19),{Address:n,bytesToBase64:o,bytesToHex:s}=r(1);class a{constructor(t,e){this.provider=t,this.options=e,this.address=e.address?new n(e.address):null,e.wc||(e.wc=this.address?this.address.wc:0),this.methods={}}async getAddress(){return this.address||(this.address=(await this.createStateInit()).address),this.address}createCodeCell(){if(!this.options.code)throw new Error("Contract: options.code is not defined");return this.options.code}createDataCell(){return new i}async createStateInit(){const t=this.createCodeCell(),e=this.createDataCell(),r=a.createStateInit(t,e),i=await r.hash();return{stateInit:r,address:new n(this.options.wc+":"+s(i)),code:t,data:e}}static createStateInit(t,e,r=null,n=null,o=null){if(r)throw"Library in state init is not implemented";if(n)throw"Split depth in state init is not implemented";if(o)throw"Ticktock in state init is not implemented";const s=new i;return s.bits.writeBitArray([Boolean(n),Boolean(o),Boolean(t),Boolean(e),Boolean(r)]),t&&s.refs.push(t),e&&s.refs.push(e),r&&s.refs.push(r),s}static createInternalMessageHeader(t,e=0,r=!0,o=null,s=!1,a=null,h=null,u=0,l=0,c=0,f=0){const d=new i;if(d.bits.writeBit(!1),d.bits.writeBit(r),null!==o?d.bits.writeBit(o):d.bits.writeBit(new n(t).isBounceable),d.bits.writeBit(s),d.bits.writeAddress(a?new n(a):null),d.bits.writeAddress(new n(t)),d.bits.writeGrams(e),h)throw"Currency collections are not implemented yet";return d.bits.writeBit(Boolean(h)),d.bits.writeGrams(u),d.bits.writeGrams(l),d.bits.writeUint(c,64),d.bits.writeUint(f,32),d}static createExternalMessageHeader(t,e=null,r=0){const o=new i;return o.bits.writeUint(2,2),o.bits.writeAddress(e?new n(e):null),o.bits.writeAddress(new n(t)),o.bits.writeGrams(r),o}static createCommonMsgInfo(t,e=null,r=null){const n=new i;return n.writeCell(t),e?(n.bits.writeBit(!0),n.bits.getFreeBits()-1>=e.bits.getUsedBits()?(n.bits.writeBit(!1),n.writeCell(e)):(n.bits.writeBit(!0),n.refs.push(e))):n.bits.writeBit(!1),r?n.bits.getFreeBits()>=r.bits.getUsedBits()?(n.bits.writeBit(!1),n.writeCell(r)):(n.bits.writeBit(!0),n.refs.push(r)):n.bits.writeBit(!1),n}static createMethod(t,e){return{getQuery:async()=>(await e).message,send:async()=>{const r=await e,i=o(await r.message.toBoc(!1));return t.sendBoc(i)},estimateFee:async()=>{const r=await e,i=r.code?{address:r.address.toString(!0,!0,!1),body:o(await r.body.toBoc(!1)),init_code:o(await r.code.toBoc(!1)),init_data:o(await r.data.toBoc(!1))}:{address:r.address.toString(!0,!0,!0),body:o(await r.body.toBoc(!1))};return t.getEstimateFee(i)}}}}t.exports={Contract:a}},(t,e,r)=>{const i=r(25).default;"undefined"==typeof fetch&&(fetch=r(26));const n="-9223372036854775808";class o{constructor(t,e){this.host=t||"https://toncenter.com/api/v2/jsonRPC",this.options=e||{}}sendImpl(t,e){const r={"Content-Type":"application/json"};return this.options.apiKey&&(r["X-API-Key"]=this.options.apiKey),fetch(t,{method:"POST",headers:r,body:JSON.stringify(e)}).then((t=>t.json())).then((({result:t,error:e})=>t||Promise.reject(e)))}send(t,e){return this.sendImpl(this.host,{id:1,jsonrpc:"2.0",method:t,params:e})}async getAddressInfo(t){return this.send("getAddressInformation",{address:t})}async getExtendedAddressInfo(t){return this.send("getExtendedAddressInformation",{address:t})}async getWalletInfo(t){return this.send("getWalletInformation",{address:t})}async getTransactions(t,e=20,r,i,n,o){return this.send("getTransactions",{address:t,limit:e,lt:r,hash:i,to_lt:n,archival:o})}async getBalance(t){return this.send("getAddressBalance",{address:t})}async sendBoc(t){return this.send("sendBoc",{boc:t})}async sendQuery(t){return this.send("sendQuerySimple",t)}async getEstimateFee(t){return this.send("estimateFee",t)}async call(t,e,r=[]){return this.send("runGetMethod",{address:t,method:e,stack:r})}async call2(t,e,r=[]){const n=await this.send("runGetMethod",{address:t,method:e,stack:r});return i.parseResponse(n)}async getMasterchainInfo(){return this.send("getMasterchainInfo",{})}async getBlockShards(t){return this.send("shards",{seqno:t})}async getBlockTransactions(t,e,r){return this.send("getBlockTransactions",{workchain:t,shard:e,seqno:r})}async getMasterchainBlockTransactions(t){return this.getBlockTransactions(-1,n,t)}async getBlockHeader(t,e,r){return this.send("getBlockHeader",{workchain:t,shard:e,seqno:r})}async getMasterchainBlockHeader(t){return this.getBlockHeader(-1,n,t)}}o.SHARD_ID_ALL=n,t.exports.default=o},(t,e,r)=>{const{BN:i,base64ToBytes:n}=r(1),{Cell:o}=r(19);class s{static parseObject(t){const e=t["@type"];switch(e){case"tvm.list":case"tvm.tuple":return t.elements.map(s.parseObject);case"tvm.stackEntryTuple":return s.parseObject(t.tuple);case"tvm.stackEntryNumber":return s.parseObject(t.number);case"tvm.numberDecimal":return new i(t.number,10);default:throw new Error("unknown type "+e)}}static parseResponseStack(t){const e=t[0],r=t[1];switch(e){case"num":return new i(r.replace(/0x/,""),16);case"list":case"tuple":return s.parseObject(r);case"cell":const t=n(r.bytes);return o.oneFromBoc(t);default:throw new Error("unknown type "+e)}}static parseResponse(t){if(0!==t.exit_code){const e=new Error("http provider parse response error");throw e.result=t,e}const e=t.stack.map(s.parseResponseStack);return 1===e.length?e[0]:e}static makeArg(t){if(t instanceof i||t instanceof Number)return["num",t];throw new Error("unknown arg type "+t)}static makeArgs(t){return t.map(this.makeArg)}}t.exports.default=s},()=>{},(t,e,r)=>{const{Cell:i}=r(19),{Address:n,BN:o,toNano:s,bytesToHex:a,hexToBytes:h,nacl:u,stringToBytes:l,bytesToBase64:c}=r(1),{Contract:f}=r(23),{SimpleWalletContractR1:d,SimpleWalletContractR2:p,SimpleWalletContractR3:m}=r(28),{WalletV2ContractR1:g,WalletV2ContractR2:v}=r(30),{WalletV3ContractR1:y,WalletV3ContractR2:w}=r(31),{WalletV4ContractR1:b}=r(32),{WalletV4ContractR2:M}=r(33),E={simpleR1:d,simpleR2:p,simpleR3:m,v2R1:g,v2R2:v,v3R1:y,v3R2:w,v4R1:b,v4R2:M},A=[d,p,m,g,v,y,w,b,M];class C{constructor(t){this.provider=t,this.all=E,this.list=A,this.defaultVersion="v3R1",this.default=this.all[this.defaultVersion]}create(t){return new this.default(this.provider,t)}}C.all=E,C.list=A,t.exports.default=C},(t,e,r)=>{const{Cell:i}=r(19),{WalletContract:n}=r(29);t.exports={SimpleWalletContractR1:class extends n{constructor(t,e){e.code=i.oneFromBoc("B5EE9C72410101010044000084FF0020DDA4F260810200D71820D70B1FED44D0D31FD3FFD15112BAF2A122F901541044F910F2A2F80001D31F3120D74A96D307D402FB00DED1A4C8CB1FCBFFC9ED5441FDF089"),super(t,e)}getName(){return"simpleR1"}},SimpleWalletContractR2:class extends n{constructor(t,e){e.code=i.oneFromBoc("B5EE9C724101010100530000A2FF0020DD2082014C97BA9730ED44D0D70B1FE0A4F260810200D71820D70B1FED44D0D31FD3FFD15112BAF2A122F901541044F910F2A2F80001D31F3120D74A96D307D402FB00DED1A4C8CB1FCBFFC9ED54D0E2786F"),super(t,e)}getName(){return"simpleR2"}},SimpleWalletContractR3:class extends n{constructor(t,e){e.code=i.oneFromBoc("B5EE9C7241010101005F0000BAFF0020DD2082014C97BA218201339CBAB19C71B0ED44D0D31FD70BFFE304E0A4F260810200D71820D70B1FED44D0D31FD3FFD15112BAF2A122F901541044F910F2A2F80001D31F3120D74A96D307D402FB00DED1A4C8CB1FCBFFC9ED54B5B86E42"),super(t,e)}getName(){return"simpleR3"}}}},(t,e,r)=>{const{Contract:i}=r(23),{Cell:n}=r(19),{nacl:o,stringToBytes:s,Address:a,BN:h}=r(1);t.exports={WalletContract:class extends i{constructor(t,e){if(!e.publicKey&&!e.address)throw new Error("WalletContract required publicKey or address in options");super(t,e),this.methods={transfer:e=>i.createMethod(t,this.createTransferMessage(e.secretKey,e.toAddress,e.amount,e.seqno,e.payload,e.sendMode,!Boolean(e.secretKey),e.stateInit)),seqno:()=>({call:async()=>{const e=await this.getAddress();let r=null;try{r=(await t.call2(e.toString(),"seqno")).toNumber()}catch(t){}return r}})},this.deploy=e=>i.createMethod(t,this.createInitExternalMessage(e))}getName(){throw new Error("override me")}createDataCell(){const t=new n;return t.bits.writeUint(0,32),t.bits.writeBytes(this.options.publicKey),t}createSigningMessage(t){t=t||0;const e=new n;return e.bits.writeUint(t,32),e}async createInitExternalMessage(t){if(!this.options.publicKey){const e=o.sign.keyPair.fromSecretKey(t);this.options.publicKey=e.publicKey}const{stateInit:e,address:r,code:s,data:a}=await this.createStateInit(),h=this.createSigningMessage(),u=o.sign.detached(await h.hash(),t),l=new n;l.bits.writeBytes(u),l.writeCell(h);const c=i.createExternalMessageHeader(r);return{address:r,message:i.createCommonMsgInfo(c,e,l),body:l,signingMessage:h,stateInit:e,code:s,data:a}}async createExternalMessage(t,e,r,s=!1){const a=s?new Uint8Array(64):o.sign.detached(await t.hash(),e),h=new n;h.bits.writeBytes(a),h.writeCell(t);let u=null,l=null,c=null;if(0===r){if(!this.options.publicKey){const t=o.sign.keyPair.fromSecretKey(e);this.options.publicKey=t.publicKey}const t=await this.createStateInit();u=t.stateInit,l=t.code,c=t.data}const f=await this.getAddress(),d=i.createExternalMessageHeader(f);return{address:f,message:i.createCommonMsgInfo(d,u,h),body:h,signature:a,signingMessage:t,stateInit:u,code:l,data:c}}async createTransferMessage(t,e,r,o,s="",u=3,l=!1,c=null){let f=new n;s&&(s.refs?f=s:"string"==typeof s?s.length>0&&(f.bits.writeUint(0,32),f.bits.writeString(s)):f.bits.writeBytes(s));const d=i.createInternalMessageHeader(new a(e),new h(r)),p=i.createCommonMsgInfo(d,c,f),m=this.createSigningMessage(o);return m.bits.writeUint8(u),m.refs.push(p),this.createExternalMessage(m,t,o,l)}}}},(t,e,r)=>{const{Cell:i}=r(19),{WalletContract:n}=r(29);class o extends n{createSigningMessage(t){t=t||0;const e=new i;if(e.bits.writeUint(t,32),0===t)for(let t=0;t<32;t++)e.bits.writeBit(1);else{const t=new Date,r=Math.floor(t.getTime()/1e3);e.bits.writeUint(r+60,32)}return e}}t.exports={WalletV2ContractR1:class extends o{constructor(t,e){e.code=i.oneFromBoc("B5EE9C724101010100570000AAFF0020DD2082014C97BA9730ED44D0D70B1FE0A4F2608308D71820D31FD31F01F823BBF263ED44D0D31FD3FFD15131BAF2A103F901541042F910F2A2F800029320D74A96D307D402FB00E8D1A4C8CB1FCBFFC9ED54A1370BB6"),super(t,e)}getName(){return"v2R1"}},WalletV2ContractR2:class extends o{constructor(t,e){e.code=i.oneFromBoc("B5EE9C724101010100630000C2FF0020DD2082014C97BA218201339CBAB19C71B0ED44D0D31FD70BFFE304E0A4F2608308D71820D31FD31F01F823BBF263ED44D0D31FD3FFD15131BAF2A103F901541042F910F2A2F800029320D74A96D307D402FB00E8D1A4C8CB1FCBFFC9ED54044CD7A1"),super(t,e)}getName(){return"v2R2"}}}},(t,e,r)=>{const{Cell:i}=r(19),{WalletContract:n}=r(29);class o extends n{createSigningMessage(t){t=t||0;const e=new i;if(e.bits.writeUint(this.options.walletId,32),0===t)for(let t=0;t<32;t++)e.bits.writeBit(1);else{const t=new Date,r=Math.floor(t.getTime()/1e3);e.bits.writeUint(r+60,32)}return e.bits.writeUint(t,32),e}createDataCell(){const t=new i;return t.bits.writeUint(0,32),t.bits.writeUint(this.options.walletId,32),t.bits.writeBytes(this.options.publicKey),t}}t.exports={WalletV3ContractR1:class extends o{constructor(t,e){e.code=i.oneFromBoc("B5EE9C724101010100620000C0FF0020DD2082014C97BA9730ED44D0D70B1FE0A4F2608308D71820D31FD31FD31FF82313BBF263ED44D0D31FD31FD3FFD15132BAF2A15144BAF2A204F901541055F910F2A3F8009320D74A96D307D402FB00E8D101A4C8CB1FCB1FCBFFC9ED543FBE6EE0"),super(t,e),this.options.walletId||(this.options.walletId=698983191+this.options.wc)}getName(){return"v3R1"}},WalletV3ContractR2:class extends o{constructor(t,e){e.code=i.oneFromBoc("B5EE9C724101010100710000DEFF0020DD2082014C97BA218201339CBAB19F71B0ED44D0D31FD31F31D70BFFE304E0A4F2608308D71820D31FD31FD31FF82313BBF263ED44D0D31FD31FD3FFD15132BAF2A15144BAF2A204F901541055F910F2A3F8009320D74A96D307D402FB00E8D101A4C8CB1FCB1FCBFFC9ED5410BD6DAD"),super(t,e),this.options.walletId||(this.options.walletId=698983191+this.options.wc)}getName(){return"v3R2"}}}},(t,e,r)=>{const{Cell:i}=r(19),{Contract:n}=r(23),{Address:o,bytesToHex:s,BN:a}=r(1),{WalletContract:h}=r(29);t.exports={WalletV4ContractR1:class extends h{constructor(t,e){e.code=i.oneFromBoc("B5EE9C72410215010002F5000114FF00F4A413F4BCF2C80B010201200203020148040504F8F28308D71820D31FD31FD31F02F823BBF263ED44D0D31FD31FD3FFF404D15143BAF2A15151BAF2A205F901541064F910F2A3F80024A4C8CB1F5240CB1F5230CBFF5210F400C9ED54F80F01D30721C0009F6C519320D74A96D307D402FB00E830E021C001E30021C002E30001C0039130E30D03A4C8CB1F12CB1FCBFF1112131403EED001D0D3030171B0915BE021D749C120915BE001D31F218210706C7567BD228210626C6E63BDB022821064737472BDB0925F03E002FA403020FA4401C8CA07CBFFC9D0ED44D0810140D721F404305C810108F40A6FA131B3925F05E004D33FC8258210706C7567BA9131E30D248210626C6E63BAE30004060708020120090A005001FA00F404308210706C7567831EB17080185005CB0527CF165003FA02F40012CB69CB1F5210CB3F0052F8276F228210626C6E63831EB17080185005CB0527CF1624FA0214CB6A13CB1F5230CB3F01FA02F4000092821064737472BA8E3504810108F45930ED44D0810140D720C801CF16F400C9ED54821064737472831EB17080185004CB0558CF1622FA0212CB6ACB1FCB3F9410345F04E2C98040FB000201200B0C0059BD242B6F6A2684080A06B90FA0218470D4080847A4937D29910CE6903E9FF9837812801B7810148987159F31840201580D0E0011B8C97ED44D0D70B1F8003DB29DFB513420405035C87D010C00B23281F2FFF274006040423D029BE84C600201200F100019ADCE76A26840206B90EB85FFC00019AF1DF6A26840106B90EB858FC0006ED207FA00D4D422F90005C8CA0715CBFFC9D077748018C8CB05CB0222CF165005FA0214CB6B12CCCCC971FB00C84014810108F451F2A702006C810108D718C8542025810108F451F2A782106E6F746570748018C8CB05CB025004CF16821005F5E100FA0213CB6A12CB1FC971FB00020072810108D718305202810108F459F2A7F82582106473747270748018C8CB05CB025005CF16821005F5E100FA0214CB6A13CB1F12CB3FC973FB00000AF400C9ED5446A9F34F"),super(t,e),this.options.walletId||(this.options.walletId=698983191+this.options.wc),this.methods.getPublicKey=this.getPublicKey.bind(this)}getName(){return"v4R1"}createSigningMessage(t,e){t=t||0;const r=new i;if(r.bits.writeUint(this.options.walletId,32),0===t)for(let t=0;t<32;t++)r.bits.writeBit(1);else{const t=new Date,e=Math.floor(t.getTime()/1e3);r.bits.writeUint(e+60,32)}return r.bits.writeUint(t,32),e||r.bits.writeUint(0,8),r}createDataCell(){const t=new i;return t.bits.writeUint(0,32),t.bits.writeUint(this.options.walletId,32),t.bits.writeBytes(this.options.publicKey),t.bits.writeUint(0,1),t}async getPublicKey(){const t=await this.getAddress();return this.provider.call2(t.toString(),"get_public_key")}}}},(t,e,r)=>{const{Cell:i}=r(19),{Contract:n}=r(23),{Address:o,bytesToHex:s,BN:a,toNano:h}=r(1),{WalletContract:u}=r(29);t.exports={WalletV4ContractR2:class extends u{constructor(t,e){e.code=i.oneFromBoc("B5EE9C72410214010002D4000114FF00F4A413F4BCF2C80B010201200203020148040504F8F28308D71820D31FD31FD31F02F823BBF264ED44D0D31FD31FD3FFF404D15143BAF2A15151BAF2A205F901541064F910F2A3F80024A4C8CB1F5240CB1F5230CBFF5210F400C9ED54F80F01D30721C0009F6C519320D74A96D307D402FB00E830E021C001E30021C002E30001C0039130E30D03A4C8CB1F12CB1FCBFF1011121302E6D001D0D3032171B0925F04E022D749C120925F04E002D31F218210706C7567BD22821064737472BDB0925F05E003FA403020FA4401C8CA07CBFFC9D0ED44D0810140D721F404305C810108F40A6FA131B3925F07E005D33FC8258210706C7567BA923830E30D03821064737472BA925F06E30D06070201200809007801FA00F40430F8276F2230500AA121BEF2E0508210706C7567831EB17080185004CB0526CF1658FA0219F400CB6917CB1F5260CB3F20C98040FB0006008A5004810108F45930ED44D0810140D720C801CF16F400C9ED540172B08E23821064737472831EB17080185005CB055003CF1623FA0213CB6ACB1FCB3FC98040FB00925F03E20201200A0B0059BD242B6F6A2684080A06B90FA0218470D4080847A4937D29910CE6903E9FF9837812801B7810148987159F31840201580C0D0011B8C97ED44D0D70B1F8003DB29DFB513420405035C87D010C00B23281F2FFF274006040423D029BE84C600201200E0F0019ADCE76A26840206B90EB85FFC00019AF1DF6A26840106B90EB858FC0006ED207FA00D4D422F90005C8CA0715CBFFC9D077748018C8CB05CB0222CF165005FA0214CB6B12CCCCC973FB00C84014810108F451F2A7020070810108D718FA00D33FC8542047810108F451F2A782106E6F746570748018C8CB05CB025006CF165004FA0214CB6A12CB1FCB3FC973FB0002006C810108D718FA00D33F305224810108F459F2A782106473747270748018C8CB05CB025005CF165003FA0213CB6ACB1F12CB3FC973FB00000AF400C9ED54696225E5"),super(t,e),this.options.walletId||(this.options.walletId=698983191+this.options.wc),this.methods.deployAndInstallPlugin=e=>n.createMethod(t,this.deployAndInstallPlugin(e)),this.methods.installPlugin=e=>n.createMethod(t,this.installPlugin(e)),this.methods.removePlugin=e=>n.createMethod(t,this.removePlugin(e)),this.methods.getPublicKey=this.getPublicKey.bind(this),this.methods.getWalletId=this.getWalletId.bind(this),this.methods.isPluginInstalled=this.isPluginInstalled.bind(this),this.methods.getPluginsList=this.getPluginsList.bind(this)}getName(){return"v4R2"}createSigningMessage(t,e){t=t||0;const r=new i;if(r.bits.writeUint(this.options.walletId,32),0===t)for(let t=0;t<32;t++)r.bits.writeBit(1);else{const t=new Date,e=Math.floor(t.getTime()/1e3);r.bits.writeUint(e+60,32)}return r.bits.writeUint(t,32),e||r.bits.writeUint(0,8),r}createDataCell(){const t=new i;return t.bits.writeUint(0,32),t.bits.writeUint(this.options.walletId,32),t.bits.writeBytes(this.options.publicKey),t.bits.writeUint(0,1),t}async deployAndInstallPlugin(t){const{secretKey:e,seqno:r,pluginWc:i,amount:n,stateInit:o,body:s}=t,a=this.createSigningMessage(r,!0);return a.bits.writeUint(1,8),a.bits.writeInt(i,8),a.bits.writeGrams(n),a.refs.push(o),a.refs.push(s),this.createExternalMessage(a,e,r,!1)}async _setPlugin(t,e){const{secretKey:r,seqno:i,amount:n,queryId:s}=t,a=new o(t.pluginAddress),u=this.createSigningMessage(i,!0);return u.bits.writeUint(e?2:3,8),u.bits.writeInt(a.wc,8),u.bits.writeBytes(a.hashPart),u.bits.writeGrams(n||h(.1)),u.bits.writeUint(s||0,64),this.createExternalMessage(u,r,i,!1)}async installPlugin(t){return this._setPlugin(t,!0)}async removePlugin(t){return this._setPlugin(t,!1)}async getWalletId(){const t=await this.getAddress();return(await this.provider.call2(t.toString(),"get_subwallet_id")).toNumber()}async getPublicKey(){const t=await this.getAddress();return this.provider.call2(t.toString(),"get_public_key")}async isPluginInstalled(t){t=new o(t);const e="0x"+s(t.hashPart),r=await this.getAddress();return!(await this.provider.call2(r.toString(),"is_plugin_installed",[["num",t.wc],["num",e]])).isZero()}async getPluginsList(){const t=await this.getAddress();return(await this.provider.call2(t.toString(),"get_plugin_list")).map((t=>t[0].toNumber()+":"+t[1].toString(16)))}}}},(t,e,r)=>{const{Cell:i}=r(19),{Address:n,BN:o,toNano:s,bytesToHex:a,hexToBytes:h,nacl:u,stringToBytes:l,bytesToBase64:c,base64ToBytes:f}=r(1),{Contract:d}=r(23),{WalletContract:p}=r(29);class m extends p{constructor(t,e){e.code=i.oneFromBoc("B5EE9C7241021E01000261000114FF00F4A413F4BCF2C80B010201200203020148040501F2F28308D71820D31FD31FD31F802403F823BB13F2F2F003802251A9BA1AF2F4802351B7BA1BF2F4801F0BF9015410C5F9101AF2F4F8005057F823F0065098F823F0062071289320D74A8E8BD30731D4511BDB3C12B001E8309229A0DF72FB02069320D74A96D307D402FB00E8D103A4476814154330F004ED541D0202CD0607020120131402012008090201200F100201200A0B002D5ED44D0D31FD31FD3FFD3FFF404FA00F404FA00F404D1803F7007434C0C05C6C2497C0F83E900C0871C02497C0F80074C7C87040A497C1383C00D46D3C00608420BABE7114AC2F6C2497C338200A208420BABE7106EE86BCBD20084AE0840EE6B2802FBCBD01E0C235C62008087E4055040DBE4404BCBD34C7E00A60840DCEAA7D04EE84BCBD34C034C7CC0078C3C412040DD78CA00C0D0E00130875D27D2A1BE95B0C60000C1039480AF00500161037410AF0050810575056001010244300F004ED540201201112004548E1E228020F4966FA520933023BB9131E2209835FA00D113A14013926C21E2B3E6308003502323287C5F287C572FFC4F2FFFD00007E80BD00007E80BD00326000431448A814C4E0083D039BE865BE803444E800A44C38B21400FE809004E0083D10C06002012015160015BDE9F780188242F847800C02012017180201481B1C002DB5187E006D88868A82609E00C6207E00C63F04EDE20B30020158191A0017ADCE76A268699F98EB85FFC00017AC78F6A268698F98EB858FC00011B325FB513435C2C7E00017B1D1BE08E0804230FB50F620002801D0D3030178B0925B7FE0FA4031FA403001F001A80EDAA4"),super(t,e),this.options.walletId||(this.options.walletId=698983191+this.options.wc),this.methods.getPublicKey=this.getPublicKey.bind(this),this.methods.getWalletId=this.getWalletId.bind(this),this.methods.getLiquidBalance=this.getLiquidBalance.bind(this),this.methods.getNominalRestrictedBalance=this.getNominalRestrictedBalance.bind(this),this.methods.getNominalLockedBalance=this.getNominalLockedBalance.bind(this)}getName(){return"lockup-0.1"}createSigningMessage(t,e){t=t||0;const r=new i;if(r.bits.writeUint(this.options.walletId,32),0===t)for(let t=0;t<32;t++)r.bits.writeBit(1);else{const t=new Date,e=Math.floor(t.getTime()/1e3);r.bits.writeUint(e+60,32)}return r.bits.writeUint(t,32),r}createDataCell(){const t=new i;return t.bits.writeUint(0,32),t.bits.writeUint(this.options.walletId,32),t.bits.writeBytes(this.options.publicKey),t.bits.writeBytes(f(this.options.config.config_public_key)),this.options.config.allowed_destinations?(t.bits.writeUint(1,1),t.refs.push(i.oneFromBoc(f(this.options.config.allowed_destinations)))):t.bits.writeUint(0,1),t.bits.writeGrams(0),t.bits.writeUint(0,1),t.bits.writeGrams(0),t.bits.writeUint(0,1),t}async getWalletId(){const t=await this.getAddress();return(await this.provider.call2(t.toString(),"get_subwallet_id")).toNumber()}async getPublicKey(){const t=await this.getAddress();return this.provider.call2(t.toString(),"get_public_key")}async getLiquidBalance(){const t=await this.getBalances();return t[0]-t[1]-t[2]}async getNominalRestrictedBalance(){return await this.getBalances()[1]}async getNominalLockedBalance(){return await this.getBalances()[2]}async getBalances(){const t=await this.getAddress();return this.provider.call2(t.toString(),"get_balances")}}t.exports.default={LockupWalletV1:m,all:{"lockup-0.1":m},list:[m]}},(t,e,r)=>{const{NftCollection:i}=r(36),{NftItem:n}=r(38),{NftMarketplace:o}=r(39),{NftSale:s}=r(40);t.exports.default={NftCollection:i,NftItem:n,NftMarketplace:o,NftSale:s}},(t,e,r)=>{const{Contract:i}=r(23),{Cell:n}=r(19),{Address:o,bytesToBase64:s}=r(1),{parseAddress:a}=r(37),{createOffchainUriCell:h,serializeUri:u,parseOffchainUriCell:l,getRoyaltyParams:c}=r(37);t.exports={NftCollection:class extends i{constructor(t,e){if(e.wc=0,e.code=e.code||n.oneFromBoc("B5EE9C724102140100021F000114FF00F4A413F4BCF2C80B0102016202030202CD04050201200E0F04E7D10638048ADF000E8698180B8D848ADF07D201800E98FE99FF6A2687D20699FEA6A6A184108349E9CA829405D47141BAF8280E8410854658056B84008646582A802E78B127D010A65B509E58FE59F80E78B64C0207D80701B28B9E382F970C892E000F18112E001718112E001F181181981E0024060708090201200A0B00603502D33F5313BBF2E1925313BA01FA00D43028103459F0068E1201A44343C85005CF1613CB3FCCCCCCC9ED54925F05E200A6357003D4308E378040F4966FA5208E2906A4208100FABE93F2C18FDE81019321A05325BBF2F402FA00D43022544B30F00623BA9302A402DE04926C21E2B3E6303250444313C85005CF1613CB3FCCCCCCC9ED54002C323401FA40304144C85005CF1613CB3FCCCCCCC9ED54003C8E15D4D43010344130C85005CF1613CB3FCCCCCCC9ED54E05F04840FF2F00201200C0D003D45AF0047021F005778018C8CB0558CF165004FA0213CB6B12CCCCC971FB008002D007232CFFE0A33C5B25C083232C044FD003D0032C03260001B3E401D3232C084B281F2FFF2742002012010110025BC82DF6A2687D20699FEA6A6A182DE86A182C40043B8B5D31ED44D0FA40D33FD4D4D43010245F04D0D431D430D071C8CB0701CF16CCC980201201213002FB5DAFDA89A1F481A67FA9A9A860D883A1A61FA61FF480610002DB4F47DA89A1F481A67FA9A9A86028BE09E008E003E00B01A500C6E"),e.royalty>1)throw new Error("royalty > 1");e.royaltyBase=1e3,e.royaltyFactor=Math.floor(e.royalty*e.royaltyBase),super(t,e),this.methods.getCollectionData=this.getCollectionData.bind(this),this.methods.getNftItemAddressByIndex=this.getNftItemAddressByIndex.bind(this),this.methods.getNftItemContent=this.getNftItemContent.bind(this),this.methods.getRoyaltyParams=this.getRoyaltyParams.bind(this)}createContentCell(t){const e=h(t.collectionContentUri),r=new n;r.bits.writeBytes(u(t.nftItemContentBaseUri));const i=new n;return i.refs[0]=e,i.refs[1]=r,i}createRoyaltyCell(t){const e=new n;return e.bits.writeUint(t.royaltyFactor,16),e.bits.writeUint(t.royaltyBase,16),e.bits.writeAddress(t.royaltyAddress),e}createDataCell(){const t=new n;return t.bits.writeAddress(this.options.ownerAddress),t.bits.writeUint(0,64),t.refs[0]=this.createContentCell(this.options),t.refs[1]=n.oneFromBoc(this.options.nftItemCodeHex),t.refs[2]=this.createRoyaltyCell(this.options),t}createMintBody(t){const e=new n;e.bits.writeUint(1,32),e.bits.writeUint(t.queryId||0,64),e.bits.writeUint(t.itemIndex,64),e.bits.writeCoins(t.amount);const r=new n;r.bits.writeAddress(t.itemOwnerAddress);const i=new n;return i.bits.writeBytes(u(t.itemContentUri)),r.refs[0]=i,e.refs[0]=r,e}createGetRoyaltyParamsBody(t){const e=new n;return e.bits.writeUint(1765620048,32),e.bits.writeUint(t.queryId||0,64),e}createChangeOwnerBody(t){const e=new n;return e.bits.writeUint(3,32),e.bits.writeUint(t.queryId||0,64),e.bits.writeAddress(t.newOwnerAddress),e}createEditContentBody(t){if(t.royalty>1)throw new Error("royalty > 1");t.royaltyBase=1e3,t.royaltyFactor=Math.floor(t.royalty*t.royaltyBase);const e=new n;return e.bits.writeUint(4,32),e.bits.writeUint(t.queryId||0,64),e.refs[0]=this.createContentCell(t),e.refs[1]=this.createRoyaltyCell(t),e}async getCollectionData(){const t=await this.getAddress(),e=await this.provider.call2(t.toString(),"get_collection_data"),r=e[0].toNumber(),i=l(e[1]);return{nextItemIndex:r,ownerAddress:a(e[2]),collectionContentUri:i}}async getNftItemContent(t){const e=await this.getAddress(),r=await t.getData();if(r.isInitialized){const t=await this.provider.call2(e.toString(),"get_nft_content",[["num",r.index],["tvm.Cell",s(await r.contentCell.toBoc(!1))]]);r.contentUri=l(t),delete r.contentCell}return r}async getNftItemAddressByIndex(t){const e=await this.getAddress(),r=await this.provider.call2(e.toString(),"get_nft_address_by_index",[["num",t]]);return a(r)}async getRoyaltyParams(){const t=await this.getAddress();return c(this.provider,t.toString())}}}},(t,e,r)=>{const{base64ToBytes:i,Address:n}=r(1),{Cell:o}=r(19),s=t=>(new TextEncoder).encode(encodeURI(t)),a=t=>(new TextDecoder).decode(t),h=(t,e,r)=>{let i=BigInt(0);for(let n=0;n{let e=h(t.bits,3,8);e>BigInt(127)&&(e-=BigInt(256));const r=h(t.bits,11,256);if(e.toString(10)+":"+r.toString(16)=="0:0")return null;const i=e.toString(10)+":"+r.toString(16).padStart(64,"0");return new n(i)};t.exports={SNAKE_DATA_PREFIX:0,CHUNK_DATA_PREFIX:1,ONCHAIN_CONTENT_PREFIX:0,OFFCHAIN_CONTENT_PREFIX:1,parseAddress:u,serializeUri:s,parseUri:a,createOffchainUriCell:t=>{const e=new o;return e.bits.writeUint(1,8),e.bits.writeBytes(s(t)),e},parseOffchainUriCell:t=>{let e=0,r=t;for(;r;)e+=r.bits.array.length,r=r.refs[0];const i=new Uint8Array(e);for(e=0,r=t;r;)i.set(r.bits.array,e),e+=r.bits.array.length,r=r.refs[0];return a(i.slice(1))},getRoyaltyParams:async(t,e)=>{const r=await t.call2(e,"royalty_params"),i=r[0].toNumber(),n=r[1].toNumber();return{royalty:i/n,royaltyBase:n,royaltyFactor:i,royaltyAddress:u(r[2])}}}},(t,e,r)=>{const{Contract:i}=r(23),{Cell:n}=r(19),{Address:o,BN:s}=r(1),{parseAddress:a,getRoyaltyParams:h}=r(37),{parseOffchainUriCell:u}=r(37),l="B5EE9C7241020D010001D0000114FF00F4A413F4BCF2C80B0102016202030202CE04050009A11F9FE00502012006070201200B0C02D70C8871C02497C0F83434C0C05C6C2497C0F83E903E900C7E800C5C75C87E800C7E800C3C00812CE3850C1B088D148CB1C17CB865407E90350C0408FC00F801B4C7F4CFE08417F30F45148C2EA3A1CC840DD78C9004F80C0D0D0D4D60840BF2C9A884AEB8C097C12103FCBC20080900113E910C1C2EBCB8536001F65135C705F2E191FA4021F001FA40D20031FA00820AFAF0801BA121945315A0A1DE22D70B01C300209206A19136E220C2FFF2E192218E3E821005138D91C85009CF16500BCF16712449145446A0708010C8CB055007CF165005FA0215CB6A12CB1FCB3F226EB39458CF17019132E201C901FB00104794102A375BE20A00727082108B77173505C8CBFF5004CF1610248040708010C8CB055007CF165005FA0215CB6A12CB1FCB3F226EB39458CF17019132E201C901FB000082028E3526F0018210D53276DB103744006D71708010C8CB055007CF165005FA0215CB6A12CB1FCB3F226EB39458CF17019132E201C901FB0093303234E25502F003003B3B513434CFFE900835D27080269FC07E90350C04090408F80C1C165B5B60001D00F232CFD633C58073C5B3327B5520BF75041B";class c extends i{constructor(t,e){e.wc=0,e.code=e.code||n.oneFromBoc(l),super(t,e),this.methods.getData=this.getData.bind(this)}createDataCell(){const t=new n;return t.bits.writeUint(this.options.index,64),t.bits.writeAddress(this.options.collectionAddress),t}async getData(){const t=await this.getAddress(),e=await this.provider.call2(t.toString(),"get_nft_data"),r=-1===e[0].toNumber(),i=e[1].toNumber(),n=a(e[2]),o=r?a(e[3]):null,s=e[4];return{isInitialized:r,index:i,collectionAddress:n,ownerAddress:o,contentCell:s,contentUri:r&&null===n?u(s):null}}async createTransferBody(t){const e=new n;return e.bits.writeUint(1607220500,32),e.bits.writeUint(t.queryId||0,64),e.bits.writeAddress(t.newOwnerAddress),e.bits.writeAddress(t.responseAddress),e.bits.writeBit(!1),e.bits.writeCoins(t.forwardAmount||new s(0)),e.bits.writeBit(!1),t.forwardPayload&&e.bits.writeBytes(t.forwardPayload),e}createGetStaticDataBody(t){const e=new n;return e.bits.writeUint(801842850,32),e.bits.writeUint(t.queryId||0,64),e}async getRoyaltyParams(){const t=await this.getAddress();return h(this.provider,t.toString())}}c.codeHex=l,t.exports={NftItem:c}},(t,e,r)=>{const{Contract:i}=r(23),{Cell:n}=r(19),{Address:o}=r(1),{parseAddress:s}=r(37);t.exports={NftMarketplace:class extends i{constructor(t,e){e.wc=0,e.code=e.code||n.oneFromBoc("B5EE9C7241010401006D000114FF00F4A413F4BCF2C80B01020120020300AAD23221C700915BE0D0D3030171B0915BE0FA40ED44D0FA403012C705F2E19101D31F01C0018E2BFA003001D4D43021F90070C8CA07CBFFC9D077748018C8CB05CB0258CF165004FA0213CB6BCCCCC971FB00915BE20004F2308EF7CCE7"),super(t,e)}createDataCell(){const t=new n;return t.bits.writeAddress(this.options.ownerAddress),t}}}},(t,e,r)=>{const{Contract:i}=r(23),{Cell:n}=r(19),{parseAddress:o}=r(37),{BN:s}=r(1),a="B5EE9C7241020A010001B4000114FF00F4A413F4BCF2C80B01020120020302014804050004F2300202CD0607002FA03859DA89A1F481F481F481F401A861A1F401F481F4006101F7D00E8698180B8D8492F82707D201876A2687D207D207D207D006A18116BA4E10159C71D991B1B2990E382C92F837028916382F970FA01698FC1080289C6C8895D7970FAE99F98FD2018201A642802E78B2801E78B00E78B00FD016664F6AA701363804C9B081B2299823878027003698FE99F9810E000C92F857010C0801F5D41081DCD650029285029185F7970E101E87D007D207D0018384008646582A804E78B28B9D090D0A85AD08A500AFD010AE5B564B8FD80384008646582AC678B2803FD010B65B564B8FD80384008646582A802E78B00FD0109E5B564B8FD80381041082FE61E8A10C00C646582A802E78B117D010A65B509E58F8A40900C8C0029A3110471036454012F004E032363704C0038E4782103B9ACA0015BEF2E1C95312C70559C705B1F2E1CA702082105FCC3D14218010C8CB055006CF1622FA0215CB6A14CB1F14CB3F21CF1601CF16CA0021FA02CA00C98100A0FB00E05F06840FF2F0002ACB3F22CF1658CF16CA0021FA02CA00C98100A0FB00AECABAD1";class h extends i{constructor(t,e){e.wc=0,e.code=e.code||n.oneFromBoc(a),super(t,e),this.methods.getData=this.getData.bind(this)}createDataCell(){const t=new n;t.bits.writeAddress(this.options.marketplaceAddress),t.bits.writeAddress(this.options.nftAddress),t.bits.writeAddress(null),t.bits.writeCoins(this.options.fullPrice);const e=new n;return e.bits.writeCoins(this.options.marketplaceFee),e.bits.writeAddress(this.options.royaltyAddress),e.bits.writeCoins(this.options.royaltyAmount),t.refs[0]=e,t}async getData(){const t=await this.getAddress(),e=await this.provider.call2(t.toString(),"get_sale_data");return{marketplaceAddress:o(e[0]),nftAddress:o(e[1]),nftOwnerAddress:o(e[2]),fullPrice:e[3],marketplaceFee:e[4],royaltyAddress:o(e[5]),royaltyAmount:e[6]}}async createCancelBody(t){const e=new n;return e.bits.writeUint(3,32),e.bits.writeUint(t.queryId||0,64),e}}h.codeHex=a,t.exports={NftSale:h}},(t,e,r)=>{const{JettonMinter:i}=r(42),{JettonWallet:n}=r(43);t.exports.default={JettonMinter:i,JettonWallet:n}},(t,e,r)=>{const{Contract:i}=r(23),{Cell:n}=r(19),{createOffchainUriCell:o,parseOffchainUriCell:s,parseAddress:a}=r(37),{Address:h,BN:u,bytesToBase64:l}=r(1);t.exports={JettonMinter:class extends i{constructor(t,e){e.wc=0,e.code=e.code||n.oneFromBoc("B5EE9C72410209010001AA000114FF00F4A413F4BCF2C80B0102016202030202CC040502037A60070801D5D9910E38048ADF068698180B8D848ADF07D201800E98FE99FF6A2687D007D206A6A18400AA9385D47181A9AA8AAE382F9702480FD207D006A18106840306B90FD001812881A28217804502A906428027D012C678B666664F6AA7041083DEECBEF0BDD71812F83C207F9784060093DFC142201B82A1009AA0A01E428027D012C678B00E78B666491646580897A007A00658064907C80383A6465816503E5FFE4E83BC00C646582AC678B28027D0109E5B589666664B8FD80400FC03FA00FA40F82854120870542013541403C85004FA0258CF1601CF16CCC922C8CB0112F400F400CB00C9F9007074C8CB02CA07CBFFC9D05008C705F2E04A12A1035024C85004FA0258CF16CCCCC9ED5401FA403020D70B01C3008E1F8210D53276DB708010C8CB055003CF1622FA0212CB6ACB1FCB3FC98042FB00915BE2007DADBCF6A2687D007D206A6A183618FC1400B82A1009AA0A01E428027D012C678B00E78B666491646580897A007A00658064FC80383A6465816503E5FFE4E840001FAF16F6A2687D007D206A6A183FAA9040F6B06B3C"),super(t,e)}createDataCell(){const t=new n;return t.bits.writeCoins(0),t.bits.writeAddress(this.options.adminAddress),t.refs[0]=o(this.options.jettonContentUri),t.refs[1]=n.oneFromBoc(this.options.jettonWalletCodeHex),t}createMintBody(t){const e=new n;e.bits.writeUint(21,32),e.bits.writeUint(t.queryId||0,64),e.bits.writeAddress(t.destination),e.bits.writeCoins(t.amount);const r=new n;return r.bits.writeUint(395134233,32),r.bits.writeUint(t.queryId||0,64),r.bits.writeCoins(t.jettonAmount),r.bits.writeAddress(null),r.bits.writeAddress(null),r.bits.writeCoins(new u(0)),r.bits.writeBit(!1),e.refs[0]=r,e}async getJettonData(){const t=await this.getAddress(),e=await this.provider.call2(t.toString(),"get_jetton_data");return{totalSupply:e[0],isMutable:-1===e[1].toNumber(),adminAddress:a(e[2]),jettonContentUri:s(e[3]),tokenWalletCode:e[4]}}async getJettonWalletAddress(t){const e=await this.getAddress(),r=new n;r.bits.writeAddress(t);const i=await this.provider.call2(e.toString(),"get_wallet_address",[["tvm.Slice",l(await r.toBoc(!1))]]);return a(i)}}}},(t,e,r)=>{const{Contract:i}=r(23),{Cell:n}=r(19),{parseAddress:o}=r(37),{BN:s}=r(1),a="B5EE9C7241021101000319000114FF00F4A413F4BCF2C80B0102016202030202CC0405001BA0F605DA89A1F401F481F481A8610201D40607020148080900BB0831C02497C138007434C0C05C6C2544D7C0FC02F83E903E900C7E800C5C75C87E800C7E800C00B4C7E08403E29FA954882EA54C4D167C0238208405E3514654882EA58C4CD00CFC02780D60841657C1EF2EA4D67C02B817C12103FCBC2000113E910C1C2EBCB853600201200A0B0201200F1001F500F4CFFE803E90087C007B51343E803E903E90350C144DA8548AB1C17CB8B04A30BFFCB8B0950D109C150804D50500F214013E809633C58073C5B33248B232C044BD003D0032C032483E401C1D3232C0B281F2FFF274013E903D010C7E801DE0063232C1540233C59C3E8085F2DAC4F3208405E351467232C7C6600C02F13B51343E803E903E90350C01F4CFFE80145468017E903E9014D6B1C1551CDB1C150804D50500F214013E809633C58073C5B33248B232C044BD003D0032C0327E401C1D3232C0B281F2FFF274140331C146EC7CB8B0C27E8020822625A020822625A02806A8486544124E17C138C34975C2C070C00930802C200D0E008ECB3F5007FA0222CF165006CF1625FA025003CF16C95005CC07AA0013A08208989680AA008208989680A0A014BCF2E2C504C98040FB001023C85004FA0258CF1601CF16CCC9ED54006C5219A018A182107362D09CC8CB1F5240CB3F5003FA0201CF165007CF16C9718018C8CB0525CF165007FA0216CB6A15CCC971FB00103400828E2A820898968072FB028210D53276DB708010C8CB055008CF165005FA0216CB6A13CB1F13CB3FC972FB0058926C33E25502C85004FA0258CF1601CF16CCC9ED5400DB3B51343E803E903E90350C01F4CFFE803E900C145468549271C17CB8B049F0BFFCB8B0A0822625A02A8005A805AF3CB8B0E0841EF765F7B232C7C572CFD400FE8088B3C58073C5B25C60043232C14933C59C3E80B2DAB33260103EC01004F214013E809633C58073C5B3327B55200083200835C87B51343E803E903E90350C0134C7E08405E3514654882EA0841EF765F784EE84AC7CB8B174CFCC7E800C04E81408F214013E809633C58073C5B3327B55204F664B79";class h extends i{constructor(t,e){e.wc=0,e.code=e.code||n.oneFromBoc(a),super(t,e)}async createTransferBody(t){const e=new n;return e.bits.writeUint(260734629,32),e.bits.writeUint(t.queryId||0,64),e.bits.writeCoins(t.jettonAmount),e.bits.writeAddress(t.toAddress),e.bits.writeAddress(t.responseAddress),e.bits.writeBit(!1),e.bits.writeCoins(t.forwardAmount||new s(0)),e.bits.writeBit(!1),t.forwardPayload&&e.bits.writeBytes(t.forwardPayload),e}async createBurnBody(t){const e=new n;return e.bits.writeUint(1499400124,32),e.bits.writeUint(t.queryId||0,64),e.bits.writeCoins(t.jettonAmount),e.bits.writeAddress(t.responseAddress),e}async getData(){const t=await this.getAddress(),e=await this.provider.call2(t.toString(),"get_wallet_data");return{balance:e[0],ownerAddress:o(e[1]),jettonMinterAddress:o(e[2]),jettonWalletCode:e[3]}}}h.codeHex=a,t.exports={JettonWallet:h}},(t,e,r)=>{const{BlockSubscription:i}=r(45),{InMemoryBlockStorage:n}=r(46);t.exports={BlockSubscription:i,InMemoryBlockStorage:n}},t=>{const e=t=>({workchain:t.workchain,shardId:t.shard,shardBlockNumber:t.seqno});t.exports={BlockSubscription:class{constructor(t,e,r,i){this.provider=t,this.storage=e,this.onBlock=r,this.startMcBlockNumber=i?i.startMcBlockNumber:void 0,this.mcInterval=(i?i.mcInterval:void 0)||1e4,this.shardsInterval=(i?i.shardsInterval:void 0)||1e3}async start(){if(this.stop(),!this.startMcBlockNumber&&(this.startMcBlockNumber=(await this.provider.getMasterchainInfo()).last.seqno,!this.startMcBlockNumber))throw new Error("Cannot get start mc block number from provider");const t=await this.provider.getMasterchainBlockHeader(this.startMcBlockNumber);if(this.startLT=t.end_lt,!this.startLT)throw new Error("Cannot get startLT from provider");let r=!1;const i=async()=>{if(!r){r=!0;try{const t=await this.storage.getLastMasterchainBlockNumber()||this.startMcBlockNumber;if(!t)throw new Error("no init masterchain block in storage");const r=(await this.provider.getMasterchainInfo()).last.seqno;if(!r)throw new Error("invalid last masterchain block from provider");for(let i=t+1;ii()),this.mcInterval),i();let n=!1;const o=async()=>{if(!n){n=!0;try{const t=await this.storage.getUnprocessedShardBlock();if(t){const{workchain:r,shardId:i,shardBlockNumber:n}=t,o=await this.provider.getBlockHeader(r,i,n);if(o.end_lto()),this.shardsInterval)}stop(){clearInterval(this.mcIntervalId),clearInterval(this.shardsIntervalId)}}}},t=>{t.exports={InMemoryBlockStorage:class{constructor(t){this.masterchainBlocks={},this.shardchainBlocks={},this.logFunction=t}async insertShardBlocks(t){for(const{workchain:e,shardId:r,shardBlockNumber:i}of t)void 0===this.shardchainBlocks[e+"_"+r+"_"+i]&&(this.logFunction&&this.logFunction("insert shard "+e+" "+r+" "+i),this.shardchainBlocks[e+"_"+r+"_"+i]=!1)}async insertBlocks(t,e){if(this.logFunction&&this.logFunction("mc processed "+t),void 0!==this.masterchainBlocks[t])throw new Error("mc already exists "+t);this.masterchainBlocks[t]=!0,await this.insertShardBlocks(e)}async getLastMasterchainBlockNumber(){return Object.keys(this.masterchainBlocks).map((t=>Number(t))).sort(((t,e)=>e-t))[0]}async setBlockProcessed(t,e,r,i){if(this.logFunction&&this.logFunction("shard processed "+t+" "+e+" "+r),void 0===this.shardchainBlocks[t+"_"+e+"_"+r])throw new Error("shard not exists "+t+"_"+e+"_"+r);this.shardchainBlocks[t+"_"+e+"_"+r]=!0,await this.insertShardBlocks(i)}async getUnprocessedShardBlock(){for(let t in this.shardchainBlocks)if(!1===this.shardchainBlocks[t]){const e=t.split("_");return{workchain:Number(e[0]),shardId:e[1],shardBlockNumber:Number(e[2])}}}}}},(t,e,r)=>{const{Contract:i}=r(23),{Cell:n}=r(19),{hexToBytes:o,BN:s,nacl:a,bytesToBase64:h}=r(1);t.exports={SubscriptionContract:class extends i{constructor(t,e){e.code=n.oneFromBoc("B5EE9C7241020F01000262000114FF00F4A413F4BCF2C80B0102012002030201480405036AF230DB3C5335A127A904F82327A128A90401BC5135A0F823B913B0F29EF800725210BE945387F0078E855386DB3CA4E2F82302DB3C0B0C0D0202CD06070121A0D0C9B67813F488DE0411F488DE0410130B048FD6D9E05E8698198FD201829846382C74E2F841999E98F9841083239BA395D497803F018B841083AB735BBED9E702984E382D9C74688462F863841083AB735BBED9E70156BA4E09040B0A0A080269F10FD22184093886D9E7C12C1083239BA39384008646582A803678B2801FD010A65B5658F89659FE4B9FD803FC1083239BA396D9E40E0A04F08E8D108C5F0C708210756E6B77DB3CE00AD31F308210706C7567831EB15210BA8F48305324A126A904F82326A127A904BEF27109FA4430A619F833D078D721D70B3F5260A11BBE8E923036F82370708210737562732759DB3C5077DE106910581047103645135042DB3CE0395F076C2232821064737472BA0A0A0D09011A8E897F821064737472DB3CE0300A006821B39982100400000072FB02DE70F8276F118010C8CB055005CF1621FA0214F40013CB6912CB1F830602948100A032DEC901FB000030ED44D0FA40FA40FA00D31FD31FD31FD31FD31FD307D31F30018021FA443020813A98DB3C01A619F833D078D721D70B3FA070F8258210706C7567228018C8CB055007CF165004FA0215CB6A12CB1F13CB3F01FA02CB00C973FB000E0040C8500ACF165008CF165006FA0214CB1F12CB1FCB1FCB1FCB1FCB07CB1FC9ED54005801A615F833D020D70B078100D1BA95810088D721DED307218100DDBA028100DEBA12B1F2E047D33F30A8AB0FE5855AB4"),super(t,e),this.methods.pay=()=>i.createMethod(t,this.createPayExternalMessage()),this.methods.getSubscriptionData=this.getSubscriptionData.bind(this)}createDataCell(){const t=new n;return t.bits.writeAddress(this.options.wallet),t.bits.writeAddress(this.options.beneficiary),t.bits.writeGrams(this.options.amount),t.bits.writeUint(this.options.period,32),t.bits.writeUint(this.options.startAt,32),t.bits.writeUint(this.options.timeout,32),t.bits.writeUint(0,32),t.bits.writeUint(0,32),t.bits.writeUint(0,8),t.bits.writeUint(this.options.subscriptionId,32),t}createBody(){const t=new n;return t.bits.writeUint(new s(1886156135).add(new s(2147483648)),32),t}createSelfDestructBody(){const t=new n;return t.bits.writeUint(1685288050,32),t}async getSubscriptionData(){const t=t=>t[0].toNumber()+":"+t[1].toString(16),e=await this.getAddress(),r=await this.provider.call2(e.toString(),"get_subscription_data");return{wallet:t(r[0]),beneficiary:t(r[1]),amount:r[2],period:r[3].toNumber(),startAt:r[4].toNumber(),timeout:r[5].toNumber(),lastPayment:r[6].toNumber(),lastRequest:r[7].toNumber(),failedAttempts:r[8].toNumber(),subscriptionId:r[9].toNumber()}}async createPayExternalMessage(){const t=await this.getAddress(),e=i.createExternalMessageHeader(t),r=i.createCommonMsgInfo(e,null,null),o=new n;return o.bits.writeUint(Math.floor(Date.now()/1e3),64),{address:t,message:r,body:o}}}}},(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>l});var i=r(49),n=r(52),o=r(53),s=r(101),a=r(51),h=r(102),u=r(9).Buffer;class l extends i.default{constructor(t,e){super(),this.device=void 0,this.deviceModel=void 0,this.channel=Math.floor(65535*Math.random()),this.packetSize=64,this.interfaceNumber=void 0,this._disconnectEmitted=!1,this._emitDisconnect=t=>{this._disconnectEmitted||(this._disconnectEmitted=!0,this.emit("disconnect",t))},this.exchange=t=>this.exchangeAtomicImpl((async()=>{const{channel:e,packetSize:r}=this;(0,s.log)("apdu","=> "+t.toString("hex"));const i=(0,n.default)(e,r),o=i.makeBlocks(t);for(let t=0;t{if(t&&t.message&&t.message.includes("disconnected"))throw this._emitDisconnect(t),new a.DisconnectedDeviceDuringOperation(t.message);throw t})),this.device=t,this.interfaceNumber=e,this.deviceModel=(0,o.identifyUSBProductId)(t.productId)}static async request(){const t=await(0,h.requestLedgerDevice)();return l.open(t)}static async openConnected(){const t=await(0,h.getLedgerDevices)();return 0===t.length?null:l.open(t[0])}static async open(t){await t.open(),null===t.configuration&&await t.selectConfiguration(1),await c(t);const e=t.configurations[0].interfaces.find((({alternates:t})=>t.some((t=>255===t.interfaceClass))));if(!e)throw new a.TransportInterfaceNotAvailable("No WebUSB interface found for your Ledger device. Please upgrade firmware or contact techsupport.");const r=e.interfaceNumber;try{await t.claimInterface(r)}catch(e){throw await t.close(),new a.TransportInterfaceNotAvailable(e.message)}const i=new l(t,r),n=e=>{t===e.device&&(navigator.usb.removeEventListener("disconnect",n),i._emitDisconnect(new a.DisconnectedDevice))};return navigator.usb.addEventListener("disconnect",n),i}async close(){await this.exchangeBusyPromise,await this.device.releaseInterface(this.interfaceNumber),await c(this.device),await this.device.close()}setScrambleKey(){}}async function c(t){try{await t.reset()}catch(t){console.warn(t)}}l.isSupported=h.isSupported,l.list=h.getLedgerDevices,l.listen=t=>{let e=!1;return(0,h.getFirstLedgerDevice)().then((r=>{if(!e){const e=(0,o.identifyUSBProductId)(r.productId);t.next({type:"add",descriptor:r,deviceModel:e}),t.complete()}}),(e=>{window.DOMException&&e instanceof window.DOMException&&18===e.code?t.error(new a.TransportWebUSBGestureRequired(e.message)):t.error(new a.TransportOpenUserCancelled(e.message))})),{unsubscribe:function(){e=!0}}}},(t,e,r)=>{"use strict";r.r(e),r.d(e,{StatusCodes:()=>o.StatusCodes,TransportError:()=>o.TransportError,TransportStatusError:()=>o.TransportStatusError,default:()=>a,getAltStatusMessage:()=>o.getAltStatusMessage});var i=r(50),n=r.n(i),o=r(51),s=r(9).Buffer;class a{constructor(){this.exchangeTimeout=3e4,this.unresponsiveTimeout=15e3,this.deviceModel=null,this._events=new(n()),this.send=async(t,e,r,i,n=s.alloc(0),a=[o.StatusCodes.OK])=>{if(n.length>=256)throw new o.TransportError("data.length exceed 256 bytes limit. Got: "+n.length,"DataLengthTooBig");const h=await this.exchange(s.concat([s.from([t,e,r,i]),s.from([n.length]),n])),u=h.readUInt16BE(h.length-2);if(!a.some((t=>t===u)))throw new o.TransportStatusError(u);return h},this.exchangeBusyPromise=void 0,this.exchangeAtomicImpl=async t=>{if(this.exchangeBusyPromise)throw new o.TransportRaceCondition("An action was already pending on the Ledger device. Please deny or reconnect.");let e;const r=new Promise((t=>{e=t}));this.exchangeBusyPromise=r;let i=!1;const n=setTimeout((()=>{i=!0,this.emit("unresponsive")}),this.unresponsiveTimeout);try{const r=await t();return i&&this.emit("responsive"),r}finally{clearTimeout(n),e&&e(),this.exchangeBusyPromise=null}},this._appAPIlock=null}exchange(t){throw new Error("exchange not implemented")}setScrambleKey(t){}close(){return Promise.resolve()}on(t,e){this._events.on(t,e)}off(t,e){this._events.removeListener(t,e)}emit(t,...e){this._events.emit(t,...e)}setDebugMode(){console.warn("setDebugMode is deprecated. use @ledgerhq/logs instead. No logs are emitted in this anymore.")}setExchangeTimeout(t){this.exchangeTimeout=t}setExchangeUnresponsiveTimeout(t){this.unresponsiveTimeout=t}static create(t=3e3,e){return new Promise(((r,i)=>{let n=!1;const s=this.listen({next:e=>{n=!0,s&&s.unsubscribe(),a&&clearTimeout(a),this.open(e.descriptor,t).then(r,i)},error:t=>{a&&clearTimeout(a),i(t)},complete:()=>{a&&clearTimeout(a),n||i(new o.TransportError(this.ErrorMessage_NoDeviceFound,"NoDeviceFound"))}}),a=e?setTimeout((()=>{s.unsubscribe(),i(new o.TransportError(this.ErrorMessage_ListenTimeout,"ListenTimeout"))}),e):null}))}decorateAppAPIMethods(t,e,r){for(let i of e)t[i]=this.decorateAppAPIMethod(i,t[i],t,r)}decorateAppAPIMethod(t,e,r,i){return async(...n)=>{const{_appAPIlock:s}=this;if(s)return Promise.reject(new o.TransportError("Ledger Device is busy (lock "+s+")","TransportLocked"));try{return this._appAPIlock=t,this.setScrambleKey(i),await e.apply(r,n)}finally{this._appAPIlock=null}}}}a.isSupported=void 0,a.list=void 0,a.listen=void 0,a.open=void 0,a.ErrorMessage_ListenTimeout="No Ledger device found (timeout)",a.ErrorMessage_NoDeviceFound="No Ledger device found"},t=>{"use strict";var e,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var n=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise((function(r,i){function n(r){t.removeListener(e,o),i(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",n),r([].slice.call(arguments))}m(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&m(t,"error",e,{once:!0})}(t,n)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function h(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function u(t,e,r,i){var n,o,s,u;if(a(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),(n=h(t))>0&&s.length>n&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,u=l,console&&console.warn&&console.warn(u)}return t}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function c(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=l.bind(i);return n.listener=r,i.wrapFn=n,n}function f(t,e,r){var i=t._events;if(void 0===i)return[];var n=i[e];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var h=o[t];if(void 0===h)return!1;if("function"==typeof h)i(h,this,e);else{var u=h.length,l=p(h,u);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,n=o;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1=0;i--)this.removeListener(t,e[i]);return this},o.prototype.listeners=function(t){return f(this,t,!0)},o.prototype.rawListeners=function(t){return f(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},o.prototype.listenerCount=d,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},(t,e,r)=>{"use strict";r.r(e),r.d(e,{AccountNameRequiredError:()=>l,AccountNotSupported:()=>c,AmountRequired:()=>f,BluetoothRequired:()=>d,BtcUnmatchedApp:()=>p,CantOpenDevice:()=>m,CantScanQRCode:()=>kt,CashAddrNotSupported:()=>g,CurrencyNotSupported:()=>v,DBNotReset:()=>Zt,DBWrongPassword:()=>Wt,DeviceAppVerifyNotSupported:()=>y,DeviceGenuineSocketEarlyClose:()=>w,DeviceHalted:()=>C,DeviceInOSUExpected:()=>A,DeviceNameInvalid:()=>B,DeviceNotGenuineError:()=>b,DeviceOnDashboardExpected:()=>M,DeviceOnDashboardUnexpected:()=>E,DeviceShouldStayInApp:()=>It,DeviceSocketFail:()=>F,DeviceSocketNoBulkStatus:()=>_,DisconnectedDevice:()=>S,DisconnectedDeviceDuringOperation:()=>D,ETHAddressNonEIP:()=>Ut,EnpointConfigError:()=>x,EthAppPleaseEnableContractData:()=>I,FeeEstimationFailed:()=>T,FeeNotLoaded:()=>Lt,FeeRequired:()=>Pt,FeeTooHigh:()=>jt,FirmwareNotRecognized:()=>R,FirmwareOrAppUpdateRequired:()=>zt,GasLessThanEstimate:()=>at,GenuineCheckFailed:()=>Kt,HardResetFail:()=>N,InvalidAddress:()=>U,InvalidAddressBecauseDestinationIsAlsoSource:()=>k,InvalidXRPTag:()=>O,LatestMCUInstalledError:()=>L,LedgerAPI4xx:()=>Ht,LedgerAPI5xx:()=>Gt,LedgerAPIError:()=>j,LedgerAPIErrorWithMessage:()=>$,LedgerAPINotAvailable:()=>q,MCUNotGenuineToDashboard:()=>pt,ManagerAppAlreadyInstalledError:()=>K,ManagerAppDepInstallRequired:()=>G,ManagerAppDepUninstallRequired:()=>z,ManagerAppRelyOnBTCError:()=>H,ManagerDeviceLockedError:()=>V,ManagerFirmwareNotEnoughSpaceError:()=>W,ManagerNotEnoughSpaceError:()=>Z,ManagerUninstallBTCDep:()=>Y,NetworkDown:()=>X,NoAccessToCamera:()=>nt,NoAddressesFound:()=>J,NoDBPathGiven:()=>Vt,NotEnoughBalance:()=>Q,NotEnoughBalanceBecauseDestinationNotCreated:()=>it,NotEnoughBalanceInParentAccount:()=>et,NotEnoughBalanceToDelegate:()=>tt,NotEnoughGas:()=>ot,NotEnoughSpendableBalance:()=>rt,NotSupportedLegacyAddress:()=>st,PairingFailed:()=>qt,PasswordIncorrectError:()=>ut,PasswordsDontMatchError:()=>ht,RecipientRequired:()=>mt,RecommendSubAccountsToEmpty:()=>lt,RecommendUndelegation:()=>ct,StatusCodes:()=>Xt,SyncError:()=>$t,TimeoutTagged:()=>ft,TransportError:()=>Yt,TransportInterfaceNotAvailable:()=>St,TransportOpenUserCancelled:()=>_t,TransportRaceCondition:()=>Dt,TransportStatusError:()=>Qt,TransportWebUSBGestureRequired:()=>xt,UnavailableTezosOriginatedAccountReceive:()=>gt,UnavailableTezosOriginatedAccountSend:()=>vt,UnexpectedBootloader:()=>dt,UnknownMCU:()=>P,UpdateFetchFileFail:()=>yt,UpdateIncorrectHash:()=>wt,UpdateIncorrectSig:()=>bt,UpdateYourApp:()=>Mt,UserRefusedAddress:()=>At,UserRefusedAllowManager:()=>Bt,UserRefusedDeviceNameChange:()=>Et,UserRefusedFirmwareUpdate:()=>Ct,UserRefusedOnDevice:()=>Ft,WebsocketConnectionError:()=>Tt,WebsocketConnectionFailed:()=>Rt,WrongAppForCurrency:()=>Ot,WrongDeviceForAccount:()=>Nt,addCustomErrorDeserializer:()=>o,createCustomErrorClass:()=>s,deserializeError:()=>a,getAltStatusMessage:()=>Jt,serializeError:()=>h});var i={},n={},o=function(t,e){n[t]=e},s=function(t){var e=function(e,r){Object.assign(this,r),this.name=t,this.message=e||t,this.stack=(new Error).stack};return e.prototype=new Error,i[t]=e,e},a=function(t){if("object"==typeof t&&t){try{var e=JSON.parse(t.message);e.message&&e.name&&(t=e)}catch(t){}var r=void 0;if("string"==typeof t.name){var o=t.name,h=n[o];if(h)r=h(t);else{var u="Error"===o?Error:i[o];u||(console.warn("deserializing an unknown class '"+o+"'"),u=s(o)),r=Object.create(u.prototype);try{for(var l in t)t.hasOwnProperty(l)&&(r[l]=t[l])}catch(t){}}}else r=new Error(t.message);return!r.stack&&Error.captureStackTrace&&Error.captureStackTrace(r,a),r}return new Error(String(t))},h=function(t){return t?"object"==typeof t?u(t,[]):"function"==typeof t?"[Function: "+(t.name||"anonymous")+"]":t:t};function u(t,e){var r={};e.push(t);for(var i=0,n=Object.keys(t);i{"use strict";var i=r(9).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=r(51);function o(t){const e=i.alloc(2);return e.writeUInt16BE(t,0),e}const s={data:i.alloc(0),dataLength:0,sequence:0};e.default=(t,e)=>({makeBlocks(r){let n=i.concat([o(r.length),r]);const s=e-5,a=Math.ceil(n.length/s);n=i.concat([n,i.alloc(a*s-n.length+1).fill(0)]);const h=[];for(let e=0;ea&&(o=o.slice(0,a)),{data:o,dataLength:a,sequence:h}},getReducedResult(t){if(t&&t.dataLength===t.data.length)return t.data}})},(t,e,r)=>{"use strict";r.r(e),r.d(e,{IICCID:()=>h,IIGenericHID:()=>o,IIKeyboardHID:()=>s,IIU2F:()=>a,IIWebUSB:()=>u,getBluetoothServiceUuids:()=>w,getDeviceModel:()=>p,getInfosForServiceUuid:()=>b,identifyProductName:()=>g,identifyUSBProductId:()=>m,ledgerUSBVendorId:()=>d});var i=r(54),n=r.n(i);const o=1,s=2,a=4,h=8,u=16,l={blue:{id:"blue",productName:"Ledger Blue",productIdMM:0,legacyUsbProductId:0,usbOnly:!0,memorySize:491520,blockSize:4096,getBlockSize:t=>4096},nanoS:{id:"nanoS",productName:"Ledger Nano S",productIdMM:16,legacyUsbProductId:1,usbOnly:!0,memorySize:327680,blockSize:4096,getBlockSize:t=>n().lt(n().coerce(t),"2.0.0")?4096:2048},nanoX:{id:"nanoX",productName:"Ledger Nano X",productIdMM:64,legacyUsbProductId:4,usbOnly:!1,memorySize:2097152,blockSize:4096,getBlockSize:t=>4096,bluetoothSpec:[{serviceUuid:"d973f2e0-b19e-11e2-9e96-0800200c9a66",notifyUuid:"d973f2e1-b19e-11e2-9e96-0800200c9a66",writeUuid:"d973f2e2-b19e-11e2-9e96-0800200c9a66"},{serviceUuid:"13d63400-2c97-0004-0000-4c6564676572",notifyUuid:"13d63400-2c97-0004-0001-4c6564676572",writeUuid:"13d63400-2c97-0004-0002-4c6564676572"}]}},c={Blue:"blue","Nano S":"nanoS","Nano X":"nanoX"},f=Object.values(l),d=11415,p=t=>{const e=l[t];if(!e)throw new Error("device '"+t+"' does not exist");return e},m=t=>{const e=f.find((e=>e.legacyUsbProductId===t));if(e)return e;const r=t>>8;return f.find((t=>t.productIdMM===r))},g=t=>{const e=c[t];return f.find((t=>t.id===e))},v=[],y={};for(let t in l){const e=l[t],{bluetoothSpec:r}=e;if(r)for(let t=0;tv,b=t=>y[t.toLowerCase()]},(t,e,r)=>{const i=r(55);t.exports={re:i.re,src:i.src,tokens:i.t,SEMVER_SPEC_VERSION:r(56).SEMVER_SPEC_VERSION,SemVer:r(58),compareIdentifiers:r(60).compareIdentifiers,rcompareIdentifiers:r(60).rcompareIdentifiers,parse:r(61),valid:r(62),clean:r(63),inc:r(64),diff:r(65),major:r(68),minor:r(69),patch:r(70),prerelease:r(71),compare:r(67),rcompare:r(72),compareLoose:r(73),compareBuild:r(74),sort:r(75),rsort:r(76),gt:r(77),lt:r(78),eq:r(66),neq:r(79),gte:r(80),lte:r(81),cmp:r(82),coerce:r(83),Comparator:r(84),Range:r(85),satisfies:r(89),toComparators:r(90),maxSatisfying:r(91),minSatisfying:r(92),minVersion:r(93),validRange:r(94),outside:r(95),gtr:r(96),ltr:r(97),intersects:r(98),simplifyRange:r(99),subset:r(100)}},(t,e,r)=>{const{MAX_SAFE_COMPONENT_LENGTH:i}=r(56),n=r(57),o=(e=t.exports={}).re=[],s=e.src=[],a=e.t={};let h=0;const u=(t,e,r)=>{const i=h++;n(i,e),a[t]=i,s[i]=e,o[i]=new RegExp(e,r?"g":void 0)};u("NUMERICIDENTIFIER","0|[1-9]\\d*"),u("NUMERICIDENTIFIERLOOSE","[0-9]+"),u("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),u("MAINVERSION",`(${s[a.NUMERICIDENTIFIER]})\\.(${s[a.NUMERICIDENTIFIER]})\\.(${s[a.NUMERICIDENTIFIER]})`),u("MAINVERSIONLOOSE",`(${s[a.NUMERICIDENTIFIERLOOSE]})\\.(${s[a.NUMERICIDENTIFIERLOOSE]})\\.(${s[a.NUMERICIDENTIFIERLOOSE]})`),u("PRERELEASEIDENTIFIER",`(?:${s[a.NUMERICIDENTIFIER]}|${s[a.NONNUMERICIDENTIFIER]})`),u("PRERELEASEIDENTIFIERLOOSE",`(?:${s[a.NUMERICIDENTIFIERLOOSE]}|${s[a.NONNUMERICIDENTIFIER]})`),u("PRERELEASE",`(?:-(${s[a.PRERELEASEIDENTIFIER]}(?:\\.${s[a.PRERELEASEIDENTIFIER]})*))`),u("PRERELEASELOOSE",`(?:-?(${s[a.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${s[a.PRERELEASEIDENTIFIERLOOSE]})*))`),u("BUILDIDENTIFIER","[0-9A-Za-z-]+"),u("BUILD",`(?:\\+(${s[a.BUILDIDENTIFIER]}(?:\\.${s[a.BUILDIDENTIFIER]})*))`),u("FULLPLAIN",`v?${s[a.MAINVERSION]}${s[a.PRERELEASE]}?${s[a.BUILD]}?`),u("FULL",`^${s[a.FULLPLAIN]}$`),u("LOOSEPLAIN",`[v=\\s]*${s[a.MAINVERSIONLOOSE]}${s[a.PRERELEASELOOSE]}?${s[a.BUILD]}?`),u("LOOSE",`^${s[a.LOOSEPLAIN]}$`),u("GTLT","((?:<|>)?=?)"),u("XRANGEIDENTIFIERLOOSE",`${s[a.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),u("XRANGEIDENTIFIER",`${s[a.NUMERICIDENTIFIER]}|x|X|\\*`),u("XRANGEPLAIN",`[v=\\s]*(${s[a.XRANGEIDENTIFIER]})(?:\\.(${s[a.XRANGEIDENTIFIER]})(?:\\.(${s[a.XRANGEIDENTIFIER]})(?:${s[a.PRERELEASE]})?${s[a.BUILD]}?)?)?`),u("XRANGEPLAINLOOSE",`[v=\\s]*(${s[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[a.XRANGEIDENTIFIERLOOSE]})(?:${s[a.PRERELEASELOOSE]})?${s[a.BUILD]}?)?)?`),u("XRANGE",`^${s[a.GTLT]}\\s*${s[a.XRANGEPLAIN]}$`),u("XRANGELOOSE",`^${s[a.GTLT]}\\s*${s[a.XRANGEPLAINLOOSE]}$`),u("COERCE",`(^|[^\\d])(\\d{1,${i}})(?:\\.(\\d{1,${i}}))?(?:\\.(\\d{1,${i}}))?(?:$|[^\\d])`),u("COERCERTL",s[a.COERCE],!0),u("LONETILDE","(?:~>?)"),u("TILDETRIM",`(\\s*)${s[a.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",u("TILDE",`^${s[a.LONETILDE]}${s[a.XRANGEPLAIN]}$`),u("TILDELOOSE",`^${s[a.LONETILDE]}${s[a.XRANGEPLAINLOOSE]}$`),u("LONECARET","(?:\\^)"),u("CARETTRIM",`(\\s*)${s[a.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",u("CARET",`^${s[a.LONECARET]}${s[a.XRANGEPLAIN]}$`),u("CARETLOOSE",`^${s[a.LONECARET]}${s[a.XRANGEPLAINLOOSE]}$`),u("COMPARATORLOOSE",`^${s[a.GTLT]}\\s*(${s[a.LOOSEPLAIN]})$|^$`),u("COMPARATOR",`^${s[a.GTLT]}\\s*(${s[a.FULLPLAIN]})$|^$`),u("COMPARATORTRIM",`(\\s*)${s[a.GTLT]}\\s*(${s[a.LOOSEPLAIN]}|${s[a.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",u("HYPHENRANGE",`^\\s*(${s[a.XRANGEPLAIN]})\\s+-\\s+(${s[a.XRANGEPLAIN]})\\s*$`),u("HYPHENRANGELOOSE",`^\\s*(${s[a.XRANGEPLAINLOOSE]})\\s+-\\s+(${s[a.XRANGEPLAINLOOSE]})\\s*$`),u("STAR","(<|>)?=?\\s*\\*"),u("GTE0","^\\s*>=\\s*0.0.0\\s*$"),u("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")},t=>{const e=Number.MAX_SAFE_INTEGER||9007199254740991;t.exports={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:e,MAX_SAFE_COMPONENT_LENGTH:16}},t=>{const e="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};t.exports=e},(t,e,r)=>{const i=r(57),{MAX_LENGTH:n,MAX_SAFE_INTEGER:o}=r(56),{re:s,t:a}=r(55),h=r(59),{compareIdentifiers:u}=r(60);class l{constructor(t,e){if(e=h(e),t instanceof l){if(t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease)return t;t=t.version}else if("string"!=typeof t)throw new TypeError(`Invalid Version: ${t}`);if(t.length>n)throw new TypeError(`version is longer than ${n} characters`);i("SemVer",t,e),this.options=e,this.loose=!!e.loose,this.includePrerelease=!!e.includePrerelease;const r=t.trim().match(e.loose?s[a.LOOSE]:s[a.FULL]);if(!r)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((t=>{if(/^[0-9]+$/.test(t)){const e=+t;if(e>=0&&e=0;)"number"==typeof this.prerelease[t]&&(this.prerelease[t]++,t=-2);-1===t&&this.prerelease.push(0)}e&&(this.prerelease[0]===e?isNaN(this.prerelease[1])&&(this.prerelease=[e,0]):this.prerelease=[e,0]);break;default:throw new Error(`invalid increment argument: ${t}`)}return this.format(),this.raw=this.version,this}}t.exports=l},t=>{const e=["includePrerelease","loose","rtl"];t.exports=t=>t?"object"!=typeof t?{loose:!0}:e.filter((e=>t[e])).reduce(((t,e)=>(t[e]=!0,t)),{}):{}},t=>{const e=/^[0-9]+$/,r=(t,r)=>{const i=e.test(t),n=e.test(r);return i&&n&&(t=+t,r=+r),t===r?0:i&&!n?-1:n&&!i?1:tr(e,t)}},(t,e,r)=>{const{MAX_LENGTH:i}=r(56),{re:n,t:o}=r(55),s=r(58),a=r(59);t.exports=(t,e)=>{if(e=a(e),t instanceof s)return t;if("string"!=typeof t)return null;if(t.length>i)return null;if(!(e.loose?n[o.LOOSE]:n[o.FULL]).test(t))return null;try{return new s(t,e)}catch(t){return null}}},(t,e,r)=>{const i=r(61);t.exports=(t,e)=>{const r=i(t,e);return r?r.version:null}},(t,e,r)=>{const i=r(61);t.exports=(t,e)=>{const r=i(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null}},(t,e,r)=>{const i=r(58);t.exports=(t,e,r,n)=>{"string"==typeof r&&(n=r,r=void 0);try{return new i(t,r).inc(e,n).version}catch(t){return null}}},(t,e,r)=>{const i=r(61),n=r(66);t.exports=(t,e)=>{if(n(t,e))return null;{const r=i(t),n=i(e),o=r.prerelease.length||n.prerelease.length,s=o?"pre":"",a=o?"prerelease":"";for(const t in r)if(("major"===t||"minor"===t||"patch"===t)&&r[t]!==n[t])return s+t;return a}}},(t,e,r)=>{const i=r(67);t.exports=(t,e,r)=>0===i(t,e,r)},(t,e,r)=>{const i=r(58);t.exports=(t,e,r)=>new i(t,r).compare(new i(e,r))},(t,e,r)=>{const i=r(58);t.exports=(t,e)=>new i(t,e).major},(t,e,r)=>{const i=r(58);t.exports=(t,e)=>new i(t,e).minor},(t,e,r)=>{const i=r(58);t.exports=(t,e)=>new i(t,e).patch},(t,e,r)=>{const i=r(61);t.exports=(t,e)=>{const r=i(t,e);return r&&r.prerelease.length?r.prerelease:null}},(t,e,r)=>{const i=r(67);t.exports=(t,e,r)=>i(e,t,r)},(t,e,r)=>{const i=r(67);t.exports=(t,e)=>i(t,e,!0)},(t,e,r)=>{const i=r(58);t.exports=(t,e,r)=>{const n=new i(t,r),o=new i(e,r);return n.compare(o)||n.compareBuild(o)}},(t,e,r)=>{const i=r(74);t.exports=(t,e)=>t.sort(((t,r)=>i(t,r,e)))},(t,e,r)=>{const i=r(74);t.exports=(t,e)=>t.sort(((t,r)=>i(r,t,e)))},(t,e,r)=>{const i=r(67);t.exports=(t,e,r)=>i(t,e,r)>0},(t,e,r)=>{const i=r(67);t.exports=(t,e,r)=>i(t,e,r)<0},(t,e,r)=>{const i=r(67);t.exports=(t,e,r)=>0!==i(t,e,r)},(t,e,r)=>{const i=r(67);t.exports=(t,e,r)=>i(t,e,r)>=0},(t,e,r)=>{const i=r(67);t.exports=(t,e,r)=>i(t,e,r)<=0},(t,e,r)=>{const i=r(66),n=r(79),o=r(77),s=r(80),a=r(78),h=r(81);t.exports=(t,e,r,u)=>{switch(e){case"===":return"object"==typeof t&&(t=t.version),"object"==typeof r&&(r=r.version),t===r;case"!==":return"object"==typeof t&&(t=t.version),"object"==typeof r&&(r=r.version),t!==r;case"":case"=":case"==":return i(t,r,u);case"!=":return n(t,r,u);case">":return o(t,r,u);case">=":return s(t,r,u);case"<":return a(t,r,u);case"<=":return h(t,r,u);default:throw new TypeError(`Invalid operator: ${e}`)}}},(t,e,r)=>{const i=r(58),n=r(61),{re:o,t:s}=r(55);t.exports=(t,e)=>{if(t instanceof i)return t;if("number"==typeof t&&(t=String(t)),"string"!=typeof t)return null;let r=null;if((e=e||{}).rtl){let e;for(;(e=o[s.COERCERTL].exec(t))&&(!r||r.index+r[0].length!==t.length);)r&&e.index+e[0].length===r.index+r[0].length||(r=e),o[s.COERCERTL].lastIndex=e.index+e[1].length+e[2].length;o[s.COERCERTL].lastIndex=-1}else r=t.match(o[s.COERCE]);return null===r?null:n(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,e)}},(t,e,r)=>{const i=Symbol("SemVer ANY");class n{static get ANY(){return i}constructor(t,e){if(e=o(e),t instanceof n){if(t.loose===!!e.loose)return t;t=t.value}u("comparator",t,e),this.options=e,this.loose=!!e.loose,this.parse(t),this.semver===i?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(t){const e=this.options.loose?s[a.COMPARATORLOOSE]:s[a.COMPARATOR],r=t.match(e);if(!r)throw new TypeError(`Invalid comparator: ${t}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new l(r[2],this.options.loose):this.semver=i}toString(){return this.value}test(t){if(u("Comparator.test",t,this.options.loose),this.semver===i||t===i)return!0;if("string"==typeof t)try{t=new l(t,this.options)}catch(t){return!1}return h(t,this.operator,this.semver,this.options)}intersects(t,e){if(!(t instanceof n))throw new TypeError("a Comparator is required");if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),""===this.operator)return""===this.value||new c(t.value,e).test(this.value);if(""===t.operator)return""===t.value||new c(this.value,e).test(t.semver);const r=!(">="!==this.operator&&">"!==this.operator||">="!==t.operator&&">"!==t.operator),i=!("<="!==this.operator&&"<"!==this.operator||"<="!==t.operator&&"<"!==t.operator),o=this.semver.version===t.semver.version,s=!(">="!==this.operator&&"<="!==this.operator||">="!==t.operator&&"<="!==t.operator),a=h(this.semver,"<",t.semver,e)&&(">="===this.operator||">"===this.operator)&&("<="===t.operator||"<"===t.operator),u=h(this.semver,">",t.semver,e)&&("<="===this.operator||"<"===this.operator)&&(">="===t.operator||">"===t.operator);return r||i||o&&s||a||u}}t.exports=n;const o=r(59),{re:s,t:a}=r(55),h=r(82),u=r(57),l=r(58),c=r(85)},(t,e,r)=>{class i{constructor(t,e){if(e=o(e),t instanceof i)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new i(t.raw,e);if(t instanceof s)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=e,this.loose=!!e.loose,this.includePrerelease=!!e.includePrerelease,this.raw=t,this.set=t.split(/\s*\|\|\s*/).map((t=>this.parseRange(t.trim()))).filter((t=>t.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${t}`);if(this.set.length>1){const t=this.set[0];if(this.set=this.set.filter((t=>!p(t[0]))),0===this.set.length)this.set=[t];else if(this.set.length>1)for(const t of this.set)if(1===t.length&&m(t[0])){this.set=[t];break}}this.format()}format(){return this.range=this.set.map((t=>t.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(t){t=t.trim();const e=`parseRange:${Object.keys(this.options).join(",")}:${t}`,r=n.get(e);if(r)return r;const i=this.options.loose,o=i?u[l.HYPHENRANGELOOSE]:u[l.HYPHENRANGE];t=t.replace(o,_(this.options.includePrerelease)),a("hyphen replace",t),t=t.replace(u[l.COMPARATORTRIM],c),a("comparator trim",t,u[l.COMPARATORTRIM]),t=(t=(t=t.replace(u[l.TILDETRIM],f)).replace(u[l.CARETTRIM],d)).split(/\s+/).join(" ");const h=i?u[l.COMPARATORLOOSE]:u[l.COMPARATOR],m=t.split(" ").map((t=>v(t,this.options))).join(" ").split(/\s+/).map((t=>F(t,this.options))).filter(this.options.loose?t=>!!t.match(h):()=>!0).map((t=>new s(t,this.options))),g=(m.length,new Map);for(const t of m){if(p(t))return[t];g.set(t.value,t)}g.size>1&&g.has("")&&g.delete("");const y=[...g.values()];return n.set(e,y),y}intersects(t,e){if(!(t instanceof i))throw new TypeError("a Range is required");return this.set.some((r=>g(r,e)&&t.set.some((t=>g(t,e)&&r.every((r=>t.every((t=>r.intersects(t,e)))))))))}test(t){if(!t)return!1;if("string"==typeof t)try{t=new h(t,this.options)}catch(t){return!1}for(let e=0;e"<0.0.0-0"===t.value,m=t=>""===t.value,g=(t,e)=>{let r=!0;const i=t.slice();let n=i.pop();for(;r&&i.length;)r=i.every((t=>n.intersects(t,e))),n=i.pop();return r},v=(t,e)=>(a("comp",t,e),t=M(t,e),a("caret",t),t=w(t,e),a("tildes",t),t=A(t,e),a("xrange",t),t=B(t,e),a("stars",t),t),y=t=>!t||"x"===t.toLowerCase()||"*"===t,w=(t,e)=>t.trim().split(/\s+/).map((t=>b(t,e))).join(" "),b=(t,e)=>{const r=e.loose?u[l.TILDELOOSE]:u[l.TILDE];return t.replace(r,((e,r,i,n,o)=>{let s;return a("tilde",t,e,r,i,n,o),y(r)?s="":y(i)?s=`>=${r}.0.0 <${+r+1}.0.0-0`:y(n)?s=`>=${r}.${i}.0 <${r}.${+i+1}.0-0`:o?(a("replaceTilde pr",o),s=`>=${r}.${i}.${n}-${o} <${r}.${+i+1}.0-0`):s=`>=${r}.${i}.${n} <${r}.${+i+1}.0-0`,a("tilde return",s),s}))},M=(t,e)=>t.trim().split(/\s+/).map((t=>E(t,e))).join(" "),E=(t,e)=>{a("caret",t,e);const r=e.loose?u[l.CARETLOOSE]:u[l.CARET],i=e.includePrerelease?"-0":"";return t.replace(r,((e,r,n,o,s)=>{let h;return a("caret",t,e,r,n,o,s),y(r)?h="":y(n)?h=`>=${r}.0.0${i} <${+r+1}.0.0-0`:y(o)?h="0"===r?`>=${r}.${n}.0${i} <${r}.${+n+1}.0-0`:`>=${r}.${n}.0${i} <${+r+1}.0.0-0`:s?(a("replaceCaret pr",s),h="0"===r?"0"===n?`>=${r}.${n}.${o}-${s} <${r}.${n}.${+o+1}-0`:`>=${r}.${n}.${o}-${s} <${r}.${+n+1}.0-0`:`>=${r}.${n}.${o}-${s} <${+r+1}.0.0-0`):(a("no pr"),h="0"===r?"0"===n?`>=${r}.${n}.${o}${i} <${r}.${n}.${+o+1}-0`:`>=${r}.${n}.${o}${i} <${r}.${+n+1}.0-0`:`>=${r}.${n}.${o} <${+r+1}.0.0-0`),a("caret return",h),h}))},A=(t,e)=>(a("replaceXRanges",t,e),t.split(/\s+/).map((t=>C(t,e))).join(" ")),C=(t,e)=>{t=t.trim();const r=e.loose?u[l.XRANGELOOSE]:u[l.XRANGE];return t.replace(r,((r,i,n,o,s,h)=>{a("xRange",t,r,i,n,o,s,h);const u=y(n),l=u||y(o),c=l||y(s),f=c;return"="===i&&f&&(i=""),h=e.includePrerelease?"-0":"",u?r=">"===i||"<"===i?"<0.0.0-0":"*":i&&f?(l&&(o=0),s=0,">"===i?(i=">=",l?(n=+n+1,o=0,s=0):(o=+o+1,s=0)):"<="===i&&(i="<",l?n=+n+1:o=+o+1),"<"===i&&(h="-0"),r=`${i+n}.${o}.${s}${h}`):l?r=`>=${n}.0.0${h} <${+n+1}.0.0-0`:c&&(r=`>=${n}.${o}.0${h} <${n}.${+o+1}.0-0`),a("xRange return",r),r}))},B=(t,e)=>(a("replaceStars",t,e),t.trim().replace(u[l.STAR],"")),F=(t,e)=>(a("replaceGTE0",t,e),t.trim().replace(u[e.includePrerelease?l.GTE0PRE:l.GTE0],"")),_=t=>(e,r,i,n,o,s,a,h,u,l,c,f,d)=>`${r=y(i)?"":y(n)?`>=${i}.0.0${t?"-0":""}`:y(o)?`>=${i}.${n}.0${t?"-0":""}`:s?`>=${r}`:`>=${r}${t?"-0":""}`} ${h=y(u)?"":y(l)?`<${+u+1}.0.0-0`:y(c)?`<${u}.${+l+1}.0-0`:f?`<=${u}.${l}.${c}-${f}`:t?`<${u}.${l}.${+c+1}-0`:`<=${h}`}`.trim(),S=(t,e,r)=>{for(let r=0;r0){const i=t[r].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}},(t,e,r)=>{"use strict";const i=r(87),n=Symbol("max"),o=Symbol("length"),s=Symbol("lengthCalculator"),a=Symbol("allowStale"),h=Symbol("maxAge"),u=Symbol("dispose"),l=Symbol("noDisposeOnSet"),c=Symbol("lruList"),f=Symbol("cache"),d=Symbol("updateAgeOnGet"),p=()=>1,m=(t,e,r)=>{const i=t[f].get(e);if(i){const e=i.value;if(g(t,e)){if(y(t,i),!t[a])return}else r&&(t[d]&&(i.value.now=Date.now()),t[c].unshiftNode(i));return e.value}},g=(t,e)=>{if(!e||!e.maxAge&&!t[h])return!1;const r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t[h]&&r>t[h]},v=t=>{if(t[o]>t[n])for(let e=t[c].tail;t[o]>t[n]&&null!==e;){const r=e.prev;y(t,e),e=r}},y=(t,e)=>{if(e){const r=e.value;t[u]&&t[u](r.key,r.value),t[o]-=r.length,t[f].delete(r.key),t[c].removeNode(e)}};class w{constructor(t,e,r,i,n){this.key=t,this.value=e,this.length=r,this.now=i,this.maxAge=n||0}}const b=(t,e,r,i)=>{let n=r.value;g(t,n)&&(y(t,r),t[a]||(n=void 0)),n&&e.call(i,n.value,n.key,t)};t.exports=class{constructor(t){if("number"==typeof t&&(t={max:t}),t||(t={}),t.max&&("number"!=typeof t.max||t.max<0))throw new TypeError("max must be a non-negative number");this[n]=t.max||1/0;const e=t.length||p;if(this[s]="function"!=typeof e?p:e,this[a]=t.stale||!1,t.maxAge&&"number"!=typeof t.maxAge)throw new TypeError("maxAge must be a number");this[h]=t.maxAge||0,this[u]=t.dispose,this[l]=t.noDisposeOnSet||!1,this[d]=t.updateAgeOnGet||!1,this.reset()}set max(t){if("number"!=typeof t||t<0)throw new TypeError("max must be a non-negative number");this[n]=t||1/0,v(this)}get max(){return this[n]}set allowStale(t){this[a]=!!t}get allowStale(){return this[a]}set maxAge(t){if("number"!=typeof t)throw new TypeError("maxAge must be a non-negative number");this[h]=t,v(this)}get maxAge(){return this[h]}set lengthCalculator(t){"function"!=typeof t&&(t=p),t!==this[s]&&(this[s]=t,this[o]=0,this[c].forEach((t=>{t.length=this[s](t.value,t.key),this[o]+=t.length}))),v(this)}get lengthCalculator(){return this[s]}get length(){return this[o]}get itemCount(){return this[c].length}rforEach(t,e){e=e||this;for(let r=this[c].tail;null!==r;){const i=r.prev;b(this,t,r,e),r=i}}forEach(t,e){e=e||this;for(let r=this[c].head;null!==r;){const i=r.next;b(this,t,r,e),r=i}}keys(){return this[c].toArray().map((t=>t.key))}values(){return this[c].toArray().map((t=>t.value))}reset(){this[u]&&this[c]&&this[c].length&&this[c].forEach((t=>this[u](t.key,t.value))),this[f]=new Map,this[c]=new i,this[o]=0}dump(){return this[c].map((t=>!g(this,t)&&{k:t.key,v:t.value,e:t.now+(t.maxAge||0)})).toArray().filter((t=>t))}dumpLru(){return this[c]}set(t,e,r){if((r=r||this[h])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");const i=r?Date.now():0,a=this[s](e,t);if(this[f].has(t)){if(a>this[n])return y(this,this[f].get(t)),!1;const s=this[f].get(t).value;return this[u]&&(this[l]||this[u](t,s.value)),s.now=i,s.maxAge=r,s.value=e,this[o]+=a-s.length,s.length=a,this.get(t),v(this),!0}const d=new w(t,e,a,i,r);return d.length>this[n]?(this[u]&&this[u](t,e),!1):(this[o]+=d.length,this[c].unshift(d),this[f].set(t,this[c].head),v(this),!0)}has(t){if(!this[f].has(t))return!1;const e=this[f].get(t).value;return!g(this,e)}get(t){return m(this,t,!0)}peek(t){return m(this,t,!1)}pop(){const t=this[c].tail;return t?(y(this,t),t.value):null}del(t){y(this,this[f].get(t))}load(t){this.reset();const e=Date.now();for(let r=t.length-1;r>=0;r--){const i=t[r],n=i.e||0;if(0===n)this.set(i.k,i.v);else{const t=n-e;t>0&&this.set(i.k,i.v,t)}}}prune(){this[f].forEach(((t,e)=>m(this,e,!1)))}}},(t,e,r)=>{"use strict";function i(t){var e=this;if(e instanceof i||(e=new i),e.tail=null,e.head=null,e.length=0,t&&"function"==typeof t.forEach)t.forEach((function(t){e.push(t)}));else if(arguments.length>0)for(var r=0,n=arguments.length;r1)r=e;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");i=this.head.next,r=this.head.value}for(var n=0;null!==i;n++)r=t(r,i.value,n),i=i.next;return r},i.prototype.reduceReverse=function(t,e){var r,i=this.tail;if(arguments.length>1)r=e;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");i=this.tail.prev,r=this.tail.value}for(var n=this.length-1;null!==i;n--)r=t(r,i.value,n),i=i.prev;return r},i.prototype.toArray=function(){for(var t=new Array(this.length),e=0,r=this.head;null!==r;e++)t[e]=r.value,r=r.next;return t},i.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,r=this.tail;null!==r;e++)t[e]=r.value,r=r.prev;return t},i.prototype.slice=function(t,e){(e=e||this.length)<0&&(e+=this.length),(t=t||0)<0&&(t+=this.length);var r=new i;if(ethis.length&&(e=this.length);for(var n=0,o=this.head;null!==o&&nthis.length&&(e=this.length);for(var n=this.length,o=this.tail;null!==o&&n>e;n--)o=o.prev;for(;null!==o&&n>t;n--,o=o.prev)r.push(o.value);return r},i.prototype.splice=function(t,e,...r){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var i=0,o=this.head;null!==o&&i{"use strict";t.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}},(t,e,r)=>{const i=r(85);t.exports=(t,e,r)=>{try{e=new i(e,r)}catch(t){return!1}return e.test(t)}},(t,e,r)=>{const i=r(85);t.exports=(t,e)=>new i(t,e).set.map((t=>t.map((t=>t.value)).join(" ").trim().split(" ")))},(t,e,r)=>{const i=r(58),n=r(85);t.exports=(t,e,r)=>{let o=null,s=null,a=null;try{a=new n(e,r)}catch(t){return null}return t.forEach((t=>{a.test(t)&&(o&&-1!==s.compare(t)||(o=t,s=new i(o,r)))})),o}},(t,e,r)=>{const i=r(58),n=r(85);t.exports=(t,e,r)=>{let o=null,s=null,a=null;try{a=new n(e,r)}catch(t){return null}return t.forEach((t=>{a.test(t)&&(o&&1!==s.compare(t)||(o=t,s=new i(o,r)))})),o}},(t,e,r)=>{const i=r(58),n=r(85),o=r(77);t.exports=(t,e)=>{t=new n(t,e);let r=new i("0.0.0");if(t.test(r))return r;if(r=new i("0.0.0-0"),t.test(r))return r;r=null;for(let e=0;e{const e=new i(t.semver.version);switch(t.operator){case">":0===e.prerelease.length?e.patch++:e.prerelease.push(0),e.raw=e.format();case"":case">=":s&&!o(e,s)||(s=e);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${t.operator}`)}})),!s||r&&!o(r,s)||(r=s)}return r&&t.test(r)?r:null}},(t,e,r)=>{const i=r(85);t.exports=(t,e)=>{try{return new i(t,e).range||"*"}catch(t){return null}}},(t,e,r)=>{const i=r(58),n=r(84),{ANY:o}=n,s=r(85),a=r(89),h=r(77),u=r(78),l=r(81),c=r(80);t.exports=(t,e,r,f)=>{let d,p,m,g,v;switch(t=new i(t,f),e=new s(e,f),r){case">":d=h,p=l,m=u,g=">",v=">=";break;case"<":d=u,p=c,m=h,g="<",v="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(a(t,e,f))return!1;for(let r=0;r{t.semver===o&&(t=new n(">=0.0.0")),s=s||t,a=a||t,d(t.semver,s.semver,f)?s=t:m(t.semver,a.semver,f)&&(a=t)})),s.operator===g||s.operator===v)return!1;if((!a.operator||a.operator===g)&&p(t,a.semver))return!1;if(a.operator===v&&m(t,a.semver))return!1}return!0}},(t,e,r)=>{const i=r(95);t.exports=(t,e,r)=>i(t,e,">",r)},(t,e,r)=>{const i=r(95);t.exports=(t,e,r)=>i(t,e,"<",r)},(t,e,r)=>{const i=r(85);t.exports=(t,e,r)=>(t=new i(t,r),e=new i(e,r),t.intersects(e))},(t,e,r)=>{const i=r(89),n=r(67);t.exports=(t,e,r)=>{const o=[];let s=null,a=null;const h=t.sort(((t,e)=>n(t,e,r)));for(const t of h)i(t,e,r)?(a=t,s||(s=t)):(a&&o.push([s,a]),a=null,s=null);s&&o.push([s,null]);const u=[];for(const[t,e]of o)t===e?u.push(t):e||t!==h[0]?e?t===h[0]?u.push(`<=${e}`):u.push(`${t} - ${e}`):u.push(`>=${t}`):u.push("*");const l=u.join(" || "),c="string"==typeof e.raw?e.raw:String(e);return l.length{const i=r(85),n=r(84),{ANY:o}=n,s=r(89),a=r(67),h=(t,e,r)=>{if(t===e)return!0;if(1===t.length&&t[0].semver===o){if(1===e.length&&e[0].semver===o)return!0;t=r.includePrerelease?[new n(">=0.0.0-0")]:[new n(">=0.0.0")]}if(1===e.length&&e[0].semver===o){if(r.includePrerelease)return!0;e=[new n(">=0.0.0")]}const i=new Set;let h,c,f,d,p,m,g;for(const e of t)">"===e.operator||">="===e.operator?h=u(h,e,r):"<"===e.operator||"<="===e.operator?c=l(c,e,r):i.add(e.semver);if(i.size>1)return null;if(h&&c){if(f=a(h.semver,c.semver,r),f>0)return null;if(0===f&&(">="!==h.operator||"<="!==c.operator))return null}for(const t of i){if(h&&!s(t,String(h),r))return null;if(c&&!s(t,String(c),r))return null;for(const i of e)if(!s(t,String(i),r))return!1;return!0}let v=!(!c||r.includePrerelease||!c.semver.prerelease.length)&&c.semver,y=!(!h||r.includePrerelease||!h.semver.prerelease.length)&&h.semver;v&&1===v.prerelease.length&&"<"===c.operator&&0===v.prerelease[0]&&(v=!1);for(const t of e){if(g=g||">"===t.operator||">="===t.operator,m=m||"<"===t.operator||"<="===t.operator,h)if(y&&t.semver.prerelease&&t.semver.prerelease.length&&t.semver.major===y.major&&t.semver.minor===y.minor&&t.semver.patch===y.patch&&(y=!1),">"===t.operator||">="===t.operator){if(d=u(h,t,r),d===t&&d!==h)return!1}else if(">="===h.operator&&!s(h.semver,String(t),r))return!1;if(c)if(v&&t.semver.prerelease&&t.semver.prerelease.length&&t.semver.major===v.major&&t.semver.minor===v.minor&&t.semver.patch===v.patch&&(v=!1),"<"===t.operator||"<="===t.operator){if(p=l(c,t,r),p===t&&p!==c)return!1}else if("<="===c.operator&&!s(c.semver,String(t),r))return!1;if(!t.operator&&(c||h)&&0!==f)return!1}return!(h&&m&&!c&&0!==f||c&&g&&!h&&0!==f||y||v)},u=(t,e,r)=>{if(!t)return e;const i=a(t.semver,e.semver,r);return i>0?t:i<0||">"===e.operator&&">="===t.operator?e:t},l=(t,e,r)=>{if(!t)return e;const i=a(t.semver,e.semver,r);return i<0?t:i>0||"<"===e.operator&&"<="===t.operator?e:t};t.exports=(t,e,r={})=>{if(t===e)return!0;t=new i(t,r),e=new i(e,r);let n=!1;t:for(const i of t.set){for(const t of e.set){const e=h(i,t,r);if(n=n||null!==e,e)continue t}if(n)return!1}return!0}},(t,e,r)=>{"use strict";r.r(e),r.d(e,{listen:()=>s,log:()=>o});let i=0;const n=[],o=(t,e,r)=>{const o={type:t,id:String(++i),date:new Date};e&&(o.message=e),r&&(o.data=r),function(t){for(let e=0;e(n.push(t),()=>{const e=n.indexOf(t);-1!==e&&(n[e]=n[n.length-1],n.pop())});"undefined"!=typeof window&&(window.__ledgerLogsListen=s)},(t,e,r)=>{"use strict";r.r(e),r.d(e,{getFirstLedgerDevice:()=>a,getLedgerDevices:()=>s,isSupported:()=>h,requestLedgerDevice:()=>o});var i=r(53);const n=[{vendorId:i.ledgerUSBVendorId}];async function o(){return await navigator.usb.requestDevice({filters:n})}async function s(){return(await navigator.usb.getDevices()).filter((t=>t.vendorId===i.ledgerUSBVendorId))}async function a(){const t=await s();return t.length>0?t[0]:o()}const h=()=>Promise.resolve(!!navigator&&!!navigator.usb&&"function"==typeof navigator.usb.getDevices)},(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>d});var i=r(49),n=r(52),o=r(53),s=r(101),a=r(51),h=r(9).Buffer;const u=[{vendorId:o.ledgerUSBVendorId}],l=()=>{const{hid:t}=navigator;if(!t)throw new a.TransportError("navigator.hid is not supported","HIDNotSupported");return t};async function c(){const t=await l().requestDevice({filters:u});return Array.isArray(t)?t:[t]}async function f(){return(await l().getDevices()).filter((t=>t.vendorId===o.ledgerUSBVendorId))}class d extends i.default{constructor(t){super(),this.device=void 0,this.deviceModel=void 0,this.channel=Math.floor(65535*Math.random()),this.packetSize=64,this.inputs=[],this.inputCallback=void 0,this.read=()=>this.inputs.length?Promise.resolve(this.inputs.shift()):new Promise((t=>{this.inputCallback=t})),this.onInputReport=t=>{const e=h.from(t.data.buffer);this.inputCallback?(this.inputCallback(e),this.inputCallback=null):this.inputs.push(e)},this._disconnectEmitted=!1,this._emitDisconnect=t=>{this._disconnectEmitted||(this._disconnectEmitted=!0,this.emit("disconnect",t))},this.exchange=t=>this.exchangeAtomicImpl((async()=>{const{channel:e,packetSize:r}=this;(0,s.log)("apdu","=> "+t.toString("hex"));const i=(0,n.default)(e,r),o=i.makeBlocks(t);for(let t=0;t{if(t&&t.message&&t.message.includes("write"))throw this._emitDisconnect(t),new a.DisconnectedDeviceDuringOperation(t.message);throw t})),this.device=t,this.deviceModel=(0,o.identifyUSBProductId)(t.productId),t.addEventListener("inputreport",this.onInputReport)}static async request(){const[t]=await c();return d.open(t)}static async openConnected(){const t=await f();return 0===t.length?null:d.open(t[0])}static async open(t){await t.open();const e=new d(t),r=i=>{t===i.device&&(l().removeEventListener("disconnect",r),e._emitDisconnect(new a.DisconnectedDevice))};return l().addEventListener("disconnect",r),e}async close(){await this.exchangeBusyPromise,this.device.removeEventListener("inputreport",this.onInputReport),await this.device.close()}setScrambleKey(){}}d.isSupported=()=>Promise.resolve(!(!r.g.navigator||!r.g.navigator.hid)),d.list=f,d.listen=t=>{let e=!1;return async function(){const t=await f();return t.length>0?t[0]:(await c())[0]}().then((r=>{if(r){if(!e){const e=(0,o.identifyUSBProductId)(r.productId);t.next({type:"add",descriptor:r,deviceModel:e}),t.complete()}}else t.error(new a.TransportOpenUserCancelled("Access denied to use Ledger device"))}),(e=>{t.error(new a.TransportOpenUserCancelled(e.message))})),{unsubscribe:function(){e=!0}}}},(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>B});var i=r(49),n=r(51),o=r(53),s=r(105),a=r(209),h=r(101),u=r(107),l=r(197),c=r(189),f=r(181),d=r(211),p=r(212),m=r(214),g=r(164),v=r(218),y=r(210),w=r(9).Buffer;const b=()=>{const{bluetooth:t}=navigator;if(void 0===t)throw new Error("web bluetooth not supported");return t},M=()=>u.Observable.create((t=>{const e=b(),r=e=>{t.next(e.value)};e.addEventListener("availabilitychanged",r);let i=!1;return e.getAvailability().then((e=>{i||t.next(e)})),()=>{i=!0,e.removeEventListener("availabilitychanged",r)}})),E={},A=()=>({filters:(0,o.getBluetoothServiceUuids)().map((t=>({services:[t]})))});async function C(t,e){let r;if("string"==typeof t){if(E[t])return(0,h.log)("ble-verbose","Transport in cache, using that."),E[t];const e=b();r=await e.requestDevice(A())}else r=t;r.gatt.connected||((0,h.log)("ble-verbose","not connected. connecting..."),await r.gatt.connect());const[i,s]=await(async t=>{if(!t.gatt)throw new Error("bluetooth gatt not found");const[e]=await t.gatt.getPrimaryServices();if(!e)throw new Error("bluetooth service not found");const r=(0,o.getInfosForServiceUuid)(e.uuid);if(!r)throw new Error("bluetooth service infos not found");return[e,r]})(r),{deviceModel:a,writeUuid:u,notifyUuid:l}=s,[c,f]=await Promise.all([i.getCharacteristic(u),i.getCharacteristic(l)]),m=(0,y.monitorCharacteristic)(f).pipe((0,d.tap)((t=>{(0,h.log)("ble-frame","<= "+t.toString("hex"))})),(0,p.share)()),g=m.subscribe(),v=new B(r,c,m,a);if(!r.gatt.connected)throw new n.DisconnectedDevice;E[v.id]=v;const w=t=>{console.log("onDisconnect!",t),delete E[v.id],v.notYetDisconnected=!1,g.unsubscribe(),r.removeEventListener("gattserverdisconnected",w),(0,h.log)("ble-verbose",`BleTransport(${v.id}) disconnected`),v.emit("disconnect",t)};r.addEventListener("gattserverdisconnected",w);let M=Date.now();try{await v.inferMTU()}finally{Date.now()-M<1e3&&(e=!1),e&&(await r.gatt.disconnect(),await new Promise((t=>setTimeout(t,4e3))))}return e?C(r,!1):v}class B extends i.default{static listen(t){let e;return(0,h.log)("ble-verbose","listen..."),b().requestDevice(A()).then((async r=>{e||(t.next({type:"add",descriptor:r}),t.complete())}),(e=>{t.error(new n.TransportOpenUserCancelled(e.message))})),{unsubscribe:function(){e=!0}}}static async open(t){return C(t,!0)}constructor(t,e,r,i){super(),this.id=void 0,this.device=void 0,this.mtuSize=20,this.writeCharacteristic=void 0,this.notifyObservable=void 0,this.notYetDisconnected=!0,this.deviceModel=void 0,this.exchange=t=>this.exchangeAtomicImpl((async()=>{try{const e=t.toString("hex");(0,h.log)("apdu",`=> ${e}`);const r=await(0,l.merge)(this.notifyObservable.pipe(a.receiveAPDU),(0,s.sendAPDU)(this.write,t,this.mtuSize)).toPromise(),i=r.toString("hex");return(0,h.log)("apdu",`<= ${i}`),r}catch(t){throw(0,h.log)("ble-error","exchange got "+String(t)),this.notYetDisconnected&&this.device.gatt.disconnect(),t}})),this.write=async t=>{(0,h.log)("ble-frame","=> "+t.toString("hex")),await this.writeCharacteristic.writeValue(t)},this.id=t.id,this.device=t,this.writeCharacteristic=e,this.notifyObservable=r,this.deviceModel=i,(0,h.log)("ble-verbose",`BleTransport(${String(this.id)}) new instance`)}async inferMTU(){let t=23;if(await this.exchangeAtomicImpl((async()=>{try{t=await(0,l.merge)(this.notifyObservable.pipe((0,m.first)((t=>8===t.readUInt8(0))),(0,g.map)((t=>t.readUInt8(5)))),(0,c.defer)((()=>(0,f.from)(this.write(w.from([8,0,0,0,0]))))).pipe((0,v.ignoreElements)())).toPromise()+3}catch(t){throw(0,h.log)("ble-error","inferMTU got "+String(t)),this.device.gatt.disconnect(),t}})),t>23){const e=t-3;(0,h.log)("ble-verbose",`BleTransport(${String(this.id)}) mtu set to ${String(e)}`),this.mtuSize=e}return this.mtuSize}setScrambleKey(){}async close(){this.exchangeBusyPromise&&await this.exchangeBusyPromise}}B.isSupported=()=>Promise.resolve().then(b).then((()=>!0),(()=>!1)),B.observeAvailability=t=>M.subscribe(t),B.list=()=>Promise.resolve([]),B.disconnect=async t=>{(0,h.log)("ble-verbose",`user disconnect(${t})`);const e=E[t];e&&e.device.gatt.disconnect()}},(t,e,r)=>{"use strict";var i=r(9).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.sendAPDU=void 0;var n=r(106),o=r(101);e.sendAPDU=(t,e,r)=>{const s=function(t,e){const r=[];for(let i=0,n=e(0);ir-(0===t?5:3))).map(((t,r)=>{const n=i.alloc(0===r?5:3);return n.writeUInt8(5,0),n.writeUInt16BE(r,1),0===r&&n.writeUInt16BE(e.length,3),i.concat([n,t])}));return n.Observable.create((e=>{let r=!1;return async function(){for(const e of s){if(r)return;await t(e)}}().then((()=>{r=!0,e.complete()}),(t=>{r=!0,(0,o.log)("ble-error","sendAPDU failure "+String(t)),e.error(t)})),()=>{r||((0,o.log)("ble-verbose","sendAPDU interruption"),r=!0)}}))}},(t,e,r)=>{"use strict";r.r(e),r.d(e,{ArgumentOutOfRangeError:()=>C.ArgumentOutOfRangeError,AsyncSubject:()=>l.AsyncSubject,BehaviorSubject:()=>h.BehaviorSubject,ConnectableObservable:()=>n.ConnectableObservable,EMPTY:()=>N.EMPTY,EmptyError:()=>B.EmptyError,GroupedObservable:()=>o.GroupedObservable,NEVER:()=>K.NEVER,Notification:()=>w.Notification,NotificationKind:()=>w.NotificationKind,ObjectUnsubscribedError:()=>F.ObjectUnsubscribedError,Observable:()=>i.Observable,ReplaySubject:()=>u.ReplaySubject,Scheduler:()=>g.Scheduler,Subject:()=>a.Subject,Subscriber:()=>y.Subscriber,Subscription:()=>v.Subscription,TimeoutError:()=>S.TimeoutError,UnsubscriptionError:()=>_.UnsubscriptionError,VirtualAction:()=>m.VirtualAction,VirtualTimeScheduler:()=>m.VirtualTimeScheduler,animationFrame:()=>p.animationFrame,animationFrameScheduler:()=>p.animationFrameScheduler,asap:()=>c.asap,asapScheduler:()=>c.asapScheduler,async:()=>f.async,asyncScheduler:()=>f.asyncScheduler,bindCallback:()=>D.bindCallback,bindNodeCallback:()=>x.bindNodeCallback,combineLatest:()=>I.combineLatest,concat:()=>T.concat,config:()=>et.config,defer:()=>R.defer,empty:()=>N.empty,forkJoin:()=>O.forkJoin,from:()=>U.from,fromEvent:()=>k.fromEvent,fromEventPattern:()=>L.fromEventPattern,generate:()=>P.generate,identity:()=>E.identity,iif:()=>j.iif,interval:()=>$.interval,isObservable:()=>A.isObservable,merge:()=>q.merge,never:()=>K.never,noop:()=>M.noop,observable:()=>s.observable,of:()=>H.of,onErrorResumeNext:()=>G.onErrorResumeNext,pairs:()=>z.pairs,partition:()=>V.partition,pipe:()=>b.pipe,queue:()=>d.queue,queueScheduler:()=>d.queueScheduler,race:()=>W.race,range:()=>Z.range,scheduled:()=>tt.scheduled,throwError:()=>Y.throwError,timer:()=>X.timer,using:()=>J.using,zip:()=>Q.zip});var i=r(107),n=r(124),o=r(129),s=r(121),a=r(126),h=r(130),u=r(131),l=r(148),c=r(149),f=r(153),d=r(141),p=r(154),m=r(157),g=r(144),v=r(115),y=r(109),w=r(133),b=r(122),M=r(158),E=r(123),A=r(159),C=r(160),B=r(161),F=r(127),_=r(117),S=r(162),D=r(163),x=r(165),I=r(166),T=r(177),R=r(189),N=r(140),O=r(190),U=r(181),k=r(191),L=r(192),P=r(193),j=r(194),$=r(195),q=r(197),K=r(198),H=r(134),G=r(199),z=r(200),V=r(201),W=r(204),Z=r(205),Y=r(139),X=r(206),J=r(207),Q=r(208),tt=r(182),et=r(112)},(t,e,r)=>{"use strict";r.r(e),r.d(e,{Observable:()=>h});var i=r(120),n=r(108),o=r(121),s=r(122),a=r(112),h=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(t,e,r){var i=this.operator,o=(0,n.toSubscriber)(t,e,r);if(i?o.add(i.call(o,this.source)):o.add(this.source||a.config.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),a.config.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){a.config.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),(0,i.canReportError)(t)?t.error(e):console.warn(e)}},t.prototype.forEach=function(t,e){var r=this;return new(e=u(e))((function(e,i){var n;n=r.subscribe((function(e){try{t(e)}catch(t){i(t),n&&n.unsubscribe()}}),i,e)}))},t.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},t.prototype[o.observable]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e{"use strict";r.r(e),r.d(e,{toSubscriber:()=>s});var i=r(109),n=r(114),o=r(111);function s(t,e,r){if(t){if(t instanceof i.Subscriber)return t;if(t[n.rxSubscriber])return t[n.rxSubscriber]()}return t||e||r?new i.Subscriber(t,e,r):new i.Subscriber(o.empty)}},(t,e,r)=>{"use strict";r.r(e),r.d(e,{SafeSubscriber:()=>c,Subscriber:()=>l});var i=r(110),n=r(116),o=r(111),s=r(115),a=r(114),h=r(112),u=r(113),l=function(t){function e(r,i,n){var s=t.call(this)||this;switch(s.syncErrorValue=null,s.syncErrorThrown=!1,s.syncErrorThrowable=!1,s.isStopped=!1,arguments.length){case 0:s.destination=o.empty;break;case 1:if(!r){s.destination=o.empty;break}if("object"==typeof r){r instanceof e?(s.syncErrorThrowable=r.syncErrorThrowable,s.destination=r,r.add(s)):(s.syncErrorThrowable=!0,s.destination=new c(s,r));break}default:s.syncErrorThrowable=!0,s.destination=new c(s,r,i,n)}return s}return i.__extends(e,t),e.prototype[a.rxSubscriber]=function(){return this},e.create=function(t,r,i){var n=new e(t,r,i);return n.syncErrorThrowable=!1,n},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var t=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this},e}(s.Subscription),c=function(t){function e(e,r,i,s){var a,h=t.call(this)||this;h._parentSubscriber=e;var u=h;return(0,n.isFunction)(r)?a=r:r&&(a=r.next,i=r.error,s=r.complete,r!==o.empty&&(u=Object.create(r),(0,n.isFunction)(u.unsubscribe)&&h.add(u.unsubscribe.bind(u)),u.unsubscribe=h.unsubscribe.bind(h))),h._context=u,h._next=a,h._error=i,h._complete=s,h}return i.__extends(e,t),e.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;h.config.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},e.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber,r=h.config.useDeprecatedSynchronousErrorHandling;if(this._error)r&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)r?(e.syncErrorValue=t,e.syncErrorThrown=!0):(0,u.hostReportError)(t),this.unsubscribe();else{if(this.unsubscribe(),r)throw t;(0,u.hostReportError)(t)}}},e.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var r=function(){return t._complete.call(t._context)};h.config.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,r),this.unsubscribe()):(this.__tryOrUnsub(r),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){if(this.unsubscribe(),h.config.useDeprecatedSynchronousErrorHandling)throw t;(0,u.hostReportError)(t)}},e.prototype.__tryOrSetError=function(t,e,r){if(!h.config.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,r)}catch(e){return h.config.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=e,t.syncErrorThrown=!0,!0):((0,u.hostReportError)(e),!0)}return!1},e.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},e}(l)},(t,e,r)=>{"use strict";r.r(e),r.d(e,{__assign:()=>o,__asyncDelegator:()=>w,__asyncGenerator:()=>y,__asyncValues:()=>b,__await:()=>v,__awaiter:()=>l,__classPrivateFieldGet:()=>C,__classPrivateFieldSet:()=>B,__decorate:()=>a,__exportStar:()=>f,__extends:()=>n,__generator:()=>c,__importDefault:()=>A,__importStar:()=>E,__makeTemplateObject:()=>M,__metadata:()=>u,__param:()=>h,__read:()=>p,__rest:()=>s,__spread:()=>m,__spreadArrays:()=>g,__values:()=>d});var i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},i(t,e)};function n(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var o=function(){return o=Object.assign||function(t){for(var e,r=1,i=arguments.length;r=0;a--)(n=t[a])&&(s=(o<3?n(s):o>3?n(e,r,s):n(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s}function h(t,e){return function(r,i){e(r,i,t)}}function u(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function l(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{h(i.next(t))}catch(t){o(t)}}function a(t){try{h(i.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}h((i=i.apply(t,e||[])).next())}))}function c(t,e){var r,i,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,i&&(n=2&o[0]?i.return:o[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,o[1])).done)return n;switch(i=0,n&&(o=[2&o[0],n.value]),o[0]){case 0:case 1:n=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((n=(n=s.trys).length>0&&n[n.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function p(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return s}function m(){for(var t=[],e=0;e1||a(t,e)}))})}function a(t,e){try{(r=n[t](e)).value instanceof v?Promise.resolve(r.value.v).then(h,u):l(o[0][2],r)}catch(t){l(o[0][3],t)}var r}function h(t){a("next",t)}function u(t){a("throw",t)}function l(t,e){t(e),o.shift(),o.length&&a(o[0][0],o[0][1])}}function w(t){var e,r;return e={},i("next"),i("throw",(function(t){throw t})),i("return"),e[Symbol.iterator]=function(){return this},e;function i(i,n){e[i]=t[i]?function(e){return(r=!r)?{value:v(t[i](e)),done:"return"===i}:n?n(e):e}:n}}function b(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,r=t[Symbol.asyncIterator];return r?r.call(t):(t=d(t),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(r){e[r]=t[r]&&function(e){return new Promise((function(i,n){!function(t,e,r,i){Promise.resolve(i).then((function(e){t({value:e,done:r})}),e)}(i,n,(e=t[r](e)).done,e.value)}))}}}function M(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function E(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function A(t){return t&&t.__esModule?t:{default:t}}function C(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function B(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}},(t,e,r)=>{"use strict";r.r(e),r.d(e,{empty:()=>o});var i=r(112),n=r(113),o={closed:!0,next:function(t){},error:function(t){if(i.config.useDeprecatedSynchronousErrorHandling)throw t;(0,n.hostReportError)(t)},complete:function(){}}},(t,e,r)=>{"use strict";r.r(e),r.d(e,{config:()=>n});var i=!1,n={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){t&&(new Error).stack,i=t},get useDeprecatedSynchronousErrorHandling(){return i}}},(t,e,r)=>{"use strict";function i(t){setTimeout((function(){throw t}),0)}r.r(e),r.d(e,{hostReportError:()=>i})},(t,e,r)=>{"use strict";r.r(e),r.d(e,{$$rxSubscriber:()=>n,rxSubscriber:()=>i});var i=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}(),n=i},(t,e,r)=>{"use strict";r.r(e),r.d(e,{Subscription:()=>a});var i=r(118),n=r(119),o=r(116),s=r(117),a=function(){function t(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)}var e;return t.prototype.unsubscribe=function(){var e;if(!this.closed){var r=this,a=r._parentOrParents,u=r._ctorUnsubscribe,l=r._unsubscribe,c=r._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,a instanceof t)a.remove(this);else if(null!==a)for(var f=0;f{"use strict";function i(t){return"function"==typeof t}r.r(e),r.d(e,{isFunction:()=>i})},(t,e,r)=>{"use strict";r.r(e),r.d(e,{UnsubscriptionError:()=>i});var i=function(){function t(t){return Error.call(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t,this}return t.prototype=Object.create(Error.prototype),t}()},(t,e,r)=>{"use strict";r.r(e),r.d(e,{isArray:()=>i});var i=function(){return Array.isArray||function(t){return t&&"number"==typeof t.length}}()},(t,e,r)=>{"use strict";function i(t){return null!==t&&"object"==typeof t}r.r(e),r.d(e,{isObject:()=>i})},(t,e,r)=>{"use strict";r.r(e),r.d(e,{canReportError:()=>n});var i=r(109);function n(t){for(;t;){var e=t,r=e.closed,n=e.destination,o=e.isStopped;if(r||o)return!1;t=n&&n instanceof i.Subscriber?n:null}return!0}},(t,e,r)=>{"use strict";r.r(e),r.d(e,{observable:()=>i});var i=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}()},(t,e,r)=>{"use strict";r.r(e),r.d(e,{pipe:()=>n,pipeFromArray:()=>o});var i=r(123);function n(){for(var t=[],e=0;e{"use strict";function i(t){return t}r.r(e),r.d(e,{identity:()=>i})},(t,e,r)=>{"use strict";r.r(e),r.d(e,{ConnectableObservable:()=>u,connectableObservableDescriptor:()=>l});var i=r(110),n=r(126),o=r(107),s=r(109),a=r(115),h=r(125),u=function(t){function e(e,r){var i=t.call(this)||this;return i.source=e,i.subjectFactory=r,i._refCount=0,i._isComplete=!1,i}return i.__extends(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype.connect=function(){var t=this._connection;return t||(this._isComplete=!1,(t=this._connection=new a.Subscription).add(this.source.subscribe(new c(this.getSubject(),this))),t.closed&&(this._connection=null,t=a.Subscription.EMPTY)),t},e.prototype.refCount=function(){return(0,h.refCount)()(this)},e}(o.Observable),l=function(){var t=u.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:t._subscribe},_isComplete:{value:t._isComplete,writable:!0},getSubject:{value:t.getSubject},connect:{value:t.connect},refCount:{value:t.refCount}}}(),c=function(t){function e(e,r){var i=t.call(this,e)||this;return i.connectable=r,i}return i.__extends(e,t),e.prototype._error=function(e){this._unsubscribe(),t.prototype._error.call(this,e)},e.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}},e}(n.SubjectSubscriber);s.Subscriber},(t,e,r)=>{"use strict";r.r(e),r.d(e,{refCount:()=>o});var i=r(110),n=r(109);function o(){return function(t){return t.lift(new s(t))}}var s=function(){function t(t){this.connectable=t}return t.prototype.call=function(t,e){var r=this.connectable;r._refCount++;var i=new a(t,r),n=e.subscribe(i);return i.closed||(i.connection=r.connect()),n},t}(),a=function(t){function e(e,r){var i=t.call(this,e)||this;return i.connectable=r,i}return i.__extends(e,t),e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._refCount;if(e<=0)this.connection=null;else if(t._refCount=e-1,e>1)this.connection=null;else{var r=this.connection,i=t._connection;this.connection=null,!i||r&&i!==r||i.unsubscribe()}}else this.connection=null},e}(n.Subscriber)},(t,e,r)=>{"use strict";r.r(e),r.d(e,{AnonymousSubject:()=>f,Subject:()=>c,SubjectSubscriber:()=>l});var i=r(110),n=r(107),o=r(109),s=r(115),a=r(127),h=r(128),u=r(114),l=function(t){function e(e){var r=t.call(this,e)||this;return r.destination=e,r}return i.__extends(e,t),e}(o.Subscriber),c=function(t){function e(){var e=t.call(this)||this;return e.observers=[],e.closed=!1,e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return i.__extends(e,t),e.prototype[u.rxSubscriber]=function(){return new l(this)},e.prototype.lift=function(t){var e=new f(this,this);return e.operator=t,e},e.prototype.next=function(t){if(this.closed)throw new a.ObjectUnsubscribedError;if(!this.isStopped)for(var e=this.observers,r=e.length,i=e.slice(),n=0;n{"use strict";r.r(e),r.d(e,{ObjectUnsubscribedError:()=>i});var i=function(){function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t}()},(t,e,r)=>{"use strict";r.r(e),r.d(e,{SubjectSubscription:()=>n});var i=r(110),n=function(t){function e(e,r){var i=t.call(this)||this;return i.subject=e,i.subscriber=r,i.closed=!1,i}return i.__extends(e,t),e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t=this.subject,e=t.observers;if(this.subject=null,e&&0!==e.length&&!t.isStopped&&!t.closed){var r=e.indexOf(this.subscriber);-1!==r&&e.splice(r,1)}}},e}(r(115).Subscription)},(t,e,r)=>{"use strict";r.r(e),r.d(e,{GroupedObservable:()=>f,groupBy:()=>h});var i=r(110),n=r(109),o=r(115),s=r(107),a=r(126);function h(t,e,r,i){return function(n){return n.lift(new u(t,e,r,i))}}var u=function(){function t(t,e,r,i){this.keySelector=t,this.elementSelector=e,this.durationSelector=r,this.subjectSelector=i}return t.prototype.call=function(t,e){return e.subscribe(new l(t,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},t}(),l=function(t){function e(e,r,i,n,o){var s=t.call(this,e)||this;return s.keySelector=r,s.elementSelector=i,s.durationSelector=n,s.subjectSelector=o,s.groups=null,s.attemptedToUnsubscribe=!1,s.count=0,s}return i.__extends(e,t),e.prototype._next=function(t){var e;try{e=this.keySelector(t)}catch(t){return void this.error(t)}this._group(t,e)},e.prototype._group=function(t,e){var r=this.groups;r||(r=this.groups=new Map);var i,n=r.get(e);if(this.elementSelector)try{i=this.elementSelector(t)}catch(t){this.error(t)}else i=t;if(!n){n=this.subjectSelector?this.subjectSelector():new a.Subject,r.set(e,n);var o=new f(e,n,this);if(this.destination.next(o),this.durationSelector){var s=void 0;try{s=this.durationSelector(new f(e,n))}catch(t){return void this.error(t)}this.add(s.subscribe(new c(e,n,this)))}}n.closed||n.next(i)},e.prototype._error=function(t){var e=this.groups;e&&(e.forEach((function(e,r){e.error(t)})),e.clear()),this.destination.error(t)},e.prototype._complete=function(){var t=this.groups;t&&(t.forEach((function(t,e){t.complete()})),t.clear()),this.destination.complete()},e.prototype.removeGroup=function(t){this.groups.delete(t)},e.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&t.prototype.unsubscribe.call(this))},e}(n.Subscriber),c=function(t){function e(e,r,i){var n=t.call(this,r)||this;return n.key=e,n.group=r,n.parent=i,n}return i.__extends(e,t),e.prototype._next=function(t){this.complete()},e.prototype._unsubscribe=function(){var t=this.parent,e=this.key;this.key=this.parent=null,t&&t.removeGroup(e)},e}(n.Subscriber),f=function(t){function e(e,r,i){var n=t.call(this)||this;return n.key=e,n.groupSubject=r,n.refCountSubscription=i,n}return i.__extends(e,t),e.prototype._subscribe=function(t){var e=new o.Subscription,r=this.refCountSubscription,i=this.groupSubject;return r&&!r.closed&&e.add(new d(r)),e.add(i.subscribe(t)),e},e}(s.Observable),d=function(t){function e(e){var r=t.call(this)||this;return r.parent=e,e.count++,r}return i.__extends(e,t),e.prototype.unsubscribe=function(){var e=this.parent;e.closed||this.closed||(t.prototype.unsubscribe.call(this),e.count-=1,0===e.count&&e.attemptedToUnsubscribe&&e.unsubscribe())},e}(o.Subscription)},(t,e,r)=>{"use strict";r.r(e),r.d(e,{BehaviorSubject:()=>s});var i=r(110),n=r(126),o=r(127),s=function(t){function e(e){var r=t.call(this)||this;return r._value=e,r}return i.__extends(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),e.prototype._subscribe=function(e){var r=t.prototype._subscribe.call(this,e);return r&&!r.closed&&e.next(this._value),r},e.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new o.ObjectUnsubscribedError;return this._value},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},e}(n.Subject)},(t,e,r)=>{"use strict";r.r(e),r.d(e,{ReplaySubject:()=>l});var i=r(110),n=r(126),o=r(141),s=r(115),a=r(132),h=r(127),u=r(128),l=function(t){function e(e,r,i){void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===r&&(r=Number.POSITIVE_INFINITY);var n=t.call(this)||this;return n.scheduler=i,n._events=[],n._infiniteTimeWindow=!1,n._bufferSize=e<1?1:e,n._windowTime=r<1?1:r,r===Number.POSITIVE_INFINITY?(n._infiniteTimeWindow=!0,n.next=n.nextInfiniteTimeWindow):n.next=n.nextTimeWindow,n}return i.__extends(e,t),e.prototype.nextInfiniteTimeWindow=function(e){if(!this.isStopped){var r=this._events;r.push(e),r.length>this._bufferSize&&r.shift()}t.prototype.next.call(this,e)},e.prototype.nextTimeWindow=function(e){this.isStopped||(this._events.push(new c(this._getNow(),e)),this._trimBufferThenGetEvents()),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){var e,r=this._infiniteTimeWindow,i=r?this._events:this._trimBufferThenGetEvents(),n=this.scheduler,o=i.length;if(this.closed)throw new h.ObjectUnsubscribedError;if(this.isStopped||this.hasError?e=s.Subscription.EMPTY:(this.observers.push(t),e=new u.SubjectSubscription(this,t)),n&&t.add(t=new a.ObserveOnSubscriber(t,n)),r)for(var l=0;le&&(o=Math.max(o,n-e)),o>0&&i.splice(0,o),i},e}(n.Subject),c=function(){return function(t,e){this.time=t,this.value=e}}()},(t,e,r)=>{"use strict";r.r(e),r.d(e,{ObserveOnMessage:()=>u,ObserveOnOperator:()=>a,ObserveOnSubscriber:()=>h,observeOn:()=>s});var i=r(110),n=r(109),o=r(133);function s(t,e){return void 0===e&&(e=0),function(r){return r.lift(new a(t,e))}}var a=function(){function t(t,e){void 0===e&&(e=0),this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return e.subscribe(new h(t,this.scheduler,this.delay))},t}(),h=function(t){function e(e,r,i){void 0===i&&(i=0);var n=t.call(this,e)||this;return n.scheduler=r,n.delay=i,n}return i.__extends(e,t),e.dispatch=function(t){var e=t.notification,r=t.destination;e.observe(r),this.unsubscribe()},e.prototype.scheduleMessage=function(t){this.destination.add(this.scheduler.schedule(e.dispatch,this.delay,new u(t,this.destination)))},e.prototype._next=function(t){this.scheduleMessage(o.Notification.createNext(t))},e.prototype._error=function(t){this.scheduleMessage(o.Notification.createError(t)),this.unsubscribe()},e.prototype._complete=function(){this.scheduleMessage(o.Notification.createComplete()),this.unsubscribe()},e}(n.Subscriber),u=function(){return function(t,e){this.notification=t,this.destination=e}}()},(t,e,r)=>{"use strict";r.r(e),r.d(e,{Notification:()=>a,NotificationKind:()=>i});var i,n=r(140),o=r(134),s=r(139);i||(i={});var a=function(){function t(t,e,r){this.kind=t,this.value=e,this.error=r,this.hasValue="N"===t}return t.prototype.observe=function(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}},t.prototype.do=function(t,e,r){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return r&&r()}},t.prototype.accept=function(t,e,r){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,r)},t.prototype.toObservable=function(){switch(this.kind){case"N":return(0,o.of)(this.value);case"E":return(0,s.throwError)(this.error);case"C":return(0,n.empty)()}throw new Error("unexpected notification kind value")},t.createNext=function(e){return void 0!==e?new t("N",e):t.undefinedValueNotification},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t}()},(t,e,r)=>{"use strict";r.r(e),r.d(e,{of:()=>s});var i=r(135),n=r(137),o=r(136);function s(){for(var t=[],e=0;e{"use strict";function i(t){return t&&"function"==typeof t.schedule}r.r(e),r.d(e,{isScheduler:()=>i})},(t,e,r)=>{"use strict";r.r(e),r.d(e,{scheduleArray:()=>o});var i=r(107),n=r(115);function o(t,e){return new i.Observable((function(r){var i=new n.Subscription,o=0;return i.add(e.schedule((function(){o!==t.length?(r.next(t[o++]),r.closed||i.add(this.schedule())):r.complete()}))),i}))}},(t,e,r)=>{"use strict";r.r(e),r.d(e,{fromArray:()=>s});var i=r(107),n=r(138),o=r(136);function s(t,e){return e?(0,o.scheduleArray)(t,e):new i.Observable((0,n.subscribeToArray)(t))}},(t,e,r)=>{"use strict";r.r(e),r.d(e,{subscribeToArray:()=>i});var i=function(t){return function(e){for(var r=0,i=t.length;r{"use strict";r.r(e),r.d(e,{throwError:()=>n});var i=r(107);function n(t,e){return e?new i.Observable((function(r){return e.schedule(o,0,{error:t,subscriber:r})})):new i.Observable((function(e){return e.error(t)}))}function o(t){var e=t.error;t.subscriber.error(e)}},(t,e,r)=>{"use strict";r.r(e),r.d(e,{EMPTY:()=>n,empty:()=>o});var i=r(107),n=new i.Observable((function(t){return t.complete()}));function o(t){return t?function(t){return new i.Observable((function(e){return t.schedule((function(){return e.complete()}))}))}(t):n}},(t,e,r)=>{"use strict";r.r(e),r.d(e,{queue:()=>o,queueScheduler:()=>n});var i=r(145),n=new(r(142).QueueScheduler)(i.QueueAction),o=n},(t,e,r)=>{"use strict";r.r(e),r.d(e,{QueueScheduler:()=>n});var i=r(110),n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r(143).AsyncScheduler)},(t,e,r)=>{"use strict";r.r(e),r.d(e,{AsyncScheduler:()=>o});var i=r(110),n=r(144),o=function(t){function e(r,i){void 0===i&&(i=n.Scheduler.now);var o=t.call(this,r,(function(){return e.delegate&&e.delegate!==o?e.delegate.now():i()}))||this;return o.actions=[],o.active=!1,o.scheduled=void 0,o}return i.__extends(e,t),e.prototype.schedule=function(r,i,n){return void 0===i&&(i=0),e.delegate&&e.delegate!==this?e.delegate.schedule(r,i,n):t.prototype.schedule.call(this,r,i,n)},e.prototype.flush=function(t){var e=this.actions;if(this.active)e.push(t);else{var r;this.active=!0;do{if(r=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,r){for(;t=e.shift();)t.unsubscribe();throw r}}},e}(n.Scheduler)},(t,e,r)=>{"use strict";r.r(e),r.d(e,{Scheduler:()=>i});var i=function(){function t(e,r){void 0===r&&(r=t.now),this.SchedulerAction=e,this.now=r}return t.prototype.schedule=function(t,e,r){return void 0===e&&(e=0),new this.SchedulerAction(this,t).schedule(r,e)},t.now=function(){return Date.now()},t}()},(t,e,r)=>{"use strict";r.r(e),r.d(e,{QueueAction:()=>n});var i=r(110),n=function(t){function e(e,r){var i=t.call(this,e,r)||this;return i.scheduler=e,i.work=r,i}return i.__extends(e,t),e.prototype.schedule=function(e,r){return void 0===r&&(r=0),r>0?t.prototype.schedule.call(this,e,r):(this.delay=r,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,r){return r>0||this.closed?t.prototype.execute.call(this,e,r):this._execute(e,r)},e.prototype.requestAsyncId=function(e,r,i){return void 0===i&&(i=0),null!==i&&i>0||null===i&&this.delay>0?t.prototype.requestAsyncId.call(this,e,r,i):e.flush(this)},e}(r(146).AsyncAction)},(t,e,r)=>{"use strict";r.r(e),r.d(e,{AsyncAction:()=>n});var i=r(110),n=function(t){function e(e,r){var i=t.call(this,e,r)||this;return i.scheduler=e,i.work=r,i.pending=!1,i}return i.__extends(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var r=this.id,i=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(i,r,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(i,this.id,e),this},e.prototype.requestAsyncId=function(t,e,r){return void 0===r&&(r=0),setInterval(t.flush.bind(t,this),r)},e.prototype.recycleAsyncId=function(t,e,r){if(void 0===r&&(r=0),null!==r&&this.delay===r&&!1===this.pending)return e;clearInterval(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(t,e);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var r=!1,i=void 0;try{this.work(t)}catch(t){r=!0,i=!!t&&t||new Error(t)}if(r)return this.unsubscribe(),i},e.prototype._unsubscribe=function(){var t=this.id,e=this.scheduler,r=e.actions,i=r.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==i&&r.splice(i,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null},e}(r(147).Action)},(t,e,r)=>{"use strict";r.r(e),r.d(e,{Action:()=>n});var i=r(110),n=function(t){function e(e,r){return t.call(this)||this}return i.__extends(e,t),e.prototype.schedule=function(t,e){return void 0===e&&(e=0),this},e}(r(115).Subscription)},(t,e,r)=>{"use strict";r.r(e),r.d(e,{AsyncSubject:()=>s});var i=r(110),n=r(126),o=r(115),s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.value=null,e.hasNext=!1,e.hasCompleted=!1,e}return i.__extends(e,t),e.prototype._subscribe=function(e){return this.hasError?(e.error(this.thrownError),o.Subscription.EMPTY):this.hasCompleted&&this.hasNext?(e.next(this.value),e.complete(),o.Subscription.EMPTY):t.prototype._subscribe.call(this,e)},e.prototype.next=function(t){this.hasCompleted||(this.value=t,this.hasNext=!0)},e.prototype.error=function(e){this.hasCompleted||t.prototype.error.call(this,e)},e.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&t.prototype.next.call(this,this.value),t.prototype.complete.call(this)},e}(n.Subject)},(t,e,r)=>{"use strict";r.r(e),r.d(e,{asap:()=>o,asapScheduler:()=>n});var i=r(151),n=new(r(150).AsapScheduler)(i.AsapAction),o=n},(t,e,r)=>{"use strict";r.r(e),r.d(e,{AsapScheduler:()=>n});var i=r(110),n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,r=this.actions,i=-1,n=r.length;t=t||r.shift();do{if(e=t.execute(t.state,t.delay))break}while(++i{"use strict";r.r(e),r.d(e,{AsapAction:()=>o});var i=r(110),n=r(152),o=function(t){function e(e,r){var i=t.call(this,e,r)||this;return i.scheduler=e,i.work=r,i}return i.__extends(e,t),e.prototype.requestAsyncId=function(e,r,i){return void 0===i&&(i=0),null!==i&&i>0?t.prototype.requestAsyncId.call(this,e,r,i):(e.actions.push(this),e.scheduled||(e.scheduled=n.Immediate.setImmediate(e.flush.bind(e,null))))},e.prototype.recycleAsyncId=function(e,r,i){if(void 0===i&&(i=0),null!==i&&i>0||null===i&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,r,i);0===e.actions.length&&(n.Immediate.clearImmediate(r),e.scheduled=void 0)},e}(r(146).AsyncAction)},(t,e,r)=>{"use strict";r.r(e),r.d(e,{Immediate:()=>a,TestTools:()=>h});var i=1,n=function(){return Promise.resolve()}(),o={};function s(t){return t in o&&(delete o[t],!0)}var a={setImmediate:function(t){var e=i++;return o[e]=!0,n.then((function(){return s(e)&&t()})),e},clearImmediate:function(t){s(t)}},h={pending:function(){return Object.keys(o).length}}},(t,e,r)=>{"use strict";r.r(e),r.d(e,{async:()=>o,asyncScheduler:()=>n});var i=r(146),n=new(r(143).AsyncScheduler)(i.AsyncAction),o=n},(t,e,r)=>{"use strict";r.r(e),r.d(e,{animationFrame:()=>o,animationFrameScheduler:()=>n});var i=r(156),n=new(r(155).AnimationFrameScheduler)(i.AnimationFrameAction),o=n},(t,e,r)=>{"use strict";r.r(e),r.d(e,{AnimationFrameScheduler:()=>n});var i=r(110),n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,r=this.actions,i=-1,n=r.length;t=t||r.shift();do{if(e=t.execute(t.state,t.delay))break}while(++i{"use strict";r.r(e),r.d(e,{AnimationFrameAction:()=>n});var i=r(110),n=function(t){function e(e,r){var i=t.call(this,e,r)||this;return i.scheduler=e,i.work=r,i}return i.__extends(e,t),e.prototype.requestAsyncId=function(e,r,i){return void 0===i&&(i=0),null!==i&&i>0?t.prototype.requestAsyncId.call(this,e,r,i):(e.actions.push(this),e.scheduled||(e.scheduled=requestAnimationFrame((function(){return e.flush(null)}))))},e.prototype.recycleAsyncId=function(e,r,i){if(void 0===i&&(i=0),null!==i&&i>0||null===i&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,r,i);0===e.actions.length&&(cancelAnimationFrame(r),e.scheduled=void 0)},e}(r(146).AsyncAction)},(t,e,r)=>{"use strict";r.r(e),r.d(e,{VirtualAction:()=>s,VirtualTimeScheduler:()=>o});var i=r(110),n=r(146),o=function(t){function e(e,r){void 0===e&&(e=s),void 0===r&&(r=Number.POSITIVE_INFINITY);var i=t.call(this,e,(function(){return i.frame}))||this;return i.maxFrames=r,i.frame=0,i.index=-1,i}return i.__extends(e,t),e.prototype.flush=function(){for(var t,e,r=this.actions,i=this.maxFrames;(e=r[0])&&e.delay<=i&&(r.shift(),this.frame=e.delay,!(t=e.execute(e.state,e.delay))););if(t){for(;e=r.shift();)e.unsubscribe();throw t}},e.frameTimeFactor=10,e}(r(143).AsyncScheduler),s=function(t){function e(e,r,i){void 0===i&&(i=e.index+=1);var n=t.call(this,e,r)||this;return n.scheduler=e,n.work=r,n.index=i,n.active=!0,n.index=e.index=i,n}return i.__extends(e,t),e.prototype.schedule=function(r,i){if(void 0===i&&(i=0),!this.id)return t.prototype.schedule.call(this,r,i);this.active=!1;var n=new e(this.scheduler,this.work);return this.add(n),n.schedule(r,i)},e.prototype.requestAsyncId=function(t,r,i){void 0===i&&(i=0),this.delay=t.frame+i;var n=t.actions;return n.push(this),n.sort(e.sortActions),!0},e.prototype.recycleAsyncId=function(t,e,r){void 0===r&&(r=0)},e.prototype._execute=function(e,r){if(!0===this.active)return t.prototype._execute.call(this,e,r)},e.sortActions=function(t,e){return t.delay===e.delay?t.index===e.index?0:t.index>e.index?1:-1:t.delay>e.delay?1:-1},e}(n.AsyncAction)},(t,e,r)=>{"use strict";function i(){}r.r(e),r.d(e,{noop:()=>i})},(t,e,r)=>{"use strict";r.r(e),r.d(e,{isObservable:()=>n});var i=r(107);function n(t){return!!t&&(t instanceof i.Observable||"function"==typeof t.lift&&"function"==typeof t.subscribe)}},(t,e,r)=>{"use strict";r.r(e),r.d(e,{ArgumentOutOfRangeError:()=>i});var i=function(){function t(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return t.prototype=Object.create(Error.prototype),t}()},(t,e,r)=>{"use strict";r.r(e),r.d(e,{EmptyError:()=>i});var i=function(){function t(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return t.prototype=Object.create(Error.prototype),t}()},(t,e,r)=>{"use strict";r.r(e),r.d(e,{TimeoutError:()=>i});var i=function(){function t(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return t.prototype=Object.create(Error.prototype),t}()},(t,e,r)=>{"use strict";r.r(e),r.d(e,{bindCallback:()=>u});var i=r(107),n=r(148),o=r(164),s=r(120),a=r(118),h=r(135);function u(t,e,r){if(e){if(!(0,h.isScheduler)(e))return function(){for(var i=[],n=0;n{"use strict";r.r(e),r.d(e,{MapOperator:()=>s,map:()=>o});var i=r(110),n=r(109);function o(t,e){return function(r){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return r.lift(new s(t,e))}}var s=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.project,this.thisArg))},t}(),a=function(t){function e(e,r,i){var n=t.call(this,e)||this;return n.project=r,n.count=0,n.thisArg=i||n,n}return i.__extends(e,t),e.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(n.Subscriber)},(t,e,r)=>{"use strict";r.r(e),r.d(e,{bindNodeCallback:()=>u});var i=r(107),n=r(148),o=r(164),s=r(120),a=r(135),h=r(118);function u(t,e,r){if(e){if(!(0,a.isScheduler)(e))return function(){for(var i=[],n=0;n{"use strict";r.r(e),r.d(e,{CombineLatestOperator:()=>c,CombineLatestSubscriber:()=>f,combineLatest:()=>l});var i=r(110),n=r(135),o=r(118),s=r(176),a=r(167),h=r(137),u={};function l(){for(var t=[],e=0;e{"use strict";r.r(e),r.d(e,{subscribeToResult:()=>s});var i=r(168),n=r(169),o=r(107);function s(t,e,r,s,a){if(void 0===a&&(a=new i.InnerSubscriber(t,r,s)),!a.closed)return e instanceof o.Observable?e.subscribe(a):(0,n.subscribeTo)(e)(a)}},(t,e,r)=>{"use strict";r.r(e),r.d(e,{InnerSubscriber:()=>n});var i=r(110),n=function(t){function e(e,r,i){var n=t.call(this)||this;return n.parent=e,n.outerValue=r,n.outerIndex=i,n.index=0,n}return i.__extends(e,t),e.prototype._next=function(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)},e.prototype._error=function(t){this.parent.notifyError(t,this),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(r(109).Subscriber)},(t,e,r)=>{"use strict";r.r(e),r.d(e,{subscribeTo:()=>f});var i=r(138),n=r(173),o=r(175),s=r(170),a=r(171),h=r(172),u=r(119),l=r(174),c=r(121),f=function(t){if(t&&"function"==typeof t[c.observable])return(0,s.subscribeToObservable)(t);if((0,a.isArrayLike)(t))return(0,i.subscribeToArray)(t);if((0,h.isPromise)(t))return(0,n.subscribeToPromise)(t);if(t&&"function"==typeof t[l.iterator])return(0,o.subscribeToIterable)(t);var e=(0,u.isObject)(t)?"an invalid object":"'"+t+"'";throw new TypeError("You provided "+e+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")}},(t,e,r)=>{"use strict";r.r(e),r.d(e,{subscribeToObservable:()=>n});var i=r(121),n=function(t){return function(e){var r=t[i.observable]();if("function"!=typeof r.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return r.subscribe(e)}}},(t,e,r)=>{"use strict";r.r(e),r.d(e,{isArrayLike:()=>i});var i=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t}},(t,e,r)=>{"use strict";function i(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}r.r(e),r.d(e,{isPromise:()=>i})},(t,e,r)=>{"use strict";r.r(e),r.d(e,{subscribeToPromise:()=>n});var i=r(113),n=function(t){return function(e){return t.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,i.hostReportError),e}}},(t,e,r)=>{"use strict";function i(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}r.r(e),r.d(e,{$$iterator:()=>o,getSymbolIterator:()=>i,iterator:()=>n});var n=i(),o=n},(t,e,r)=>{"use strict";r.r(e),r.d(e,{subscribeToIterable:()=>n});var i=r(174),n=function(t){return function(e){for(var r=t[i.iterator]();;){var n=void 0;try{n=r.next()}catch(t){return e.error(t),e}if(n.done){e.complete();break}if(e.next(n.value),e.closed)break}return"function"==typeof r.return&&e.add((function(){r.return&&r.return()})),e}}},(t,e,r)=>{"use strict";r.r(e),r.d(e,{OuterSubscriber:()=>n});var i=r(110),n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.notifyNext=function(t,e,r,i,n){this.destination.next(e)},e.prototype.notifyError=function(t,e){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.destination.complete()},e}(r(109).Subscriber)},(t,e,r)=>{"use strict";r.r(e),r.d(e,{concat:()=>o});var i=r(134),n=r(178);function o(){for(var t=[],e=0;e{"use strict";r.r(e),r.d(e,{concatAll:()=>n});var i=r(179);function n(){return(0,i.mergeAll)(1)}},(t,e,r)=>{"use strict";r.r(e),r.d(e,{mergeAll:()=>o});var i=r(180),n=r(123);function o(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),(0,i.mergeMap)(n.identity,t)}},(t,e,r)=>{"use strict";r.r(e),r.d(e,{MergeMapOperator:()=>h,MergeMapSubscriber:()=>u,flatMap:()=>l,mergeMap:()=>a});var i=r(110),n=r(164),o=r(181),s=r(188);function a(t,e,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),"function"==typeof e?function(i){return i.pipe(a((function(r,i){return(0,o.from)(t(r,i)).pipe((0,n.map)((function(t,n){return e(r,t,i,n)})))}),r))}:("number"==typeof e&&(r=e),function(e){return e.lift(new h(t,r))})}var h=function(){function t(t,e){void 0===e&&(e=Number.POSITIVE_INFINITY),this.project=t,this.concurrent=e}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.project,this.concurrent))},t}(),u=function(t){function e(e,r,i){void 0===i&&(i=Number.POSITIVE_INFINITY);var n=t.call(this,e)||this;return n.project=r,n.concurrent=i,n.hasCompleted=!1,n.buffer=[],n.active=0,n.index=0,n}return i.__extends(e,t),e.prototype._next=function(t){this.active0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(s.SimpleOuterSubscriber),l=a},(t,e,r)=>{"use strict";r.r(e),r.d(e,{from:()=>s});var i=r(107),n=r(169),o=r(182);function s(t,e){return e?(0,o.scheduled)(t,e):t instanceof i.Observable?t:new i.Observable((0,n.subscribeTo)(t))}},(t,e,r)=>{"use strict";r.r(e),r.d(e,{scheduled:()=>c});var i=r(184),n=r(185),o=r(136),s=r(187),a=r(183),h=r(172),u=r(171),l=r(186);function c(t,e){if(null!=t){if((0,a.isInteropObservable)(t))return(0,i.scheduleObservable)(t,e);if((0,h.isPromise)(t))return(0,n.schedulePromise)(t,e);if((0,u.isArrayLike)(t))return(0,o.scheduleArray)(t,e);if((0,l.isIterable)(t)||"string"==typeof t)return(0,s.scheduleIterable)(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}},(t,e,r)=>{"use strict";r.r(e),r.d(e,{isInteropObservable:()=>n});var i=r(121);function n(t){return t&&"function"==typeof t[i.observable]}},(t,e,r)=>{"use strict";r.r(e),r.d(e,{scheduleObservable:()=>s});var i=r(107),n=r(115),o=r(121);function s(t,e){return new i.Observable((function(r){var i=new n.Subscription;return i.add(e.schedule((function(){var n=t[o.observable]();i.add(n.subscribe({next:function(t){i.add(e.schedule((function(){return r.next(t)})))},error:function(t){i.add(e.schedule((function(){return r.error(t)})))},complete:function(){i.add(e.schedule((function(){return r.complete()})))}}))}))),i}))}},(t,e,r)=>{"use strict";r.r(e),r.d(e,{schedulePromise:()=>o});var i=r(107),n=r(115);function o(t,e){return new i.Observable((function(r){var i=new n.Subscription;return i.add(e.schedule((function(){return t.then((function(t){i.add(e.schedule((function(){r.next(t),i.add(e.schedule((function(){return r.complete()})))})))}),(function(t){i.add(e.schedule((function(){return r.error(t)})))}))}))),i}))}},(t,e,r)=>{"use strict";r.r(e),r.d(e,{isIterable:()=>n});var i=r(174);function n(t){return t&&"function"==typeof t[i.iterator]}},(t,e,r)=>{"use strict";r.r(e),r.d(e,{scheduleIterable:()=>s});var i=r(107),n=r(115),o=r(174);function s(t,e){if(!t)throw new Error("Iterable cannot be null");return new i.Observable((function(r){var i,s=new n.Subscription;return s.add((function(){i&&"function"==typeof i.return&&i.return()})),s.add(e.schedule((function(){i=t[o.iterator](),s.add(e.schedule((function(){if(!r.closed){var t,e;try{var n=i.next();t=n.value,e=n.done}catch(t){return void r.error(t)}e?r.complete():(r.next(t),this.schedule())}})))}))),s}))}},(t,e,r)=>{"use strict";r.r(e),r.d(e,{ComplexInnerSubscriber:()=>h,ComplexOuterSubscriber:()=>l,SimpleInnerSubscriber:()=>a,SimpleOuterSubscriber:()=>u,innerSubscribe:()=>c});var i=r(110),n=r(109),o=r(107),s=r(169),a=function(t){function e(e){var r=t.call(this)||this;return r.parent=e,r}return i.__extends(e,t),e.prototype._next=function(t){this.parent.notifyNext(t)},e.prototype._error=function(t){this.parent.notifyError(t),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},e}(n.Subscriber),h=function(t){function e(e,r,i){var n=t.call(this)||this;return n.parent=e,n.outerValue=r,n.outerIndex=i,n}return i.__extends(e,t),e.prototype._next=function(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this)},e.prototype._error=function(t){this.parent.notifyError(t),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(n.Subscriber),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.notifyNext=function(t){this.destination.next(t)},e.prototype.notifyError=function(t){this.destination.error(t)},e.prototype.notifyComplete=function(){this.destination.complete()},e}(n.Subscriber),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.notifyNext=function(t,e,r,i){this.destination.next(e)},e.prototype.notifyError=function(t){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.destination.complete()},e}(n.Subscriber);function c(t,e){if(!e.closed){if(t instanceof o.Observable)return t.subscribe(e);var r;try{r=(0,s.subscribeTo)(t)(e)}catch(t){e.error(t)}return r}}},(t,e,r)=>{"use strict";r.r(e),r.d(e,{defer:()=>s});var i=r(107),n=r(181),o=r(140);function s(t){return new i.Observable((function(e){var r;try{r=t()}catch(t){return void e.error(t)}return(r?(0,n.from)(r):(0,o.empty)()).subscribe(e)}))}},(t,e,r)=>{"use strict";r.r(e),r.d(e,{forkJoin:()=>h});var i=r(107),n=r(118),o=r(164),s=r(119),a=r(181);function h(){for(var t=[],e=0;e