Update Dependencies

This commit is contained in:
Leo committed 2023-11-17 14:43:11 +00:00
1 parent 6d6f53d288
commit fdcf397f64
3 files changed
+890 -655

No files matched your search

+854 -619
View File
File diff suppressed because it is too large. Load diff
+35 -35
View File
@@ -1,108 +1,108 @@
!function e(t,i,n){function r(a,s){if(!i[a]){if(!t[a]){var c="function"==typeof require&&require;if(!s&&c)return c(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var u=i[a]={exports:{}};t[a][0].call(u.exports,(function(e){return r(t[a][1][e]||e)}),u,u.exports,e,t,i,n)}return i[a].exports}for(var o="function"==typeof require&&require,a=0;a<n.length;a++)r(n[a]);return r}({1:[function(e,t,i){"use strict";function n(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function r(e){return e instanceof n(e).Element||e instanceof Element}function o(e){return e instanceof n(e).HTMLElement||e instanceof HTMLElement}function a(e){return"undefined"!=typeof ShadowRoot&&(e instanceof n(e).ShadowRoot||e instanceof ShadowRoot)}Object.defineProperty(i,"__esModule",{value:!0});var s=Math.max,c=Math.min,l=Math.round;function u(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function p(){return!/^((?!chrome|android).)*safari/i.test(u())}function d(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=!1);var a=e.getBoundingClientRect(),s=1,c=1;t&&o(e)&&(s=e.offsetWidth>0&&l(a.width)/e.offsetWidth||1,c=e.offsetHeight>0&&l(a.height)/e.offsetHeight||1);var u=(r(e)?n(e):window).visualViewport,d=!p()&&i,f=(a.left+(d&&u?u.offsetLeft:0))/s,h=(a.top+(d&&u?u.offsetTop:0))/c,m=a.width/s,b=a.height/c;return{width:m,height:b,top:h,right:f+m,bottom:h+b,left:f,x:f,y:h}}function f(e){var t=n(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function h(e){return e?(e.nodeName||"").toLowerCase():null}function m(e){return((r(e)?e.ownerDocument:e.document)||window.document).documentElement}function b(e){return d(m(e)).left+f(e).scrollLeft}function v(e){return n(e).getComputedStyle(e)}function g(e){var t=v(e),i=t.overflow,n=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+r+n)}function y(e,t,i){void 0===i&&(i=!1);var r,a,s=o(t),c=o(t)&&function(e){var t=e.getBoundingClientRect(),i=l(t.width)/e.offsetWidth||1,n=l(t.height)/e.offsetHeight||1;return 1!==i||1!==n}(t),u=m(t),p=d(e,c,i),v={scrollLeft:0,scrollTop:0},y={x:0,y:0};return(s||!s&&!i)&&(("body"!==h(t)||g(u))&&(v=(r=t)!==n(r)&&o(r)?{scrollLeft:(a=r).scrollLeft,scrollTop:a.scrollTop}:f(r)),o(t)?((y=d(t,!0)).x+=t.clientLeft,y.y+=t.clientTop):u&&(y.x=b(u))),{x:p.left+v.scrollLeft-y.x,y:p.top+v.scrollTop-y.y,width:p.width,height:p.height}}function x(e){var t=d(e),i=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-i)<=1&&(i=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:i,height:n}}function _(e){return"html"===h(e)?e:e.assignedSlot||e.parentNode||(a(e)?e.host:null)||m(e)}function w(e){return["html","body","#document"].indexOf(h(e))>=0?e.ownerDocument.body:o(e)&&g(e)?e:w(_(e))}function k(e,t){var i;void 0===t&&(t=[]);var r=w(e),o=r===(null==(i=e.ownerDocument)?void 0:i.body),a=n(r),s=o?[a].concat(a.visualViewport||[],g(r)?r:[]):r,c=t.concat(s);return o?c:c.concat(k(_(s)))}function S(e){return["table","td","th"].indexOf(h(e))>=0}function E(e){return o(e)&&"fixed"!==v(e).position?e.offsetParent:null}function M(e){for(var t=n(e),i=E(e);i&&S(i)&&"static"===v(i).position;)i=E(i);return i&&("html"===h(i)||"body"===h(i)&&"static"===v(i).position)?t:i||function(e){var t=/firefox/i.test(u());if(/Trident/i.test(u())&&o(e)&&"fixed"===v(e).position)return null;var i=_(e);for(a(i)&&(i=i.host);o(i)&&["html","body"].indexOf(h(i))<0;){var n=v(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||t&&"filter"===n.willChange||t&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(e)||t}var A="top",j="bottom",I="right",T="left",C="auto",B=[A,j,I,T],R="start",O="end",P="clippingParents",L="viewport",U="popper",q="reference",N=B.reduce((function(e,t){return e.concat([t+"-"+R,t+"-"+O])}),[]),D=[].concat(B,[C]).reduce((function(e,t){return e.concat([t,t+"-"+R,t+"-"+O])}),[]),z=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function H(e){var t=new Map,i=new Set,n=[];function r(e){i.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!i.has(e)){var n=t.get(e);n&&r(n)}})),n.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){i.has(e.name)||r(e)})),n}function F(e,t){var i=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(i&&a(i)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function W(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function V(e,t,i){return t===L?W(function(e,t){var i=n(e),r=m(e),o=i.visualViewport,a=r.clientWidth,s=r.clientHeight,c=0,l=0;if(o){a=o.width,s=o.height;var u=p();(u||!u&&"fixed"===t)&&(c=o.offsetLeft,l=oLine truncated
!function e(t,n,i){function r(a,s){if(!n[a]){if(!t[a]){var c="function"==typeof require&&require;if(!s&&c)return c(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var u=n[a]={exports:{}};t[a][0].call(u.exports,(function(e){return r(t[a][1][e]||e)}),u,u.exports,e,t,n,i)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<i.length;a++)r(i[a]);return r}({1:[function(e,t,n){"use strict";function i(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function r(e){return e instanceof i(e).Element||e instanceof Element}function o(e){return e instanceof i(e).HTMLElement||e instanceof HTMLElement}function a(e){return"undefined"!=typeof ShadowRoot&&(e instanceof i(e).ShadowRoot||e instanceof ShadowRoot)}Object.defineProperty(n,"__esModule",{value:!0});var s=Math.max,c=Math.min,l=Math.round;function u(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function p(){return!/^((?!chrome|android).)*safari/i.test(u())}function d(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var a=e.getBoundingClientRect(),s=1,c=1;t&&o(e)&&(s=e.offsetWidth>0&&l(a.width)/e.offsetWidth||1,c=e.offsetHeight>0&&l(a.height)/e.offsetHeight||1);var u=(r(e)?i(e):window).visualViewport,d=!p()&&n,f=(a.left+(d&&u?u.offsetLeft:0))/s,h=(a.top+(d&&u?u.offsetTop:0))/c,m=a.width/s,b=a.height/c;return{width:m,height:b,top:h,right:f+m,bottom:h+b,left:f,x:f,y:h}}function f(e){var t=i(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function h(e){return e?(e.nodeName||"").toLowerCase():null}function m(e){return((r(e)?e.ownerDocument:e.document)||window.document).documentElement}function b(e){return d(m(e)).left+f(e).scrollLeft}function v(e){return i(e).getComputedStyle(e)}function g(e){var t=v(e),n=t.overflow,i=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+i)}function y(e,t,n){void 0===n&&(n=!1);var r,a,s=o(t),c=o(t)&&function(e){var t=e.getBoundingClientRect(),n=l(t.width)/e.offsetWidth||1,i=l(t.height)/e.offsetHeight||1;return 1!==n||1!==i}(t),u=m(t),p=d(e,c,n),v={scrollLeft:0,scrollTop:0},y={x:0,y:0};return(s||!s&&!n)&&(("body"!==h(t)||g(u))&&(v=(r=t)!==i(r)&&o(r)?{scrollLeft:(a=r).scrollLeft,scrollTop:a.scrollTop}:f(r)),o(t)?((y=d(t,!0)).x+=t.clientLeft,y.y+=t.clientTop):u&&(y.x=b(u))),{x:p.left+v.scrollLeft-y.x,y:p.top+v.scrollTop-y.y,width:p.width,height:p.height}}function x(e){var t=d(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}function _(e){return"html"===h(e)?e:e.assignedSlot||e.parentNode||(a(e)?e.host:null)||m(e)}function w(e){return["html","body","#document"].indexOf(h(e))>=0?e.ownerDocument.body:o(e)&&g(e)?e:w(_(e))}function k(e,t){var n;void 0===t&&(t=[]);var r=w(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),a=i(r),s=o?[a].concat(a.visualViewport||[],g(r)?r:[]):r,c=t.concat(s);return o?c:c.concat(k(_(s)))}function S(e){return["table","td","th"].indexOf(h(e))>=0}function E(e){return o(e)&&"fixed"!==v(e).position?e.offsetParent:null}function M(e){for(var t=i(e),n=E(e);n&&S(n)&&"static"===v(n).position;)n=E(n);return n&&("html"===h(n)||"body"===h(n)&&"static"===v(n).position)?t:n||function(e){var t=/firefox/i.test(u());if(/Trident/i.test(u())&&o(e)&&"fixed"===v(e).position)return null;var n=_(e);for(a(n)&&(n=n.host);o(n)&&["html","body"].indexOf(h(n))<0;){var i=v(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(e)||t}var A="top",j="bottom",I="right",T="left",C="auto",B=[A,j,I,T],R="start",O="end",P="clippingParents",L="viewport",U="popper",q="reference",N=B.reduce((function(e,t){return e.concat([t+"-"+R,t+"-"+O])}),[]),D=[].concat(B,[C]).reduce((function(e,t){return e.concat([t,t+"-"+R,t+"-"+O])}),[]),z=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function H(e){var t=new Map,n=new Set,i=[];function r(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var i=t.get(e);i&&r(i)}})),i.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||r(e)})),i}function F(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&a(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function W(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function V(e,t,n){return t===L?W(function(e,t){var n=i(e),r=m(e),o=n.visualViewport,a=r.clientWidth,s=r.clientHeight,c=0,l=0;if(o){a=o.width,s=o.height;var u=p();(u||!u&&"fixed"===t)&&(c=o.offsetLeft,l=oLine truncated
/*! bittorrent-protocol. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */
const n=e("unordered-array-remove"),r=e("bencode"),o=e("bitfield").default,a=e("crypto"),s=e("debug")("bittorrent-protocol"),c=e("randombytes"),l=e("simple-sha1"),u=e("speedometer"),p=e("readable-stream"),d=e("rc4"),f=i.from("BitTorrent protocol"),h=i.from([0,0,0,0]),m=i.from([0,0,0,1,0]),b=i.from([0,0,0,1,1]),v=i.from([0,0,0,1,2]),g=i.from([0,0,0,1,3]),y=[0,0,0,0,0,0,0,0],x=[0,0,0,3,9,0,0],_=i.from([0,0,0,1,14]),w=i.from([0,0,0,1,15]),k=i.from([0,0,0,0,0,0,0,0]),S=i.from([0,0,1,2]),E=i.from([0,0,0,2]);function M(e,t){for(let i=e.length;i--;)e[i]^=t[i];return e}class A{constructor(e,t,i,n){this.piece=e,this.offset=t,this.length=i,this.callback=n}}class j{constructor(){this.buffer=new Uint8Array}get(e){return!0}set(e){}}class I extends p.Duplex{constructor(e=null,t=0,i=!1){super(),this._debugId=c(4).toString("hex"),this._debug("new wire"),this.peerId=null,this.peerIdBuffer=null,this.type=e,this.amChoking=!0,this.amInterested=!1,this.peerChoking=!0,this.peerInterested=!1,this.peerPieces=new o(0,{grow:4e5}),this.extensions={},this.peerExtensions={},this.requests=[],this.peerRequests=[],this.extendedMapping={},this.peerExtendedMapping={},this.extendedHandshake={},this.peerExtendedHandshake={},this.hasFast=!1,this.allowedFastSet=[],this.peerAllowedFastSet=[],this._ext={},this._nextExt=1,this.uploaded=0,this.downloaded=0,this.uploadSpeed=u(),this.downloadSpeed=u(),this._keepAliveInterval=null,this._timeout=null,this._timeoutMs=0,this._timeoutExpiresAt=null,this.destroyed=!1,this._finished=!1,this._parserSize=0,this._parser=null,this._buffer=[],this._bufferSize=0,this._peEnabled=i,i?(this._dh=a.createDiffieHellman("ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a36210000000000090563","hex",2),this._myPubKey=this._dh.generateKeys("hex")):this._myPubKey=null,this._peerPubKey=null,this._sharedSecret=null,this._peerCryptoProvide=[],this._cryptoHandshakeDone=!1,this._cryptoSyncPattern=null,this._waitMaxBytes=null,this._encryptionMethod=null,this._encryptGenerator=null,this._decryptGenerator=null,this._setGenerators=!1,this.once("finish",(()=>this._onFinish())),this.on("finish",this._onFinish),this._debug("type:",this.type),"tcpIncoming"===this.type&&this._peEnabled?this._determineHandshakeType():"tcpOutgoing"===this.type&&this._peEnabled&&0===t?this._parsePe2():this._parseHandshake(null)}setKeepAlive(e){this._debug("setKeepAlive %s",e),clearInterval(this._keepAliveInterval),!1!==e&&(this._keepAliveInterval=setInterval((()=>{this.keepAlive()}),55e3))}setTimeout(e,t){this._debug("setTimeout ms=%d unref=%s",e,t),this._timeoutMs=e,this._timeoutUnref=!!t,this._resetTimeout(!0)}destroy(){if(!this.destroyed)return this.destroyed=!0,this._debug("destroy"),this.emit("close"),this.end(),this}end(...e){return this._debug("end"),this._onUninterested(),this._onChoke(),super.end(...e)}use(e){const t=e.prototype.name;if(!t)throw new Error('Extension class requires a "name" property on the prototype');this._debug("use extension.name=%s",t);const i=this._nextExt,n=new e(this);function r(){}"function"!=typeof n.onHandshake&&(n.onHandshake=r),"function"!=typeof n.onExtendedHandshake&&(n.onExtendedHandshake=r),"function"!=typeof n.onMessage&&(n.onMessage=r),this.extendedMapping[i]=t,this._ext[t]=n,this[t]=n,this._nextExt+=1}keepAlive(){this._debug("keep-alive"),this._push(h)}sendPe1(){if(this._peEnabled){const e=Math.floor(513*Math.random()),t=c(e);this._push(i.concat([i.from(this._myPubKey,"hex"),t]))}}sendPe2(){const e=Math.floor(513*Math.random()),t=c(e);this._push(i.concat([i.from(this._myPubKey,"hex"),t]))}sendPe3(e){this.setEncrypt(this._sharedSecret,e);const t=i.from(l.sync(i.from(this._utfToHex("req1")+this._sharedSecret,"hex")),"hex"),n=M(i.from(l.sync(i.from(this._utfToHex("req2")+e,"hex")),"hex"),i.from(l.sync(i.from(this._utfToHex("req3")+this._sharedSecret,"hex")),"hex")),r=c(2).readUInt16BE(0)%512,o=c(r);let a=i.alloc(14+r+2);k.copy(a),S.copy(a,8),a.writeInt16BE(r,12),o.copy(a,14),a.writeInt16BE(0,14+r),a=this._encryptHandshake(a),this._push(i.concat([t,n,a]))}sendPe4(e){this.setEncrypt(this._sharedSecret,e);const t=c(2).readUInt16BE(0)%512,n=c(t);let r=i.alloc(14+t);k.copy(r),E.copy(r,8),r.writeInt16BE(t,12),n.copy(r,14),r=this._encryptHandshake(r),this._push(r),this._cryptoHandshakeDone=!0,this._debug("completed crypto handshake")}handshake(e,t,n){let r,o;if("string"==typeof e?(e=e.toLowerCase(),r=i.from(e,"hex")):(r=e,e=r.toString("hex")),"string"==typeof t?o=i.from(t,"hex"):(o=t,t=o.toString("hex")),this._infoHash=r,20!==r.length||20!==o.length)throw new Error("infoHash and peerId MUST have length 20");this._debug("handshake i=%s p=%s exts=%o",e,t,n);const a=i.from(y);this.extensions={extended:!0,dht:!(!n||!n.dht),fast:!(!n||!n.fast)},a[5]|=16,this.extensions.dht&&(a[7]|=1),this.extensions.fast&&(a[7]|=4),this.extensions.fast&&this.peerExtensions.fast&&(this._debug("fast extension is enabled"),thiLine truncated
const i=e("unordered-array-remove"),r=e("bencode"),o=e("bitfield").default,a=e("crypto"),s=e("debug")("bittorrent-protocol"),c=e("randombytes"),l=e("simple-sha1"),u=e("speedometer"),p=e("readable-stream"),d=e("rc4"),f=n.from("BitTorrent protocol"),h=n.from([0,0,0,0]),m=n.from([0,0,0,1,0]),b=n.from([0,0,0,1,1]),v=n.from([0,0,0,1,2]),g=n.from([0,0,0,1,3]),y=[0,0,0,0,0,0,0,0],x=[0,0,0,3,9,0,0],_=n.from([0,0,0,1,14]),w=n.from([0,0,0,1,15]),k=n.from([0,0,0,0,0,0,0,0]),S=n.from([0,0,1,2]),E=n.from([0,0,0,2]);function M(e,t){for(let n=e.length;n--;)e[n]^=t[n];return e}class A{constructor(e,t,n,i){this.piece=e,this.offset=t,this.length=n,this.callback=i}}class j{constructor(){this.buffer=new Uint8Array}get(e){return!0}set(e){}}class I extends p.Duplex{constructor(e=null,t=0,n=!1){super(),this._debugId=c(4).toString("hex"),this._debug("new wire"),this.peerId=null,this.peerIdBuffer=null,this.type=e,this.amChoking=!0,this.amInterested=!1,this.peerChoking=!0,this.peerInterested=!1,this.peerPieces=new o(0,{grow:4e5}),this.extensions={},this.peerExtensions={},this.requests=[],this.peerRequests=[],this.extendedMapping={},this.peerExtendedMapping={},this.extendedHandshake={},this.peerExtendedHandshake={},this.hasFast=!1,this.allowedFastSet=[],this.peerAllowedFastSet=[],this._ext={},this._nextExt=1,this.uploaded=0,this.downloaded=0,this.uploadSpeed=u(),this.downloadSpeed=u(),this._keepAliveInterval=null,this._timeout=null,this._timeoutMs=0,this._timeoutExpiresAt=null,this.destroyed=!1,this._finished=!1,this._parserSize=0,this._parser=null,this._buffer=[],this._bufferSize=0,this._peEnabled=n,n?(this._dh=a.createDiffieHellman("ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a36210000000000090563","hex",2),this._myPubKey=this._dh.generateKeys("hex")):this._myPubKey=null,this._peerPubKey=null,this._sharedSecret=null,this._peerCryptoProvide=[],this._cryptoHandshakeDone=!1,this._cryptoSyncPattern=null,this._waitMaxBytes=null,this._encryptionMethod=null,this._encryptGenerator=null,this._decryptGenerator=null,this._setGenerators=!1,this.once("finish",(()=>this._onFinish())),this.on("finish",this._onFinish),this._debug("type:",this.type),"tcpIncoming"===this.type&&this._peEnabled?this._determineHandshakeType():"tcpOutgoing"===this.type&&this._peEnabled&&0===t?this._parsePe2():this._parseHandshake(null)}setKeepAlive(e){this._debug("setKeepAlive %s",e),clearInterval(this._keepAliveInterval),!1!==e&&(this._keepAliveInterval=setInterval((()=>{this.keepAlive()}),55e3))}setTimeout(e,t){this._debug("setTimeout ms=%d unref=%s",e,t),this._timeoutMs=e,this._timeoutUnref=!!t,this._resetTimeout(!0)}destroy(){if(!this.destroyed)return this.destroyed=!0,this._debug("destroy"),this.emit("close"),this.end(),this}end(...e){return this._debug("end"),this._onUninterested(),this._onChoke(),super.end(...e)}use(e){const t=e.prototype.name;if(!t)throw new Error('Extension class requires a "name" property on the prototype');this._debug("use extension.name=%s",t);const n=this._nextExt,i=new e(this);function r(){}"function"!=typeof i.onHandshake&&(i.onHandshake=r),"function"!=typeof i.onExtendedHandshake&&(i.onExtendedHandshake=r),"function"!=typeof i.onMessage&&(i.onMessage=r),this.extendedMapping[n]=t,this._ext[t]=i,this[t]=i,this._nextExt+=1}keepAlive(){this._debug("keep-alive"),this._push(h)}sendPe1(){if(this._peEnabled){const e=Math.floor(513*Math.random()),t=c(e);this._push(n.concat([n.from(this._myPubKey,"hex"),t]))}}sendPe2(){const e=Math.floor(513*Math.random()),t=c(e);this._push(n.concat([n.from(this._myPubKey,"hex"),t]))}sendPe3(e){this.setEncrypt(this._sharedSecret,e);const t=n.from(l.sync(n.from(this._utfToHex("req1")+this._sharedSecret,"hex")),"hex"),i=M(n.from(l.sync(n.from(this._utfToHex("req2")+e,"hex")),"hex"),n.from(l.sync(n.from(this._utfToHex("req3")+this._sharedSecret,"hex")),"hex")),r=c(2).readUInt16BE(0)%512,o=c(r);let a=n.alloc(14+r+2);k.copy(a),S.copy(a,8),a.writeInt16BE(r,12),o.copy(a,14),a.writeInt16BE(0,14+r),a=this._encryptHandshake(a),this._push(n.concat([t,i,a]))}sendPe4(e){this.setEncrypt(this._sharedSecret,e);const t=c(2).readUInt16BE(0)%512,i=c(t);let r=n.alloc(14+t);k.copy(r),E.copy(r,8),r.writeInt16BE(t,12),i.copy(r,14),r=this._encryptHandshake(r),this._push(r),this._cryptoHandshakeDone=!0,this._debug("completed crypto handshake")}handshake(e,t,i){let r,o;if("string"==typeof e?(e=e.toLowerCase(),r=n.from(e,"hex")):(r=e,e=r.toString("hex")),"string"==typeof t?o=n.from(t,"hex"):(o=t,t=o.toString("hex")),this._infoHash=r,20!==r.length||20!==o.length)throw new Error("infoHash and peerId MUST have length 20");this._debug("handshake i=%s p=%s exts=%o",e,t,i);const a=n.from(y);this.extensions={extended:!0,dht:!(!i||!i.dht),fast:!(!i||!i.fast)},a[5]|=16,this.extensions.dht&&(a[7]|=1),this.extensions.fast&&(a[7]|=4),this.extensions.fast&&this.peerExtensions.fast&&(this._debug("fast extension is enabled"),thiLine truncated
/*! blob-to-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
t.exports=function(t,i){if("undefined"==typeof Blob||!(t instanceof Blob))throw new Error("first argument must be a Blob");if("function"!=typeof i)throw new Error("second argument must be a function");const n=new FileReader;n.addEventListener("loadend",(function t(r){n.removeEventListener("loadend",t,!1),r.error?i(r.error):i(null,e.from(n.result))}),!1),n.readAsArrayBuffer(t)}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:110}],48:[function(e,t,i){function n(e,t){if("string"==typeof e[0])return e.join("");if("number"==typeof e[0])return new Uint8Array(e);const i=new Uint8Array(t);let n=0;for(let t=0,r=e.length;t<r;t++){const r=e[t];i.set(r,n),n+=r.byteLength||r.length}return i}t.exports=async function*(e,t=512,i={}){"object"==typeof t&&(t=(i=t).size);let{nopad:r,zeroPadding:o=!0}=i;r&&(o=!1);let a=[],s=0;for await(const i of e)if(s+=i.byteLength||i.length||1,a.push(i),s>=t){const e=n(a,s);let i=0;for(;s>=t;)yield e.slice(i,i+t),s-=t,i+=t;a=[e.slice(i,e.length)]}s&&(yield n(a,o?t:s))}},{}],49:[function(e,t,i){(function(i){(function(){const{Transform:n}=e("readable-stream");t.exports=class extends n{constructor(e,t={}){super(t),"object"==typeof e&&(e=(t=e).size),this.size=e||512;const{nopad:i,zeroPadding:n=!0}=t;this._zeroPadding=!i&&!!n,this._buffered=[],this._bufferedBytes=0}_transform(e,t,n){for(this._bufferedBytes+=e.length,this._buffered.push(e);this._bufferedBytes>=this.size;){this._bufferedBytes-=this.size;const e=[];let t=0;for(;t<this.size;){const i=this._buffered.shift();if(t+i.length<=this.size)e.push(i),t+=i.length;else{const n=this.size-t;e.push(i.slice(0,n)),t+=n,this._buffered.unshift(i.slice(n))}}this.push(i.concat(e,this.size))}n()}_flush(){if(this._bufferedBytes&&this._zeroPadding){const e=i.alloc(this.size-this._bufferedBytes);this._buffered.push(e),this.push(i.concat(this._buffered)),this._buffered=null}else this._bufferedBytes&&(this.push(i.concat(this._buffered)),this._buffered=null);this.push(null)}}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:110,"readable-stream":64}],50:[function(e,t,i){arguments[4][28][0].apply(i,arguments)},{dup:28}],51:[function(e,t,i){arguments[4][29][0].apply(i,arguments)},{"./_stream_readable":53,"./_stream_writable":55,_process:306,dup:29,inherits:226}],52:[function(e,t,i){arguments[4][30][0].apply(i,arguments)},{"./_stream_transform":54,dup:30,inherits:226}],53:[function(e,t,i){arguments[4][31][0].apply(i,arguments)},{"../errors":50,"./_stream_duplex":51,"./internal/streams/async_iterator":56,"./internal/streams/buffer_list":57,"./internal/streams/destroy":58,"./internal/streams/from":60,"./internal/streams/state":62,"./internal/streams/stream":63,_process:306,buffer:110,dup:31,events:180,inherits:226,"string_decoder/":443,util:67}],54:[function(e,t,i){arguments[4][32][0].apply(i,arguments)},{"../errors":50,"./_stream_duplex":51,dup:32,inherits:226}],55:[function(e,t,i){arguments[4][33][0].apply(i,arguments)},{"../errors":50,"./_stream_duplex":51,"./internal/streams/destroy":58,"./internal/streams/state":62,"./internal/streams/stream":63,_process:306,buffer:110,dup:33,inherits:226,"util-deprecate":455}],56:[function(e,t,i){arguments[4][34][0].apply(i,arguments)},{"./end-of-stream":59,_process:306,dup:34}],57:[function(e,t,i){arguments[4][35][0].apply(i,arguments)},{buffer:110,dup:35,util:67}],58:[function(e,t,i){arguments[4][36][0].apply(i,arguments)},{_process:306,dup:36}],59:[function(e,t,i){arguments[4][37][0].apply(i,arguments)},{"../../../errors":50,dup:37}],60:[function(e,t,i){arguments[4][38][0].apply(i,arguments)},{dup:38}],61:[function(e,t,i){arguments[4][39][0].apply(i,arguments)},{"../../../errors":50,"./end-of-stream":59,dup:39}],62:[function(e,t,i){arguments[4][40][0].apply(i,arguments)},{"../../../errors":50,dup:40}],63:[function(e,t,i){arguments[4][41][0].apply(i,arguments)},{dup:41,events:180}],64:[function(e,t,i){arguments[4][42][0].apply(i,arguments)},{"./lib/_stream_duplex.js":51,"./lib/_stream_passthrough.js":52,"./lib/_stream_readable.js":53,"./lib/_stream_transform.js":54,"./lib/_stream_writable.js":55,"./lib/internal/streams/end-of-stream.js":59,"./lib/internal/streams/pipeline.js":61,dup:42}],65:[function(e,t,i){!function(t,i){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}function o(e,t,i){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(i=t,t=10),this._init(e||0,t||10,i||"be"))}var a;"object"==typeof t?t.exports=o:i.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:e("buffer").Buffer}catch(e){}function s(e,t){var i=e.charCodeAt(t);return i>=48&&i<=57?i-48:i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:void n(!1,"Invalid character in "+e)}function c(e,t,i){var n=s(e,i);return i-1>=t&&(n|=s(e,i-1)<<4),n}function l(e,t,i,r){for(var o=0,a=0,s=Math.min(e.length,i),c=t;c<s;c++){var Line truncated
t.exports=function(t,n){if("undefined"==typeof Blob||!(t instanceof Blob))throw new Error("first argument must be a Blob");if("function"!=typeof n)throw new Error("second argument must be a function");const i=new FileReader;i.addEventListener("loadend",(function t(r){i.removeEventListener("loadend",t,!1),r.error?n(r.error):n(null,e.from(i.result))}),!1),i.readAsArrayBuffer(t)}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:110}],48:[function(e,t,n){function i(e,t){if("string"==typeof e[0])return e.join("");if("number"==typeof e[0])return new Uint8Array(e);const n=new Uint8Array(t);let i=0;for(let t=0,r=e.length;t<r;t++){const r=e[t];n.set(r,i),i+=r.byteLength||r.length}return n}t.exports=async function*(e,t=512,n={}){"object"==typeof t&&(t=(n=t).size);let{nopad:r,zeroPadding:o=!0}=n;r&&(o=!1);let a=[],s=0;for await(const n of e)if(s+=n.byteLength||n.length||1,a.push(n),s>=t){const e=i(a,s);let n=0;for(;s>=t;)yield e.slice(n,n+t),s-=t,n+=t;a=[e.slice(n,e.length)]}s&&(yield i(a,o?t:s))}},{}],49:[function(e,t,n){(function(n){(function(){const{Transform:i}=e("readable-stream");t.exports=class extends i{constructor(e,t={}){super(t),"object"==typeof e&&(e=(t=e).size),this.size=e||512;const{nopad:n,zeroPadding:i=!0}=t;this._zeroPadding=!n&&!!i,this._buffered=[],this._bufferedBytes=0}_transform(e,t,i){for(this._bufferedBytes+=e.length,this._buffered.push(e);this._bufferedBytes>=this.size;){this._bufferedBytes-=this.size;const e=[];let t=0;for(;t<this.size;){const n=this._buffered.shift();if(t+n.length<=this.size)e.push(n),t+=n.length;else{const i=this.size-t;e.push(n.slice(0,i)),t+=i,this._buffered.unshift(n.slice(i))}}this.push(n.concat(e,this.size))}i()}_flush(){if(this._bufferedBytes&&this._zeroPadding){const e=n.alloc(this.size-this._bufferedBytes);this._buffered.push(e),this.push(n.concat(this._buffered)),this._buffered=null}else this._bufferedBytes&&(this.push(n.concat(this._buffered)),this._buffered=null);this.push(null)}}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:110,"readable-stream":64}],50:[function(e,t,n){arguments[4][28][0].apply(n,arguments)},{dup:28}],51:[function(e,t,n){arguments[4][29][0].apply(n,arguments)},{"./_stream_readable":53,"./_stream_writable":55,_process:309,dup:29,inherits:229}],52:[function(e,t,n){arguments[4][30][0].apply(n,arguments)},{"./_stream_transform":54,dup:30,inherits:229}],53:[function(e,t,n){arguments[4][31][0].apply(n,arguments)},{"../errors":50,"./_stream_duplex":51,"./internal/streams/async_iterator":56,"./internal/streams/buffer_list":57,"./internal/streams/destroy":58,"./internal/streams/from":60,"./internal/streams/state":62,"./internal/streams/stream":63,_process:309,buffer:110,dup:31,events:181,inherits:229,"string_decoder/":447,util:67}],54:[function(e,t,n){arguments[4][32][0].apply(n,arguments)},{"../errors":50,"./_stream_duplex":51,dup:32,inherits:229}],55:[function(e,t,n){arguments[4][33][0].apply(n,arguments)},{"../errors":50,"./_stream_duplex":51,"./internal/streams/destroy":58,"./internal/streams/state":62,"./internal/streams/stream":63,_process:309,buffer:110,dup:33,inherits:229,"util-deprecate":459}],56:[function(e,t,n){arguments[4][34][0].apply(n,arguments)},{"./end-of-stream":59,_process:309,dup:34}],57:[function(e,t,n){arguments[4][35][0].apply(n,arguments)},{buffer:110,dup:35,util:67}],58:[function(e,t,n){arguments[4][36][0].apply(n,arguments)},{_process:309,dup:36}],59:[function(e,t,n){arguments[4][37][0].apply(n,arguments)},{"../../../errors":50,dup:37}],60:[function(e,t,n){arguments[4][38][0].apply(n,arguments)},{dup:38}],61:[function(e,t,n){arguments[4][39][0].apply(n,arguments)},{"../../../errors":50,"./end-of-stream":59,dup:39}],62:[function(e,t,n){arguments[4][40][0].apply(n,arguments)},{"../../../errors":50,dup:40}],63:[function(e,t,n){arguments[4][41][0].apply(n,arguments)},{dup:41,events:181}],64:[function(e,t,n){arguments[4][42][0].apply(n,arguments)},{"./lib/_stream_duplex.js":51,"./lib/_stream_passthrough.js":52,"./lib/_stream_readable.js":53,"./lib/_stream_transform.js":54,"./lib/_stream_writable.js":55,"./lib/internal/streams/end-of-stream.js":59,"./lib/internal/streams/pipeline.js":61,dup:42}],65:[function(e,t,n){!function(t,n){"use strict";function i(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function o(e,t,n){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var a;"object"==typeof t?t.exports=o:n.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:e("buffer").Buffer}catch(e){}function s(e,t){var n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void i(!1,"Invalid character in "+e)}function c(e,t,n){var i=s(e,n);return n-1>=t&&(i|=s(e,n-1)<<4),i}function l(e,t,n,r){for(var o=0,a=0,s=Math.min(e.length,n),c=t;c<s;c++){var Line truncated
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
"use strict";var t=e("base64-js"),n=e("ieee754");i.Buffer=a,i.SlowBuffer=function(e){+e!=e&&(e=0);return a.alloc(+e)},i.INSPECT_MAX_BYTES=50;var r=2147483647;function o(e){if(e>r)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=a.prototype,t}function a(e,t,i){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return s(e,t,i)}function s(e,t,i){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!a.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var i=0|d(e,t),n=o(i),r=n.write(e,t);r!==i&&(n=n.slice(0,r));return n}(e,t);if(ArrayBuffer.isView(e))return u(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(D(e,ArrayBuffer)||e&&D(e.buffer,ArrayBuffer))return function(e,t,i){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(i||0))throw new RangeError('"length" is outside of buffer bounds');var n;n=void 0===t&&void 0===i?new Uint8Array(e):void 0===i?new Uint8Array(e,t):new Uint8Array(e,t,i);return n.__proto__=a.prototype,n}(e,t,i);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return a.from(n,t,i);var r=function(e){if(a.isBuffer(e)){var t=0|p(e.length),i=o(t);return 0===i.length||e.copy(i,0,0,t),i}if(void 0!==e.length)return"number"!=typeof e.length||z(e.length)?o(0):u(e);if("Buffer"===e.type&&Array.isArray(e.data))return u(e.data)}(e);if(r)return r;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return a.from(e[Symbol.toPrimitive]("string"),t,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return c(e),o(e<0?0:0|p(e))}function u(e){for(var t=e.length<0?0:0|p(e.length),i=o(t),n=0;n<t;n+=1)i[n]=255&e[n];return i}function p(e){if(e>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|e}function d(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||D(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var i=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===i)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return q(e).length;default:if(r)return n?-1:U(e).length;t=(""+t).toLowerCase(),r=!0}}function f(e,t,i){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return j(this,t,i);case"utf8":case"utf-8":return S(this,t,i);case"ascii":return M(this,t,i);case"latin1":case"binary":return A(this,t,i);case"base64":return k(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,i);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function h(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function m(e,t,i,n,r){if(0===e.length)return-1;if("string"==typeof i?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),z(i=+i)&&(i=r?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(r)return-1;i=e.length-1}else if(i<0){if(!r)return-1;i=0}if("string"==typeof t&&(t=a.from(t,n)),a.isBuffer(t))return 0===t.length?-1:b(e,t,i,n,r);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):b(e,[t],i,n,r);throw new TypeError("val must be string, number or Buffer")}function b(e,t,i,n,r){var o,a=1,s=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,i/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(r){var u=-1;for(o=i;o<s;o++)if(l(e,o)===l(t,-1===u?0:o-u)){if(-1===u&&(u=o),o-u+1===c)return u*a}else-1!==u&&(o-=o-u),u=-1}else for(i+c>s&&(i=s-c),o=i;o>=0;o--){for(var p=!0,d=0;d<c;d++)if(l(e,o+d)!==l(t,d)){p=!1;break}if(p)return o}return-1}function v(e,t,i,n){i=Number(i)||0;var r=e.length-i;n?(n=Number(n))>r&&(n=r):n=r;var o=t.length;n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(t.substr(2*a,2),16);if(z(s))return a;e[i+a]=s}return a}funcLine truncated
"use strict";var t=e("base64-js"),i=e("ieee754");n.Buffer=a,n.SlowBuffer=function(e){+e!=e&&(e=0);return a.alloc(+e)},n.INSPECT_MAX_BYTES=50;var r=2147483647;function o(e){if(e>r)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=a.prototype,t}function a(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return s(e,t,n)}function s(e,t,n){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!a.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|d(e,t),i=o(n),r=i.write(e,t);r!==n&&(i=i.slice(0,r));return i}(e,t);if(ArrayBuffer.isView(e))return u(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(D(e,ArrayBuffer)||e&&D(e.buffer,ArrayBuffer))return function(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');var i;i=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n);return i.__proto__=a.prototype,i}(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var i=e.valueOf&&e.valueOf();if(null!=i&&i!==e)return a.from(i,t,n);var r=function(e){if(a.isBuffer(e)){var t=0|p(e.length),n=o(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!=typeof e.length||z(e.length)?o(0):u(e);if("Buffer"===e.type&&Array.isArray(e.data))return u(e.data)}(e);if(r)return r;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return a.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return c(e),o(e<0?0:0|p(e))}function u(e){for(var t=e.length<0?0:0|p(e.length),n=o(t),i=0;i<t;i+=1)n[i]=255&e[i];return n}function p(e){if(e>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|e}function d(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||D(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return q(e).length;default:if(r)return i?-1:U(e).length;t=(""+t).toLowerCase(),r=!0}}function f(e,t,n){var i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return j(this,t,n);case"utf8":case"utf-8":return S(this,t,n);case"ascii":return M(this,t,n);case"latin1":case"binary":return A(this,t,n);case"base64":return k(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,n);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function h(e,t,n){var i=e[t];e[t]=e[n],e[n]=i}function m(e,t,n,i,r){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),z(n=+n)&&(n=r?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(r)return-1;n=e.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof t&&(t=a.from(t,i)),a.isBuffer(t))return 0===t.length?-1:b(e,t,n,i,r);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,i,r);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,i,r){var o,a=1,s=e.length,c=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,n/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(r){var u=-1;for(o=n;o<s;o++)if(l(e,o)===l(t,-1===u?0:o-u)){if(-1===u&&(u=o),o-u+1===c)return u*a}else-1!==u&&(o-=o-u),u=-1}else for(n+c>s&&(n=s-c),o=n;o>=0;o--){for(var p=!0,d=0;d<c;d++)if(l(e,o+d)!==l(t,d)){p=!1;break}if(p)return o}return-1}function v(e,t,n,i){n=Number(n)||0;var r=e.length-n;i?(i=Number(i))>r&&(i=r):i=r;var o=t.length;i>o/2&&(i=o/2);for(var a=0;a<i;++a){var s=parseInt(t.substr(2*a,2),16);if(z(s))return a;e[n+a]=s}return a}funcLine truncated
/*!
* bytes
* Copyright(c) 2012-2014 TJ Holowaychuk
* Copyright(c) 2015 Jed Watson
* MIT Licensed
*/
"use strict";t.exports=function(e,t){if("string"==typeof e)return c(e);if("number"==typeof e)return s(e,t);return null},t.exports.format=s,t.exports.parse=c;var n=/\B(?=(\d{3})+(?!\d))/g,r=/(?:\.0*|(\.[^0]+)0+)$/,o={b:1,kb:1024,mb:1<<20,gb:1<<30,tb:Math.pow(1024,4),pb:Math.pow(1024,5)},a=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;function s(e,t){if(!Number.isFinite(e))return null;var i=Math.abs(e),a=t&&t.thousandsSeparator||"",s=t&&t.unitSeparator||"",c=t&&void 0!==t.decimalPlaces?t.decimalPlaces:2,l=Boolean(t&&t.fixedDecimals),u=t&&t.unit||"";u&&o[u.toLowerCase()]||(u=i>=o.pb?"PB":i>=o.tb?"TB":i>=o.gb?"GB":i>=o.mb?"MB":i>=o.kb?"KB":"B");var p=(e/o[u.toLowerCase()]).toFixed(c);return l||(p=p.replace(r,"$1")),a&&(p=p.split(".").map((function(e,t){return 0===t?e.replace(n,a):e})).join(".")),p+s+u}function c(e){if("number"==typeof e&&!isNaN(e))return e;if("string"!=typeof e)return null;var t,i=a.exec(e),n="b";return i?(t=parseFloat(i[1]),n=i[4].toLowerCase()):(t=parseInt(e,10),n="b"),isNaN(t)?null:Math.floor(o[n]*t)}},{}],117:[function(e,t,i){
"use strict";t.exports=function(e,t){if("string"==typeof e)return c(e);if("number"==typeof e)return s(e,t);return null},t.exports.format=s,t.exports.parse=c;var i=/\B(?=(\d{3})+(?!\d))/g,r=/(?:\.0*|(\.[^0]+)0+)$/,o={b:1,kb:1024,mb:1<<20,gb:1<<30,tb:Math.pow(1024,4),pb:Math.pow(1024,5)},a=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;function s(e,t){if(!Number.isFinite(e))return null;var n=Math.abs(e),a=t&&t.thousandsSeparator||"",s=t&&t.unitSeparator||"",c=t&&void 0!==t.decimalPlaces?t.decimalPlaces:2,l=Boolean(t&&t.fixedDecimals),u=t&&t.unit||"";u&&o[u.toLowerCase()]||(u=n>=o.pb?"PB":n>=o.tb?"TB":n>=o.gb?"GB":n>=o.mb?"MB":n>=o.kb?"KB":"B");var p=(e/o[u.toLowerCase()]).toFixed(c);return l||(p=p.replace(r,"$1")),a&&(p=p.split(".").map((function(e,t){return 0===t?e.replace(i,a):e})).join(".")),p+s+u}function c(e){if("number"==typeof e&&!isNaN(e))return e;if("string"!=typeof e)return null;var t,n=a.exec(e),i="b";return n?(t=parseFloat(n[1]),i=n[4].toLowerCase()):(t=parseInt(e,10),i="b"),isNaN(t)?null:Math.floor(o[i]*t)}},{}],117:[function(e,t,n){
/*! cache-chunk-store. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
const n=e("lru"),r=e("queue-microtask");t.exports=class{constructor(e,t){if(this.store=e,this.chunkLength=e.chunkLength,this.inProgressGets=new Map,!this.store||!this.store.get||!this.store.put)throw new Error("First argument must be abstract-chunk-store compliant");this.cache=new n(t)}put(e,t,i=(()=>{})){if(!this.cache)return r((()=>i(new Error("CacheStore closed"))));this.cache.remove(e),this.store.put(e,t,i)}get(e,t,i=(()=>{})){if("function"==typeof t)return this.get(e,null,t);if(!this.cache)return r((()=>i(new Error("CacheStore closed"))));t||(t={});let n=this.cache.get(e);if(n){const e=t.offset||0,o=t.length||n.length-e;return 0===e&&o===n.length||(n=n.slice(e,o+e)),r((()=>i(null,n)))}let o=this.inProgressGets.get(e);const a=!!o;o||(o=[],this.inProgressGets.set(e,o)),o.push({opts:t,cb:i}),a||this.store.get(e,((t,i)=>{t||null==this.cache||this.cache.set(e,i);const n=this.inProgressGets.get(e);this.inProgressGets.delete(e);for(const{opts:e,cb:r}of n)if(t)r(t);else{const t=e.offset||0,n=e.length||i.length-t;let o=i;0===t&&n===i.length||(o=i.slice(t,n+t)),r(null,o)}}))}close(e=(()=>{})){if(!this.cache)return r((()=>e(new Error("CacheStore closed"))));this.cache=null,this.store.close(e)}destroy(e=(()=>{})){if(!this.cache)return r((()=>e(new Error("CacheStore closed"))));this.cache=null,this.store.destroy(e)}}},{lru:235,"queue-microtask":324}],118:[function(e,t,i){"use strict";var n=e("get-intrinsic"),r=e("./"),o=r(n("String.prototype.indexOf"));t.exports=function(e,t){var i=n(e,!!t);return"function"==typeof i&&o(e,".prototype.")>-1?r(i):i}},{"./":119,"get-intrinsic":189}],119:[function(e,t,i){"use strict";var n=e("function-bind"),r=e("get-intrinsic"),o=r("%Function.prototype.apply%"),a=r("%Function.prototype.call%"),s=r("%Reflect.apply%",!0)||n.call(a,o),c=r("%Object.getOwnPropertyDescriptor%",!0),l=r("%Object.defineProperty%",!0),u=r("%Math.max%");if(l)try{l({},"a",{value:1})}catch(e){l=null}t.exports=function(e){var t=s(n,a,arguments);c&&l&&(c(t,"length").configurable&&l(t,"length",{value:1+u(0,e.length-(arguments.length-1))}));return t};var p=function(){return s(n,o,arguments)};l?l(t.exports,"apply",{value:p}):t.exports.apply=p},{"function-bind":187,"get-intrinsic":189}],120:[function(e,t,i){arguments[4][28][0].apply(i,arguments)},{dup:28}],121:[function(e,t,i){arguments[4][29][0].apply(i,arguments)},{"./_stream_readable":123,"./_stream_writable":125,_process:306,dup:29,inherits:226}],122:[function(e,t,i){arguments[4][30][0].apply(i,arguments)},{"./_stream_transform":124,dup:30,inherits:226}],123:[function(e,t,i){arguments[4][31][0].apply(i,arguments)},{"../errors":120,"./_stream_duplex":121,"./internal/streams/async_iterator":126,"./internal/streams/buffer_list":127,"./internal/streams/destroy":128,"./internal/streams/from":130,"./internal/streams/state":132,"./internal/streams/stream":133,_process:306,buffer:110,dup:31,events:180,inherits:226,"string_decoder/":443,util:67}],124:[function(e,t,i){arguments[4][32][0].apply(i,arguments)},{"../errors":120,"./_stream_duplex":121,dup:32,inherits:226}],125:[function(e,t,i){arguments[4][33][0].apply(i,arguments)},{"../errors":120,"./_stream_duplex":121,"./internal/streams/destroy":128,"./internal/streams/state":132,"./internal/streams/stream":133,_process:306,buffer:110,dup:33,inherits:226,"util-deprecate":455}],126:[function(e,t,i){arguments[4][34][0].apply(i,arguments)},{"./end-of-stream":129,_process:306,dup:34}],127:[function(e,t,i){arguments[4][35][0].apply(i,arguments)},{buffer:110,dup:35,util:67}],128:[function(e,t,i){arguments[4][36][0].apply(i,arguments)},{_process:306,dup:36}],129:[function(e,t,i){arguments[4][37][0].apply(i,arguments)},{"../../../errors":120,dup:37}],130:[function(e,t,i){arguments[4][38][0].apply(i,arguments)},{dup:38}],131:[function(e,t,i){arguments[4][39][0].apply(i,arguments)},{"../../../errors":120,"./end-of-stream":129,dup:39}],132:[function(e,t,i){arguments[4][40][0].apply(i,arguments)},{"../../../errors":120,dup:40}],133:[function(e,t,i){arguments[4][41][0].apply(i,arguments)},{dup:41,events:180}],134:[function(e,t,i){arguments[4][42][0].apply(i,arguments)},{"./lib/_stream_duplex.js":121,"./lib/_stream_passthrough.js":122,"./lib/_stream_readable.js":123,"./lib/_stream_transform.js":124,"./lib/_stream_writable.js":125,"./lib/internal/streams/end-of-stream.js":129,"./lib/internal/streams/pipeline.js":131,dup:42}],135:[function(e,t,i){const n=e("block-stream2"),r=e("readable-stream");class o extends r.Writable{constructor(e,t,i={}){if(super(i),!e||!e.put||!e.get)throw new Error("First argument must be an abstract-chunk-store compliant store");if(!(t=Number(t)))throw new Error("Second argument must be a chunk length");const r=void 0!==i.zeroPadding&&i.zeroPadding;this._blockstream=new n(t,{...i,zeroPadding:r}),this._outstandingPuts=0,this._storeMaxOutstandingPuts=i.storeMaxOutstandingPuts||16;let o=0;this._blockstream.on("data",(t=>{this.destroyed||(this._outstandingPuts+=1,this._outstandingPuts>=this._storeMaxOutstandingPuts&&thLine truncated
const i=e("lru"),r=e("queue-microtask");t.exports=class{constructor(e,t){if(this.store=e,this.chunkLength=e.chunkLength,this.inProgressGets=new Map,!this.store||!this.store.get||!this.store.put)throw new Error("First argument must be abstract-chunk-store compliant");this.cache=new i(t)}put(e,t,n=(()=>{})){if(!this.cache)return r((()=>n(new Error("CacheStore closed"))));this.cache.remove(e),this.store.put(e,t,n)}get(e,t,n=(()=>{})){if("function"==typeof t)return this.get(e,null,t);if(!this.cache)return r((()=>n(new Error("CacheStore closed"))));t||(t={});let i=this.cache.get(e);if(i){const e=t.offset||0,o=t.length||i.length-e;return 0===e&&o===i.length||(i=i.slice(e,o+e)),r((()=>n(null,i)))}let o=this.inProgressGets.get(e);const a=!!o;o||(o=[],this.inProgressGets.set(e,o)),o.push({opts:t,cb:n}),a||this.store.get(e,((t,n)=>{t||null==this.cache||this.cache.set(e,n);const i=this.inProgressGets.get(e);this.inProgressGets.delete(e);for(const{opts:e,cb:r}of i)if(t)r(t);else{const t=e.offset||0,i=e.length||n.length-t;let o=n;0===t&&i===n.length||(o=n.slice(t,i+t)),r(null,o)}}))}close(e=(()=>{})){if(!this.cache)return r((()=>e(new Error("CacheStore closed"))));this.cache=null,this.store.close(e)}destroy(e=(()=>{})){if(!this.cache)return r((()=>e(new Error("CacheStore closed"))));this.cache=null,this.store.destroy(e)}}},{lru:238,"queue-microtask":327}],118:[function(e,t,n){"use strict";var i=e("get-intrinsic"),r=e("./"),o=r(i("String.prototype.indexOf"));t.exports=function(e,t){var n=i(e,!!t);return"function"==typeof n&&o(e,".prototype.")>-1?r(n):n}},{"./":119,"get-intrinsic":190}],119:[function(e,t,n){"use strict";var i=e("function-bind"),r=e("get-intrinsic"),o=e("set-function-length"),a=r("%TypeError%"),s=r("%Function.prototype.apply%"),c=r("%Function.prototype.call%"),l=r("%Reflect.apply%",!0)||i.call(c,s),u=r("%Object.defineProperty%",!0),p=r("%Math.max%");if(u)try{u({},"a",{value:1})}catch(e){u=null}t.exports=function(e){if("function"!=typeof e)throw new a("a function is required");var t=l(i,c,arguments);return o(t,1+p(0,e.length-(arguments.length-1)),!0)};var d=function(){return l(i,s,arguments)};u?u(t.exports,"apply",{value:d}):t.exports.apply=d},{"function-bind":188,"get-intrinsic":190,"set-function-length":358}],120:[function(e,t,n){arguments[4][28][0].apply(n,arguments)},{dup:28}],121:[function(e,t,n){arguments[4][29][0].apply(n,arguments)},{"./_stream_readable":123,"./_stream_writable":125,_process:309,dup:29,inherits:229}],122:[function(e,t,n){arguments[4][30][0].apply(n,arguments)},{"./_stream_transform":124,dup:30,inherits:229}],123:[function(e,t,n){arguments[4][31][0].apply(n,arguments)},{"../errors":120,"./_stream_duplex":121,"./internal/streams/async_iterator":126,"./internal/streams/buffer_list":127,"./internal/streams/destroy":128,"./internal/streams/from":130,"./internal/streams/state":132,"./internal/streams/stream":133,_process:309,buffer:110,dup:31,events:181,inherits:229,"string_decoder/":447,util:67}],124:[function(e,t,n){arguments[4][32][0].apply(n,arguments)},{"../errors":120,"./_stream_duplex":121,dup:32,inherits:229}],125:[function(e,t,n){arguments[4][33][0].apply(n,arguments)},{"../errors":120,"./_stream_duplex":121,"./internal/streams/destroy":128,"./internal/streams/state":132,"./internal/streams/stream":133,_process:309,buffer:110,dup:33,inherits:229,"util-deprecate":459}],126:[function(e,t,n){arguments[4][34][0].apply(n,arguments)},{"./end-of-stream":129,_process:309,dup:34}],127:[function(e,t,n){arguments[4][35][0].apply(n,arguments)},{buffer:110,dup:35,util:67}],128:[function(e,t,n){arguments[4][36][0].apply(n,arguments)},{_process:309,dup:36}],129:[function(e,t,n){arguments[4][37][0].apply(n,arguments)},{"../../../errors":120,dup:37}],130:[function(e,t,n){arguments[4][38][0].apply(n,arguments)},{dup:38}],131:[function(e,t,n){arguments[4][39][0].apply(n,arguments)},{"../../../errors":120,"./end-of-stream":129,dup:39}],132:[function(e,t,n){arguments[4][40][0].apply(n,arguments)},{"../../../errors":120,dup:40}],133:[function(e,t,n){arguments[4][41][0].apply(n,arguments)},{dup:41,events:181}],134:[function(e,t,n){arguments[4][42][0].apply(n,arguments)},{"./lib/_stream_duplex.js":121,"./lib/_stream_passthrough.js":122,"./lib/_stream_readable.js":123,"./lib/_stream_transform.js":124,"./lib/_stream_writable.js":125,"./lib/internal/streams/end-of-stream.js":129,"./lib/internal/streams/pipeline.js":131,dup:42}],135:[function(e,t,n){const i=e("block-stream2"),r=e("readable-stream");class o extends r.Writable{constructor(e,t,n={}){if(super(n),!e||!e.put||!e.get)throw new Error("First argument must be an abstract-chunk-store compliant store");if(!(t=Number(t)))throw new Error("Second argument must be a chunk length");const r=void 0!==n.zeroPadding&&n.zeroPadding;this._blockstream=new i(t,{...n,zeroPadding:r}),this._outstandingPuts=0,this._storeMaxOutstandingPuts=n.storeMaxOutstandingPuts||16;let o=0;this._blockstream.on("data",(t=>{this.destroyed||(this._outstandingPuts+=1,this._outstandingPLine truncated
/*!
* clipboard.js v2.0.11
* https://clipboardjs.com/
*
* Licensed MIT © Zeno Rocha
*/
var n,r;n=this,r=function(){return function(){var e={686:function(e,t,i){"use strict";i.d(t,{default:function(){return w}});var n=i(279),r=i.n(n),o=i(370),a=i.n(o),s=i(817),c=i.n(s);function l(e){try{return document.execCommand(e)}catch(e){return!1}}var u=function(e){var t=c()(e);return l("cut"),t},p=function(e,t){var i=function(e){var t="rtl"===document.documentElement.getAttribute("dir"),i=document.createElement("textarea");i.style.fontSize="12pt",i.style.border="0",i.style.padding="0",i.style.margin="0",i.style.position="absolute",i.style[t?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;return i.style.top="".concat(n,"px"),i.setAttribute("readonly",""),i.value=e,i}(e);t.container.appendChild(i);var n=c()(i);return l("copy"),i.remove(),n},d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{container:document.body},i="";return"string"==typeof e?i=p(e,t):e instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(null==e?void 0:e.type)?i=p(e.value,t):(i=c()(e),l("copy")),i};function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}var h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.action,i=void 0===t?"copy":t,n=e.container,r=e.target,o=e.text;if("copy"!==i&&"cut"!==i)throw new Error('Invalid "action" value, use either "copy" or "cut"');if(void 0!==r){if(!r||"object"!==f(r)||1!==r.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===i&&r.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===i&&(r.hasAttribute("readonly")||r.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes')}return o?d(o,{container:n}):r?"cut"===i?u(r):d(r,{container:n}):void 0};function m(e){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(e)}function b(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function v(e,t){return v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},v(e,t)}function g(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=y(e);if(t){var r=y(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return function(e,t){return!t||"object"!==m(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,i)}}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function x(e,t){var i="data-clipboard-".concat(e);if(t.hasAttribute(i))return t.getAttribute(i)}var _=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&v(e,t)}(o,e);var t,i,n,r=g(o);function o(e,t){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(i=r.call(this)).resolveOptions(t),i.listenClick(e),i}return t=o,i=[{key:"resolveOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===m(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=a()(e,"click",(function(e){return t.onClick(e)}))}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget,i=this.action(t)||"copy",n=h({action:i,container:this.container,target:this.target(t),text:this.text(t)});this.emit(n?"success":"error",{action:i,text:n,trigger:t,clearSelection:function(){t&&t.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(e){return x("action",e)}},{key:"defaultTarget",value:function(e){var t=x("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return x("text",e)}},{key:"destroy",value:function(){this.listener.destroy()}}],n=[{key:"copy",value:function(e){var t=arguments.length>1&&Line truncated
var i,r;i=this,r=function(){return function(){var e={686:function(e,t,n){"use strict";n.d(t,{default:function(){return w}});var i=n(279),r=n.n(i),o=n(370),a=n.n(o),s=n(817),c=n.n(s);function l(e){try{return document.execCommand(e)}catch(e){return!1}}var u=function(e){var t=c()(e);return l("cut"),t},p=function(e,t){var n=function(e){var t="rtl"===document.documentElement.getAttribute("dir"),n=document.createElement("textarea");n.style.fontSize="12pt",n.style.border="0",n.style.padding="0",n.style.margin="0",n.style.position="absolute",n.style[t?"right":"left"]="-9999px";var i=window.pageYOffset||document.documentElement.scrollTop;return n.style.top="".concat(i,"px"),n.setAttribute("readonly",""),n.value=e,n}(e);t.container.appendChild(n);var i=c()(n);return l("copy"),n.remove(),i},d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{container:document.body},n="";return"string"==typeof e?n=p(e,t):e instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(null==e?void 0:e.type)?n=p(e.value,t):(n=c()(e),l("copy")),n};function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}var h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.action,n=void 0===t?"copy":t,i=e.container,r=e.target,o=e.text;if("copy"!==n&&"cut"!==n)throw new Error('Invalid "action" value, use either "copy" or "cut"');if(void 0!==r){if(!r||"object"!==f(r)||1!==r.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===n&&r.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===n&&(r.hasAttribute("readonly")||r.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes')}return o?d(o,{container:i}):r?"cut"===n?u(r):d(r,{container:i}):void 0};function m(e){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(e)}function b(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function v(e,t){return v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},v(e,t)}function g(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=y(e);if(t){var r=y(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(e,t){return!t||"object"!==m(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n)}}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function x(e,t){var n="data-clipboard-".concat(e);if(t.hasAttribute(n))return t.getAttribute(n)}var _=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&v(e,t)}(o,e);var t,n,i,r=g(o);function o(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(n=r.call(this)).resolveOptions(t),n.listenClick(e),n}return t=o,n=[{key:"resolveOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===m(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=a()(e,"click",(function(e){return t.onClick(e)}))}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget,n=this.action(t)||"copy",i=h({action:n,container:this.container,target:this.target(t),text:this.text(t)});this.emit(i?"success":"error",{action:n,text:i,trigger:t,clearSelection:function(){t&&t.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(e){return x("action",e)}},{key:"defaultTarget",value:function(e){var t=x("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return x("text",e)}},{key:"destroy",value:function(){this.listener.destroy()}}],i=[{key:"copy",value:function(e){var t=arguments.length>1&&Line truncated
/*! create-torrent. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */
const n=e("bencode"),r=e("block-iterator"),o=e("piece-length"),a=e("path"),s=e("is-file"),c=e("junk"),l=e("join-async-iterator"),u=e("run-parallel"),p=e("queue-microtask"),d=e("simple-sha1");e("fast-readable-async-iterator");const f=e("./get-files");const h=Symbol("itemPath");function m(e,t,n){var r;if(r=e,"undefined"!=typeof FileList&&r instanceof FileList&&(e=Array.from(e)),Array.isArray(e)||(e=[e]),0===e.length)throw new Error("invalid input type");e.forEach((e=>{if(null==e)throw new Error(`invalid input type: ${e}`)})),1!==(e=e.map((e=>y(e)&&"string"==typeof e.path&&"function"==typeof f?e.path:e))).length||"string"==typeof e[0]||e[0].name||(e[0].name=t.name);let o=null;e.forEach(((t,i)=>{if("string"==typeof t)return;let n=t.fullPath||t.name;n||(n=`Unknown File ${i+1}`,t.unknownName=!0),t[h]=n.split("/"),t[h][0]||t[h].shift(),t[h].length<2?o=null:0===i&&e.length>1?o=t[h][0]:t[h][0]!==o&&(o=null)}));(void 0===t.filterJunkFiles||t.filterJunkFiles)&&(e=e.filter((e=>"string"==typeof e||!v(e[h])))),o&&e.forEach((e=>{const t=(i.isBuffer(e)||x(e))&&!e[h];"string"==typeof e||t||e[h].shift()})),!t.name&&o&&(t.name=o),t.name||e.some((e=>"string"==typeof e?(t.name=a.basename(e),!0):!e.unknownName&&(t.name=e[h][e[h].length-1],!0))),t.name||(t.name=`Unnamed Torrent ${Date.now()}`);const c=e.reduce(((e,t)=>e+Number("string"==typeof t)),0);let l=1===e.length;if(1===e.length&&"string"==typeof e[0]){if("function"!=typeof f)throw new Error("filesystem paths do not work in the browser");s(e[0],((e,t)=>{if(e)return n(e);l=t,d()}))}else p(d);function d(){u(e.map((e=>t=>{const n={};if(y(e))n.getStream=e.stream(),n.length=e.size;else if(i.isBuffer(e))n.getStream=[e],n.length=e.length;else{if(!x(e)){if("string"==typeof e){if("function"!=typeof f)throw new Error("filesystem paths do not work in the browser");return void f(e,c>1||l,t)}throw new Error("invalid input type")}n.getStream=async function*(e,t){for await(const i of e)t.length+=i.length,yield i}(e,n),n.length=0}n.path=e[h],t(null,n)})),((e,t)=>{if(e)return n(e);t=t.flat(),n(null,t,l)}))}}const b=5;function v(e){const t=e[e.length-1];return"."===t[0]&&c.is(t)}function g(e,t){return e+t.length}function y(e){return"undefined"!=typeof Blob&&e instanceof Blob}function x(e){return"object"==typeof e&&null!=e&&"function"==typeof e.pipe}t.exports=function(e,a,s){"function"==typeof a&&([a,s]=[s,a]),m(e,a=a?Object.assign({},a):{},((e,c,u)=>{if(e)return s(e);a.singleFileTorrent=u,function(e,a,s){let c=a.announceList;c||("string"==typeof a.announce?c=[[a.announce]]:Array.isArray(a.announce)&&(c=a.announce.map((e=>[e]))));c||(c=[]);globalThis.WEBTORRENT_ANNOUNCE&&("string"==typeof globalThis.WEBTORRENT_ANNOUNCE?c.push([[globalThis.WEBTORRENT_ANNOUNCE]]):Array.isArray(globalThis.WEBTORRENT_ANNOUNCE)&&(c=c.concat(globalThis.WEBTORRENT_ANNOUNCE.map((e=>[e])))));void 0===a.announce&&void 0===a.announceList&&(c=c.concat(t.exports.announceList));"string"==typeof a.urlList&&(a.urlList=[a.urlList]);const u={info:{name:a.name},"creation date":Math.ceil((Number(a.creationDate)||Date.now())/1e3),encoding:"UTF-8"};0!==c.length&&(u.announce=c[0][0],u["announce-list"]=c);void 0!==a.comment&&(u.comment=a.comment);void 0!==a.createdBy&&(u["created by"]=a.createdBy);void 0!==a.private&&(u.info.private=Number(a.private));void 0!==a.info&&Object.assign(u.info,a.info);void 0!==a.sslCert&&(u.info["ssl-cert"]=a.sslCert);void 0!==a.urlList&&(u["url-list"]=a.urlList);const p=e.reduce(g,0),f=a.pieceLength||o(p);u.info["piece length"]=f,async function(e,t,n,o,a){const s=[];let c=0,u=0;const p=e.map((e=>e.getStream)),f=o.onProgress;let h=0,m=0,v=!1;const g=r(l(p),t,{zeroPadding:!1});try{for await(const e of g)await new Promise((t=>{c+=e.length;const r=m;++m,++h<b&&t(),d(e,(o=>{s[r]=o,--h,u+=e.length,f&&f(u,n),t(),v&&0===h&&a(null,i.from(s.join(""),"hex"),c)}))}));if(0===h)return a(null,i.from(s.join(""),"hex"),c);v=!0}catch(e){a(e)}}(e,f,p,a,((t,i,r)=>{if(t)return s(t);u.info.pieces=i,e.forEach((e=>{delete e.getStream})),a.singleFileTorrent?u.info.length=r:u.info.files=e,s(null,n.encode(u))}))}(c,a,s)}))},t.exports.parseInput=function(e,t,i){"function"==typeof t&&([t,i]=[i,t]),m(e,t=t?Object.assign({},t):{},i)},t.exports.announceList=[["udp://tracker.leechers-paradise.org:6969"],["udp://tracker.coppersurfer.tk:6969"],["udp://tracker.opentrackr.org:1337"],["udp://explodie.org:6969"],["udp://tracker.empire-js.us:1337"],["wss://tracker.btorrent.xyz"],["wss://tracker.openwebtorrent.com"]],t.exports.isJunkPath=v}).call(this)}).call(this,e("buffer").Buffer)},{"./get-files":67,bencode:22,"block-iterator":48,buffer:110,"fast-readable-async-iterator":185,"is-file":67,"join-async-iterator":229,junk:230,path:298,"piece-length":305,"queue-microtask":324,"run-parallel":351,"simple-sha1":382}],147:[function(e,t,i){"use strict";i.randomBytes=i.rng=i.pseudoRandomBytes=i.prng=e("randombytes"),i.createHash=i.Hash=e("create-hash"),i.createHmac=i.Hmac=e("create-hmac");var n=e("browserify-sign/algos"),r=Object.keys(n),o=["sha1","sLine truncated
const i=e("bencode"),r=e("block-iterator"),o=e("piece-length"),a=e("path"),s=e("is-file"),c=e("junk"),l=e("join-async-iterator"),u=e("run-parallel"),p=e("queue-microtask"),d=e("simple-sha1");e("fast-readable-async-iterator");const f=e("./get-files");const h=Symbol("itemPath");function m(e,t,i){var r;if(r=e,"undefined"!=typeof FileList&&r instanceof FileList&&(e=Array.from(e)),Array.isArray(e)||(e=[e]),0===e.length)throw new Error("invalid input type");e.forEach((e=>{if(null==e)throw new Error(`invalid input type: ${e}`)})),1!==(e=e.map((e=>y(e)&&"string"==typeof e.path&&"function"==typeof f?e.path:e))).length||"string"==typeof e[0]||e[0].name||(e[0].name=t.name);let o=null;e.forEach(((t,n)=>{if("string"==typeof t)return;let i=t.fullPath||t.name;i||(i=`Unknown File ${n+1}`,t.unknownName=!0),t[h]=i.split("/"),t[h][0]||t[h].shift(),t[h].length<2?o=null:0===n&&e.length>1?o=t[h][0]:t[h][0]!==o&&(o=null)}));(void 0===t.filterJunkFiles||t.filterJunkFiles)&&(e=e.filter((e=>"string"==typeof e||!v(e[h])))),o&&e.forEach((e=>{const t=(n.isBuffer(e)||x(e))&&!e[h];"string"==typeof e||t||e[h].shift()})),!t.name&&o&&(t.name=o),t.name||e.some((e=>"string"==typeof e?(t.name=a.basename(e),!0):!e.unknownName&&(t.name=e[h][e[h].length-1],!0))),t.name||(t.name=`Unnamed Torrent ${Date.now()}`);const c=e.reduce(((e,t)=>e+Number("string"==typeof t)),0);let l=1===e.length;if(1===e.length&&"string"==typeof e[0]){if("function"!=typeof f)throw new Error("filesystem paths do not work in the browser");s(e[0],((e,t)=>{if(e)return i(e);l=t,d()}))}else p(d);function d(){u(e.map((e=>t=>{const i={};if(y(e))i.getStream=e.stream(),i.length=e.size;else if(n.isBuffer(e))i.getStream=[e],i.length=e.length;else{if(!x(e)){if("string"==typeof e){if("function"!=typeof f)throw new Error("filesystem paths do not work in the browser");return void f(e,c>1||l,t)}throw new Error("invalid input type")}i.getStream=async function*(e,t){for await(const n of e)t.length+=n.length,yield n}(e,i),i.length=0}i.path=e[h],t(null,i)})),((e,t)=>{if(e)return i(e);t=t.flat(),i(null,t,l)}))}}const b=5;function v(e){const t=e[e.length-1];return"."===t[0]&&c.is(t)}function g(e,t){return e+t.length}function y(e){return"undefined"!=typeof Blob&&e instanceof Blob}function x(e){return"object"==typeof e&&null!=e&&"function"==typeof e.pipe}t.exports=function(e,a,s){"function"==typeof a&&([a,s]=[s,a]),m(e,a=a?Object.assign({},a):{},((e,c,u)=>{if(e)return s(e);a.singleFileTorrent=u,function(e,a,s){let c=a.announceList;c||("string"==typeof a.announce?c=[[a.announce]]:Array.isArray(a.announce)&&(c=a.announce.map((e=>[e]))));c||(c=[]);globalThis.WEBTORRENT_ANNOUNCE&&("string"==typeof globalThis.WEBTORRENT_ANNOUNCE?c.push([[globalThis.WEBTORRENT_ANNOUNCE]]):Array.isArray(globalThis.WEBTORRENT_ANNOUNCE)&&(c=c.concat(globalThis.WEBTORRENT_ANNOUNCE.map((e=>[e])))));void 0===a.announce&&void 0===a.announceList&&(c=c.concat(t.exports.announceList));"string"==typeof a.urlList&&(a.urlList=[a.urlList]);const u={info:{name:a.name},"creation date":Math.ceil((Number(a.creationDate)||Date.now())/1e3),encoding:"UTF-8"};0!==c.length&&(u.announce=c[0][0],u["announce-list"]=c);void 0!==a.comment&&(u.comment=a.comment);void 0!==a.createdBy&&(u["created by"]=a.createdBy);void 0!==a.private&&(u.info.private=Number(a.private));void 0!==a.info&&Object.assign(u.info,a.info);void 0!==a.sslCert&&(u.info["ssl-cert"]=a.sslCert);void 0!==a.urlList&&(u["url-list"]=a.urlList);const p=e.reduce(g,0),f=a.pieceLength||o(p);u.info["piece length"]=f,async function(e,t,i,o,a){const s=[];let c=0,u=0;const p=e.map((e=>e.getStream)),f=o.onProgress;let h=0,m=0,v=!1;const g=r(l(p),t,{zeroPadding:!1});try{for await(const e of g)await new Promise((t=>{c+=e.length;const r=m;++m,++h<b&&t(),d(e,(o=>{s[r]=o,--h,u+=e.length,f&&f(u,i),t(),v&&0===h&&a(null,n.from(s.join(""),"hex"),c)}))}));if(0===h)return a(null,n.from(s.join(""),"hex"),c);v=!0}catch(e){a(e)}}(e,f,p,a,((t,n,r)=>{if(t)return s(t);u.info.pieces=n,e.forEach((e=>{delete e.getStream})),a.singleFileTorrent?u.info.length=r:u.info.files=e,s(null,i.encode(u))}))}(c,a,s)}))},t.exports.parseInput=function(e,t,n){"function"==typeof t&&([t,n]=[n,t]),m(e,t=t?Object.assign({},t):{},n)},t.exports.announceList=[["udp://tracker.leechers-paradise.org:6969"],["udp://tracker.coppersurfer.tk:6969"],["udp://tracker.opentrackr.org:1337"],["udp://explodie.org:6969"],["udp://tracker.empire-js.us:1337"],["wss://tracker.btorrent.xyz"],["wss://tracker.openwebtorrent.com"]],t.exports.isJunkPath=v}).call(this)}).call(this,e("buffer").Buffer)},{"./get-files":67,bencode:22,"block-iterator":48,buffer:110,"fast-readable-async-iterator":186,"is-file":67,"join-async-iterator":232,junk:233,path:301,"piece-length":308,"queue-microtask":327,"run-parallel":354,"simple-sha1":386}],147:[function(e,t,n){"use strict";n.randomBytes=n.rng=n.pseudoRandomBytes=n.prng=e("randombytes"),n.createHash=n.Hash=e("create-hash"),n.createHmac=n.Hmac=e("create-hmac");var i=e("browserify-sign/algos"),r=Object.keys(i),o=["sha1","sLine truncated
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
i.read=function(e,t,i,n,r){var o,a,s=8*r-n-1,c=(1<<s)-1,l=c>>1,u=-7,p=i?r-1:0,d=i?-1:1,f=e[t+p];for(p+=d,o=f&(1<<-u)-1,f>>=-u,u+=s;u>0;o=256*o+e[t+p],p+=d,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=n;u>0;a=256*a+e[t+p],p+=d,u-=8);if(0===o)o=1-l;else{if(o===c)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),o-=l}return(f?-1:1)*a*Math.pow(2,o-n)},i.write=function(e,t,i,n,r,o){var a,s,c,l=8*o-r-1,u=(1<<l)-1,p=u>>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,h=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+p>=1?d/c:d*Math.pow(2,1-p))*c>=2&&(a++,c/=2),a+p>=u?(s=0,a=u):a+p>=1?(s=(t*c-1)*Math.pow(2,r),a+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,r),a=0));r>=8;e[i+f]=255&s,f+=h,s/=256,r-=8);for(a=a<<r|s,l+=r;l>0;e[i+f]=255&a,f+=h,a/=256,l-=8);e[i+f-h]|=128*m}},{}],225:[function(e,t,i){
n.read=function(e,t,n,i,r){var o,a,s=8*r-i-1,c=(1<<s)-1,l=c>>1,u=-7,p=n?r-1:0,d=n?-1:1,f=e[t+p];for(p+=d,o=f&(1<<-u)-1,f>>=-u,u+=s;u>0;o=256*o+e[t+p],p+=d,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=i;u>0;a=256*a+e[t+p],p+=d,u-=8);if(0===o)o=1-l;else{if(o===c)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,i),o-=l}return(f?-1:1)*a*Math.pow(2,o-i)},n.write=function(e,t,n,i,r,o){var a,s,c,l=8*o-r-1,u=(1<<l)-1,p=u>>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:o-1,h=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+p>=1?d/c:d*Math.pow(2,1-p))*c>=2&&(a++,c/=2),a+p>=u?(s=0,a=u):a+p>=1?(s=(t*c-1)*Math.pow(2,r),a+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,r),a=0));r>=8;e[n+f]=255&s,f+=h,s/=256,r-=8);for(a=a<<r|s,l+=r;l>0;e[n+f]=255&a,f+=h,a/=256,l-=8);e[n+f-h]|=128*m}},{}],228:[function(e,t,n){
/*! immediate-chunk-store. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
const n=e("queue-microtask");t.exports=class{constructor(e){if(this.store=e,this.chunkLength=e.chunkLength,!this.store||!this.store.get||!this.store.put)throw new Error("First argument must be abstract-chunk-store compliant");this.mem=[]}put(e,t,i=(()=>{})){this.mem[e]=t,this.store.put(e,t,(t=>{this.mem[e]=null,i(t)}))}get(e,t,i=(()=>{})){if("function"==typeof t)return this.get(e,null,t);let r=this.mem[e];if(!r)return this.store.get(e,t,i);t||(t={});const o=t.offset||0,a=t.length||r.length-o;0===o&&a===r.length||(r=r.slice(o,a+o)),n((()=>i(null,r)))}close(e=(()=>{})){this.store.close(e)}destroy(e=(()=>{})){this.store.destroy(e)}}},{"queue-microtask":324}],226:[function(e,t,i){"function"==typeof Object.create?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}}},{}],227:[function(e,t,i){t.exports=function(e){for(var t=0,i=e.length;t<i;++t)if(e.charCodeAt(t)>127)return!1;return!0}},{}],228:[function(e,t,i){function n(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}
const i=e("queue-microtask");t.exports=class{constructor(e){if(this.store=e,this.chunkLength=e.chunkLength,!this.store||!this.store.get||!this.store.put)throw new Error("First argument must be abstract-chunk-store compliant");this.mem=[]}put(e,t,n=(()=>{})){this.mem[e]=t,this.store.put(e,t,(t=>{this.mem[e]=null,n(t)}))}get(e,t,n=(()=>{})){if("function"==typeof t)return this.get(e,null,t);let r=this.mem[e];if(!r)return this.store.get(e,t,n);t||(t={});const o=t.offset||0,a=t.length||r.length-o;0===o&&a===r.length||(r=r.slice(o,a+o)),i((()=>n(null,r)))}close(e=(()=>{})){this.store.close(e)}destroy(e=(()=>{})){this.store.destroy(e)}}},{"queue-microtask":327}],229:[function(e,t,n){"function"==typeof Object.create?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},{}],230:[function(e,t,n){t.exports=function(e){for(var t=0,n=e.length;t<n;++t)if(e.charCodeAt(t)>127)return!1;return!0}},{}],231:[function(e,t,n){function i(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}
/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
t.exports=function(e){return null!=e&&(n(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&n(e.slice(0,0))}(e)||!!e._isBuffer)}},{}],229:[function(e,t,i){t.exports=async function*(e){for(let t of e)"function"==typeof t&&(t=t()),yield*t}},{}],230:[function(e,t,i){"use strict";i.re=()=>{throw new Error("`junk.re` was renamed to `junk.regex`")},i.regex=new RegExp(["^npm-debug\\.log$","^\\..*\\.swp$","^\\.DS_Store$","^\\.AppleDouble$","^\\.LSOverride$","^Icon\\r$","^\\._.*","^\\.Spotlight-V100(?:$|\\/)","\\.Trashes","^__MACOSX$","~$","^Thumbs\\.db$","^ehthumbs\\.db$","^Desktop\\.ini$","@eaDir$"].join("|")),i.is=e=>i.regex.test(e),i.not=e=>!i.is(e),i.default=t.exports},{}],231:[function(e,t,i){i.RateLimiter=e("./lib/rateLimiter"),i.TokenBucket=e("./lib/tokenBucket")},{"./lib/rateLimiter":233,"./lib/tokenBucket":234}],232:[function(e,t,i){(function(e){(function(){t.exports=function(){if(void 0!==e&&e.hrtime){var t=e.hrtime(),i=t[0],n=t[1];return 1e3*i+Math.floor(n/1e6)}return(new Date).getTime()}}).call(this)}).call(this,e("_process"))},{_process:306}],233:[function(e,t,i){(function(i){(function(){var n=e("./tokenBucket"),r=e("./clock"),o=function(e,t,i){this.tokenBucket=new n(e,e,t,null),this.tokenBucket.content=e,this.curIntervalStart=r(),this.tokensThisInterval=0,this.fireImmediately=i};o.prototype={tokenBucket:null,curIntervalStart:0,tokensThisInterval:0,fireImmediately:!1,removeTokens:function(e,t){if(e>this.tokenBucket.bucketSize)return i.nextTick(t.bind(null,"Requested tokens "+e+" exceeds maximum tokens per interval "+this.tokenBucket.bucketSize,null)),!1;var n=this,o=r();if((o<this.curIntervalStart||o-this.curIntervalStart>=this.tokenBucket.interval)&&(this.curIntervalStart=o,this.tokensThisInterval=0),e>this.tokenBucket.tokensPerInterval-this.tokensThisInterval){if(this.fireImmediately)i.nextTick(t.bind(null,null,-1));else{var a=Math.ceil(this.curIntervalStart+this.tokenBucket.interval-o);setTimeout((function(){n.tokenBucket.removeTokens(e,s)}),a)}return!1}return this.tokenBucket.removeTokens(e,s);function s(i,r){if(i)return t(i,null);n.tokensThisInterval+=e,t(null,r)}},tryRemoveTokens:function(e){if(e>this.tokenBucket.bucketSize)return!1;var t=r();if((t<this.curIntervalStart||t-this.curIntervalStart>=this.tokenBucket.interval)&&(this.curIntervalStart=t,this.tokensThisInterval=0),e>this.tokenBucket.tokensPerInterval-this.tokensThisInterval)return!1;var i=this.tokenBucket.tryRemoveTokens(e);return i&&(this.tokensThisInterval+=e),i},getTokensRemaining:function(){return this.tokenBucket.drip(),this.tokenBucket.content}},t.exports=o}).call(this)}).call(this,e("_process"))},{"./clock":232,"./tokenBucket":234,_process:306}],234:[function(e,t,i){(function(e){(function(){var i=function(e,t,i,n){if(this.bucketSize=e,this.tokensPerInterval=t,"string"==typeof i)switch(i){case"sec":case"second":this.interval=1e3;break;case"min":case"minute":this.interval=6e4;break;case"hr":case"hour":this.interval=36e5;break;case"day":this.interval=864e5;break;default:throw new Error("Invaid interval "+i)}else this.interval=i;this.parentBucket=n,this.content=0,this.lastDrip=+new Date};i.prototype={bucketSize:1,tokensPerInterval:1,interval:1e3,parentBucket:null,content:0,lastDrip:0,removeTokens:function(t,i){var n=this;return this.bucketSize?t>this.bucketSize?(e.nextTick(i.bind(null,"Requested tokens "+t+" exceeds bucket size "+this.bucketSize,null)),!1):(this.drip(),t>this.content?r():this.parentBucket?this.parentBucket.removeTokens(t,(function(e,o){return e?i(e,null):t>n.content?r():(n.content-=t,void i(null,Math.min(o,n.content)))})):(this.content-=t,e.nextTick(i.bind(null,null,this.content)),!0)):(e.nextTick(i.bind(null,null,t,Number.POSITIVE_INFINITY)),!0);function r(){var e=Math.ceil((t-n.content)*(n.interval/n.tokensPerInterval));return setTimeout((function(){n.removeTokens(t,i)}),e),!1}},tryRemoveTokens:function(e){return!this.bucketSize||!(e>this.bucketSize)&&(this.drip(),!(e>this.content)&&(!(this.parentBucket&&!this.parentBucket.tryRemoveTokens(e))&&(this.content-=e,!0)))},drip:function(){if(this.tokensPerInterval){var e=+new Date,t=Math.max(e-this.lastDrip,0);this.lastDrip=e;var i=t*(this.tokensPerInterval/this.interval);this.content=Math.min(this.content+i,this.bucketSize)}else this.content=this.bucketSize}},t.exports=i}).call(this)}).call(this,e("_process"))},{_process:306}],235:[function(e,t,i){var n=e("events"),r=e("inherits");function o(e){if(!(this instanceof o))return new o(e);"number"==typeof e&&(e={max:e}),e||(e={}),n.EventEmitter.call(this),this.cache={},this.head=this.tail=null,this.length=0,this.max=e.max||1e3,this.maxAge=e.maxAge||0}t.exports=o,r(o,n.EventEmitter),Object.defineProperty(o.prototype,"keys",{get:function(){return Object.keys(this.cache)}}),o.prototype.clear=function(){this.cache={},this.head=this.tail=null,this.length=0},o.prototype.remove=function(e){if("string"!=typeof e&&(e=""+e),this.cache.hasOwnProperty(e)){var t=this.cache[e];return delete this.cache[e],Line truncated
t.exports=function(e){return null!=e&&(i(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&i(e.slice(0,0))}(e)||!!e._isBuffer)}},{}],232:[function(e,t,n){t.exports=async function*(e){for(let t of e)"function"==typeof t&&(t=t()),yield*t}},{}],233:[function(e,t,n){"use strict";n.re=()=>{throw new Error("`junk.re` was renamed to `junk.regex`")},n.regex=new RegExp(["^npm-debug\\.log$","^\\..*\\.swp$","^\\.DS_Store$","^\\.AppleDouble$","^\\.LSOverride$","^Icon\\r$","^\\._.*","^\\.Spotlight-V100(?:$|\\/)","\\.Trashes","^__MACOSX$","~$","^Thumbs\\.db$","^ehthumbs\\.db$","^Desktop\\.ini$","@eaDir$"].join("|")),n.is=e=>n.regex.test(e),n.not=e=>!n.is(e),n.default=t.exports},{}],234:[function(e,t,n){n.RateLimiter=e("./lib/rateLimiter"),n.TokenBucket=e("./lib/tokenBucket")},{"./lib/rateLimiter":236,"./lib/tokenBucket":237}],235:[function(e,t,n){(function(e){(function(){t.exports=function(){if(void 0!==e&&e.hrtime){var t=e.hrtime(),n=t[0],i=t[1];return 1e3*n+Math.floor(i/1e6)}return(new Date).getTime()}}).call(this)}).call(this,e("_process"))},{_process:309}],236:[function(e,t,n){(function(n){(function(){var i=e("./tokenBucket"),r=e("./clock"),o=function(e,t,n){this.tokenBucket=new i(e,e,t,null),this.tokenBucket.content=e,this.curIntervalStart=r(),this.tokensThisInterval=0,this.fireImmediately=n};o.prototype={tokenBucket:null,curIntervalStart:0,tokensThisInterval:0,fireImmediately:!1,removeTokens:function(e,t){if(e>this.tokenBucket.bucketSize)return n.nextTick(t.bind(null,"Requested tokens "+e+" exceeds maximum tokens per interval "+this.tokenBucket.bucketSize,null)),!1;var i=this,o=r();if((o<this.curIntervalStart||o-this.curIntervalStart>=this.tokenBucket.interval)&&(this.curIntervalStart=o,this.tokensThisInterval=0),e>this.tokenBucket.tokensPerInterval-this.tokensThisInterval){if(this.fireImmediately)n.nextTick(t.bind(null,null,-1));else{var a=Math.ceil(this.curIntervalStart+this.tokenBucket.interval-o);setTimeout((function(){i.tokenBucket.removeTokens(e,s)}),a)}return!1}return this.tokenBucket.removeTokens(e,s);function s(n,r){if(n)return t(n,null);i.tokensThisInterval+=e,t(null,r)}},tryRemoveTokens:function(e){if(e>this.tokenBucket.bucketSize)return!1;var t=r();if((t<this.curIntervalStart||t-this.curIntervalStart>=this.tokenBucket.interval)&&(this.curIntervalStart=t,this.tokensThisInterval=0),e>this.tokenBucket.tokensPerInterval-this.tokensThisInterval)return!1;var n=this.tokenBucket.tryRemoveTokens(e);return n&&(this.tokensThisInterval+=e),n},getTokensRemaining:function(){return this.tokenBucket.drip(),this.tokenBucket.content}},t.exports=o}).call(this)}).call(this,e("_process"))},{"./clock":235,"./tokenBucket":237,_process:309}],237:[function(e,t,n){(function(e){(function(){var n=function(e,t,n,i){if(this.bucketSize=e,this.tokensPerInterval=t,"string"==typeof n)switch(n){case"sec":case"second":this.interval=1e3;break;case"min":case"minute":this.interval=6e4;break;case"hr":case"hour":this.interval=36e5;break;case"day":this.interval=864e5;break;default:throw new Error("Invaid interval "+n)}else this.interval=n;this.parentBucket=i,this.content=0,this.lastDrip=+new Date};n.prototype={bucketSize:1,tokensPerInterval:1,interval:1e3,parentBucket:null,content:0,lastDrip:0,removeTokens:function(t,n){var i=this;return this.bucketSize?t>this.bucketSize?(e.nextTick(n.bind(null,"Requested tokens "+t+" exceeds bucket size "+this.bucketSize,null)),!1):(this.drip(),t>this.content?r():this.parentBucket?this.parentBucket.removeTokens(t,(function(e,o){return e?n(e,null):t>i.content?r():(i.content-=t,void n(null,Math.min(o,i.content)))})):(this.content-=t,e.nextTick(n.bind(null,null,this.content)),!0)):(e.nextTick(n.bind(null,null,t,Number.POSITIVE_INFINITY)),!0);function r(){var e=Math.ceil((t-i.content)*(i.interval/i.tokensPerInterval));return setTimeout((function(){i.removeTokens(t,n)}),e),!1}},tryRemoveTokens:function(e){return!this.bucketSize||!(e>this.bucketSize)&&(this.drip(),!(e>this.content)&&(!(this.parentBucket&&!this.parentBucket.tryRemoveTokens(e))&&(this.content-=e,!0)))},drip:function(){if(this.tokensPerInterval){var e=+new Date,t=Math.max(e-this.lastDrip,0);this.lastDrip=e;var n=t*(this.tokensPerInterval/this.interval);this.content=Math.min(this.content+n,this.bucketSize)}else this.content=this.bucketSize}},t.exports=n}).call(this)}).call(this,e("_process"))},{_process:309}],238:[function(e,t,n){var i=e("events"),r=e("inherits");function o(e){if(!(this instanceof o))return new o(e);"number"==typeof e&&(e={max:e}),e||(e={}),i.EventEmitter.call(this),this.cache={},this.head=this.tail=null,this.length=0,this.max=e.max||1e3,this.maxAge=e.maxAge||0}t.exports=o,r(o,i.EventEmitter),Object.defineProperty(o.prototype,"keys",{get:function(){return Object.keys(this.cache)}}),o.prototype.clear=function(){this.cache={},this.head=this.tail=null,this.length=0},o.prototype.remove=function(e){if("string"!=typeof e&&(e=""+e),this.cache.hasOwnProperty(e)){var t=this.cache[e];return delete this.cache[e],Line truncated
/*! lt_donthave. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */
const n=e("unordered-array-remove"),{EventEmitter:r}=e("events"),o=e("debug")("lt_donthave");t.exports=()=>{class e extends r{constructor(e){super(),this._peerSupports=!1,this._wire=e}onExtendedHandshake(){this._peerSupports=!0}onMessage(e){let t;try{t=e.readUInt32BE()}catch(e){return}this._wire.peerPieces.get(t)&&(o("got donthave %d",t),this._wire.peerPieces.set(t,!1),this.emit("donthave",t),this._failRequests(t))}donthave(e){if(!this._peerSupports)return;o("donthave %d",e);const t=i.alloc(4);t.writeUInt32BE(e),this._wire.extended("lt_donthave",t)}_failRequests(e){const t=this._wire.requests;for(let i=0;i<t.length;i++){const r=t[i];r.piece===e&&(n(t,i),i-=1,this._wire._callback(r,new Error("peer sent donthave"),null))}}}return e.prototype.name="lt_donthave",e}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:110,debug:148,events:180,"unordered-array-remove":452}],237:[function(e,t,i){(function(i){(function(){
const i=e("unordered-array-remove"),{EventEmitter:r}=e("events"),o=e("debug")("lt_donthave");t.exports=()=>{class e extends r{constructor(e){super(),this._peerSupports=!1,this._wire=e}onExtendedHandshake(){this._peerSupports=!0}onMessage(e){let t;try{t=e.readUInt32BE()}catch(e){return}this._wire.peerPieces.get(t)&&(o("got donthave %d",t),this._wire.peerPieces.set(t,!1),this.emit("donthave",t),this._failRequests(t))}donthave(e){if(!this._peerSupports)return;o("donthave %d",e);const t=n.alloc(4);t.writeUInt32BE(e),this._wire.extended("lt_donthave",t)}_failRequests(e){const t=this._wire.requests;for(let n=0;n<t.length;n++){const r=t[n];r.piece===e&&(i(t,n),n-=1,this._wire._callback(r,new Error("peer sent donthave"),null))}}}return e.prototype.name="lt_donthave",e}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:110,debug:148,events:181,"unordered-array-remove":456}],240:[function(e,t,n){(function(n){(function(){
/*! magnet-uri. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */
t.exports=o,t.exports.decode=o,t.exports.encode=function(e){e=Object.assign({},e);let t=new Set;e.xt&&"string"==typeof e.xt&&t.add(e.xt);e.xt&&Array.isArray(e.xt)&&(t=new Set(e.xt));e.infoHashBuffer&&t.add(`urn:btih:${e.infoHashBuffer.toString("hex")}`);e.infoHash&&t.add(`urn:btih:${e.infoHash}`);e.infoHashV2Buffer&&t.add(e.xt=`urn:btmh:1220${e.infoHashV2Buffer.toString("hex")}`);e.infoHashV2&&t.add(`urn:btmh:1220${e.infoHashV2}`);const i=Array.from(t);1===i.length&&(e.xt=i[0]);i.length>1&&(e.xt=i);e.publicKeyBuffer&&(e.xs=`urn:btpk:${e.publicKeyBuffer.toString("hex")}`);e.publicKey&&(e.xs=`urn:btpk:${e.publicKey}`);e.name&&(e.dn=e.name);e.keywords&&(e.kt=e.keywords);e.announce&&(e.tr=e.announce);e.urlList&&(e.ws=e.urlList,delete e.as);e.peerAddresses&&(e["x.pe"]=e.peerAddresses);let n="magnet:?";return Object.keys(e).filter((e=>2===e.length||"x.pe"===e)).forEach(((t,i)=>{const o=Array.isArray(e[t])?e[t]:[e[t]];o.forEach(((e,r)=>{(i>0||r>0)&&("kt"!==t&&"so"!==t||0===r)&&(n+="&"),"dn"===t&&(e=encodeURIComponent(e).replace(/%20/g,"+")),"tr"!==t&&"as"!==t&&"ws"!==t||(e=encodeURIComponent(e)),"xs"!==t||e.startsWith("urn:btpk:")||(e=encodeURIComponent(e)),"kt"===t&&(e=encodeURIComponent(e)),"so"!==t&&(n+="kt"===t&&r>0?`+${e}`:`${t}=${e}`)})),"so"===t&&(n+=`${t}=${r.compose(o)}`)})),n};const n=e("thirty-two"),r=e("bep53-range");function o(e){const t={},o=e.split("magnet:?")[1];let a;if((o&&o.length>=0?o.split("&"):[]).forEach((e=>{const i=e.split("=");if(2!==i.length)return;const n=i[0];let o=i[1];"dn"===n&&(o=decodeURIComponent(o).replace(/\+/g," ")),"tr"!==n&&"xs"!==n&&"as"!==n&&"ws"!==n||(o=decodeURIComponent(o)),"kt"===n&&(o=decodeURIComponent(o).split("+")),"ix"===n&&(o=Number(o)),"so"===n&&(o=r.parse(decodeURIComponent(o).split(","))),t[n]?(Array.isArray(t[n])||(t[n]=[t[n]]),t[n].push(o)):t[n]=o})),t.xt){(Array.isArray(t.xt)?t.xt:[t.xt]).forEach((e=>{if(a=e.match(/^urn:btih:(.{40})/))t.infoHash=a[1].toLowerCase();else if(a=e.match(/^urn:btih:(.{32})/)){const e=n.decode(a[1]);t.infoHash=i.from(e,"binary").toString("hex")}else(a=e.match(/^urn:btmh:1220(.{64})/))&&(t.infoHashV2=a[1].toLowerCase())}))}if(t.xs){(Array.isArray(t.xs)?t.xs:[t.xs]).forEach((e=>{(a=e.match(/^urn:btpk:(.{64})/))&&(t.publicKey=a[1].toLowerCase())}))}return t.infoHash&&(t.infoHashBuffer=i.from(t.infoHash,"hex")),t.infoHashV2&&(t.infoHashV2Buffer=i.from(t.infoHashV2,"hex")),t.publicKey&&(t.publicKeyBuffer=i.from(t.publicKey,"hex")),t.dn&&(t.name=t.dn),t.kt&&(t.keywords=t.kt),t.announce=[],("string"==typeof t.tr||Array.isArray(t.tr))&&(t.announce=t.announce.concat(t.tr)),t.urlList=[],("string"==typeof t.as||Array.isArray(t.as))&&(t.urlList=t.urlList.concat(t.as)),("string"==typeof t.ws||Array.isArray(t.ws))&&(t.urlList=t.urlList.concat(t.ws)),t.peerAddresses=[],("string"==typeof t["x.pe"]||Array.isArray(t["x.pe"]))&&(t.peerAddresses=t.peerAddresses.concat(t["x.pe"])),t.announce=Array.from(new Set(t.announce)),t.urlList=Array.from(new Set(t.urlList)),t.peerAddresses=Array.from(new Set(t.peerAddresses)),t}}).call(this)}).call(this,e("buffer").Buffer)},{"bep53-range":24,buffer:110,"thirty-two":444}],238:[function(e,t,i){"use strict";var n=e("inherits"),r=e("hash-base"),o=e("safe-buffer").Buffer,a=new Array(16);function s(){r.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function c(e,t){return e<<t|e>>>32-t}function l(e,t,i,n,r,o,a){return c(e+(t&i|~t&n)+r+o|0,a)+t|0}function u(e,t,i,n,r,o,a){return c(e+(t&n|i&~n)+r+o|0,a)+t|0}function p(e,t,i,n,r,o,a){return c(e+(t^i^n)+r+o|0,a)+t|0}function d(e,t,i,n,r,o,a){return c(e+(i^(t|~n))+r+o|0,a)+t|0}n(s,r),s.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var i=this._a,n=this._b,r=this._c,o=this._d;i=l(i,n,r,o,e[0],3614090360,7),o=l(o,i,n,r,e[1],3905402710,12),r=l(r,o,i,n,e[2],606105819,17),n=l(n,r,o,i,e[3],3250441966,22),i=l(i,n,r,o,e[4],4118548399,7),o=l(o,i,n,r,e[5],1200080426,12),r=l(r,o,i,n,e[6],2821735955,17),n=l(n,r,o,i,e[7],4249261313,22),i=l(i,n,r,o,e[8],1770035416,7),o=l(o,i,n,r,e[9],2336552879,12),r=l(r,o,i,n,e[10],4294925233,17),n=l(n,r,o,i,e[11],2304563134,22),i=l(i,n,r,o,e[12],1804603682,7),o=l(o,i,n,r,e[13],4254626195,12),r=l(r,o,i,n,e[14],2792965006,17),i=u(i,n=l(n,r,o,i,e[15],1236535329,22),r,o,e[1],4129170786,5),o=u(o,i,n,r,e[6],3225465664,9),r=u(r,o,i,n,e[11],643717713,14),n=u(n,r,o,i,e[0],3921069994,20),i=u(i,n,r,o,e[5],3593408605,5),o=u(o,i,n,r,e[10],38016083,9),r=u(r,o,i,n,e[15],3634488961,14),n=u(n,r,o,i,e[4],3889429448,20),i=u(i,n,r,o,e[9],568446438,5),o=u(o,i,n,r,e[14],3275163606,9),r=u(r,o,i,n,e[3],4107603335,14),n=u(n,r,o,i,e[8],1163531501,20),i=u(i,n,r,o,e[13],2850285829,5),o=u(o,i,n,r,e[2],4243563512,9),r=u(r,o,i,n,e[7],1735328473,14),i=p(i,n=u(n,r,o,i,e[12],2368359562,20),r,o,e[5],4294588738,4),o=p(o,i,n,r,e[8],2272392833,11),r=p(r,o,i,n,e[11],1839030562,16),n=p(n,r,o,i,e[14],4259657740,23),i=p(i,n,r,o,e[1],2763975236,4),o=p(o,i,n,r,e[4],1272893353,11),r=p(r,o,i,n,e[7],4139469664,16),n=Line truncated
t.exports=o,t.exports.decode=o,t.exports.encode=function(e){e=Object.assign({},e);let t=new Set;e.xt&&"string"==typeof e.xt&&t.add(e.xt);e.xt&&Array.isArray(e.xt)&&(t=new Set(e.xt));e.infoHashBuffer&&t.add(`urn:btih:${e.infoHashBuffer.toString("hex")}`);e.infoHash&&t.add(`urn:btih:${e.infoHash}`);e.infoHashV2Buffer&&t.add(e.xt=`urn:btmh:1220${e.infoHashV2Buffer.toString("hex")}`);e.infoHashV2&&t.add(`urn:btmh:1220${e.infoHashV2}`);const n=Array.from(t);1===n.length&&(e.xt=n[0]);n.length>1&&(e.xt=n);e.publicKeyBuffer&&(e.xs=`urn:btpk:${e.publicKeyBuffer.toString("hex")}`);e.publicKey&&(e.xs=`urn:btpk:${e.publicKey}`);e.name&&(e.dn=e.name);e.keywords&&(e.kt=e.keywords);e.announce&&(e.tr=e.announce);e.urlList&&(e.ws=e.urlList,delete e.as);e.peerAddresses&&(e["x.pe"]=e.peerAddresses);let i="magnet:?";return Object.keys(e).filter((e=>2===e.length||"x.pe"===e)).forEach(((t,n)=>{const o=Array.isArray(e[t])?e[t]:[e[t]];o.forEach(((e,r)=>{(n>0||r>0)&&("kt"!==t&&"so"!==t||0===r)&&(i+="&"),"dn"===t&&(e=encodeURIComponent(e).replace(/%20/g,"+")),"tr"!==t&&"as"!==t&&"ws"!==t||(e=encodeURIComponent(e)),"xs"!==t||e.startsWith("urn:btpk:")||(e=encodeURIComponent(e)),"kt"===t&&(e=encodeURIComponent(e)),"so"!==t&&(i+="kt"===t&&r>0?`+${e}`:`${t}=${e}`)})),"so"===t&&(i+=`${t}=${r.compose(o)}`)})),i};const i=e("thirty-two"),r=e("bep53-range");function o(e){const t={},o=e.split("magnet:?")[1];let a;if((o&&o.length>=0?o.split("&"):[]).forEach((e=>{const n=e.split("=");if(2!==n.length)return;const i=n[0];let o=n[1];"dn"===i&&(o=decodeURIComponent(o).replace(/\+/g," ")),"tr"!==i&&"xs"!==i&&"as"!==i&&"ws"!==i||(o=decodeURIComponent(o)),"kt"===i&&(o=decodeURIComponent(o).split("+")),"ix"===i&&(o=Number(o)),"so"===i&&(o=r.parse(decodeURIComponent(o).split(","))),t[i]?(Array.isArray(t[i])||(t[i]=[t[i]]),t[i].push(o)):t[i]=o})),t.xt){(Array.isArray(t.xt)?t.xt:[t.xt]).forEach((e=>{if(a=e.match(/^urn:btih:(.{40})/))t.infoHash=a[1].toLowerCase();else if(a=e.match(/^urn:btih:(.{32})/)){const e=i.decode(a[1]);t.infoHash=n.from(e,"binary").toString("hex")}else(a=e.match(/^urn:btmh:1220(.{64})/))&&(t.infoHashV2=a[1].toLowerCase())}))}if(t.xs){(Array.isArray(t.xs)?t.xs:[t.xs]).forEach((e=>{(a=e.match(/^urn:btpk:(.{64})/))&&(t.publicKey=a[1].toLowerCase())}))}return t.infoHash&&(t.infoHashBuffer=n.from(t.infoHash,"hex")),t.infoHashV2&&(t.infoHashV2Buffer=n.from(t.infoHashV2,"hex")),t.publicKey&&(t.publicKeyBuffer=n.from(t.publicKey,"hex")),t.dn&&(t.name=t.dn),t.kt&&(t.keywords=t.kt),t.announce=[],("string"==typeof t.tr||Array.isArray(t.tr))&&(t.announce=t.announce.concat(t.tr)),t.urlList=[],("string"==typeof t.as||Array.isArray(t.as))&&(t.urlList=t.urlList.concat(t.as)),("string"==typeof t.ws||Array.isArray(t.ws))&&(t.urlList=t.urlList.concat(t.ws)),t.peerAddresses=[],("string"==typeof t["x.pe"]||Array.isArray(t["x.pe"]))&&(t.peerAddresses=t.peerAddresses.concat(t["x.pe"])),t.announce=Array.from(new Set(t.announce)),t.urlList=Array.from(new Set(t.urlList)),t.peerAddresses=Array.from(new Set(t.peerAddresses)),t}}).call(this)}).call(this,e("buffer").Buffer)},{"bep53-range":24,buffer:110,"thirty-two":448}],241:[function(e,t,n){"use strict";var i=e("inherits"),r=e("hash-base"),o=e("safe-buffer").Buffer,a=new Array(16);function s(){r.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function c(e,t){return e<<t|e>>>32-t}function l(e,t,n,i,r,o,a){return c(e+(t&n|~t&i)+r+o|0,a)+t|0}function u(e,t,n,i,r,o,a){return c(e+(t&i|n&~i)+r+o|0,a)+t|0}function p(e,t,n,i,r,o,a){return c(e+(t^n^i)+r+o|0,a)+t|0}function d(e,t,n,i,r,o,a){return c(e+(n^(t|~i))+r+o|0,a)+t|0}i(s,r),s.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var n=this._a,i=this._b,r=this._c,o=this._d;n=l(n,i,r,o,e[0],3614090360,7),o=l(o,n,i,r,e[1],3905402710,12),r=l(r,o,n,i,e[2],606105819,17),i=l(i,r,o,n,e[3],3250441966,22),n=l(n,i,r,o,e[4],4118548399,7),o=l(o,n,i,r,e[5],1200080426,12),r=l(r,o,n,i,e[6],2821735955,17),i=l(i,r,o,n,e[7],4249261313,22),n=l(n,i,r,o,e[8],1770035416,7),o=l(o,n,i,r,e[9],2336552879,12),r=l(r,o,n,i,e[10],4294925233,17),i=l(i,r,o,n,e[11],2304563134,22),n=l(n,i,r,o,e[12],1804603682,7),o=l(o,n,i,r,e[13],4254626195,12),r=l(r,o,n,i,e[14],2792965006,17),n=u(n,i=l(i,r,o,n,e[15],1236535329,22),r,o,e[1],4129170786,5),o=u(o,n,i,r,e[6],3225465664,9),r=u(r,o,n,i,e[11],643717713,14),i=u(i,r,o,n,e[0],3921069994,20),n=u(n,i,r,o,e[5],3593408605,5),o=u(o,n,i,r,e[10],38016083,9),r=u(r,o,n,i,e[15],3634488961,14),i=u(i,r,o,n,e[4],3889429448,20),n=u(n,i,r,o,e[9],568446438,5),o=u(o,n,i,r,e[14],3275163606,9),r=u(r,o,n,i,e[3],4107603335,14),i=u(i,r,o,n,e[8],1163531501,20),n=u(n,i,r,o,e[13],2850285829,5),o=u(o,n,i,r,e[2],4243563512,9),r=u(r,o,n,i,e[7],1735328473,14),n=p(n,i=u(i,r,o,n,e[12],2368359562,20),r,o,e[5],4294588738,4),o=p(o,n,i,r,e[8],2272392833,11),r=p(r,o,n,i,e[11],1839030562,16),i=p(i,r,o,n,e[14],4259657740,23),n=p(n,i,r,o,e[1],2763975236,4),o=p(o,n,i,r,e[4],1272893353,11),r=p(r,o,n,i,e[7],4139469664,16),i=Line truncated
/*! mediasource. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
t.exports=c;var n=e("inherits"),r=e("readable-stream"),o=e("to-arraybuffer"),a="undefined"!=typeof window&&window.MediaSource,s=60;function c(e,t){var i=this;if(!(i instanceof c))return new c(e,t);if(!a)throw new Error("web browser lacks MediaSource support");t||(t={}),i._debug=t.debug,i._bufferDuration=t.bufferDuration||s,i._elem=e,i._mediaSource=new a,i._streams=[],i.detailedError=null,i._errorHandler=function(){i._elem.removeEventListener("error",i._errorHandler),i._streams.slice().forEach((function(e){e.destroy(i._elem.error)}))},i._elem.addEventListener("error",i._errorHandler),i._elem.src=window.URL.createObjectURL(i._mediaSource)}function l(e,t){var i=this;if(r.Writable.call(i),i._wrapper=e,i._elem=e._elem,i._mediaSource=e._mediaSource,i._allStreams=e._streams,i._allStreams.push(i),i._bufferDuration=e._bufferDuration,i._sourceBuffer=null,i._debugBuffers=[],i._openHandler=function(){i._onSourceOpen()},i._flowHandler=function(){i._flow()},i._errorHandler=function(e){i.destroyed||i.emit("error",e)},"string"==typeof t)i._type=t,"open"===i._mediaSource.readyState?i._createSourceBuffer():i._mediaSource.addEventListener("sourceopen",i._openHandler);else if(null===t._sourceBuffer)t.destroy(),i._type=t._type,i._mediaSource.addEventListener("sourceopen",i._openHandler);else{if(!t._sourceBuffer)throw new Error("The argument to MediaElementWrapper.createWriteStream must be a string or a previous stream returned from that function");t.destroy(),i._type=t._type,i._sourceBuffer=t._sourceBuffer,i._debugBuffers=t._debugBuffers,i._sourceBuffer.addEventListener("updateend",i._flowHandler),i._sourceBuffer.addEventListener("error",i._errorHandler)}i._elem.addEventListener("timeupdate",i._flowHandler),i.on("error",(function(e){i._wrapper.error(e)})),i.on("finish",(function(){if(!i.destroyed&&(i._finished=!0,i._allStreams.every((function(e){return e._finished})))){i._wrapper._dumpDebugData();try{i._mediaSource.endOfStream()}catch(e){}}}))}c.prototype.createWriteStream=function(e){return new l(this,e)},c.prototype.error=function(e){var t=this;t.detailedError||(t.detailedError=e),t._dumpDebugData();try{t._mediaSource.endOfStream("decode")}catch(e){}try{window.URL.revokeObjectURL(t._elem.src)}catch(e){}},c.prototype._dumpDebugData=function(){var e=this;e._debug&&(e._debug=!1,e._streams.forEach((function(e,t){var i,n,r;i=e._debugBuffers,n="mediasource-stream-"+t,(r=document.createElement("a")).href=window.URL.createObjectURL(new window.Blob(i)),r.download=n,r.click()})))},n(l,r.Writable),l.prototype._onSourceOpen=function(){var e=this;e.destroyed||(e._mediaSource.removeEventListener("sourceopen",e._openHandler),e._createSourceBuffer())},l.prototype.destroy=function(e){var t=this;t.destroyed||(t.destroyed=!0,t._allStreams.splice(t._allStreams.indexOf(t),1),t._mediaSource.removeEventListener("sourceopen",t._openHandler),t._elem.removeEventListener("timeupdate",t._flowHandler),t._sourceBuffer&&(t._sourceBuffer.removeEventListener("updateend",t._flowHandler),t._sourceBuffer.removeEventListener("error",t._errorHandler),"open"===t._mediaSource.readyState&&t._sourceBuffer.abort()),e&&t.emit("error",e),t.emit("close"))},l.prototype._createSourceBuffer=function(){var e=this;if(!e.destroyed)if(a.isTypeSupported(e._type)){if(e._sourceBuffer=e._mediaSource.addSourceBuffer(e._type),e._sourceBuffer.addEventListener("updateend",e._flowHandler),e._sourceBuffer.addEventListener("error",e._errorHandler),e._cb){var t=e._cb;e._cb=null,t()}}else e.destroy(new Error("The provided type is not supported"))},l.prototype._write=function(e,t,i){var n=this;if(!n.destroyed)if(n._sourceBuffer){if(n._sourceBuffer.updating)return i(new Error("Cannot append buffer while source buffer updating"));var r=o(e);n._wrapper._debug&&n._debugBuffers.push(r);try{n._sourceBuffer.appendBuffer(r)}catch(e){return void n.destroy(e)}n._cb=i}else n._cb=function(r){if(r)return i(r);n._write(e,t,i)}},l.prototype._flow=function(){var e=this;if(!e.destroyed&&e._sourceBuffer&&!e._sourceBuffer.updating&&!("open"===e._mediaSource.readyState&&e._getBufferDuration()>e._bufferDuration)&&e._cb){var t=e._cb;e._cb=null,t()}};l.prototype._getBufferDuration=function(){for(var e=this._sourceBuffer.buffered,t=this._elem.currentTime,i=-1,n=0;n<e.length;n++){var r=e.start(n),o=e.end(n)+0;if(r>t)break;(i>=0||t<=o)&&(i=o)}var a=i-t;return a<0&&(a=0),a}},{inherits:226,"readable-stream":254,"to-arraybuffer":448}],240:[function(e,t,i){arguments[4][28][0].apply(i,arguments)},{dup:28}],241:[function(e,t,i){arguments[4][29][0].apply(i,arguments)},{"./_stream_readable":243,"./_stream_writable":245,_process:306,dup:29,inherits:226}],242:[function(e,t,i){arguments[4][30][0].apply(i,arguments)},{"./_stream_transform":244,dup:30,inherits:226}],243:[function(e,t,i){arguments[4][31][0].apply(i,arguments)},{"../errors":240,"./_stream_duplex":241,"./internal/streams/async_iterator":246,"./internal/streams/buffer_list":247,"./internal/streams/destroy":248,"./internal/streams/from":250,"./internal/streams/state"Line truncated
t.exports=c;var i=e("inherits"),r=e("readable-stream"),o=e("to-arraybuffer"),a="undefined"!=typeof window&&window.MediaSource,s=60;function c(e,t){var n=this;if(!(n instanceof c))return new c(e,t);if(!a)throw new Error("web browser lacks MediaSource support");t||(t={}),n._debug=t.debug,n._bufferDuration=t.bufferDuration||s,n._elem=e,n._mediaSource=new a,n._streams=[],n.detailedError=null,n._errorHandler=function(){n._elem.removeEventListener("error",n._errorHandler),n._streams.slice().forEach((function(e){e.destroy(n._elem.error)}))},n._elem.addEventListener("error",n._errorHandler),n._elem.src=window.URL.createObjectURL(n._mediaSource)}function l(e,t){var n=this;if(r.Writable.call(n),n._wrapper=e,n._elem=e._elem,n._mediaSource=e._mediaSource,n._allStreams=e._streams,n._allStreams.push(n),n._bufferDuration=e._bufferDuration,n._sourceBuffer=null,n._debugBuffers=[],n._openHandler=function(){n._onSourceOpen()},n._flowHandler=function(){n._flow()},n._errorHandler=function(e){n.destroyed||n.emit("error",e)},"string"==typeof t)n._type=t,"open"===n._mediaSource.readyState?n._createSourceBuffer():n._mediaSource.addEventListener("sourceopen",n._openHandler);else if(null===t._sourceBuffer)t.destroy(),n._type=t._type,n._mediaSource.addEventListener("sourceopen",n._openHandler);else{if(!t._sourceBuffer)throw new Error("The argument to MediaElementWrapper.createWriteStream must be a string or a previous stream returned from that function");t.destroy(),n._type=t._type,n._sourceBuffer=t._sourceBuffer,n._debugBuffers=t._debugBuffers,n._sourceBuffer.addEventListener("updateend",n._flowHandler),n._sourceBuffer.addEventListener("error",n._errorHandler)}n._elem.addEventListener("timeupdate",n._flowHandler),n.on("error",(function(e){n._wrapper.error(e)})),n.on("finish",(function(){if(!n.destroyed&&(n._finished=!0,n._allStreams.every((function(e){return e._finished})))){n._wrapper._dumpDebugData();try{n._mediaSource.endOfStream()}catch(e){}}}))}c.prototype.createWriteStream=function(e){return new l(this,e)},c.prototype.error=function(e){var t=this;t.detailedError||(t.detailedError=e),t._dumpDebugData();try{t._mediaSource.endOfStream("decode")}catch(e){}try{window.URL.revokeObjectURL(t._elem.src)}catch(e){}},c.prototype._dumpDebugData=function(){var e=this;e._debug&&(e._debug=!1,e._streams.forEach((function(e,t){var n,i,r;n=e._debugBuffers,i="mediasource-stream-"+t,(r=document.createElement("a")).href=window.URL.createObjectURL(new window.Blob(n)),r.download=i,r.click()})))},i(l,r.Writable),l.prototype._onSourceOpen=function(){var e=this;e.destroyed||(e._mediaSource.removeEventListener("sourceopen",e._openHandler),e._createSourceBuffer())},l.prototype.destroy=function(e){var t=this;t.destroyed||(t.destroyed=!0,t._allStreams.splice(t._allStreams.indexOf(t),1),t._mediaSource.removeEventListener("sourceopen",t._openHandler),t._elem.removeEventListener("timeupdate",t._flowHandler),t._sourceBuffer&&(t._sourceBuffer.removeEventListener("updateend",t._flowHandler),t._sourceBuffer.removeEventListener("error",t._errorHandler),"open"===t._mediaSource.readyState&&t._sourceBuffer.abort()),e&&t.emit("error",e),t.emit("close"))},l.prototype._createSourceBuffer=function(){var e=this;if(!e.destroyed)if(a.isTypeSupported(e._type)){if(e._sourceBuffer=e._mediaSource.addSourceBuffer(e._type),e._sourceBuffer.addEventListener("updateend",e._flowHandler),e._sourceBuffer.addEventListener("error",e._errorHandler),e._cb){var t=e._cb;e._cb=null,t()}}else e.destroy(new Error("The provided type is not supported"))},l.prototype._write=function(e,t,n){var i=this;if(!i.destroyed)if(i._sourceBuffer){if(i._sourceBuffer.updating)return n(new Error("Cannot append buffer while source buffer updating"));var r=o(e);i._wrapper._debug&&i._debugBuffers.push(r);try{i._sourceBuffer.appendBuffer(r)}catch(e){return void i.destroy(e)}i._cb=n}else i._cb=function(r){if(r)return n(r);i._write(e,t,n)}},l.prototype._flow=function(){var e=this;if(!e.destroyed&&e._sourceBuffer&&!e._sourceBuffer.updating&&!("open"===e._mediaSource.readyState&&e._getBufferDuration()>e._bufferDuration)&&e._cb){var t=e._cb;e._cb=null,t()}};l.prototype._getBufferDuration=function(){for(var e=this._sourceBuffer.buffered,t=this._elem.currentTime,n=-1,i=0;i<e.length;i++){var r=e.start(i),o=e.end(i)+0;if(r>t)break;(n>=0||t<=o)&&(n=o)}var a=n-t;return a<0&&(a=0),a}},{inherits:229,"readable-stream":257,"to-arraybuffer":452}],243:[function(e,t,n){arguments[4][28][0].apply(n,arguments)},{dup:28}],244:[function(e,t,n){arguments[4][29][0].apply(n,arguments)},{"./_stream_readable":246,"./_stream_writable":248,_process:309,dup:29,inherits:229}],245:[function(e,t,n){arguments[4][30][0].apply(n,arguments)},{"./_stream_transform":247,dup:30,inherits:229}],246:[function(e,t,n){arguments[4][31][0].apply(n,arguments)},{"../errors":243,"./_stream_duplex":244,"./internal/streams/async_iterator":249,"./internal/streams/buffer_list":250,"./internal/streams/destroy":251,"./internal/streams/from":253,"./internal/streams/state"Line truncated
/*!
* mime-db
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015-2022 Douglas Christopher Wilson
* MIT Licensed
*/
t.exports=e("./db.json")},{"./db.json":258}],260:[function(e,t,i){
t.exports=e("./db.json")},{"./db.json":261}],263:[function(e,t,n){
/*!
* mime-types
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/
"use strict";var n,r,o,a=e("mime-db"),s=e("path").extname,c=/^\s*([^;\s]*)(?:;|\s|$)/,l=/^text\//i;function u(e){if(!e||"string"!=typeof e)return!1;var t=c.exec(e),i=t&&a[t[1].toLowerCase()];return i&&i.charset?i.charset:!(!t||!l.test(t[1]))&&"UTF-8"}i.charset=u,i.charsets={lookup:u},i.contentType=function(e){if(!e||"string"!=typeof e)return!1;var t=-1===e.indexOf("/")?i.lookup(e):e;if(!t)return!1;if(-1===t.indexOf("charset")){var n=i.charset(t);n&&(t+="; charset="+n.toLowerCase())}return t},i.extension=function(e){if(!e||"string"!=typeof e)return!1;var t=c.exec(e),n=t&&i.extensions[t[1].toLowerCase()];if(!n||!n.length)return!1;return n[0]},i.extensions=Object.create(null),i.lookup=function(e){if(!e||"string"!=typeof e)return!1;var t=s("x."+e).toLowerCase().substr(1);if(!t)return!1;return i.types[t]||!1},i.types=Object.create(null),n=i.extensions,r=i.types,o=["nginx","apache",void 0,"iana"],Object.keys(a).forEach((function(e){var t=a[e],i=t.extensions;if(i&&i.length){n[e]=i;for(var s=0;s<i.length;s++){var c=i[s];if(r[c]){var l=o.indexOf(a[r[c]].source),u=o.indexOf(t.source);if("application/octet-stream"!==r[c]&&(l>u||l===u&&"application/"===r[c].substr(0,12)))continue}r[c]=e}}}))},{"mime-db":259,path:298}],261:[function(e,t,i){"use strict";function n(){this._types=Object.create(null),this._extensions=Object.create(null);for(let e=0;e<arguments.length;e++)this.define(arguments[e]);this.define=this.define.bind(this),this.getType=this.getType.bind(this),this.getExtension=this.getExtension.bind(this)}n.prototype.define=function(e,t){for(let i in e){let n=e[i].map((function(e){return e.toLowerCase()}));i=i.toLowerCase();for(let e=0;e<n.length;e++){const r=n[e];if("*"!==r[0]){if(!t&&r in this._types)throw new Error('Attempt to change mapping for "'+r+'" extension from "'+this._types[r]+'" to "'+i+'". Pass `force=true` to allow this, otherwise remove "'+r+'" from the list of extensions for "'+i+'".');this._types[r]=i}}if(t||!this._extensions[i]){const e=n[0];this._extensions[i]="*"!==e[0]?e:e.substr(1)}}},n.prototype.getType=function(e){let t=(e=String(e)).replace(/^.*[/\\]/,"").toLowerCase(),i=t.replace(/^.*\./,"").toLowerCase(),n=t.length<e.length;return(i.length<t.length-1||!n)&&this._types[i]||null},n.prototype.getExtension=function(e){return(e=/^\s*([^;\s]*)/.test(e)&&RegExp.$1)&&this._extensions[e.toLowerCase()]||null},t.exports=n},{}],262:[function(e,t,i){"use strict";let n=e("./Mime");t.exports=new n(e("./types/standard"),e("./types/other"))},{"./Mime":261,"./types/other":263,"./types/standard":264}],263:[function(e,t,i){t.exports={"application/prs.cww":["cww"],"application/vnd.1000minds.decision-model+xml":["1km"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.keynote":["key"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.numbers":["numbers"],"application/vnd.apple.pages":["pages"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.balsamiq.bmml+xml":["bmml"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.citationstyles.style+xml":["csl"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkpLine truncated
"use strict";var i,r,o,a=e("mime-db"),s=e("path").extname,c=/^\s*([^;\s]*)(?:;|\s|$)/,l=/^text\//i;function u(e){if(!e||"string"!=typeof e)return!1;var t=c.exec(e),n=t&&a[t[1].toLowerCase()];return n&&n.charset?n.charset:!(!t||!l.test(t[1]))&&"UTF-8"}n.charset=u,n.charsets={lookup:u},n.contentType=function(e){if(!e||"string"!=typeof e)return!1;var t=-1===e.indexOf("/")?n.lookup(e):e;if(!t)return!1;if(-1===t.indexOf("charset")){var i=n.charset(t);i&&(t+="; charset="+i.toLowerCase())}return t},n.extension=function(e){if(!e||"string"!=typeof e)return!1;var t=c.exec(e),i=t&&n.extensions[t[1].toLowerCase()];if(!i||!i.length)return!1;return i[0]},n.extensions=Object.create(null),n.lookup=function(e){if(!e||"string"!=typeof e)return!1;var t=s("x."+e).toLowerCase().substr(1);if(!t)return!1;return n.types[t]||!1},n.types=Object.create(null),i=n.extensions,r=n.types,o=["nginx","apache",void 0,"iana"],Object.keys(a).forEach((function(e){var t=a[e],n=t.extensions;if(n&&n.length){i[e]=n;for(var s=0;s<n.length;s++){var c=n[s];if(r[c]){var l=o.indexOf(a[r[c]].source),u=o.indexOf(t.source);if("application/octet-stream"!==r[c]&&(l>u||l===u&&"application/"===r[c].substr(0,12)))continue}r[c]=e}}}))},{"mime-db":262,path:301}],264:[function(e,t,n){"use strict";function i(){this._types=Object.create(null),this._extensions=Object.create(null);for(let e=0;e<arguments.length;e++)this.define(arguments[e]);this.define=this.define.bind(this),this.getType=this.getType.bind(this),this.getExtension=this.getExtension.bind(this)}i.prototype.define=function(e,t){for(let n in e){let i=e[n].map((function(e){return e.toLowerCase()}));n=n.toLowerCase();for(let e=0;e<i.length;e++){const r=i[e];if("*"!==r[0]){if(!t&&r in this._types)throw new Error('Attempt to change mapping for "'+r+'" extension from "'+this._types[r]+'" to "'+n+'". Pass `force=true` to allow this, otherwise remove "'+r+'" from the list of extensions for "'+n+'".');this._types[r]=n}}if(t||!this._extensions[n]){const e=i[0];this._extensions[n]="*"!==e[0]?e:e.substr(1)}}},i.prototype.getType=function(e){let t=(e=String(e)).replace(/^.*[/\\]/,"").toLowerCase(),n=t.replace(/^.*\./,"").toLowerCase(),i=t.length<e.length;return(n.length<t.length-1||!i)&&this._types[n]||null},i.prototype.getExtension=function(e){return(e=/^\s*([^;\s]*)/.test(e)&&RegExp.$1)&&this._extensions[e.toLowerCase()]||null},t.exports=i},{}],265:[function(e,t,n){"use strict";let i=e("./Mime");t.exports=new i(e("./types/standard"),e("./types/other"))},{"./Mime":264,"./types/other":266,"./types/standard":267}],266:[function(e,t,n){t.exports={"application/prs.cww":["cww"],"application/vnd.1000minds.decision-model+xml":["1km"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.keynote":["key"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.numbers":["numbers"],"application/vnd.apple.pages":["pages"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.balsamiq.bmml+xml":["bmml"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.citationstyles.style+xml":["csl"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkpLine truncated
/*! parse-torrent. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */
const n=e("bencode"),r=e("blob-to-buffer"),o=e("fs"),a=e("simple-get"),s=e("magnet-uri"),c=e("path"),l=e("simple-sha1"),u=e("queue-microtask");function p(e){if("string"==typeof e&&/^(stream-)?magnet:/.test(e)){const t=s(e);if(!t.infoHash)throw new Error("Invalid torrent identifier");return t}if("string"==typeof e&&(/^[a-f0-9]{40}$/i.test(e)||/^[a-z2-7]{32}$/i.test(e)))return s(`magnet:?xt=urn:btih:${e}`);if(i.isBuffer(e)&&20===e.length)return s(`magnet:?xt=urn:btih:${e.toString("hex")}`);if(i.isBuffer(e))return function(e){i.isBuffer(e)&&(e=n.decode(e));f(e.info,"info"),f(e.info["name.utf-8"]||e.info.name,"info.name"),f(e.info["piece length"],"info['piece length']"),f(e.info.pieces,"info.pieces"),e.info.files?e.info.files.forEach((e=>{f("number"==typeof e.length,"info.files[0].length"),f(e["path.utf-8"]||e.path,"info.files[0].path")})):f("number"==typeof e.info.length,"info.length");const t={info:e.info,infoBuffer:n.encode(e.info),name:(e.info["name.utf-8"]||e.info.name).toString(),announce:[]};t.infoHash=l.sync(t.infoBuffer),t.infoHashBuffer=i.from(t.infoHash,"hex"),void 0!==e.info.private&&(t.private=!!e.info.private);e["creation date"]&&(t.created=new Date(1e3*e["creation date"]));e["created by"]&&(t.createdBy=e["created by"].toString());i.isBuffer(e.comment)&&(t.comment=e.comment.toString());Array.isArray(e["announce-list"])&&e["announce-list"].length>0?e["announce-list"].forEach((e=>{e.forEach((e=>{t.announce.push(e.toString())}))})):e.announce&&t.announce.push(e.announce.toString());i.isBuffer(e["url-list"])&&(e["url-list"]=e["url-list"].length>0?[e["url-list"]]:[]);t.urlList=(e["url-list"]||[]).map((e=>e.toString())),t.announce=Array.from(new Set(t.announce)),t.urlList=Array.from(new Set(t.urlList));const r=e.info.files||[e.info];t.files=r.map(((e,i)=>{const n=[].concat(t.name,e["path.utf-8"]||e.path||[]).map((e=>e.toString()));return{path:c.join.apply(null,[c.sep].concat(n)).slice(1),name:n[n.length-1],length:e.length,offset:r.slice(0,i).reduce(d,0)}})),t.length=r.reduce(d,0);const o=t.files[t.files.length-1];return t.pieceLength=e.info["piece length"],t.lastPieceLength=(o.offset+o.length)%t.pieceLength||t.pieceLength,t.pieces=function(e){const t=[];for(let i=0;i<e.length;i+=20)t.push(e.slice(i,i+20).toString("hex"));return t}(e.info.pieces),t}(e);if(e&&e.infoHash)return e.infoHash=e.infoHash.toLowerCase(),e.announce||(e.announce=[]),"string"==typeof e.announce&&(e.announce=[e.announce]),e.urlList||(e.urlList=[]),e;throw new Error("Invalid torrent identifier")}function d(e,t){return e+t.length}function f(e,t){if(!e)throw new Error(`Torrent is missing required field: ${t}`)}t.exports=p,t.exports.remote=function e(t,i,n){if("function"==typeof i)return e(t,{},i);if("function"!=typeof n)throw new Error("second argument must be a Function");let s;try{s=p(t)}catch(e){}s&&s.infoHash?u((()=>{n(null,s)})):(c=t,"undefined"!=typeof Blob&&c instanceof Blob?r(t,((e,t)=>{if(e)return n(new Error(`Error converting Blob: ${e.message}`));l(t)})):"function"==typeof a&&/^https?:/.test(t)?(i=Object.assign({url:t,timeout:3e4,headers:{"user-agent":"WebTorrent (https://webtorrent.io)"}},i),a.concat(i,((e,t,i)=>{if(e)return n(new Error(`Error downloading torrent: ${e.message}`));l(i)}))):"function"==typeof o.readFile&&"string"==typeof t?o.readFile(t,((e,t)=>{if(e)return n(new Error("Invalid torrent identifier"));l(t)})):u((()=>{n(new Error("Invalid torrent identifier"))})));var c;function l(e){try{s=p(e)}catch(e){return n(e)}s&&s.infoHash?n(null,s):n(new Error("Invalid torrent identifier"))}},t.exports.toMagnetURI=s.encode,t.exports.toTorrentFile=function(e){const t={info:e.info};t["announce-list"]=(e.announce||[]).map((e=>(t.announce||(t.announce=e),[e=i.from(e,"utf8")]))),t["url-list"]=e.urlList||[],void 0!==e.private&&(t.private=Number(e.private));e.created&&(t["creation date"]=e.created.getTime()/1e3|0);e.createdBy&&(t["created by"]=e.createdBy);e.comment&&(t.comment=e.comment);return n.encode(t)},i.alloc(0)}).call(this)}).call(this,e("buffer").Buffer)},{bencode:22,"blob-to-buffer":47,buffer:110,fs:67,"magnet-uri":237,path:298,"queue-microtask":324,"simple-get":365,"simple-sha1":382}],298:[function(e,t,i){(function(e){(function(){"use strict";function i(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var i,n="",r=0,o=-1,a=0,s=0;s<=e.length;++s){if(s<e.length)i=e.charCodeAt(s);else{if(47===i)break;i=47}if(47===i){if(o===s-1||1===a);else if(o!==s-1&&2===a){if(n.length<2||2!==r||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var c=n.lastIndexOf("/");if(c!==n.length-1){-1===c?(n="",r=0):r=(n=n.slice(0,c)).length-1-n.lastIndexOf("/"),o=s,a=0;continue}}else if(2===n.length||1===n.length){n="",r=0,o=s,a=0;continue}t&&(n.length>0?n+="/..":n="..",r=2)}else n.length>0?n+="/"+e.slice(o+1,s):n=e.slice(o+1,s),r=s-o-1;o=s,a=0}else 46===i&&-1!==a?++a:a=-1}return n}var r={resolve:function(){for(var t,r="",o=!1,a=arguments.length-1;a>=-1Line truncated
const i=e("bencode"),r=e("blob-to-buffer"),o=e("fs"),a=e("simple-get"),s=e("magnet-uri"),c=e("path"),l=e("simple-sha1"),u=e("queue-microtask");function p(e){if("string"==typeof e&&/^(stream-)?magnet:/.test(e)){const t=s(e);if(!t.infoHash)throw new Error("Invalid torrent identifier");return t}if("string"==typeof e&&(/^[a-f0-9]{40}$/i.test(e)||/^[a-z2-7]{32}$/i.test(e)))return s(`magnet:?xt=urn:btih:${e}`);if(n.isBuffer(e)&&20===e.length)return s(`magnet:?xt=urn:btih:${e.toString("hex")}`);if(n.isBuffer(e))return function(e){n.isBuffer(e)&&(e=i.decode(e));f(e.info,"info"),f(e.info["name.utf-8"]||e.info.name,"info.name"),f(e.info["piece length"],"info['piece length']"),f(e.info.pieces,"info.pieces"),e.info.files?e.info.files.forEach((e=>{f("number"==typeof e.length,"info.files[0].length"),f(e["path.utf-8"]||e.path,"info.files[0].path")})):f("number"==typeof e.info.length,"info.length");const t={info:e.info,infoBuffer:i.encode(e.info),name:(e.info["name.utf-8"]||e.info.name).toString(),announce:[]};t.infoHash=l.sync(t.infoBuffer),t.infoHashBuffer=n.from(t.infoHash,"hex"),void 0!==e.info.private&&(t.private=!!e.info.private);e["creation date"]&&(t.created=new Date(1e3*e["creation date"]));e["created by"]&&(t.createdBy=e["created by"].toString());n.isBuffer(e.comment)&&(t.comment=e.comment.toString());Array.isArray(e["announce-list"])&&e["announce-list"].length>0?e["announce-list"].forEach((e=>{e.forEach((e=>{t.announce.push(e.toString())}))})):e.announce&&t.announce.push(e.announce.toString());n.isBuffer(e["url-list"])&&(e["url-list"]=e["url-list"].length>0?[e["url-list"]]:[]);t.urlList=(e["url-list"]||[]).map((e=>e.toString())),t.announce=Array.from(new Set(t.announce)),t.urlList=Array.from(new Set(t.urlList));const r=e.info.files||[e.info];t.files=r.map(((e,n)=>{const i=[].concat(t.name,e["path.utf-8"]||e.path||[]).map((e=>e.toString()));return{path:c.join.apply(null,[c.sep].concat(i)).slice(1),name:i[i.length-1],length:e.length,offset:r.slice(0,n).reduce(d,0)}})),t.length=r.reduce(d,0);const o=t.files[t.files.length-1];return t.pieceLength=e.info["piece length"],t.lastPieceLength=(o.offset+o.length)%t.pieceLength||t.pieceLength,t.pieces=function(e){const t=[];for(let n=0;n<e.length;n+=20)t.push(e.slice(n,n+20).toString("hex"));return t}(e.info.pieces),t}(e);if(e&&e.infoHash)return e.infoHash=e.infoHash.toLowerCase(),e.announce||(e.announce=[]),"string"==typeof e.announce&&(e.announce=[e.announce]),e.urlList||(e.urlList=[]),e;throw new Error("Invalid torrent identifier")}function d(e,t){return e+t.length}function f(e,t){if(!e)throw new Error(`Torrent is missing required field: ${t}`)}t.exports=p,t.exports.remote=function e(t,n,i){if("function"==typeof n)return e(t,{},n);if("function"!=typeof i)throw new Error("second argument must be a Function");let s;try{s=p(t)}catch(e){}s&&s.infoHash?u((()=>{i(null,s)})):(c=t,"undefined"!=typeof Blob&&c instanceof Blob?r(t,((e,t)=>{if(e)return i(new Error(`Error converting Blob: ${e.message}`));l(t)})):"function"==typeof a&&/^https?:/.test(t)?(n=Object.assign({url:t,timeout:3e4,headers:{"user-agent":"WebTorrent (https://webtorrent.io)"}},n),a.concat(n,((e,t,n)=>{if(e)return i(new Error(`Error downloading torrent: ${e.message}`));l(n)}))):"function"==typeof o.readFile&&"string"==typeof t?o.readFile(t,((e,t)=>{if(e)return i(new Error("Invalid torrent identifier"));l(t)})):u((()=>{i(new Error("Invalid torrent identifier"))})));var c;function l(e){try{s=p(e)}catch(e){return i(e)}s&&s.infoHash?i(null,s):i(new Error("Invalid torrent identifier"))}},t.exports.toMagnetURI=s.encode,t.exports.toTorrentFile=function(e){const t={info:e.info};t["announce-list"]=(e.announce||[]).map((e=>(t.announce||(t.announce=e),[e=n.from(e,"utf8")]))),t["url-list"]=e.urlList||[],void 0!==e.private&&(t.private=Number(e.private));e.created&&(t["creation date"]=e.created.getTime()/1e3|0);e.createdBy&&(t["created by"]=e.createdBy);e.comment&&(t.comment=e.comment);return i.encode(t)},n.alloc(0)}).call(this)}).call(this,e("buffer").Buffer)},{bencode:22,"blob-to-buffer":47,buffer:110,fs:67,"magnet-uri":240,path:301,"queue-microtask":327,"simple-get":369,"simple-sha1":386}],301:[function(e,t,n){(function(e){(function(){"use strict";function n(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function i(e,t){for(var n,i="",r=0,o=-1,a=0,s=0;s<=e.length;++s){if(s<e.length)n=e.charCodeAt(s);else{if(47===n)break;n=47}if(47===n){if(o===s-1||1===a);else if(o!==s-1&&2===a){if(i.length<2||2!==r||46!==i.charCodeAt(i.length-1)||46!==i.charCodeAt(i.length-2))if(i.length>2){var c=i.lastIndexOf("/");if(c!==i.length-1){-1===c?(i="",r=0):r=(i=i.slice(0,c)).length-1-i.lastIndexOf("/"),o=s,a=0;continue}}else if(2===i.length||1===i.length){i="",r=0,o=s,a=0;continue}t&&(i.length>0?i+="/..":i="..",r=2)}else i.length>0?i+="/"+e.slice(o+1,s):i=e.slice(o+1,s),r=s-o-1;o=s,a=0}else 46===n&&-1!==a?++a:a=-1}return i}var r={resolve:function(){for(var t,r="",o=!1,a=arguments.length-1;a>=-1Line truncated
/*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
let i;t.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:e):e=>(i||(i=Promise.resolve())).then(e).catch((e=>setTimeout((()=>{throw e}),0)))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],325:[function(e,t,i){t.exports="function"==typeof queueMicrotask?queueMicrotask:e=>Promise.resolve().then(e)},{}],326:[function(e,t,i){t.exports=function(e){var t=0;return function(){if(t===e.length)return null;var i=e.length-t,n=Math.random()*i|0,r=e[t+n],o=e[t];return e[t]=r,e[t+n]=o,t++,r}}},{}],327:[function(e,t,i){(function(i,n){(function(){"use strict";var r=65536,o=4294967295;var a=e("safe-buffer").Buffer,s=n.crypto||n.msCrypto;s&&s.getRandomValues?t.exports=function(e,t){if(e>o)throw new RangeError("requested too many random bytes");var n=a.allocUnsafe(e);if(e>0)if(e>r)for(var c=0;c<e;c+=r)s.getRandomValues(n.slice(c,c+r));else s.getRandomValues(n);if("function"==typeof t)return i.nextTick((function(){t(null,n)}));return n}:t.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:306,"safe-buffer":353}],328:[function(e,t,i){(function(t,n){(function(){"use strict";function r(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var o=e("safe-buffer"),a=e("randombytes"),s=o.Buffer,c=o.kMaxLength,l=n.crypto||n.msCrypto,u=Math.pow(2,32)-1;function p(e,t){if("number"!=typeof e||e!=e)throw new TypeError("offset must be a number");if(e>u||e<0)throw new TypeError("offset must be a uint32");if(e>c||e>t)throw new RangeError("offset out of range")}function d(e,t,i){if("number"!=typeof e||e!=e)throw new TypeError("size must be a number");if(e>u||e<0)throw new TypeError("size must be a uint32");if(e+t>i||e>c)throw new RangeError("buffer too small")}function f(e,i,n,r){if(t.browser){var o=e.buffer,s=new Uint8Array(o,i,n);return l.getRandomValues(s),r?void t.nextTick((function(){r(null,e)})):e}if(!r)return a(n).copy(e,i),e;a(n,(function(t,n){if(t)return r(t);n.copy(e,i),r(null,e)}))}l&&l.getRandomValues||!t.browser?(i.randomFill=function(e,t,i,r){if(!(s.isBuffer(e)||e instanceof n.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof t)r=t,t=0,i=e.length;else if("function"==typeof i)r=i,i=e.length-t;else if("function"!=typeof r)throw new TypeError('"cb" argument must be a function');return p(t,e.length),d(i,t,e.length),f(e,t,i,r)},i.randomFillSync=function(e,t,i){void 0===t&&(t=0);if(!(s.isBuffer(e)||e instanceof n.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');p(t,e.length),void 0===i&&(i=e.length-t);return d(i,t,e.length),f(e,t,i)}):(i.randomFill=r,i.randomFillSync=r)}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:306,randombytes:327,"safe-buffer":353}],329:[function(e,t,i){
let n;t.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:e):e=>(n||(n=Promise.resolve())).then(e).catch((e=>setTimeout((()=>{throw e}),0)))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],328:[function(e,t,n){t.exports="function"==typeof queueMicrotask?queueMicrotask:e=>Promise.resolve().then(e)},{}],329:[function(e,t,n){t.exports=function(e){var t=0;return function(){if(t===e.length)return null;var n=e.length-t,i=Math.random()*n|0,r=e[t+i],o=e[t];return e[t]=r,e[t+i]=o,t++,r}}},{}],330:[function(e,t,n){(function(n,i){(function(){"use strict";var r=65536,o=4294967295;var a=e("safe-buffer").Buffer,s=i.crypto||i.msCrypto;s&&s.getRandomValues?t.exports=function(e,t){if(e>o)throw new RangeError("requested too many random bytes");var i=a.allocUnsafe(e);if(e>0)if(e>r)for(var c=0;c<e;c+=r)s.getRandomValues(i.slice(c,c+r));else s.getRandomValues(i);if("function"==typeof t)return n.nextTick((function(){t(null,i)}));return i}:t.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:309,"safe-buffer":356}],331:[function(e,t,n){(function(t,i){(function(){"use strict";function r(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var o=e("safe-buffer"),a=e("randombytes"),s=o.Buffer,c=o.kMaxLength,l=i.crypto||i.msCrypto,u=Math.pow(2,32)-1;function p(e,t){if("number"!=typeof e||e!=e)throw new TypeError("offset must be a number");if(e>u||e<0)throw new TypeError("offset must be a uint32");if(e>c||e>t)throw new RangeError("offset out of range")}function d(e,t,n){if("number"!=typeof e||e!=e)throw new TypeError("size must be a number");if(e>u||e<0)throw new TypeError("size must be a uint32");if(e+t>n||e>c)throw new RangeError("buffer too small")}function f(e,n,i,r){if(t.browser){var o=e.buffer,s=new Uint8Array(o,n,i);return l.getRandomValues(s),r?void t.nextTick((function(){r(null,e)})):e}if(!r)return a(i).copy(e,n),e;a(i,(function(t,i){if(t)return r(t);i.copy(e,n),r(null,e)}))}l&&l.getRandomValues||!t.browser?(n.randomFill=function(e,t,n,r){if(!(s.isBuffer(e)||e instanceof i.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof t)r=t,t=0,n=e.length;else if("function"==typeof n)r=n,n=e.length-t;else if("function"!=typeof r)throw new TypeError('"cb" argument must be a function');return p(t,e.length),d(n,t,e.length),f(e,t,n,r)},n.randomFillSync=function(e,t,n){void 0===t&&(t=0);if(!(s.isBuffer(e)||e instanceof i.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');p(t,e.length),void 0===n&&(n=e.length-t);return d(n,t,e.length),f(e,t,n)}):(n.randomFill=r,n.randomFillSync=r)}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:309,randombytes:330,"safe-buffer":356}],332:[function(e,t,n){
/*!
* range-parser
* Copyright(c) 2012-2014 TJ Holowaychuk
* Copyright(c) 2015-2016 Douglas Christopher Wilson
* MIT Licensed
*/
"use strict";function n(e,t){return{start:e.start,end:e.end,index:t}}function r(e){return{start:e.start,end:e.end}}function o(e,t){return e.index-t.index}function a(e,t){return e.start-t.start}t.exports=function(e,t,i){if("string"!=typeof t)throw new TypeError("argument str must be a string");var s=t.indexOf("=");if(-1===s)return-2;var c=t.slice(s+1).split(","),l=[];l.type=t.slice(0,s);for(var u=0;u<c.length;u++){var p=c[u].split("-"),d=parseInt(p[0],10),f=parseInt(p[1],10);isNaN(d)?(d=e-f,f=e-1):isNaN(f)&&(f=e-1),f>e-1&&(f=e-1),isNaN(d)||isNaN(f)||d>f||d<0||l.push({start:d,end:f})}if(l.length<1)return-1;return i&&i.combine?function(e){for(var t=e.map(n).sort(a),i=0,s=1;s<t.length;s++){var c=t[s],l=t[i];c.start>l.end+1?t[++i]=c:c.end>l.end&&(l.end=c.end,l.index=Math.min(l.index,c.index))}t.length=i+1;var u=t.sort(o).map(r);return u.type=e.type,u}(l):l}},{}],330:[function(e,t,i){const{Writable:n,PassThrough:r}=e("readable-stream");t.exports=class extends n{constructor(e,t={}){super(t),this.destroyed=!1,this._queue=[],this._position=e||0,this._cb=null,this._buffer=null,this._out=null}_write(e,t,i){let n=!0;for(;;){if(this.destroyed)return;if(0===this._queue.length)return this._buffer=e,void(this._cb=i);this._buffer=null;var r=this._queue[0];const t=Math.max(r.start-this._position,0),o=r.end-this._position;if(t>=e.length)return this._position+=e.length,i(null);let a;if(o>e.length){this._position+=e.length,a=0===t?e:e.slice(t),n=r.stream.write(a)&&n;break}this._position+=o,a=0===t&&o===e.length?e:e.slice(t,o),n=r.stream.write(a)&&n,r.last&&r.stream.end(),e=e.slice(o),this._queue.shift()}n?i(null):r.stream.once("drain",i.bind(null,null))}slice(e){if(this.destroyed)return null;Array.isArray(e)||(e=[e]);const t=new r;return e.forEach(((i,n)=>{this._queue.push({start:i.start,end:i.end,stream:t,last:n===e.length-1})})),this._buffer&&this._write(this._buffer,null,this._cb),t}destroy(e){this.destroyed||(this.destroyed=!0,e&&this.emit("error",e))}}},{"readable-stream":345}],331:[function(e,t,i){arguments[4][28][0].apply(i,arguments)},{dup:28}],332:[function(e,t,i){arguments[4][29][0].apply(i,arguments)},{"./_stream_readable":334,"./_stream_writable":336,_process:306,dup:29,inherits:226}],333:[function(e,t,i){arguments[4][30][0].apply(i,arguments)},{"./_stream_transform":335,dup:30,inherits:226}],334:[function(e,t,i){arguments[4][31][0].apply(i,arguments)},{"../errors":331,"./_stream_duplex":332,"./internal/streams/async_iterator":337,"./internal/streams/buffer_list":338,"./internal/streams/destroy":339,"./internal/streams/from":341,"./internal/streams/state":343,"./internal/streams/stream":344,_process:306,buffer:110,dup:31,events:180,inherits:226,"string_decoder/":443,util:67}],335:[function(e,t,i){arguments[4][32][0].apply(i,arguments)},{"../errors":331,"./_stream_duplex":332,dup:32,inherits:226}],336:[function(e,t,i){arguments[4][33][0].apply(i,arguments)},{"../errors":331,"./_stream_duplex":332,"./internal/streams/destroy":339,"./internal/streams/state":343,"./internal/streams/stream":344,_process:306,buffer:110,dup:33,inherits:226,"util-deprecate":455}],337:[function(e,t,i){arguments[4][34][0].apply(i,arguments)},{"./end-of-stream":340,_process:306,dup:34}],338:[function(e,t,i){arguments[4][35][0].apply(i,arguments)},{buffer:110,dup:35,util:67}],339:[function(e,t,i){arguments[4][36][0].apply(i,arguments)},{_process:306,dup:36}],340:[function(e,t,i){arguments[4][37][0].apply(i,arguments)},{"../../../errors":331,dup:37}],341:[function(e,t,i){arguments[4][38][0].apply(i,arguments)},{dup:38}],342:[function(e,t,i){arguments[4][39][0].apply(i,arguments)},{"../../../errors":331,"./end-of-stream":340,dup:39}],343:[function(e,t,i){arguments[4][40][0].apply(i,arguments)},{"../../../errors":331,dup:40}],344:[function(e,t,i){arguments[4][41][0].apply(i,arguments)},{dup:41,events:180}],345:[function(e,t,i){arguments[4][42][0].apply(i,arguments)},{"./lib/_stream_duplex.js":332,"./lib/_stream_passthrough.js":333,"./lib/_stream_readable.js":334,"./lib/_stream_transform.js":335,"./lib/_stream_writable.js":336,"./lib/internal/streams/end-of-stream.js":340,"./lib/internal/streams/pipeline.js":342,dup:42}],346:[function(e,t,i){"use strict";function n(e){return parseInt(e,10)===e}function r(e){function t(t){if(void 0===t){t=new Array(e);for(var i=0;i<e;i++)t[i]=Math.floor(Math.random()*e)}else if("string"==typeof t)t=(t=""+t).split("").map((function(t){return t.charCodeAt(0)%e}));else{if(!Array.isArray(t))throw new TypeError("invalid seed key specified");if(!t.every((function(e){return"number"==typeof e&&e===(0|e)})))throw new TypeError("invalid seed key specified: not array of integers")}for(var n=t.length,r=function(){for(var t=new Array(e),i=0;i<e;i++)t[i]=i;return t}(),o=0,a=0;a<e;a++){o=(o+r[a]+t[a%n])%e;var s=r[a];r[a]=r[o],r[o]=s}return r}function i(e){this.s=t(e),this.i=0,this.j=0}return i.prototype.randomNative=function(){this.i=(this.i+1)%e,this.j=(this.j+this.s[this.i])%e;var t=this.s[this.i];return this.s[this.i]=this.s[tLine truncated
"use strict";function i(e,t){return{start:e.start,end:e.end,index:t}}function r(e){return{start:e.start,end:e.end}}function o(e,t){return e.index-t.index}function a(e,t){return e.start-t.start}t.exports=function(e,t,n){if("string"!=typeof t)throw new TypeError("argument str must be a string");var s=t.indexOf("=");if(-1===s)return-2;var c=t.slice(s+1).split(","),l=[];l.type=t.slice(0,s);for(var u=0;u<c.length;u++){var p=c[u].split("-"),d=parseInt(p[0],10),f=parseInt(p[1],10);isNaN(d)?(d=e-f,f=e-1):isNaN(f)&&(f=e-1),f>e-1&&(f=e-1),isNaN(d)||isNaN(f)||d>f||d<0||l.push({start:d,end:f})}if(l.length<1)return-1;return n&&n.combine?function(e){for(var t=e.map(i).sort(a),n=0,s=1;s<t.length;s++){var c=t[s],l=t[n];c.start>l.end+1?t[++n]=c:c.end>l.end&&(l.end=c.end,l.index=Math.min(l.index,c.index))}t.length=n+1;var u=t.sort(o).map(r);return u.type=e.type,u}(l):l}},{}],333:[function(e,t,n){const{Writable:i,PassThrough:r}=e("readable-stream");t.exports=class extends i{constructor(e,t={}){super(t),this.destroyed=!1,this._queue=[],this._position=e||0,this._cb=null,this._buffer=null,this._out=null}_write(e,t,n){let i=!0;for(;;){if(this.destroyed)return;if(0===this._queue.length)return this._buffer=e,void(this._cb=n);this._buffer=null;var r=this._queue[0];const t=Math.max(r.start-this._position,0),o=r.end-this._position;if(t>=e.length)return this._position+=e.length,n(null);let a;if(o>e.length){this._position+=e.length,a=0===t?e:e.slice(t),i=r.stream.write(a)&&i;break}this._position+=o,a=0===t&&o===e.length?e:e.slice(t,o),i=r.stream.write(a)&&i,r.last&&r.stream.end(),e=e.slice(o),this._queue.shift()}i?n(null):r.stream.once("drain",n.bind(null,null))}slice(e){if(this.destroyed)return null;Array.isArray(e)||(e=[e]);const t=new r;return e.forEach(((n,i)=>{this._queue.push({start:n.start,end:n.end,stream:t,last:i===e.length-1})})),this._buffer&&this._write(this._buffer,null,this._cb),t}destroy(e){this.destroyed||(this.destroyed=!0,e&&this.emit("error",e))}}},{"readable-stream":348}],334:[function(e,t,n){arguments[4][28][0].apply(n,arguments)},{dup:28}],335:[function(e,t,n){arguments[4][29][0].apply(n,arguments)},{"./_stream_readable":337,"./_stream_writable":339,_process:309,dup:29,inherits:229}],336:[function(e,t,n){arguments[4][30][0].apply(n,arguments)},{"./_stream_transform":338,dup:30,inherits:229}],337:[function(e,t,n){arguments[4][31][0].apply(n,arguments)},{"../errors":334,"./_stream_duplex":335,"./internal/streams/async_iterator":340,"./internal/streams/buffer_list":341,"./internal/streams/destroy":342,"./internal/streams/from":344,"./internal/streams/state":346,"./internal/streams/stream":347,_process:309,buffer:110,dup:31,events:181,inherits:229,"string_decoder/":447,util:67}],338:[function(e,t,n){arguments[4][32][0].apply(n,arguments)},{"../errors":334,"./_stream_duplex":335,dup:32,inherits:229}],339:[function(e,t,n){arguments[4][33][0].apply(n,arguments)},{"../errors":334,"./_stream_duplex":335,"./internal/streams/destroy":342,"./internal/streams/state":346,"./internal/streams/stream":347,_process:309,buffer:110,dup:33,inherits:229,"util-deprecate":459}],340:[function(e,t,n){arguments[4][34][0].apply(n,arguments)},{"./end-of-stream":343,_process:309,dup:34}],341:[function(e,t,n){arguments[4][35][0].apply(n,arguments)},{buffer:110,dup:35,util:67}],342:[function(e,t,n){arguments[4][36][0].apply(n,arguments)},{_process:309,dup:36}],343:[function(e,t,n){arguments[4][37][0].apply(n,arguments)},{"../../../errors":334,dup:37}],344:[function(e,t,n){arguments[4][38][0].apply(n,arguments)},{dup:38}],345:[function(e,t,n){arguments[4][39][0].apply(n,arguments)},{"../../../errors":334,"./end-of-stream":343,dup:39}],346:[function(e,t,n){arguments[4][40][0].apply(n,arguments)},{"../../../errors":334,dup:40}],347:[function(e,t,n){arguments[4][41][0].apply(n,arguments)},{dup:41,events:181}],348:[function(e,t,n){arguments[4][42][0].apply(n,arguments)},{"./lib/_stream_duplex.js":335,"./lib/_stream_passthrough.js":336,"./lib/_stream_readable.js":337,"./lib/_stream_transform.js":338,"./lib/_stream_writable.js":339,"./lib/internal/streams/end-of-stream.js":343,"./lib/internal/streams/pipeline.js":345,dup:42}],349:[function(e,t,n){"use strict";function i(e){return parseInt(e,10)===e}function r(e){function t(t){if(void 0===t){t=new Array(e);for(var n=0;n<e;n++)t[n]=Math.floor(Math.random()*e)}else if("string"==typeof t)t=(t=""+t).split("").map((function(t){return t.charCodeAt(0)%e}));else{if(!Array.isArray(t))throw new TypeError("invalid seed key specified");if(!t.every((function(e){return"number"==typeof e&&e===(0|e)})))throw new TypeError("invalid seed key specified: not array of integers")}for(var i=t.length,r=function(){for(var t=new Array(e),n=0;n<e;n++)t[n]=n;return t}(),o=0,a=0;a<e;a++){o=(o+r[a]+t[a%i])%e;var s=r[a];r[a]=r[o],r[o]=s}return r}function n(e){this.s=t(e),this.i=0,this.j=0}return n.prototype.randomNative=function(){this.i=(this.i+1)%e,this.j=(this.j+this.s[this.i])%e;var t=this.s[this.i];return this.s[this.i]=this.s[tLine truncated
/*! render-media. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
i.render=function(e,t,i,n){"function"==typeof i&&(n=i,i={});i||(i={});n||(n=()=>{});x(e),_(i),"string"==typeof t&&(t=document.querySelector(t));g(e,(n=>{if(t.nodeName!==n.toUpperCase()){const i=a.extname(e.name).toLowerCase();throw new Error(`Cannot render "${i}" inside a "${t.nodeName.toLowerCase()}" element, expected "${n}"`)}return"video"!==n&&"audio"!==n||w(t,i),t}),i,n)},i.append=function(e,t,i,n){"function"==typeof i&&(n=i,i={});i||(i={});n||(n=()=>{});x(e),_(i),"string"==typeof t&&(t=document.querySelector(t));if(t&&("VIDEO"===t.nodeName||"AUDIO"===t.nodeName))throw new Error("Invalid video/audio node argument. Argument must be root element that video/audio tag will be appended to.");function r(e){const i=document.createElement(e);return t.appendChild(i),i}g(e,(function(e){return"video"===e||"audio"===e?function(e){const n=r(e);return w(n,i),t.appendChild(n),n}(e):r(e)}),i,(function(e,t){e&&t&&t.remove(),n(e,t)}))},i.mime=e("./lib/mime.json");const n=e("debug")("render-media"),r=e("is-ascii"),o=e("mediasource"),a=e("path"),s=e("stream-to-blob-url"),c=e("videostream"),l=[".m4a",".m4b",".m4p",".m4v",".mp4"],u=[".m4v",".mkv",".mp4",".webm"],p=[].concat(u,[".m4a",".m4b",".m4p",".mp3"]),d=[".mov",".ogv"],f=[".aac",".oga",".ogg",".wav",".flac"],h=[".bmp",".gif",".jpeg",".jpg",".png",".svg"],m=[".css",".html",".js",".md",".pdf",".srt",".txt"],b=2e8,v="undefined"!=typeof window&&window.MediaSource;function g(e,t,i,s){const b=a.extname(e.name).toLowerCase();let g,x=0;function _(){return!("number"==typeof e.length&&e.length>i.maxBlobLength)||(n("File length too large for Blob URL approach: %d (max: %d)",e.length,i.maxBlobLength),M(new Error(`File length too large for Blob URL approach: ${e.length} (max: ${i.maxBlobLength})`)),!1)}function w(i){_()&&(g=t(i),y(e,((e,t)=>{if(e)return M(e);g.addEventListener("error",M),g.addEventListener("loadstart",k),g.addEventListener("loadedmetadata",S),g.src=t})))}function k(){if(g.removeEventListener("loadstart",k),i.autoplay){const e=g.play();void 0!==e&&e.catch(M)}}function S(){g.removeEventListener("loadedmetadata",S),s(null,g)}function E(){y(e,((e,i)=>{if(e)return M(e);".pdf"!==b?(g=t("iframe"),g.sandbox="allow-forms allow-scripts",g.src=i):(g=t("object"),g.setAttribute("typemustmatch",!0),g.setAttribute("type","application/pdf"),g.setAttribute("data",i)),s(null,g)}))}function M(t){t.message=`Error rendering file "${e.name}": ${t.message}`,n(t.message),s(t)}p.includes(b)?function(){const i=u.includes(b)?"video":"audio";v?l.includes(b)?r():s():p();function r(){n(`Use \`videostream\` package for ${e.name}`),h(),g.addEventListener("error",d),g.addEventListener("loadstart",k),g.addEventListener("loadedmetadata",S),new c(e,g)}function s(){n(`Use MediaSource API for ${e.name}`),h(),g.addEventListener("error",f),g.addEventListener("loadstart",k),g.addEventListener("loadedmetadata",S);const t=new o(g).createWriteStream(function(e){const t=a.extname(e).toLowerCase();return{".m4a":'audio/mp4; codecs="mp4a.40.5"',".m4b":'audio/mp4; codecs="mp4a.40.5"',".m4p":'audio/mp4; codecs="mp4a.40.5"',".m4v":'video/mp4; codecs="avc1.640029, mp4a.40.5"',".mkv":'video/webm; codecs="avc1.640029, mp4a.40.5"',".mp3":"audio/mpeg",".mp4":'video/mp4; codecs="avc1.640029, mp4a.40.5"',".webm":'video/webm; codecs="vorbis, vp8"'}[t]}(e.name));e.createReadStream().pipe(t),x&&(g.currentTime=x)}function p(){n(`Use Blob URL for ${e.name}`),h(),g.addEventListener("error",M),g.addEventListener("loadstart",k),g.addEventListener("loadedmetadata",S),y(e,((e,t)=>{if(e)return M(e);g.src=t,x&&(g.currentTime=x)}))}function d(e){n("videostream error: fallback to MediaSource API: %o",e.message||e),g.removeEventListener("error",d),g.removeEventListener("loadedmetadata",S),s()}function f(e){n("MediaSource API error: fallback to Blob URL: %o",e.message||e),_()&&(g.removeEventListener("error",f),g.removeEventListener("loadedmetadata",S),p())}function h(){g||(g=t(i),g.addEventListener("progress",(()=>{x=g.currentTime})))}}():d.includes(b)?w("video"):f.includes(b)?w("audio"):h.includes(b)?(g=t("img"),y(e,((t,i)=>{if(t)return M(t);g.src=i,g.alt=e.name,s(null,g)}))):m.includes(b)?E():function(){n('Unknown file extension "%s" - will attempt to render into iframe',b);let t="";function i(){r(t)?(n('File extension "%s" appears ascii, so will render.',b),E()):(n('File extension "%s" appears non-ascii, will not render.',b),s(new Error(`Unsupported file type "${b}": Cannot append to DOM`)))}e.createReadStream({start:0,end:1e3}).setEncoding("utf8").on("data",(e=>{t+=e})).on("end",i).on("error",s)}()}function y(e,t){const n=a.extname(e.name).toLowerCase();s(e.createReadStream(),i.mime[n]).then((e=>t(null,e)),(e=>t(e)))}function x(e){if(null==e)throw new Error("file cannot be null or undefined");if("string"!=typeof e.name)throw new Error("missing or invalid file.name property");if("function"!=typeof e.createReadStream)throw new Error("missing or invalid file.createReadStream property")}function _(e){null==e.autoplay&&(e.autoplay=!1),nulLine truncated
n.render=function(e,t,n,i){"function"==typeof n&&(i=n,n={});n||(n={});i||(i=()=>{});x(e),_(n),"string"==typeof t&&(t=document.querySelector(t));g(e,(i=>{if(t.nodeName!==i.toUpperCase()){const n=a.extname(e.name).toLowerCase();throw new Error(`Cannot render "${n}" inside a "${t.nodeName.toLowerCase()}" element, expected "${i}"`)}return"video"!==i&&"audio"!==i||w(t,n),t}),n,i)},n.append=function(e,t,n,i){"function"==typeof n&&(i=n,n={});n||(n={});i||(i=()=>{});x(e),_(n),"string"==typeof t&&(t=document.querySelector(t));if(t&&("VIDEO"===t.nodeName||"AUDIO"===t.nodeName))throw new Error("Invalid video/audio node argument. Argument must be root element that video/audio tag will be appended to.");function r(e){const n=document.createElement(e);return t.appendChild(n),n}g(e,(function(e){return"video"===e||"audio"===e?function(e){const i=r(e);return w(i,n),t.appendChild(i),i}(e):r(e)}),n,(function(e,t){e&&t&&t.remove(),i(e,t)}))},n.mime=e("./lib/mime.json");const i=e("debug")("render-media"),r=e("is-ascii"),o=e("mediasource"),a=e("path"),s=e("stream-to-blob-url"),c=e("videostream"),l=[".m4a",".m4b",".m4p",".m4v",".mp4"],u=[".m4v",".mkv",".mp4",".webm"],p=[].concat(u,[".m4a",".m4b",".m4p",".mp3"]),d=[".mov",".ogv"],f=[".aac",".oga",".ogg",".wav",".flac"],h=[".bmp",".gif",".jpeg",".jpg",".png",".svg"],m=[".css",".html",".js",".md",".pdf",".srt",".txt"],b=2e8,v="undefined"!=typeof window&&window.MediaSource;function g(e,t,n,s){const b=a.extname(e.name).toLowerCase();let g,x=0;function _(){return!("number"==typeof e.length&&e.length>n.maxBlobLength)||(i("File length too large for Blob URL approach: %d (max: %d)",e.length,n.maxBlobLength),M(new Error(`File length too large for Blob URL approach: ${e.length} (max: ${n.maxBlobLength})`)),!1)}function w(n){_()&&(g=t(n),y(e,((e,t)=>{if(e)return M(e);g.addEventListener("error",M),g.addEventListener("loadstart",k),g.addEventListener("loadedmetadata",S),g.src=t})))}function k(){if(g.removeEventListener("loadstart",k),n.autoplay){const e=g.play();void 0!==e&&e.catch(M)}}function S(){g.removeEventListener("loadedmetadata",S),s(null,g)}function E(){y(e,((e,n)=>{if(e)return M(e);".pdf"!==b?(g=t("iframe"),g.sandbox="allow-forms allow-scripts",g.src=n):(g=t("object"),g.setAttribute("typemustmatch",!0),g.setAttribute("type","application/pdf"),g.setAttribute("data",n)),s(null,g)}))}function M(t){t.message=`Error rendering file "${e.name}": ${t.message}`,i(t.message),s(t)}p.includes(b)?function(){const n=u.includes(b)?"video":"audio";v?l.includes(b)?r():s():p();function r(){i(`Use \`videostream\` package for ${e.name}`),h(),g.addEventListener("error",d),g.addEventListener("loadstart",k),g.addEventListener("loadedmetadata",S),new c(e,g)}function s(){i(`Use MediaSource API for ${e.name}`),h(),g.addEventListener("error",f),g.addEventListener("loadstart",k),g.addEventListener("loadedmetadata",S);const t=new o(g).createWriteStream(function(e){const t=a.extname(e).toLowerCase();return{".m4a":'audio/mp4; codecs="mp4a.40.5"',".m4b":'audio/mp4; codecs="mp4a.40.5"',".m4p":'audio/mp4; codecs="mp4a.40.5"',".m4v":'video/mp4; codecs="avc1.640029, mp4a.40.5"',".mkv":'video/webm; codecs="avc1.640029, mp4a.40.5"',".mp3":"audio/mpeg",".mp4":'video/mp4; codecs="avc1.640029, mp4a.40.5"',".webm":'video/webm; codecs="vorbis, vp8"'}[t]}(e.name));e.createReadStream().pipe(t),x&&(g.currentTime=x)}function p(){i(`Use Blob URL for ${e.name}`),h(),g.addEventListener("error",M),g.addEventListener("loadstart",k),g.addEventListener("loadedmetadata",S),y(e,((e,t)=>{if(e)return M(e);g.src=t,x&&(g.currentTime=x)}))}function d(e){i("videostream error: fallback to MediaSource API: %o",e.message||e),g.removeEventListener("error",d),g.removeEventListener("loadedmetadata",S),s()}function f(e){i("MediaSource API error: fallback to Blob URL: %o",e.message||e),_()&&(g.removeEventListener("error",f),g.removeEventListener("loadedmetadata",S),p())}function h(){g||(g=t(n),g.addEventListener("progress",(()=>{x=g.currentTime})))}}():d.includes(b)?w("video"):f.includes(b)?w("audio"):h.includes(b)?(g=t("img"),y(e,((t,n)=>{if(t)return M(t);g.src=n,g.alt=e.name,s(null,g)}))):m.includes(b)?E():function(){i('Unknown file extension "%s" - will attempt to render into iframe',b);let t="";function n(){r(t)?(i('File extension "%s" appears ascii, so will render.',b),E()):(i('File extension "%s" appears non-ascii, will not render.',b),s(new Error(`Unsupported file type "${b}": Cannot append to DOM`)))}e.createReadStream({start:0,end:1e3}).setEncoding("utf8").on("data",(e=>{t+=e})).on("end",n).on("error",s)}()}function y(e,t){const i=a.extname(e.name).toLowerCase();s(e.createReadStream(),n.mime[i]).then((e=>t(null,e)),(e=>t(e)))}function x(e){if(null==e)throw new Error("file cannot be null or undefined");if("string"!=typeof e.name)throw new Error("missing or invalid file.name property");if("function"!=typeof e.createReadStream)throw new Error("missing or invalid file.createReadStream property")}function _(e){null==e.autoplay&&(e.autoplay=!1),nulLine truncated
/*! run-parallel-limit. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
t.exports=function(e,t,i){if("number"!=typeof t)throw new Error("second argument must be a Number");let r,o,a,s,c,l,u=!0;Array.isArray(e)?(r=[],a=o=e.length):(s=Object.keys(e),r={},a=o=s.length);function p(e){function t(){i&&i(e,r),i=null}u?n(t):t()}function d(t,i,n){if(r[t]=n,i&&(c=!0),0==--a||i)p(i);else if(!c&&l<o){let t;s?(t=s[l],l+=1,e[t]((function(e,i){d(t,e,i)}))):(t=l,l+=1,e[t]((function(e,i){d(t,e,i)})))}}l=t,a?s?s.some((function(i,n){return e[i]((function(e,t){d(i,e,t)})),n===t-1})):e.some((function(e,i){return e((function(e,t){d(i,e,t)})),i===t-1})):p(null);u=!1};const n=e("queue-microtask")},{"queue-microtask":324}],351:[function(e,t,i){
t.exports=function(e,t,n){if("number"!=typeof t)throw new Error("second argument must be a Number");let r,o,a,s,c,l,u=!0;Array.isArray(e)?(r=[],a=o=e.length):(s=Object.keys(e),r={},a=o=s.length);function p(e){function t(){n&&n(e,r),n=null}u?i(t):t()}function d(t,n,i){if(r[t]=i,n&&(c=!0),0==--a||n)p(n);else if(!c&&l<o){let t;s?(t=s[l],l+=1,e[t]((function(e,n){d(t,e,n)}))):(t=l,l+=1,e[t]((function(e,n){d(t,e,n)})))}}l=t,a?s?s.some((function(n,i){return e[n]((function(e,t){d(n,e,t)})),i===t-1})):e.some((function(e,n){return e((function(e,t){d(n,e,t)})),n===t-1})):p(null);u=!1};const i=e("queue-microtask")},{"queue-microtask":327}],354:[function(e,t,n){
/*! run-parallel. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
t.exports=function(e,t){let i,r,o,a=!0;Array.isArray(e)?(i=[],r=e.length):(o=Object.keys(e),i={},r=o.length);function s(e){function r(){t&&t(e,i),t=null}a?n(r):r()}function c(e,t,n){i[e]=n,(0==--r||t)&&s(t)}r?o?o.forEach((function(t){e[t]((function(e,i){c(t,e,i)}))})):e.forEach((function(e,t){e((function(e,i){c(t,e,i)}))})):s(null);a=!1};const n=e("queue-microtask")},{"queue-microtask":324}],352:[function(e,t,i){var n,r;n="undefined"!=typeof self?self:this,r=function(){return function(e){var t={};function i(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=3)}([function(e,t,i){var n=i(5),r=i(1),o=r.toHex,a=r.ceilHeapSize,s=i(6),c=function(e){for(e+=9;e%64>0;e+=1);return e},l=function(e,t){var i=new Int32Array(e,t+320,5),n=new Int32Array(5),r=new DataView(n.buffer);return r.setInt32(0,i[0],!1),r.setInt32(4,i[1],!1),r.setInt32(8,i[2],!1),r.setInt32(12,i[3],!1),r.setInt32(16,i[4],!1),n},u=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),(t=t||65536)%64>0)throw new Error("Chunk size must be a multiple of 128 bit");this._offset=0,this._maxChunkLen=t,this._padMaxChunkLen=c(t),this._heap=new ArrayBuffer(a(this._padMaxChunkLen+320+20)),this._h32=new Int32Array(this._heap),this._h8=new Int8Array(this._heap),this._core=new n({Int32Array:Int32Array},{},this._heap)}return e.prototype._initState=function(e,t){this._offset=0;var i=new Int32Array(e,t+320,5);i[0]=1732584193,i[1]=-271733879,i[2]=-1732584194,i[3]=271733878,i[4]=-1009589776},e.prototype._padChunk=function(e,t){var i=c(e),n=new Int32Array(this._heap,0,i>>2);return function(e,t){var i=new Uint8Array(e.buffer),n=t%4,r=t-n;switch(n){case 0:i[r+3]=0;case 1:i[r+2]=0;case 2:i[r+1]=0;case 3:i[r+0]=0}for(var o=1+(t>>2);o<e.length;o++)e[o]=0}(n,e),function(e,t,i){e[t>>2]|=128<<24-(t%4<<3),e[14+(2+(t>>2)&-16)]=i/(1<<29)|0,e[15+(2+(t>>2)&-16)]=i<<3}(n,e,t),i},e.prototype._write=function(e,t,i,n){s(e,this._h8,this._h32,t,i,n||0)},e.prototype._coreCall=function(e,t,i,n,r){var o=i;this._write(e,t,i),r&&(o=this._padChunk(i,n)),this._core.hash(o,this._padMaxChunkLen)},e.prototype.rawDigest=function(e){var t=e.byteLength||e.length||e.size||0;this._initState(this._heap,this._padMaxChunkLen);var i=0,n=this._maxChunkLen;for(i=0;t>i+n;i+=n)this._coreCall(e,i,n,t,!1);return this._coreCall(e,i,t-i,t,!0),l(this._heap,this._padMaxChunkLen)},e.prototype.digest=function(e){return o(this.rawDigest(e).buffer)},e.prototype.digestFromString=function(e){return this.digest(e)},e.prototype.digestFromBuffer=function(e){return this.digest(e)},e.prototype.digestFromArrayBuffer=function(e){return this.digest(e)},e.prototype.resetState=function(){return this._initState(this._heap,this._padMaxChunkLen),this},e.prototype.append=function(e){var t=0,i=e.byteLength||e.length||e.size||0,n=this._offset%this._maxChunkLen,r=void 0;for(this._offset+=i;t<i;)r=Math.min(i-t,this._maxChunkLen-n),this._write(e,t,r,n),t+=r,(n+=r)===this._maxChunkLen&&(this._core.hash(this._maxChunkLen,this._padMaxChunkLen),n=0);return this},e.prototype.getState=function(){var e=void 0;if(this._offset%this._maxChunkLen)e=this._heap.slice(0);else{var t=new Int32Array(this._heap,this._padMaxChunkLen+320,5);e=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}return{offset:this._offset,heap:e}},e.prototype.setState=function(e){return this._offset=e.offset,20===e.heap.byteLength?new Int32Array(this._heap,this._padMaxChunkLen+320,5).set(new Int32Array(e.heap)):this._h32.set(new Int32Array(e.heap)),this},e.prototype.rawEnd=function(){var e=this._offset,t=e%this._maxChunkLen,i=this._padChunk(t,e);this._core.hash(i,this._padMaxChunkLen);var n=l(this._heap,this._padMaxChunkLen);return this._initState(this._heap,this._padMaxChunkLen),n},e.prototype.end=function(){return o(this.rawEnd().buffer)},e}();e.exports=u,e.exports._core=n},function(e,t){for(var i=new Array(256),n=0;n<256;n++)i[n]=(n<16?"0":"")+n.toString(16);e.exports.toHex=function(e){for(var t=new Uint8Array(e),n=new Array(e.byteLength),r=0;r<n.length;r++)n[r]=i[t[r]];return n.join("")},e.exports.ceilHeapSize=function(e){var t=0;if(e<=65536)return 65536;if(e<16777216)for(t=1;t<e;t<<=1);else for(t=16777216;t<e;t+=16777216);return t},e.exports.isDedicatedWorkerScope=function(e){var t="WorkerGlobalScope"in e&&e instanceof e.WorkerGlobalScope,i="SharedWorkerGlobalScope"in e&&e instanceof e.SharedWorkerGlobalScope,n="ServiceWorkerGlobalScope"in e&&e instanceof e.ServiceWorkerGlobalScope;return t&&!i&&!n}},function(e,t,i){e.exports=function(){var e=i(0),t=function(e,i,n,r,o){var a=new self.FileReader;a.onloadend=function(){if(a.erroLine truncated
t.exports=function(e,t){let n,r,o,a=!0;Array.isArray(e)?(n=[],r=e.length):(o=Object.keys(e),n={},r=o.length);function s(e){function r(){t&&t(e,n),t=null}a?i(r):r()}function c(e,t,i){n[e]=i,(0==--r||t)&&s(t)}r?o?o.forEach((function(t){e[t]((function(e,n){c(t,e,n)}))})):e.forEach((function(e,t){e((function(e,n){c(t,e,n)}))})):s(null);a=!1};const i=e("queue-microtask")},{"queue-microtask":327}],355:[function(e,t,n){var i,r;i="undefined"!=typeof self?self:this,r=function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(e,t,n){var i=n(5),r=n(1),o=r.toHex,a=r.ceilHeapSize,s=n(6),c=function(e){for(e+=9;e%64>0;e+=1);return e},l=function(e,t){var n=new Int32Array(e,t+320,5),i=new Int32Array(5),r=new DataView(i.buffer);return r.setInt32(0,n[0],!1),r.setInt32(4,n[1],!1),r.setInt32(8,n[2],!1),r.setInt32(12,n[3],!1),r.setInt32(16,n[4],!1),i},u=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),(t=t||65536)%64>0)throw new Error("Chunk size must be a multiple of 128 bit");this._offset=0,this._maxChunkLen=t,this._padMaxChunkLen=c(t),this._heap=new ArrayBuffer(a(this._padMaxChunkLen+320+20)),this._h32=new Int32Array(this._heap),this._h8=new Int8Array(this._heap),this._core=new i({Int32Array:Int32Array},{},this._heap)}return e.prototype._initState=function(e,t){this._offset=0;var n=new Int32Array(e,t+320,5);n[0]=1732584193,n[1]=-271733879,n[2]=-1732584194,n[3]=271733878,n[4]=-1009589776},e.prototype._padChunk=function(e,t){var n=c(e),i=new Int32Array(this._heap,0,n>>2);return function(e,t){var n=new Uint8Array(e.buffer),i=t%4,r=t-i;switch(i){case 0:n[r+3]=0;case 1:n[r+2]=0;case 2:n[r+1]=0;case 3:n[r+0]=0}for(var o=1+(t>>2);o<e.length;o++)e[o]=0}(i,e),function(e,t,n){e[t>>2]|=128<<24-(t%4<<3),e[14+(2+(t>>2)&-16)]=n/(1<<29)|0,e[15+(2+(t>>2)&-16)]=n<<3}(i,e,t),n},e.prototype._write=function(e,t,n,i){s(e,this._h8,this._h32,t,n,i||0)},e.prototype._coreCall=function(e,t,n,i,r){var o=n;this._write(e,t,n),r&&(o=this._padChunk(n,i)),this._core.hash(o,this._padMaxChunkLen)},e.prototype.rawDigest=function(e){var t=e.byteLength||e.length||e.size||0;this._initState(this._heap,this._padMaxChunkLen);var n=0,i=this._maxChunkLen;for(n=0;t>n+i;n+=i)this._coreCall(e,n,i,t,!1);return this._coreCall(e,n,t-n,t,!0),l(this._heap,this._padMaxChunkLen)},e.prototype.digest=function(e){return o(this.rawDigest(e).buffer)},e.prototype.digestFromString=function(e){return this.digest(e)},e.prototype.digestFromBuffer=function(e){return this.digest(e)},e.prototype.digestFromArrayBuffer=function(e){return this.digest(e)},e.prototype.resetState=function(){return this._initState(this._heap,this._padMaxChunkLen),this},e.prototype.append=function(e){var t=0,n=e.byteLength||e.length||e.size||0,i=this._offset%this._maxChunkLen,r=void 0;for(this._offset+=n;t<n;)r=Math.min(n-t,this._maxChunkLen-i),this._write(e,t,r,i),t+=r,(i+=r)===this._maxChunkLen&&(this._core.hash(this._maxChunkLen,this._padMaxChunkLen),i=0);return this},e.prototype.getState=function(){var e=void 0;if(this._offset%this._maxChunkLen)e=this._heap.slice(0);else{var t=new Int32Array(this._heap,this._padMaxChunkLen+320,5);e=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}return{offset:this._offset,heap:e}},e.prototype.setState=function(e){return this._offset=e.offset,20===e.heap.byteLength?new Int32Array(this._heap,this._padMaxChunkLen+320,5).set(new Int32Array(e.heap)):this._h32.set(new Int32Array(e.heap)),this},e.prototype.rawEnd=function(){var e=this._offset,t=e%this._maxChunkLen,n=this._padChunk(t,e);this._core.hash(n,this._padMaxChunkLen);var i=l(this._heap,this._padMaxChunkLen);return this._initState(this._heap,this._padMaxChunkLen),i},e.prototype.end=function(){return o(this.rawEnd().buffer)},e}();e.exports=u,e.exports._core=i},function(e,t){for(var n=new Array(256),i=0;i<256;i++)n[i]=(i<16?"0":"")+i.toString(16);e.exports.toHex=function(e){for(var t=new Uint8Array(e),i=new Array(e.byteLength),r=0;r<i.length;r++)i[r]=n[t[r]];return i.join("")},e.exports.ceilHeapSize=function(e){var t=0;if(e<=65536)return 65536;if(e<16777216)for(t=1;t<e;t<<=1);else for(t=16777216;t<e;t+=16777216);return t},e.exports.isDedicatedWorkerScope=function(e){var t="WorkerGlobalScope"in e&&e instanceof e.WorkerGlobalScope,n="SharedWorkerGlobalScope"in e&&e instanceof e.SharedWorkerGlobalScope,i="ServiceWorkerGlobalScope"in e&&e instanceof e.ServiceWorkerGlobalScope;return t&&!n&&!i}},function(e,t,n){e.exports=function(){var e=n(0),t=function(e,n,i,r,o){var a=new self.FileReader;a.onloadend=function(){if(a.erroLine truncated
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
var n=e("buffer"),r=n.Buffer;function o(e,t){for(var i in e)t[i]=e[i]}function a(e,t,i){return r(e,t,i)}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?t.exports=n:(o(n,i),i.Buffer=a),a.prototype=Object.create(r.prototype),o(r,a),a.from=function(e,t,i){if("number"==typeof e)throw new TypeError("Argument must not be a number");return r(e,t,i)},a.alloc=function(e,t,i){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=r(e);return void 0!==t?"string"==typeof i?n.fill(t,i):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},{buffer:110}],354:[function(e,t,i){(function(i){(function(){"use strict";var n,r=e("buffer"),o=r.Buffer,a={};for(n in r)r.hasOwnProperty(n)&&"SlowBuffer"!==n&&"Buffer"!==n&&(a[n]=r[n]);var s=a.Buffer={};for(n in o)o.hasOwnProperty(n)&&"allocUnsafe"!==n&&"allocUnsafeSlow"!==n&&(s[n]=o[n]);if(a.Buffer.prototype=o.prototype,s.from&&s.from!==Uint8Array.from||(s.from=function(e,t,i){if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof e);if(e&&void 0===e.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);return o(e,t,i)}),s.alloc||(s.alloc=function(e,t,i){if("number"!=typeof e)throw new TypeError('The "size" argument must be of type number. Received type '+typeof e);if(e<0||e>=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var n=o(e);return t&&0!==t.length?"string"==typeof i?n.fill(t,i):n.fill(t):n.fill(0),n}),!a.kStringMaxLength)try{a.kStringMaxLength=i.binding("buffer").kStringMaxLength}catch(e){}a.constants||(a.constants={MAX_LENGTH:a.kMaxLength},a.kStringMaxLength&&(a.constants.MAX_STRING_LENGTH=a.kStringMaxLength)),t.exports=a}).call(this)}).call(this,e("_process"))},{_process:306,buffer:110}],355:[function(e,t,i){var n=e("safe-buffer").Buffer;function r(e,t){this._block=n.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}r.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=n.from(e,t));for(var i=this._block,r=this._blockSize,o=e.length,a=this._len,s=0;s<o;){for(var c=a%r,l=Math.min(o-s,r-c),u=0;u<l;u++)i[c+u]=e[s+u];s+=l,(a+=l)%r==0&&this._update(i)}return this._len+=o,this},r.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var i=8*this._len;if(i<=4294967295)this._block.writeUInt32BE(i,this._blockSize-4);else{var n=(4294967295&i)>>>0,r=(i-n)/4294967296;this._block.writeUInt32BE(r,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},r.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=r},{"safe-buffer":353}],356:[function(e,t,i){(i=t.exports=function(e){e=e.toLowerCase();var t=i[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t}).sha=e("./sha"),i.sha1=e("./sha1"),i.sha224=e("./sha224"),i.sha256=e("./sha256"),i.sha384=e("./sha384"),i.sha512=e("./sha512")},{"./sha":357,"./sha1":358,"./sha224":359,"./sha256":360,"./sha384":361,"./sha512":362}],357:[function(e,t,i){var n=e("inherits"),r=e("./hash"),o=e("safe-buffer").Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function c(){this.init(),this._w=s,r.call(this,64,56)}function l(e){return e<<30|e>>>2}function u(e,t,i,n){return 0===e?t&i|~t&n:2===e?t&i|t&n|i&n:t^i^n}n(c,r),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(e){for(var t,i=this._w,n=0|this._a,r=0|this._b,o=0|this._c,s=0|this._d,c=0|this._e,p=0;p<16;++p)i[p]=e.readInt32BE(4*p);for(;p<80;++p)i[p]=i[p-3]^i[p-8]^i[p-14]^i[p-16];for(var d=0;d<80;++d){var f=~~(d/20),h=0|((t=n)<<5|t>>>27)+u(f,r,o,s)+c+i[d]+a[f];c=s,s=o,o=l(r),r=n,n=h}this._a=n+this._a|0,this._b=r+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=c},{"./hash":355,inherits:226,"safe-buffer":353}],358:[function(e,t,i){var n=e("inherits"),r=e("./hash"),o=e("safe-buffer").Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function c(){this.init(),this._w=s,r.call(this,64,56)}function l(e){return e<<5|e>>>27}function u(e){return e<<30|e>>>2}function p(e,t,i,n){return 0===e?t&i|~t&n:2===e?t&i|t&n|i&n:t^i^n}n(c,r),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._dLine truncated
var i=e("buffer"),r=i.Buffer;function o(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n){return r(e,t,n)}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?t.exports=i:(o(i,n),n.Buffer=a),a.prototype=Object.create(r.prototype),o(r,a),a.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return r(e,t,n)},a.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=r(e);return void 0!==t?"string"==typeof n?i.fill(t,n):i.fill(t):i.fill(0),i},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i.SlowBuffer(e)}},{buffer:110}],357:[function(e,t,n){(function(n){(function(){"use strict";var i,r=e("buffer"),o=r.Buffer,a={};for(i in r)r.hasOwnProperty(i)&&"SlowBuffer"!==i&&"Buffer"!==i&&(a[i]=r[i]);var s=a.Buffer={};for(i in o)o.hasOwnProperty(i)&&"allocUnsafe"!==i&&"allocUnsafeSlow"!==i&&(s[i]=o[i]);if(a.Buffer.prototype=o.prototype,s.from&&s.from!==Uint8Array.from||(s.from=function(e,t,n){if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof e);if(e&&void 0===e.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);return o(e,t,n)}),s.alloc||(s.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError('The "size" argument must be of type number. Received type '+typeof e);if(e<0||e>=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var i=o(e);return t&&0!==t.length?"string"==typeof n?i.fill(t,n):i.fill(t):i.fill(0),i}),!a.kStringMaxLength)try{a.kStringMaxLength=n.binding("buffer").kStringMaxLength}catch(e){}a.constants||(a.constants={MAX_LENGTH:a.kMaxLength},a.kStringMaxLength&&(a.constants.MAX_STRING_LENGTH=a.kStringMaxLength)),t.exports=a}).call(this)}).call(this,e("_process"))},{_process:309,buffer:110}],358:[function(e,t,n){"use strict";var i=e("get-intrinsic"),r=e("define-data-property"),o=e("has-property-descriptors")(),a=e("gopd"),s=i("%TypeError%"),c=i("%Math.floor%");t.exports=function(e,t){if("function"!=typeof e)throw new s("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||c(t)!==t)throw new s("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],i=!0,l=!0;if("length"in e&&a){var u=a(e,"length");u&&!u.configurable&&(i=!1),u&&!u.writable&&(l=!1)}return(i||l||!n)&&(o?r(e,"length",t,!0,!0):r(e,"length",t)),e}},{"define-data-property":150,"get-intrinsic":190,gopd:191,"has-property-descriptors":192}],359:[function(e,t,n){var i=e("safe-buffer").Buffer;function r(e,t){this._block=i.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}r.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=i.from(e,t));for(var n=this._block,r=this._blockSize,o=e.length,a=this._len,s=0;s<o;){for(var c=a%r,l=Math.min(o-s,r-c),u=0;u<l;u++)n[c+u]=e[s+u];s+=l,(a+=l)%r==0&&this._update(n)}return this._len+=o,this},r.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var i=(4294967295&n)>>>0,r=(n-i)/4294967296;this._block.writeUInt32BE(r,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},r.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=r},{"safe-buffer":356}],360:[function(e,t,n){(n=t.exports=function(e){e=e.toLowerCase();var t=n[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t}).sha=e("./sha"),n.sha1=e("./sha1"),n.sha224=e("./sha224"),n.sha256=e("./sha256"),n.sha384=e("./sha384"),n.sha512=e("./sha512")},{"./sha":361,"./sha1":362,"./sha224":363,"./sha256":364,"./sha384":365,"./sha512":366}],361:[function(e,t,n){var i=e("inherits"),r=e("./hash"),o=e("safe-buffer").Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function c(){this.init(),this._w=s,r.call(this,64,56)}function l(e){return e<<30|e>>>2}function u(e,t,n,i){return 0===e?t&n|~t&i:2===e?t&n|t&i|n&i:t^n^i}i(c,r),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(e){for(var t,n=this._w,i=0|this._a,r=0|this._b,o=0|this._c,s=0|this._d,c=0|this._e,p=0;p<16;++p)n[p]=e.readInt32BE(4*p);for(;p<80;++p)n[p]=n[p-3]^n[p-8]^n[p-14]^n[p-16];for(var d=0;d<80;++d){var f=~~(d/20),h=0|((t=i)<<5|t>>>27)+u(f,r,o,s)+c+n[d]+a[f];c=s,s=o,o=l(r),r=i,i=h}this._a=i+this._a|0,this._b=r+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var e=o.alloLine truncated
/*! simple-concat. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
t.exports=function(t,i){var n=[];t.on("data",(function(e){n.push(e)})),t.once("end",(function(){i&&i(null,e.concat(n)),i=null})),t.once("error",(function(e){i&&i(e),i=null}))}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:110}],365:[function(e,t,i){(function(i){(function(){
t.exports=function(t,n){var i=[];t.on("data",(function(e){i.push(e)})),t.once("end",(function(){n&&n(null,e.concat(i)),n=null})),t.once("error",(function(e){n&&n(e),n=null}))}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:110}],369:[function(e,t,n){(function(n){(function(){
/*! simple-get. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
t.exports=p;const n=e("simple-concat"),r=e("decompress-response"),o=e("http"),a=e("https"),s=e("once"),c=e("querystring"),l=e("url"),u=e=>null!==e&&"object"==typeof e&&"function"==typeof e.pipe;function p(e,t){if(e=Object.assign({maxRedirects:10},"string"==typeof e?{url:e}:e),t=s(t),e.url){const{hostname:t,port:i,protocol:n,auth:r,path:o}=l.parse(e.url);delete e.url,t||i||n||r?Object.assign(e,{hostname:t,port:i,protocol:n,auth:r,path:o}):e.path=o}const n={"accept-encoding":"gzip, deflate"};let d;e.headers&&Object.keys(e.headers).forEach((t=>n[t.toLowerCase()]=e.headers[t])),e.headers=n,e.body?d=e.json&&!u(e.body)?JSON.stringify(e.body):e.body:e.form&&(d="string"==typeof e.form?e.form:c.stringify(e.form),e.headers["content-type"]="application/x-www-form-urlencoded"),d&&(e.method||(e.method="POST"),u(d)||(e.headers["content-length"]=i.byteLength(d)),e.json&&!e.form&&(e.headers["content-type"]="application/json")),delete e.body,delete e.form,e.json&&(e.headers.accept="application/json"),e.method&&(e.method=e.method.toUpperCase());const f=e.hostname,h=("https:"===e.protocol?a:o).request(e,(i=>{if(!1!==e.followRedirects&&i.statusCode>=300&&i.statusCode<400&&i.headers.location){e.url=i.headers.location,delete e.headers.host,i.resume();const n=l.parse(e.url).hostname;return null!==n&&n!==f&&(delete e.headers.cookie,delete e.headers.authorization),"POST"===e.method&&[301,302].includes(i.statusCode)&&(e.method="GET",delete e.headers["content-length"],delete e.headers["content-type"]),0==e.maxRedirects--?t(new Error("too many redirects")):p(e,t)}const n="function"==typeof r&&"HEAD"!==e.method;t(null,n?r(i):i)}));return h.on("timeout",(()=>{h.abort(),t(new Error("Request timed out"))})),h.on("error",t),u(d)?d.on("error",t).pipe(h):h.end(d),h}p.concat=(e,t)=>p(e,((i,r)=>{if(i)return t(i);n(r,((i,n)=>{if(i)return t(i);if(e.json)try{n=JSON.parse(n.toString())}catch(i){return t(i,r,n)}t(null,r,n)}))})),["get","post","put","patch","head","delete"].forEach((e=>{p[e]=(t,i)=>("string"==typeof t&&(t={url:t}),p(Object.assign({method:e.toUpperCase()},t),i))}))}).call(this)}).call(this,e("buffer").Buffer)},{buffer:110,"decompress-response":67,http:420,https:223,once:291,querystring:323,"simple-concat":364,url:453}],366:[function(e,t,i){
t.exports=p;const i=e("simple-concat"),r=e("decompress-response"),o=e("http"),a=e("https"),s=e("once"),c=e("querystring"),l=e("url"),u=e=>null!==e&&"object"==typeof e&&"function"==typeof e.pipe;function p(e,t){if(e=Object.assign({maxRedirects:10},"string"==typeof e?{url:e}:e),t=s(t),e.url){const{hostname:t,port:n,protocol:i,auth:r,path:o}=l.parse(e.url);delete e.url,t||n||i||r?Object.assign(e,{hostname:t,port:n,protocol:i,auth:r,path:o}):e.path=o}const i={"accept-encoding":"gzip, deflate"};let d;e.headers&&Object.keys(e.headers).forEach((t=>i[t.toLowerCase()]=e.headers[t])),e.headers=i,e.body?d=e.json&&!u(e.body)?JSON.stringify(e.body):e.body:e.form&&(d="string"==typeof e.form?e.form:c.stringify(e.form),e.headers["content-type"]="application/x-www-form-urlencoded"),d&&(e.method||(e.method="POST"),u(d)||(e.headers["content-length"]=n.byteLength(d)),e.json&&!e.form&&(e.headers["content-type"]="application/json")),delete e.body,delete e.form,e.json&&(e.headers.accept="application/json"),e.method&&(e.method=e.method.toUpperCase());const f=e.hostname,h=("https:"===e.protocol?a:o).request(e,(n=>{if(!1!==e.followRedirects&&n.statusCode>=300&&n.statusCode<400&&n.headers.location){e.url=n.headers.location,delete e.headers.host,n.resume();const i=l.parse(e.url).hostname;return null!==i&&i!==f&&(delete e.headers.cookie,delete e.headers.authorization),"POST"===e.method&&[301,302].includes(n.statusCode)&&(e.method="GET",delete e.headers["content-length"],delete e.headers["content-type"]),0==e.maxRedirects--?t(new Error("too many redirects")):p(e,t)}const i="function"==typeof r&&"HEAD"!==e.method;t(null,i?r(n):n)}));return h.on("timeout",(()=>{h.abort(),t(new Error("Request timed out"))})),h.on("error",t),u(d)?d.on("error",t).pipe(h):h.end(d),h}p.concat=(e,t)=>p(e,((n,r)=>{if(n)return t(n);i(r,((n,i)=>{if(n)return t(n);if(e.json)try{i=JSON.parse(i.toString())}catch(n){return t(n,r,i)}t(null,r,i)}))})),["get","post","put","patch","head","delete"].forEach((e=>{p[e]=(t,n)=>("string"==typeof t&&(t={url:t}),p(Object.assign({method:e.toUpperCase()},t),n))}))}).call(this)}).call(this,e("buffer").Buffer)},{buffer:110,"decompress-response":67,http:424,https:226,once:294,querystring:326,"simple-concat":368,url:457}],370:[function(e,t,n){
/*! simple-peer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
const n=e("debug")("simple-peer"),r=e("get-browser-rtc"),o=e("randombytes"),a=e("readable-stream"),s=e("queue-microtask"),c=e("err-code"),{Buffer:l}=e("buffer"),u=65536;function p(e){return e.replace(/a=ice-options:trickle\s\n/g,"")}class d extends a.Duplex{constructor(e){if(super(e=Object.assign({allowHalfOpen:!1},e)),this._id=o(4).toString("hex").slice(0,7),this._debug("new peer %o",e),this.channelName=e.initiator?e.channelName||o(20).toString("hex"):null,this.initiator=e.initiator||!1,this.channelConfig=e.channelConfig||d.channelConfig,this.channelNegotiated=this.channelConfig.negotiated,this.config=Object.assign({},d.config,e.config),this.offerOptions=e.offerOptions||{},this.answerOptions=e.answerOptions||{},this.sdpTransform=e.sdpTransform||(e=>e),this.streams=e.streams||(e.stream?[e.stream]:[]),this.trickle=void 0===e.trickle||e.trickle,this.allowHalfTrickle=void 0!==e.allowHalfTrickle&&e.allowHalfTrickle,this.iceCompleteTimeout=e.iceCompleteTimeout||5e3,this.destroyed=!1,this.destroying=!1,this._connected=!1,this.remoteAddress=void 0,this.remoteFamily=void 0,this.remotePort=void 0,this.localAddress=void 0,this.localFamily=void 0,this.localPort=void 0,this._wrtc=e.wrtc&&"object"==typeof e.wrtc?e.wrtc:r(),!this._wrtc)throw"undefined"==typeof window?c(new Error("No WebRTC support: Specify `opts.wrtc` option in this environment"),"ERR_WEBRTC_SUPPORT"):c(new Error("No WebRTC support: Not a supported browser"),"ERR_WEBRTC_SUPPORT");this._pcReady=!1,this._channelReady=!1,this._iceComplete=!1,this._iceCompleteTimer=null,this._channel=null,this._pendingCandidates=[],this._isNegotiating=!1,this._firstNegotiation=!0,this._batchedNegotiation=!1,this._queuedNegotiation=!1,this._sendersAwaitingStable=[],this._senderMap=new Map,this._closingInterval=null,this._remoteTracks=[],this._remoteStreams=[],this._chunk=null,this._cb=null,this._interval=null;try{this._pc=new this._wrtc.RTCPeerConnection(this.config)}catch(e){return void this.destroy(c(e,"ERR_PC_CONSTRUCTOR"))}this._isReactNativeWebrtc="number"==typeof this._pc._peerConnectionId,this._pc.oniceconnectionstatechange=()=>{this._onIceStateChange()},this._pc.onicegatheringstatechange=()=>{this._onIceStateChange()},this._pc.onconnectionstatechange=()=>{this._onConnectionStateChange()},this._pc.onsignalingstatechange=()=>{this._onSignalingStateChange()},this._pc.onicecandidate=e=>{this._onIceCandidate(e)},"object"==typeof this._pc.peerIdentity&&this._pc.peerIdentity.catch((e=>{this.destroy(c(e,"ERR_PC_PEER_IDENTITY"))})),this.initiator||this.channelNegotiated?this._setupData({channel:this._pc.createDataChannel(this.channelName,this.channelConfig)}):this._pc.ondatachannel=e=>{this._setupData(e)},this.streams&&this.streams.forEach((e=>{this.addStream(e)})),this._pc.ontrack=e=>{this._onTrack(e)},this._debug("initial negotiation"),this._needsNegotiation(),this._onFinishBound=()=>{this._onFinish()},this.once("finish",this._onFinishBound)}get bufferSize(){return this._channel&&this._channel.bufferedAmount||0}get connected(){return this._connected&&"open"===this._channel.readyState}address(){return{port:this.localPort,family:this.localFamily,address:this.localAddress}}signal(e){if(!this.destroying){if(this.destroyed)throw c(new Error("cannot signal after peer is destroyed"),"ERR_DESTROYED");if("string"==typeof e)try{e=JSON.parse(e)}catch(t){e={}}this._debug("signal()"),e.renegotiate&&this.initiator&&(this._debug("got request to renegotiate"),this._needsNegotiation()),e.transceiverRequest&&this.initiator&&(this._debug("got request for transceiver"),this.addTransceiver(e.transceiverRequest.kind,e.transceiverRequest.init)),e.candidate&&(this._pc.remoteDescription&&this._pc.remoteDescription.type?this._addIceCandidate(e.candidate):this._pendingCandidates.push(e.candidate)),e.sdp&&this._pc.setRemoteDescription(new this._wrtc.RTCSessionDescription(e)).then((()=>{this.destroyed||(this._pendingCandidates.forEach((e=>{this._addIceCandidate(e)})),this._pendingCandidates=[],"offer"===this._pc.remoteDescription.type&&this._createAnswer())})).catch((e=>{this.destroy(c(e,"ERR_SET_REMOTE_DESCRIPTION"))})),e.sdp||e.candidate||e.renegotiate||e.transceiverRequest||this.destroy(c(new Error("signal() called with invalid signal data"),"ERR_SIGNALING"))}}_addIceCandidate(e){const t=new this._wrtc.RTCIceCandidate(e);this._pc.addIceCandidate(t).catch((e=>{var i;!t.address||t.address.endsWith(".local")?(i="Ignoring unsupported ICE candidate.",console.warn(i)):this.destroy(c(e,"ERR_ADD_ICE_CANDIDATE"))}))}send(e){if(!this.destroying){if(this.destroyed)throw c(new Error("cannot send after peer is destroyed"),"ERR_DESTROYED");this._channel.send(e)}}addTransceiver(e,t){if(!this.destroying){if(this.destroyed)throw c(new Error("cannot addTransceiver after peer is destroyed"),"ERR_DESTROYED");if(this._debug("addTransceiver()"),this.initiator)try{this._pc.addTransceiver(e,t),this._needsNegotiation()}catch(e){this.destroy(c(e,"ERR_ADD_TRANSCEIVER"))}else this.emit("signal",{type:"transceiverRequest",transLine truncated
const i=e("debug")("simple-peer"),r=e("get-browser-rtc"),o=e("randombytes"),a=e("readable-stream"),s=e("queue-microtask"),c=e("err-code"),{Buffer:l}=e("buffer"),u=65536;function p(e){return e.replace(/a=ice-options:trickle\s\n/g,"")}class d extends a.Duplex{constructor(e){if(super(e=Object.assign({allowHalfOpen:!1},e)),this._id=o(4).toString("hex").slice(0,7),this._debug("new peer %o",e),this.channelName=e.initiator?e.channelName||o(20).toString("hex"):null,this.initiator=e.initiator||!1,this.channelConfig=e.channelConfig||d.channelConfig,this.channelNegotiated=this.channelConfig.negotiated,this.config=Object.assign({},d.config,e.config),this.offerOptions=e.offerOptions||{},this.answerOptions=e.answerOptions||{},this.sdpTransform=e.sdpTransform||(e=>e),this.streams=e.streams||(e.stream?[e.stream]:[]),this.trickle=void 0===e.trickle||e.trickle,this.allowHalfTrickle=void 0!==e.allowHalfTrickle&&e.allowHalfTrickle,this.iceCompleteTimeout=e.iceCompleteTimeout||5e3,this.destroyed=!1,this.destroying=!1,this._connected=!1,this.remoteAddress=void 0,this.remoteFamily=void 0,this.remotePort=void 0,this.localAddress=void 0,this.localFamily=void 0,this.localPort=void 0,this._wrtc=e.wrtc&&"object"==typeof e.wrtc?e.wrtc:r(),!this._wrtc)throw"undefined"==typeof window?c(new Error("No WebRTC support: Specify `opts.wrtc` option in this environment"),"ERR_WEBRTC_SUPPORT"):c(new Error("No WebRTC support: Not a supported browser"),"ERR_WEBRTC_SUPPORT");this._pcReady=!1,this._channelReady=!1,this._iceComplete=!1,this._iceCompleteTimer=null,this._channel=null,this._pendingCandidates=[],this._isNegotiating=!1,this._firstNegotiation=!0,this._batchedNegotiation=!1,this._queuedNegotiation=!1,this._sendersAwaitingStable=[],this._senderMap=new Map,this._closingInterval=null,this._remoteTracks=[],this._remoteStreams=[],this._chunk=null,this._cb=null,this._interval=null;try{this._pc=new this._wrtc.RTCPeerConnection(this.config)}catch(e){return void this.destroy(c(e,"ERR_PC_CONSTRUCTOR"))}this._isReactNativeWebrtc="number"==typeof this._pc._peerConnectionId,this._pc.oniceconnectionstatechange=()=>{this._onIceStateChange()},this._pc.onicegatheringstatechange=()=>{this._onIceStateChange()},this._pc.onconnectionstatechange=()=>{this._onConnectionStateChange()},this._pc.onsignalingstatechange=()=>{this._onSignalingStateChange()},this._pc.onicecandidate=e=>{this._onIceCandidate(e)},"object"==typeof this._pc.peerIdentity&&this._pc.peerIdentity.catch((e=>{this.destroy(c(e,"ERR_PC_PEER_IDENTITY"))})),this.initiator||this.channelNegotiated?this._setupData({channel:this._pc.createDataChannel(this.channelName,this.channelConfig)}):this._pc.ondatachannel=e=>{this._setupData(e)},this.streams&&this.streams.forEach((e=>{this.addStream(e)})),this._pc.ontrack=e=>{this._onTrack(e)},this._debug("initial negotiation"),this._needsNegotiation(),this._onFinishBound=()=>{this._onFinish()},this.once("finish",this._onFinishBound)}get bufferSize(){return this._channel&&this._channel.bufferedAmount||0}get connected(){return this._connected&&"open"===this._channel.readyState}address(){return{port:this.localPort,family:this.localFamily,address:this.localAddress}}signal(e){if(!this.destroying){if(this.destroyed)throw c(new Error("cannot signal after peer is destroyed"),"ERR_DESTROYED");if("string"==typeof e)try{e=JSON.parse(e)}catch(t){e={}}this._debug("signal()"),e.renegotiate&&this.initiator&&(this._debug("got request to renegotiate"),this._needsNegotiation()),e.transceiverRequest&&this.initiator&&(this._debug("got request for transceiver"),this.addTransceiver(e.transceiverRequest.kind,e.transceiverRequest.init)),e.candidate&&(this._pc.remoteDescription&&this._pc.remoteDescription.type?this._addIceCandidate(e.candidate):this._pendingCandidates.push(e.candidate)),e.sdp&&this._pc.setRemoteDescription(new this._wrtc.RTCSessionDescription(e)).then((()=>{this.destroyed||(this._pendingCandidates.forEach((e=>{this._addIceCandidate(e)})),this._pendingCandidates=[],"offer"===this._pc.remoteDescription.type&&this._createAnswer())})).catch((e=>{this.destroy(c(e,"ERR_SET_REMOTE_DESCRIPTION"))})),e.sdp||e.candidate||e.renegotiate||e.transceiverRequest||this.destroy(c(new Error("signal() called with invalid signal data"),"ERR_SIGNALING"))}}_addIceCandidate(e){const t=new this._wrtc.RTCIceCandidate(e);this._pc.addIceCandidate(t).catch((e=>{var n;!t.address||t.address.endsWith(".local")?(n="Ignoring unsupported ICE candidate.",console.warn(n)):this.destroy(c(e,"ERR_ADD_ICE_CANDIDATE"))}))}send(e){if(!this.destroying){if(this.destroyed)throw c(new Error("cannot send after peer is destroyed"),"ERR_DESTROYED");this._channel.send(e)}}addTransceiver(e,t){if(!this.destroying){if(this.destroyed)throw c(new Error("cannot addTransceiver after peer is destroyed"),"ERR_DESTROYED");if(this._debug("addTransceiver()"),this.initiator)try{this._pc.addTransceiver(e,t),this._needsNegotiation()}catch(e){this.destroy(c(e,"ERR_ADD_TRANSCEIVER"))}else this.emit("signal",{type:"transceiverRequest",transLine truncated
/*! simple-websocket. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
const n=e("debug")("simple-websocket"),r=e("randombytes"),o=e("readable-stream"),a=e("queue-microtask"),s=e("ws"),c="function"!=typeof s?WebSocket:s;class l extends o.Duplex{constructor(e={}){if("string"==typeof e&&(e={url:e}),super(e=Object.assign({allowHalfOpen:!1},e)),null==e.url&&null==e.socket)throw new Error("Missing required `url` or `socket` option");if(null!=e.url&&null!=e.socket)throw new Error("Must specify either `url` or `socket` option, not both");if(this._id=r(4).toString("hex").slice(0,7),this._debug("new websocket: %o",e),this.connected=!1,this.destroyed=!1,this._chunk=null,this._cb=null,this._interval=null,e.socket)this.url=e.socket.url,this._ws=e.socket,this.connected=e.socket.readyState===c.OPEN;else{this.url=e.url;try{this._ws="function"==typeof s?new c(e.url,null,{...e,encoding:void 0}):new c(e.url)}catch(e){return void a((()=>this.destroy(e)))}}this._ws.binaryType="arraybuffer",e.socket&&this.connected?a((()=>this._handleOpen())):this._ws.onopen=()=>this._handleOpen(),this._ws.onmessage=e=>this._handleMessage(e),this._ws.onclose=()=>this._handleClose(),this._ws.onerror=e=>this._handleError(e),this._handleFinishBound=()=>this._handleFinish(),this.once("finish",this._handleFinishBound)}send(e){this._ws.send(e)}destroy(e){this._destroy(e,(()=>{}))}_destroy(e,t){if(!this.destroyed){if(this._debug("destroy (error: %s)",e&&(e.message||e)),this.readable=this.writable=!1,this._readableState.ended||this.push(null),this._writableState.finished||this.end(),this.connected=!1,this.destroyed=!0,clearInterval(this._interval),this._interval=null,this._chunk=null,this._cb=null,this._handleFinishBound&&this.removeListener("finish",this._handleFinishBound),this._handleFinishBound=null,this._ws){const t=this._ws,i=()=>{t.onclose=null};if(t.readyState===c.CLOSED)i();else try{t.onclose=i,t.close()}catch(e){i()}t.onopen=null,t.onmessage=null,t.onerror=()=>{}}this._ws=null,e&&this.emit("error",e),this.emit("close"),t()}}_read(){}_write(e,t,i){if(this.destroyed)return i(new Error("cannot write after socket is destroyed"));if(this.connected){try{this.send(e)}catch(e){return this.destroy(e)}"function"!=typeof s&&this._ws.bufferedAmount>65536?(this._debug("start backpressure: bufferedAmount %d",this._ws.bufferedAmount),this._cb=i):i(null)}else this._debug("write before connect"),this._chunk=e,this._cb=i}_handleOpen(){if(!this.connected&&!this.destroyed){if(this.connected=!0,this._chunk){try{this.send(this._chunk)}catch(e){return this.destroy(e)}this._chunk=null,this._debug('sent chunk from "write before connect"');const e=this._cb;this._cb=null,e(null)}"function"!=typeof s&&(this._interval=setInterval((()=>this._onInterval()),150),this._interval.unref&&this._interval.unref()),this._debug("connect"),this.emit("connect")}}_handleMessage(e){if(this.destroyed)return;let t=e.data;t instanceof ArrayBuffer&&(t=i.from(t)),this.push(t)}_handleClose(){this.destroyed||(this._debug("on close"),this.destroy())}_handleError(e){this.destroy(new Error(`Error connecting to ${this.url}`))}_handleFinish(){if(this.destroyed)return;const e=()=>{setTimeout((()=>this.destroy()),1e3)};this.connected?e():this.once("connect",e)}_onInterval(){if(!this._cb||!this._ws||this._ws.bufferedAmount>65536)return;this._debug("ending backpressure: bufferedAmount %d",this._ws.bufferedAmount);const e=this._cb;this._cb=null,e(null)}_debug(){const e=[].slice.call(arguments);e[0]="["+this._id+"] "+e[0],n.apply(null,e)}}l.WEBSOCKET_SUPPORT=!!c,t.exports=l}).call(this)}).call(this,e("buffer").Buffer)},{buffer:110,debug:148,"queue-microtask":324,randombytes:327,"readable-stream":399,ws:67}],385:[function(e,t,i){arguments[4][28][0].apply(i,arguments)},{dup:28}],386:[function(e,t,i){arguments[4][29][0].apply(i,arguments)},{"./_stream_readable":388,"./_stream_writable":390,_process:306,dup:29,inherits:226}],387:[function(e,t,i){arguments[4][30][0].apply(i,arguments)},{"./_stream_transform":389,dup:30,inherits:226}],388:[function(e,t,i){arguments[4][31][0].apply(i,arguments)},{"../errors":385,"./_stream_duplex":386,"./internal/streams/async_iterator":391,"./internal/streams/buffer_list":392,"./internal/streams/destroy":393,"./internal/streams/from":395,"./internal/streams/state":397,"./internal/streams/stream":398,_process:306,buffer:110,dup:31,events:180,inherits:226,"string_decoder/":443,util:67}],389:[function(e,t,i){arguments[4][32][0].apply(i,arguments)},{"../errors":385,"./_stream_duplex":386,dup:32,inherits:226}],390:[function(e,t,i){arguments[4][33][0].apply(i,arguments)},{"../errors":385,"./_stream_duplex":386,"./internal/streams/destroy":393,"./internal/streams/state":397,"./internal/streams/stream":398,_process:306,buffer:110,dup:33,inherits:226,"util-deprecate":455}],391:[function(e,t,i){arguments[4][34][0].apply(i,arguments)},{"./end-of-stream":394,_process:306,dup:34}],392:[function(e,t,i){arguments[4][35][0].apply(i,arguments)},{buffer:110,dup:35,util:67}],393:[function(e,t,i){arguments[4][36][0].apply(i,arguments)},{_process:306,dup:36}],394:[fLine truncated
const i=e("debug")("simple-websocket"),r=e("randombytes"),o=e("readable-stream"),a=e("queue-microtask"),s=e("ws"),c="function"!=typeof s?WebSocket:s;class l extends o.Duplex{constructor(e={}){if("string"==typeof e&&(e={url:e}),super(e=Object.assign({allowHalfOpen:!1},e)),null==e.url&&null==e.socket)throw new Error("Missing required `url` or `socket` option");if(null!=e.url&&null!=e.socket)throw new Error("Must specify either `url` or `socket` option, not both");if(this._id=r(4).toString("hex").slice(0,7),this._debug("new websocket: %o",e),this.connected=!1,this.destroyed=!1,this._chunk=null,this._cb=null,this._interval=null,e.socket)this.url=e.socket.url,this._ws=e.socket,this.connected=e.socket.readyState===c.OPEN;else{this.url=e.url;try{this._ws="function"==typeof s?new c(e.url,null,{...e,encoding:void 0}):new c(e.url)}catch(e){return void a((()=>this.destroy(e)))}}this._ws.binaryType="arraybuffer",e.socket&&this.connected?a((()=>this._handleOpen())):this._ws.onopen=()=>this._handleOpen(),this._ws.onmessage=e=>this._handleMessage(e),this._ws.onclose=()=>this._handleClose(),this._ws.onerror=e=>this._handleError(e),this._handleFinishBound=()=>this._handleFinish(),this.once("finish",this._handleFinishBound)}send(e){this._ws.send(e)}destroy(e){this._destroy(e,(()=>{}))}_destroy(e,t){if(!this.destroyed){if(this._debug("destroy (error: %s)",e&&(e.message||e)),this.readable=this.writable=!1,this._readableState.ended||this.push(null),this._writableState.finished||this.end(),this.connected=!1,this.destroyed=!0,clearInterval(this._interval),this._interval=null,this._chunk=null,this._cb=null,this._handleFinishBound&&this.removeListener("finish",this._handleFinishBound),this._handleFinishBound=null,this._ws){const t=this._ws,n=()=>{t.onclose=null};if(t.readyState===c.CLOSED)n();else try{t.onclose=n,t.close()}catch(e){n()}t.onopen=null,t.onmessage=null,t.onerror=()=>{}}this._ws=null,e&&this.emit("error",e),this.emit("close"),t()}}_read(){}_write(e,t,n){if(this.destroyed)return n(new Error("cannot write after socket is destroyed"));if(this.connected){try{this.send(e)}catch(e){return this.destroy(e)}"function"!=typeof s&&this._ws.bufferedAmount>65536?(this._debug("start backpressure: bufferedAmount %d",this._ws.bufferedAmount),this._cb=n):n(null)}else this._debug("write before connect"),this._chunk=e,this._cb=n}_handleOpen(){if(!this.connected&&!this.destroyed){if(this.connected=!0,this._chunk){try{this.send(this._chunk)}catch(e){return this.destroy(e)}this._chunk=null,this._debug('sent chunk from "write before connect"');const e=this._cb;this._cb=null,e(null)}"function"!=typeof s&&(this._interval=setInterval((()=>this._onInterval()),150),this._interval.unref&&this._interval.unref()),this._debug("connect"),this.emit("connect")}}_handleMessage(e){if(this.destroyed)return;let t=e.data;t instanceof ArrayBuffer&&(t=n.from(t)),this.push(t)}_handleClose(){this.destroyed||(this._debug("on close"),this.destroy())}_handleError(e){this.destroy(new Error(`Error connecting to ${this.url}`))}_handleFinish(){if(this.destroyed)return;const e=()=>{setTimeout((()=>this.destroy()),1e3)};this.connected?e():this.once("connect",e)}_onInterval(){if(!this._cb||!this._ws||this._ws.bufferedAmount>65536)return;this._debug("ending backpressure: bufferedAmount %d",this._ws.bufferedAmount);const e=this._cb;this._cb=null,e(null)}_debug(){const e=[].slice.call(arguments);e[0]="["+this._id+"] "+e[0],i.apply(null,e)}}l.WEBSOCKET_SUPPORT=!!c,t.exports=l}).call(this)}).call(this,e("buffer").Buffer)},{buffer:110,debug:148,"queue-microtask":327,randombytes:330,"readable-stream":403,ws:67}],389:[function(e,t,n){arguments[4][28][0].apply(n,arguments)},{dup:28}],390:[function(e,t,n){arguments[4][29][0].apply(n,arguments)},{"./_stream_readable":392,"./_stream_writable":394,_process:309,dup:29,inherits:229}],391:[function(e,t,n){arguments[4][30][0].apply(n,arguments)},{"./_stream_transform":393,dup:30,inherits:229}],392:[function(e,t,n){arguments[4][31][0].apply(n,arguments)},{"../errors":389,"./_stream_duplex":390,"./internal/streams/async_iterator":395,"./internal/streams/buffer_list":396,"./internal/streams/destroy":397,"./internal/streams/from":399,"./internal/streams/state":401,"./internal/streams/stream":402,_process:309,buffer:110,dup:31,events:181,inherits:229,"string_decoder/":447,util:67}],393:[function(e,t,n){arguments[4][32][0].apply(n,arguments)},{"../errors":389,"./_stream_duplex":390,dup:32,inherits:229}],394:[function(e,t,n){arguments[4][33][0].apply(n,arguments)},{"../errors":389,"./_stream_duplex":390,"./internal/streams/destroy":397,"./internal/streams/state":401,"./internal/streams/stream":402,_process:309,buffer:110,dup:33,inherits:229,"util-deprecate":459}],395:[function(e,t,n){arguments[4][34][0].apply(n,arguments)},{"./end-of-stream":398,_process:309,dup:34}],396:[function(e,t,n){arguments[4][35][0].apply(n,arguments)},{buffer:110,dup:35,util:67}],397:[function(e,t,n){arguments[4][36][0].apply(n,arguments)},{_process:309,dup:36}],398:[fLine truncated
/*! stream-to-blob-url. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
t.exports=async function(e,t){const i=await n(e,t);return URL.createObjectURL(i)};const n=e("stream-to-blob")},{"stream-to-blob":440}],440:[function(e,t,i){
t.exports=async function(e,t){const n=await i(e,t);return URL.createObjectURL(n)};const i=e("stream-to-blob")},{"stream-to-blob":444}],444:[function(e,t,n){
/*! stream-to-blob. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
t.exports=function(e,t){if(null!=t&&"string"!=typeof t)throw new Error("Invalid mimetype, expected string.");return new Promise(((i,n)=>{const r=[];e.on("data",(e=>r.push(e))).once("end",(()=>{const e=null!=t?new Blob(r,{type:t}):new Blob(r);i(e)})).once("error",n)}))}},{}],441:[function(e,t,i){(function(i){(function(){
t.exports=function(e,t){if(null!=t&&"string"!=typeof t)throw new Error("Invalid mimetype, expected string.");return new Promise(((n,i)=>{const r=[];e.on("data",(e=>r.push(e))).once("end",(()=>{const e=null!=t?new Blob(r,{type:t}):new Blob(r);n(e)})).once("error",i)}))}},{}],445:[function(e,t,n){(function(n){(function(){
/*! stream-with-known-length-to-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
var n=e("once");t.exports=function(e,t,r){r=n(r);var o=i.alloc(t),a=0;e.on("data",(function(e){e.copy(o,a),a+=e.length})).on("end",(function(){r(null,o)})).on("error",r)}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:110,once:291}],442:[function(e,t,i){const{EventEmitter:n}=e("events"),r=new Error("Stream was destroyed"),o=new Error("Premature close"),a=e("queue-tick"),s=e("fast-fifo"),c=134217727,l=1^c,u=64,p=128,d=256,f=1024,h=2048,m=4096,b=8192,v=16384,g=32768,y=768^c,x=134184959,_=1<<17,w=2<<17,k=4<<17,S=8<<17,E=16<<17,M=32<<17,A=64<<17,j=128<<17,I=256<<17,T=512<<17,C=100532223,B=133693439,R=117440511,O=131088,P=134086639,L=4210688,U=14,q=15,N=4210702,D=16809984,z=16809999,H=1179648,F=1179663,W=Symbol.asyncIterator||Symbol("asyncIterator");class V{constructor(e,{highWaterMark:t=16384,map:i=null,mapWritable:n,byteLength:r,byteLengthWritable:o}={}){this.stream=e,this.queue=new s,this.highWaterMark=t,this.buffered=0,this.error=null,this.pipeline=null,this.drains=null,this.byteLength=o||r||de,this.map=n||i,this.afterWrite=Z.bind(this),this.afterUpdateNextTick=te.bind(this)}get ended(){return 0!=(this.stream._duplexState&M)}push(e){return null!==this.map&&(e=this.map(e)),this.buffered+=this.byteLength(e),this.queue.push(e),this.buffered<this.highWaterMark?(this.stream._duplexState|=S,!0):(this.stream._duplexState|=3145728,!1)}shift(){const e=this.queue.shift();return this.buffered-=this.byteLength(e),0===this.buffered&&(this.stream._duplexState&=133169151),e}end(e){"function"==typeof e?this.stream.once("finish",e):null!=e&&this.push(e),this.stream._duplexState=(this.stream._duplexState|T)&B}autoBatch(e,t){const i=[],n=this.stream;for(i.push(e);(n._duplexState&F)===H;)i.push(n._writableState.shift());if(0!=(n._duplexState&q))return t(null);n._writev(i,t)}update(){const e=this.stream;e._duplexState|=w;do{for(;(e._duplexState&F)===S;){const t=this.shift();e._duplexState|=33685504,e._write(t,this.afterWrite)}0==(655360&e._duplexState)&&this.updateNonPrimary()}while(!0===this.continueUpdate());e._duplexState&=133955583}updateNonPrimary(){const e=this.stream;if((72482831&e._duplexState)===T)return e._duplexState=67108863&(e._duplexState|_),void e._final(Y.bind(this));4!=(e._duplexState&U)?1==(e._duplexState&z)&&(e._duplexState=(e._duplexState|O)&l,e._open(ie.bind(this))):0==(e._duplexState&D)&&(e._duplexState|=O,e._destroy(J.bind(this)))}continueUpdate(){return 0!=(this.stream._duplexState&j)&&(this.stream._duplexState&=R,!0)}updateCallback(){(17563663&this.stream._duplexState)===k?this.update():this.updateNextTick()}updateNextTick(){0==(this.stream._duplexState&j)&&(this.stream._duplexState|=j,0==(this.stream._duplexState&w)&&a(this.afterUpdateNextTick))}}class K{constructor(e,{highWaterMark:t=16384,map:i=null,mapReadable:n,byteLength:r,byteLengthReadable:o}={}){this.stream=e,this.queue=new s,this.highWaterMark=t,this.buffered=0,this.error=null,this.pipeline=null,this.byteLength=o||r||de,this.map=n||i,this.pipeTo=null,this.afterRead=Q.bind(this),this.afterUpdateNextTick=ee.bind(this)}get ended(){return 0!=(this.stream._duplexState&v)}pipe(e,t){if(null!==this.pipeTo)throw new Error("Can only pipe to one destination");if("function"!=typeof t&&(t=null),this.stream._duplexState|=512,this.pipeTo=e,this.pipeline=new G(this.stream,e,t),t&&this.stream.on("error",fe),pe(e))e._writableState.pipeline=this.pipeline,t&&e.on("error",fe),e.on("finish",this.pipeline.finished.bind(this.pipeline));else{const t=this.pipeline.done.bind(this.pipeline,e),i=this.pipeline.done.bind(this.pipeline,e,null);e.on("error",t),e.on("close",i),e.on("finish",this.pipeline.finished.bind(this.pipeline))}e.on("drain",X.bind(this)),this.stream.emit("piping",e),e.emit("pipe",this.stream)}push(e){const t=this.stream;return null===e?(this.highWaterMark=0,t._duplexState=134152127&(t._duplexState|f),!1):(null!==this.map&&(e=this.map(e)),this.buffered+=this.byteLength(e),this.queue.push(e),t._duplexState=134152191&(t._duplexState|p),this.buffered<this.highWaterMark)}shift(){const e=this.queue.shift();return this.buffered-=this.byteLength(e),0===this.buffered&&(this.stream._duplexState&=134209407),e}unshift(e){const t=[null!==this.map?this.map(e):e];for(;this.buffered>0;)t.push(this.shift());for(let e=0;e<t.length-1;e++){const i=t[e];this.buffered+=this.byteLength(i),this.queue.push(i)}this.push(t[t.length-1])}read(){const e=this.stream;if((16527&e._duplexState)===p){const t=this.shift();return null!==this.pipeTo&&!1===this.pipeTo.write(t)&&(e._duplexState&=y),0!=(e._duplexState&h)&&e.emit("data",t),t}return null}drain(){const e=this.stream;for(;(16527&e._duplexState)===p&&0!=(768&e._duplexState);){const t=this.shift();null!==this.pipeTo&&!1===this.pipeTo.write(t)&&(e._duplexState&=y),0!=(e._duplexState&h)&&e.emit("data",t)}}update(){const e=this.stream;e._duplexState|=32;do{for(this.drain();this.buffered<this.highWaterMark&&0==(82975&e._duplexState);)e._duplexState|=65552,e._read(this.afterRead),this.drain();4224==(12431&e._duplexState)&&(e._dupleLine truncated
var i=e("once");t.exports=function(e,t,r){r=i(r);var o=n.alloc(t),a=0;e.on("data",(function(e){e.copy(o,a),a+=e.length})).on("end",(function(){r(null,o)})).on("error",r)}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:110,once:294}],446:[function(e,t,n){const{EventEmitter:i}=e("events"),r=new Error("Stream was destroyed"),o=new Error("Premature close"),a=e("queue-tick"),s=e("fast-fifo"),c=134217727,l=1^c,u=64,p=128,d=256,f=1024,h=2048,m=4096,b=8192,v=16384,g=32768,y=768^c,x=134184959,_=1<<17,w=2<<17,k=4<<17,S=8<<17,E=16<<17,M=32<<17,A=64<<17,j=128<<17,I=256<<17,T=512<<17,C=100532223,B=133693439,R=117440511,O=131088,P=134086639,L=4210688,U=14,q=15,N=4210702,D=16809984,z=16809999,H=1179648,F=1179663,W=Symbol.asyncIterator||Symbol("asyncIterator");class V{constructor(e,{highWaterMark:t=16384,map:n=null,mapWritable:i,byteLength:r,byteLengthWritable:o}={}){this.stream=e,this.queue=new s,this.highWaterMark=t,this.buffered=0,this.error=null,this.pipeline=null,this.drains=null,this.byteLength=o||r||fe,this.map=i||n,this.afterWrite=Z.bind(this),this.afterUpdateNextTick=te.bind(this)}get ended(){return 0!=(this.stream._duplexState&M)}push(e){return null!==this.map&&(e=this.map(e)),this.buffered+=this.byteLength(e),this.queue.push(e),this.buffered<this.highWaterMark?(this.stream._duplexState|=S,!0):(this.stream._duplexState|=3145728,!1)}shift(){const e=this.queue.shift();return this.buffered-=this.byteLength(e),0===this.buffered&&(this.stream._duplexState&=133169151),e}end(e){"function"==typeof e?this.stream.once("finish",e):null!=e&&this.push(e),this.stream._duplexState=(this.stream._duplexState|T)&B}autoBatch(e,t){const n=[],i=this.stream;for(n.push(e);(i._duplexState&F)===H;)n.push(i._writableState.shift());if(0!=(i._duplexState&q))return t(null);i._writev(n,t)}update(){const e=this.stream;e._duplexState|=w;do{for(;(e._duplexState&F)===S;){const t=this.shift();e._duplexState|=33685504,e._write(t,this.afterWrite)}0==(655360&e._duplexState)&&this.updateNonPrimary()}while(!0===this.continueUpdate());e._duplexState&=133955583}updateNonPrimary(){const e=this.stream;if((72482831&e._duplexState)===T)return e._duplexState=67108863&(e._duplexState|_),void e._final(Y.bind(this));4!=(e._duplexState&U)?1==(e._duplexState&z)&&(e._duplexState=(e._duplexState|O)&l,e._open(ne.bind(this))):0==(e._duplexState&D)&&(e._duplexState|=O,e._destroy(J.bind(this)))}continueUpdate(){return 0!=(this.stream._duplexState&j)&&(this.stream._duplexState&=R,!0)}updateCallback(){(17563663&this.stream._duplexState)===k?this.update():this.updateNextTick()}updateNextTick(){0==(this.stream._duplexState&j)&&(this.stream._duplexState|=j,0==(this.stream._duplexState&w)&&a(this.afterUpdateNextTick))}}class K{constructor(e,{highWaterMark:t=16384,map:n=null,mapReadable:i,byteLength:r,byteLengthReadable:o}={}){this.stream=e,this.queue=new s,this.highWaterMark=t,this.buffered=0,this.error=null,this.pipeline=null,this.byteLength=o||r||fe,this.map=i||n,this.pipeTo=null,this.afterRead=Q.bind(this),this.afterUpdateNextTick=ee.bind(this)}get ended(){return 0!=(this.stream._duplexState&v)}pipe(e,t){if(null!==this.pipeTo)throw new Error("Can only pipe to one destination");if("function"!=typeof t&&(t=null),this.stream._duplexState|=512,this.pipeTo=e,this.pipeline=new G(this.stream,e,t),t&&this.stream.on("error",he),de(e))e._writableState.pipeline=this.pipeline,t&&e.on("error",he),e.on("finish",this.pipeline.finished.bind(this.pipeline));else{const t=this.pipeline.done.bind(this.pipeline,e),n=this.pipeline.done.bind(this.pipeline,e,null);e.on("error",t),e.on("close",n),e.on("finish",this.pipeline.finished.bind(this.pipeline))}e.on("drain",X.bind(this)),this.stream.emit("piping",e),e.emit("pipe",this.stream)}push(e){const t=this.stream;return null===e?(this.highWaterMark=0,t._duplexState=134152127&(t._duplexState|f),!1):(null!==this.map&&(e=this.map(e)),this.buffered+=this.byteLength(e),this.queue.push(e),t._duplexState=134152191&(t._duplexState|p),this.buffered<this.highWaterMark)}shift(){const e=this.queue.shift();return this.buffered-=this.byteLength(e),0===this.buffered&&(this.stream._duplexState&=134209407),e}unshift(e){const t=[null!==this.map?this.map(e):e];for(;this.buffered>0;)t.push(this.shift());for(let e=0;e<t.length-1;e++){const n=t[e];this.buffered+=this.byteLength(n),this.queue.push(n)}this.push(t[t.length-1])}read(){const e=this.stream;if((16527&e._duplexState)===p){const t=this.shift();return null!==this.pipeTo&&!1===this.pipeTo.write(t)&&(e._duplexState&=y),0!=(e._duplexState&h)&&e.emit("data",t),t}return null}drain(){const e=this.stream;for(;(16527&e._duplexState)===p&&0!=(768&e._duplexState);){const t=this.shift();null!==this.pipeTo&&!1===this.pipeTo.write(t)&&(e._duplexState&=y),0!=(e._duplexState&h)&&e.emit("data",t)}}update(){const e=this.stream;e._duplexState|=32;do{for(this.drain();this.buffered<this.highWaterMark&&0==(82975&e._duplexState);)e._duplexState|=65552,e._read(this.afterRead),this.drain();4224==(12431&e._duplexState)&&(e._dupleLine truncated
/**!
* tippy.js v6.3.7
* (c) 2017-2021 atomiks
* MIT License
*/
"use strict";Object.defineProperty(i,"__esModule",{value:!0});var n=e("@popperjs/core"),r="tippy-content",o="tippy-backdrop",a="tippy-arrow",s="tippy-svg-arrow",c={passive:!0,capture:!0},l=function(){return document.body};function u(e,t,i){if(Array.isArray(e)){var n=e[t];return null==n?Array.isArray(i)?i[t]:i:n}return e}function p(e,t){var i={}.toString.call(e);return 0===i.indexOf("[object")&&i.indexOf(t+"]")>-1}function d(e,t){return"function"==typeof e?e.apply(void 0,t):e}function f(e,t){return 0===t?e:function(n){clearTimeout(i),i=setTimeout((function(){e(n)}),t)};var i}function h(e,t){var i=Object.assign({},e);return t.forEach((function(e){delete i[e]})),i}function m(e){return[].concat(e)}function b(e,t){-1===e.indexOf(t)&&e.push(t)}function v(e){return e.split("-")[0]}function g(e){return[].slice.call(e)}function y(e){return Object.keys(e).reduce((function(t,i){return void 0!==e[i]&&(t[i]=e[i]),t}),{})}function x(){return document.createElement("div")}function _(e){return["Element","Fragment"].some((function(t){return p(e,t)}))}function w(e){return p(e,"MouseEvent")}function k(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function S(e){return _(e)?[e]:function(e){return p(e,"NodeList")}(e)?g(e):Array.isArray(e)?e:g(document.querySelectorAll(e))}function E(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function M(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function A(e){var t,i=m(e)[0];return null!=i&&null!=(t=i.ownerDocument)&&t.body?i.ownerDocument:document}function j(e,t,i){var n=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[n](t,i)}))}function I(e,t){for(var i=t;i;){var n;if(e.contains(i))return!0;i=null==i.getRootNode||null==(n=i.getRootNode())?void 0:n.host}return!1}var T={isTouch:!1},C=0;function B(){T.isTouch||(T.isTouch=!0,window.performance&&document.addEventListener("mousemove",R))}function R(){var e=performance.now();e-C<20&&(T.isTouch=!1,document.removeEventListener("mousemove",R)),C=e}function O(){var e=document.activeElement;if(k(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var P,L=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;function U(e){return[e+"() was called on a"+("destroy"===e?"n already-":" ")+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function q(e){return e.replace(/[ \t]{2,}/g," ").replace(/^[ \t]*/gm,"").trim()}function N(e){return q("\n %ctippy.js\n\n %c"+q(e)+"\n\n %c👷‍ This is a development-only message. It will be removed in production.\n ")}function D(e){return[N(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}function z(e,t){var i;e&&!P.has(t)&&(P.add(t),(i=console).warn.apply(i,D(t)))}function H(e,t){var i;e&&!P.has(t)&&(P.add(t),(i=console).error.apply(i,D(t)))}"production"!==t.env.NODE_ENV&&(P=new Set);var F={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},W=Object.assign({appendTo:l,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},F,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),V=Object.keys(W);function K(e){var t=(e.plugins||[]).reduce((function(t,i){var n,r=i.name,o=i.defaultValue;r&&(t[r]=void 0!==e[r]?e[r]:null!=(n=W[r])?n:o);return t}),{});return Object.assign({},e,t)}function $(e,t){var i=Object.assign({},t,{content:d(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(K(Object.assign({},W,{plugins:t}))):V).reduce((function(t,i){var n=(e.getAttribute("data-tippy-"+i)||"").trim();if(!n)return t;if("content"===i)t[i]=n;else try{t[i]=JSON.parse(n)}catch(e){t[i]=n}return t}),{})}(e,t.plugins));return i.aria=Object.assign({},W.aria,i.aria),i.aria={expanded:"auto"===i.aria.expanded?t.interactive:i.aria.expanded,content:"auto"===i.aria.content?t.interactive?null:"describedby":i.aria.content},i}function G(e,t){void 0===e&&(e={}),void 0===t&&(t=[]),Object.keys(e).forEach((function(e){var i,n,r=h(W,Object.keys(F)),o=(i=r,n=e,!{}.hasOwnProperty.call(i,n));o&&(o=0===t.filter((function(t){return t.name===e})).length),z(o,["`"+e+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.","\n\n","All props: https://atomiks.github.io/tippyjs/v6/all-props/\n","Plugins: https://atomiks.github.io/tippyjs/v6/pl Line truncated
"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=e("@popperjs/core"),r="tippy-content",o="tippy-backdrop",a="tippy-arrow",s="tippy-svg-arrow",c={passive:!0,capture:!0},l=function(){return document.body};function u(e,t,n){if(Array.isArray(e)){var i=e[t];return null==i?Array.isArray(n)?n[t]:n:i}return e}function p(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function d(e,t){return"function"==typeof e?e.apply(void 0,t):e}function f(e,t){return 0===t?e:function(i){clearTimeout(n),n=setTimeout((function(){e(i)}),t)};var n}function h(e,t){var n=Object.assign({},e);return t.forEach((function(e){delete n[e]})),n}function m(e){return[].concat(e)}function b(e,t){-1===e.indexOf(t)&&e.push(t)}function v(e){return e.split("-")[0]}function g(e){return[].slice.call(e)}function y(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function x(){return document.createElement("div")}function _(e){return["Element","Fragment"].some((function(t){return p(e,t)}))}function w(e){return p(e,"MouseEvent")}function k(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function S(e){return _(e)?[e]:function(e){return p(e,"NodeList")}(e)?g(e):Array.isArray(e)?e:g(document.querySelectorAll(e))}function E(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function M(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function A(e){var t,n=m(e)[0];return null!=n&&null!=(t=n.ownerDocument)&&t.body?n.ownerDocument:document}function j(e,t,n){var i=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[i](t,n)}))}function I(e,t){for(var n=t;n;){var i;if(e.contains(n))return!0;n=null==n.getRootNode||null==(i=n.getRootNode())?void 0:i.host}return!1}var T={isTouch:!1},C=0;function B(){T.isTouch||(T.isTouch=!0,window.performance&&document.addEventListener("mousemove",R))}function R(){var e=performance.now();e-C<20&&(T.isTouch=!1,document.removeEventListener("mousemove",R)),C=e}function O(){var e=document.activeElement;if(k(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var P,L=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;function U(e){return[e+"() was called on a"+("destroy"===e?"n already-":" ")+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function q(e){return e.replace(/[ \t]{2,}/g," ").replace(/^[ \t]*/gm,"").trim()}function N(e){return q("\n %ctippy.js\n\n %c"+q(e)+"\n\n %c👷‍ This is a development-only message. It will be removed in production.\n ")}function D(e){return[N(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}function z(e,t){var n;e&&!P.has(t)&&(P.add(t),(n=console).warn.apply(n,D(t)))}function H(e,t){var n;e&&!P.has(t)&&(P.add(t),(n=console).error.apply(n,D(t)))}"production"!==t.env.NODE_ENV&&(P=new Set);var F={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},W=Object.assign({appendTo:l,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},F,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),V=Object.keys(W);function K(e){var t=(e.plugins||[]).reduce((function(t,n){var i,r=n.name,o=n.defaultValue;r&&(t[r]=void 0!==e[r]?e[r]:null!=(i=W[r])?i:o);return t}),{});return Object.assign({},e,t)}function $(e,t){var n=Object.assign({},t,{content:d(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(K(Object.assign({},W,{plugins:t}))):V).reduce((function(t,n){var i=(e.getAttribute("data-tippy-"+n)||"").trim();if(!i)return t;if("content"===n)t[n]=i;else try{t[n]=JSON.parse(i)}catch(e){t[n]=i}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},W.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function G(e,t){void 0===e&&(e={}),void 0===t&&(t=[]),Object.keys(e).forEach((function(e){var n,i,r=h(W,Object.keys(F)),o=(n=r,i=e,!{}.hasOwnProperty.call(n,i));o&&(o=0===t.filter((function(t){return t.name===e})).length),z(o,["`"+e+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.","\n\n","All props: https://atomiks.github.io/tippyjs/v6/all-props/\n","Plugins: https://atomiks.github.io/tippyjs/v6/pl Line truncated
/*! torrent-discovery. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */
const n=e("debug")("torrent-discovery"),r=e("bittorrent-dht/client"),o=e("events").EventEmitter,a=e("run-parallel"),s=e("bittorrent-tracker/client"),c=e("bittorrent-lsd");t.exports=class extends o{constructor(e){if(super(),!e.peerId)throw new Error("Option `peerId` is required");if(!e.infoHash)throw new Error("Option `infoHash` is required");if(!i.browser&&!e.port)throw new Error("Option `port` is required");this.peerId="string"==typeof e.peerId?e.peerId:e.peerId.toString("hex"),this.infoHash="string"==typeof e.infoHash?e.infoHash.toLowerCase():e.infoHash.toString("hex"),this._port=e.port,this._userAgent=e.userAgent,this.destroyed=!1,this._announce=e.announce||[],this._intervalMs=e.intervalMs||9e5,this._trackerOpts=null,this._dhtAnnouncing=!1,this._dhtTimeout=!1,this._internalDHT=!1,this._onWarning=e=>{this.emit("warning",e)},this._onError=e=>{this.emit("error",e)},this._onDHTPeer=(e,t)=>{t.toString("hex")===this.infoHash&&this.emit("peer",`${e.host}:${e.port}`,"dht")},this._onTrackerPeer=e=>{this.emit("peer",e,"tracker")},this._onTrackerAnnounce=()=>{this.emit("trackerAnnounce")},this._onLSDPeer=(e,t)=>{this.emit("peer",e,"lsd")};const t=(e,t)=>{const i=new r(t);return i.on("warning",this._onWarning),i.on("error",this._onError),i.listen(e),this._internalDHT=!0,i};!1===e.tracker?this.tracker=null:e.tracker&&"object"==typeof e.tracker?(this._trackerOpts=Object.assign({},e.tracker),this.tracker=this._createTracker()):this.tracker=this._createTracker(),!1===e.dht||"function"!=typeof r?this.dht=null:e.dht&&"function"==typeof e.dht.addNode?this.dht=e.dht:e.dht&&"object"==typeof e.dht?this.dht=t(e.dhtPort,e.dht):this.dht=t(e.dhtPort),this.dht&&(this.dht.on("peer",this._onDHTPeer),this._dhtAnnounce()),!1===e.lsd||"function"!=typeof c?this.lsd=null:this.lsd=this._createLSD()}updatePort(e){e!==this._port&&(this._port=e,this.dht&&this._dhtAnnounce(),this.tracker&&(this.tracker.stop(),this.tracker.destroy((()=>{this.tracker=this._createTracker()}))))}complete(e){this.tracker&&this.tracker.complete(e)}destroy(e){if(this.destroyed)return;this.destroyed=!0,clearTimeout(this._dhtTimeout);const t=[];this.tracker&&(this.tracker.stop(),this.tracker.removeListener("warning",this._onWarning),this.tracker.removeListener("error",this._onError),this.tracker.removeListener("peer",this._onTrackerPeer),this.tracker.removeListener("update",this._onTrackerAnnounce),t.push((e=>{this.tracker.destroy(e)}))),this.dht&&this.dht.removeListener("peer",this._onDHTPeer),this._internalDHT&&(this.dht.removeListener("warning",this._onWarning),this.dht.removeListener("error",this._onError),t.push((e=>{this.dht.destroy(e)}))),this.lsd&&(this.lsd.removeListener("warning",this._onWarning),this.lsd.removeListener("error",this._onError),this.lsd.removeListener("peer",this._onLSDPeer),t.push((e=>{this.lsd.destroy(e)}))),a(t,e),this.dht=null,this.tracker=null,this.lsd=null,this._announce=null}_createTracker(){const e=Object.assign({},this._trackerOpts,{infoHash:this.infoHash,announce:this._announce,peerId:this.peerId,port:this._port,userAgent:this._userAgent}),t=new s(e);return t.on("warning",this._onWarning),t.on("error",this._onError),t.on("peer",this._onTrackerPeer),t.on("update",this._onTrackerAnnounce),t.setInterval(this._intervalMs),t.start(),t}_dhtAnnounce(){this._dhtAnnouncing||(n("dht announce"),this._dhtAnnouncing=!0,clearTimeout(this._dhtTimeout),this.dht.announce(this.infoHash,this._port,(e=>{this._dhtAnnouncing=!1,n("dht announce complete"),e&&this.emit("warning",e),this.emit("dhtAnnounce"),this.destroyed||(this._dhtTimeout=setTimeout((()=>{this._dhtAnnounce()}),this._intervalMs+Math.floor(Math.random()*this._intervalMs/5)),this._dhtTimeout.unref&&this._dhtTimeout.unref())})))}_createLSD(){const e=Object.assign({},{infoHash:this.infoHash,peerId:this.peerId,port:this._port}),t=new c(e);return t.on("warning",this._onWarning),t.on("error",this._onError),t.on("peer",this._onLSDPeer),t.start(),t}}}).call(this)}).call(this,e("_process"))},{_process:306,"bittorrent-dht/client":67,"bittorrent-lsd":67,"bittorrent-tracker/client":43,debug:148,events:180,"run-parallel":351}],450:[function(e,t,i){(function(e){(function(){
const i=e("debug")("torrent-discovery"),r=e("bittorrent-dht/client"),o=e("events").EventEmitter,a=e("run-parallel"),s=e("bittorrent-tracker/client"),c=e("bittorrent-lsd");t.exports=class extends o{constructor(e){if(super(),!e.peerId)throw new Error("Option `peerId` is required");if(!e.infoHash)throw new Error("Option `infoHash` is required");if(!n.browser&&!e.port)throw new Error("Option `port` is required");this.peerId="string"==typeof e.peerId?e.peerId:e.peerId.toString("hex"),this.infoHash="string"==typeof e.infoHash?e.infoHash.toLowerCase():e.infoHash.toString("hex"),this._port=e.port,this._userAgent=e.userAgent,this.destroyed=!1,this._announce=e.announce||[],this._intervalMs=e.intervalMs||9e5,this._trackerOpts=null,this._dhtAnnouncing=!1,this._dhtTimeout=!1,this._internalDHT=!1,this._onWarning=e=>{this.emit("warning",e)},this._onError=e=>{this.emit("error",e)},this._onDHTPeer=(e,t)=>{t.toString("hex")===this.infoHash&&this.emit("peer",`${e.host}:${e.port}`,"dht")},this._onTrackerPeer=e=>{this.emit("peer",e,"tracker")},this._onTrackerAnnounce=()=>{this.emit("trackerAnnounce")},this._onLSDPeer=(e,t)=>{this.emit("peer",e,"lsd")};const t=(e,t)=>{const n=new r(t);return n.on("warning",this._onWarning),n.on("error",this._onError),n.listen(e),this._internalDHT=!0,n};!1===e.tracker?this.tracker=null:e.tracker&&"object"==typeof e.tracker?(this._trackerOpts=Object.assign({},e.tracker),this.tracker=this._createTracker()):this.tracker=this._createTracker(),!1===e.dht||"function"!=typeof r?this.dht=null:e.dht&&"function"==typeof e.dht.addNode?this.dht=e.dht:e.dht&&"object"==typeof e.dht?this.dht=t(e.dhtPort,e.dht):this.dht=t(e.dhtPort),this.dht&&(this.dht.on("peer",this._onDHTPeer),this._dhtAnnounce()),!1===e.lsd||"function"!=typeof c?this.lsd=null:this.lsd=this._createLSD()}updatePort(e){e!==this._port&&(this._port=e,this.dht&&this._dhtAnnounce(),this.tracker&&(this.tracker.stop(),this.tracker.destroy((()=>{this.tracker=this._createTracker()}))))}complete(e){this.tracker&&this.tracker.complete(e)}destroy(e){if(this.destroyed)return;this.destroyed=!0,clearTimeout(this._dhtTimeout);const t=[];this.tracker&&(this.tracker.stop(),this.tracker.removeListener("warning",this._onWarning),this.tracker.removeListener("error",this._onError),this.tracker.removeListener("peer",this._onTrackerPeer),this.tracker.removeListener("update",this._onTrackerAnnounce),t.push((e=>{this.tracker.destroy(e)}))),this.dht&&this.dht.removeListener("peer",this._onDHTPeer),this._internalDHT&&(this.dht.removeListener("warning",this._onWarning),this.dht.removeListener("error",this._onError),t.push((e=>{this.dht.destroy(e)}))),this.lsd&&(this.lsd.removeListener("warning",this._onWarning),this.lsd.removeListener("error",this._onError),this.lsd.removeListener("peer",this._onLSDPeer),t.push((e=>{this.lsd.destroy(e)}))),a(t,e),this.dht=null,this.tracker=null,this.lsd=null,this._announce=null}_createTracker(){const e=Object.assign({},this._trackerOpts,{infoHash:this.infoHash,announce:this._announce,peerId:this.peerId,port:this._port,userAgent:this._userAgent}),t=new s(e);return t.on("warning",this._onWarning),t.on("error",this._onError),t.on("peer",this._onTrackerPeer),t.on("update",this._onTrackerAnnounce),t.setInterval(this._intervalMs),t.start(),t}_dhtAnnounce(){this._dhtAnnouncing||(i("dht announce"),this._dhtAnnouncing=!0,clearTimeout(this._dhtTimeout),this.dht.announce(this.infoHash,this._port,(e=>{this._dhtAnnouncing=!1,i("dht announce complete"),e&&this.emit("warning",e),this.emit("dhtAnnounce"),this.destroyed||(this._dhtTimeout=setTimeout((()=>{this._dhtAnnounce()}),this._intervalMs+Math.floor(Math.random()*this._intervalMs/5)),this._dhtTimeout.unref&&this._dhtTimeout.unref())})))}_createLSD(){const e=Object.assign({},{infoHash:this.infoHash,peerId:this.peerId,port:this._port}),t=new c(e);return t.on("warning",this._onWarning),t.on("error",this._onError),t.on("peer",this._onLSDPeer),t.start(),t}}}).call(this)}).call(this,e("_process"))},{_process:309,"bittorrent-dht/client":67,"bittorrent-lsd":67,"bittorrent-tracker/client":43,debug:148,events:181,"run-parallel":354}],454:[function(e,t,n){(function(e){(function(){
/*! torrent-piece. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */
const i=16384;class n{constructor(e){this.length=e,this.missing=e,this.sources=null,this._chunks=Math.ceil(e/i),this._remainder=e%i||i,this._buffered=0,this._buffer=null,this._cancellations=null,this._reservations=0,this._flushed=!1}chunkLength(e){return e===this._chunks-1?this._remainder:i}chunkLengthRemaining(e){return this.length-e*i}chunkOffset(e){return e*i}reserve(){return this.init()?this._cancellations.length?this._cancellations.pop():this._reservations<this._chunks?this._reservations++:-1:-1}reserveRemaining(){if(!this.init())return-1;if(this._cancellations.length||this._reservations<this._chunks){let e=this._reservations;for(;this._cancellations.length;)e=Math.min(e,this._cancellations.pop());return this._reservations=this._chunks,e}return-1}cancel(e){this.init()&&this._cancellations.push(e)}cancelRemaining(e){this.init()&&(this._reservations=e)}get(e){return this.init()?this._buffer[e]:null}set(e,t,n){if(!this.init())return!1;const r=t.length,o=Math.ceil(r/i);for(let r=0;r<o;r++)if(!this._buffer[e+r]){const o=r*i,a=t.slice(o,o+i);this._buffered++,this._buffer[e+r]=a,this.missing-=a.length,this.sources.includes(n)||this.sources.push(n)}return this._buffered===this._chunks}flush(){if(!this._buffer||this._chunks!==this._buffered)return null;const t=e.concat(this._buffer,this.length);return this._buffer=null,this._cancellations=null,this.sources=null,this._flushed=!0,t}init(){return!this._flushed&&(this._buffer||(this._buffer=new Array(this._chunks),this._cancellations=[],this.sources=[]),!0)}}Object.defineProperty(n,"BLOCK_LENGTH",{value:i}),t.exports=n}).call(this)}).call(this,e("buffer").Buffer)},{buffer:110}],451:[function(e,t,i){var n=e("buffer-alloc"),r=Math.pow(2,32);i.encodingLength=function(){return 8},i.encode=function(e,t,i){t||(t=n(8)),i||(i=0);var o=Math.floor(e/r),a=e-o*r;return t.writeUInt32BE(o,i),t.writeUInt32BE(a,i+4),t},i.decode=function(e,t){t||(t=0);var i=e.readUInt32BE(t),n=e.readUInt32BE(t+4);return i*r+n},i.encode.bytes=8,i.decode.bytes=8},{"buffer-alloc":112}],452:[function(e,t,i){t.exports=function(e,t){if(t>=e.length||t<0)return;var i=e.pop();if(t<e.length){var n=e[t];return e[t]=i,n}return i}},{}],453:[function(e,t,i){"use strict";var n=e("punycode");function r(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var o=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,s=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(c),u=["%","/","?",";","#"].concat(l),p=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,f=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,h={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},b={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=e("qs");function g(e,t,i){if(e&&"object"==typeof e&&e instanceof r)return e;var n=new r;return n.parse(e,t,i),n}r.prototype.parse=function(e,t,i){if("string"!=typeof e)throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var r=e.indexOf("?"),a=-1!==r&&r<e.indexOf("#")?"?":"#",c=e.split(a);c[0]=c[0].replace(/\\/g,"/");var g=e=c.join(a);if(g=g.trim(),!i&&1===e.split("#").length){var y=s.exec(g);if(y)return this.path=g,this.href=g,this.pathname=y[1],y[2]?(this.search=y[2],this.query=t?v.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var x=o.exec(g);if(x){var _=(x=x[0]).toLowerCase();this.protocol=_,g=g.substr(x.length)}if(i||x||g.match(/^\/\/[^@/]+@[^@/]+/)){var w="//"===g.substr(0,2);!w||x&&m[x]||(g=g.substr(2),this.slashes=!0)}if(!m[x]&&(w||x&&!b[x])){for(var k,S,E=-1,M=0;M<p.length;M++){-1!==(A=g.indexOf(p[M]))&&(-1===E||A<E)&&(E=A)}-1!==(S=-1===E?g.lastIndexOf("@"):g.lastIndexOf("@",E))&&(k=g.slice(0,S),g=g.slice(S+1),this.auth=decodeURIComponent(k)),E=-1;for(M=0;M<u.length;M++){var A;-1!==(A=g.indexOf(u[M]))&&(-1===E||A<E)&&(E=A)}-1===E&&(E=g.length),this.host=g.slice(0,E),g=g.slice(E),this.parseHost(),this.hostname=this.hostname||"";var j="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!j)for(var I=this.hostname.split(/\./),T=(M=0,I.length);M<T;M++){var C=I[M];if(C&&!C.match(d)){for(var B="",R=0,O=C.length;R<O;R++)C.charCodeAt(R)>127?B+="x":B+=C[R];if(!B.match(d)){var P=I.slice(0,M),L=I.slice(M+1),U=C.match(f);U&&(P.push(U[1]),L.unshift(U[2])),L.length&&(g="/"+L.join(".")+g),this.hostname=P.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),j||(this.hostname=n.toASCII(this.hostname));var q=this.port?":"+this.port:"",N=this.hostname||"";this.host=N+q,this.href+=this.host,j&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==g[0]&&(g="/"+g))}if(!h[_])for(M=0,T=l.length;M<T;M++){var D=l[M];if(-1!==g.indexOf(D)){var z=encodeURIComponent(D);z===D&&(z=escape(D)),g=g.split(D).join(z)}}var H=g.indexOf("#");-1!==H&&(this.hash=g.sLine truncated
const n=16384;class i{constructor(e){this.length=e,this.missing=e,this.sources=null,this._chunks=Math.ceil(e/n),this._remainder=e%n||n,this._buffered=0,this._buffer=null,this._cancellations=null,this._reservations=0,this._flushed=!1}chunkLength(e){return e===this._chunks-1?this._remainder:n}chunkLengthRemaining(e){return this.length-e*n}chunkOffset(e){return e*n}reserve(){return this.init()?this._cancellations.length?this._cancellations.pop():this._reservations<this._chunks?this._reservations++:-1:-1}reserveRemaining(){if(!this.init())return-1;if(this._cancellations.length||this._reservations<this._chunks){let e=this._reservations;for(;this._cancellations.length;)e=Math.min(e,this._cancellations.pop());return this._reservations=this._chunks,e}return-1}cancel(e){this.init()&&this._cancellations.push(e)}cancelRemaining(e){this.init()&&(this._reservations=e)}get(e){return this.init()?this._buffer[e]:null}set(e,t,i){if(!this.init())return!1;const r=t.length,o=Math.ceil(r/n);for(let r=0;r<o;r++)if(!this._buffer[e+r]){const o=r*n,a=t.slice(o,o+n);this._buffered++,this._buffer[e+r]=a,this.missing-=a.length,this.sources.includes(i)||this.sources.push(i)}return this._buffered===this._chunks}flush(){if(!this._buffer||this._chunks!==this._buffered)return null;const t=e.concat(this._buffer,this.length);return this._buffer=null,this._cancellations=null,this.sources=null,this._flushed=!0,t}init(){return!this._flushed&&(this._buffer||(this._buffer=new Array(this._chunks),this._cancellations=[],this.sources=[]),!0)}}Object.defineProperty(i,"BLOCK_LENGTH",{value:n}),t.exports=i}).call(this)}).call(this,e("buffer").Buffer)},{buffer:110}],455:[function(e,t,n){var i=e("buffer-alloc"),r=Math.pow(2,32);n.encodingLength=function(){return 8},n.encode=function(e,t,n){t||(t=i(8)),n||(n=0);var o=Math.floor(e/r),a=e-o*r;return t.writeUInt32BE(o,n),t.writeUInt32BE(a,n+4),t},n.decode=function(e,t){t||(t=0);var n=e.readUInt32BE(t),i=e.readUInt32BE(t+4);return n*r+i},n.encode.bytes=8,n.decode.bytes=8},{"buffer-alloc":112}],456:[function(e,t,n){t.exports=function(e,t){if(t>=e.length||t<0)return;var n=e.pop();if(t<e.length){var i=e[t];return e[t]=n,i}return n}},{}],457:[function(e,t,n){"use strict";var i=e("punycode");function r(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var o=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,s=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(c),u=["%","/","?",";","#"].concat(l),p=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,f=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,h={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},b={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=e("qs");function g(e,t,n){if(e&&"object"==typeof e&&e instanceof r)return e;var i=new r;return i.parse(e,t,n),i}r.prototype.parse=function(e,t,n){if("string"!=typeof e)throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var r=e.indexOf("?"),a=-1!==r&&r<e.indexOf("#")?"?":"#",c=e.split(a);c[0]=c[0].replace(/\\/g,"/");var g=e=c.join(a);if(g=g.trim(),!n&&1===e.split("#").length){var y=s.exec(g);if(y)return this.path=g,this.href=g,this.pathname=y[1],y[2]?(this.search=y[2],this.query=t?v.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var x=o.exec(g);if(x){var _=(x=x[0]).toLowerCase();this.protocol=_,g=g.substr(x.length)}if(n||x||g.match(/^\/\/[^@/]+@[^@/]+/)){var w="//"===g.substr(0,2);!w||x&&m[x]||(g=g.substr(2),this.slashes=!0)}if(!m[x]&&(w||x&&!b[x])){for(var k,S,E=-1,M=0;M<p.length;M++){-1!==(A=g.indexOf(p[M]))&&(-1===E||A<E)&&(E=A)}-1!==(S=-1===E?g.lastIndexOf("@"):g.lastIndexOf("@",E))&&(k=g.slice(0,S),g=g.slice(S+1),this.auth=decodeURIComponent(k)),E=-1;for(M=0;M<u.length;M++){var A;-1!==(A=g.indexOf(u[M]))&&(-1===E||A<E)&&(E=A)}-1===E&&(E=g.length),this.host=g.slice(0,E),g=g.slice(E),this.parseHost(),this.hostname=this.hostname||"";var j="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!j)for(var I=this.hostname.split(/\./),T=(M=0,I.length);M<T;M++){var C=I[M];if(C&&!C.match(d)){for(var B="",R=0,O=C.length;R<O;R++)C.charCodeAt(R)>127?B+="x":B+=C[R];if(!B.match(d)){var P=I.slice(0,M),L=I.slice(M+1),U=C.match(f);U&&(P.push(U[1]),L.unshift(U[2])),L.length&&(g="/"+L.join(".")+g),this.hostname=P.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),j||(this.hostname=i.toASCII(this.hostname));var q=this.port?":"+this.port:"",N=this.hostname||"";this.host=N+q,this.href+=this.host,j&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==g[0]&&(g="/"+g))}if(!h[_])for(M=0,T=l.length;M<T;M++){var D=l[M];if(-1!==g.indexOf(D)){var z=encodeURIComponent(D);z===D&&(z=escape(D)),g=g.split(D).join(z)}}var H=g.indexOf("#");-1!==H&&(this.hash=g.sLine truncated
/*! ut_metadata. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */
const{EventEmitter:n}=e("events"),r=e("bencode"),o=e("bitfield").default,a=e("debug")("ut_metadata"),s=e("simple-sha1"),c=16384;t.exports=e=>{class t extends n{constructor(t){super(),this._wire=t,this._fetching=!1,this._metadataComplete=!1,this._metadataSize=null,this._remainingRejects=null,this._bitfield=new o(0,{grow:1e3}),i.isBuffer(e)&&this.setMetadata(e)}onHandshake(e,t,i){this._infoHash=e}onExtendedHandshake(e){return e.m&&e.m.ut_metadata?e.metadata_size?"number"!=typeof e.metadata_size||1e7<e.metadata_size||e.metadata_size<=0?this.emit("warning",new Error("Peer gave invalid metadata size")):(this._metadataSize=e.metadata_size,this._numPieces=Math.ceil(this._metadataSize/c),this._remainingRejects=2*this._numPieces,void this._requestPieces()):this.emit("warning",new Error("Peer does not have metadata")):this.emit("warning",new Error("Peer does not support ut_metadata"))}onMessage(e){let t,i;try{const n=e.toString(),o=n.indexOf("ee")+2;t=r.decode(n.substring(0,o)),i=e.slice(o)}catch(e){return}switch(t.msg_type){case 0:this._onRequest(t.piece);break;case 1:this._onData(t.piece,i,t.total_size);break;case 2:this._onReject(t.piece)}}fetch(){this._metadataComplete||(this._fetching=!0,this._metadataSize&&this._requestPieces())}cancel(){this._fetching=!1}setMetadata(e){if(this._metadataComplete)return!0;a("set metadata");try{const t=r.decode(e).info;t&&(e=r.encode(t))}catch(e){}return(!this._infoHash||this._infoHash===s.sync(e))&&(this.cancel(),this.metadata=e,this._metadataComplete=!0,this._metadataSize=this.metadata.length,this._wire.extendedHandshake.metadata_size=this._metadataSize,this.emit("metadata",r.encode({info:r.decode(this.metadata)})),!0)}_send(e,t){let n=r.encode(e);i.isBuffer(t)&&(n=i.concat([n,t])),this._wire.extended("ut_metadata",n)}_request(e){this._send({msg_type:0,piece:e})}_data(e,t,i){const n={msg_type:1,piece:e};"number"==typeof i&&(n.total_size=i),this._send(n,t)}_reject(e){this._send({msg_type:2,piece:e})}_onRequest(e){if(!this._metadataComplete)return void this._reject(e);const t=e*c;let i=t+c;i>this._metadataSize&&(i=this._metadataSize);const n=this.metadata.slice(t,i);this._data(e,n,this._metadataSize)}_onData(e,t,i){t.length>c||!this._fetching||(t.copy(this.metadata,e*c),this._bitfield.set(e),this._checkDone())}_onReject(e){this._remainingRejects>0&&this._fetching?(this._request(e),this._remainingRejects-=1):this.emit("warning",new Error('Peer sent "reject" too much'))}_requestPieces(){if(this._fetching){this.metadata=i.alloc(this._metadataSize);for(let e=0;e<this._numPieces;e++)this._request(e)}}_checkDone(){let e=!0;for(let t=0;t<this._numPieces;t++)if(!this._bitfield.get(t)){e=!1;break}if(!e)return;this.setMetadata(this.metadata)||this._failedMetadata()}_failedMetadata(){this._bitfield=new o(0,{grow:1e3}),this._remainingRejects-=this._numPieces,this._remainingRejects>0?this._requestPieces():this.emit("warning",new Error("Peer sent invalid metadata"))}}return t.prototype.name="ut_metadata",t}}).call(this)}).call(this,e("buffer").Buffer)},{bencode:22,bitfield:26,buffer:110,debug:148,events:180,"simple-sha1":382}],455:[function(e,t,i){(function(e){(function(){function i(t){try{if(!e.localStorage)return!1}catch(e){return!1}var i=e.localStorage[t];return null!=i&&"true"===String(i).toLowerCase()}t.exports=function(e,t){if(i("noDeprecation"))return e;var n=!1;return function(){if(!n){if(i("throwDeprecation"))throw new Error(t);i("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],456:[function(e,t,i){(function(i){(function(){const n=e("binary-search"),r=e("events"),o=e("mp4-stream"),a=e("mp4-box-encoding"),s=e("range-slice-stream");class c{constructor(e,t){this._entries=e,this._countName=t||"count",this._index=0,this._offset=0,this.value=this._entries[0]}inc(){this._offset++,this._offset>=this._entries[this._index][this._countName]&&(this._index++,this._offset=0),this.value=this._entries[this._index]}}const l=1;t.exports=class extends r{constructor(e){super(),this._tracks=[],this._file=e,this._decoder=null,this._findMoov(0)}_findMoov(e){this._decoder&&this._decoder.destroy();let t=0;this._decoder=o.decode();const i=this._file.createReadStream({start:e});i.pipe(this._decoder);const n=r=>{"moov"===r.type?(this._decoder.removeListener("box",n),this._decoder.decode((e=>{i.destroy();try{this._processMoov(e)}catch(e){e.message=`Cannot parse mp4 file: ${e.message}`,this.emit("error",e)}}))):r.length<4096?(t+=r.length,this._decoder.ignore()):(this._decoder.removeListener("box",n),t+=r.length,i.destroy(),this._decoder.destroy(),this._findMoov(e+t))};this._decoder.on("box",n)}_processMoov(e){const t=e.traks;this._tracks=[],this._hasVideo=!1,this._hasAudio=!1;for(let i=0;i<t.length;i++){const r=t[i],o=r.mdia.minf.stbl,a=o.stsd.entries[0],s=r.mdia.hdlr.handlerType;let l,u;if("vide"===s&&"avc1"===a.type){if(this._hasVideo)contiLine truncated
const{EventEmitter:i}=e("events"),r=e("bencode"),o=e("bitfield").default,a=e("debug")("ut_metadata"),s=e("simple-sha1"),c=16384;t.exports=e=>{class t extends i{constructor(t){super(),this._wire=t,this._fetching=!1,this._metadataComplete=!1,this._metadataSize=null,this._remainingRejects=null,this._bitfield=new o(0,{grow:1e3}),n.isBuffer(e)&&this.setMetadata(e)}onHandshake(e,t,n){this._infoHash=e}onExtendedHandshake(e){return e.m&&e.m.ut_metadata?e.metadata_size?"number"!=typeof e.metadata_size||1e7<e.metadata_size||e.metadata_size<=0?this.emit("warning",new Error("Peer gave invalid metadata size")):(this._metadataSize=e.metadata_size,this._numPieces=Math.ceil(this._metadataSize/c),this._remainingRejects=2*this._numPieces,void this._requestPieces()):this.emit("warning",new Error("Peer does not have metadata")):this.emit("warning",new Error("Peer does not support ut_metadata"))}onMessage(e){let t,n;try{const i=e.toString(),o=i.indexOf("ee")+2;t=r.decode(i.substring(0,o)),n=e.slice(o)}catch(e){return}switch(t.msg_type){case 0:this._onRequest(t.piece);break;case 1:this._onData(t.piece,n,t.total_size);break;case 2:this._onReject(t.piece)}}fetch(){this._metadataComplete||(this._fetching=!0,this._metadataSize&&this._requestPieces())}cancel(){this._fetching=!1}setMetadata(e){if(this._metadataComplete)return!0;a("set metadata");try{const t=r.decode(e).info;t&&(e=r.encode(t))}catch(e){}return(!this._infoHash||this._infoHash===s.sync(e))&&(this.cancel(),this.metadata=e,this._metadataComplete=!0,this._metadataSize=this.metadata.length,this._wire.extendedHandshake.metadata_size=this._metadataSize,this.emit("metadata",r.encode({info:r.decode(this.metadata)})),!0)}_send(e,t){let i=r.encode(e);n.isBuffer(t)&&(i=n.concat([i,t])),this._wire.extended("ut_metadata",i)}_request(e){this._send({msg_type:0,piece:e})}_data(e,t,n){const i={msg_type:1,piece:e};"number"==typeof n&&(i.total_size=n),this._send(i,t)}_reject(e){this._send({msg_type:2,piece:e})}_onRequest(e){if(!this._metadataComplete)return void this._reject(e);const t=e*c;let n=t+c;n>this._metadataSize&&(n=this._metadataSize);const i=this.metadata.slice(t,n);this._data(e,i,this._metadataSize)}_onData(e,t,n){t.length>c||!this._fetching||(t.copy(this.metadata,e*c),this._bitfield.set(e),this._checkDone())}_onReject(e){this._remainingRejects>0&&this._fetching?(this._request(e),this._remainingRejects-=1):this.emit("warning",new Error('Peer sent "reject" too much'))}_requestPieces(){if(this._fetching){this.metadata=n.alloc(this._metadataSize);for(let e=0;e<this._numPieces;e++)this._request(e)}}_checkDone(){let e=!0;for(let t=0;t<this._numPieces;t++)if(!this._bitfield.get(t)){e=!1;break}if(!e)return;this.setMetadata(this.metadata)||this._failedMetadata()}_failedMetadata(){this._bitfield=new o(0,{grow:1e3}),this._remainingRejects-=this._numPieces,this._remainingRejects>0?this._requestPieces():this.emit("warning",new Error("Peer sent invalid metadata"))}}return t.prototype.name="ut_metadata",t}}).call(this)}).call(this,e("buffer").Buffer)},{bencode:22,bitfield:26,buffer:110,debug:148,events:181,"simple-sha1":386}],459:[function(e,t,n){(function(e){(function(){function n(t){try{if(!e.localStorage)return!1}catch(e){return!1}var n=e.localStorage[t];return null!=n&&"true"===String(n).toLowerCase()}t.exports=function(e,t){if(n("noDeprecation"))return e;var i=!1;return function(){if(!i){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),i=!0}return e.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],460:[function(e,t,n){(function(n){(function(){const i=e("binary-search"),r=e("events"),o=e("mp4-stream"),a=e("mp4-box-encoding"),s=e("range-slice-stream");class c{constructor(e,t){this._entries=e,this._countName=t||"count",this._index=0,this._offset=0,this.value=this._entries[0]}inc(){this._offset++,this._offset>=this._entries[this._index][this._countName]&&(this._index++,this._offset=0),this.value=this._entries[this._index]}}const l=1;t.exports=class extends r{constructor(e){super(),this._tracks=[],this._file=e,this._decoder=null,this._findMoov(0)}_findMoov(e){this._decoder&&this._decoder.destroy();let t=0;this._decoder=o.decode();const n=this._file.createReadStream({start:e});n.pipe(this._decoder);const i=r=>{"moov"===r.type?(this._decoder.removeListener("box",i),this._decoder.decode((e=>{n.destroy();try{this._processMoov(e)}catch(e){e.message=`Cannot parse mp4 file: ${e.message}`,this.emit("error",e)}}))):r.length<4096?(t+=r.length,this._decoder.ignore()):(this._decoder.removeListener("box",i),t+=r.length,n.destroy(),this._decoder.destroy(),this._findMoov(e+t))};this._decoder.on("box",i)}_processMoov(e){const t=e.traks;this._tracks=[],this._hasVideo=!1,this._hasAudio=!1;for(let n=0;n<t.length;n++){const r=t[n],o=r.mdia.minf.stbl,a=o.stsd.entries[0],s=r.mdia.hdlr.handlerType;let l,u;if("vide"===s&&"avc1"===a.type){if(this._hasVideo)contiLine truncated
/*! webtorrent. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */
const n=e("events"),r=e("path"),o=e("simple-concat"),a=e("create-torrent"),s=e("debug"),c=e("bittorrent-dht/client"),l=e("load-ip-set"),u=e("run-parallel"),p=e("parse-torrent"),d=e("simple-peer"),f=e("queue-microtask"),h=e("randombytes"),m=e("simple-sha1"),b=e("throughput"),{ThrottleGroup:v}=e("speed-limiter"),g=e("./lib/conn-pool.js"),y=e("./lib/torrent.js"),{version:x}=e("./package.json"),_=s("webtorrent"),w=x.replace(/\d*./g,(e=>("0"+e%100).slice(-2))).slice(0,4),k=`-WW${w}-`;class S extends n{constructor(t={}){super(),"string"==typeof t.peerId?this.peerId=t.peerId:i.isBuffer(t.peerId)?this.peerId=t.peerId.toString("hex"):this.peerId=i.from(k+h(9).toString("base64")).toString("hex"),this.peerIdBuffer=i.from(this.peerId,"hex"),"string"==typeof t.nodeId?this.nodeId=t.nodeId:i.isBuffer(t.nodeId)?this.nodeId=t.nodeId.toString("hex"):this.nodeId=h(20).toString("hex"),this.nodeIdBuffer=i.from(this.nodeId,"hex"),this._debugId=this.peerId.toString("hex").substring(0,7),this.destroyed=!1,this.listening=!1,this.torrentPort=t.torrentPort||0,this.dhtPort=t.dhtPort||0,this.tracker=void 0!==t.tracker?t.tracker:{},this.lsd=!1!==t.lsd,this.torrents=[],this.maxConns=Number(t.maxConns)||55,this.utp=S.UTP_SUPPORT&&!1!==t.utp,this._downloadLimit=Math.max("number"==typeof t.downloadLimit?t.downloadLimit:-1,-1),this._uploadLimit=Math.max("number"==typeof t.uploadLimit?t.uploadLimit:-1,-1),this.serviceWorker=null,this.workerKeepAliveInterval=null,this.workerPortCount=0,!0===t.secure&&e("./lib/peer").enableSecure(),this._debug("new webtorrent (peerId %s, nodeId %s, port %s)",this.peerId,this.nodeId,this.torrentPort),this.throttleGroups={down:new v({rate:Math.max(this._downloadLimit,0),enabled:this._downloadLimit>=0}),up:new v({rate:Math.max(this._uploadLimit,0),enabled:this._uploadLimit>=0})},this.tracker&&("object"!=typeof this.tracker&&(this.tracker={}),globalThis.WRTC&&!this.tracker.wrtc&&(this.tracker.wrtc=globalThis.WRTC)),"function"==typeof g?this._connPool=new g(this):f((()=>{this._onListening()})),this._downloadSpeed=b(),this._uploadSpeed=b(),!1!==t.dht&&"function"==typeof c?(this.dht=new c(Object.assign({},{nodeId:this.nodeId},t.dht)),this.dht.once("error",(e=>{this._destroy(e)})),this.dht.once("listening",(()=>{const e=this.dht.address();e&&(this.dhtPort=e.port)})),this.dht.setMaxListeners(0),this.dht.listen(this.dhtPort)):this.dht=!1,this.enableWebSeeds=!1!==t.webSeeds;const n=()=>{this.destroyed||(this.ready=!0,this.emit("ready"))};"function"==typeof l&&null!=t.blocklist?l(t.blocklist,{headers:{"user-agent":`WebTorrent/${x} (https://webtorrent.io)`}},((e,t)=>{if(e)return console.error(`Failed to load blocklist: ${e.message}`);this.blocked=t,n()})):f(n)}loadWorker(e,t=(()=>{})){if(!(e instanceof ServiceWorker))throw new Error("Invalid worker registration");if("activated"!==e.state)throw new Error("Worker isn't activated");this.serviceWorker=e,navigator.serviceWorker.addEventListener("message",(e=>{const{data:t}=e;if(!t.type||"webtorrent"===!t.type||!t.url)return null;let[i,...n]=t.url.slice(t.url.indexOf(t.scope+"webtorrent/")+11+t.scope.length).split("/");if(n=decodeURI(n.join("/")),!i||!n)return null;const[r]=e.ports,o=this.get(i)&&this.get(i).files.find((e=>e.path===n));if(!o)return null;const[a,s,c]=o._serve(t),l=s&&s[Symbol.asyncIterator](),u=()=>{r.onmessage=null,s&&s.destroy(),c&&c.destroy(),this.workerPortCount--,this.workerPortCount||(clearInterval(this.workerKeepAliveInterval),this.workerKeepAliveInterval=null)};r.onmessage=async e=>{if(e.data){let e;try{e=(await l.next()).value}catch(e){}r.postMessage(e),e||u(),this.workerKeepAliveInterval||(this.workerKeepAliveInterval=setInterval((()=>fetch(`${this.serviceWorker.scriptURL.slice(0,this.serviceWorker.scriptURL.lastIndexOf("/")+1).slice(window.location.origin.length)}webtorrent/keepalive/`)),2e4))}else u()},this.workerPortCount++,r.postMessage(a)})),fetch(`${this.serviceWorker.scriptURL.slice(0,this.serviceWorker.scriptURL.lastIndexOf("/")+1).slice(window.location.origin.length)}webtorrent/cancel/`).then((e=>{e.body.cancel()})),t(null,this.serviceWorker)}get downloadSpeed(){return this._downloadSpeed()}get uploadSpeed(){return this._uploadSpeed()}get progress(){const e=this.torrents.filter((e=>1!==e.progress));return e.reduce(((e,t)=>e+t.downloaded),0)/(e.reduce(((e,t)=>e+(t.length||0)),0)||1)}get ratio(){return this.torrents.reduce(((e,t)=>e+t.uploaded),0)/(this.torrents.reduce(((e,t)=>e+t.received),0)||1)}get(e){if(e instanceof y){if(this.torrents.includes(e))return e}else{let t;try{t=p(e)}catch(e){}if(!t)return null;if(!t.infoHash)throw new Error("Invalid torrent identifier");for(const e of this.torrents)if(e.infoHash===t.infoHash)return e}return null}add(e,t={},i=(()=>{})){if(this.destroyed)throw new Error("client is destroyed");"function"==typeof t&&([t,i]=[{},t]);const n=()=>{if(!this.destroyed)for(const e of this.torrents)if(e.infoHash===o.infoHash&&e!==o)return o._destroy(new Error(`Cannot add duplicate torrent ${o.infoHash}`)),void i(e)},r=()=>{thLine truncated
const i=e("events"),r=e("path"),o=e("simple-concat"),a=e("create-torrent"),s=e("debug"),c=e("bittorrent-dht/client"),l=e("load-ip-set"),u=e("run-parallel"),p=e("parse-torrent"),d=e("simple-peer"),f=e("queue-microtask"),h=e("randombytes"),m=e("simple-sha1"),b=e("throughput"),{ThrottleGroup:v}=e("speed-limiter"),g=e("./lib/conn-pool.js"),y=e("./lib/torrent.js"),{version:x}=e("./package.json"),_=s("webtorrent"),w=x.replace(/\d*./g,(e=>("0"+e%100).slice(-2))).slice(0,4),k=`-WW${w}-`;class S extends i{constructor(t={}){super(),"string"==typeof t.peerId?this.peerId=t.peerId:n.isBuffer(t.peerId)?this.peerId=t.peerId.toString("hex"):this.peerId=n.from(k+h(9).toString("base64")).toString("hex"),this.peerIdBuffer=n.from(this.peerId,"hex"),"string"==typeof t.nodeId?this.nodeId=t.nodeId:n.isBuffer(t.nodeId)?this.nodeId=t.nodeId.toString("hex"):this.nodeId=h(20).toString("hex"),this.nodeIdBuffer=n.from(this.nodeId,"hex"),this._debugId=this.peerId.toString("hex").substring(0,7),this.destroyed=!1,this.listening=!1,this.torrentPort=t.torrentPort||0,this.dhtPort=t.dhtPort||0,this.tracker=void 0!==t.tracker?t.tracker:{},this.lsd=!1!==t.lsd,this.torrents=[],this.maxConns=Number(t.maxConns)||55,this.utp=S.UTP_SUPPORT&&!1!==t.utp,this._downloadLimit=Math.max("number"==typeof t.downloadLimit?t.downloadLimit:-1,-1),this._uploadLimit=Math.max("number"==typeof t.uploadLimit?t.uploadLimit:-1,-1),this.serviceWorker=null,this.workerKeepAliveInterval=null,this.workerPortCount=0,!0===t.secure&&e("./lib/peer").enableSecure(),this._debug("new webtorrent (peerId %s, nodeId %s, port %s)",this.peerId,this.nodeId,this.torrentPort),this.throttleGroups={down:new v({rate:Math.max(this._downloadLimit,0),enabled:this._downloadLimit>=0}),up:new v({rate:Math.max(this._uploadLimit,0),enabled:this._uploadLimit>=0})},this.tracker&&("object"!=typeof this.tracker&&(this.tracker={}),globalThis.WRTC&&!this.tracker.wrtc&&(this.tracker.wrtc=globalThis.WRTC)),"function"==typeof g?this._connPool=new g(this):f((()=>{this._onListening()})),this._downloadSpeed=b(),this._uploadSpeed=b(),!1!==t.dht&&"function"==typeof c?(this.dht=new c(Object.assign({},{nodeId:this.nodeId},t.dht)),this.dht.once("error",(e=>{this._destroy(e)})),this.dht.once("listening",(()=>{const e=this.dht.address();e&&(this.dhtPort=e.port)})),this.dht.setMaxListeners(0),this.dht.listen(this.dhtPort)):this.dht=!1,this.enableWebSeeds=!1!==t.webSeeds;const i=()=>{this.destroyed||(this.ready=!0,this.emit("ready"))};"function"==typeof l&&null!=t.blocklist?l(t.blocklist,{headers:{"user-agent":`WebTorrent/${x} (https://webtorrent.io)`}},((e,t)=>{if(e)return console.error(`Failed to load blocklist: ${e.message}`);this.blocked=t,i()})):f(i)}loadWorker(e,t=(()=>{})){if(!(e instanceof ServiceWorker))throw new Error("Invalid worker registration");if("activated"!==e.state)throw new Error("Worker isn't activated");this.serviceWorker=e,navigator.serviceWorker.addEventListener("message",(e=>{const{data:t}=e;if(!t.type||"webtorrent"===!t.type||!t.url)return null;let[n,...i]=t.url.slice(t.url.indexOf(t.scope+"webtorrent/")+11+t.scope.length).split("/");if(i=decodeURI(i.join("/")),!n||!i)return null;const[r]=e.ports,o=this.get(n)&&this.get(n).files.find((e=>e.path===i));if(!o)return null;const[a,s,c]=o._serve(t),l=s&&s[Symbol.asyncIterator](),u=()=>{r.onmessage=null,s&&s.destroy(),c&&c.destroy(),this.workerPortCount--,this.workerPortCount||(clearInterval(this.workerKeepAliveInterval),this.workerKeepAliveInterval=null)};r.onmessage=async e=>{if(e.data){let e;try{e=(await l.next()).value}catch(e){}r.postMessage(e),e||u(),this.workerKeepAliveInterval||(this.workerKeepAliveInterval=setInterval((()=>fetch(`${this.serviceWorker.scriptURL.slice(0,this.serviceWorker.scriptURL.lastIndexOf("/")+1).slice(window.location.origin.length)}webtorrent/keepalive/`)),2e4))}else u()},this.workerPortCount++,r.postMessage(a)})),fetch(`${this.serviceWorker.scriptURL.slice(0,this.serviceWorker.scriptURL.lastIndexOf("/")+1).slice(window.location.origin.length)}webtorrent/cancel/`).then((e=>{e.body.cancel()})),t(null,this.serviceWorker)}get downloadSpeed(){return this._downloadSpeed()}get uploadSpeed(){return this._uploadSpeed()}get progress(){const e=this.torrents.filter((e=>1!==e.progress));return e.reduce(((e,t)=>e+t.downloaded),0)/(e.reduce(((e,t)=>e+(t.length||0)),0)||1)}get ratio(){return this.torrents.reduce(((e,t)=>e+t.uploaded),0)/(this.torrents.reduce(((e,t)=>e+t.received),0)||1)}get(e){if(e instanceof y){if(this.torrents.includes(e))return e}else{let t;try{t=p(e)}catch(e){}if(!t)return null;if(!t.infoHash)throw new Error("Invalid torrent identifier");for(const e of this.torrents)if(e.infoHash===t.infoHash)return e}return null}add(e,t={},n=(()=>{})){if(this.destroyed)throw new Error("client is destroyed");"function"==typeof t&&([t,n]=[{},t]);const i=()=>{if(!this.destroyed)for(const e of this.torrents)if(e.infoHash===o.infoHash&&e!==o)return o._destroy(new Error(`Cannot add duplicate torrent ${o.infoHash}`)),void n(e)},r=()=>{thLine truncated
+1 -1
View File
@@ -6,7 +6,7 @@
"dependencies": {
"browserify": "^17.0.0",
"bytes": "^3.1.2",
"clipboard": "^2.0.10",
"clipboard": "^2.0.11",
"magnet-uri": "^6.2.0",
"mime-types": "^2.1.35",
"parse-torrent": "^9.1.4",